Skip to content

Commit

Permalink
get local build working
Browse files Browse the repository at this point in the history
  • Loading branch information
Clinton Werth authored and Clinton Werth committed Dec 18, 2024
1 parent 6030daf commit e4af45c
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 6 deletions.
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 20.11.1
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ That [NPM script](./instance/package.json) will run the `mage.service` script fr
[configuration](./instance/config.js) from the instance directory. You can modify that configuration to suit
your needs.

## Local development

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.
Next, run 'npm run build:local'

### Local runtime issues

You may run into some problems running the Mage instance from your working tree due to NPM's dependency installation
Expand Down
15 changes: 15 additions & 0 deletions local-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
case $1 in
stop-watch )
echo "stopping builds running with watch..."
watchPIDS=""
watchPIDS=$(ps aux | grep -- '--watch' | grep -v grep | awk '{print $2}')
echo "found pids with watch: {$watchPIDS}"
if [ -z "$watchPIDS" ]; then
echo "No watch processes were found."
else
echo "Killing PIDs: $watchPIDS"
kill $watchPIDS
echo "watch builds have been stopped."
fi
esac

1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
"version": "6.3.0-beta.6",
"files": [],
"scripts": {
"postinstall": "npm-run-all service:ci web-app:ci image.service:ci nga-msi:ci",
"postinstall": "npm-run-all service:ci web-app:ci image.service:ci nga-msi:ci arc-web:install arc-service:install",
"install:resolve": "npm-run-all service:install web-app:install image.service:install nga-msi:install",
"build": "npm-run-all service:build web-app:build image.service:build nga-msi:build instance:build",
"build": "npm-run-all service:build web-app:build image.service:build nga-msi:build instance:build arc-service:build arc-web:build",
"build:local": "npm-run-all service:build-local web-app:build-local arc-service:build-local arc-web:build-local instance:build",
"pack-all": "npm-run-all service:pack web-app:pack image.service:pack nga-msi:pack",
"service:install": "npm install --prefix service",
"service:ci": "npm ci --prefix service",
"service:build": "npm run build --prefix service",
"service:build-local": "npm run build:local --prefix service",
"service:pack": "npm pack ./service",
"web-app:install": "npm install --prefix web-app",
"web-app:ci": "npm ci --prefix web-app",
"web-app:build": "npm run build --prefix web-app",
"web-app:build-local": "npm run build:local --prefix web-app",
"web-app:debug": "npm start --prefix web-app",
"web-app:pack": "npm pack ./web-app/dist/app",
"instance:build": "npm install --prefix instance",
Expand All @@ -29,6 +32,12 @@
"nga-msi:ci": "npm ci --prefix plugins/nga-msi",
"nga-msi:build": "npm run build --prefix plugins/nga-msi",
"nga-msi:pack": "npm pack ./plugins/nga-msi",
"arc-web:install": "npm install --prefix plugins/arcgis/web-app",
"arc-web:build-local": "cd plugins/arcgis/web-app && npm run build:local",
"arc-web:build": "npm run build --prefix plugins/arcgis/web-app",
"arc-service:install": "npm install --prefix plugins/arcgis/service",
"arc-service:build-local": "cd plugins/arcgis/service && npm run build:local",
"arc-service:build": "npm run build --prefix plugins/arcgis/service",
"start": "npm run instance:start-env",
"start-web": "npm run web-app:debug"
},
Expand Down
2 changes: 1 addition & 1 deletion plugins/arcgis/service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion plugins/arcgis/service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"scripts": {
"build:tsc": "tsc -b src",
"build": "npm-run-all build:tsc",
"build:local": "npm link ../../../service && tsc -b src --watch &",
"test:run": "jest lib",
"test": "npm-run-all build test:run",
"clean": "rm -rf lib"
Expand Down Expand Up @@ -44,7 +45,7 @@
"form-data": "^4.0.1"
},
"peerDependencies": {
"@ngageoint/mage.service": "^6.2.9 || ^6.3.0-beta",
"@ngageoint/mage.service": "^6.2.13 || ^6.3.0-beta",
"express": "^4.17.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions plugins/arcgis/web-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugins/arcgis/web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ng": "ng",
"start": "ng serve",
"build": "npm-run-all build:main",
"build:local": "npm link ../../../web-app && ng build --project=main --watch &",
"build:main": "ng build --project=main",
"test": "ng test --project=main",
"test-headless": "ng test --watch=false --browsers=ChromeHeadless --project=main",
Expand Down
2 changes: 2 additions & 0 deletions service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,15 @@
},
"scripts": {
"build:compile": "tsc -b src",
"build:compile-local": "tsc -b src --watch &",
"build:copy_assets": "cpy --cwd=src './assets/**/*' '../lib/assets/'",
"build:copy_docs": "cpy --cwd=src './docs/**/*' '../lib/docs/'",
"build:copy_package": "cpy --rename=dist-package.json 'package.json' 'lib'",
"build:copy_types": "cpy --cwd=src './**/*.d.ts' '../lib'",
"build:copy_views": "cpy --cwd=src './views/**/*' '../lib/views/'",
"build:after_compile": "npm-run-all build:copy_assets build:copy_types build:copy_docs build:copy_package build:copy_views",
"build": "npm-run-all build:compile build:after_compile",
"build:local": "npm-run-all build:compile-local build:copy_assets",
"test:compile": "tsc -b test",
"test:copy_resources": "cpy --cwd=test 'environment/*.pem' '../test-lib/environment/'",
"test:copy_node_modules": "cpy --cwd=test 'node_modules/**/*' '../test-lib/node_modules/'",
Expand Down
3 changes: 3 additions & 0 deletions web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@
"start:app": "ng serve --project=app --configuration development",
"start:admin": "ng serve --project=admin --configuration development",
"build": "npm-run-all clean build:core-lib build:app:dev build:admin:dev combine",
"build:local": "npm-run-all clean build:core-lib build:app:dev-local build:admin:dev-local combine",
"build:prod": "npm-run-all clean build:core-lib build:app:prod build:admin:prod combine",
"build:app:dev": "ng build --project=app --configuration development",
"build:app:dev-local": "ng build --project=app --configuration development --watch &",
"build:admin:dev": "ng build --project=admin --configuration development",
"build:admin:dev-local": "ng build --project=admin --configuration development --watch &",
"build:app:prod": "ng build --project=app --configuration production",
"build:admin:prod": "ng build --project=admin --configuration production",
"build:core-lib": "npm-run-all build:core-lib:*",
Expand Down

0 comments on commit e4af45c

Please sign in to comment.