Skip to content

Commit e4af45c

Browse files
Clinton WerthClinton Werth
authored andcommitted
get local build working
1 parent 6030daf commit e4af45c

File tree

11 files changed

+44
-6
lines changed

11 files changed

+44
-6
lines changed

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 20.11.1

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ That [NPM script](./instance/package.json) will run the `mage.service` script fr
319319
[configuration](./instance/config.js) from the instance directory. You can modify that configuration to suit
320320
your needs.
321321

322+
## Local development
323+
324+
These steps will ensure all necessary packages are installed and built correctly. This will also ensure that changes are applied in real time, rather than having to rebuild packages and restart the instance. First, ensure you have the correct version of node installed as mentioned above. From the root directory, run 'npm run install'. This will install all of the necessary node_modules for each app. If there is an additional plugin you would like to install packages for, see the 'postinstall' script and make adjustments there.
325+
Next, run 'npm run build:local'
326+
322327
### Local runtime issues
323328

324329
You may run into some problems running the Mage instance from your working tree due to NPM's dependency installation

local-dev.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
case $1 in
2+
stop-watch )
3+
echo "stopping builds running with watch..."
4+
watchPIDS=""
5+
watchPIDS=$(ps aux | grep -- '--watch' | grep -v grep | awk '{print $2}')
6+
echo "found pids with watch: {$watchPIDS}"
7+
if [ -z "$watchPIDS" ]; then
8+
echo "No watch processes were found."
9+
else
10+
echo "Killing PIDs: $watchPIDS"
11+
kill $watchPIDS
12+
echo "watch builds have been stopped."
13+
fi
14+
esac
15+

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
"version": "6.3.0-beta.6",
66
"files": [],
77
"scripts": {
8-
"postinstall": "npm-run-all service:ci web-app:ci image.service:ci nga-msi:ci",
8+
"postinstall": "npm-run-all service:ci web-app:ci image.service:ci nga-msi:ci arc-web:install arc-service:install",
99
"install:resolve": "npm-run-all service:install web-app:install image.service:install nga-msi:install",
10-
"build": "npm-run-all service:build web-app:build image.service:build nga-msi:build instance:build",
10+
"build": "npm-run-all service:build web-app:build image.service:build nga-msi:build instance:build arc-service:build arc-web:build",
11+
"build:local": "npm-run-all service:build-local web-app:build-local arc-service:build-local arc-web:build-local instance:build",
1112
"pack-all": "npm-run-all service:pack web-app:pack image.service:pack nga-msi:pack",
1213
"service:install": "npm install --prefix service",
1314
"service:ci": "npm ci --prefix service",
1415
"service:build": "npm run build --prefix service",
16+
"service:build-local": "npm run build:local --prefix service",
1517
"service:pack": "npm pack ./service",
1618
"web-app:install": "npm install --prefix web-app",
1719
"web-app:ci": "npm ci --prefix web-app",
1820
"web-app:build": "npm run build --prefix web-app",
21+
"web-app:build-local": "npm run build:local --prefix web-app",
1922
"web-app:debug": "npm start --prefix web-app",
2023
"web-app:pack": "npm pack ./web-app/dist/app",
2124
"instance:build": "npm install --prefix instance",
@@ -29,6 +32,12 @@
2932
"nga-msi:ci": "npm ci --prefix plugins/nga-msi",
3033
"nga-msi:build": "npm run build --prefix plugins/nga-msi",
3134
"nga-msi:pack": "npm pack ./plugins/nga-msi",
35+
"arc-web:install": "npm install --prefix plugins/arcgis/web-app",
36+
"arc-web:build-local": "cd plugins/arcgis/web-app && npm run build:local",
37+
"arc-web:build": "npm run build --prefix plugins/arcgis/web-app",
38+
"arc-service:install": "npm install --prefix plugins/arcgis/service",
39+
"arc-service:build-local": "cd plugins/arcgis/service && npm run build:local",
40+
"arc-service:build": "npm run build --prefix plugins/arcgis/service",
3241
"start": "npm run instance:start-env",
3342
"start-web": "npm run web-app:debug"
3443
},

plugins/arcgis/service/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/arcgis/service/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"scripts": {
1515
"build:tsc": "tsc -b src",
1616
"build": "npm-run-all build:tsc",
17+
"build:local": "npm link ../../../service && tsc -b src --watch &",
1718
"test:run": "jest lib",
1819
"test": "npm-run-all build test:run",
1920
"clean": "rm -rf lib"
@@ -44,7 +45,7 @@
4445
"form-data": "^4.0.1"
4546
},
4647
"peerDependencies": {
47-
"@ngageoint/mage.service": "^6.2.9 || ^6.3.0-beta",
48+
"@ngageoint/mage.service": "^6.2.13 || ^6.3.0-beta",
4849
"express": "^4.17.0"
4950
},
5051
"devDependencies": {

plugins/arcgis/web-app/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/arcgis/web-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"ng": "ng",
66
"start": "ng serve",
77
"build": "npm-run-all build:main",
8+
"build:local": "npm link ../../../web-app && ng build --project=main --watch &",
89
"build:main": "ng build --project=main",
910
"test": "ng test --project=main",
1011
"test-headless": "ng test --watch=false --browsers=ChromeHeadless --project=main",

service/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,15 @@
152152
},
153153
"scripts": {
154154
"build:compile": "tsc -b src",
155+
"build:compile-local": "tsc -b src --watch &",
155156
"build:copy_assets": "cpy --cwd=src './assets/**/*' '../lib/assets/'",
156157
"build:copy_docs": "cpy --cwd=src './docs/**/*' '../lib/docs/'",
157158
"build:copy_package": "cpy --rename=dist-package.json 'package.json' 'lib'",
158159
"build:copy_types": "cpy --cwd=src './**/*.d.ts' '../lib'",
159160
"build:copy_views": "cpy --cwd=src './views/**/*' '../lib/views/'",
160161
"build:after_compile": "npm-run-all build:copy_assets build:copy_types build:copy_docs build:copy_package build:copy_views",
161162
"build": "npm-run-all build:compile build:after_compile",
163+
"build:local": "npm-run-all build:compile-local build:copy_assets",
162164
"test:compile": "tsc -b test",
163165
"test:copy_resources": "cpy --cwd=test 'environment/*.pem' '../test-lib/environment/'",
164166
"test:copy_node_modules": "cpy --cwd=test 'node_modules/**/*' '../test-lib/node_modules/'",

0 commit comments

Comments
 (0)