Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/classes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "CrafterCMS",
"license": "GNU LGPL 3.0",
"scripts": {
"rollup": "../../node_modules/rollup/bin/rollup -c rollup.config.js",
"rollup": "rollup -c rollup.config.js",
"build:ts": "tsc -p tsconfig.build.json",
"clean:ts": "../../node_modules/rimraf/bin.js ts-out",
"build": "npm run build:ts && npm run rollup && npm run clean:ts",
Expand All @@ -30,15 +30,15 @@
"query-string": "^9.1.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^29.0.2",
"@rollup/plugin-node-resolve": "^15.2.3",
"chai": "^5.1.1",
"mocha": "^10.2.0",
"mocha": "^10.8.2",
"nock": "^13.3.4",
"node-fetch": "2",
"rollup": "^2.79.1",
"node-fetch": "3.3.2",
"rollup": "^4.59.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.30.1",
"terser": "^5.46.0",
"url-search-params-polyfill": "^5.0.0",
"xhr2": "^0.2.1"
}
Expand Down
14 changes: 7 additions & 7 deletions packages/content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "CrafterCMS",
"license": "GNU LGPL 3.0",
"scripts": {
"rollup": "../../node_modules/rollup/bin/rollup -c rollup.config.js",
"rollup": "rollup -c rollup.config.js",
"build:ts": "tsc -p tsconfig.build.json",
"clean:ts": "../../node_modules/rimraf/bin.js ts-out",
"build": "npm run build:ts && npm run rollup && npm run clean:ts",
Expand All @@ -31,16 +31,16 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^29.0.2",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/mocha": "^10.0.7",
"@types/mocha": "^10.0.10",
"chai": "^5.1.1",
"mocha": "^10.7.3",
"mocha": "^10.8.2",
"nock": "^13.3.3",
"node-fetch": "2",
"rollup": "^2.79.1",
"node-fetch": "3.3.2",
"rollup": "^4.59.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.30.1",
"terser": "^5.46.0",
"ts-node": "^10.9.2",
"whatwg-fetch": "^3.6.19",
"xhr-mock": "^2.5.1"
Expand Down
10 changes: 5 additions & 5 deletions packages/ice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@
"author": "CrafterCMS",
"license": "GNU LGPL 3.0",
"scripts": {
"rollup": "../../node_modules/rollup/bin/rollup -c rollup.config.js",
"rollup": "rollup -c rollup.config.js",
"build:ts": "tsc -p tsconfig.build.json",
"clean:ts": "../../node_modules/rimraf/bin.js ts-out",
"build": "npm run build:ts && npm run rollup && npm run clean:ts",
"test": "mocha"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^29.0.2",
"@rollup/plugin-node-resolve": "^15.2.3",
"@testing-library/react": "^16.0.0",
"enzyme": "^3.11.0",
"jsdom": "^25.0.0",
"mocha": "^10.2.0",
"mocha": "^10.8.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.79.1",
"rollup": "^4.59.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.30.1"
"terser": "^5.46.0"
},
"dependencies": {
"@craftercms/models": "0.0.0-PLACEHOLDER"
Expand Down
8 changes: 4 additions & 4 deletions packages/models/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
"author": "CrafterCMS",
"license": "GNU LGPL 3.0",
"scripts": {
"rollup": "../../node_modules/rollup/bin/rollup -c rollup.config.js",
"rollup": "rollup -c rollup.config.js",
"build:ts": "tsc -p tsconfig.build.json",
"clean:ts": "../../node_modules/rimraf/bin.js ts-out",
"build": "npm run build:ts && npm run rollup && npm run clean:ts"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^29.0.2",
"@rollup/plugin-node-resolve": "^15.2.3",
"rollup": "^2.79.1",
"rollup": "^4.59.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.30.1"
"terser": "^5.46.0"
}
}
14 changes: 7 additions & 7 deletions packages/redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "CrafterCMS",
"license": "GNU LGPL 3.0",
"scripts": {
"rollup": "../../node_modules/rollup/bin/rollup -c rollup.config.js",
"rollup": "rollup -c rollup.config.js",
"build:ts": "tsc -p tsconfig.build.json",
"clean:ts": "../../node_modules/rimraf/bin.js ts-out",
"build": "npm run build:ts && npm run rollup && npm run clean:ts",
Expand All @@ -32,16 +32,16 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^29.0.2",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/mocha": "^10.0.7",
"@types/mocha": "^10.0.10",
"chai": "^5.1.1",
"mocha": "^10.7.3",
"mocha": "^10.8.2",
"nock": "^13.3.3",
"node-fetch": "2",
"rollup": "^2.79.1",
"node-fetch": "3.3.2",
"rollup": "^4.59.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.30.1",
"terser": "^5.46.0",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"xhr-mock": "^2.5.1"
Expand Down
12 changes: 6 additions & 6 deletions packages/search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"author": "CrafterCMS",
"license": "GNU LGPL 3.0",
"scripts": {
"rollup": "../../node_modules/rollup/bin/rollup -c rollup.config.js",
"rollup": "rollup -c rollup.config.js",
"build:ts": "tsc -p tsconfig.build.json",
"clean:ts": "../../node_modules/rimraf/bin.js ts-out",
"build": "npm run build:ts && npm run rollup && npm run clean:ts",
Expand All @@ -32,15 +32,15 @@
"uuid": "^10.0.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^29.0.2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Repo Node engine constraints (all package.json files) =="
fd '^package\.json$' -E node_modules -x sh -c '
  file="$1"
  name=$(jq -r ".name // \"<unnamed>\"" "$file")
  engine=$(jq -r ".engines.node // \"<none>\"" "$file")
  printf "%s | %s | engines.node=%s\n" "$file" "$name" "$engine"
' sh {}

echo
echo "== NPM metadata checks for bumped build deps =="
echo "-- rollup@4.59.0"
curl -s https://registry.npmjs.org/rollup/4.59.0 \
  | jq -r '"engines.node=" + (.engines.node // "<none>")'

echo "-- `@rollup/plugin-commonjs`@29.0.2"
curl -s https://registry.npmjs.org/%40rollup%2fplugin-commonjs/29.0.2 \
  | jq -r '"peerDependencies.rollup=" + (.peerDependencies.rollup // "<none>"), "engines.node=" + (.engines.node // "<none>")'

echo "-- rollup-plugin-sourcemaps@0.6.3"
curl -s https://registry.npmjs.org/rollup-plugin-sourcemaps/0.6.3 \
  | jq -r '"peerDependencies.rollup=" + (.peerDependencies.rollup // "<none>"), "engines.node=" + (.engines.node // "<none>")'

echo "-- terser@5.46.0"
curl -s https://registry.npmjs.org/terser/5.46.0 \
  | jq -r '"engines.node=" + (.engines.node // "<none>")'

echo
echo "== Scan rollup config for potentially legacy keys to manually re-check =="
fd 'rollup\.config\.(js|cjs|mjs|ts)$' -t f -E node_modules -x rg -n -C2 \
  'acorn|output\.preferConst|treeshake\.pureExternalModules|legacy|commonjs\(' {} || true

Repository: craftercms/js-sdk

Length of output: 1161


🏁 Script executed:

cat -n packages/search/package.json | sed -n '30,45p'

Repository: craftercms/js-sdk

Length of output: 623


🏁 Script executed:

fd 'rollup' -t f -E node_modules | head -20

Repository: craftercms/js-sdk

Length of output: 371


🏁 Script executed:

cat -n packages/search/rollup.config.js | head -50

Repository: craftercms/js-sdk

Length of output: 984


🏁 Script executed:

cat -n package.json | sed -n '1,30p'

Repository: craftercms/js-sdk

Length of output: 1097


🏁 Script executed:

cat -n util/rollup-utils.js

Repository: craftercms/js-sdk

Length of output: 4400


Add explicit Node engine constraint to prevent Rollup v4 compatibility issues.

Rollup v4.59.0 requires Node >=18.0.0, but the repository has no engines.node constraint defined. This will allow developers on Node 14-17 to install dependencies and encounter runtime failures. The bumped plugins (@rollup/plugin-commonjs@29.0.2, rollup-plugin-sourcemaps@0.6.3) are all compatible with Rollup v4, and the rollup config (util/rollup-utils.js) uses no deprecated APIs, so the toolchain is otherwise safe to upgrade. Add "engines": { "node": ">=18.0.0" } to the root package.json.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/search/package.json` at line 35, Add an explicit Node engine
constraint in the root package.json by adding an "engines" field with "node":
">=18.0.0" to prevent users on Node 14–17 from installing dependencies that
require Rollup v4; edit the package.json and add the "engines": { "node":
">=18.0.0" } entry at root level (ensure it is valid JSON and commas adjusted
around existing keys).

"@rollup/plugin-node-resolve": "^15.2.3",
"@types/mocha": "^10.0.7",
"@types/mocha": "^10.0.10",
"chai": "^5.1.1",
"mocha": "^10.7.3",
"mocha": "^10.8.2",
"nock": "^13.3.3",
"rollup": "^2.79.1",
"rollup": "^4.59.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.30.1",
"terser": "^5.46.0",
"ts-node": "^10.9.2",
"xhr-mock": "^2.5.1",
"xhr2": "^0.2.1"
Expand Down
10 changes: 5 additions & 5 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
"author": "CrafterCMS",
"license": "GNU LGPL 3.0",
"scripts": {
"rollup": "../../node_modules/rollup/bin/rollup -c rollup.config.js",
"rollup": "rollup -c rollup.config.js",
"build:ts": "tsc -p tsconfig.build.json",
"clean:ts": "../../node_modules/rimraf/bin.js ts-out",
"build": "npm run build:ts && npm run rollup && npm run clean:ts",
"test": "mocha"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-commonjs": "^29.0.2",
"@rollup/plugin-node-resolve": "^15.2.3",
"mocha": "^10.2.0",
"rollup": "^2.79.1",
"mocha": "^10.8.2",
"rollup": "^4.59.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"terser": "^5.30.1"
"terser": "^5.46.0"
}
}
Loading