Skip to content

Commit 4c42153

Browse files
chore: bump widget-tools
chore: switch to widgets-tools tarball
1 parent 3eaa558 commit 4c42153

5 files changed

Lines changed: 818 additions & 1042 deletions

‎TEMP-REVERT-BEFORE-MERGE.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# TEMPORARY: revert before merging the React Native 0.88 upgrade
2+
3+
To test the React Native 0.88 upgrade, `@mendix/pluggable-widgets-tools` is installed from a tarball packed from the
4+
unreleased [`MxKevinBeqo/widgets-tools#moo/MOO-2499-rn-088`](https://github.com/MxKevinBeqo/widgets-tools/tree/moo/MOO-2499-rn-088)
5+
branch (commit `0dc4f444`) instead of npm. Once a version of the tools with React Native 0.88 support is released, undo
6+
the following and delete this file.
7+
8+
1. `package.json` → `pnpm.overrides`: set `@mendix/pluggable-widgets-tools` back to the released version (it was
9+
`11.12.0` before this change) instead of
10+
`file:temp-vendor/mendix-pluggable-widgets-tools-11.15.0-moo-2499-rn-088-0dc4f44.tgz`.
11+
2. Delete the `temp-vendor/` folder.
12+
3. `patches/@mendix__pluggable-widgets-tools.patch`:
13+
- Remove the `TEMPORARY` note at the top of the file.
14+
- Remove the `package.json` hunk. It widens `engines.node` from `^22.18.0` to `>=22.18.0`, because the tools refuse
15+
to run on the Node 24 this repo uses (`.nvmrc`). If the released version still says `^22.18.0`, raise it with the
16+
tools maintainers rather than keeping the hunk.
17+
- Regenerate the remaining hunks against the released version and drop any it already includes: the
18+
`rollup-plugin-collect-dependencies.mjs` copy fix, the `@shopify/flash-list` transform pattern, and the ts-jest
19+
`module: "preserve"` / `noEmitOnError: false` settings (the branch still uses `module: "commonjs"`, which
20+
TypeScript rejects together with the base config's `moduleResolution: "bundler"`).
21+
4. Run `pnpm install` to update `pnpm-lock.yaml`.
22+
23+
## Why a tarball and not a git dependency
24+
25+
CI installs with `pnpm install --frozen-lockfile --ignore-scripts`. A git dependency only gets its compiled `dist/`
26+
from its `prepack` script, which `--ignore-scripts` skips, so every widget build failed with
27+
`Cannot find module '../dist/commands/audit.js'`. The tarball was made with `pnpm pack` in
28+
`packages/pluggable-widgets-tools` of a clean checkout of that commit, so it ships `dist/` prebuilt like the npm package.
29+
To pick up a newer commit of the branch, repack it the same way, replace the file and update the override.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
},
8080
"pnpm": {
8181
"overrides": {
82-
"@mendix/pluggable-widgets-tools": "11.12.0",
82+
"@mendix/pluggable-widgets-tools": "file:temp-vendor/mendix-pluggable-widgets-tools-11.15.0-moo-2499-rn-088-0dc4f44.tgz",
8383
"@rollup/plugin-typescript": "12.3.0",
8484
"mendix": "11.8.0",
8585
"eslint": "9.39.4",

‎patches/@mendix__pluggable-widgets-tools.patch‎

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
TEMPORARY - REVERT BEFORE MERGE (see TEMP-REVERT-BEFORE-MERGE.md in the repo root).
2+
3+
This patch targets the unreleased MxKevinBeqo/widgets-tools#moo/MOO-2499-rn-088 branch, used only to test
4+
the React Native 0.88 upgrade. Once @mendix/pluggable-widgets-tools is released, restore this patch to its
5+
pre-branch content and remove the package.json hunk, which only widens engines.node from ^22.18.0 so the
6+
tools run on the Node 24 this repo uses.
7+
18
diff --git a/configs/rollup-plugin-collect-dependencies.mjs b/configs/rollup-plugin-collect-dependencies.mjs
29
index d45c737..9246919 100644
310
--- a/configs/rollup-plugin-collect-dependencies.mjs
@@ -58,65 +65,31 @@ index d45c737..9246919 100644
5865
});
5966
}
6067

