From e7130ccb3bf53edd45e8302db9ad18e1de8d78c4 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Thu, 6 Jul 2023 09:20:57 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Ensure=20package=20export=20Node.js=20v12.1?= =?UTF-8?q?8=20test=20doesn=E2=80=99t=20use=20`--conditions`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re likely to add more package export matrix combinations in future But the flag `--conditions` was only added in Node.js v12.19.0 So rather than do the hard job to “opt out” Node.js 12.18.0 from _every_ incompatible matrix combination, let’s just “opt in” to the package export tests we know will run --- .github/workflows/tests.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6855af4b45..9e5498e176 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -241,17 +241,16 @@ jobs: matrix: node-version: - - 12.18 # Node.js 12.18 uses package exports with trailing slashes - - 12 # But Node.js 12.20+ uses package exports with subpath patterns - - 18 + - 12 # Node.js 12.20+ uses package exports with subpath patterns + - 18 # Node.js 17+ cannot use package exports with trailing slashes conditions: - require - import - exclude: - - conditions: import - node-version: 12.18 + include: + - conditions: require + node-version: 12.18 # Node.js 12.18 uses package exports with trailing slashes env: # Node.js conditions override from "require" to "import" etc From 5b5d364477d1f2b3472dcd0a2df565c95c092373 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Thu, 13 Jul 2023 13:06:35 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Skip=20cache=20=E2=80=9CRestore=20dependenc?= =?UTF-8?q?ies=E2=80=9D=20for=20package=20export=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e5498e176..1773a8b1d7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -261,9 +261,6 @@ jobs: - name: Checkout uses: actions/checkout@v3.5.3 - - name: Restore dependencies - uses: ./.github/workflows/actions/install-node - - name: Restore build uses: ./.github/workflows/actions/build @@ -273,10 +270,19 @@ jobs: node-version: ${{ matrix.node-version }} - run: node --eval "console.log(require.resolve('govuk-frontend'))"${{ env.FLAGS }} + working-directory: packages/govuk-frontend + - run: node --eval "console.log(require.resolve('govuk-frontend/package.json'))"${{ env.FLAGS }} + working-directory: packages/govuk-frontend + - run: node --eval "console.log(require.resolve('govuk-frontend/dist/govuk/components/accordion/accordion.bundle.js'))"${{ env.FLAGS }} + working-directory: packages/govuk-frontend + - run: node --eval "console.log(require.resolve('govuk-frontend/dist/govuk/components/accordion/accordion.bundle.mjs'))"${{ env.FLAGS }} + working-directory: packages/govuk-frontend + - run: node --eval "console.log(require.resolve('govuk-frontend/dist/govuk/i18n.mjs'))"${{ env.FLAGS }} + working-directory: packages/govuk-frontend regression: name: Percy From 9a9f69a66c0751daf7c4f962743b444eb7826101 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Thu, 13 Jul 2023 12:58:19 +0100 Subject: [PATCH 3/3] Add Node.js v20 to package export tests Node.js v20 reaches LTS in October 2023 so good to test early --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1773a8b1d7..488f9d4c04 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -243,6 +243,7 @@ jobs: node-version: - 12 # Node.js 12.20+ uses package exports with subpath patterns - 18 # Node.js 17+ cannot use package exports with trailing slashes + - 20 conditions: - require