Build and version the package json files on each npm run build

This commit is contained in:
mmcwilliams 2019-03-22 19:52:21 -04:00
parent 283085cb8d
commit f09ada2cd2
6 changed files with 1393 additions and 170 deletions

View File

@ -1,165 +1,152 @@
{ {
"version" : "2.0.0", "version": "1.3.2",
"ext_port" : 1111, "ext_port": 1111,
"profiles" : { "profiles": {
"mcopy" : { "mcopy": {
"label" : "Default mcopy profile", "label": "Default mcopy profile",
"cam" : { "cam": {
"time" : 850, "time": 850,
"delay" : 50, "delay": 50,
"momentary" : 0 "momentary": 0
}, },
"proj" : { "proj": {
"time" : 1400, "time": 1400,
"delay" : 50, "delay": 50,
"momentary" : 0 "momentary": 0
}, },
"black" : { "black": {
"before" : 0, "before": 0,
"after" : 0 "after": 0
} }
}, },
"jk103" : { "jk103": {
"label" : "JK103", "label": "JK103",
"cam" : { "cam": {
"time" : 600, "time": 600,
"delay" : 50, "delay": 50,
"momentary" : 240 "momentary": 240
}, },
"proj" : { "proj": {
"time" : 950, "time": 950,
"delay" : 50, "delay": 50,
"momentary" : 240 "momentary": 240
}, },
"black" : { "black": {
"before" : 0, "before": 0,
"after" : 0 "after": 0
}, },
"light" : false "light": false
}, },
"jk_original" : { "jk_original": {
"label" : "JK45 profile", "label": "JK45 profile",
"cam" : { "cam": {
"time" : 750, "time": 750,
"delay" : 50, "delay": 50,
"momentary" : 300 "momentary": 300
}, },
"proj" : { "proj": {
"time" : 1300, "time": 1300,
"delay" : 50, "delay": 50,
"momentary" : 300 "momentary": 300
}, },
"black" : { "black": {
"before" : 250, "before": 250,
"after" : 250 "after": 250
} }
}, },
"intval3" : { "intval3": {
"label" : "INTVAL3", "label": "INTVAL3",
"cam" : { "cam": {
"time" : 630, "time": 630,
"delay" : 50, "delay": 50,
"momentary" : 0 "momentary": 0
} }
}, },
"jk_mono" : { "jk_mono": {
"label" : "MONO's JK", "label": "MONO's JK",
"cam" : { "cam": {
"time" : 750, "time": 750,
"delay" : 50, "delay": 50,
"momentary" : 300 "momentary": 300
}, },
"proj" : { "proj": {
"time" : 1300, "time": 1300,
"delay" : 50, "delay": 50,
"momentary" : 300 "momentary": 300
}, },
"light" : false, "light": false,
"projector_second" : true "projector_second": true
} }
}, },
"cmd" : { "cmd": {
"camera_forward" : "CF", "camera_forward": "CF",
"camera_backward" : "CB", "camera_backward": "CB",
"projector_forward": "PF",
"projector_forward" : "PF", "projector_backward": "PB",
"projector_backward" : "PB", "black_forward": "BF",
"black_backward": "BB",
"black_forward" : "BF", "camera_second_forward": "C2F",
"black_backward" : "BB", "camera_second_backward": "C2B",
"cameras_forward": "CCB",
"camera_second_forward" : "C2F", "camera_forward_camera_second_backward": "CFCB",
"camera_second_backward" : "C2B", "camera_backward_camera_second_forward": "CBCF",
"projector_second_forward": "P2F",
"cameras_forward" : "CCF", "projector_second_backward": "P2B",
"cameras_forward" : "CCB", "projectors_forward": "PPF",
"projectors_backward": "PPB",
"camera_forward_camera_second_backward" : "CFCB", "projector_forward_projector_second_backward": "PFPB",
"camera_backward_camera_second_forward" : "CBCF", "projector_backward_projector_second_forward": "PBPF"
"projector_second_forward" : "P2F",
"projector_second_backward" : "P2B",
"projectors_forward" : "PPF",
"projectors_backward" : "PPB",
"projector_forward_projector_second_backward" : "PFPB",
"projector_backward_projector_second_forward" : "PBPF"
}, },
"arduino" : { "arduino": {
"baud" : 57600, "baud": 57600,
"board" : "uno", "board": "uno",
"serialDelay" : 20, "serialDelay": 20,
"sequenceDelay" : 100, "sequenceDelay": 100,
"cam" : { "cam": {
"time" : 850, "time": 850,
"delay" : 50, "delay": 50,
"momentary" : 300 "momentary": 300
}, },
"proj" : { "proj": {
"time" : 1300, "time": 1300,
"delay" : 50, "delay": 50,
"momentary" : 300 "momentary": 300
}, },
"black" : { "black": {
"before" : 250, "before": 250,
"after" : 250 "after": 250
}, },
"cmd" : { "cmd": {
"debug" : "d", "debug": "d",
"connect": "i", "connect": "i",
"light" : "l", "light": "l",
"camera" : "c", "camera": "c",
"projector" : "p", "projector": "p",
"black" : "b", "black": "b",
"camera_forward" : "e", "camera_forward": "e",
"camera_backward" : "f", "camera_backward": "f",
"projector_forward" : "g", "projector_forward": "g",
"projector_backward" : "h", "projector_backward": "h",
"projector_identifier" : "j", "projector_identifier": "j",
"camera_identifier" : "k", "camera_identifier": "k",
"mcopy_identifier" : "m", "mcopy_identifier": "m",
"camera_timed" : "n", "camera_timed": "n",
"projector_identifier" : "j", "light_identifier": "o",
"camera_identifier" : "k", "projector_light_identifier": "q",
"light_identifier" : "o", "projector_camera_light_identifier": "r",
"projector_light_identifier" : "q", "projector_camera_identifier": "s",
"projector_camera_light_identifier" : "r", "projector_second_identifier": "t",
"projector_camera_identifier" : "s", "projectors_identifier": "d",
"projector_second_forward": "u",
"projector_second_identifier" : "t", "projector_second_backward": "v",
"projectors_identifier" : "d", "projector_second": "w",
"projector_second_forward" : "u", "projectors": "x",
"projector_second_backward" : "v", "camera_second_identifier": "y",
"projector_second" : "w", "cameras_identifier": "a",
"projectors" : "x", "camera_second_forward": "1",
"camera_second_backward": "2",
"camera_second_identifier" : "y", "camera_second": "3",
"cameras_identifier" : "a", "cameras": "4"
"camera_second_forward" : "1",
"camera_second_backward" : "2",
"camera_second" : "3",
"cameras" : "4"
} }
} }
} }