61-
diff --git a/configs/rollup.config.native.mjs b/configs/rollup.config.native.mjs
62-
index 62c5c82..927c8e7 100644
63-
--- a/configs/rollup.config.native.mjs
64-
+++ b/configs/rollup.config.native.mjs
65-
@@ -52,9 +52,9 @@ const nativeExternal = [
66-
/^react($|\/)/,
67-
/^react-native-gesture-handler($|\/)/,
68-
/^react-native-reanimated($|\/)/,
69-
- /^react-native-fast-image($|\/)/,
70-
+ /^react-native-worklets($|\/)/,
71-
/^react-native-svg($|\/)/,
72-
- /^react-native-vector-icons($|\/)/,
73-
+ /^@react-native-vector-icons\/common($|\/)/,
74-
/^@?react-navigation($|\/)/,
75-
/^react-native-safe-area-context($|\/)/,
76-
/^@d11\/react-native-fast-image($|\/)/
77-
@@ -222,7 +222,7 @@ export default async args => {
78-
})
79-
: null,
80-
image(),
81-
- production ? terser({ mangle: false }) : null,
82-
+ production ? terser({ mangle: false, compress: { directives: false } }) : null,
83-
// We need to create .mpk and copy results to test project after bundling is finished.
84-
// In case of a regular build is it is on `writeBundle` of the last config we define
85-
// (since rollup processes configs sequentially). But in watch mode rollup re-bundles only
86-
diff --git a/configs/tsconfig.base.json b/configs/tsconfig.base.json
87-
index 62627fd..0b8f2d5 100644
88-
--- a/configs/tsconfig.base.json
89-
+++ b/configs/tsconfig.base.json
90-
@@ -6,7 +6,7 @@
91-
"target": "es6",
92-
"lib": ["esnext", "dom"],
93-
"types": ["jest", "node"],
94-
- "moduleResolution": "node",
95-
+ "moduleResolution": "bundler",
96-
"declaration": false,
97-
"noLib": false,
98-
"forceConsistentCasingInFileNames": true,
68+
diff --git a/package.json b/package.json
69+
index f7a38e3..8f2d448 100644
70+
--- a/package.json
71+
+++ b/package.json
72+
@@ -3,7 +3,7 @@
73+
"version": "11.15.0",
74+
"description": "Mendix Pluggable Widgets Tools",
75+
"engines": {
76+
- "node": "^22.18.0"
77+
+ "node": ">=22.18.0"
78+
},
79+
"main": "dist/index.js",
80+
"types": "dist/index.d.ts",
9981
diff --git a/test-config/jest.native.config.js b/test-config/jest.native.config.js
100-
index 9424f7f..088669c 100644
82+
index 7d697f9..088669c 100644
10183
--- a/test-config/jest.native.config.js
10284
+++ b/test-config/jest.native.config.js
103-
@@ -3,7 +3,7 @@ const { join } = require("path");
104-
const projectDir = process.cwd();
105-
106-
module.exports = {
107-
- preset: "react-native",
108-
+ preset: "@react-native/jest-preset",
109-
testRunner: "jest-jasmine2",
110-
clearMocks: true,
111-
haste: {
112-
@@ -16,12 +16,13 @@ module.exports = {
85+
@@ -16,13 +16,13 @@ module.exports = {
11386
...(hasDependency("react-native-gesture-handler") ? ["react-native-gesture-handler/jestSetup.js"] : [])
11487
],
11588
testMatch: ["<rootDir>/**/*.spec.{js,jsx,ts,tsx}"],
11689
- transformIgnorePatterns: ["node_modules/(?!(.*react-native.*|victory-)/)"],
11790
+ transformIgnorePatterns: ["node_modules/(?!(.*react-native.*|victory-|@shopify/flash-list)/)"],
11891
transform: {
119-
+ "^.+\\.(ttf|otf|woff2?|eot)$": require.resolve("@react-native/jest-preset/jest/assetFileTransformer.js"),
92+
"^.+\\.(ttf|otf|woff2?|eot)$": require.resolve("@react-native/jest-preset/jest/assetFileTransformer.js"),
12093
"^.+\\.tsx?$": [
12194
"ts-jest",
12295
{

0 commit comments

Comments
 (0)