From 2e2751ad1bea26205597e6f73a3bbdd024d81633 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Thu, 23 Jul 2020 18:04:11 -0400 Subject: [PATCH] Add experimental pkg build process for creating portable binaries for debian --- .gitignore | 4 +++- bin/Readme.md | 1 + index.js | 8 ++++---- package.json | 21 ++++++++++++++++++++- 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 bin/Readme.md diff --git a/.gitignore b/.gitignore index c240c3e..3f68312 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ run_dev.sh state */.DS_Store .DS_Store -*.tsbuildinfo \ No newline at end of file +*.tsbuildinfo +bin/* +!bin/*.md \ No newline at end of file diff --git a/bin/Readme.md b/bin/Readme.md new file mode 100644 index 0000000..66e3ab1 --- /dev/null +++ b/bin/Readme.md @@ -0,0 +1 @@ +# experimental build \ No newline at end of file diff --git a/index.js b/index.js index 08bdf8d..90d527d 100644 --- a/index.js +++ b/index.js @@ -1,14 +1,14 @@ 'use strict' const restify = require('restify') -const log = require('./lib/log')('main') +const log = require('./lib/log/index.js')('main') const { readFile } = require('fs-extra') const { exec } = require('child_process') -const BLE = require('./lib/ble') -const Intval = require('./lib/intval') +const BLE = require('./lib/ble/index.js') +const Intval = require('./lib/intval/index.js') const intval = new Intval() -const Sequence = require('./lib/sequence') +const Sequence = require('./lib/sequence/index.js') const sequence = new Sequence(intval) const PACKAGE = require('./package.json') diff --git a/package.json b/package.json index fb0a6e2..b5f1e1e 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "version": "", "postversion": "git push && git push --tags", "u": "npm run git -- -m \"update\"", - "git": "npm version patch --force" + "git": "npm version patch --force", + "pkg": "pkg . --output ./bin/intval3" }, "repository": { "type": "git", @@ -52,5 +53,23 @@ "pkg": "^4.4.0", "qunit": "^2.9.3", "typescript": "^3.6.4" + }, + "bin": "index.js", + "pkg": { + "scripts": [ + "./lib/ble/index.js", + "./lib/db/index.js", + "./lib/delay/index.js", + "./lib/intval/index.js", + "./lib/log/index.js", + "./lib/mscript/index.js", + "./lib/onoff/index.js", + "./lib/sequence/index.js", + "./lib/wifi/index.js" + ], + "targets": [ + "node10" + ], + "out-file": "./bin/intval3" } }