Skip to content

Commit

Permalink
feat: Move to pnpm from yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Apr 17, 2023
1 parent 91f4f86 commit 6ed9bd5
Show file tree
Hide file tree
Showing 15 changed files with 15,814 additions and 12,892 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build-test-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '16.x'
- run: yarn install
- run: yarn bootstrap
- run: yarn build
cache: 'pnpm'
- run: pnpm add -g pnpm
- run: pnpm install
- run: pnpm build
- name: run CI tests
env:
INCLUDE_POSTGRES_TESTS: true
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test123
POSTGRES_PORT: 5432
run: yarn test:ci
run: pnpm test:ci
- run: npx codecov
32 changes: 12 additions & 20 deletions .github/workflows/build-test-publish-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,20 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '16.x'

# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "::set-output name=dir::$(yarn cache dir)"
# - uses: actions/cache@v2
# id: yarn-cache
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-2-${{ hashFiles('**/package.json') }}

- run: yarn install
- run: yarn bootstrap
- run: yarn build
- name: run integration tests
cache: 'pnpm'
- run: pnpm add -g pnpm
- run: pnpm install
- run: pnpm build
- name: run CI tests
env:
INCLUDE_POSTGRES_TESTS: true
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test123
POSTGRES_PORT: 5432
run: yarn test:ci
- run: git diff -u yarn.lock
run: pnpm test:ci
- run: npx codecov
- run: git diff -u pnpm-lock.yaml

- name: setup git coordinates
run: |
Expand All @@ -71,16 +63,16 @@ jobs:
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
# npm whoami

- run: git diff -u yarn.lock
- run: git diff -u pnpm-lock.yaml

- name: publish @latest when on main
if: github.ref == 'refs/heads/main'
run: yarn publish:latest
run: pnpm publish:latest

- name: publish @next when on develop
if: github.ref == 'refs/heads/develop'
run: yarn publish:next
run: pnpm publish:next

