@granite-js/mpack 0.1.28 → 0.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @granite-js/mpack
|
|
2
2
|
|
|
3
|
+
## 0.1.30
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9e9ea71: escape `from` string of alias config when creating RegExp
|
|
8
|
+
- @granite-js/devtools-frontend@0.1.30
|
|
9
|
+
- @granite-js/plugin-core@0.1.30
|
|
10
|
+
- @granite-js/utils@0.1.30
|
|
11
|
+
|
|
12
|
+
## 0.1.29
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- ed4cdbf: support additional metro config options from granite.config.ts
|
|
17
|
+
- Updated dependencies [ed4cdbf]
|
|
18
|
+
- @granite-js/plugin-core@0.1.29
|
|
19
|
+
- @granite-js/devtools-frontend@0.1.29
|
|
20
|
+
- @granite-js/utils@0.1.29
|
|
21
|
+
|
|
3
22
|
## 0.1.28
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -83,7 +83,8 @@ function setupAliasResolver(build, aliasConfig) {
|
|
|
83
83
|
}
|
|
84
84
|
function resolveAliasConfig(build, aliasConfig) {
|
|
85
85
|
const { from, to, exact } = aliasConfig;
|
|
86
|
-
const
|
|
86
|
+
const escapedFrom = escapeRegExpString(from);
|
|
87
|
+
const filter = new RegExp(exact ? `^${escapedFrom}$` : `^${escapedFrom}(?:$|/)`);
|
|
87
88
|
const resolver = (0, import_resolveHelpers.createNonRecursiveResolver)(build);
|
|
88
89
|
const aliasResolver = (boundArgs, path2, options) => {
|
|
89
90
|
const result = resolver({ ...boundArgs, path: path2 }, options);
|
|
@@ -102,6 +103,9 @@ function resolveAliasConfig(build, aliasConfig) {
|
|
|
102
103
|
};
|
|
103
104
|
return { filter, resolveAlias };
|
|
104
105
|
}
|
|
106
|
+
function escapeRegExpString(str) {
|
|
107
|
+
return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
|
|
108
|
+
}
|
|
105
109
|
function normalizeResolveResult(result) {
|
|
106
110
|
if (typeof result === "string") {
|
|
107
111
|
return { path: (0, import_esbuildUtils.normalizePath)(result), options: void 0 };
|
package/dist/metro/build.js
CHANGED
|
@@ -64,7 +64,8 @@ async function getMetroConfig({ rootPath }, additionalConfig) {
|
|
|
64
64
|
const resolvedRootPath = await (0, import_getMonorepoRoot.getMonorepoRoot)(rootPath);
|
|
65
65
|
const packageRootPath = await (0, import_utils.getPackageRoot)();
|
|
66
66
|
return (0, import_loadConfig.mergeConfig)(defaultConfig, {
|
|
67
|
-
|
|
67
|
+
projectRoot: additionalConfig?.projectRoot || rootPath,
|
|
68
|
+
watchFolders: [resolvedRootPath, packageRootPath, ...additionalConfig?.watchFolders || []],
|
|
68
69
|
transformerPath: resolveVendors("metro-transform-worker/src"),
|
|
69
70
|
transformer: {
|
|
70
71
|
allowOptionalDependencies: true,
|
|
@@ -98,7 +99,10 @@ async function getMetroConfig({ rootPath }, additionalConfig) {
|
|
|
98
99
|
sourceExts: [...import_constants.SOURCE_EXTENSIONS.map((extension) => extension.replace(/^\.?/, "")), "cjs", "mjs"],
|
|
99
100
|
blockList: (0, import_exclusionList.default)(
|
|
100
101
|
additionalConfig?.resolver?.blockList ? asArray(additionalConfig.resolver.blockList) : []
|
|
101
|
-
)
|
|
102
|
+
),
|
|
103
|
+
nodeModulesPaths: additionalConfig?.resolver?.nodeModulesPaths || [],
|
|
104
|
+
extraNodeModules: additionalConfig?.resolver?.extraNodeModules || {},
|
|
105
|
+
disableHierarchicalLookup: additionalConfig?.resolver?.disableHierarchicalLookup
|
|
102
106
|
},
|
|
103
107
|
serializer: {
|
|
104
108
|
getModulesRunBeforeMainModule: () => [resolveFromRoot("react-native/Libraries/Core/InitializeCore", rootPath)],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granite-js/mpack",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "A bundler for Granite apps",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"@babel/traverse": "^7.14.0",
|
|
90
90
|
"@babel/types": "^7.0.0",
|
|
91
91
|
"@fastify/static": "7.0.1",
|
|
92
|
-
"@granite-js/devtools-frontend": "0.1.
|
|
93
|
-
"@granite-js/plugin-core": "0.1.
|
|
94
|
-
"@granite-js/utils": "0.1.
|
|
92
|
+
"@granite-js/devtools-frontend": "0.1.30",
|
|
93
|
+
"@granite-js/plugin-core": "0.1.30",
|
|
94
|
+
"@granite-js/utils": "0.1.30",
|
|
95
95
|
"@inquirer/prompts": "^7.2.3",
|
|
96
96
|
"@react-native-community/cli-plugin-metro": "11.3.7",
|
|
97
97
|
"@react-native-community/cli-server-api": "11.3.7",
|