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,5 +1,5 @@
{ {
"version" : "2.0.0", "version": "1.3.2",
"ext_port": 1111, "ext_port": 1111,
"profiles": { "profiles": {
"mcopy": { "mcopy": {
@ -81,28 +81,19 @@
"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_forward": "BF",
"black_backward": "BB", "black_backward": "BB",
"camera_second_forward": "C2F", "camera_second_forward": "C2F",
"camera_second_backward": "C2B", "camera_second_backward": "C2B",
"cameras_forward" : "CCF",
"cameras_forward": "CCB", "cameras_forward": "CCB",
"camera_forward_camera_second_backward": "CFCB", "camera_forward_camera_second_backward": "CFCB",
"camera_backward_camera_second_forward": "CBCF", "camera_backward_camera_second_forward": "CBCF",
"projector_second_forward": "P2F", "projector_second_forward": "P2F",
"projector_second_backward": "P2B", "projector_second_backward": "P2B",
"projectors_forward": "PPF", "projectors_forward": "PPF",
"projectors_backward": "PPB", "projectors_backward": "PPB",
"projector_forward_projector_second_backward": "PFPB", "projector_forward_projector_second_backward": "PFPB",
"projector_backward_projector_second_forward": "PBPF" "projector_backward_projector_second_forward": "PBPF"
}, },
@ -140,20 +131,16 @@
"camera_identifier": "k", "camera_identifier": "k",
"mcopy_identifier": "m", "mcopy_identifier": "m",
"camera_timed": "n", "camera_timed": "n",
"projector_identifier" : "j",
"camera_identifier" : "k",
"light_identifier": "o", "light_identifier": "o",
"projector_light_identifier": "q", "projector_light_identifier": "q",
"projector_camera_light_identifier": "r", "projector_camera_light_identifier": "r",
"projector_camera_identifier": "s", "projector_camera_identifier": "s",
"projector_second_identifier": "t", "projector_second_identifier": "t",
"projectors_identifier": "d", "projectors_identifier": "d",
"projector_second_forward": "u", "projector_second_forward": "u",
"projector_second_backward": "v", "projector_second_backward": "v",
"projector_second": "w", "projector_second": "w",
"projectors": "x", "projectors": "x",
"camera_second_identifier": "y", "camera_second_identifier": "y",
"cameras_identifier": "a", "cameras_identifier": "a",
"camera_second_forward": "1", "camera_second_forward": "1",

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