mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-26 02:21:06 -04:00
Fix api deploy not installing deps from shared, emails and common
This commit is contained in:
31
backend/api/dist_copy.sh
Executable file
31
backend/api/dist_copy.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
rsync -a --delete ../../common/lib/ dist/common/lib
|
||||
rsync -a --delete ../../common/messages/ dist/common/messages/
|
||||
|
||||
rsync -a --delete ../shared/lib/ dist/backend/shared/lib
|
||||
|
||||
rsync -a --delete ../email/lib/ dist/backend/email/lib
|
||||
|
||||
rsync -a --delete ./lib/* dist/backend/api/lib
|
||||
cp package.json dist/backend/api
|
||||
cp metadata.json dist
|
||||
cp metadata.json dist/backend/api
|
||||
|
||||
cp ../../yarn.lock dist
|
||||
|
||||
# Installing from backend/api/package.json is not enough
|
||||
# Need to install the deps from all the workspaces used in the back end
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const deps = ['../api', '../shared', '../email', '../../common']
|
||||
.map(p => require('./' + p + '/package.json').dependencies || {})
|
||||
.reduce((acc, d) => ({ ...acc, ...d }), {});
|
||||
const pkg = require('./package.json');
|
||||
pkg.dependencies = { ...deps, ...pkg.dependencies };
|
||||
fs.writeFileSync('./dist/package.json', JSON.stringify(pkg, null, 2));
|
||||
"
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@compass/api",
|
||||
"version": "1.21.0",
|
||||
"version": "1.21.1",
|
||||
"private": true,
|
||||
"description": "Backend API endpoints",
|
||||
"main": "src/serve.ts",
|
||||
@@ -13,7 +13,7 @@
|
||||
"dev": "yarn watch:serve",
|
||||
"dist": "yarn dist:clean && yarn dist:copy",
|
||||
"dist:clean": "rm -rf dist && mkdir -p dist/common/lib dist/backend/shared/lib dist/backend/api/lib dist/backend/email/lib",
|
||||
"dist:copy": "rsync -a --delete ../../common/lib/ dist/common/lib && rsync -a ../../common/messages/ dist/common/messages/ && rsync -a --delete ../shared/lib/ dist/backend/shared/lib && rsync -a --delete ../email/lib/ dist/backend/email/lib && rsync -a --delete ./lib/* dist/backend/api/lib && cp ../../yarn.lock dist && cp package.json dist && cp package.json dist/backend/api && cp metadata.json dist && cp metadata.json dist/backend/api",
|
||||
"dist:copy": "./dist_copy.sh",
|
||||
"lint": "npx eslint . --max-warnings 0",
|
||||
"lint-fix": "npx eslint . --fix",
|
||||
"prod": "npx concurrently -n COMPILE,SERVER -c cyan,green \"yarn watch:compile\" \"yarn watch:serve\"",
|
||||
|
||||
Reference in New Issue
Block a user