diff --git a/.changeset/eleven-numbers-jam.md b/.changeset/eleven-numbers-jam.md new file mode 100644 index 0000000000..f134a6e79c --- /dev/null +++ b/.changeset/eleven-numbers-jam.md @@ -0,0 +1,18 @@ +--- +'@credo-ts/openid4vc': patch +'@credo-ts/core': patch +'@credo-ts/node': patch +'@credo-ts/action-menu': patch +'@credo-ts/anoncreds': patch +'@credo-ts/askar': patch +'@credo-ts/bbs-signatures': patch +'@credo-ts/cheqd': patch +'@credo-ts/drpc': patch +'@credo-ts/indy-sdk-to-askar-migration': patch +'@credo-ts/indy-vdr': patch +'@credo-ts/question-answer': patch +'@credo-ts/react-native': patch +'@credo-ts/tenants': patch +--- + +feat: support node 22 diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 8997c3067d..8d1430d9a7 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -4,13 +4,10 @@ on: pull_request: branches: - main - - '**-pre' - types: [opened, synchronize, reopened, labeled] push: branches: - main - - '**-pre' - workflow_dispatch: + pull_request_review: env: NODE_OPTIONS: --max_old_space_size=6144 @@ -24,44 +21,19 @@ concurrency: cancel-in-progress: true jobs: - # PRs created by github actions won't trigger CI. Before we can merge a PR we need to run the tests and - # validation scripts. To still be able to run the CI we can manually trigger it by adding the 'ci-test' - # label to the pull request - ci-trigger: - runs-on: ubuntu-20.04 - outputs: - triggered: ${{ steps.check.outputs.triggered }} - steps: - - name: Determine if CI should run - id: check - run: | - if [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" == "ci-test" ]]; then - export SHOULD_RUN='true' - elif [[ "${{ github.event.action }}" == "labeled" && "${{ github.event.label.name }}" != "ci-test" ]]; then - export SHOULD_RUN='false' - else - export SHOULD_RUN='true' - fi - - echo "SHOULD_RUN: ${SHOULD_RUN}" - echo triggered="${SHOULD_RUN}" >> "$GITHUB_OUTPUT" - validate: runs-on: ubuntu-20.04 name: Validate + if: github.event_name != 'pull_request_review' || github.event.pull_request.head.ref == 'changeset-release/main' steps: - - name: Checkout credo-ts - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v2 - with: - version: 9.1.0 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 - name: Setup NodeJS uses: actions/setup-node@v4 with: - node-version: 18 - cache: 'pnpm' + node-version: 22 + cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile @@ -81,19 +53,20 @@ jobs: unit-tests: runs-on: ubuntu-20.04 name: Unit Tests + if: github.event_name != 'pull_request_review' || github.event.pull_request.head.ref == 'changeset-release/main' strategy: fail-fast: false matrix: - node-version: [18, 20] + node-version: [18, 20, 22] # Each shard runs a set of the tests # Make sure to UPDATE THE TEST command with the total length of # the shards if you change this!! shard: [1, 2] steps: - - name: Checkout credo - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 - name: Setup NodeJS id: setup-node @@ -101,10 +74,6 @@ jobs: with: node-version: ${{ matrix.node-version }} - - uses: pnpm/action-setup@v2 - with: - version: 9.1.0 - # See https://github.com/actions/setup-node/issues/641#issuecomment-1358859686 - name: pnpm cache path id: pnpm-cache-path @@ -136,15 +105,15 @@ jobs: e2e-tests: runs-on: ubuntu-20.04 name: E2E Tests + if: github.event_name != 'pull_request_review' || github.event.pull_request.head.ref == 'changeset-release/main' strategy: fail-fast: false matrix: - node-version: [18, 20] + node-version: [18, 20, 22] steps: - - name: Checkout credo - uses: actions/checkout@v4 + - uses: actions/checkout@v4 # setup dependencies - name: Setup services @@ -156,9 +125,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - - uses: pnpm/action-setup@v2 - with: - version: 9.1.0 + - uses: pnpm/action-setup@v4 # See https://github.com/actions/setup-node/issues/641#issuecomment-1358859686 - name: pnpm cache path diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a27b93b9b8..951f3b065d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,18 +23,14 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 - - uses: pnpm/action-setup@v2 - with: - version: 9.1.0 - - - name: Setup Node.js 20.x + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20.x - cache: 'pnpm' + node-version: 22 + cache: pnpm - name: Install Dependencies run: pnpm install --frozen-lockfile @@ -43,11 +39,10 @@ jobs: id: changesets uses: changesets/action@v1 with: - # This expects you to have a script called release which does a build for your packages and calls changeset publish - publish: pnpm release title: 'chore(release): new version' commit: 'chore(release): new version' - createGithubReleases: false + publish: pnpm release + version: pnpm changeset-version env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_PUBLISH }} @@ -65,9 +60,6 @@ jobs: release-unstable: name: Release Unstable runs-on: ubuntu-latest - # We don't want to run release and release-unstable concurrently as NPM doesn't allow publishing packages while another version of the same package is - # still processing. So we wait for release to finish, and the always() ensure that it will run no matter the result of release. - needs: [release] if: "always() && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'openwallet-foundation/credo-ts') || (github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release): new version'))" steps: - uses: snnaplab/get-labels-action@v1 @@ -77,18 +69,14 @@ jobs: - if: github.event_name == 'pull_request' && !contains(fromJSON(env.LABELS), 'alpha-release') run: exit 0 - - name: Checkout Repo - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v2 - with: - version: 9.1.0 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 - - name: Setup Node.js 20.x + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20.x - cache: 'pnpm' + node-version: 22 + cache: pnpm - name: Install Dependencies run: pnpm install --frozen-lockfile diff --git a/package.json b/package.json index 0786d91883..da26740473 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "demo-openid", "samples/*" ], - "packageManager": "pnpm@9.1.0", + "packageManager": "pnpm@9.15.3+sha512.1f79bc245a66eb0b07c5d4d83131240774642caaa86ef7d0434ab47c0d16f66b04e21e0c086eb61e62c77efc4d7f7ec071afad3796af64892fae66509173893a", "repository": { "url": "https://github.com/openwallet-foundation/credo-ts", "type": "git" @@ -58,7 +58,7 @@ "eslint-plugin-workspaces": "^0.8.0", "express": "^4.17.1", "jest": "^29.7.0", - "nock": "^14.0.0-beta.16", + "nock": "^14.0.0-beta.19", "prettier": "^2.3.1", "rxjs": "^7.8.0", "supertest": "^7.0.0", diff --git a/packages/core/package.json b/packages/core/package.json index f10cc2cdb0..e20317fac4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -76,6 +76,6 @@ "rimraf": "^4.4.0", "tslog": "^4.8.2", "typescript": "~5.5.2", - "nock": "^14.0.0-beta.16" + "nock": "^14.0.0-beta.19" } } diff --git a/packages/node/package.json b/packages/node/package.json index 1748ba3bc6..e5508f6872 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -37,7 +37,7 @@ "devDependencies": { "@types/node": "^18.18.8", "@types/ws": "^8.5.4", - "nock": "^14.0.0-beta.16", + "nock": "^14.0.0-beta.19", "rimraf": "^4.4.0", "typescript": "~5.5.2" } diff --git a/packages/openid4vc/package.json b/packages/openid4vc/package.json index 9e4f8481cb..70f0dcaa49 100644 --- a/packages/openid4vc/package.json +++ b/packages/openid4vc/package.json @@ -40,7 +40,7 @@ "@credo-ts/tenants": "workspace:*", "@types/express": "^4.17.21", "express": "^4.18.2", - "nock": "^14.0.0-beta.16", + "nock": "^14.0.0-beta.19", "rimraf": "^4.4.0", "typescript": "~5.5.2" } diff --git a/packages/openid4vc/tests/openid4vc.e2e.test.ts b/packages/openid4vc/tests/openid4vc.e2e.test.ts index edd125832b..30ddf0a54c 100644 --- a/packages/openid4vc/tests/openid4vc.e2e.test.ts +++ b/packages/openid4vc/tests/openid4vc.e2e.test.ts @@ -3,7 +3,6 @@ import type { OpenId4VciSignMdocCredentials } from '../src' import type { OpenId4VciCredentialBindingResolver } from '../src/openid4vc-holder' import type { AuthorizationServerMetadata } from '@animo-id/oauth2' import type { DifPresentationExchangeDefinitionV2, JwkJson, Mdoc, MdocDeviceResponse, SdJwtVc } from '@credo-ts/core' -import type { Server } from 'http' import { calculateJwkThumbprint, @@ -40,6 +39,7 @@ import { import { ResponseMode } from '@sphereon/did-auth-siop' import express, { type Express } from 'express' +import { setupNockToExpress } from '../../../tests/nockToExpress' import { AskarModule } from '../../askar/src' import { askarModuleConfig } from '../../askar/tests/helpers' import { TenantsModule } from '../../tenants/src' @@ -72,7 +72,7 @@ const verificationBaseUrl = `${baseUrl}/oid4vp` describe('OpenId4Vc', () => { let expressApp: Express - let expressServer: Server + let cleanupMockServer: () => void let issuer: AgentType<{ openId4VcIssuer: OpenId4VcIssuerModule @@ -197,11 +197,11 @@ describe('OpenId4Vc', () => { expressApp.use('/oid4vci', issuer.agent.modules.openId4VcIssuer.config.router) expressApp.use('/oid4vp', verifier.agent.modules.openId4VcVerifier.config.router) - expressServer = expressApp.listen(serverPort) + cleanupMockServer = setupNockToExpress(baseUrl, expressApp) }) afterEach(async () => { - expressServer?.close() + cleanupMockServer() await issuer.agent.shutdown() await issuer.agent.wallet.delete() diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c40e72e73d..4025e4b884 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -94,8 +94,8 @@ importers: specifier: ^29.7.0 version: 29.7.0(@types/node@18.18.8)(ts-node@10.9.2(@types/node@18.18.8)(typescript@5.5.4)) nock: - specifier: ^14.0.0-beta.16 - version: 14.0.0-beta.16 + specifier: ^14.0.0-beta.19 + version: 14.0.0-beta.19 prettier: specifier: ^2.3.1 version: 2.8.8 @@ -576,8 +576,8 @@ importers: specifier: ^6.0.0 version: 6.0.3 nock: - specifier: ^14.0.0-beta.16 - version: 14.0.0-beta.16 + specifier: ^14.0.0-beta.19 + version: 14.0.0-beta.19 rimraf: specifier: ^4.4.0 version: 4.4.1 @@ -706,8 +706,8 @@ importers: specifier: ^8.5.4 version: 8.5.12 nock: - specifier: ^14.0.0-beta.16 - version: 14.0.0-beta.16 + specifier: ^14.0.0-beta.19 + version: 14.0.0-beta.19 rimraf: specifier: ^4.4.0 version: 4.4.1 @@ -755,8 +755,8 @@ importers: specifier: ^4.18.2 version: 4.19.2 nock: - specifier: ^14.0.0-beta.16 - version: 14.0.0-beta.16 + specifier: ^14.0.0-beta.19 + version: 14.0.0-beta.19 rimraf: specifier: ^4.4.0 version: 4.4.1 @@ -2643,8 +2643,8 @@ packages: resolution: {integrity: sha512-s9ccL/1TTvCP1N//4QR84j/d5D/stx/AI1kPcRgiE4O3KrxyF7ZdL9ca8fmFuN6yh9LAbn/OiGRnOXgvn38Dgg==} engines: {node: '>=14', yarn: 1.x} - '@mswjs/interceptors@0.36.9': - resolution: {integrity: sha512-mMRDUBwSNeCgjSMEWfjoh4Rm9fbyZ7xQ9SBq8eGHiiyRn1ieTip3pNEt0wxWVPPxR4i1Rv9bTkeEbkX7M4c15A==} + '@mswjs/interceptors@0.37.5': + resolution: {integrity: sha512-AAwRb5vXFcY4L+FvZ7LZusDuZ0vEe0Zm8ohn1FM6/X7A3bj4mqmkAcGRWuvC2JwSygNwHAAmMnAI73vPHeqsHA==} engines: {node: '>=18'} '@multiformats/base-x@4.0.1': @@ -6331,8 +6331,8 @@ packages: resolution: {integrity: sha512-WDD0bdg9mbq6F4mRxEYcPWwfA1vxd0mrvKOyxI7Xj/atfRHVeutzuWByG//jfm4uPzp0y4Kj051EORCBSQMycw==} engines: {node: '>=12.0.0'} - nock@14.0.0-beta.16: - resolution: {integrity: sha512-H6ZyT+Naz9wfy0gNrhD0m+VIkCq9li/eaNQPEUEjXg06gsLR3/jDctROt44Z+iT3gFnkTQ0wXtwKJPdvbueBbg==} + nock@14.0.0-beta.19: + resolution: {integrity: sha512-xqWQQZ/Hv01tj5uL7BE4j752hhB2MHP7aaEcTp/iDT1EHsh3TYZOIx4HHFL81yRc8KFx4pqb2P2OtuxKShKhjw==} engines: {node: '>= 18'} node-addon-api@3.2.1: @@ -11770,7 +11770,7 @@ snapshots: - supports-color optional: true - '@mswjs/interceptors@0.36.9': + '@mswjs/interceptors@0.37.5': dependencies: '@open-draft/deferred-promise': 2.2.0 '@open-draft/logger': 0.3.0 @@ -17294,9 +17294,9 @@ snapshots: nocache@3.0.4: {} - nock@14.0.0-beta.16: + nock@14.0.0-beta.19: dependencies: - '@mswjs/interceptors': 0.36.9 + '@mswjs/interceptors': 0.37.5 json-stringify-safe: 5.0.1 propagate: 2.0.1