7
app/package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.3.1", "version": "1.3.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -6556,6 +6556,11 @@
"system": { "system": {
"version": "file:lib/system" "version": "file:lib/system"
}, },
"systeminformation": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-4.1.1.tgz",
"integrity": "sha512-sRQYRRTOkwpXQA8grIBPSZEzJvxdsitdmrp0mer9MFRlry5AJC6DbAE0EcsK54k5jLTBaauvzCFwM+y7c5fMmg=="
},
"table-layout": { "table-layout": {
"version": "0.4.4", "version": "0.4.4",
"resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.4.tgz", "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.4.tgz",

View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy-app", "name": "mcopy-app",
"version": "1.3.1", "version": "1.3.2",
"description": "GUI for the mcopy small gauge film optical printer platform", "description": "GUI for the mcopy small gauge film optical printer platform",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
@ -67,6 +67,7 @@
"settings": "file:lib/settings", "settings": "file:lib/settings",
"spawn": "file:lib/spawn", "spawn": "file:lib/spawn",
"system": "file:lib/system", "system": "file:lib/system",
"systeminformation": "^4.1.1",
"uuid": "^3.3.2", "uuid": "^3.3.2",
"winston": "^3.0.0" "winston": "^3.0.0"
}, },

1215
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "mcopy", "name": "mcopy",
"version": "1.3.0", "version": "1.3.2",
"description": "Small gauge film optical printer platform", "description": "Small gauge film optical printer platform",
"main": "build.js", "main": "build.js",
"directories": { "directories": {
@ -22,6 +22,7 @@
}, },
"homepage": "https://github.com/sixteenmillimeter/mcopy#readme", "homepage": "https://github.com/sixteenmillimeter/mcopy#readme",
"devDependencies": { "devDependencies": {
"@types/electron": "^1.6.10",
"@types/node": "^11.10.4", "@types/node": "^11.10.4",
"typescript": "^3.3.3333" "typescript": "^3.3.3333"
} }

View File

@ -1,8 +1,24 @@
#!/bin/sh #!/bin/sh
./node_modules/.bin/tsc -p tsconfig.json #./node_modules/.bin/tsc -p tsconfig.json
#electron-build fails when local modules are in parent directory #electron-build fails when local modules are in parent directory
#copy them into lib directory #copy them into lib directory
cp -r ./lib/* ./app/lib/ cp -r ./lib/* ./app/lib/
cp -r ./lib/* ./cli/lib/ cp -r ./lib/* ./cli/lib/
cp ./data/cfg.json ./app/data/
cp ./data/cfg.json ./cli/data/
#version all sub projects and config files
version=$(jq -r '.version' ./package.json)
echo "VERSION: $version"
declare -a fileArr=("./data/cfg.json" "./app/package.json" "./cli/package.json")
for i in "${fileArr[@]}"
do
tmp=$(mktemp)
VERSION="$version" jq '.version = env.VERSION' "$i" > "$tmp" && mv "$tmp" "$i"
done