Browse Source

chore: npm -> pnpm

pull/5903/head
Wing-Kam Wong 1 year ago
parent
commit
56a3ee7870
  1. 10
      build-local-docker-image.sh
  2. 14
      package.json
  3. 4
      packages/nocodb/litestream/Dockerfile

10
build-local-docker-image.sh

@ -14,8 +14,8 @@ ERROR=""
function build_sdk(){
#build nocodb-sdk
cd ${SCRIPT_DIR}/packages/nocodb-sdk
npm ci || ERROR="sdk build failed"
npm run build || ERROR="sdk build failed"
pnpm install || ERROR="sdk build failed"
pnpm run build || ERROR="sdk build failed"
}
function build_gui(){
@ -23,8 +23,8 @@ function build_gui(){
export NODE_OPTIONS="--max_old_space_size=16384"
# generate static build of nc-gui
cd ${SCRIPT_DIR}/packages/nc-gui
npm ci || ERROR="gui build failed"
npm run generate || ERROR="gui build failed"
pnpm install || ERROR="gui build failed"
pnpm run generate || ERROR="gui build failed"
}
function copy_gui_artifacts(){
@ -36,7 +36,7 @@ function package_nocodb(){
#build nocodb
# build nocodb ( pack nocodb-sdk and nc-gui )
cd ${SCRIPT_DIR}/packages/nocodb
npm install || ERROR="package_nocodb failed"
pnpm install || ERROR="package_nocodb failed"
EE=true ./node_modules/.bin/webpack --config webpack.local.config.js || ERROR="package_nocodb failed"
}

14
package.json

@ -28,20 +28,20 @@
},
"lint-staged": {
"scripts/playwright/**/*.{ts,tsx,js,json}": [
"npm run lint:staged:playwright"
"pnpm run lint:staged:playwright"
]
},
"scripts": {
"lint:staged:playwright": "cd ./tests/playwright; npx lint-staged; cd -",
"build:common": "cd ./packages/nocodb-sdk; npm install; npm run build",
"install:common": "cd packages/nocodb-legacy; npm install ../nocodb-sdk; cd ../nc-gui; npm install ../nocodb-sdk",
"start:web": "npm run build:common ; cd ./packages/nc-gui; npm install ../nocodb-sdk; npm install; ANT_MESSAGE_DURATION=0.5 npm run dev",
"build:common": "cd ./packages/nocodb-sdk; pnpm install; pnpm run build",
"install:common": "cd packages/nocodb-legacy; pnpm install ../nocodb-sdk; cd ../nc-gui; pnpm install ../nocodb-sdk",
"start:web": "pnpm run build:common ; cd ./packages/nc-gui; pnpm install ../nocodb-sdk; pnpm install; ANT_MESSAGE_DURATION=0.5 pnpm run dev",
"test:travis": "git log --pretty=format:'%h' -n 1 --skip 1 | xargs lerna run test:travis --since",
"lerna:install": "git log --pretty=format:'%h' -n 1 --skip 1 | xargs lerna bootstrap --ignore nc-cli --since",
"updated:xc-migrator": "lerna run publish --scope xc-migrator && lerna run xc && lerna publish && npm install -f xc-cli",
"updated:xc-migrator": "lerna run publish --scope xc-migrator && lerna run xc && lerna publish && pnpm install -f xc-cli",
"doc": "lerna run doc",
"install:local:dep": "cd packages/nc-lib-gui;npm uninstall -S xc-lib;rm package-lock.json; npm i ../../../xc-lib-private; cd ../xc-instant;npm uninstall -S xc-lib xc-lib-gui;npm i ../../../xc-lib-private;npm i ../xc-lib-gui",
"install:npm:dep": "cd packages/nc-lib-gui;npm uninstall -S xc-lib; npm i -S xc-lib@latest; cd ../xc-instant;npm uninstall -S xc-lib xc-lib-gui;npm i -S xc-lib@latest xc-lib-gui@latest;npm i ../xc-lib-gui",
"install:local:dep": "cd packages/nc-lib-gui;pnpm uninstall -S xc-lib;rm package-lock.json; pnpm i ../../../xc-lib-private; cd ../xc-instant;pnpm uninstall -S xc-lib xc-lib-gui;pnpm i ../../../xc-lib-private;pnpm i ../xc-lib-gui",
"install:pnpm:dep": "cd packages/nc-lib-gui;pnpm uninstall -S xc-lib; pnpm i -S xc-lib@latest; cd ../xc-instant;pnpm uninstall -S xc-lib xc-lib-gui;pnpm i -S xc-lib@latest xc-lib-gui@latest;pnpm i ../xc-lib-gui",
"prepare": "husky install",
"start:mysql": "docker-compose -f ./tests/playwright/scripts/docker-compose-mysql-playwright.yml up -d",
"stop:mysql": "docker-compose -f ./tests/playwright/scripts/docker-compose-mysql-playwright.yml down",

4
packages/nocodb/litestream/Dockerfile

@ -17,7 +17,7 @@ WORKDIR /usr/src/app
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm ci on every code change.
# Copying this separately prevents re-running pnpm install on every code change.
COPY ./package*.json ./
COPY ./docker/main.js ./docker/main.js
#COPY ./docker/start.sh /usr/src/appEntry/start.sh
@ -25,7 +25,7 @@ COPY ./docker/start-litestream.sh /usr/src/appEntry/start.sh
# install production dependencies,
# reduce node_module size with modclean & removing sqlite deps,
# package built code into app.tar.gz & add execute permission to start.sh
RUN npm ci --production --quiet
RUN pnpm install --production --quiet
RUN npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**" --run
RUN rm -rf ./node_modules/sqlite3/deps
RUN tar -czf ../appEntry/app.tar.gz ./*

Loading…
Cancel
Save