@granite-js/mpack 0.1.29 → 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,14 @@
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
+
3
12
  ## 0.1.29
4
13
 
5
14
  ### 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 filter = new RegExp(exact ? `^${from}$` : `^${from}(?:$|/)`);
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 };
@@ -58,7 +58,7 @@ async function buildAll(optionsList, { config, concurrency = 2 }) {
58
58
  try {
59
59
  const buildResult = await buildImpl(config, options);
60
60
  buildResults.push(buildResult);
61
- } catch {
61
+ } finally {
62
62
  semaphore.release();
63
63
  }
64
64
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@granite-js/mpack",
3
- "version": "0.1.29",
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.29",
93
- "@granite-js/plugin-core": "0.1.29",
94
- "@granite-js/utils": "0.1.29",
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",