Browse Source

chore(deps): npm -> pnpm

pull/5903/head
Wing-Kam Wong 2 years ago
parent
commit
ce06ffb432
  1. 24
      .github/workflows/ci-cd.yml
  2. 26
      .github/workflows/playwright-test-workflow.yml
  3. 4
      .github/workflows/publish-blog.yml
  4. 4
      .github/workflows/publish-dev-docs.yml
  5. 4
      .github/workflows/publish-docs.yml
  6. 4
      .github/workflows/publish-noco-i18n.yml
  7. 4
      .github/workflows/publish-prev-docs.yml
  8. 10
      .github/workflows/release-docker.yml
  9. 14
      .github/workflows/release-executables.yml
  10. 10
      .github/workflows/release-nightly-dev.yml
  11. 8
      .github/workflows/release-nocodb.yml
  12. 12
      .github/workflows/release-npm.yml
  13. 10
      .github/workflows/release-pr.yml
  14. 14
      .github/workflows/release-timely-executables.yml
  15. 6
      .github/workflows/unit-test.yml
  16. 4
      .github/workflows/update-sdk-path.yml

24
.github/workflows/ci-cd.yml

@ -44,8 +44,8 @@ jobs:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
# pnpm cache files are stored in `~/.pnpm` on Linux/macOS
path: ~/.pnpm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
@ -53,16 +53,16 @@ jobs:
${{ runner.os }}-
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm install
run: pnpm install
- name: build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm run build:main
run: pnpm run build:main
- name: Install dependencies
working-directory: ./packages/nocodb
run: npm install
run: pnpm install
- name: run unit tests
working-directory: ./packages/nocodb
run: npm run test:unit
run: pnpm run test:unit
unit-tests-pg:
runs-on: ubuntu-20.04
timeout-minutes: 40
@ -82,8 +82,8 @@ jobs:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
# pnpm cache files are stored in `~/.pnpm` on Linux/macOS
path: ~/.pnpm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
@ -94,16 +94,16 @@ jobs:
run: docker-compose -f ./tests/playwright/scripts/docker-compose-playwright-pg.yml up -d &
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm install
run: pnpm install
- name: build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm run build:main
run: pnpm run build:main
- name: Install dependencies
working-directory: ./packages/nocodb
run: npm install
run: pnpm install
- name: run unit tests
working-directory: ./packages/nocodb
run: npm run test:unit:pg
run: pnpm run test:unit:pg
playwright-mysql-1:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml

26
.github/workflows/playwright-test-workflow.yml

@ -40,8 +40,8 @@ jobs:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
# pnpm cache files are stored in `~/.pnpm` on Linux/macOS
path: ~/.pnpm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
@ -49,10 +49,10 @@ jobs:
${{ runner.os }}-
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm install
run: pnpm install
- name: build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm run build
run: pnpm run build
- name: setup mysql
if: ${{ inputs.db == 'mysql' }}
working-directory: ./
@ -67,13 +67,13 @@ jobs:
run: docker-compose -f ./tests/playwright/scripts/docker-compose-pg-pw-quick.yml up -d &
- name: run frontend
working-directory: ./packages/nc-gui
run: npm run ci:run
run: pnpm run ci:run
- name: Run backend
working-directory: ./packages/nocodb
run: |
npm install
npm run watch:run:playwright > ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log &
- name: Cache playwright npm modules
pnpm install
pnpm run watch:run:playwright > ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log &
- name: Cache playwright pnpm modules
uses: actions/cache@v3
id: playwright-cache
with:
@ -83,7 +83,7 @@ jobs:
- name: Install dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ./tests/playwright
run: npm install
run: pnpm install
- name: Install Playwright Browsers
working-directory: ./tests/playwright
run: npx playwright install chromium --with-deps
@ -96,7 +96,7 @@ jobs:
- name: Run Playwright tests
working-directory: ./tests/playwright
run: E2E_DB_TYPE=${{ inputs.db }} npm run ci:test:shard:${{ inputs.shard }}
run: E2E_DB_TYPE=${{ inputs.db }} pnpm run ci:test:shard:${{ inputs.shard }}
# Stress test added/modified tests
- name: Fetch develop branch
@ -112,13 +112,13 @@ jobs:
working-directory: ./packages/nocodb
run: |
kill -9 $(lsof -t -i:8080)
npm run watch:run:playwright:pg:cyquick &
pnpm run watch:run:playwright:pg:cyquick &
- name: Run quick server and tests (sqlite)
if: ${{ inputs.db == 'sqlite' && inputs.shard == '2' }}
working-directory: ./packages/nocodb
run: |
kill -9 $(lsof -t -i:8080)
npm run watch:run:playwright:quick > quick_${{ inputs.shard }}_test_backend.log &
pnpm run watch:run:playwright:quick > quick_${{ inputs.shard }}_test_backend.log &
- name: Wait for backend & run quick tests
if: ${{ inputs.db == 'sqlite' }}
working-directory: ./tests/playwright
@ -127,7 +127,7 @@ jobs:
printf '.'
sleep 2
done
PLAYWRIGHT_HTML_REPORT=playwright-report-quick npm run test:quick
PLAYWRIGHT_HTML_REPORT=playwright-report-quick pnpm run test:quick
- uses: actions/upload-artifact@v3
if: ${{ inputs.db == 'sqlite' }}
with:

