Skip to content

Commit

Permalink
feat: switch to pnpm (#80)
Browse files Browse the repository at this point in the history
* chore: fix linting issues

* chore: linting warning

* chore: fix sonarcube warnings

* chore: downgrade node

* chore: same eslint config everywhere

* chore: use local typescript version

* chore: some package fixes

* fix: provider bug

* fix: add ethereum param

* chore: fix linting problems

* fix: dep bug

* fix: multiformats

* fix: docs linting error

* fix: docs

* fix: some fixes and remove comments

* tests: fix duplicate imports

* tests: fix missing imports

* fix: change jest config

* chore: some updates

* chore: fixes linting issues

* fix: fix tests

* feat: switch to pnpm and fix multiformats issue

* chore: add correct lock-file

* chore: fix workflows

* chore: fix running tests

* chore: fix workflows

* chore: fix test

* fix: tests

* fix: fixes most tests

* chore: commit pnpm-lock

* fix: fixes publish workflow

Co-authored-by: martines3000 <domajnko.martin@gmail.com>
  • Loading branch information
andyv09 and martines3000 committed Feb 27, 2023
1 parent d89194d commit 688fe61
Show file tree
Hide file tree
Showing 92 changed files with 21,354 additions and 28,270 deletions.
20 changes: 19 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
module.exports = {
root: true,
extends: [
'airbnb-base',
'airbnb-typescript/base',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint/eslint-plugin'],
parser: '@typescript-eslint/parser',
rules: { 'prettier/prettier': ['error', { singleQuote: true }] },
rules: {
'import/prefer-default-export': 0,
'class-methods-use-this': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.spec.ts',
'**/*.e2e-spec.ts',
'**/webpack.config.ts',
],
},
],
'prettier/prettier': ['error', { singleQuote: true }],
},
ignorePatterns: [
'**/node_modules/**',
'**/dist/**',
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ jobs:
uses: ./.github/workflows/nx-cloud-main.yml
secrets: inherit
with:
node-version: 18.12.1
node-version: 18.13.0
number-of-agents: 3
main-branch-name: 'develop'
init-commands: |
yarn exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3
pnpm exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3
parallel-commands-on-agents: |
yarn exec nx affected --target=lint --parallel=3
yarn exec nx affected --target=test:ci --parallel=3
yarn exec nx affected --target=build --parallel=3
pnpm exec nx affected --target=lint --parallel=3
pnpm exec nx affected --target=test:ci --parallel=3
pnpm exec nx affected --target=build --parallel=3
agents:
name: Nx Cloud - Agents
uses: ./.github/workflows/nx-cloud-agents.yml
secrets: inherit
with:
number-of-agents: 3
node-version: 18.12.1
node-version: 18.13.0
26 changes: 17 additions & 9 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ jobs:
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'develop'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.25.1
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: yarn
node-version: 18.13.0
cache: pnpm
- name: Install dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile
- name: Lint
run: yarn nx run @blockchain-lab-um/ssi-snap-docs:lint
run: pnpm nx run @blockchain-lab-um/ssi-snap-docs:lint
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Test build website
run: yarn nx run @blockchain-lab-um/ssi-snap-docs:build
run: pnpm nx run @blockchain-lab-um/ssi-snap-docs:build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

Expand Down Expand Up @@ -71,10 +75,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.25.1
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: yarn
node-version: 18.13.0
cache: pnpm
- uses: webfactory/ssh-agent@v0.6.0
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
Expand All @@ -84,5 +92,5 @@ jobs:
run: |
git config --global user.email "andraz.vrecko@gmail.com"
git config --global user.name "andyv09"
yarn install --immutable
yarn deploy:docs
pnpm install --frozen-lockfile
pnpm deploy:docs
28 changes: 18 additions & 10 deletions .github/workflows/deploy_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ jobs:
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'develop'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.25.1
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: yarn
node-version: 18.13.0
cache: pnpm
- name: Install dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile
- name: Lint
run: yarn nx run @blockchain-lab-um/website:lint
run: pnpm nx run @blockchain-lab-um/website:lint
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Test build website
run: yarn nx run @blockchain-lab-um/website:build
run: pnpm nx run @blockchain-lab-um/website:build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

Expand Down Expand Up @@ -76,18 +80,22 @@ jobs:
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'develop'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.25.1
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: yarn
node-version: 18.13.0
cache: pnpm
- name: Install dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile
- name: Lint
run: yarn nx run @blockchain-lab-um/website:lint
run: pnpm nx run @blockchain-lab-um/website:lint
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Test build website
run: yarn nx run @blockchain-lab-um/website:build
run: pnpm nx run @blockchain-lab-um/website:build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Deploy to GitHub Pages
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
node-version: 18.12.1
version: 7.25.1
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18.13.0
registry-url: https://registry.npmjs.org/
cache: 'yarn'
cache-depndency-path: '**/yarn.lock'
- run: yarn install --immutable
- run: yarn build
cache: 'pnpm'
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- env:
- name: Publish
run: npm publish -w @blockchain-lab-um/ssi-snap -w @blockchain-lab-um/ssi-snap-connector -w @blockchain-lab-um/veramo-vc-manager -w @blockchain-lab-um/ssi-snap-types
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
run: |
echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml
- run: yarn workspaces foreach -v --exclude root --no-private npm publish --tolerate-republish --access public
12 changes: 8 additions & 4 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@ jobs:
- uses: nrwl/nx-set-shas@v3
with:
main-branch-name: 'develop'
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7.25.1
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: yarn
node-version: 18.13.0
cache: pnpm
- name: Install dependencies
run: yarn install --immutable
run: pnpm install --frozen-lockfile
- name: Test
run: yarn run test:ci
run: pnpm run test:ci
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: SonarQube Scan
Expand Down
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit $1
pnpm commitlint --edit $1
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.12.1
v18.13.0
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ build
dist
.docusaurus
coverage
CHANGELOG.md
pnpm-lock.yaml
pnpm-workspace.yaml
9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-engines.cjs

This file was deleted.

Loading

0 comments on commit 688fe61

Please sign in to comment.