@gadicc/loom 2.0.0 → 2.0.1
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/.loom-source-manifest.json +1 -1
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +10 -3
- package/esm/src/cli/mod.js.map +1 -1
- package/package.json +2 -2
- package/source/src/cli/mod.ts +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gadicc/loom",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Shared helpers and verification tooling for Next.js applications.",
|
|
5
5
|
"homepage": "https://github.com/gadicc/loom#readme",
|
|
6
6
|
"repository": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://github.com/gadicc/loom/issues"
|
|
12
12
|
},
|
|
13
13
|
"loom": {
|
|
14
|
-
"gitCommit": "
|
|
14
|
+
"gitCommit": "489920a2d5d2b552f552e8465d5d6fac55eb0344"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "./esm/mod.js",
|
package/source/src/cli/mod.ts
CHANGED
|
@@ -10284,12 +10284,18 @@ function getModuleBoundaryDirective(text: string) {
|
|
|
10284
10284
|
|
|
10285
10285
|
function getStaticModuleSpecifiers(text: string) {
|
|
10286
10286
|
const specifiers = new Set<string>();
|
|
10287
|
-
|
|
10288
|
-
|
|
10287
|
+
const source = normalizeText(text);
|
|
10288
|
+
for (const match of source.matchAll(
|
|
10289
|
+
/(?:^|[;\n])\s*(import|export)\s+(?:([^"'`;]*?\s+from\s+))?["']([^"']+)["']/gm,
|
|
10289
10290
|
)) {
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10291
|
+
const clause = match[2]?.replace(/\s+from\s+$/, "").trim();
|
|
10292
|
+
if (clause && /^type\s+(?:\{|\*|[$\p{ID_Start}])/u.test(clause)) continue;
|
|
10293
|
+
// Inline `type` specifiers can retain side effects under verbatimModuleSyntax.
|
|
10294
|
+
// Only declaration-level type imports/exports are unconditionally erased.
|
|
10295
|
+
specifiers.add(match[3]);
|
|
10296
|
+
}
|
|
10297
|
+
// Remain conservative for dynamic imports, including template expressions.
|
|
10298
|
+
for (const match of source.matchAll(
|
|
10293
10299
|
/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,
|
|
10294
10300
|
)) {
|
|
10295
10301
|
specifiers.add(match[1]);
|