4
.github/workflows/publish-blog.yml

@ -21,8 +21,8 @@ jobs:
- name: Build blogs
run: |
cd packages/noco-blog
npm install
npm run generate
pnpm install
pnpm run generate
- name: Pushes generated output

4
.github/workflows/publish-dev-docs.yml

@ -24,8 +24,8 @@ jobs:
- name: Build docs
run: |
cd packages/noco-docs
npm install
npm run generate
pnpm install
pnpm run generate
- name: Pushes generated output

4
.github/workflows/publish-docs.yml

@ -23,8 +23,8 @@ jobs:
- name: Build docs
run: |
cd packages/noco-docs
npm install
npm run generate
pnpm install
pnpm run generate
- name: Pushes generated output
uses: dmnemec/copy_file_to_another_repo_action@1b29cbd9a323185f20b175dc6d5f8f31be5c0658
env:

4
.github/workflows/publish-noco-i18n.yml

@ -23,8 +23,8 @@ jobs:
- name: Build noco-i18n
run: |
cd packages/noco-i18n
npm install
npm run generate
pnpm install
pnpm run generate
- name: Pushes generated output

4
.github/workflows/publish-prev-docs.yml

@ -23,8 +23,8 @@ jobs:
- name: Build prev docs
run: |
cd packages/noco-docs-prev
npm install
npm run generate
pnpm install
pnpm run generate
- name: Pushes generated output

10
.github/workflows/release-docker.yml

@ -88,23 +88,23 @@ jobs:
export NODE_OPTIONS="--max_old_space_size=16384"
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} node scripts/bumpNocodbSdkVersion.js
cd packages/nocodb-sdk
npm install && npm run build
pnpm install && pnpm run build
cd ../..
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNocodbSdk.js &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} node scripts/bumpNcGuiVersion.js &&
cd packages/nc-gui
npm install
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} npm run build:copy
pnpm install
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} pnpm run build:copy
cd ../..
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNcGui.js
- uses: bahmutov/npm-install@v1
- uses: bahmutov/pnpm-install@v1
with:
working-directory: ${{ env.working-directory }}
- name: Build nocodb and docker files
run: |
npm run docker:build
pnpm run docker:build
working-directory: ${{ env.working-directory }}
- name: Set up QEMU

14
.github/workflows/release-executables.yml

