Skip to content

Commit a41f437

Browse files
committed
chore: patch widget tools rollup plugin to correctly copy linked dependencies
1 parent ee0d37e commit a41f437

3 files changed

+81
-106
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/node_modules/@mendix/pluggable-widgets-tools/bin/mx-scripts.js b/node_modules/@mendix/pluggable-widgets-tools/bin/mx-scripts.js
2+
index 673e0b2..055f87d 100755
3+
--- a/node_modules/@mendix/pluggable-widgets-tools/bin/mx-scripts.js
4+
+++ b/node_modules/@mendix/pluggable-widgets-tools/bin/mx-scripts.js
5+
@@ -107,7 +107,7 @@ function getRealCommand(cmd, toolsRoot) {
6+
}
7+
8+
function findNodeModulesBin() {
9+
- let parentDir = join(__dirname, "..");
10+
+ let parentDir = join(__dirname, "../..");
11+
const bins = [];
12+
while (parse(parentDir).root !== parentDir) {
13+
const candidate = join(parentDir, "node_modules/.bin");
14+
diff --git a/node_modules/@mendix/pluggable-widgets-tools/test-config/transform-native.js b/node_modules/@mendix/pluggable-widgets-tools/test-config/transform-native.js
15+
index eed8109..4b422fa 100644
16+
--- a/node_modules/@mendix/pluggable-widgets-tools/test-config/transform-native.js
17+
+++ b/node_modules/@mendix/pluggable-widgets-tools/test-config/transform-native.js
18+
@@ -1,3 +1,3 @@
19+
module.exports = require("babel-jest").createTransformer({
20+
- presets: ["module:metro-react-native-babel-preset"]
21+
+ presets: ["module:@react-native/babel-preset"]
22+
});
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
diff --git a/node_modules/@mendix/pluggable-widgets-tools/configs/rollup-plugin-collect-dependencies.mjs b/node_modules/@mendix/pluggable-widgets-toolsconfigs/rollup-plugin-collect-dependencies.mjs
2+
index 2d0b5bfac7f1a1482bc1a222cba3e52b0339cc79..44ab7f4aa30abc0ba52672ea3e717f4401d00ed5 100644
3+
--- a/node_modules/@mendix/pluggable-widgets-tools/configs/rollup-plugin-collect-dependencies.mjs
4+
+++ b/node_modules/@mendix/pluggable-widgets-tools/configs/rollup-plugin-collect-dependencies.mjs
5+
@@ -2,9 +2,8 @@
6+
7+
import fg from "fast-glob";
8+
import fsExtra from "fs-extra";
9+
-import { existsSync, readFileSync, writeFileSync } from "fs";
10+
+import { existsSync, readFileSync, writeFileSync, cpSync } from "fs";
11+
import { dirname, join, parse } from "path";
12+
-import copy from "recursive-copy";
13+
import { promisify } from "util";
14+
import resolve from "resolve";
15+
import _ from "lodash";
16+
@@ -171,15 +174,34 @@ async function copyJsModule(moduleSourcePath, to) {
17+
if (existsSync(to)) {
18+
return;
19+
}
20+
- return promisify(copy)(moduleSourcePath, to, {
21+
- filter: [
22+
- "**/*.*",
23+
- LICENSE_GLOB,
24+
- "!**/{android,ios,windows,mac,jest,github,gradle,__*__,docs,jest,example*}/**/*",
25+
- "!**/*.{config,setup}.*",
26+
- "!**/*.{podspec,flow}"
27+
- ]
28+
- });
29+
+
30+
+ try {
31+
+ cpSync(moduleSourcePath, to, {
32+
+ recursive: true,
33+
+ filter: (src, dest) => {
34+
+ const relativePath = src.replace(moduleSourcePath, '').replace(/^[\\/]/, '');
35+
+
36+
+ // Skip certain directories
37+
+ if (relativePath.match(/[\\/](android|ios|windows|mac|jest|github|gradle|__.*__|docs|example.*)[\\/]/)) {
38+
+ return false;
39+
+ }
40+
+
41+
+ // Skip certain file types
42+
+ if (relativePath.match(/\.(config|setup)\.|\.podspec$|\.flow$/)) {
43+
+ return false;
44+
+ }
45+
+
46+
+ // Include LICENSE files
47+
+ if (relativePath.match(/license/i)) {
48+
+ return true;
49+
+ }
50+
+
51+
+ return true;
52+
+ }
53+
+ });
54+
+ } catch (error) {
55+
+ throw error;
56+
+ }
57+
}
58+
59+
function getModuleName(modulePath) {

patches/@mendix+pluggable-widgets-tools+10.21.1.patch

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)