From cc2274053f219fef401b087b2bba168132b56710 Mon Sep 17 00:00:00 2001 From: ShafSpecs Date: Wed, 30 Oct 2024 18:13:20 +0100 Subject: [PATCH 1/4] chore: updated scripts to work for node 22 and below --- scripts/update-sandbox.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/update-sandbox.js b/scripts/update-sandbox.js index a7dd2278..b0ea3bbe 100644 --- a/scripts/update-sandbox.js +++ b/scripts/update-sandbox.js @@ -2,9 +2,21 @@ import { writeFile } from 'fs'; -export {}; +const importJson = async (/** @type {string} */ path) => { + try { + return await import(path, { assert: { type: 'json' } }); + } catch (err) { + // @ts-ignore + if (err.code === 'ERR_IMPORT_ATTRIBUTE_MISSING') { + return await import(path, { with: { type: 'json' } }); + } else { + console.error('💥 Error occured:', '\n\n', err); + process.exit(1); + } + } +}; -const sandboxPackageJson = await import('../playground/package.json', { with: { type: 'json' } }); +const sandboxPackageJson = await importJson('../playground/package.json'); const deps = sandboxPackageJson.default.dependencies; const devDeps = sandboxPackageJson.default.devDependencies; @@ -28,7 +40,7 @@ Object.keys(devDeps).forEach(dep => { await Promise.allSettled(remixPwaPackages.map(async pkg => { const pkgPath = pkg.replace('@remix-pwa/', ''); - const pkgJson = await import(`../packages/${pkgPath}/package.json`, { with: { type: 'json' } }); + const pkgJson = await importJson(`../packages/${pkgPath}/package.json`); // @ts-ignore if (deps[pkg]) { From 706cddd3ce23d1838f0c0d7dcbe2af7a0665f1a9 Mon Sep 17 00:00:00 2001 From: ShafSpecs Date: Wed, 30 Oct 2024 18:18:45 +0100 Subject: [PATCH 2/4] chore: updated sandbox packages --- playground/package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/playground/package.json b/playground/package.json index c81cca42..a700f0fc 100644 --- a/playground/package.json +++ b/playground/package.json @@ -23,11 +23,11 @@ }, "dependencies": { "@remix-pwa/client": "3.0.7", - "@remix-pwa/manifest": "3.0.0", + "@remix-pwa/manifest": "3.0.1-dev.2", "@remix-pwa/push": "2.10.3", - "@remix-pwa/sw": "3.0.10", - "@remix-pwa/sync": "3.0.5", - "@remix-pwa/worker-runtime": "2.1.4", + "@remix-pwa/sw": "3.1.0-dev.1", + "@remix-pwa/sync": "3.0.6-dev.1", + "@remix-pwa/worker-runtime": "2.2.0-dev.1", "@remix-run/node": "^2.12.1", "@remix-run/react": "^2.12.1", "@remix-run/serve": "^2.12.1", @@ -39,7 +39,7 @@ "react-dom": "^18.2.0" }, "devDependencies": { - "@remix-pwa/dev": "3.1.0", + "@remix-pwa/dev": "3.2.0-dev.2", "@remix-run/dev": "^2.12.1", "@remix-run/eslint-config": "^2.12.1", "@types/react": "^18.2.22", From 32d04b0f5426011b3abd7e2538a348d7013a11a9 Mon Sep 17 00:00:00 2001 From: ShafSpecs Date: Wed, 30 Oct 2024 18:19:08 +0100 Subject: [PATCH 3/4] chore: fixed `postclone` scripts --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6721b144..ec0bb16a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "lint-staged": "lint-staged", "lint": "turbo lint -- --fix", "format": "turbo format -- --write", - "postclone": "npm install && npm run test && npm run build", + "postclone": "npm run preinstall -w @remix-pwa/playground && npm install && npm run test && npm run build", "publish:pr": "npx pkg-pr-new publish './packages/*'", "test": "turbo test -- --coverage" }, From 6c4b5ad0dc91ac0af3c971b1a08c4de9ae23f824 Mon Sep 17 00:00:00 2001 From: ShafSpecs Date: Wed, 30 Oct 2024 18:19:49 +0100 Subject: [PATCH 4/4] chore: updated workspace node version to 22 --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index 2edeafb0..8fdd954d 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 \ No newline at end of file +22 \ No newline at end of file