@ -23,13 +23,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Cache node modules
id: cache-npm
id: cache-pnpm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
# pnpm cache files are stored in `~/.pnpm` on Linux/macOS
path: ~/.pnpm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
@ -71,10 +71,10 @@ jobs:
cd ./scripts/pkg-executable
# Install nocodb version based on provided tag name
npm i -E nocodb@${{ github.event.inputs.tag || inputs.tag }}
pnpm i -E nocodb@${{ github.event.inputs.tag || inputs.tag }}
# install npm dependendencies
npm i
# install pnpm dependendencies
pnpm i
# Build sqlite binaries for all platforms
./node_modules/.bin/node-pre-gyp install --directory=./node_modules/sqlite3 --target_platform=win32 --fallback-to-build --target_arch=x64 --target_libc=unknown
@ -90,7 +90,7 @@ jobs:
npx modclean --patterns="default:*" --ignore="nc-lib-gui/**,nocodb/**,dayjs/**,express-status-monitor/**,sqlite3/**" --run
# build executables
npm run build
pnpm run build
ls ./dist

10
.github/workflows/release-nightly-dev.yml

@ -43,10 +43,10 @@ jobs:
nightly_build_tag: ${{ steps.tag-step.outputs.NIGHTLY_BUILD_TAG }}
is_daily: ${{ steps.tag-step.outputs.IS_DAILY }}
current_version: ${{ steps.tag-step.outputs.CURRENT_VERSION }}
# Build frontend and backend and publish to npm
release-npm:
# Build frontend and backend and publish to pnpm
release-pnpm:
needs: set-tag
uses: ./.github/workflows/release-npm.yml
uses: ./.github/workflows/release-pnpm.yml
with:
tag: ${{ needs.set-tag.outputs.nightly_build_tag }}
targetEnv: 'DEV'
@ -55,7 +55,7 @@ jobs:
# Build executables and publish to GitHub
release-executables:
needs: [set-tag, release-npm]
needs: [set-tag, release-pnpm]
uses: ./.github/workflows/release-timely-executables.yml
with:
tag: ${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.nightly_build_tag }}
@ -64,7 +64,7 @@ jobs:
# Build docker image and push to docker hub
release-docker:
needs: [set-tag, release-npm]
needs: [set-tag, release-pnpm]
uses: ./.github/workflows/release-docker.yml
with:
currentVersion: ${{ needs.set-tag.outputs.current_version }}

8
.github/workflows/release-nocodb.yml

@ -60,10 +60,10 @@ jobs:
tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
# Build, install, publish frontend and backend to npm
release-npm:
# Build, install, publish frontend and backend to pnpm
release-pnpm:
needs: [pr-to-master, process-input]
uses: ./.github/workflows/release-npm.yml
uses: ./.github/workflows/release-pnpm.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}
targetEnv: ${{ github.event.inputs.targetEnv || 'PROD' }}
@ -72,7 +72,7 @@ jobs:
# Draft Release Note
release-draft-note:
needs: [release-npm, process-input]
needs: [release-pnpm, process-input]
uses: ./.github/workflows/release-draft.yml
with:
tag: ${{ needs.process-input.outputs.target_tag }}

12
.github/workflows/release-npm.yml

@ -1,4 +1,4 @@
name: "Release : NPM packages"
name: "Release : pnpm packages"
on:
# Triggered manually
@ -42,8 +42,8 @@ jobs:
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: NPM Setup and Publish with 16.15.0
# Setup .npmrc file to publish to npm
- name: pnpm Setup and Publish with 16.15.0
# Setup .npmrc file to publish to pnpm
uses: actions/setup-node@v3
with:
node-version: 16.15.0
@ -52,17 +52,17 @@ jobs:
export NODE_OPTIONS="--max_old_space_size=16384"
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} node scripts/bumpNocodbSdkVersion.js &&
cd packages/nocodb-sdk &&
pnpm install && npm run build && npm publish &&
pnpm install && pnpm run build && pnpm publish &&
cd ../.. &&
sleep 60 &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNocodbSdk.js &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} node scripts/bumpNcGuiVersion.js &&
cd packages/nc-gui &&
pnpm install &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} npm run build:copy:publish &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} targetVersion=${{ github.event.inputs.tag || inputs.tag }} pnpm run build:copy:publish &&
cd ../.. &&
sleep 60 &&
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNcGui.js && cd packages/nocodb && npm install && npm run obfuscate:build:publish
targetEnv=${{ github.event.inputs.targetEnv || inputs.targetEnv }} node scripts/upgradeNcGui.js && cd packages/nocodb && pnpm install && pnpm run obfuscate:build:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Pull Request

