@absolutejs/absolute 0.19.0-beta.875 → 0.19.0-beta.877
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/dist/index.js
CHANGED
|
@@ -9832,12 +9832,12 @@ __export(exports_hmrInjectionPlugin, {
|
|
|
9832
9832
|
});
|
|
9833
9833
|
import { readFile as readFile5 } from "fs/promises";
|
|
9834
9834
|
import { relative as relative6, resolve as resolve15 } from "path";
|
|
9835
|
-
var ENTITY_DECORATOR_RE, IMPORT_RE,
|
|
9835
|
+
var ENTITY_DECORATOR_RE, IMPORT_RE, TOP_LEVEL_DECL_RE, extractAllTopLevelNames = (jsSource) => {
|
|
9836
9836
|
const names = new Set;
|
|
9837
9837
|
IMPORT_RE.lastIndex = 0;
|
|
9838
|
-
let
|
|
9839
|
-
while ((
|
|
9840
|
-
const [, , nsName, defaultName, namedAfterDefault, named] =
|
|
9838
|
+
let importMatch;
|
|
9839
|
+
while ((importMatch = IMPORT_RE.exec(jsSource)) !== null) {
|
|
9840
|
+
const [, , nsName, defaultName, namedAfterDefault, named] = importMatch;
|
|
9841
9841
|
if (nsName)
|
|
9842
9842
|
names.add(nsName);
|
|
9843
9843
|
if (defaultName)
|
|
@@ -9855,6 +9855,13 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, extractImportedLocalNames = (jsSource) => {
|
|
|
9855
9855
|
}
|
|
9856
9856
|
}
|
|
9857
9857
|
}
|
|
9858
|
+
TOP_LEVEL_DECL_RE.lastIndex = 0;
|
|
9859
|
+
let declMatch;
|
|
9860
|
+
while ((declMatch = TOP_LEVEL_DECL_RE.exec(jsSource)) !== null) {
|
|
9861
|
+
const name = declMatch[1];
|
|
9862
|
+
if (name)
|
|
9863
|
+
names.add(name);
|
|
9864
|
+
}
|
|
9858
9865
|
return [...names];
|
|
9859
9866
|
}, buildHmrTail = (className, encodedIdLiteral) => `
|
|
9860
9867
|
|
|
@@ -9977,8 +9984,8 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, extractImportedLocalNames = (jsSource) => {
|
|
|
9977
9984
|
const id = `${projectRel}@${className}`;
|
|
9978
9985
|
return buildHmrTail(className, JSON.stringify(id));
|
|
9979
9986
|
}).join("");
|
|
9980
|
-
const
|
|
9981
|
-
const depsKeys =
|
|
9987
|
+
const topLevelNames = extractAllTopLevelNames(text);
|
|
9988
|
+
const depsKeys = topLevelNames.filter((n) => !classNames.includes(n)).join(", ");
|
|
9982
9989
|
const depsBlock = classNames.length > 0 && depsKeys ? `
|
|
9983
9990
|
|
|
9984
9991
|
// absolutejs HMR \u2014 Tier 1a class-deps registry
|
|
@@ -9993,6 +10000,7 @@ var ENTITY_DECORATOR_RE, IMPORT_RE, extractImportedLocalNames = (jsSource) => {
|
|
|
9993
10000
|
var init_hmrInjectionPlugin = __esm(() => {
|
|
9994
10001
|
ENTITY_DECORATOR_RE = /([A-Z][A-Za-z0-9_$]*)\s*=\s*__legacyDecorateClassTS[A-Za-z0-9_$]*\s*\(\s*\[[\s\S]*?\b(?:Component|Directive|Pipe|Injectable)[A-Za-z0-9_$]*\s*\(/g;
|
|
9995
10002
|
IMPORT_RE = /^\s*import\s+(?:(?:(\*)\s+as\s+([A-Za-z_$][\w$]*)\s+from)|(?:([A-Za-z_$][\w$]*)(?:\s*,\s*\{([^}]*)\})?\s+from)|(?:\{([^}]*)\}\s+from))\s*['"][^'"]+['"]/gm;
|
|
10003
|
+
TOP_LEVEL_DECL_RE = /^(?:export\s+)?(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/gm;
|
|
9996
10004
|
});
|
|
9997
10005
|
|
|
9998
10006
|
// src/utils/cleanStaleOutputs.ts
|
|
@@ -19163,26 +19171,41 @@ ${block}
|
|
|
19163
19171
|
while ((idMatch = identRe.exec(provisionalMethodsBlock)) !== null) {
|
|
19164
19172
|
referencedNames.add(idMatch[0]);
|
|
19165
19173
|
}
|
|
19166
|
-
const
|
|
19174
|
+
const sourceScopeNames = new Set;
|
|
19167
19175
|
for (const stmt of sourceFile.statements) {
|
|
19168
|
-
if (
|
|
19169
|
-
|
|
19170
|
-
|
|
19176
|
+
if (ts7.isImportDeclaration(stmt)) {
|
|
19177
|
+
if (!ts7.isStringLiteral(stmt.moduleSpecifier))
|
|
19178
|
+
continue;
|
|
19179
|
+
const clause = stmt.importClause;
|
|
19180
|
+
if (clause?.name)
|
|
19181
|
+
sourceScopeNames.add(clause.name.text);
|
|
19182
|
+
if (clause?.namedBindings && ts7.isNamedImports(clause.namedBindings)) {
|
|
19183
|
+
for (const el of clause.namedBindings.elements) {
|
|
19184
|
+
if (el.isTypeOnly)
|
|
19185
|
+
continue;
|
|
19186
|
+
sourceScopeNames.add(el.name.text);
|
|
19187
|
+
}
|
|
19188
|
+
} else if (clause?.namedBindings && ts7.isNamespaceImport(clause.namedBindings)) {
|
|
19189
|
+
sourceScopeNames.add(clause.namedBindings.name.text);
|
|
19190
|
+
}
|
|
19171
19191
|
continue;
|
|
19172
|
-
|
|
19173
|
-
if (
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
sourceImportedNames.add(el.name.text);
|
|
19192
|
+
}
|
|
19193
|
+
if (ts7.isVariableStatement(stmt) || stmt.kind === ts7.SyntaxKind.VariableStatement) {
|
|
19194
|
+
const varStmt = stmt;
|
|
19195
|
+
for (const decl of varStmt.declarationList.declarations) {
|
|
19196
|
+
if (ts7.isIdentifier(decl.name)) {
|
|
19197
|
+
sourceScopeNames.add(decl.name.text);
|
|
19198
|
+
}
|
|
19180
19199
|
}
|
|
19181
|
-
|
|
19182
|
-
|
|
19200
|
+
continue;
|
|
19201
|
+
}
|
|
19202
|
+
if (ts7.isFunctionDeclaration(stmt) || ts7.isClassDeclaration(stmt)) {
|
|
19203
|
+
if (stmt.name)
|
|
19204
|
+
sourceScopeNames.add(stmt.name.text);
|
|
19183
19205
|
}
|
|
19184
19206
|
}
|
|
19185
|
-
|
|
19207
|
+
sourceScopeNames.delete(className);
|
|
19208
|
+
const depsToDestructure = [...sourceScopeNames].filter((n) => referencedNames.has(n));
|
|
19186
19209
|
const tsSourceText = fnText;
|
|
19187
19210
|
const transpiled = ts7.transpileModule(tsSourceText, {
|
|
19188
19211
|
compilerOptions: {
|
|
@@ -30466,5 +30489,5 @@ export {
|
|
|
30466
30489
|
ANGULAR_INIT_TIMEOUT_MS
|
|
30467
30490
|
};
|
|
30468
30491
|
|
|
30469
|
-
//# debugId=
|
|
30492
|
+
//# debugId=4117F8576985AF1A64756E2164756E21
|
|
30470
30493
|
//# sourceMappingURL=index.js.map
|