- name: publish @unstable when on unstable branch
if: startsWith(github.ref, 'refs/heads/feat')
run: yarn publish:unstable
run: pnpm publish:unstable
2 changes: 1 addition & 1 deletion jest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}]
},
"transformIgnorePatterns": [
".*node_modules/(?!(nist-weierstrauss|multiformatsgggggg)/)"
"node_modules/(?!(?:.pnpm/)?(nist-weierstrauss|multiformatsgggggg))"
],
"testMatch": [
"**/__tests__/**/*.test.*",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"packages": ["packages/*"],
"version": "0.10.1",
"npmClient": "yarn",
"npmClient": "pnpm",
"command": {
"publish": {
"allowBranch": ["main", "master"],
Expand Down
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,22 @@
"author": "Sphereon <[email protected]>",
"license": "Apache-2.0",
"scripts": {
"build": "lerna run build && yarn build:copyfiles && yarn build:schema-api",
"build:schema-api": "lerna run extract-api && lerna run generate-plugin-schema",
"build:copyfiles": "lerna run build:copyfiles",
"preinstall": "npx only-allow pnpm",
"build": "pnpm build:js && pnpm build:copyfiles && pnpm build:api && pnpm build:schema",
"build:js": "pnpm -r --stream build",
"build:api": "pnpm --package=@veramo/cli -c dlx \"pnpm -r --stream extract-api\"",
"build:schema": "pnpm --package=@veramo/cli -c dlx \"pnpm -r --stream generate-plugin-schema\"",
"build:copyfiles": "pnpm -r --stream build:copyfiles",
"bootstrap": "lerna bootstrap",
"test:ci": "jest --config=jest.json",
"test": "jest --verbose --config=jest.json --coverage=true --detectOpenHandles",
"test:watch": "yarn test --watch --verbose",
"test:watch": "pnpm test --watch --verbose",
"test:lint": "eslint . --ext .ts",
"prettier": "prettier --write \"{packages,__tests__,!dist}/**/*.{ts,tsx,js,json,md,yml}\"",
"build-clean": "rimraf ./packages/*/dist ./packages/*/api ./packages/*/node_modules ./packages/*/tsconfig.tsbuildinfo && jest --clearCache",
"publish:latest": "lerna publish --conventional-commits --include-merged-tags --create-release github --yes --dist-tag latest --registry https://registry.npmjs.org",
"publish:next": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid next --pre-dist-tag next --yes --registry https://registry.npmjs.org",
"publish:unstable": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes --registry https://registry.npmjs.org",
"postinstall": "patch-package"
},
"workspaces": {
"nohoist": [
"multiformats"
],
"packages": [
"./packages/*"
]
"publish:unstable": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes --registry https://registry.npmjs.org"
},
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -101,9 +95,9 @@
"@veramo/remote-server": "4.2.0",
"@veramo/selective-disclosure": "4.2.0",
"@veramo/url-handler": "4.2.0",
"**/@digitalcredentials/ed25519-verification-key-2020": "3.2.2",
"**/jsonld": "npm:@digitalcredentials/jsonld@^5.2.1",
"**/isomorphic-webcrypto": "link:./node_modules/@sphereon/isomorphic-webcrypto"
"@digitalcredentials/ed25519-verification-key-2020": "3.2.2",
"jsonld": "npm:@digitalcredentials/jsonld@^5.2.1",
"isomorphic-webcrypto": "link:./node_modules/@sphereon/isomorphic-webcrypto"
},
"engines": {
"node": ">= 16.0.0"
Expand All @@ -113,5 +107,10 @@
"semi": false,
"singleQuote": true,
"printWidth": 150
},
"pnpm": {
"patchedDependencies": {
"@veramo/[email protected]": "patches/@[email protected]"
}
}
}
1 change: 1 addition & 0 deletions packages/did-provider-jwk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@veramo/did-manager": "4.2.0",
"debug": "^4.3.4",
"did-resolver": "^4.1.0",
"base64url": "^3.0.1",
"elliptic": "^6.5.4"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/did-provider-key/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"dependencies": {
"@transmute/did-key-bls12381": "^0.3.0-unstable.10",
"@sphereon/did-resolver-key": "^0.10.1",
"@veramo/did-provider-key": "4.2.0",
"@veramo/core": "4.2.0",
"@veramo/did-manager": "4.2.0",
"did-resolver": "^4.1.0",
"debug": "^4.3.4",
"multibase": "^4.0.6",
"multicodec": "^3.2.1"
Expand Down
1 change: 1 addition & 0 deletions packages/did-resolver-key/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@stablelib/ed25519": "^1.0.3",
"did-resolver": "^4.1.0",
"multiformats": "^9.9.0",
"uint8arrays": "^3.1.1",
"lodash.isplainobject": "^4.0.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/key-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"scripts": {
"build": "tsc --build",
"generate-plugin-schema": "yarn veramo dev generate-plugin-schema"
"generate-plugin-schema": "pnpm veramo dev generate-plugin-schema"
},
"dependencies": {
"@mattrglobal/bbs-signatures": "^1.1.0",
Expand Down
12 changes: 9 additions & 3 deletions packages/kms-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc --build",
"generate-plugin-schema": "yarn veramo dev extract-api"
"generate-plugin-schema": "pnpm veramo dev extract-api"
},
"dependencies": {
"@mattrglobal/bbs-signatures": "^1.1.0",
"@sphereon/isomorphic-webcrypto": "^2.4.0-unstable.4",
"@sphereon/ssi-sdk-did-utils": "^0.9.0",
"@stablelib/sha256": "^1.0.1",
"@stablelib/sha512": "^1.0.1",
"uint8arrays": "3.1.1",
"@trust/keyto": "^2.0.0-alpha1",
"@veramo/core": "4.2.0"
"@veramo/core": "4.2.0",
"@veramo/key-manager": "4.2.0",
"@veramo/kms-local": "4.2.0"
},
"devDependencies": {
"@veramo/cli": "4.2.0"
"@veramo/cli": "4.2.0",
"@sphereon/jsencrypt": "^3.3.2-unstable.0"
},
"resolutions": {
"**/@digitalcredentials/ed25519-verification-key-2020": "3.2.2"
Expand Down
26 changes: 13 additions & 13 deletions patches/@veramo+core+4.2.0.patch → patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/node_modules/@veramo/core/build/types/IIdentifier.d.ts b/node_modules/@veramo/core/build/types/IIdentifier.d.ts
index ace5497..d69eccd 100644
--- a/node_modules/@veramo/core/build/types/IIdentifier.d.ts
+++ b/node_modules/@veramo/core/build/types/IIdentifier.d.ts
diff --git a/build/types/IIdentifier.d.ts b/build/types/IIdentifier.d.ts
index ace5497d95205df6fce3de304eae4293883b5e93..d69eccd2b587b5ec260e44bac3712ea13c02da4a 100644
--- a/build/types/IIdentifier.d.ts
+++ b/build/types/IIdentifier.d.ts
@@ -43,7 +43,7 @@ export type MinimalImportableIdentifier = {
*
* @public
Expand All @@ -11,10 +11,10 @@ index ace5497..d69eccd 100644
/**
* Cryptographic key
* @public
diff --git a/node_modules/@veramo/core/plugin.schema.json b/node_modules/@veramo/core/plugin.schema.json
index f33bd89..6b686d4 100644
--- a/node_modules/@veramo/core/plugin.schema.json
+++ b/node_modules/@veramo/core/plugin.schema.json
diff --git a/plugin.schema.json b/plugin.schema.json
index f33bd89e6154d8c191bcb18bdff42764e99febed..38c63c18924e24801db60690fb060c7f530fb973 100644
--- a/plugin.schema.json
+++ b/plugin.schema.json
@@ -476,7 +476,8 @@
"Secp256r1",
"X25519",
Expand Down Expand Up @@ -45,10 +45,10 @@ index f33bd89..6b686d4 100644
],
"description": "Cryptographic key type."
},
diff --git a/node_modules/@veramo/core/src/types/IIdentifier.ts b/node_modules/@veramo/core/src/types/IIdentifier.ts
index ee063bd..3002bb8 100644
--- a/node_modules/@veramo/core/src/types/IIdentifier.ts
+++ b/node_modules/@veramo/core/src/types/IIdentifier.ts
diff --git a/src/types/IIdentifier.ts b/src/types/IIdentifier.ts
index ee063bdb7611b0552801b73ec664413f7c7246f4..3002bb85a7f4a8a8719ef50622e17546b3864735 100644
--- a/src/types/IIdentifier.ts
+++ b/src/types/IIdentifier.ts
@@ -51,7 +51,7 @@ export type MinimalImportableIdentifier = {
*
* @public
Expand All @@ -57,4 +57,4 @@ index ee063bd..3002bb8 100644
+export type TKeyType = 'Ed25519' | 'Secp256k1' | 'Secp256r1' | 'X25519' | 'Bls12381G1' | 'Bls12381G2' | 'RSA'

/**
* Cryptographic key
* Cryptographic key
Loading

0 comments on commit 6ed9bd5

Please sign in to comment.