Browse Source

chore(deps): use pnpm dlx instead

pull/5903/head
Wing-Kam Wong 1 year ago
parent
commit
a0d5b5659b
  1. 4
      package.json
  2. 2
      packages/nocodb-sdk/package.json
  3. 2
      packages/nocodb/Dockerfile
  4. 2
      packages/nocodb/Dockerfile.local
  5. 2
      packages/nocodb/litestream/Dockerfile
  6. 2
      tests/playwright/.lintstagedrc.json
  7. 4
      tests/playwright/package.json
  8. 2
      tests/playwright/startPlayWrightServer.sh

4
package.json

@ -23,7 +23,7 @@
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "npx lint-staged" "pre-commit": "pnpm dlx lint-staged"
} }
}, },
"lint-staged": { "lint-staged": {
@ -35,7 +35,7 @@
"bootstrap": "pnpm --filter=nocodb-sdk install && pnpm --filter=nocodb-sdk run build && pnpm --filter=nocodb --filter=nc-gui --filter=playwright install", "bootstrap": "pnpm --filter=nocodb-sdk install && pnpm --filter=nocodb-sdk run build && pnpm --filter=nocodb --filter=nc-gui --filter=playwright install",
"start:frontend": "pnpm --filter=nc-gui run dev", "start:frontend": "pnpm --filter=nc-gui run dev",
"start:backend": "pnpm --filter=nocodb run start", "start:backend": "pnpm --filter=nocodb run start",
"lint:staged:playwright": "cd ./tests/playwright; npx lint-staged; cd -", "lint:staged:playwright": "cd ./tests/playwright; pnpm dlx lint-staged; cd -",
"start:mysql": "docker-compose -f ./tests/playwright/scripts/docker-compose-mysql-playwright.yml up -d", "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", "stop:mysql": "docker-compose -f ./tests/playwright/scripts/docker-compose-mysql-playwright.yml down",
"start:pg": "docker-compose -f ./tests/playwright/scripts/docker-compose-pg.yml up -d", "start:pg": "docker-compose -f ./tests/playwright/scripts/docker-compose-pg.yml up -d",

2
packages/nocodb-sdk/package.json

@ -34,7 +34,7 @@
"test:prettier": "prettier \"src/**/*.ts\" --list-different", "test:prettier": "prettier \"src/**/*.ts\" --list-different",
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"", "test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"",
"watch:build": "tsc -p tsconfig.json -w", "watch:build": "tsc -p tsconfig.json -w",
"generate:sdk": "npx --yes swagger-typescript-api@10.0.3 -r -p ../nocodb/src/schema/swagger.json -o ./src/lib/ --axios --unwrap-response-data --module-name-first-tag --type-suffix=Type --templates ../../scripts/sdk/templates", "generate:sdk": "pnpm dlx swagger-typescript-api@10.0.3 -r -p ../nocodb/src/schema/swagger.json -o ./src/lib/ --axios --unwrap-response-data --module-name-first-tag --type-suffix=Type --templates ../../scripts/sdk/templates",
"preinstall": "npx only-allow pnpm" "preinstall": "npx only-allow pnpm"
}, },
"dependencies": { "dependencies": {

2
packages/nocodb/Dockerfile

@ -42,7 +42,7 @@ RUN echo "node-linker=hoisted" > .npmrc
# reduce node_module size with modclean & removing sqlite deps, # reduce node_module size with modclean & removing sqlite deps,
# package built code into app.tar.gz & add execute permission to start.sh # package built code into app.tar.gz & add execute permission to start.sh
RUN pnpm install --prod --shamefully-hoist \ RUN pnpm install --prod --shamefully-hoist \
&& npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run \ && pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run \
&& rm -rf ./node_modules/sqlite3/deps \ && rm -rf ./node_modules/sqlite3/deps \
&& tar -czf ../appEntry/app.tar.gz ./* \ && tar -czf ../appEntry/app.tar.gz ./* \
&& chmod +x /usr/src/appEntry/start.sh && chmod +x /usr/src/appEntry/start.sh

2
packages/nocodb/Dockerfile.local

@ -26,7 +26,7 @@ RUN echo "node-linker=hoisted" > .npmrc
# package built code into app.tar.gz & add execute permission to start.sh # package built code into app.tar.gz & add execute permission to start.sh
RUN pnpm uninstall nocodb-sdk RUN pnpm uninstall nocodb-sdk
RUN pnpm install --prod --shamefully-hoist --reporter=silent \ RUN pnpm install --prod --shamefully-hoist --reporter=silent \
&& npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run \ && pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**,@azure/msal-node/dist/**" --run \
&& rm -rf ./node_modules/sqlite3/deps \ && rm -rf ./node_modules/sqlite3/deps \
&& tar -czf ../appEntry/app.tar.gz ./* \ && tar -czf ../appEntry/app.tar.gz ./* \
&& chmod +x /usr/src/appEntry/start.sh && chmod +x /usr/src/appEntry/start.sh

2
packages/nocodb/litestream/Dockerfile

@ -32,7 +32,7 @@ RUN echo "node-linker=hoisted" > .npmrc
# reduce node_module size with modclean & removing sqlite deps, # reduce node_module size with modclean & removing sqlite deps,
# package built code into app.tar.gz & add execute permission to start.sh # package built code into app.tar.gz & add execute permission to start.sh
RUN pnpm install --prod --shamefully-hoist --reporter=silent RUN pnpm install --prod --shamefully-hoist --reporter=silent
RUN npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**" --run RUN pnpm dlx modclean --patterns="default:*" --ignore="nc-lib-gui/**,dayjs/**,express-status-monitor/**" --run
RUN rm -rf ./node_modules/sqlite3/deps RUN rm -rf ./node_modules/sqlite3/deps
RUN tar -czf ../appEntry/app.tar.gz ./* RUN tar -czf ../appEntry/app.tar.gz ./*
RUN chmod +x /usr/src/appEntry/start.sh RUN chmod +x /usr/src/appEntry/start.sh

2
tests/playwright/.lintstagedrc.json

@ -1,3 +1,3 @@
{ {
"**/*.{ts,tsx,js,json}": "npx eslint --fix" "**/*.{ts,tsx,js,json}": "pnpm exec eslint --fix"
} }

4
tests/playwright/package.json

@ -26,10 +26,10 @@
"test:shard:1": "TRACE=true pnpm exec playwright test --workers=4 --shard=1/2", "test:shard:1": "TRACE=true pnpm exec playwright test --workers=4 --shard=1/2",
"test:shard:2": "TRACE=true pnpm exec playwright test --workers=4 --shard=2/2", "test:shard:2": "TRACE=true pnpm exec playwright test --workers=4 --shard=2/2",
"test:repeat": "TRACE=true pnpm exec playwright test --workers=4 --repeat-each=12", "test:repeat": "TRACE=true pnpm exec playwright test --workers=4 --repeat-each=12",
"test:quick": "TRACE=true PW_QUICK_TEST=1 npx playwright test --workers=4", "test:quick": "TRACE=true PW_QUICK_TEST=1 pnpm dlx playwright test --workers=4",
"test:debug": "./startPlayWrightServer.sh; PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console pnpm exec playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 0 --workers 1 --max-failures=1", "test:debug": "./startPlayWrightServer.sh; PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console pnpm exec playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 0 --workers 1 --max-failures=1",
"test:debug:intelliJ": "TRACE=true PWDEBUG=console pnpm exec playwright test --trace on -c playwright.config.ts --headed --project=chromium --retries 0 --workers 1 --max-failures=1", "test:debug:intelliJ": "TRACE=true PWDEBUG=console pnpm exec playwright test --trace on -c playwright.config.ts --headed --project=chromium --retries 0 --workers 1 --max-failures=1",
"test:debug:watch": "npx nodemon -e ts -w ./ -x \"pnpm run test:debug\"", "test:debug:watch": "pnpm dlx nodemon -e ts -w ./ -x \"pnpm run test:debug\"",
"test:debug:quick:sqlite": "./startPlayWrightServer.sh; PW_QUICK_TEST=1 PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console pnpm exec playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 5 --workers 1 --max-failures=1", "test:debug:quick:sqlite": "./startPlayWrightServer.sh; PW_QUICK_TEST=1 PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console pnpm exec playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 5 --workers 1 --max-failures=1",
"ci:test": "pnpm exec playwright test --workers=2", "ci:test": "pnpm exec playwright test --workers=2",
"ci:test:shard:1": "pnpm exec playwright test --workers=2 --shard=1/2", "ci:test:shard:1": "pnpm exec playwright test --workers=2 --shard=1/2",

2
tests/playwright/startPlayWrightServer.sh

@ -2,7 +2,7 @@
if ! curl --output /dev/null --silent --head --fail http://localhost:31000 if ! curl --output /dev/null --silent --head --fail http://localhost:31000
then then
echo "Starting PlayWright Server" echo "Starting PlayWright Server"
PWDEBUG=console npx playwright run-server --port 31000 & PWDEBUG=console pnpm dlx playwright run-server --port 31000 &
# Wait for server to start # Wait for server to start
while ! curl --output /dev/null --silent --head --fail http://localhost:31000; do while ! curl --output /dev/null --silent --head --fail http://localhost:31000; do

Loading…
Cancel
Save