Skip to content

Commit

Permalink
Merge pull request #277 from remix-pwa/v5-rc
Browse files Browse the repository at this point in the history
Updated sandbox scripts to work for node 22 and below
  • Loading branch information
ShafSpecs authored Oct 30, 2024
2 parents d1d170e + 6c4b5ad commit ccd5cb3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
10 changes: 5 additions & 5 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
18 changes: 15 additions & 3 deletions scripts/update-sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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]) {
Expand Down

0 comments on commit ccd5cb3

Please sign in to comment.