10
.github/workflows/release-pr.yml

@ -46,11 +46,11 @@ jobs:
target_tag: ${{ steps.tag-step.outputs.TARGET_TAG }}
current_version: ${{ steps.tag-step.outputs.CURRENT_VERSION }}
# Build, install, publish frontend and backend to npm
release-npm:
# Build, install, publish frontend and backend to pnpm
release-pnpm:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
needs: [set-tag]
uses: ./.github/workflows/release-npm.yml
uses: ./.github/workflows/release-pnpm.yml
with:
tag: ${{ needs.set-tag.outputs.target_tag }}
targetEnv: 'DEV'
@ -60,7 +60,7 @@ jobs:
# Build docker image and push to docker hub
release-docker:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
needs: [release-npm, set-tag]
needs: [release-pnpm, set-tag]
uses: ./.github/workflows/release-docker.yml
with:
currentVersion: ${{ needs.set-tag.outputs.current_version }}
@ -74,7 +74,7 @@ jobs:
# Build executables and publish to GitHub
# release-executables:
# if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' && github.event.pull_request.draft == false && github.base_ref == 'develop' && github.event.action != 'closed' }}
# needs: [set-tag, release-npm]
# needs: [set-tag, release-pnpm]
# uses: ./.github/workflows/release-timely-executables.yml
# with:
# tag: ${{ needs.set-tag.outputs.current_version }}-${{ needs.set-tag.outputs.target_tag }}

14
.github/workflows/release-timely-executables.yml

@ -26,13 +26,13 @@ jobs:
token: ${{ secrets.NC_GITHUB_TOKEN }}
repository: 'nocodb/nocodb-timely'
- name: Cache node modules
id: cache-npm
id: cache-pnpm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
# pnpm cache files are stored in `~/.pnpm` on Linux/macOS
path: ~/.pnpm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
@ -70,7 +70,7 @@ jobs:
env:
TAG: ${{ github.event.inputs.tag || inputs.tag }}
run: |
npm i -E nocodb-daily@$TAG
pnpm i -E nocodb-daily@$TAG
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
@ -81,8 +81,8 @@ jobs:
- name : Install dependencies and build executables
run: |
# install npm dependendencies
npm i
# install pnpm dependendencies
pnpm i
# Copy sqlite binaries
# rsync -rvzhP ./binaries/binding/ ./node_modules/sqlite3/lib/binding/
@ -105,7 +105,7 @@ jobs:
npx modclean --patterns="default:*" --ignore="nc-lib-gui-daily/**,nocodb-daily/**,dayjs/**,express-status-monitor/**,sqlite3/**" --run
# build executables
npm run build
pnpm run build
mkdir ./mac-dist
mv ./dist/Noco-macos-arm64 ./mac-dist/

6
.github/workflows/unit-test.yml

@ -29,16 +29,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: 'pnpm'
- name: install dependencies nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: pnpm install
- name: build nocodb-sdk
working-directory: ./packages/nocodb-sdk
run: npm run build:main
run: pnpm run build:main
- name: install dependencies nocodb
working-directory: ./packages/nocodb
run: pnpm install
- name: run unit tests
working-directory: ./packages/nocodb
run: npm run unit-test
run: pnpm run unit-test

4
.github/workflows/update-sdk-path.yml

@ -20,10 +20,10 @@ jobs:
- run: |
cd packages/nocodb
npm install --save --save-exact nocodb-sdk@file:../nocodb-sdk
pnpm install --save --save-exact nocodb-sdk@file:../nocodb-sdk
cd ../..
cd packages/nc-gui
npm install --save --save-exact nocodb-sdk@file:../nocodb-sdk
pnpm install --save --save-exact nocodb-sdk@file:../nocodb-sdk
- name: Create Pull Request
id: cpr

Loading…
Cancel
Save