From f8370606751ff98ba4caee18c4cfcc858effb79c Mon Sep 17 00:00:00 2001 From: Paulo Margarido <64600052+paulomarg@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:24:19 -0400 Subject: [PATCH 1/2] Remove node 14 support --- .changeset/chilled-bobcats-brush.md | 24 +++++++++++++++++ .github/workflows/ci.yml | 5 ++-- packages/shopify-app-express/loom.config.ts | 2 +- packages/shopify-app-remix/loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../src/__tests__/kv.test.actual.ts | 21 --------------- .../src/__tests__/kv.test.ts | 26 ++++++++++++++----- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- .../loom.config.ts | 2 +- 17 files changed, 58 insertions(+), 44 deletions(-) create mode 100644 .changeset/chilled-bobcats-brush.md delete mode 100644 packages/shopify-app-session-storage-kv/src/__tests__/kv.test.actual.ts diff --git a/.changeset/chilled-bobcats-brush.md b/.changeset/chilled-bobcats-brush.md new file mode 100644 index 0000000000..85937aa749 --- /dev/null +++ b/.changeset/chilled-bobcats-brush.md @@ -0,0 +1,24 @@ +--- +'@shopify/shopify-app-remix': major +'@shopify/shopify-app-express': major +'@shopify/shopify-app-session-storage': major +'@shopify/shopify-app-session-storage-dynamodb': major +'@shopify/shopify-app-session-storage-kv': major +'@shopify/shopify-app-session-storage-memory': major +'@shopify/shopify-app-session-storage-mongodb': major +'@shopify/shopify-app-session-storage-mysql': major +'@shopify/shopify-app-session-storage-postgresql': major +'@shopify/shopify-app-session-storage-prisma': major +'@shopify/shopify-app-session-storage-redis': major +'@shopify/shopify-app-session-storage-sqlite': major +'@shopify/shopify-app-session-storage-test-utils': patch +--- + +### Removed support for Node 14 + +Node 14 has reached it's [EOL](https://endoflife.date/nodejs), and dependencies to this package no longer work on Node 14. +Because of that, we can no longer support that version. + +If your app is running on Node 14, you'll need to update to a more recent version before upgrading this package. + +This upgrade does not require any code changes. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4438042b28..90ff16a6ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: [14, 16, 18, 20] + version: [16, 18, 20] steps: - uses: actions/checkout@master - uses: actions/setup-node@v3 with: node-version: ${{ matrix.version }} - name: Install - # TODO remove the --ignore-engines flag when node 14 support is dropped - run: yarn install --ignore-engines + run: yarn install - name: Run tests run: yarn test - name: Run linting diff --git a/packages/shopify-app-express/loom.config.ts b/packages/shopify-app-express/loom.config.ts index b71817d6e8..5eb021c5fc 100644 --- a/packages/shopify-app-express/loom.config.ts +++ b/packages/shopify-app-express/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-remix/loom.config.ts b/packages/shopify-app-remix/loom.config.ts index 51957dc0a3..d8ae0eb65e 100644 --- a/packages/shopify-app-remix/loom.config.ts +++ b/packages/shopify-app-remix/loom.config.ts @@ -20,7 +20,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-dynamodb/loom.config.ts b/packages/shopify-app-session-storage-dynamodb/loom.config.ts index 50ee255a2d..023121a789 100644 --- a/packages/shopify-app-session-storage-dynamodb/loom.config.ts +++ b/packages/shopify-app-session-storage-dynamodb/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-kv/loom.config.ts b/packages/shopify-app-session-storage-kv/loom.config.ts index ca4ed47ca0..a2abceb21a 100644 --- a/packages/shopify-app-session-storage-kv/loom.config.ts +++ b/packages/shopify-app-session-storage-kv/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-kv/src/__tests__/kv.test.actual.ts b/packages/shopify-app-session-storage-kv/src/__tests__/kv.test.actual.ts deleted file mode 100644 index 42e810b7bc..0000000000 --- a/packages/shopify-app-session-storage-kv/src/__tests__/kv.test.actual.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {Miniflare} from 'miniflare'; -import {batteryOfTests} from '@shopify/shopify-app-session-storage-test-utils'; - -import {KVSessionStorage} from '../kv'; - -describe('KVSessionStorage', () => { - let storage: KVSessionStorage | undefined; - beforeAll(async () => { - const mf = new Miniflare({ - scriptPath: - 'packages/shopify-app-session-storage-kv/src/__tests__/kv-namespace-dummy-worker.ts', - kvNamespaces: ['KV_TEST_NAMESPACE'], - }); - - storage = new KVSessionStorage( - await mf.getKVNamespace('KV_TEST_NAMESPACE'), - ); - }); - - batteryOfTests(async () => storage!); -}); diff --git a/packages/shopify-app-session-storage-kv/src/__tests__/kv.test.ts b/packages/shopify-app-session-storage-kv/src/__tests__/kv.test.ts index 02378e6378..42e810b7bc 100644 --- a/packages/shopify-app-session-storage-kv/src/__tests__/kv.test.ts +++ b/packages/shopify-app-session-storage-kv/src/__tests__/kv.test.ts @@ -1,9 +1,21 @@ -import semver from 'semver'; +import {Miniflare} from 'miniflare'; +import {batteryOfTests} from '@shopify/shopify-app-session-storage-test-utils'; -// eslint-disable-next-line no-warning-comments -// TODO Remove this file and rename kv.test.actual.ts to kv.test.ts when we drop support for Node 14 -if (semver.gte(process.version, '15.0.0')) { - require('./kv.test.actual'); -} +import {KVSessionStorage} from '../kv'; -test('dummy test', () => expect(1).toEqual(1)); +describe('KVSessionStorage', () => { + let storage: KVSessionStorage | undefined; + beforeAll(async () => { + const mf = new Miniflare({ + scriptPath: + 'packages/shopify-app-session-storage-kv/src/__tests__/kv-namespace-dummy-worker.ts', + kvNamespaces: ['KV_TEST_NAMESPACE'], + }); + + storage = new KVSessionStorage( + await mf.getKVNamespace('KV_TEST_NAMESPACE'), + ); + }); + + batteryOfTests(async () => storage!); +}); diff --git a/packages/shopify-app-session-storage-memory/loom.config.ts b/packages/shopify-app-session-storage-memory/loom.config.ts index 0dc03afe54..48c6e68ff1 100644 --- a/packages/shopify-app-session-storage-memory/loom.config.ts +++ b/packages/shopify-app-session-storage-memory/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-mongodb/loom.config.ts b/packages/shopify-app-session-storage-mongodb/loom.config.ts index 03dac177da..84f748f1d6 100644 --- a/packages/shopify-app-session-storage-mongodb/loom.config.ts +++ b/packages/shopify-app-session-storage-mongodb/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-mysql/loom.config.ts b/packages/shopify-app-session-storage-mysql/loom.config.ts index a494ea9600..e2f721a49c 100644 --- a/packages/shopify-app-session-storage-mysql/loom.config.ts +++ b/packages/shopify-app-session-storage-mysql/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-postgresql/loom.config.ts b/packages/shopify-app-session-storage-postgresql/loom.config.ts index dcfdfe4d44..fba91f1757 100644 --- a/packages/shopify-app-session-storage-postgresql/loom.config.ts +++ b/packages/shopify-app-session-storage-postgresql/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-prisma/loom.config.ts b/packages/shopify-app-session-storage-prisma/loom.config.ts index 0b95c9f181..e5bc6f69fb 100644 --- a/packages/shopify-app-session-storage-prisma/loom.config.ts +++ b/packages/shopify-app-session-storage-prisma/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-redis/loom.config.ts b/packages/shopify-app-session-storage-redis/loom.config.ts index c59e166aef..c79ef30dbd 100644 --- a/packages/shopify-app-session-storage-redis/loom.config.ts +++ b/packages/shopify-app-session-storage-redis/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-sqlite/loom.config.ts b/packages/shopify-app-session-storage-sqlite/loom.config.ts index a5c690b6d5..abfc1ce088 100644 --- a/packages/shopify-app-session-storage-sqlite/loom.config.ts +++ b/packages/shopify-app-session-storage-sqlite/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage-test-utils/loom.config.ts b/packages/shopify-app-session-storage-test-utils/loom.config.ts index 9035bb5764..1058432bff 100644 --- a/packages/shopify-app-session-storage-test-utils/loom.config.ts +++ b/packages/shopify-app-session-storage-test-utils/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. diff --git a/packages/shopify-app-session-storage/loom.config.ts b/packages/shopify-app-session-storage/loom.config.ts index 999e693d6e..73475a542e 100644 --- a/packages/shopify-app-session-storage/loom.config.ts +++ b/packages/shopify-app-session-storage/loom.config.ts @@ -9,7 +9,7 @@ export default createPackage((pkg) => { // Use browser targets (e.g. `'defaults'`) if your package targets the browser, // node targets (e.g. `'node 12.22'`) if your package targets node // or both (e.g.`'defaults, node 12.22'`) if your package targets both - targets: 'node 14', + targets: 'node 16', // Optional. Defaults to false. Defines if commonjs outputs should be generated. commonjs: true, // Optional. Defaults to false. Defines if esmodules outputs should be generated. From 68997c424e825910bc66bb01d9e9283070dc8184 Mon Sep 17 00:00:00 2001 From: Paulo Margarido <64600052+paulomarg@users.noreply.github.com> Date: Thu, 5 Oct 2023 11:39:58 -0400 Subject: [PATCH 2/2] Fixing CI setup issue --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90ff16a6ba..d92b1474c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: with: node-version: ${{ matrix.version }} - name: Install - run: yarn install + run: yarn install --ignore-engines - name: Run tests run: yarn test - name: Run linting