From 0892767f646cf31cf964f2478424e6dbc602bf17 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Thu, 15 Apr 2021 15:39:52 -0400 Subject: [PATCH 1/2] Revert "Revert "build: pkg/interface builds pkg/npm preinstall"" This reverts commit ebcd2136eb4739262a859edf5d4b8098276b9867. --- pkg/interface/package.json | 3 ++- pkg/interface/preinstall.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 pkg/interface/preinstall.sh diff --git a/pkg/interface/package.json b/pkg/interface/package.json index ae2d1129c2..ff6dd60dd9 100644 --- a/pkg/interface/package.json +++ b/pkg/interface/package.json @@ -98,8 +98,9 @@ "lint-file": "eslint", "tsc": "tsc", "tsc:watch": "tsc --watch", + "preinstall": "./preinstall.sh", "build:dev": "cross-env NODE_ENV=development webpack --config config/webpack.dev.js", - "build:prod": "cd ../npm/api && npm i && cd ../../interface && cross-env NODE_ENV=production webpack --config config/webpack.prod.js", + "build:prod": "cross-env NODE_ENV=production webpack --config config/webpack.prod.js", "start": "webpack-dev-server --config config/webpack.dev.js", "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/pkg/interface/preinstall.sh b/pkg/interface/preinstall.sh new file mode 100755 index 0000000000..9868080873 --- /dev/null +++ b/pkg/interface/preinstall.sh @@ -0,0 +1,12 @@ +#!/bin/sh +cd ../npm + +for i in $(find . -type d -maxdepth 1) ; do + packageJson="${i}/package.json" + if [ -f "${packageJson}" ]; then + echo "installing ${i}..." + cd ./${i} + npm install + cd .. + fi +done \ No newline at end of file From aefc267477fc4c0f522282fbf8f9f53ebcee8488 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Thu, 15 Apr 2021 15:41:20 -0400 Subject: [PATCH 2/2] landscape: install using ci in most cases --- pkg/interface/CONTRIBUTING.md | 6 +++--- pkg/interface/package.json | 2 +- pkg/interface/preinstall.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/interface/CONTRIBUTING.md b/pkg/interface/CONTRIBUTING.md index 711e359d8f..f3bfbb5a0e 100644 --- a/pkg/interface/CONTRIBUTING.md +++ b/pkg/interface/CONTRIBUTING.md @@ -32,7 +32,7 @@ same (if [developing on a local development ship][local]). Then, from 'pkg/interface': ``` -npm install +npm ci npm run start ``` @@ -59,7 +59,7 @@ module.exports = { ``` The dev environment will attempt to match the subdomain against the keys of this -object, and if matched will proxy to the corresponding URL. For example, the +object, and if matched will proxy to the corresponding URL. For example, the above config will proxy `zod.localhost:9000` to `http://localhost:8080`, `bus.localhost:9000` to `http://localhost:8081` and so on and so forth. If no match is found, then it will fallback to the `URL` property. @@ -71,7 +71,7 @@ linter and for usage through the command, do the following: ```bash $ cd ./pkg/interface -$ npm install +$ npm ci $ npm run lint ``` diff --git a/pkg/interface/package.json b/pkg/interface/package.json index ff6dd60dd9..8315072931 100644 --- a/pkg/interface/package.json +++ b/pkg/interface/package.json @@ -100,7 +100,7 @@ "tsc:watch": "tsc --watch", "preinstall": "./preinstall.sh", "build:dev": "cross-env NODE_ENV=development webpack --config config/webpack.dev.js", - "build:prod": "cross-env NODE_ENV=production webpack --config config/webpack.prod.js", + "build:prod": "cd ../npm/api && npm ci && cd ../../interface && cross-env NODE_ENV=production webpack --config config/webpack.prod.js", "start": "webpack-dev-server --config config/webpack.dev.js", "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/pkg/interface/preinstall.sh b/pkg/interface/preinstall.sh index 9868080873..4f35cfc0f7 100755 --- a/pkg/interface/preinstall.sh +++ b/pkg/interface/preinstall.sh @@ -6,7 +6,7 @@ for i in $(find . -type d -maxdepth 1) ; do if [ -f "${packageJson}" ]; then echo "installing ${i}..." cd ./${i} - npm install + npm ci cd .. fi done \ No newline at end of file