@absolutejs/absolute 0.19.0-beta.852 → 0.19.0-beta.853
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/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +3 -1
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +3 -1
- package/dist/angular/server.js.map +3 -3
- package/dist/build.js +1919 -284
- package/dist/build.js.map +17 -7
- package/dist/dev/client/handlers/angularHmrShim.ts +77 -0
- package/dist/dev/client/hmrClient.ts +21 -0
- package/dist/index.js +2006 -329
- package/dist/index.js.map +18 -8
- package/dist/react/index.js +3 -1
- package/dist/react/index.js.map +2 -2
- package/dist/react/server.js +3 -1
- package/dist/react/server.js.map +2 -2
- package/dist/src/core/prepare.d.ts +25 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +19 -0
- package/dist/src/dev/angular/hmrCompiler.d.ts +18 -0
- package/dist/src/dev/angular/hmrImportGenerator.d.ts +3 -0
- package/dist/src/dev/angular/hmrInjectionPlugin.d.ts +7 -0
- package/dist/src/dev/angular/resolveOwningComponents.d.ts +8 -0
- package/dist/src/dev/angular/vendor/translator/api/ast_factory.d.ts +363 -0
- package/dist/src/dev/angular/vendor/translator/api/import_generator.d.ts +49 -0
- package/dist/src/dev/angular/vendor/translator/context.d.ts +18 -0
- package/dist/src/dev/angular/vendor/translator/translator.d.ts +75 -0
- package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +12 -0
- package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +66 -0
- package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +13 -0
- package/dist/src/plugins/hmr.d.ts +25 -0
- package/dist/src/vue/components/Image.d.ts +1 -1
- package/dist/svelte/index.js +3 -1
- package/dist/svelte/index.js.map +2 -2
- package/dist/svelte/server.js +3 -1
- package/dist/svelte/server.js.map +2 -2
- package/dist/vue/index.js +3 -1
- package/dist/vue/index.js.map +2 -2
- package/dist/vue/server.js +3 -1
- package/dist/vue/server.js.map +2 -2
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -215,6 +215,8 @@ var colors2, frameworkColors, formatPath = (filePath) => {
|
|
|
215
215
|
console.error(`${timestamp} ${tag} ${fullMessage}`);
|
|
216
216
|
}, logHmrUpdate = (path, framework, duration) => {
|
|
217
217
|
log("hmr update", { duration, framework, path });
|
|
218
|
+
}, logInfo = (message) => {
|
|
219
|
+
log(message);
|
|
218
220
|
}, logScriptUpdate = (path, framework, duration) => {
|
|
219
221
|
log("script update", { duration, framework, path });
|
|
220
222
|
}, logServerReload = () => {
|
|
@@ -9552,19 +9554,87 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
9552
9554
|
angularLinkerPlugin = createAngularLinkerPlugin(false);
|
|
9553
9555
|
});
|
|
9554
9556
|
|
|
9557
|
+
// src/dev/angular/hmrInjectionPlugin.ts
|
|
9558
|
+
var exports_hmrInjectionPlugin = {};
|
|
9559
|
+
__export(exports_hmrInjectionPlugin, {
|
|
9560
|
+
createAngularHmrInjectionPlugin: () => createAngularHmrInjectionPlugin
|
|
9561
|
+
});
|
|
9562
|
+
import { readFile as readFile5 } from "fs/promises";
|
|
9563
|
+
import { relative as relative6, resolve as resolve12 } from "path";
|
|
9564
|
+
var COMPONENT_DECORATOR_RE, buildHmrTail = (className, encodedIdLiteral) => `
|
|
9565
|
+
|
|
9566
|
+
// absolutejs HMR \u2014 auto-generated; mirrors compileHmrInitializer from
|
|
9567
|
+
// @angular/compiler with import.meta.hot adapted to globalThis.__angularHmr.
|
|
9568
|
+
{
|
|
9569
|
+
const __ng_hmr_id = ${encodedIdLiteral};
|
|
9570
|
+
const __ng_hmr_load = async (t) => {
|
|
9571
|
+
const [u, core] = await Promise.all([
|
|
9572
|
+
import('/@ng/component?c=' + encodeURIComponent(__ng_hmr_id) + '&t=' + t),
|
|
9573
|
+
import('@angular/core')
|
|
9574
|
+
]);
|
|
9575
|
+
if (u && typeof u.default === 'function') u.default(${className}, [core]);
|
|
9576
|
+
};
|
|
9577
|
+
if (typeof globalThis !== 'undefined' &&
|
|
9578
|
+
globalThis.__angularHmr &&
|
|
9579
|
+
typeof globalThis.__angularHmr.on === 'function') {
|
|
9580
|
+
globalThis.__angularHmr.on('angular:component-update', (d) => {
|
|
9581
|
+
if (d && d.id === __ng_hmr_id) __ng_hmr_load(d.timestamp);
|
|
9582
|
+
});
|
|
9583
|
+
}
|
|
9584
|
+
}
|
|
9585
|
+
`, createAngularHmrInjectionPlugin = (params) => {
|
|
9586
|
+
const { generatedAngularRoot, userAngularRoot, projectRoot } = params;
|
|
9587
|
+
const normalizedGenRoot = resolve12(generatedAngularRoot).replace(/\\/g, "/");
|
|
9588
|
+
return {
|
|
9589
|
+
name: "absolute-angular-hmr-injection",
|
|
9590
|
+
setup(build) {
|
|
9591
|
+
build.onLoad({ filter: /\.component\.js$/ }, async (args) => {
|
|
9592
|
+
const normalizedPath = args.path.replace(/\\/g, "/");
|
|
9593
|
+
if (!normalizedPath.startsWith(normalizedGenRoot + "/"))
|
|
9594
|
+
return;
|
|
9595
|
+
const text = await readFile5(args.path, "utf8");
|
|
9596
|
+
const seen = new Set;
|
|
9597
|
+
const classNames = [];
|
|
9598
|
+
let match;
|
|
9599
|
+
const re2 = new RegExp(COMPONENT_DECORATOR_RE.source, COMPONENT_DECORATOR_RE.flags);
|
|
9600
|
+
while ((match = re2.exec(text)) !== null) {
|
|
9601
|
+
const className = match[1];
|
|
9602
|
+
if (className && !seen.has(className)) {
|
|
9603
|
+
seen.add(className);
|
|
9604
|
+
classNames.push(className);
|
|
9605
|
+
}
|
|
9606
|
+
}
|
|
9607
|
+
if (classNames.length === 0)
|
|
9608
|
+
return;
|
|
9609
|
+
const relFromGenRoot = relative6(generatedAngularRoot, args.path).replace(/\\/g, "/");
|
|
9610
|
+
const userTsPath = resolve12(userAngularRoot, relFromGenRoot.replace(/\.js$/, ".ts"));
|
|
9611
|
+
const projectRel = relative6(projectRoot, userTsPath).replace(/\\/g, "/");
|
|
9612
|
+
const tail = classNames.map((className) => {
|
|
9613
|
+
const id = `${projectRel}@${className}`;
|
|
9614
|
+
return buildHmrTail(className, JSON.stringify(id));
|
|
9615
|
+
}).join("");
|
|
9616
|
+
return { contents: text + tail, loader: "js" };
|
|
9617
|
+
});
|
|
9618
|
+
}
|
|
9619
|
+
};
|
|
9620
|
+
};
|
|
9621
|
+
var init_hmrInjectionPlugin = __esm(() => {
|
|
9622
|
+
COMPONENT_DECORATOR_RE = /([A-Z][A-Za-z0-9_$]*)\s*=\s*__legacyDecorateClassTS[A-Za-z0-9_$]*\s*\(\s*\[[\s\S]*?\bComponent[A-Za-z0-9_$]*\s*\(/g;
|
|
9623
|
+
});
|
|
9624
|
+
|
|
9555
9625
|
// src/utils/cleanStaleOutputs.ts
|
|
9556
9626
|
import { rm as rm2 } from "fs/promises";
|
|
9557
|
-
import { resolve as
|
|
9627
|
+
import { resolve as resolve13 } from "path";
|
|
9558
9628
|
var {Glob: Glob5 } = globalThis.Bun;
|
|
9559
9629
|
var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
|
|
9560
|
-
const currentPaths = new Set(currentOutputPaths.map((path) =>
|
|
9630
|
+
const currentPaths = new Set(currentOutputPaths.map((path) => resolve13(path)));
|
|
9561
9631
|
const glob = new Glob5("**/*");
|
|
9562
9632
|
const removals = [];
|
|
9563
|
-
for (const
|
|
9564
|
-
const absolute =
|
|
9633
|
+
for (const relative7 of glob.scanSync({ cwd: buildPath })) {
|
|
9634
|
+
const absolute = resolve13(buildPath, relative7);
|
|
9565
9635
|
if (currentPaths.has(absolute))
|
|
9566
9636
|
continue;
|
|
9567
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
9637
|
+
if (!HASHED_FILE_PATTERN.test(relative7))
|
|
9568
9638
|
continue;
|
|
9569
9639
|
removals.push(rm2(absolute, { force: true }));
|
|
9570
9640
|
}
|
|
@@ -9793,11 +9863,11 @@ var init_buildDirectoryLock = __esm(() => {
|
|
|
9793
9863
|
});
|
|
9794
9864
|
|
|
9795
9865
|
// src/utils/validateSafePath.ts
|
|
9796
|
-
import { resolve as
|
|
9866
|
+
import { resolve as resolve14, relative as relative7 } from "path";
|
|
9797
9867
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
9798
|
-
const absoluteBase =
|
|
9799
|
-
const absoluteTarget =
|
|
9800
|
-
const relativePath = normalizePath(
|
|
9868
|
+
const absoluteBase = resolve14(baseDirectory);
|
|
9869
|
+
const absoluteTarget = resolve14(baseDirectory, targetPath);
|
|
9870
|
+
const relativePath = normalizePath(relative7(absoluteBase, absoluteTarget));
|
|
9801
9871
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
9802
9872
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
9803
9873
|
}
|
|
@@ -9951,22 +10021,22 @@ import {
|
|
|
9951
10021
|
join as join15,
|
|
9952
10022
|
basename as basename4,
|
|
9953
10023
|
extname as extname5,
|
|
9954
|
-
resolve as
|
|
9955
|
-
relative as
|
|
10024
|
+
resolve as resolve15,
|
|
10025
|
+
relative as relative8,
|
|
9956
10026
|
sep as sep2
|
|
9957
10027
|
} from "path";
|
|
9958
10028
|
import { env } from "process";
|
|
9959
10029
|
var {write, file, Transpiler } = globalThis.Bun;
|
|
9960
10030
|
var resolveDevClientDir2 = () => {
|
|
9961
10031
|
const projectRoot = process.cwd();
|
|
9962
|
-
const fromSource =
|
|
10032
|
+
const fromSource = resolve15(import.meta.dir, "../dev/client");
|
|
9963
10033
|
if (existsSync14(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
9964
10034
|
return fromSource;
|
|
9965
10035
|
}
|
|
9966
|
-
const fromNodeModules =
|
|
10036
|
+
const fromNodeModules = resolve15(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
9967
10037
|
if (existsSync14(fromNodeModules))
|
|
9968
10038
|
return fromNodeModules;
|
|
9969
|
-
return
|
|
10039
|
+
return resolve15(import.meta.dir, "./dev/client");
|
|
9970
10040
|
}, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
|
|
9971
10041
|
persistentCache.clear();
|
|
9972
10042
|
sourceHashCache.clear();
|
|
@@ -9996,7 +10066,7 @@ var resolveDevClientDir2 = () => {
|
|
|
9996
10066
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
9997
10067
|
if (!spec.startsWith("."))
|
|
9998
10068
|
return null;
|
|
9999
|
-
const basePath =
|
|
10069
|
+
const basePath = resolve15(dirname9(from), spec);
|
|
10000
10070
|
const candidates = [
|
|
10001
10071
|
basePath,
|
|
10002
10072
|
`${basePath}.ts`,
|
|
@@ -10023,7 +10093,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10023
10093
|
const resolved = resolvePackageImport(spec);
|
|
10024
10094
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
10025
10095
|
}
|
|
10026
|
-
const basePath =
|
|
10096
|
+
const basePath = resolve15(dirname9(from), spec);
|
|
10027
10097
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
10028
10098
|
if (!explicit) {
|
|
10029
10099
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -10044,8 +10114,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10044
10114
|
return jsPath;
|
|
10045
10115
|
return null;
|
|
10046
10116
|
}, addModuleRewrite = (rewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir) => {
|
|
10047
|
-
const toServer =
|
|
10048
|
-
const toClient =
|
|
10117
|
+
const toServer = relative8(ssrOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
10118
|
+
const toClient = relative8(clientOutputDir, resolvedModule).replace(/\\/g, "/");
|
|
10049
10119
|
rewrites.set(rawSpec, {
|
|
10050
10120
|
client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
|
|
10051
10121
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -10083,8 +10153,8 @@ var resolveDevClientDir2 = () => {
|
|
|
10083
10153
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
10084
10154
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedServer) : preprocessedServer;
|
|
10085
10155
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedClient) : preprocessedClient;
|
|
10086
|
-
const rawRel = dirname9(
|
|
10087
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${
|
|
10156
|
+
const rawRel = dirname9(relative8(svelteRoot, src)).replace(/\\/g, "/");
|
|
10157
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative8(process.cwd(), dirname9(src)).replace(/\\/g, "/")}` : rawRel;
|
|
10088
10158
|
const baseName = basename4(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
10089
10159
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
10090
10160
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -10105,15 +10175,15 @@ var resolveDevClientDir2 = () => {
|
|
|
10105
10175
|
addModuleRewrite(externalRewrites, rawSpec, resolvedModule, ssrOutputDir, clientOutputDir);
|
|
10106
10176
|
if (!resolved)
|
|
10107
10177
|
continue;
|
|
10108
|
-
const childRel =
|
|
10178
|
+
const childRel = relative8(svelteRoot, resolved).replace(/\\/g, "/");
|
|
10109
10179
|
if (!childRel.startsWith(".."))
|
|
10110
10180
|
continue;
|
|
10111
10181
|
const childBuilt2 = cache.get(resolved);
|
|
10112
10182
|
if (!childBuilt2)
|
|
10113
10183
|
continue;
|
|
10114
10184
|
const origSpec = rawSpec.replace(/\.svelte(?:\.(?:ts|js))?$/, ".js");
|
|
10115
|
-
const toServer =
|
|
10116
|
-
const toClient =
|
|
10185
|
+
const toServer = relative8(ssrOutputDir, childBuilt2.ssr).replace(/\\/g, "/");
|
|
10186
|
+
const toClient = relative8(clientOutputDir, childBuilt2.client).replace(/\\/g, "/");
|
|
10117
10187
|
externalRewrites.set(origSpec, {
|
|
10118
10188
|
client: toClient.startsWith(".") ? toClient : `./${toClient}`,
|
|
10119
10189
|
server: toServer.startsWith(".") ? toServer : `./${toServer}`
|
|
@@ -10147,7 +10217,7 @@ var resolveDevClientDir2 = () => {
|
|
|
10147
10217
|
}).js.code;
|
|
10148
10218
|
let code = compiled.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
10149
10219
|
if (mode === "client" && isDev) {
|
|
10150
|
-
const moduleKey = `/@src/${
|
|
10220
|
+
const moduleKey = `/@src/${relative8(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
10151
10221
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
10152
10222
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
10153
10223
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -10190,10 +10260,10 @@ var resolveDevClientDir2 = () => {
|
|
|
10190
10260
|
};
|
|
10191
10261
|
const roots = await Promise.all(entryPoints.map(build));
|
|
10192
10262
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
10193
|
-
const relClientDir = dirname9(
|
|
10263
|
+
const relClientDir = dirname9(relative8(clientDir, client));
|
|
10194
10264
|
const name = basename4(client, extname5(client));
|
|
10195
10265
|
const indexPath = join15(indexDir, relClientDir, `${name}.js`);
|
|
10196
|
-
const importRaw =
|
|
10266
|
+
const importRaw = relative8(dirname9(indexPath), client).split(sep2).join("/");
|
|
10197
10267
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
10198
10268
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
10199
10269
|
import "${hmrClientPath3}";
|
|
@@ -10270,7 +10340,7 @@ if (typeof window !== "undefined") {
|
|
|
10270
10340
|
return {
|
|
10271
10341
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
10272
10342
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
10273
|
-
const rel = dirname9(
|
|
10343
|
+
const rel = dirname9(relative8(clientDir, client));
|
|
10274
10344
|
return join15(indexDir, rel, basename4(client));
|
|
10275
10345
|
}),
|
|
10276
10346
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -10359,20 +10429,20 @@ import {
|
|
|
10359
10429
|
dirname as dirname10,
|
|
10360
10430
|
isAbsolute as isAbsolute3,
|
|
10361
10431
|
join as join16,
|
|
10362
|
-
relative as
|
|
10363
|
-
resolve as
|
|
10432
|
+
relative as relative9,
|
|
10433
|
+
resolve as resolve16
|
|
10364
10434
|
} from "path";
|
|
10365
10435
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
10366
10436
|
var resolveDevClientDir3 = () => {
|
|
10367
10437
|
const projectRoot = process.cwd();
|
|
10368
|
-
const fromSource =
|
|
10438
|
+
const fromSource = resolve16(import.meta.dir, "../dev/client");
|
|
10369
10439
|
if (existsSync15(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
10370
10440
|
return fromSource;
|
|
10371
10441
|
}
|
|
10372
|
-
const fromNodeModules =
|
|
10442
|
+
const fromNodeModules = resolve16(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
10373
10443
|
if (existsSync15(fromNodeModules))
|
|
10374
10444
|
return fromNodeModules;
|
|
10375
|
-
return
|
|
10445
|
+
return resolve16(import.meta.dir, "./dev/client");
|
|
10376
10446
|
}, devClientDir3, hmrClientPath4, transpiler3, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
|
|
10377
10447
|
scriptCache.clear();
|
|
10378
10448
|
scriptSetupCache.clear();
|
|
@@ -10411,14 +10481,14 @@ var resolveDevClientDir3 = () => {
|
|
|
10411
10481
|
return "template-only";
|
|
10412
10482
|
}
|
|
10413
10483
|
return "full";
|
|
10414
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
10484
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative9(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath, sourceDir) => {
|
|
10415
10485
|
if (filePath.endsWith(".vue"))
|
|
10416
10486
|
return filePath.replace(/\.vue$/, ".js");
|
|
10417
10487
|
if (filePath.endsWith(".ts"))
|
|
10418
10488
|
return filePath.replace(/\.ts$/, ".js");
|
|
10419
10489
|
if (isStylePath(filePath)) {
|
|
10420
10490
|
if (sourceDir && (filePath.startsWith("./") || filePath.startsWith("../"))) {
|
|
10421
|
-
return
|
|
10491
|
+
return resolve16(sourceDir, filePath);
|
|
10422
10492
|
}
|
|
10423
10493
|
return filePath;
|
|
10424
10494
|
}
|
|
@@ -10444,7 +10514,7 @@ var resolveDevClientDir3 = () => {
|
|
|
10444
10514
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
10445
10515
|
if (cachedResult)
|
|
10446
10516
|
return cachedResult;
|
|
10447
|
-
const relativeFilePath =
|
|
10517
|
+
const relativeFilePath = relative9(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
10448
10518
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
10449
10519
|
const fileBaseName = basename5(sourceFilePath, ".vue");
|
|
10450
10520
|
const componentId = toKebab(fileBaseName);
|
|
@@ -10482,12 +10552,12 @@ var resolveDevClientDir3 = () => {
|
|
|
10482
10552
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
10483
10553
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
10484
10554
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
10485
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path :
|
|
10555
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve16(dirname10(sourceFilePath), path));
|
|
10486
10556
|
for (const stylePath of stylePathsImported) {
|
|
10487
10557
|
addStyleImporter(sourceFilePath, stylePath);
|
|
10488
10558
|
}
|
|
10489
10559
|
const childBuildResults = await Promise.all([
|
|
10490
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(
|
|
10560
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve16(dirname10(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
10491
10561
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
10492
10562
|
]);
|
|
10493
10563
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -10578,7 +10648,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10578
10648
|
let result2 = code;
|
|
10579
10649
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
10580
10650
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
10581
|
-
let rel =
|
|
10651
|
+
let rel = relative9(dirname10(outputPath), targetPath).replace(/\\/g, "/");
|
|
10582
10652
|
if (!rel.startsWith("."))
|
|
10583
10653
|
rel = `./${rel}`;
|
|
10584
10654
|
result2 = result2.replaceAll(bareImport, rel);
|
|
@@ -10596,7 +10666,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10596
10666
|
hmrId,
|
|
10597
10667
|
serverPath: serverOutputPath,
|
|
10598
10668
|
tsHelperPaths: [
|
|
10599
|
-
...helperModulePaths.map((helper) =>
|
|
10669
|
+
...helperModulePaths.map((helper) => resolve16(dirname10(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
10600
10670
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
10601
10671
|
]
|
|
10602
10672
|
};
|
|
@@ -10619,7 +10689,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10619
10689
|
const buildCache = new Map;
|
|
10620
10690
|
const allTsHelperPaths = new Set;
|
|
10621
10691
|
const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
|
|
10622
|
-
const result = await compileVueFile(
|
|
10692
|
+
const result = await compileVueFile(resolve16(entryPath), {
|
|
10623
10693
|
client: clientOutputDir,
|
|
10624
10694
|
css: cssOutputDir,
|
|
10625
10695
|
server: serverOutputDir
|
|
@@ -10627,7 +10697,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10627
10697
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
10628
10698
|
const entryBaseName = basename5(entryPath, ".vue");
|
|
10629
10699
|
const indexOutputFile = join16(indexOutputDir, `${entryBaseName}.js`);
|
|
10630
|
-
const clientOutputFile = join16(clientOutputDir,
|
|
10700
|
+
const clientOutputFile = join16(clientOutputDir, relative9(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
10631
10701
|
await mkdir4(dirname10(indexOutputFile), { recursive: true });
|
|
10632
10702
|
const vueHmrImports = isDev ? [
|
|
10633
10703
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -10635,7 +10705,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10635
10705
|
] : [];
|
|
10636
10706
|
await write2(indexOutputFile, [
|
|
10637
10707
|
...vueHmrImports,
|
|
10638
|
-
`import Comp, * as PageModule from "${
|
|
10708
|
+
`import Comp, * as PageModule from "${relative9(dirname10(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
10639
10709
|
'import { createSSRApp, createApp } from "vue";',
|
|
10640
10710
|
"",
|
|
10641
10711
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -10779,7 +10849,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10779
10849
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
10780
10850
|
const sourceCode = await file2(tsPath).text();
|
|
10781
10851
|
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
10782
|
-
const relativeJsPath =
|
|
10852
|
+
const relativeJsPath = relative9(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
10783
10853
|
const outClientPath = join16(clientOutputDir, relativeJsPath);
|
|
10784
10854
|
const outServerPath = join16(serverOutputDir, relativeJsPath);
|
|
10785
10855
|
await mkdir4(dirname10(outClientPath), { recursive: true });
|
|
@@ -11284,17 +11354,17 @@ __export(exports_compileAngular, {
|
|
|
11284
11354
|
compileAngular: () => compileAngular
|
|
11285
11355
|
});
|
|
11286
11356
|
import { existsSync as existsSync16, readFileSync as readFileSync11, promises as fs } from "fs";
|
|
11287
|
-
import { join as join17, basename as basename6, sep as sep3, dirname as dirname11, resolve as
|
|
11357
|
+
import { join as join17, basename as basename6, sep as sep3, dirname as dirname11, resolve as resolve17, relative as relative10 } from "path";
|
|
11288
11358
|
import ts2 from "typescript";
|
|
11289
11359
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
11290
11360
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
11291
11361
|
return tracePhase ? tracePhase(`compile/angular/${name}`, fn2, metadata) : await fn2();
|
|
11292
11362
|
}, readTsconfigPathAliases = () => {
|
|
11293
11363
|
try {
|
|
11294
|
-
const configPath2 =
|
|
11364
|
+
const configPath2 = resolve17(process.cwd(), "tsconfig.json");
|
|
11295
11365
|
const config = ts2.readConfigFile(configPath2, ts2.sys.readFile).config;
|
|
11296
11366
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
11297
|
-
const baseUrl =
|
|
11367
|
+
const baseUrl = resolve17(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
11298
11368
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
11299
11369
|
return { aliases, baseUrl };
|
|
11300
11370
|
} catch {
|
|
@@ -11314,7 +11384,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11314
11384
|
const wildcardValue = exactMatch ? "" : specifier.slice(prefix.length, specifier.length - suffix.length);
|
|
11315
11385
|
for (const replacement of alias.replacements) {
|
|
11316
11386
|
const candidate = replacement.replace("*", wildcardValue);
|
|
11317
|
-
const resolved = resolveSourceFile(
|
|
11387
|
+
const resolved = resolveSourceFile(resolve17(baseUrl, candidate));
|
|
11318
11388
|
if (resolved)
|
|
11319
11389
|
return resolved;
|
|
11320
11390
|
}
|
|
@@ -11333,13 +11403,13 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11333
11403
|
];
|
|
11334
11404
|
return candidates.find((file3) => existsSync16(file3));
|
|
11335
11405
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
11336
|
-
const baseDir =
|
|
11406
|
+
const baseDir = resolve17(rootDir);
|
|
11337
11407
|
const tsconfigAliases = readTsconfigPathAliases();
|
|
11338
11408
|
const transpiler4 = new Bun.Transpiler({ loader: "tsx" });
|
|
11339
11409
|
const scanCache = new Map;
|
|
11340
11410
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
11341
11411
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
11342
|
-
return resolveSourceFile(
|
|
11412
|
+
return resolveSourceFile(resolve17(fromDir, specifier));
|
|
11343
11413
|
}
|
|
11344
11414
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile);
|
|
11345
11415
|
if (aliased)
|
|
@@ -11348,7 +11418,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11348
11418
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
11349
11419
|
if (resolved.includes("/node_modules/"))
|
|
11350
11420
|
return;
|
|
11351
|
-
const absolute =
|
|
11421
|
+
const absolute = resolve17(resolved);
|
|
11352
11422
|
if (!absolute.startsWith(baseDir))
|
|
11353
11423
|
return;
|
|
11354
11424
|
return resolveSourceFile(absolute);
|
|
@@ -11364,7 +11434,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11364
11434
|
usesLegacyAnimations: false
|
|
11365
11435
|
});
|
|
11366
11436
|
}
|
|
11367
|
-
const resolved =
|
|
11437
|
+
const resolved = resolve17(actualPath);
|
|
11368
11438
|
const cached = scanCache.get(resolved);
|
|
11369
11439
|
if (cached)
|
|
11370
11440
|
return cached;
|
|
@@ -11393,7 +11463,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11393
11463
|
const actualPath = resolveSourceFile(filePath);
|
|
11394
11464
|
if (!actualPath)
|
|
11395
11465
|
return false;
|
|
11396
|
-
const resolved =
|
|
11466
|
+
const resolved = resolve17(actualPath);
|
|
11397
11467
|
if (visited.has(resolved))
|
|
11398
11468
|
return false;
|
|
11399
11469
|
visited.add(resolved);
|
|
@@ -11411,14 +11481,14 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11411
11481
|
return (entryPath) => visit(entryPath);
|
|
11412
11482
|
}, resolveDevClientDir4 = () => {
|
|
11413
11483
|
const projectRoot = process.cwd();
|
|
11414
|
-
const fromSource =
|
|
11484
|
+
const fromSource = resolve17(import.meta.dir, "../dev/client");
|
|
11415
11485
|
if (existsSync16(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
11416
11486
|
return fromSource;
|
|
11417
11487
|
}
|
|
11418
|
-
const fromNodeModules =
|
|
11488
|
+
const fromNodeModules = resolve17(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
11419
11489
|
if (existsSync16(fromNodeModules))
|
|
11420
11490
|
return fromNodeModules;
|
|
11421
|
-
return
|
|
11491
|
+
return resolve17(import.meta.dir, "./dev/client");
|
|
11422
11492
|
}, devClientDir4, hmrClientPath5, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
|
|
11423
11493
|
const entityClassRegex = /(?:export\s+)?class\s+(\w+(?:Component|Service|Directive|Pipe))\s/g;
|
|
11424
11494
|
const entityNames = [];
|
|
@@ -11480,11 +11550,11 @@ ${registrations}
|
|
|
11480
11550
|
if (hasJsLikeExtension(path))
|
|
11481
11551
|
return `${path}${query}`;
|
|
11482
11552
|
const importerDir = dirname11(importerOutputPath);
|
|
11483
|
-
const fileCandidate =
|
|
11553
|
+
const fileCandidate = resolve17(importerDir, `${path}.js`);
|
|
11484
11554
|
if (outputFiles?.has(fileCandidate) || existsSync16(fileCandidate)) {
|
|
11485
11555
|
return `${path}.js${query}`;
|
|
11486
11556
|
}
|
|
11487
|
-
const indexCandidate =
|
|
11557
|
+
const indexCandidate = resolve17(importerDir, path, "index.js");
|
|
11488
11558
|
if (outputFiles?.has(indexCandidate) || existsSync16(indexCandidate)) {
|
|
11489
11559
|
return `${path}/index.js${query}`;
|
|
11490
11560
|
}
|
|
@@ -11512,7 +11582,7 @@ ${registrations}
|
|
|
11512
11582
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
11513
11583
|
if (!isRelativeModuleSpecifier(specifier))
|
|
11514
11584
|
return null;
|
|
11515
|
-
const basePath =
|
|
11585
|
+
const basePath = resolve17(dirname11(fromFile), specifier);
|
|
11516
11586
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
11517
11587
|
`${basePath}.ts`,
|
|
11518
11588
|
`${basePath}.tsx`,
|
|
@@ -11523,9 +11593,9 @@ ${registrations}
|
|
|
11523
11593
|
join17(basePath, "index.mts"),
|
|
11524
11594
|
join17(basePath, "index.cts")
|
|
11525
11595
|
];
|
|
11526
|
-
return candidates.map((candidate) =>
|
|
11527
|
-
}, readFileForAotTransform = async (fileName,
|
|
11528
|
-
const hostSource =
|
|
11596
|
+
return candidates.map((candidate) => resolve17(candidate)).find((candidate) => existsSync16(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
11597
|
+
}, readFileForAotTransform = async (fileName, readFile6) => {
|
|
11598
|
+
const hostSource = readFile6?.(fileName);
|
|
11529
11599
|
if (typeof hostSource === "string")
|
|
11530
11600
|
return hostSource;
|
|
11531
11601
|
return fs.readFile(fileName, "utf-8");
|
|
@@ -11558,7 +11628,7 @@ ${registrations}
|
|
|
11558
11628
|
paths.push(join17(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
11559
11629
|
}
|
|
11560
11630
|
}
|
|
11561
|
-
return paths.map((path) =>
|
|
11631
|
+
return paths.map((path) => resolve17(path));
|
|
11562
11632
|
}, readResourceCacheFile = async (cachePath) => {
|
|
11563
11633
|
try {
|
|
11564
11634
|
const entry = JSON.parse(await fs.readFile(cachePath, "utf-8"));
|
|
@@ -11590,7 +11660,7 @@ ${registrations}
|
|
|
11590
11660
|
].join("\x00");
|
|
11591
11661
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
11592
11662
|
return join17(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
11593
|
-
}, precomputeAotResourceTransforms = async (inputPaths,
|
|
11663
|
+
}, precomputeAotResourceTransforms = async (inputPaths, readFile6, stylePreprocessors) => {
|
|
11594
11664
|
const transformedSources = new Map;
|
|
11595
11665
|
const visited = new Set;
|
|
11596
11666
|
const stats = {
|
|
@@ -11600,14 +11670,14 @@ ${registrations}
|
|
|
11600
11670
|
transformedFiles: 0
|
|
11601
11671
|
};
|
|
11602
11672
|
const transformFile = async (filePath) => {
|
|
11603
|
-
const resolvedPath =
|
|
11673
|
+
const resolvedPath = resolve17(filePath);
|
|
11604
11674
|
if (visited.has(resolvedPath))
|
|
11605
11675
|
return;
|
|
11606
11676
|
visited.add(resolvedPath);
|
|
11607
11677
|
if (!existsSync16(resolvedPath) || resolvedPath.endsWith(".d.ts"))
|
|
11608
11678
|
return;
|
|
11609
11679
|
stats.filesVisited += 1;
|
|
11610
|
-
const source = await readFileForAotTransform(resolvedPath,
|
|
11680
|
+
const source = await readFileForAotTransform(resolvedPath, readFile6);
|
|
11611
11681
|
const cachePath = await resolveResourceTransformCachePath(resolvedPath, source, stylePreprocessors);
|
|
11612
11682
|
const cached = await readResourceCacheFile(cachePath);
|
|
11613
11683
|
let transformedSource;
|
|
@@ -11635,7 +11705,7 @@ ${registrations}
|
|
|
11635
11705
|
return { stats, transformedSources };
|
|
11636
11706
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
11637
11707
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
11638
|
-
const outputPath =
|
|
11708
|
+
const outputPath = resolve17(join17(outDir, relative10(process.cwd(), resolve17(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
11639
11709
|
return [
|
|
11640
11710
|
outputPath,
|
|
11641
11711
|
buildIslandMetadataExports(readFileSync11(inputPath, "utf-8"))
|
|
@@ -11646,7 +11716,7 @@ ${registrations}
|
|
|
11646
11716
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
11647
11717
|
const tsPath = __require.resolve("typescript");
|
|
11648
11718
|
const tsRootDir = dirname11(tsPath);
|
|
11649
|
-
return tsRootDir.endsWith("lib") ? tsRootDir :
|
|
11719
|
+
return tsRootDir.endsWith("lib") ? tsRootDir : resolve17(tsRootDir, "lib");
|
|
11650
11720
|
});
|
|
11651
11721
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
11652
11722
|
const options = {
|
|
@@ -11688,7 +11758,7 @@ ${registrations}
|
|
|
11688
11758
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
11689
11759
|
};
|
|
11690
11760
|
const emitted = {};
|
|
11691
|
-
const resolvedOutDir =
|
|
11761
|
+
const resolvedOutDir = resolve17(outDir);
|
|
11692
11762
|
host.writeFile = (fileName, text) => {
|
|
11693
11763
|
const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
|
|
11694
11764
|
emitted[relativePath] = text;
|
|
@@ -11710,12 +11780,12 @@ ${registrations}
|
|
|
11710
11780
|
if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
|
|
11711
11781
|
return source;
|
|
11712
11782
|
}
|
|
11713
|
-
const resolvedPath =
|
|
11783
|
+
const resolvedPath = resolve17(fileName);
|
|
11714
11784
|
return transformedSources.get(resolvedPath) ?? source;
|
|
11715
11785
|
};
|
|
11716
11786
|
const originalGetSourceFileForCompile = host.getSourceFile;
|
|
11717
11787
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
11718
|
-
const source = transformedSources.get(
|
|
11788
|
+
const source = transformedSources.get(resolve17(fileName));
|
|
11719
11789
|
if (source) {
|
|
11720
11790
|
return ts2.createSourceFile(fileName, source, languageVersion, true);
|
|
11721
11791
|
}
|
|
@@ -11739,7 +11809,7 @@ ${registrations}
|
|
|
11739
11809
|
content,
|
|
11740
11810
|
target: join17(outDir, fileName)
|
|
11741
11811
|
}));
|
|
11742
|
-
const outputFiles = new Set(rawEntries.map(({ target }) =>
|
|
11812
|
+
const outputFiles = new Set(rawEntries.map(({ target }) => resolve17(target)));
|
|
11743
11813
|
return rawEntries.map(({ content, target }) => {
|
|
11744
11814
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
11745
11815
|
const rewritten = rewriteRelativeJsSpecifier(target, path, outputFiles);
|
|
@@ -11754,7 +11824,7 @@ ${registrations}
|
|
|
11754
11824
|
return cleaned ? `import { ${cleaned}, InternalInjectFlags } from '@angular/core'` : `import { InternalInjectFlags } from '@angular/core'`;
|
|
11755
11825
|
});
|
|
11756
11826
|
processedContent = processedContent.replace(/\b(?<!Internal)InjectFlags\b/g, "InternalInjectFlags");
|
|
11757
|
-
processedContent += islandMetadataByOutputPath.get(
|
|
11827
|
+
processedContent += islandMetadataByOutputPath.get(resolve17(target)) ?? "";
|
|
11758
11828
|
return { content: processedContent, target };
|
|
11759
11829
|
});
|
|
11760
11830
|
});
|
|
@@ -11775,7 +11845,7 @@ ${registrations}
|
|
|
11775
11845
|
}
|
|
11776
11846
|
return null;
|
|
11777
11847
|
}, resolveAngularDeferImportSpecifier = () => {
|
|
11778
|
-
const sourceEntry =
|
|
11848
|
+
const sourceEntry = resolve17(import.meta.dir, "../angular/components/index.ts");
|
|
11779
11849
|
if (existsSync16(sourceEntry)) {
|
|
11780
11850
|
return sourceEntry.replace(/\\/g, "/");
|
|
11781
11851
|
}
|
|
@@ -12005,10 +12075,10 @@ ${fields}
|
|
|
12005
12075
|
source: result
|
|
12006
12076
|
};
|
|
12007
12077
|
}, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors, cacheBuster) => {
|
|
12008
|
-
const entryPath =
|
|
12078
|
+
const entryPath = resolve17(inputPath);
|
|
12009
12079
|
const allOutputs = [];
|
|
12010
12080
|
const visited = new Set;
|
|
12011
|
-
const baseDir =
|
|
12081
|
+
const baseDir = resolve17(rootDir ?? process.cwd());
|
|
12012
12082
|
let usesLegacyAnimations = false;
|
|
12013
12083
|
const angularTranspiler = new Bun.Transpiler({
|
|
12014
12084
|
loader: "ts",
|
|
@@ -12035,7 +12105,7 @@ ${fields}
|
|
|
12035
12105
|
};
|
|
12036
12106
|
const resolveLocalImport = (specifier, fromDir) => {
|
|
12037
12107
|
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
12038
|
-
return resolveSourceFile2(
|
|
12108
|
+
return resolveSourceFile2(resolve17(fromDir, specifier));
|
|
12039
12109
|
}
|
|
12040
12110
|
const aliased = matchTsconfigAlias(specifier, tsconfigAliases.aliases, tsconfigAliases.baseUrl, resolveSourceFile2);
|
|
12041
12111
|
if (aliased)
|
|
@@ -12044,7 +12114,7 @@ ${fields}
|
|
|
12044
12114
|
const resolved = Bun.resolveSync(specifier, fromDir);
|
|
12045
12115
|
if (resolved.includes("/node_modules/"))
|
|
12046
12116
|
return;
|
|
12047
|
-
const absolute =
|
|
12117
|
+
const absolute = resolve17(resolved);
|
|
12048
12118
|
if (!absolute.startsWith(baseDir))
|
|
12049
12119
|
return;
|
|
12050
12120
|
return resolveSourceFile2(absolute);
|
|
@@ -12093,13 +12163,13 @@ ${fields}
|
|
|
12093
12163
|
return `${prefix}${dots}`;
|
|
12094
12164
|
return `${prefix}../${dots}`;
|
|
12095
12165
|
});
|
|
12096
|
-
if (
|
|
12166
|
+
if (resolve17(actualPath) === entryPath) {
|
|
12097
12167
|
processedContent += buildIslandMetadataExports(sourceCode);
|
|
12098
12168
|
}
|
|
12099
12169
|
return processedContent;
|
|
12100
12170
|
};
|
|
12101
12171
|
const transpileFile = async (filePath) => {
|
|
12102
|
-
const resolved =
|
|
12172
|
+
const resolved = resolve17(filePath);
|
|
12103
12173
|
if (visited.has(resolved))
|
|
12104
12174
|
return;
|
|
12105
12175
|
visited.add(resolved);
|
|
@@ -12136,7 +12206,7 @@ ${fields}
|
|
|
12136
12206
|
const resolved2 = resolveLocalImport(specifier, inputDir);
|
|
12137
12207
|
if (!resolved2)
|
|
12138
12208
|
return null;
|
|
12139
|
-
const relativeImport =
|
|
12209
|
+
const relativeImport = relative10(targetDir, toOutputPath(resolved2)).replace(/\\/g, "/").replace(/\.js$/, "");
|
|
12140
12210
|
const relativeRewrite = relativeImport.startsWith(".") ? relativeImport : `./${relativeImport}`;
|
|
12141
12211
|
importRewrites.set(specifier, relativeRewrite);
|
|
12142
12212
|
return resolved2;
|
|
@@ -12176,11 +12246,11 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12176
12246
|
const compiledRoot = compiledParent;
|
|
12177
12247
|
const indexesDir = join17(compiledParent, "indexes");
|
|
12178
12248
|
await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
|
|
12179
|
-
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) =>
|
|
12249
|
+
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve17(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
12180
12250
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
12181
12251
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
12182
|
-
const resolvedEntry =
|
|
12183
|
-
const relativeEntry =
|
|
12252
|
+
const resolvedEntry = resolve17(entry);
|
|
12253
|
+
const relativeEntry = relative10(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
|
|
12184
12254
|
const compileEntry = () => compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors);
|
|
12185
12255
|
let outputs = hmr ? await traceAngularPhase("jit/compile-entry", compileEntry, {
|
|
12186
12256
|
entry: resolvedEntry
|
|
@@ -12191,10 +12261,10 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12191
12261
|
join17(compiledRoot, relativeEntry),
|
|
12192
12262
|
join17(compiledRoot, "pages", jsName),
|
|
12193
12263
|
join17(compiledRoot, jsName)
|
|
12194
|
-
].map((file3) =>
|
|
12264
|
+
].map((file3) => resolve17(file3));
|
|
12195
12265
|
const resolveRawServerFile = (candidatePaths) => {
|
|
12196
12266
|
const normalizedCandidates = [
|
|
12197
|
-
...candidatePaths.map((file3) =>
|
|
12267
|
+
...candidatePaths.map((file3) => resolve17(file3)),
|
|
12198
12268
|
...compiledFallbackPaths
|
|
12199
12269
|
];
|
|
12200
12270
|
let candidate = normalizedCandidates.find((file3) => existsSync16(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
|
|
@@ -12265,7 +12335,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
12265
12335
|
rewritten = injectHMRRegistration(rewritten, resolvedEntry);
|
|
12266
12336
|
}
|
|
12267
12337
|
await traceAngularPhase("wrapper/write-server-output", () => fs.writeFile(rawServerFile, rewritten, "utf-8"), { entry: resolvedEntry });
|
|
12268
|
-
const relativePath =
|
|
12338
|
+
const relativePath = relative10(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
12269
12339
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
12270
12340
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
12271
12341
|
import "${hmrRuntimePath}";
|
|
@@ -12927,7 +12997,7 @@ __export(exports_compileEmber, {
|
|
|
12927
12997
|
});
|
|
12928
12998
|
import { existsSync as existsSync17 } from "fs";
|
|
12929
12999
|
import { mkdir as mkdir5, rm as rm4 } from "fs/promises";
|
|
12930
|
-
import { basename as basename7, dirname as dirname12, extname as extname6, join as join18, resolve as
|
|
13000
|
+
import { basename as basename7, dirname as dirname12, extname as extname6, join as join18, resolve as resolve18 } from "path";
|
|
12931
13001
|
var {build: bunBuild2, Transpiler: Transpiler3, write: write3, file: file3 } = globalThis.Bun;
|
|
12932
13002
|
var cachedPreprocessor = null, getPreprocessor = async () => {
|
|
12933
13003
|
if (cachedPreprocessor)
|
|
@@ -13023,7 +13093,7 @@ export const importSync = (specifier) => {
|
|
|
13023
13093
|
const originalImporter = stagedSourceMap.get(args.importer);
|
|
13024
13094
|
if (!originalImporter)
|
|
13025
13095
|
return;
|
|
13026
|
-
const candidateBase =
|
|
13096
|
+
const candidateBase = resolve18(dirname12(originalImporter), args.path);
|
|
13027
13097
|
const extensionsToTry = ["", ".gts", ".gjs", ".ts", ".js"];
|
|
13028
13098
|
for (const ext of extensionsToTry) {
|
|
13029
13099
|
const candidate = candidateBase + ext;
|
|
@@ -13082,7 +13152,7 @@ export const renderToHTML = (props = {}) => {
|
|
|
13082
13152
|
export { PageComponent };
|
|
13083
13153
|
export default PageComponent;
|
|
13084
13154
|
`, compileEmberFile = async (entry, compiledRoot, cwd = process.cwd()) => {
|
|
13085
|
-
const resolvedEntry =
|
|
13155
|
+
const resolvedEntry = resolve18(entry);
|
|
13086
13156
|
const source = await file3(resolvedEntry).text();
|
|
13087
13157
|
let preprocessed = source;
|
|
13088
13158
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -13102,8 +13172,8 @@ export default PageComponent;
|
|
|
13102
13172
|
mkdir5(serverDir, { recursive: true }),
|
|
13103
13173
|
mkdir5(clientDir, { recursive: true })
|
|
13104
13174
|
]);
|
|
13105
|
-
const tmpPagePath =
|
|
13106
|
-
const tmpHarnessPath =
|
|
13175
|
+
const tmpPagePath = resolve18(join18(tmpDir, `${baseName}.module.js`));
|
|
13176
|
+
const tmpHarnessPath = resolve18(join18(tmpDir, `${baseName}.harness.js`));
|
|
13107
13177
|
await Promise.all([
|
|
13108
13178
|
write3(tmpPagePath, transpiled),
|
|
13109
13179
|
write3(tmpHarnessPath, generateServerHarness(tmpPagePath))
|
|
@@ -13145,7 +13215,7 @@ export default PageComponent;
|
|
|
13145
13215
|
serverPaths: outputs.map((o) => o.serverPath)
|
|
13146
13216
|
};
|
|
13147
13217
|
}, compileEmberFileSource = async (entry) => {
|
|
13148
|
-
const resolvedEntry =
|
|
13218
|
+
const resolvedEntry = resolve18(entry);
|
|
13149
13219
|
const source = await file3(resolvedEntry).text();
|
|
13150
13220
|
let preprocessed = source;
|
|
13151
13221
|
if (isTemplateTagFile(resolvedEntry)) {
|
|
@@ -13178,24 +13248,24 @@ __export(exports_buildReactVendor, {
|
|
|
13178
13248
|
buildReactVendor: () => buildReactVendor
|
|
13179
13249
|
});
|
|
13180
13250
|
import { existsSync as existsSync18, mkdirSync as mkdirSync7 } from "fs";
|
|
13181
|
-
import { join as join19, resolve as
|
|
13251
|
+
import { join as join19, resolve as resolve19 } from "path";
|
|
13182
13252
|
import { rm as rm5 } from "fs/promises";
|
|
13183
13253
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
13184
13254
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
13185
13255
|
const candidates = [
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
13190
|
-
|
|
13191
|
-
|
|
13256
|
+
resolve19(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
|
|
13257
|
+
resolve19(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13258
|
+
resolve19(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
|
|
13259
|
+
resolve19(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
|
|
13260
|
+
resolve19(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
|
|
13261
|
+
resolve19(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
|
|
13192
13262
|
];
|
|
13193
13263
|
for (const candidate of candidates) {
|
|
13194
13264
|
if (existsSync18(candidate)) {
|
|
13195
13265
|
return candidate.replace(/\\/g, "/");
|
|
13196
13266
|
}
|
|
13197
13267
|
}
|
|
13198
|
-
return (candidates[0] ??
|
|
13268
|
+
return (candidates[0] ?? resolve19(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
|
|
13199
13269
|
}, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
|
|
13200
13270
|
try {
|
|
13201
13271
|
Bun.resolveSync(specifier, process.cwd());
|
|
@@ -13845,7 +13915,7 @@ import {
|
|
|
13845
13915
|
statSync,
|
|
13846
13916
|
writeFileSync as writeFileSync7
|
|
13847
13917
|
} from "fs";
|
|
13848
|
-
import { basename as basename8, dirname as dirname13, extname as extname7, join as join24, relative as
|
|
13918
|
+
import { basename as basename8, dirname as dirname13, extname as extname7, join as join24, relative as relative11, resolve as resolve20 } from "path";
|
|
13849
13919
|
import { cwd, env as env2, exit } from "process";
|
|
13850
13920
|
var {build: bunBuild7, Glob: Glob7 } = globalThis.Bun;
|
|
13851
13921
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -13936,8 +14006,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
13936
14006
|
}
|
|
13937
14007
|
}, resolveAbsoluteVersion = async () => {
|
|
13938
14008
|
const candidates = [
|
|
13939
|
-
|
|
13940
|
-
|
|
14009
|
+
resolve20(import.meta.dir, "..", "..", "package.json"),
|
|
14010
|
+
resolve20(import.meta.dir, "..", "package.json")
|
|
13941
14011
|
];
|
|
13942
14012
|
const resolveCandidate = async (remaining) => {
|
|
13943
14013
|
const [candidate, ...rest] = remaining;
|
|
@@ -13953,7 +14023,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
13953
14023
|
};
|
|
13954
14024
|
await resolveCandidate(candidates);
|
|
13955
14025
|
}, SKIP_DIRS, addWorkerPathIfExists = (file4, relPath, workerPaths) => {
|
|
13956
|
-
const absPath =
|
|
14026
|
+
const absPath = resolve20(file4, "..", relPath);
|
|
13957
14027
|
try {
|
|
13958
14028
|
statSync(absPath);
|
|
13959
14029
|
workerPaths.add(absPath);
|
|
@@ -14015,7 +14085,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14015
14085
|
return;
|
|
14016
14086
|
}
|
|
14017
14087
|
const indexFiles = readDir(reactIndexesPath).filter((file4) => file4.endsWith(".tsx"));
|
|
14018
|
-
const pagesRel =
|
|
14088
|
+
const pagesRel = relative11(process.cwd(), resolve20(reactPagesPath)).replace(/\\/g, "/");
|
|
14019
14089
|
for (const file4 of indexFiles) {
|
|
14020
14090
|
let content = readFileSync12(join24(reactIndexesPath, file4), "utf-8");
|
|
14021
14091
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
@@ -14023,27 +14093,27 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14023
14093
|
}
|
|
14024
14094
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
14025
14095
|
const svelteIndexDir = join24(getFrameworkGeneratedDir("svelte"), "indexes");
|
|
14026
|
-
const sveltePageEntries = svelteEntries.filter((file4) =>
|
|
14096
|
+
const sveltePageEntries = svelteEntries.filter((file4) => resolve20(file4).startsWith(resolve20(sveltePagesPath)));
|
|
14027
14097
|
for (const entry of sveltePageEntries) {
|
|
14028
14098
|
const name = basename8(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
14029
14099
|
const indexFile = join24(svelteIndexDir, "pages", `${name}.js`);
|
|
14030
14100
|
if (!existsSync19(indexFile))
|
|
14031
14101
|
continue;
|
|
14032
14102
|
let content = readFileSync12(indexFile, "utf-8");
|
|
14033
|
-
const srcRel =
|
|
14103
|
+
const srcRel = relative11(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
|
|
14034
14104
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
14035
14105
|
writeFileSync7(join24(devIndexDir, `${name}.svelte.js`), content);
|
|
14036
14106
|
}
|
|
14037
14107
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
14038
14108
|
const vueIndexDir = join24(getFrameworkGeneratedDir("vue"), "indexes");
|
|
14039
|
-
const vuePageEntries = vueEntries.filter((file4) =>
|
|
14109
|
+
const vuePageEntries = vueEntries.filter((file4) => resolve20(file4).startsWith(resolve20(vuePagesPath)));
|
|
14040
14110
|
for (const entry of vuePageEntries) {
|
|
14041
14111
|
const name = basename8(entry, ".vue");
|
|
14042
14112
|
const indexFile = join24(vueIndexDir, `${name}.js`);
|
|
14043
14113
|
if (!existsSync19(indexFile))
|
|
14044
14114
|
continue;
|
|
14045
14115
|
let content = readFileSync12(indexFile, "utf-8");
|
|
14046
|
-
const srcRel =
|
|
14116
|
+
const srcRel = relative11(process.cwd(), resolve20(entry)).replace(/\\/g, "/");
|
|
14047
14117
|
content = content.replace(/import\s+Comp(?:\s*,\s*\*\s+as\s+\w+)?\s+from\s+['"]([^'"]+)['"]/, (match) => match.replace(/from\s+['"][^'"]+['"]/, `from "/@src/${srcRel}"`));
|
|
14048
14118
|
writeFileSync7(join24(devIndexDir, `${name}.vue.js`), content);
|
|
14049
14119
|
}
|
|
@@ -14056,7 +14126,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
14056
14126
|
const last = allComments[allComments.length - 1];
|
|
14057
14127
|
if (!last?.[1])
|
|
14058
14128
|
return JSON.stringify(outputPath);
|
|
14059
|
-
const srcPath =
|
|
14129
|
+
const srcPath = resolve20(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
|
|
14060
14130
|
return JSON.stringify(srcPath);
|
|
14061
14131
|
}, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
|
|
14062
14132
|
let depth = 0;
|
|
@@ -14118,7 +14188,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14118
14188
|
}, buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
14119
14189
|
const urlFileMap = new Map;
|
|
14120
14190
|
for (const srcPath of urlReferencedFiles) {
|
|
14121
|
-
const rel =
|
|
14191
|
+
const rel = relative11(projectRoot, srcPath).replace(/\\/g, "/");
|
|
14122
14192
|
const name = basename8(srcPath);
|
|
14123
14193
|
const mtime = Math.round(statSync(srcPath).mtimeMs);
|
|
14124
14194
|
const url = `/@src/${rel}?v=${mtime}`;
|
|
@@ -14133,7 +14203,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14133
14203
|
const output = nonReactClientOutputs.find((artifact) => basename8(artifact.path).startsWith(`${srcBase}.`));
|
|
14134
14204
|
if (!output)
|
|
14135
14205
|
continue;
|
|
14136
|
-
urlFileMap.set(basename8(srcPath), `/${
|
|
14206
|
+
urlFileMap.set(basename8(srcPath), `/${relative11(buildPath, output.path).replace(/\\/g, "/")}`);
|
|
14137
14207
|
}
|
|
14138
14208
|
return urlFileMap;
|
|
14139
14209
|
}, buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReactClientOutputs) => {
|
|
@@ -14381,13 +14451,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14381
14451
|
const filterToIncrementalEntries = (entryPoints, mapToSource) => {
|
|
14382
14452
|
if (!isIncremental || !incrementalFiles)
|
|
14383
14453
|
return entryPoints;
|
|
14384
|
-
const normalizedIncremental = new Set(incrementalFiles.map((f2) =>
|
|
14454
|
+
const normalizedIncremental = new Set(incrementalFiles.map((f2) => resolve20(f2)));
|
|
14385
14455
|
const matchingEntries = [];
|
|
14386
14456
|
for (const entry of entryPoints) {
|
|
14387
14457
|
const sourceFile = mapToSource(entry);
|
|
14388
14458
|
if (!sourceFile)
|
|
14389
14459
|
continue;
|
|
14390
|
-
if (!normalizedIncremental.has(
|
|
14460
|
+
if (!normalizedIncremental.has(resolve20(sourceFile)))
|
|
14391
14461
|
continue;
|
|
14392
14462
|
matchingEntries.push(entry);
|
|
14393
14463
|
}
|
|
@@ -14449,7 +14519,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14449
14519
|
}
|
|
14450
14520
|
const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/html/") && (f2.endsWith(".html") || isStylePath(f2)));
|
|
14451
14521
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
14452
|
-
if (entry.startsWith(
|
|
14522
|
+
if (entry.startsWith(resolve20(reactIndexesPath))) {
|
|
14453
14523
|
const pageName = basename8(entry, ".tsx");
|
|
14454
14524
|
return join24(reactPagesPath, `${pageName}.tsx`);
|
|
14455
14525
|
}
|
|
@@ -14528,7 +14598,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14528
14598
|
const clientPath = islandSvelteClientPaths[idx];
|
|
14529
14599
|
if (!sourcePath || !clientPath)
|
|
14530
14600
|
continue;
|
|
14531
|
-
islandSvelteClientPathMap.set(
|
|
14601
|
+
islandSvelteClientPathMap.set(resolve20(sourcePath), clientPath);
|
|
14532
14602
|
}
|
|
14533
14603
|
const islandVueClientPathMap = new Map;
|
|
14534
14604
|
for (let idx = 0;idx < islandVueSources.length; idx++) {
|
|
@@ -14536,7 +14606,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14536
14606
|
const clientPath = islandVueClientPaths[idx];
|
|
14537
14607
|
if (!sourcePath || !clientPath)
|
|
14538
14608
|
continue;
|
|
14539
|
-
islandVueClientPathMap.set(
|
|
14609
|
+
islandVueClientPathMap.set(resolve20(sourcePath), clientPath);
|
|
14540
14610
|
}
|
|
14541
14611
|
const islandAngularClientPathMap = new Map;
|
|
14542
14612
|
for (let idx = 0;idx < islandAngularSources.length; idx++) {
|
|
@@ -14544,7 +14614,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14544
14614
|
const clientPath = islandAngularClientPaths[idx];
|
|
14545
14615
|
if (!sourcePath || !clientPath)
|
|
14546
14616
|
continue;
|
|
14547
|
-
islandAngularClientPathMap.set(
|
|
14617
|
+
islandAngularClientPathMap.set(resolve20(sourcePath), clientPath);
|
|
14548
14618
|
}
|
|
14549
14619
|
const reactConventionSources = collectConventionSourceFiles(conventionsMap.react);
|
|
14550
14620
|
const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
|
|
@@ -14857,6 +14927,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14857
14927
|
outdir: buildPath,
|
|
14858
14928
|
plugins: [
|
|
14859
14929
|
stylePreprocessorPlugin2,
|
|
14930
|
+
...angularDir && hmr ? [
|
|
14931
|
+
createAngularHmrInjectionPlugin({
|
|
14932
|
+
generatedAngularRoot: getFrameworkGeneratedDir("angular", projectRoot),
|
|
14933
|
+
projectRoot,
|
|
14934
|
+
userAngularRoot: angularDir
|
|
14935
|
+
})
|
|
14936
|
+
] : [],
|
|
14860
14937
|
...angularDir ? [createAngularLinkerPlugin(hmr)] : [],
|
|
14861
14938
|
...htmlScriptPlugin ? [htmlScriptPlugin] : []
|
|
14862
14939
|
],
|
|
@@ -14877,6 +14954,13 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14877
14954
|
outdir: buildPath,
|
|
14878
14955
|
plugins: [
|
|
14879
14956
|
stylePreprocessorPlugin2,
|
|
14957
|
+
...angularDir && hmr ? [
|
|
14958
|
+
createAngularHmrInjectionPlugin({
|
|
14959
|
+
generatedAngularRoot: getFrameworkGeneratedDir("angular", projectRoot),
|
|
14960
|
+
projectRoot,
|
|
14961
|
+
userAngularRoot: angularDir
|
|
14962
|
+
})
|
|
14963
|
+
] : [],
|
|
14880
14964
|
...angularDir ? [createAngularLinkerPlugin(hmr)] : []
|
|
14881
14965
|
],
|
|
14882
14966
|
root: islandEntryResult.generatedRoot,
|
|
@@ -14967,7 +15051,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14967
15051
|
const fileDir = dirname13(artifact.path);
|
|
14968
15052
|
const relativePaths = {};
|
|
14969
15053
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
14970
|
-
const rel =
|
|
15054
|
+
const rel = relative11(fileDir, absolute);
|
|
14971
15055
|
relativePaths[specifier] = rel.startsWith(".") ? rel : `./${rel}`;
|
|
14972
15056
|
}
|
|
14973
15057
|
return relativePaths;
|
|
@@ -15172,6 +15256,7 @@ var init_build = __esm(() => {
|
|
|
15172
15256
|
init_rewriteReactImports();
|
|
15173
15257
|
init_telemetryEvent();
|
|
15174
15258
|
init_angularLinkerPlugin();
|
|
15259
|
+
init_hmrInjectionPlugin();
|
|
15175
15260
|
init_cleanStaleOutputs();
|
|
15176
15261
|
init_cleanup();
|
|
15177
15262
|
init_commonAncestor();
|
|
@@ -15386,7 +15471,7 @@ var init_buildEmberVendor = __esm(() => {
|
|
|
15386
15471
|
// src/dev/dependencyGraph.ts
|
|
15387
15472
|
import { existsSync as existsSync21, readFileSync as readFileSync13 } from "fs";
|
|
15388
15473
|
var {Glob: Glob8 } = globalThis.Bun;
|
|
15389
|
-
import { resolve as
|
|
15474
|
+
import { resolve as resolve21 } from "path";
|
|
15390
15475
|
var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
|
|
15391
15476
|
const lower = filePath.toLowerCase();
|
|
15392
15477
|
if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
|
|
@@ -15400,8 +15485,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15400
15485
|
if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
|
|
15401
15486
|
return null;
|
|
15402
15487
|
}
|
|
15403
|
-
const fromDir =
|
|
15404
|
-
const normalized =
|
|
15488
|
+
const fromDir = resolve21(fromFile, "..");
|
|
15489
|
+
const normalized = resolve21(fromDir, importPath);
|
|
15405
15490
|
const extensions = [
|
|
15406
15491
|
".ts",
|
|
15407
15492
|
".tsx",
|
|
@@ -15431,7 +15516,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15431
15516
|
dependents.delete(normalizedPath);
|
|
15432
15517
|
}
|
|
15433
15518
|
}, addFileToGraph = (graph, filePath) => {
|
|
15434
|
-
const normalizedPath =
|
|
15519
|
+
const normalizedPath = resolve21(filePath);
|
|
15435
15520
|
if (!existsSync21(normalizedPath))
|
|
15436
15521
|
return;
|
|
15437
15522
|
const dependencies = extractDependencies(normalizedPath);
|
|
@@ -15448,10 +15533,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15448
15533
|
}, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
|
|
15449
15534
|
const processedFiles = new Set;
|
|
15450
15535
|
const glob = new Glob8("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
|
|
15451
|
-
const resolvedDirs = directories.map((dir) =>
|
|
15536
|
+
const resolvedDirs = directories.map((dir) => resolve21(dir)).filter((dir) => existsSync21(dir));
|
|
15452
15537
|
const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
|
|
15453
15538
|
for (const file4 of allFiles) {
|
|
15454
|
-
const fullPath =
|
|
15539
|
+
const fullPath = resolve21(file4);
|
|
15455
15540
|
if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
|
|
15456
15541
|
continue;
|
|
15457
15542
|
if (processedFiles.has(fullPath))
|
|
@@ -15564,7 +15649,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15564
15649
|
return [];
|
|
15565
15650
|
}
|
|
15566
15651
|
}, getAffectedFiles = (graph, changedFile) => {
|
|
15567
|
-
const normalizedPath =
|
|
15652
|
+
const normalizedPath = resolve21(changedFile);
|
|
15568
15653
|
const affected = new Set;
|
|
15569
15654
|
const toProcess = [normalizedPath];
|
|
15570
15655
|
const processNode = (current) => {
|
|
@@ -15604,7 +15689,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
|
|
|
15604
15689
|
}
|
|
15605
15690
|
graph.dependents.delete(normalizedPath);
|
|
15606
15691
|
}, removeFileFromGraph = (graph, filePath) => {
|
|
15607
|
-
const normalizedPath =
|
|
15692
|
+
const normalizedPath = resolve21(filePath);
|
|
15608
15693
|
removeDepsForFile(graph, normalizedPath);
|
|
15609
15694
|
removeDependentsForFile(graph, normalizedPath);
|
|
15610
15695
|
};
|
|
@@ -15647,12 +15732,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
|
|
|
15647
15732
|
};
|
|
15648
15733
|
|
|
15649
15734
|
// src/dev/configResolver.ts
|
|
15650
|
-
import { resolve as
|
|
15735
|
+
import { resolve as resolve22 } from "path";
|
|
15651
15736
|
var resolveBuildPaths = (config) => {
|
|
15652
15737
|
const cwd2 = process.cwd();
|
|
15653
15738
|
const normalize = (path) => path.replace(/\\/g, "/");
|
|
15654
|
-
const withDefault = (value, fallback) => normalize(
|
|
15655
|
-
const optional = (value) => value ? normalize(
|
|
15739
|
+
const withDefault = (value, fallback) => normalize(resolve22(cwd2, value ?? fallback));
|
|
15740
|
+
const optional = (value) => value ? normalize(resolve22(cwd2, value)) : undefined;
|
|
15656
15741
|
return {
|
|
15657
15742
|
angularDir: optional(config.angularDirectory),
|
|
15658
15743
|
assetsDir: optional(config.assetsDirectory),
|
|
@@ -15704,8 +15789,8 @@ var init_clientManager = __esm(() => {
|
|
|
15704
15789
|
});
|
|
15705
15790
|
|
|
15706
15791
|
// src/dev/pathUtils.ts
|
|
15707
|
-
import { existsSync as existsSync22 } from "fs";
|
|
15708
|
-
import { resolve as
|
|
15792
|
+
import { existsSync as existsSync22, readdirSync, readFileSync as readFileSync14 } from "fs";
|
|
15793
|
+
import { dirname as dirname14, resolve as resolve23 } from "path";
|
|
15709
15794
|
var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
15710
15795
|
if (shouldIgnorePath(filePath, resolved)) {
|
|
15711
15796
|
return "ignored";
|
|
@@ -15779,13 +15864,80 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
15779
15864
|
return "assets";
|
|
15780
15865
|
}
|
|
15781
15866
|
return "unknown";
|
|
15867
|
+
}, collectAngularResourceDirs = (angularDir) => {
|
|
15868
|
+
const out = new Set;
|
|
15869
|
+
const angularRoot = resolve23(angularDir);
|
|
15870
|
+
const angularRootNormalized = normalizePath(angularRoot);
|
|
15871
|
+
const walk = (dir) => {
|
|
15872
|
+
let entries;
|
|
15873
|
+
try {
|
|
15874
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
15875
|
+
} catch {
|
|
15876
|
+
return;
|
|
15877
|
+
}
|
|
15878
|
+
for (const entry of entries) {
|
|
15879
|
+
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
15880
|
+
continue;
|
|
15881
|
+
}
|
|
15882
|
+
const full = resolve23(dir, entry.name);
|
|
15883
|
+
if (entry.isDirectory()) {
|
|
15884
|
+
walk(full);
|
|
15885
|
+
continue;
|
|
15886
|
+
}
|
|
15887
|
+
if (!entry.isFile() || !entry.name.endsWith(".component.ts")) {
|
|
15888
|
+
continue;
|
|
15889
|
+
}
|
|
15890
|
+
let source;
|
|
15891
|
+
try {
|
|
15892
|
+
source = readFileSync14(full, "utf8");
|
|
15893
|
+
} catch {
|
|
15894
|
+
continue;
|
|
15895
|
+
}
|
|
15896
|
+
const refs = [];
|
|
15897
|
+
const tplRe = /templateUrl\s*:\s*['"]([^'"]+)['"]/g;
|
|
15898
|
+
const styleRe = /styleUrl\s*:\s*['"]([^'"]+)['"]/g;
|
|
15899
|
+
const stylesArrRe = /styleUrls\s*:\s*\[([^\]]*)\]/g;
|
|
15900
|
+
const literalRe = /['"]([^'"]+)['"]/g;
|
|
15901
|
+
let match;
|
|
15902
|
+
while ((match = tplRe.exec(source)) !== null) {
|
|
15903
|
+
if (match[1])
|
|
15904
|
+
refs.push(match[1]);
|
|
15905
|
+
}
|
|
15906
|
+
while ((match = styleRe.exec(source)) !== null) {
|
|
15907
|
+
if (match[1])
|
|
15908
|
+
refs.push(match[1]);
|
|
15909
|
+
}
|
|
15910
|
+
while ((match = stylesArrRe.exec(source)) !== null) {
|
|
15911
|
+
const inner = match[1];
|
|
15912
|
+
if (!inner)
|
|
15913
|
+
continue;
|
|
15914
|
+
let strMatch;
|
|
15915
|
+
const innerRe = new RegExp(literalRe.source, literalRe.flags);
|
|
15916
|
+
while ((strMatch = innerRe.exec(inner)) !== null) {
|
|
15917
|
+
if (strMatch[1])
|
|
15918
|
+
refs.push(strMatch[1]);
|
|
15919
|
+
}
|
|
15920
|
+
}
|
|
15921
|
+
const componentDir = dirname14(full);
|
|
15922
|
+
for (const ref of refs) {
|
|
15923
|
+
const refAbs = normalizePath(resolve23(componentDir, ref));
|
|
15924
|
+
const refDir = normalizePath(dirname14(refAbs));
|
|
15925
|
+
if (refDir === angularRootNormalized || refDir.startsWith(angularRootNormalized + "/")) {
|
|
15926
|
+
continue;
|
|
15927
|
+
}
|
|
15928
|
+
out.add(refDir);
|
|
15929
|
+
}
|
|
15930
|
+
}
|
|
15931
|
+
};
|
|
15932
|
+
walk(angularRoot);
|
|
15933
|
+
return Array.from(out);
|
|
15782
15934
|
}, collectPositiveWatchRoots = (config, resolved) => {
|
|
15783
15935
|
const cwd2 = process.cwd();
|
|
15784
15936
|
const roots = [];
|
|
15785
15937
|
const push = (path) => {
|
|
15786
15938
|
if (!path)
|
|
15787
15939
|
return;
|
|
15788
|
-
const abs = normalizePath(
|
|
15940
|
+
const abs = normalizePath(resolve23(cwd2, path));
|
|
15789
15941
|
if (!roots.includes(abs))
|
|
15790
15942
|
roots.push(abs);
|
|
15791
15943
|
};
|
|
@@ -15810,13 +15962,20 @@ var STYLE_EXTENSION_PATTERN2, detectFramework = (filePath, resolved) => {
|
|
|
15810
15962
|
push(cfg.assetsDir);
|
|
15811
15963
|
push(cfg.stylesDir);
|
|
15812
15964
|
for (const candidate of ["src", "db", "assets", "styles"]) {
|
|
15813
|
-
const abs = normalizePath(
|
|
15965
|
+
const abs = normalizePath(resolve23(cwd2, candidate));
|
|
15814
15966
|
if (existsSync22(abs) && !roots.includes(abs))
|
|
15815
15967
|
roots.push(abs);
|
|
15816
15968
|
}
|
|
15817
15969
|
const extraDirs = config.dev?.watchDirs ?? [];
|
|
15818
15970
|
for (const dir of extraDirs)
|
|
15819
15971
|
push(dir);
|
|
15972
|
+
if (cfg.angularDir) {
|
|
15973
|
+
const resourceDirs = collectAngularResourceDirs(cfg.angularDir);
|
|
15974
|
+
for (const dir of resourceDirs) {
|
|
15975
|
+
if (!roots.includes(dir))
|
|
15976
|
+
roots.push(dir);
|
|
15977
|
+
}
|
|
15978
|
+
}
|
|
15820
15979
|
return roots;
|
|
15821
15980
|
}, getWatchPaths = (config, resolved) => {
|
|
15822
15981
|
const roots = collectPositiveWatchRoots(config, resolved);
|
|
@@ -15874,7 +16033,7 @@ var init_pathUtils = __esm(() => {
|
|
|
15874
16033
|
// src/dev/fileWatcher.ts
|
|
15875
16034
|
import { watch } from "fs";
|
|
15876
16035
|
import { existsSync as existsSync23 } from "fs";
|
|
15877
|
-
import { join as join26, resolve as
|
|
16036
|
+
import { join as join26, resolve as resolve24 } from "path";
|
|
15878
16037
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
15879
16038
|
try {
|
|
15880
16039
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -15919,7 +16078,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
15919
16078
|
}, addFileWatchers = (state, paths, onFileChange) => {
|
|
15920
16079
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
15921
16080
|
paths.forEach((path) => {
|
|
15922
|
-
const absolutePath =
|
|
16081
|
+
const absolutePath = resolve24(path).replace(/\\/g, "/");
|
|
15923
16082
|
if (!existsSync23(absolutePath)) {
|
|
15924
16083
|
return;
|
|
15925
16084
|
}
|
|
@@ -15930,7 +16089,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
15930
16089
|
const watchPaths = getWatchPaths(config, state.resolvedPaths);
|
|
15931
16090
|
const stylesDir = state.resolvedPaths?.stylesDir;
|
|
15932
16091
|
watchPaths.forEach((path) => {
|
|
15933
|
-
const absolutePath =
|
|
16092
|
+
const absolutePath = resolve24(path).replace(/\\/g, "/");
|
|
15934
16093
|
if (!existsSync23(absolutePath)) {
|
|
15935
16094
|
return;
|
|
15936
16095
|
}
|
|
@@ -15945,13 +16104,13 @@ var init_fileWatcher = __esm(() => {
|
|
|
15945
16104
|
});
|
|
15946
16105
|
|
|
15947
16106
|
// src/dev/assetStore.ts
|
|
15948
|
-
import { resolve as
|
|
16107
|
+
import { resolve as resolve25 } from "path";
|
|
15949
16108
|
import { readdir as readdir4, unlink } from "fs/promises";
|
|
15950
16109
|
var mimeTypes, getMimeType = (filePath) => {
|
|
15951
16110
|
const ext = filePath.slice(filePath.lastIndexOf("."));
|
|
15952
16111
|
return mimeTypes[ext] ?? "application/octet-stream";
|
|
15953
16112
|
}, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
|
|
15954
|
-
const fullPath =
|
|
16113
|
+
const fullPath = resolve25(dir, entry.name);
|
|
15955
16114
|
if (entry.isDirectory()) {
|
|
15956
16115
|
return walkAndClean(fullPath);
|
|
15957
16116
|
}
|
|
@@ -15967,10 +16126,10 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
15967
16126
|
}, cleanStaleAssets = async (store, manifest, buildDir) => {
|
|
15968
16127
|
const liveByIdentity = new Map;
|
|
15969
16128
|
for (const webPath of store.keys()) {
|
|
15970
|
-
const diskPath =
|
|
16129
|
+
const diskPath = resolve25(buildDir, webPath.slice(1));
|
|
15971
16130
|
liveByIdentity.set(stripHash(diskPath), diskPath);
|
|
15972
16131
|
}
|
|
15973
|
-
const absBuildDir =
|
|
16132
|
+
const absBuildDir = resolve25(buildDir);
|
|
15974
16133
|
Object.values(manifest).forEach((val) => {
|
|
15975
16134
|
if (!HASHED_FILE_RE.test(val))
|
|
15976
16135
|
return;
|
|
@@ -15988,7 +16147,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
15988
16147
|
} catch {}
|
|
15989
16148
|
}, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
|
|
15990
16149
|
if (entry.isDirectory()) {
|
|
15991
|
-
return scanDir(
|
|
16150
|
+
return scanDir(resolve25(dir, entry.name), `${prefix}${entry.name}/`);
|
|
15992
16151
|
}
|
|
15993
16152
|
if (!entry.name.startsWith("chunk-")) {
|
|
15994
16153
|
return null;
|
|
@@ -15997,7 +16156,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
15997
16156
|
if (store.has(webPath)) {
|
|
15998
16157
|
return null;
|
|
15999
16158
|
}
|
|
16000
|
-
return Bun.file(
|
|
16159
|
+
return Bun.file(resolve25(dir, entry.name)).bytes().then((bytes) => {
|
|
16001
16160
|
store.set(webPath, bytes);
|
|
16002
16161
|
return;
|
|
16003
16162
|
}).catch(() => {});
|
|
@@ -16019,7 +16178,7 @@ var mimeTypes, getMimeType = (filePath) => {
|
|
|
16019
16178
|
for (const webPath of newIdentities.values()) {
|
|
16020
16179
|
if (store.has(webPath))
|
|
16021
16180
|
continue;
|
|
16022
|
-
loadPromises.push(Bun.file(
|
|
16181
|
+
loadPromises.push(Bun.file(resolve25(buildDir, webPath.slice(1))).bytes().then((bytes) => {
|
|
16023
16182
|
store.set(webPath, bytes);
|
|
16024
16183
|
return;
|
|
16025
16184
|
}).catch(() => {}));
|
|
@@ -16049,8 +16208,8 @@ var init_assetStore = __esm(() => {
|
|
|
16049
16208
|
});
|
|
16050
16209
|
|
|
16051
16210
|
// src/islands/pageMetadata.ts
|
|
16052
|
-
import { readFileSync as
|
|
16053
|
-
import { dirname as
|
|
16211
|
+
import { readFileSync as readFileSync15 } from "fs";
|
|
16212
|
+
import { dirname as dirname15, resolve as resolve26 } from "path";
|
|
16054
16213
|
var pagePatterns, getPageDirs = (config) => [
|
|
16055
16214
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
16056
16215
|
{ dir: config.emberDirectory, framework: "ember" },
|
|
@@ -16070,15 +16229,15 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
16070
16229
|
const source = definition.buildReference?.source;
|
|
16071
16230
|
if (!source)
|
|
16072
16231
|
continue;
|
|
16073
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname :
|
|
16074
|
-
lookup.set(`${definition.framework}:${definition.component}`,
|
|
16232
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve26(dirname15(buildInfo.resolvedRegistryPath), source);
|
|
16233
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve26(resolvedSource));
|
|
16075
16234
|
}
|
|
16076
16235
|
return lookup;
|
|
16077
16236
|
}, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
|
|
16078
16237
|
const candidate = usage.source;
|
|
16079
|
-
return candidate ?
|
|
16238
|
+
return candidate ? resolve26(candidate) === target : false;
|
|
16080
16239
|
}), getPagesUsingIslandSource = (sourcePath) => {
|
|
16081
|
-
const target =
|
|
16240
|
+
const target = resolve26(sourcePath);
|
|
16082
16241
|
return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
|
|
16083
16242
|
}, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
|
|
16084
16243
|
const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
|
|
@@ -16090,13 +16249,13 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
16090
16249
|
const pattern = pagePatterns[entry.framework];
|
|
16091
16250
|
if (!pattern)
|
|
16092
16251
|
return;
|
|
16093
|
-
const files = await scanEntryPoints(
|
|
16252
|
+
const files = await scanEntryPoints(resolve26(entry.dir), pattern);
|
|
16094
16253
|
for (const filePath of files) {
|
|
16095
|
-
const source =
|
|
16254
|
+
const source = readFileSync15(filePath, "utf-8");
|
|
16096
16255
|
const islands = extractIslandUsagesFromSource(source);
|
|
16097
|
-
pageMetadata.set(
|
|
16256
|
+
pageMetadata.set(resolve26(filePath), {
|
|
16098
16257
|
islands: resolveIslandUsages(islands, islandSourceLookup),
|
|
16099
|
-
pagePath:
|
|
16258
|
+
pagePath: resolve26(filePath)
|
|
16100
16259
|
});
|
|
16101
16260
|
}
|
|
16102
16261
|
}, loadPageIslandMetadata = async (config) => {
|
|
@@ -16123,10 +16282,10 @@ var init_pageMetadata = __esm(() => {
|
|
|
16123
16282
|
});
|
|
16124
16283
|
|
|
16125
16284
|
// src/dev/fileHashTracker.ts
|
|
16126
|
-
import { readFileSync as
|
|
16285
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
16127
16286
|
var computeFileHash = (filePath) => {
|
|
16128
16287
|
try {
|
|
16129
|
-
const fileContent =
|
|
16288
|
+
const fileContent = readFileSync16(filePath);
|
|
16130
16289
|
return Number(Bun.hash(fileContent));
|
|
16131
16290
|
} catch {
|
|
16132
16291
|
return UNFOUND_INDEX;
|
|
@@ -16206,9 +16365,9 @@ var init_transformCache = __esm(() => {
|
|
|
16206
16365
|
});
|
|
16207
16366
|
|
|
16208
16367
|
// src/dev/reactComponentClassifier.ts
|
|
16209
|
-
import { resolve as
|
|
16368
|
+
import { resolve as resolve27 } from "path";
|
|
16210
16369
|
var classifyComponent = (filePath) => {
|
|
16211
|
-
const normalizedPath =
|
|
16370
|
+
const normalizedPath = resolve27(filePath);
|
|
16212
16371
|
if (normalizedPath.includes("/react/pages/")) {
|
|
16213
16372
|
return "server";
|
|
16214
16373
|
}
|
|
@@ -16220,7 +16379,7 @@ var classifyComponent = (filePath) => {
|
|
|
16220
16379
|
var init_reactComponentClassifier = () => {};
|
|
16221
16380
|
|
|
16222
16381
|
// src/dev/moduleMapper.ts
|
|
16223
|
-
import { basename as basename9, resolve as
|
|
16382
|
+
import { basename as basename9, resolve as resolve28 } from "path";
|
|
16224
16383
|
var buildModulePaths = (moduleKeys, manifest) => {
|
|
16225
16384
|
const modulePaths = {};
|
|
16226
16385
|
moduleKeys.forEach((key) => {
|
|
@@ -16230,7 +16389,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
16230
16389
|
});
|
|
16231
16390
|
return modulePaths;
|
|
16232
16391
|
}, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
|
|
16233
|
-
const normalizedFile =
|
|
16392
|
+
const normalizedFile = resolve28(sourceFile);
|
|
16234
16393
|
const normalizedPath = normalizedFile.replace(/\\/g, "/");
|
|
16235
16394
|
if (processedFiles.has(normalizedFile)) {
|
|
16236
16395
|
return null;
|
|
@@ -16266,7 +16425,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
|
|
|
16266
16425
|
});
|
|
16267
16426
|
return grouped;
|
|
16268
16427
|
}, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
|
|
16269
|
-
const normalizedFile =
|
|
16428
|
+
const normalizedFile = resolve28(sourceFile);
|
|
16270
16429
|
const fileName = basename9(normalizedFile);
|
|
16271
16430
|
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
|
|
16272
16431
|
const pascalName = toPascal(baseName);
|
|
@@ -16449,7 +16608,7 @@ var init_ssrCache = __esm(() => {
|
|
|
16449
16608
|
});
|
|
16450
16609
|
|
|
16451
16610
|
// src/dev/angular/editTypeDetection.ts
|
|
16452
|
-
import { readFileSync as
|
|
16611
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
16453
16612
|
import { basename as basename10 } from "path";
|
|
16454
16613
|
import * as ts3 from "typescript";
|
|
16455
16614
|
var TYPE_PRIORITY, STYLE_EXT_RE, COMPONENT_STYLE_RE, TEMPLATE_RE, COMPONENT_CLASS_RE, SERVICE_RE, ROUTES_RE, PAGE_TS_RE, SIDE_EFFECT_CALL_NAMES, SIDE_EFFECT_NEW_NAMES, getCalleeName = (node) => {
|
|
@@ -16529,7 +16688,7 @@ var TYPE_PRIORITY, STYLE_EXT_RE, COMPONENT_STYLE_RE, TEMPLATE_RE, COMPONENT_CLAS
|
|
|
16529
16688
|
}, analyzeServiceFile = (file4) => {
|
|
16530
16689
|
let source;
|
|
16531
16690
|
try {
|
|
16532
|
-
source =
|
|
16691
|
+
source = readFileSync17(file4, "utf8");
|
|
16533
16692
|
} catch {
|
|
16534
16693
|
return {
|
|
16535
16694
|
hasSideEffectCtor: true,
|
|
@@ -16700,8 +16859,8 @@ __export(exports_moduleServer, {
|
|
|
16700
16859
|
createModuleServer: () => createModuleServer,
|
|
16701
16860
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
16702
16861
|
});
|
|
16703
|
-
import { existsSync as existsSync24, readFileSync as
|
|
16704
|
-
import { basename as basename11, dirname as
|
|
16862
|
+
import { existsSync as existsSync24, readFileSync as readFileSync18, statSync as statSync2 } from "fs";
|
|
16863
|
+
import { basename as basename11, dirname as dirname16, extname as extname8, join as join27, resolve as resolve29, relative as relative12 } from "path";
|
|
16705
16864
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
16706
16865
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
16707
16866
|
const allExports = [];
|
|
@@ -16721,7 +16880,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
16721
16880
|
${stubs}
|
|
16722
16881
|
`;
|
|
16723
16882
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
16724
|
-
const found = extensions.find((ext) => existsSync24(
|
|
16883
|
+
const found = extensions.find((ext) => existsSync24(resolve29(projectRoot, srcPath + ext)));
|
|
16725
16884
|
return found ? srcPath + found : srcPath;
|
|
16726
16885
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
16727
16886
|
const entries = Object.entries(vendorPaths).sort(([a], [b2]) => b2.length - a.length);
|
|
@@ -16736,7 +16895,7 @@ ${stubs}
|
|
|
16736
16895
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
16737
16896
|
}, srcUrl = (relPath, projectRoot) => {
|
|
16738
16897
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
16739
|
-
const absPath =
|
|
16898
|
+
const absPath = resolve29(projectRoot, relPath);
|
|
16740
16899
|
const cached = mtimeCache.get(absPath);
|
|
16741
16900
|
if (cached !== undefined)
|
|
16742
16901
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -16748,12 +16907,12 @@ ${stubs}
|
|
|
16748
16907
|
return base;
|
|
16749
16908
|
}
|
|
16750
16909
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
16751
|
-
const absPath =
|
|
16752
|
-
const rel =
|
|
16910
|
+
const absPath = resolve29(fileDir, relPath);
|
|
16911
|
+
const rel = relative12(projectRoot, absPath);
|
|
16753
16912
|
const extension = extname8(rel);
|
|
16754
16913
|
let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
16755
16914
|
if (extname8(srcPath) === ".svelte") {
|
|
16756
|
-
srcPath =
|
|
16915
|
+
srcPath = relative12(projectRoot, resolveSvelteModulePath(resolve29(projectRoot, srcPath)));
|
|
16757
16916
|
}
|
|
16758
16917
|
return srcUrl(srcPath, projectRoot);
|
|
16759
16918
|
}, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
@@ -16763,27 +16922,27 @@ ${stubs}
|
|
|
16763
16922
|
"import"
|
|
16764
16923
|
]);
|
|
16765
16924
|
if (fromExports)
|
|
16766
|
-
return
|
|
16925
|
+
return relative12(projectRoot, fromExports);
|
|
16767
16926
|
try {
|
|
16768
16927
|
const isScoped = specifier.startsWith("@");
|
|
16769
16928
|
const parts = specifier.split("/");
|
|
16770
16929
|
const packageName = isScoped ? `${parts[0]}/${parts[1]}` : parts[0];
|
|
16771
16930
|
const subpath = isScoped ? parts.slice(2).join("/") : parts.slice(1).join("/");
|
|
16772
16931
|
if (!subpath) {
|
|
16773
|
-
const pkgDir =
|
|
16932
|
+
const pkgDir = resolve29(projectRoot, "node_modules", packageName ?? "");
|
|
16774
16933
|
const pkgJsonPath = join27(pkgDir, "package.json");
|
|
16775
16934
|
if (existsSync24(pkgJsonPath)) {
|
|
16776
|
-
const pkg = JSON.parse(
|
|
16935
|
+
const pkg = JSON.parse(readFileSync18(pkgJsonPath, "utf-8"));
|
|
16777
16936
|
const esmEntry = typeof pkg.module === "string" && pkg.module || typeof pkg.browser === "string" && pkg.browser;
|
|
16778
16937
|
if (esmEntry) {
|
|
16779
|
-
const resolved =
|
|
16938
|
+
const resolved = resolve29(pkgDir, esmEntry);
|
|
16780
16939
|
if (existsSync24(resolved))
|
|
16781
|
-
return
|
|
16940
|
+
return relative12(projectRoot, resolved);
|
|
16782
16941
|
}
|
|
16783
16942
|
}
|
|
16784
16943
|
}
|
|
16785
16944
|
} catch {}
|
|
16786
|
-
return
|
|
16945
|
+
return relative12(projectRoot, Bun.resolveSync(specifier, projectRoot));
|
|
16787
16946
|
} catch {
|
|
16788
16947
|
return;
|
|
16789
16948
|
}
|
|
@@ -16808,26 +16967,26 @@ ${stubs}
|
|
|
16808
16967
|
};
|
|
16809
16968
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
16810
16969
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
16811
|
-
const fileDir =
|
|
16970
|
+
const fileDir = dirname16(filePath);
|
|
16812
16971
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
16813
16972
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
16814
16973
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
16815
16974
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
|
|
16816
16975
|
if (absPath.startsWith(projectRoot)) {
|
|
16817
|
-
const rel2 =
|
|
16976
|
+
const rel2 = relative12(projectRoot, absPath).replace(/\\/g, "/");
|
|
16818
16977
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
16819
16978
|
}
|
|
16820
|
-
const rel =
|
|
16979
|
+
const rel = relative12(projectRoot, absPath).replace(/\\/g, "/");
|
|
16821
16980
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
16822
16981
|
});
|
|
16823
16982
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
16824
|
-
const absPath =
|
|
16825
|
-
const rel =
|
|
16983
|
+
const absPath = resolve29(fileDir, relPath);
|
|
16984
|
+
const rel = relative12(projectRoot, absPath);
|
|
16826
16985
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
16827
16986
|
});
|
|
16828
16987
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
16829
|
-
const absPath =
|
|
16830
|
-
const rel =
|
|
16988
|
+
const absPath = resolve29(fileDir, relPath);
|
|
16989
|
+
const rel = relative12(projectRoot, absPath);
|
|
16831
16990
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
16832
16991
|
});
|
|
16833
16992
|
return result;
|
|
@@ -16872,7 +17031,7 @@ ${code}`;
|
|
|
16872
17031
|
reactFastRefreshWarningEmitted = true;
|
|
16873
17032
|
logWarn("React HMR is blocked: this Bun build ignores " + "`reactFastRefresh` on Bun.Transpiler, so component state " + "cannot be preserved across edits. Tracking " + "https://github.com/oven-sh/bun/pull/28312 \u2014 if it still has " + "not merged, leave a \uD83D\uDC4D on the PR so the Bun team knows it " + "is blocking you. Until then, React edits trigger a full " + "reload instead of a fast refresh.");
|
|
16874
17033
|
}, transformReactFile = (filePath, projectRoot, rewriter) => {
|
|
16875
|
-
const raw =
|
|
17034
|
+
const raw = readFileSync18(filePath, "utf-8");
|
|
16876
17035
|
const valueExports = tsxTranspiler.scan(raw).exports;
|
|
16877
17036
|
let transpiled = reactTranspiler.transformSync(raw);
|
|
16878
17037
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
@@ -16883,12 +17042,12 @@ ${code}`;
|
|
|
16883
17042
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
16884
17043
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
16885
17044
|
${transpiled}`;
|
|
16886
|
-
const relPath =
|
|
17045
|
+
const relPath = relative12(projectRoot, filePath).replace(/\\/g, "/");
|
|
16887
17046
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
16888
17047
|
transpiled += buildIslandMetadataExports(raw);
|
|
16889
17048
|
return rewriteImports(transpiled, filePath, projectRoot, rewriter);
|
|
16890
17049
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
16891
|
-
const raw =
|
|
17050
|
+
const raw = readFileSync18(filePath, "utf-8");
|
|
16892
17051
|
const ext = extname8(filePath);
|
|
16893
17052
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
16894
17053
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
@@ -17044,17 +17203,17 @@ ${code}`;
|
|
|
17044
17203
|
if (compiled.css?.code) {
|
|
17045
17204
|
const cssPath = `${filePath}.css`;
|
|
17046
17205
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
17047
|
-
const cssUrl = srcUrl(
|
|
17206
|
+
const cssUrl = srcUrl(relative12(projectRoot, cssPath), projectRoot);
|
|
17048
17207
|
code = `import "${cssUrl}";
|
|
17049
17208
|
${code}`;
|
|
17050
17209
|
}
|
|
17051
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
17210
|
+
const moduleUrl = `${SRC_PREFIX}${relative12(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
17052
17211
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
17053
17212
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
17054
17213
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
17055
17214
|
return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
|
|
17056
17215
|
}, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
17057
|
-
const raw =
|
|
17216
|
+
const raw = readFileSync18(filePath, "utf-8");
|
|
17058
17217
|
if (!svelteCompiler) {
|
|
17059
17218
|
svelteCompiler = await import("svelte/compiler");
|
|
17060
17219
|
}
|
|
@@ -17114,7 +17273,7 @@ export default __script__;`;
|
|
|
17114
17273
|
return `${cssInjection}
|
|
17115
17274
|
${code}`;
|
|
17116
17275
|
}, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
17117
|
-
const rawSource =
|
|
17276
|
+
const rawSource = readFileSync18(filePath, "utf-8");
|
|
17118
17277
|
const raw = addAutoRouterSetupApp(rawSource);
|
|
17119
17278
|
if (!vueCompiler) {
|
|
17120
17279
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
@@ -17137,8 +17296,8 @@ ${code}`;
|
|
|
17137
17296
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
17138
17297
|
return rewriteImports(code, filePath, projectRoot, rewriter);
|
|
17139
17298
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
17140
|
-
const hmrBase = vueDir ?
|
|
17141
|
-
const hmrId =
|
|
17299
|
+
const hmrBase = vueDir ? resolve29(vueDir) : projectRoot;
|
|
17300
|
+
const hmrId = relative12(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
17142
17301
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
17143
17302
|
result += [
|
|
17144
17303
|
"",
|
|
@@ -17169,7 +17328,7 @@ ${code}`;
|
|
|
17169
17328
|
}
|
|
17170
17329
|
});
|
|
17171
17330
|
}, handleCssRequest = (filePath) => {
|
|
17172
|
-
const raw =
|
|
17331
|
+
const raw = readFileSync18(filePath, "utf-8");
|
|
17173
17332
|
const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
17174
17333
|
return [
|
|
17175
17334
|
`const style = document.createElement('style');`,
|
|
@@ -17296,7 +17455,7 @@ export default {};
|
|
|
17296
17455
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
17297
17456
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
17298
17457
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
17299
|
-
const filePath =
|
|
17458
|
+
const filePath = resolve29(projectRoot, relPath);
|
|
17300
17459
|
const ext = extname8(filePath);
|
|
17301
17460
|
if (ext === ".svelte")
|
|
17302
17461
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
@@ -17323,7 +17482,7 @@ export default {};
|
|
|
17323
17482
|
if (!TRANSPILABLE.has(ext))
|
|
17324
17483
|
return;
|
|
17325
17484
|
const stat3 = statSync2(filePath);
|
|
17326
|
-
const resolvedVueDir = vueDir ?
|
|
17485
|
+
const resolvedVueDir = vueDir ? resolve29(vueDir) : undefined;
|
|
17327
17486
|
const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
17328
17487
|
setTransformed(filePath, content, stat3.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
17329
17488
|
return jsResponse(content);
|
|
@@ -17354,7 +17513,7 @@ export default {};
|
|
|
17354
17513
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
17355
17514
|
return;
|
|
17356
17515
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
17357
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
17516
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve29(projectRoot, relPath));
|
|
17358
17517
|
if (virtualCssResponse)
|
|
17359
17518
|
return virtualCssResponse;
|
|
17360
17519
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -17370,11 +17529,11 @@ export default {};
|
|
|
17370
17529
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
17371
17530
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
17372
17531
|
if (match[1])
|
|
17373
|
-
files.push(
|
|
17532
|
+
files.push(resolve29(projectRoot, match[1]));
|
|
17374
17533
|
}
|
|
17375
17534
|
return files;
|
|
17376
17535
|
}, invalidateModule = (filePath) => {
|
|
17377
|
-
const resolved =
|
|
17536
|
+
const resolved = resolve29(filePath);
|
|
17378
17537
|
invalidate(filePath);
|
|
17379
17538
|
if (resolved !== filePath)
|
|
17380
17539
|
invalidate(resolved);
|
|
@@ -17489,6 +17648,1441 @@ var init_rewriteImports = __esm(() => {
|
|
|
17489
17648
|
rewriteVendorDirectories2 = rewriteVendorDirectories;
|
|
17490
17649
|
});
|
|
17491
17650
|
|
|
17651
|
+
// src/dev/angular/resolveOwningComponents.ts
|
|
17652
|
+
var exports_resolveOwningComponents = {};
|
|
17653
|
+
__export(exports_resolveOwningComponents, {
|
|
17654
|
+
resolveOwningComponents: () => resolveOwningComponents
|
|
17655
|
+
});
|
|
17656
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync19, statSync as statSync3 } from "fs";
|
|
17657
|
+
import { dirname as dirname17, extname as extname9, join as join28, resolve as resolve30 } from "path";
|
|
17658
|
+
import ts4 from "typescript";
|
|
17659
|
+
var isComponentTsFile = (file4) => file4.endsWith(".component.ts") || file4.endsWith(".component.tsx"), walkComponentTsFiles = (root) => {
|
|
17660
|
+
const out = [];
|
|
17661
|
+
const visit = (dir) => {
|
|
17662
|
+
let entries;
|
|
17663
|
+
try {
|
|
17664
|
+
entries = readdirSync2(dir, { withFileTypes: true });
|
|
17665
|
+
} catch {
|
|
17666
|
+
return;
|
|
17667
|
+
}
|
|
17668
|
+
for (const entry of entries) {
|
|
17669
|
+
if (entry.name.startsWith(".") || entry.name === "node_modules") {
|
|
17670
|
+
continue;
|
|
17671
|
+
}
|
|
17672
|
+
const full = join28(dir, entry.name);
|
|
17673
|
+
if (entry.isDirectory()) {
|
|
17674
|
+
visit(full);
|
|
17675
|
+
} else if (entry.isFile() && isComponentTsFile(entry.name)) {
|
|
17676
|
+
out.push(full);
|
|
17677
|
+
}
|
|
17678
|
+
}
|
|
17679
|
+
};
|
|
17680
|
+
visit(root);
|
|
17681
|
+
return out;
|
|
17682
|
+
}, getStringPropertyValue = (obj, name) => {
|
|
17683
|
+
for (const prop of obj.properties) {
|
|
17684
|
+
if (!ts4.isPropertyAssignment(prop))
|
|
17685
|
+
continue;
|
|
17686
|
+
const propName = ts4.isIdentifier(prop.name) ? prop.name.text : ts4.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
17687
|
+
if (propName !== name)
|
|
17688
|
+
continue;
|
|
17689
|
+
const init = prop.initializer;
|
|
17690
|
+
if (ts4.isStringLiteral(init) || ts4.isNoSubstitutionTemplateLiteral(init)) {
|
|
17691
|
+
return init.text;
|
|
17692
|
+
}
|
|
17693
|
+
}
|
|
17694
|
+
return null;
|
|
17695
|
+
}, getStringArrayProperty = (obj, name) => {
|
|
17696
|
+
const out = [];
|
|
17697
|
+
for (const prop of obj.properties) {
|
|
17698
|
+
if (!ts4.isPropertyAssignment(prop))
|
|
17699
|
+
continue;
|
|
17700
|
+
const propName = ts4.isIdentifier(prop.name) ? prop.name.text : ts4.isStringLiteral(prop.name) ? prop.name.text : null;
|
|
17701
|
+
if (propName !== name)
|
|
17702
|
+
continue;
|
|
17703
|
+
const init = prop.initializer;
|
|
17704
|
+
if (!ts4.isArrayLiteralExpression(init))
|
|
17705
|
+
continue;
|
|
17706
|
+
for (const element of init.elements) {
|
|
17707
|
+
if (ts4.isStringLiteral(element) || ts4.isNoSubstitutionTemplateLiteral(element)) {
|
|
17708
|
+
out.push(element.text);
|
|
17709
|
+
}
|
|
17710
|
+
}
|
|
17711
|
+
}
|
|
17712
|
+
return out;
|
|
17713
|
+
}, parseComponentRefs = (filePath) => {
|
|
17714
|
+
const refs = {
|
|
17715
|
+
classNames: [],
|
|
17716
|
+
templateUrls: [],
|
|
17717
|
+
styleUrls: []
|
|
17718
|
+
};
|
|
17719
|
+
let source;
|
|
17720
|
+
try {
|
|
17721
|
+
source = readFileSync19(filePath, "utf8");
|
|
17722
|
+
} catch {
|
|
17723
|
+
return refs;
|
|
17724
|
+
}
|
|
17725
|
+
const sourceFile = ts4.createSourceFile(filePath, source, ts4.ScriptTarget.ES2022, true, ts4.ScriptKind.TS);
|
|
17726
|
+
const visit = (node) => {
|
|
17727
|
+
if (ts4.isClassDeclaration(node) && node.name) {
|
|
17728
|
+
const decorators = ts4.getDecorators(node) ?? [];
|
|
17729
|
+
for (const decorator of decorators) {
|
|
17730
|
+
const expr = decorator.expression;
|
|
17731
|
+
if (!ts4.isCallExpression(expr))
|
|
17732
|
+
continue;
|
|
17733
|
+
const fn2 = expr.expression;
|
|
17734
|
+
if (!ts4.isIdentifier(fn2) || fn2.text !== "Component")
|
|
17735
|
+
continue;
|
|
17736
|
+
refs.classNames.push(node.name.text);
|
|
17737
|
+
const arg = expr.arguments[0];
|
|
17738
|
+
if (!arg || !ts4.isObjectLiteralExpression(arg))
|
|
17739
|
+
continue;
|
|
17740
|
+
const tplUrl = getStringPropertyValue(arg, "templateUrl");
|
|
17741
|
+
if (tplUrl)
|
|
17742
|
+
refs.templateUrls.push(tplUrl);
|
|
17743
|
+
const styleUrl = getStringPropertyValue(arg, "styleUrl");
|
|
17744
|
+
if (styleUrl)
|
|
17745
|
+
refs.styleUrls.push(styleUrl);
|
|
17746
|
+
refs.styleUrls.push(...getStringArrayProperty(arg, "styleUrls"));
|
|
17747
|
+
}
|
|
17748
|
+
}
|
|
17749
|
+
ts4.forEachChild(node, visit);
|
|
17750
|
+
};
|
|
17751
|
+
visit(sourceFile);
|
|
17752
|
+
return refs;
|
|
17753
|
+
}, safeNormalize = (path) => resolve30(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
|
|
17754
|
+
const { changedFilePath, userAngularRoot } = params;
|
|
17755
|
+
const changedAbs = safeNormalize(changedFilePath);
|
|
17756
|
+
const out = [];
|
|
17757
|
+
if (changedAbs.endsWith(".component.ts")) {
|
|
17758
|
+
const refs = parseComponentRefs(changedAbs);
|
|
17759
|
+
for (const className of refs.classNames) {
|
|
17760
|
+
out.push({ componentFilePath: changedAbs, className });
|
|
17761
|
+
}
|
|
17762
|
+
return out;
|
|
17763
|
+
}
|
|
17764
|
+
const ext = extname9(changedAbs).toLowerCase();
|
|
17765
|
+
if (ext !== ".html" && ext !== ".css" && ext !== ".scss" && ext !== ".sass") {
|
|
17766
|
+
return out;
|
|
17767
|
+
}
|
|
17768
|
+
let rootStat;
|
|
17769
|
+
try {
|
|
17770
|
+
rootStat = statSync3(userAngularRoot);
|
|
17771
|
+
} catch {
|
|
17772
|
+
return out;
|
|
17773
|
+
}
|
|
17774
|
+
if (!rootStat.isDirectory())
|
|
17775
|
+
return out;
|
|
17776
|
+
for (const componentTsPath of walkComponentTsFiles(userAngularRoot)) {
|
|
17777
|
+
const refs = parseComponentRefs(componentTsPath);
|
|
17778
|
+
const componentDir = dirname17(componentTsPath);
|
|
17779
|
+
const matchesResource = (relativeUrl) => {
|
|
17780
|
+
const abs = safeNormalize(resolve30(componentDir, relativeUrl));
|
|
17781
|
+
return abs === changedAbs;
|
|
17782
|
+
};
|
|
17783
|
+
const referencesChanged = refs.templateUrls.some(matchesResource) || refs.styleUrls.some(matchesResource);
|
|
17784
|
+
if (!referencesChanged)
|
|
17785
|
+
continue;
|
|
17786
|
+
for (const className of refs.classNames) {
|
|
17787
|
+
out.push({
|
|
17788
|
+
componentFilePath: componentTsPath,
|
|
17789
|
+
className
|
|
17790
|
+
});
|
|
17791
|
+
}
|
|
17792
|
+
}
|
|
17793
|
+
return out;
|
|
17794
|
+
};
|
|
17795
|
+
var init_resolveOwningComponents = () => {};
|
|
17796
|
+
|
|
17797
|
+
// src/dev/angular/hmrImportGenerator.ts
|
|
17798
|
+
import ts5 from "typescript";
|
|
17799
|
+
var createHmrImportGenerator = (namespaceMap) => ({
|
|
17800
|
+
addImport(request) {
|
|
17801
|
+
const ns = namespaceMap.get(request.exportModuleSpecifier);
|
|
17802
|
+
if (!ns) {
|
|
17803
|
+
throw new Error(`HMR import generator has no namespace mapping for ${request.exportModuleSpecifier}. ` + `Add it to namespaceDependencies before calling compileHmrUpdateCallback.`);
|
|
17804
|
+
}
|
|
17805
|
+
const namespaceId = ts5.factory.createIdentifier(ns);
|
|
17806
|
+
if (request.exportSymbolName === null) {
|
|
17807
|
+
return namespaceId;
|
|
17808
|
+
}
|
|
17809
|
+
return ts5.factory.createPropertyAccessExpression(namespaceId, ts5.factory.createIdentifier(request.exportSymbolName));
|
|
17810
|
+
}
|
|
17811
|
+
});
|
|
17812
|
+
var init_hmrImportGenerator = () => {};
|
|
17813
|
+
|
|
17814
|
+
// src/dev/angular/vendor/translator/context.ts
|
|
17815
|
+
class Context {
|
|
17816
|
+
isStatement;
|
|
17817
|
+
constructor(isStatement) {
|
|
17818
|
+
this.isStatement = isStatement;
|
|
17819
|
+
}
|
|
17820
|
+
get withExpressionMode() {
|
|
17821
|
+
return this.isStatement ? new Context(false) : this;
|
|
17822
|
+
}
|
|
17823
|
+
get withStatementMode() {
|
|
17824
|
+
return !this.isStatement ? new Context(true) : this;
|
|
17825
|
+
}
|
|
17826
|
+
}
|
|
17827
|
+
|
|
17828
|
+
// src/dev/angular/vendor/translator/translator.ts
|
|
17829
|
+
import * as o from "@angular/compiler";
|
|
17830
|
+
|
|
17831
|
+
class ExpressionTranslatorVisitor {
|
|
17832
|
+
factory;
|
|
17833
|
+
imports;
|
|
17834
|
+
contextFile;
|
|
17835
|
+
downlevelTaggedTemplates;
|
|
17836
|
+
downlevelVariableDeclarations;
|
|
17837
|
+
recordWrappedNode;
|
|
17838
|
+
constructor(factory, imports, contextFile, options) {
|
|
17839
|
+
this.factory = factory;
|
|
17840
|
+
this.imports = imports;
|
|
17841
|
+
this.contextFile = contextFile;
|
|
17842
|
+
this.downlevelTaggedTemplates = options.downlevelTaggedTemplates === true;
|
|
17843
|
+
this.downlevelVariableDeclarations = options.downlevelVariableDeclarations === true;
|
|
17844
|
+
this.recordWrappedNode = options.recordWrappedNode || (() => {});
|
|
17845
|
+
}
|
|
17846
|
+
visitDeclareVarStmt(stmt, context) {
|
|
17847
|
+
const varType = this.downlevelVariableDeclarations ? "var" : stmt.hasModifier(o.StmtModifier.Final) ? "const" : "let";
|
|
17848
|
+
return this.attachComments(this.factory.createVariableDeclaration(stmt.name, stmt.value?.visitExpression(this, context.withExpressionMode), varType, stmt.type?.visitType(this, context)), stmt.leadingComments);
|
|
17849
|
+
}
|
|
17850
|
+
visitDeclareFunctionStmt(stmt, context) {
|
|
17851
|
+
return this.attachComments(this.factory.createFunctionDeclaration(stmt.name, this.translateParams(stmt.params, context), this.factory.createBlock(this.visitStatements(stmt.statements, context.withStatementMode))), stmt.leadingComments);
|
|
17852
|
+
}
|
|
17853
|
+
visitExpressionStmt(stmt, context) {
|
|
17854
|
+
return this.attachComments(this.factory.createExpressionStatement(stmt.expr.visitExpression(this, context.withStatementMode)), stmt.leadingComments);
|
|
17855
|
+
}
|
|
17856
|
+
visitReturnStmt(stmt, context) {
|
|
17857
|
+
return this.attachComments(this.factory.createReturnStatement(stmt.value.visitExpression(this, context.withExpressionMode)), stmt.leadingComments);
|
|
17858
|
+
}
|
|
17859
|
+
visitIfStmt(stmt, context) {
|
|
17860
|
+
return this.attachComments(this.factory.createIfStatement(stmt.condition.visitExpression(this, context), this.factory.createBlock(this.visitStatements(stmt.trueCase, context.withStatementMode)), stmt.falseCase.length > 0 ? this.factory.createBlock(this.visitStatements(stmt.falseCase, context.withStatementMode)) : null), stmt.leadingComments);
|
|
17861
|
+
}
|
|
17862
|
+
visitReadVarExpr(ast, _context) {
|
|
17863
|
+
const identifier = this.factory.createIdentifier(ast.name);
|
|
17864
|
+
this.setSourceMapRange(identifier, ast.sourceSpan);
|
|
17865
|
+
return identifier;
|
|
17866
|
+
}
|
|
17867
|
+
visitInvokeFunctionExpr(ast, context) {
|
|
17868
|
+
return this.setSourceMapRange(this.factory.createCallExpression(ast.fn.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)), ast.pure), ast.sourceSpan);
|
|
17869
|
+
}
|
|
17870
|
+
visitTaggedTemplateLiteralExpr(ast, context) {
|
|
17871
|
+
return this.setSourceMapRange(this.createTaggedTemplateExpression(ast.tag.visitExpression(this, context), this.getTemplateLiteralFromAst(ast.template, context)), ast.sourceSpan);
|
|
17872
|
+
}
|
|
17873
|
+
visitTemplateLiteralExpr(ast, context) {
|
|
17874
|
+
return this.setSourceMapRange(this.factory.createTemplateLiteral(this.getTemplateLiteralFromAst(ast, context)), ast.sourceSpan);
|
|
17875
|
+
}
|
|
17876
|
+
visitInstantiateExpr(ast, context) {
|
|
17877
|
+
return this.factory.createNewExpression(ast.classExpr.visitExpression(this, context), ast.args.map((arg) => arg.visitExpression(this, context)));
|
|
17878
|
+
}
|
|
17879
|
+
visitLiteralExpr(ast, _context) {
|
|
17880
|
+
return this.setSourceMapRange(this.factory.createLiteral(ast.value), ast.sourceSpan);
|
|
17881
|
+
}
|
|
17882
|
+
visitRegularExpressionLiteral(ast, context) {
|
|
17883
|
+
return this.setSourceMapRange(this.factory.createRegularExpressionLiteral(ast.body, ast.flags), ast.sourceSpan);
|
|
17884
|
+
}
|
|
17885
|
+
visitLocalizedString(ast, context) {
|
|
17886
|
+
const elements = [createTemplateElement(ast.serializeI18nHead())];
|
|
17887
|
+
const expressions = [];
|
|
17888
|
+
for (let i = 0;i < ast.expressions.length; i++) {
|
|
17889
|
+
const placeholder = this.setSourceMapRange(ast.expressions[i].visitExpression(this, context), ast.getPlaceholderSourceSpan(i));
|
|
17890
|
+
expressions.push(placeholder);
|
|
17891
|
+
elements.push(createTemplateElement(ast.serializeI18nTemplatePart(i + 1)));
|
|
17892
|
+
}
|
|
17893
|
+
const localizeTag = this.factory.createIdentifier("$localize");
|
|
17894
|
+
return this.setSourceMapRange(this.createTaggedTemplateExpression(localizeTag, { elements, expressions }), ast.sourceSpan);
|
|
17895
|
+
}
|
|
17896
|
+
visitBuiltinType(ast) {
|
|
17897
|
+
let builtInType;
|
|
17898
|
+
switch (ast.name) {
|
|
17899
|
+
case o.BuiltinTypeName.Bool:
|
|
17900
|
+
builtInType = "boolean";
|
|
17901
|
+
break;
|
|
17902
|
+
case o.BuiltinTypeName.String:
|
|
17903
|
+
builtInType = "string";
|
|
17904
|
+
break;
|
|
17905
|
+
case o.BuiltinTypeName.Dynamic:
|
|
17906
|
+
builtInType = "any";
|
|
17907
|
+
break;
|
|
17908
|
+
case o.BuiltinTypeName.Number:
|
|
17909
|
+
case o.BuiltinTypeName.Int:
|
|
17910
|
+
builtInType = "number";
|
|
17911
|
+
break;
|
|
17912
|
+
case o.BuiltinTypeName.Function:
|
|
17913
|
+
builtInType = "function";
|
|
17914
|
+
break;
|
|
17915
|
+
case o.BuiltinTypeName.None:
|
|
17916
|
+
builtInType = "never";
|
|
17917
|
+
break;
|
|
17918
|
+
case o.BuiltinTypeName.Inferred:
|
|
17919
|
+
return null;
|
|
17920
|
+
}
|
|
17921
|
+
return this.factory.createBuiltInType(builtInType);
|
|
17922
|
+
}
|
|
17923
|
+
visitExpressionType(ast, context) {
|
|
17924
|
+
return this.factory.createExpressionType(ast.value.visitExpression(this, context), ast.typeParams === null || ast.typeParams.length === 0 ? null : ast.typeParams.map((param) => param.visitType(this, context)));
|
|
17925
|
+
}
|
|
17926
|
+
visitArrayType(ast, context) {
|
|
17927
|
+
return this.factory.createArrayType(ast.of.visitType(this, context));
|
|
17928
|
+
}
|
|
17929
|
+
visitMapType(ast, context) {
|
|
17930
|
+
const valueType = ast.valueType === null ? this.factory.createBuiltInType("unknown") : ast.valueType.visitType(this, context);
|
|
17931
|
+
return this.factory.createMapType(valueType);
|
|
17932
|
+
}
|
|
17933
|
+
visitTransplantedType(type) {
|
|
17934
|
+
return this.factory.transplantType(type.type);
|
|
17935
|
+
}
|
|
17936
|
+
createTaggedTemplateExpression(tag, template) {
|
|
17937
|
+
return this.downlevelTaggedTemplates ? this.createES5TaggedTemplateFunctionCall(tag, template) : this.factory.createTaggedTemplate(tag, template);
|
|
17938
|
+
}
|
|
17939
|
+
createES5TaggedTemplateFunctionCall(tagHandler, { elements, expressions }) {
|
|
17940
|
+
const __makeTemplateObjectHelper = this.imports.addImport({
|
|
17941
|
+
exportModuleSpecifier: "tslib",
|
|
17942
|
+
exportSymbolName: "__makeTemplateObject",
|
|
17943
|
+
requestedFile: this.contextFile
|
|
17944
|
+
});
|
|
17945
|
+
const cooked = [];
|
|
17946
|
+
const raw = [];
|
|
17947
|
+
for (const element of elements) {
|
|
17948
|
+
cooked.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.cooked), element.range));
|
|
17949
|
+
raw.push(this.factory.setSourceMapRange(this.factory.createLiteral(element.raw), element.range));
|
|
17950
|
+
}
|
|
17951
|
+
const templateHelperCall = this.factory.createCallExpression(__makeTemplateObjectHelper, [this.factory.createArrayLiteral(cooked), this.factory.createArrayLiteral(raw)], false);
|
|
17952
|
+
return this.factory.createCallExpression(tagHandler, [templateHelperCall, ...expressions], false);
|
|
17953
|
+
}
|
|
17954
|
+
visitExternalExpr(ast, _context) {
|
|
17955
|
+
if (ast.value.name === null) {
|
|
17956
|
+
if (ast.value.moduleName === null) {
|
|
17957
|
+
throw new Error("Invalid import without name nor moduleName");
|
|
17958
|
+
}
|
|
17959
|
+
return this.imports.addImport({
|
|
17960
|
+
exportModuleSpecifier: ast.value.moduleName,
|
|
17961
|
+
exportSymbolName: null,
|
|
17962
|
+
requestedFile: this.contextFile
|
|
17963
|
+
});
|
|
17964
|
+
}
|
|
17965
|
+
if (ast.value.moduleName !== null) {
|
|
17966
|
+
return this.imports.addImport({
|
|
17967
|
+
exportModuleSpecifier: ast.value.moduleName,
|
|
17968
|
+
exportSymbolName: ast.value.name,
|
|
17969
|
+
requestedFile: this.contextFile
|
|
17970
|
+
});
|
|
17971
|
+
} else {
|
|
17972
|
+
return this.factory.createIdentifier(ast.value.name);
|
|
17973
|
+
}
|
|
17974
|
+
}
|
|
17975
|
+
visitConditionalExpr(ast, context) {
|
|
17976
|
+
return this.factory.createConditional(ast.condition.visitExpression(this, context), ast.trueCase.visitExpression(this, context), ast.falseCase.visitExpression(this, context));
|
|
17977
|
+
}
|
|
17978
|
+
visitDynamicImportExpr(ast, context) {
|
|
17979
|
+
const urlExpression = typeof ast.url === "string" ? this.factory.createLiteral(ast.url) : ast.url.visitExpression(this, context);
|
|
17980
|
+
if (ast.urlComment) {
|
|
17981
|
+
this.factory.attachComments(urlExpression, [o.leadingComment(ast.urlComment, true)]);
|
|
17982
|
+
}
|
|
17983
|
+
return this.factory.createDynamicImport(urlExpression);
|
|
17984
|
+
}
|
|
17985
|
+
visitNotExpr(ast, context) {
|
|
17986
|
+
return this.factory.createUnaryExpression("!", ast.condition.visitExpression(this, context));
|
|
17987
|
+
}
|
|
17988
|
+
visitFunctionExpr(ast, context) {
|
|
17989
|
+
return this.factory.createFunctionExpression(ast.name ?? null, this.translateParams(ast.params, context), this.factory.createBlock(this.visitStatements(ast.statements, context)));
|
|
17990
|
+
}
|
|
17991
|
+
visitArrowFunctionExpr(ast, context) {
|
|
17992
|
+
return this.factory.createArrowFunctionExpression(this.translateParams(ast.params, context), Array.isArray(ast.body) ? this.factory.createBlock(this.visitStatements(ast.body, context)) : ast.body.visitExpression(this, context));
|
|
17993
|
+
}
|
|
17994
|
+
visitBinaryOperatorExpr(ast, context) {
|
|
17995
|
+
if (!BINARY_OPERATORS.has(ast.operator)) {
|
|
17996
|
+
throw new Error(`Unknown binary operator: ${o.BinaryOperator[ast.operator]}`);
|
|
17997
|
+
}
|
|
17998
|
+
const operator = BINARY_OPERATORS.get(ast.operator);
|
|
17999
|
+
if (ast.isAssignment()) {
|
|
18000
|
+
return this.factory.createAssignment(ast.lhs.visitExpression(this, context), operator, ast.rhs.visitExpression(this, context));
|
|
18001
|
+
}
|
|
18002
|
+
return this.factory.createBinaryExpression(ast.lhs.visitExpression(this, context), operator, ast.rhs.visitExpression(this, context));
|
|
18003
|
+
}
|
|
18004
|
+
visitReadPropExpr(ast, context) {
|
|
18005
|
+
return this.factory.createPropertyAccess(ast.receiver.visitExpression(this, context), ast.name);
|
|
18006
|
+
}
|
|
18007
|
+
visitReadKeyExpr(ast, context) {
|
|
18008
|
+
return this.factory.createElementAccess(ast.receiver.visitExpression(this, context), ast.index.visitExpression(this, context));
|
|
18009
|
+
}
|
|
18010
|
+
visitLiteralArrayExpr(ast, context) {
|
|
18011
|
+
return this.factory.createArrayLiteral(ast.entries.map((expr) => this.setSourceMapRange(expr.visitExpression(this, context), ast.sourceSpan)));
|
|
18012
|
+
}
|
|
18013
|
+
visitLiteralMapExpr(ast, context) {
|
|
18014
|
+
const properties = ast.entries.map((entry) => {
|
|
18015
|
+
return entry instanceof o.LiteralMapPropertyAssignment ? {
|
|
18016
|
+
kind: "property",
|
|
18017
|
+
propertyName: entry.key,
|
|
18018
|
+
quoted: entry.quoted,
|
|
18019
|
+
value: entry.value.visitExpression(this, context)
|
|
18020
|
+
} : {
|
|
18021
|
+
kind: "spread",
|
|
18022
|
+
expression: entry.expression.visitExpression(this, context)
|
|
18023
|
+
};
|
|
18024
|
+
});
|
|
18025
|
+
return this.setSourceMapRange(this.factory.createObjectLiteral(properties), ast.sourceSpan);
|
|
18026
|
+
}
|
|
18027
|
+
visitCommaExpr(ast, context) {
|
|
18028
|
+
throw new Error("Method not implemented.");
|
|
18029
|
+
}
|
|
18030
|
+
visitTemplateLiteralElementExpr(ast, context) {
|
|
18031
|
+
throw new Error("Method not implemented");
|
|
18032
|
+
}
|
|
18033
|
+
visitSpreadElementExpr(ast, context) {
|
|
18034
|
+
const expression = ast.expression.visitExpression(this, context);
|
|
18035
|
+
return this.setSourceMapRange(this.factory.createSpreadElement(expression), ast.sourceSpan);
|
|
18036
|
+
}
|
|
18037
|
+
visitWrappedNodeExpr(ast, _context) {
|
|
18038
|
+
this.recordWrappedNode(ast);
|
|
18039
|
+
return ast.node;
|
|
18040
|
+
}
|
|
18041
|
+
visitTypeofExpr(ast, context) {
|
|
18042
|
+
return this.factory.createTypeOfExpression(ast.expr.visitExpression(this, context));
|
|
18043
|
+
}
|
|
18044
|
+
visitVoidExpr(ast, context) {
|
|
18045
|
+
return this.factory.createVoidExpression(ast.expr.visitExpression(this, context));
|
|
18046
|
+
}
|
|
18047
|
+
visitUnaryOperatorExpr(ast, context) {
|
|
18048
|
+
if (!UNARY_OPERATORS.has(ast.operator)) {
|
|
18049
|
+
throw new Error(`Unknown unary operator: ${o.UnaryOperator[ast.operator]}`);
|
|
18050
|
+
}
|
|
18051
|
+
return this.factory.createUnaryExpression(UNARY_OPERATORS.get(ast.operator), ast.expr.visitExpression(this, context));
|
|
18052
|
+
}
|
|
18053
|
+
visitParenthesizedExpr(ast, context) {
|
|
18054
|
+
const result = ast.expr.visitExpression(this, context);
|
|
18055
|
+
return this.factory.createParenthesizedExpression(result);
|
|
18056
|
+
}
|
|
18057
|
+
visitStatements(statements, context) {
|
|
18058
|
+
return statements.map((stmt) => stmt.visitStatement(this, context)).filter((stmt) => stmt !== undefined);
|
|
18059
|
+
}
|
|
18060
|
+
setSourceMapRange(ast, span) {
|
|
18061
|
+
return this.factory.setSourceMapRange(ast, createRange(span));
|
|
18062
|
+
}
|
|
18063
|
+
attachComments(statement, leadingComments) {
|
|
18064
|
+
if (leadingComments !== undefined) {
|
|
18065
|
+
this.factory.attachComments(statement, leadingComments);
|
|
18066
|
+
}
|
|
18067
|
+
return statement;
|
|
18068
|
+
}
|
|
18069
|
+
getTemplateLiteralFromAst(ast, context) {
|
|
18070
|
+
return {
|
|
18071
|
+
elements: ast.elements.map((e) => createTemplateElement({
|
|
18072
|
+
cooked: e.text,
|
|
18073
|
+
raw: e.rawText,
|
|
18074
|
+
range: e.sourceSpan ?? ast.sourceSpan
|
|
18075
|
+
})),
|
|
18076
|
+
expressions: ast.expressions.map((e) => e.visitExpression(this, context))
|
|
18077
|
+
};
|
|
18078
|
+
}
|
|
18079
|
+
translateParams(params, context) {
|
|
18080
|
+
return params.map((param) => ({
|
|
18081
|
+
name: param.name,
|
|
18082
|
+
type: param.type?.visitType(this, context)
|
|
18083
|
+
}));
|
|
18084
|
+
}
|
|
18085
|
+
}
|
|
18086
|
+
function createTemplateElement({
|
|
18087
|
+
cooked,
|
|
18088
|
+
raw,
|
|
18089
|
+
range
|
|
18090
|
+
}) {
|
|
18091
|
+
return { cooked, raw, range: createRange(range) };
|
|
18092
|
+
}
|
|
18093
|
+
function createRange(span) {
|
|
18094
|
+
if (span === null) {
|
|
18095
|
+
return null;
|
|
18096
|
+
}
|
|
18097
|
+
const { start, end } = span;
|
|
18098
|
+
const { url, content } = start.file;
|
|
18099
|
+
if (!url) {
|
|
18100
|
+
return null;
|
|
18101
|
+
}
|
|
18102
|
+
return {
|
|
18103
|
+
url,
|
|
18104
|
+
content,
|
|
18105
|
+
start: { offset: start.offset, line: start.line, column: start.col },
|
|
18106
|
+
end: { offset: end.offset, line: end.line, column: end.col }
|
|
18107
|
+
};
|
|
18108
|
+
}
|
|
18109
|
+
var UNARY_OPERATORS, BINARY_OPERATORS;
|
|
18110
|
+
var init_translator = __esm(() => {
|
|
18111
|
+
UNARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
18112
|
+
[o.UnaryOperator.Minus, "-"],
|
|
18113
|
+
[o.UnaryOperator.Plus, "+"]
|
|
18114
|
+
]);
|
|
18115
|
+
BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
18116
|
+
[o.BinaryOperator.And, "&&"],
|
|
18117
|
+
[o.BinaryOperator.Bigger, ">"],
|
|
18118
|
+
[o.BinaryOperator.BiggerEquals, ">="],
|
|
18119
|
+
[o.BinaryOperator.BitwiseAnd, "&"],
|
|
18120
|
+
[o.BinaryOperator.BitwiseOr, "|"],
|
|
18121
|
+
[o.BinaryOperator.Divide, "/"],
|
|
18122
|
+
[o.BinaryOperator.Equals, "=="],
|
|
18123
|
+
[o.BinaryOperator.Identical, "==="],
|
|
18124
|
+
[o.BinaryOperator.Lower, "<"],
|
|
18125
|
+
[o.BinaryOperator.LowerEquals, "<="],
|
|
18126
|
+
[o.BinaryOperator.Minus, "-"],
|
|
18127
|
+
[o.BinaryOperator.Modulo, "%"],
|
|
18128
|
+
[o.BinaryOperator.Multiply, "*"],
|
|
18129
|
+
[o.BinaryOperator.NotEquals, "!="],
|
|
18130
|
+
[o.BinaryOperator.NotIdentical, "!=="],
|
|
18131
|
+
[o.BinaryOperator.Or, "||"],
|
|
18132
|
+
[o.BinaryOperator.Plus, "+"],
|
|
18133
|
+
[o.BinaryOperator.NullishCoalesce, "??"],
|
|
18134
|
+
[o.BinaryOperator.Exponentiation, "**"],
|
|
18135
|
+
[o.BinaryOperator.In, "in"],
|
|
18136
|
+
[o.BinaryOperator.InstanceOf, "instanceof"],
|
|
18137
|
+
[o.BinaryOperator.Assign, "="],
|
|
18138
|
+
[o.BinaryOperator.AdditionAssignment, "+="],
|
|
18139
|
+
[o.BinaryOperator.SubtractionAssignment, "-="],
|
|
18140
|
+
[o.BinaryOperator.MultiplicationAssignment, "*="],
|
|
18141
|
+
[o.BinaryOperator.DivisionAssignment, "/="],
|
|
18142
|
+
[o.BinaryOperator.RemainderAssignment, "%="],
|
|
18143
|
+
[o.BinaryOperator.ExponentiationAssignment, "**="],
|
|
18144
|
+
[o.BinaryOperator.AndAssignment, "&&="],
|
|
18145
|
+
[o.BinaryOperator.OrAssignment, "||="],
|
|
18146
|
+
[o.BinaryOperator.NullishCoalesceAssignment, "??="]
|
|
18147
|
+
]);
|
|
18148
|
+
});
|
|
18149
|
+
|
|
18150
|
+
// src/dev/angular/vendor/translator/ts_util.ts
|
|
18151
|
+
import ts6 from "typescript";
|
|
18152
|
+
function tsNumericExpression(value) {
|
|
18153
|
+
if (value < 0) {
|
|
18154
|
+
const operand = ts6.factory.createNumericLiteral(Math.abs(value));
|
|
18155
|
+
return ts6.factory.createPrefixUnaryExpression(ts6.SyntaxKind.MinusToken, operand);
|
|
18156
|
+
}
|
|
18157
|
+
return ts6.factory.createNumericLiteral(value);
|
|
18158
|
+
}
|
|
18159
|
+
var init_ts_util = __esm(() => {
|
|
18160
|
+
/*!
|
|
18161
|
+
* @license
|
|
18162
|
+
* Copyright Google LLC All Rights Reserved.
|
|
18163
|
+
*
|
|
18164
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
18165
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
18166
|
+
*/
|
|
18167
|
+
});
|
|
18168
|
+
|
|
18169
|
+
// src/dev/angular/vendor/translator/typescript_ast_factory.ts
|
|
18170
|
+
import ts7 from "typescript";
|
|
18171
|
+
|
|
18172
|
+
class TypeScriptAstFactory {
|
|
18173
|
+
annotateForClosureCompiler;
|
|
18174
|
+
externalSourceFiles = new Map;
|
|
18175
|
+
UNARY_OPERATORS = /* @__PURE__ */ (() => ({
|
|
18176
|
+
"+": ts7.SyntaxKind.PlusToken,
|
|
18177
|
+
"-": ts7.SyntaxKind.MinusToken,
|
|
18178
|
+
"!": ts7.SyntaxKind.ExclamationToken
|
|
18179
|
+
}))();
|
|
18180
|
+
BINARY_OPERATORS = /* @__PURE__ */ (() => ({
|
|
18181
|
+
"&&": ts7.SyntaxKind.AmpersandAmpersandToken,
|
|
18182
|
+
">": ts7.SyntaxKind.GreaterThanToken,
|
|
18183
|
+
">=": ts7.SyntaxKind.GreaterThanEqualsToken,
|
|
18184
|
+
"&": ts7.SyntaxKind.AmpersandToken,
|
|
18185
|
+
"|": ts7.SyntaxKind.BarToken,
|
|
18186
|
+
"/": ts7.SyntaxKind.SlashToken,
|
|
18187
|
+
"==": ts7.SyntaxKind.EqualsEqualsToken,
|
|
18188
|
+
"===": ts7.SyntaxKind.EqualsEqualsEqualsToken,
|
|
18189
|
+
"<": ts7.SyntaxKind.LessThanToken,
|
|
18190
|
+
"<=": ts7.SyntaxKind.LessThanEqualsToken,
|
|
18191
|
+
"-": ts7.SyntaxKind.MinusToken,
|
|
18192
|
+
"%": ts7.SyntaxKind.PercentToken,
|
|
18193
|
+
"*": ts7.SyntaxKind.AsteriskToken,
|
|
18194
|
+
"**": ts7.SyntaxKind.AsteriskAsteriskToken,
|
|
18195
|
+
"!=": ts7.SyntaxKind.ExclamationEqualsToken,
|
|
18196
|
+
"!==": ts7.SyntaxKind.ExclamationEqualsEqualsToken,
|
|
18197
|
+
"||": ts7.SyntaxKind.BarBarToken,
|
|
18198
|
+
"+": ts7.SyntaxKind.PlusToken,
|
|
18199
|
+
"??": ts7.SyntaxKind.QuestionQuestionToken,
|
|
18200
|
+
"=": ts7.SyntaxKind.EqualsToken,
|
|
18201
|
+
"+=": ts7.SyntaxKind.PlusEqualsToken,
|
|
18202
|
+
"-=": ts7.SyntaxKind.MinusEqualsToken,
|
|
18203
|
+
"*=": ts7.SyntaxKind.AsteriskEqualsToken,
|
|
18204
|
+
"/=": ts7.SyntaxKind.SlashEqualsToken,
|
|
18205
|
+
"%=": ts7.SyntaxKind.PercentEqualsToken,
|
|
18206
|
+
"**=": ts7.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
18207
|
+
"&&=": ts7.SyntaxKind.AmpersandAmpersandEqualsToken,
|
|
18208
|
+
"||=": ts7.SyntaxKind.BarBarEqualsToken,
|
|
18209
|
+
"??=": ts7.SyntaxKind.QuestionQuestionEqualsToken,
|
|
18210
|
+
in: ts7.SyntaxKind.InKeyword,
|
|
18211
|
+
instanceof: ts7.SyntaxKind.InstanceOfKeyword
|
|
18212
|
+
}))();
|
|
18213
|
+
VAR_TYPES = /* @__PURE__ */ (() => ({
|
|
18214
|
+
const: ts7.NodeFlags.Const,
|
|
18215
|
+
let: ts7.NodeFlags.Let,
|
|
18216
|
+
var: ts7.NodeFlags.None
|
|
18217
|
+
}))();
|
|
18218
|
+
constructor(annotateForClosureCompiler) {
|
|
18219
|
+
this.annotateForClosureCompiler = annotateForClosureCompiler;
|
|
18220
|
+
}
|
|
18221
|
+
attachComments = attachComments;
|
|
18222
|
+
createArrayLiteral = ts7.factory.createArrayLiteralExpression;
|
|
18223
|
+
createAssignment(target, operator, value) {
|
|
18224
|
+
return ts7.factory.createBinaryExpression(target, this.BINARY_OPERATORS[operator], value);
|
|
18225
|
+
}
|
|
18226
|
+
createBinaryExpression(leftOperand, operator, rightOperand) {
|
|
18227
|
+
return ts7.factory.createBinaryExpression(leftOperand, this.BINARY_OPERATORS[operator], rightOperand);
|
|
18228
|
+
}
|
|
18229
|
+
createBlock(body) {
|
|
18230
|
+
return ts7.factory.createBlock(body);
|
|
18231
|
+
}
|
|
18232
|
+
createCallExpression(callee, args, pure) {
|
|
18233
|
+
const call = ts7.factory.createCallExpression(callee, undefined, args);
|
|
18234
|
+
if (pure) {
|
|
18235
|
+
ts7.addSyntheticLeadingComment(call, ts7.SyntaxKind.MultiLineCommentTrivia, this.annotateForClosureCompiler ? "* @pureOrBreakMyCode " /* CLOSURE */ : "@__PURE__" /* TERSER */, false);
|
|
18236
|
+
}
|
|
18237
|
+
return call;
|
|
18238
|
+
}
|
|
18239
|
+
createConditional(condition, whenTrue, whenFalse) {
|
|
18240
|
+
return ts7.factory.createConditionalExpression(condition, undefined, whenTrue, undefined, whenFalse);
|
|
18241
|
+
}
|
|
18242
|
+
createElementAccess = ts7.factory.createElementAccessExpression;
|
|
18243
|
+
createExpressionStatement = ts7.factory.createExpressionStatement;
|
|
18244
|
+
createDynamicImport(url) {
|
|
18245
|
+
return ts7.factory.createCallExpression(ts7.factory.createToken(ts7.SyntaxKind.ImportKeyword), undefined, [typeof url === "string" ? ts7.factory.createStringLiteral(url) : url]);
|
|
18246
|
+
}
|
|
18247
|
+
createFunctionDeclaration(functionName, parameters, body) {
|
|
18248
|
+
if (!ts7.isBlock(body)) {
|
|
18249
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts7.SyntaxKind[body.kind]}.`);
|
|
18250
|
+
}
|
|
18251
|
+
return ts7.factory.createFunctionDeclaration(undefined, undefined, functionName, undefined, parameters.map((param) => this.createParameter(param)), undefined, body);
|
|
18252
|
+
}
|
|
18253
|
+
createFunctionExpression(functionName, parameters, body) {
|
|
18254
|
+
if (!ts7.isBlock(body)) {
|
|
18255
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts7.SyntaxKind[body.kind]}.`);
|
|
18256
|
+
}
|
|
18257
|
+
return ts7.factory.createFunctionExpression(undefined, undefined, functionName ?? undefined, undefined, parameters.map((param) => this.createParameter(param)), undefined, body);
|
|
18258
|
+
}
|
|
18259
|
+
createArrowFunctionExpression(parameters, body) {
|
|
18260
|
+
if (ts7.isStatement(body) && !ts7.isBlock(body)) {
|
|
18261
|
+
throw new Error(`Invalid syntax, expected a block, but got ${ts7.SyntaxKind[body.kind]}.`);
|
|
18262
|
+
}
|
|
18263
|
+
return ts7.factory.createArrowFunction(undefined, undefined, parameters.map((param) => this.createParameter(param)), undefined, undefined, body);
|
|
18264
|
+
}
|
|
18265
|
+
createParameter(param) {
|
|
18266
|
+
return ts7.factory.createParameterDeclaration(undefined, undefined, param.name, undefined, param.type ?? undefined);
|
|
18267
|
+
}
|
|
18268
|
+
createIdentifier = ts7.factory.createIdentifier;
|
|
18269
|
+
createIfStatement(condition, thenStatement, elseStatement) {
|
|
18270
|
+
return ts7.factory.createIfStatement(condition, thenStatement, elseStatement ?? undefined);
|
|
18271
|
+
}
|
|
18272
|
+
createLiteral(value) {
|
|
18273
|
+
if (value === undefined) {
|
|
18274
|
+
return ts7.factory.createIdentifier("undefined");
|
|
18275
|
+
} else if (value === null) {
|
|
18276
|
+
return ts7.factory.createNull();
|
|
18277
|
+
} else if (typeof value === "boolean") {
|
|
18278
|
+
return value ? ts7.factory.createTrue() : ts7.factory.createFalse();
|
|
18279
|
+
} else if (typeof value === "number") {
|
|
18280
|
+
return tsNumericExpression(value);
|
|
18281
|
+
} else {
|
|
18282
|
+
return ts7.factory.createStringLiteral(value);
|
|
18283
|
+
}
|
|
18284
|
+
}
|
|
18285
|
+
createNewExpression(expression, args) {
|
|
18286
|
+
return ts7.factory.createNewExpression(expression, undefined, args);
|
|
18287
|
+
}
|
|
18288
|
+
createObjectLiteral(properties) {
|
|
18289
|
+
return ts7.factory.createObjectLiteralExpression(properties.map((prop) => {
|
|
18290
|
+
if (prop.kind === "spread") {
|
|
18291
|
+
return ts7.factory.createSpreadAssignment(prop.expression);
|
|
18292
|
+
}
|
|
18293
|
+
return ts7.factory.createPropertyAssignment(prop.quoted ? ts7.factory.createStringLiteral(prop.propertyName) : ts7.factory.createIdentifier(prop.propertyName), prop.value);
|
|
18294
|
+
}));
|
|
18295
|
+
}
|
|
18296
|
+
createParenthesizedExpression = ts7.factory.createParenthesizedExpression;
|
|
18297
|
+
createPropertyAccess = ts7.factory.createPropertyAccessExpression;
|
|
18298
|
+
createSpreadElement = ts7.factory.createSpreadElement;
|
|
18299
|
+
createReturnStatement(expression) {
|
|
18300
|
+
return ts7.factory.createReturnStatement(expression ?? undefined);
|
|
18301
|
+
}
|
|
18302
|
+
createTaggedTemplate(tag, template) {
|
|
18303
|
+
return ts7.factory.createTaggedTemplateExpression(tag, undefined, this.createTemplateLiteral(template));
|
|
18304
|
+
}
|
|
18305
|
+
createTemplateLiteral(template) {
|
|
18306
|
+
let templateLiteral;
|
|
18307
|
+
const length = template.elements.length;
|
|
18308
|
+
const head = template.elements[0];
|
|
18309
|
+
if (length === 1) {
|
|
18310
|
+
templateLiteral = ts7.factory.createNoSubstitutionTemplateLiteral(head.cooked, head.raw);
|
|
18311
|
+
} else {
|
|
18312
|
+
const spans = [];
|
|
18313
|
+
for (let i = 1;i < length - 1; i++) {
|
|
18314
|
+
const { cooked, raw, range } = template.elements[i];
|
|
18315
|
+
const middle = createTemplateMiddle(cooked, raw);
|
|
18316
|
+
if (range !== null) {
|
|
18317
|
+
this.setSourceMapRange(middle, range);
|
|
18318
|
+
}
|
|
18319
|
+
spans.push(ts7.factory.createTemplateSpan(template.expressions[i - 1], middle));
|
|
18320
|
+
}
|
|
18321
|
+
const resolvedExpression = template.expressions[length - 2];
|
|
18322
|
+
const templatePart = template.elements[length - 1];
|
|
18323
|
+
const templateTail = createTemplateTail(templatePart.cooked, templatePart.raw);
|
|
18324
|
+
if (templatePart.range !== null) {
|
|
18325
|
+
this.setSourceMapRange(templateTail, templatePart.range);
|
|
18326
|
+
}
|
|
18327
|
+
spans.push(ts7.factory.createTemplateSpan(resolvedExpression, templateTail));
|
|
18328
|
+
templateLiteral = ts7.factory.createTemplateExpression(ts7.factory.createTemplateHead(head.cooked, head.raw), spans);
|
|
18329
|
+
}
|
|
18330
|
+
if (head.range !== null) {
|
|
18331
|
+
this.setSourceMapRange(templateLiteral, head.range);
|
|
18332
|
+
}
|
|
18333
|
+
return templateLiteral;
|
|
18334
|
+
}
|
|
18335
|
+
createThrowStatement = ts7.factory.createThrowStatement;
|
|
18336
|
+
createTypeOfExpression = ts7.factory.createTypeOfExpression;
|
|
18337
|
+
createVoidExpression = ts7.factory.createVoidExpression;
|
|
18338
|
+
createUnaryExpression(operator, operand) {
|
|
18339
|
+
return ts7.factory.createPrefixUnaryExpression(this.UNARY_OPERATORS[operator], operand);
|
|
18340
|
+
}
|
|
18341
|
+
createVariableDeclaration(variableName, initializer, variableType, type) {
|
|
18342
|
+
return ts7.factory.createVariableStatement(undefined, ts7.factory.createVariableDeclarationList([
|
|
18343
|
+
ts7.factory.createVariableDeclaration(variableName, undefined, type ?? undefined, initializer ?? undefined)
|
|
18344
|
+
], this.VAR_TYPES[variableType]));
|
|
18345
|
+
}
|
|
18346
|
+
createRegularExpressionLiteral(body, flags) {
|
|
18347
|
+
return ts7.factory.createRegularExpressionLiteral(`/${body}/${flags ?? ""}`);
|
|
18348
|
+
}
|
|
18349
|
+
setSourceMapRange(node, sourceMapRange) {
|
|
18350
|
+
if (sourceMapRange === null) {
|
|
18351
|
+
return node;
|
|
18352
|
+
}
|
|
18353
|
+
const url = sourceMapRange.url;
|
|
18354
|
+
if (!this.externalSourceFiles.has(url)) {
|
|
18355
|
+
this.externalSourceFiles.set(url, ts7.createSourceMapSource(url, sourceMapRange.content, (pos) => pos));
|
|
18356
|
+
}
|
|
18357
|
+
const source = this.externalSourceFiles.get(url);
|
|
18358
|
+
ts7.setSourceMapRange(node, {
|
|
18359
|
+
pos: sourceMapRange.start.offset,
|
|
18360
|
+
end: sourceMapRange.end.offset,
|
|
18361
|
+
source
|
|
18362
|
+
});
|
|
18363
|
+
return node;
|
|
18364
|
+
}
|
|
18365
|
+
createBuiltInType(type) {
|
|
18366
|
+
switch (type) {
|
|
18367
|
+
case "any":
|
|
18368
|
+
return ts7.factory.createKeywordTypeNode(ts7.SyntaxKind.AnyKeyword);
|
|
18369
|
+
case "boolean":
|
|
18370
|
+
return ts7.factory.createKeywordTypeNode(ts7.SyntaxKind.BooleanKeyword);
|
|
18371
|
+
case "number":
|
|
18372
|
+
return ts7.factory.createKeywordTypeNode(ts7.SyntaxKind.NumberKeyword);
|
|
18373
|
+
case "string":
|
|
18374
|
+
return ts7.factory.createKeywordTypeNode(ts7.SyntaxKind.StringKeyword);
|
|
18375
|
+
case "function":
|
|
18376
|
+
return ts7.factory.createTypeReferenceNode(ts7.factory.createIdentifier("Function"));
|
|
18377
|
+
case "never":
|
|
18378
|
+
return ts7.factory.createKeywordTypeNode(ts7.SyntaxKind.NeverKeyword);
|
|
18379
|
+
case "unknown":
|
|
18380
|
+
return ts7.factory.createKeywordTypeNode(ts7.SyntaxKind.UnknownKeyword);
|
|
18381
|
+
}
|
|
18382
|
+
}
|
|
18383
|
+
createExpressionType(expression, typeParams) {
|
|
18384
|
+
const typeName = getEntityTypeFromExpression(expression);
|
|
18385
|
+
return ts7.factory.createTypeReferenceNode(typeName, typeParams ?? undefined);
|
|
18386
|
+
}
|
|
18387
|
+
createArrayType(elementType) {
|
|
18388
|
+
return ts7.factory.createArrayTypeNode(elementType);
|
|
18389
|
+
}
|
|
18390
|
+
createMapType(valueType) {
|
|
18391
|
+
return ts7.factory.createTypeLiteralNode([
|
|
18392
|
+
ts7.factory.createIndexSignature(undefined, [
|
|
18393
|
+
ts7.factory.createParameterDeclaration(undefined, undefined, "key", undefined, ts7.factory.createKeywordTypeNode(ts7.SyntaxKind.StringKeyword))
|
|
18394
|
+
], valueType)
|
|
18395
|
+
]);
|
|
18396
|
+
}
|
|
18397
|
+
transplantType(type) {
|
|
18398
|
+
if (typeof type.kind === "number" && typeof type.getSourceFile === "function" && ts7.isTypeNode(type)) {
|
|
18399
|
+
return type;
|
|
18400
|
+
}
|
|
18401
|
+
throw new Error("Attempting to transplant a type node from a non-TypeScript AST: " + type);
|
|
18402
|
+
}
|
|
18403
|
+
}
|
|
18404
|
+
function createTemplateMiddle(cooked, raw) {
|
|
18405
|
+
const node = ts7.factory.createTemplateHead(cooked, raw);
|
|
18406
|
+
node.kind = ts7.SyntaxKind.TemplateMiddle;
|
|
18407
|
+
return node;
|
|
18408
|
+
}
|
|
18409
|
+
function createTemplateTail(cooked, raw) {
|
|
18410
|
+
const node = ts7.factory.createTemplateHead(cooked, raw);
|
|
18411
|
+
node.kind = ts7.SyntaxKind.TemplateTail;
|
|
18412
|
+
return node;
|
|
18413
|
+
}
|
|
18414
|
+
function attachComments(statement, leadingComments) {
|
|
18415
|
+
for (const comment of leadingComments) {
|
|
18416
|
+
const commentKind = comment.multiline ? ts7.SyntaxKind.MultiLineCommentTrivia : ts7.SyntaxKind.SingleLineCommentTrivia;
|
|
18417
|
+
if (comment.multiline) {
|
|
18418
|
+
ts7.addSyntheticLeadingComment(statement, commentKind, comment.toString(), comment.trailingNewline);
|
|
18419
|
+
} else {
|
|
18420
|
+
for (const line of comment.toString().split(`
|
|
18421
|
+
`)) {
|
|
18422
|
+
ts7.addSyntheticLeadingComment(statement, commentKind, line, comment.trailingNewline);
|
|
18423
|
+
}
|
|
18424
|
+
}
|
|
18425
|
+
}
|
|
18426
|
+
}
|
|
18427
|
+
function getEntityTypeFromExpression(expression) {
|
|
18428
|
+
if (ts7.isIdentifier(expression)) {
|
|
18429
|
+
return expression;
|
|
18430
|
+
}
|
|
18431
|
+
if (ts7.isPropertyAccessExpression(expression)) {
|
|
18432
|
+
const left = getEntityTypeFromExpression(expression.expression);
|
|
18433
|
+
if (!ts7.isIdentifier(expression.name)) {
|
|
18434
|
+
throw new Error(`Unsupported property access for type reference: ${expression.name.text}`);
|
|
18435
|
+
}
|
|
18436
|
+
return ts7.factory.createQualifiedName(left, expression.name);
|
|
18437
|
+
}
|
|
18438
|
+
throw new Error(`Unsupported expression for type reference: ${ts7.SyntaxKind[expression.kind]}`);
|
|
18439
|
+
}
|
|
18440
|
+
var init_typescript_ast_factory = __esm(() => {
|
|
18441
|
+
init_ts_util();
|
|
18442
|
+
});
|
|
18443
|
+
|
|
18444
|
+
// src/dev/angular/vendor/translator/typescript_translator.ts
|
|
18445
|
+
function translateStatement(contextFile, statement, imports, options = {}) {
|
|
18446
|
+
return statement.visitStatement(new ExpressionTranslatorVisitor(new TypeScriptAstFactory(options.annotateForClosureCompiler === true), imports, contextFile, options), new Context(true));
|
|
18447
|
+
}
|
|
18448
|
+
var init_typescript_translator = __esm(() => {
|
|
18449
|
+
init_translator();
|
|
18450
|
+
init_typescript_ast_factory();
|
|
18451
|
+
});
|
|
18452
|
+
|
|
18453
|
+
// src/dev/angular/fastHmrCompiler.ts
|
|
18454
|
+
import { existsSync as existsSync25, readFileSync as readFileSync20 } from "fs";
|
|
18455
|
+
import { dirname as dirname18, relative as relative13, resolve as resolve31 } from "path";
|
|
18456
|
+
import ts8 from "typescript";
|
|
18457
|
+
var fail = (reason, detail) => ({ ok: false, reason, detail }), findClassDeclaration = (sourceFile, className) => {
|
|
18458
|
+
let found = null;
|
|
18459
|
+
const walk = (node) => {
|
|
18460
|
+
if (found)
|
|
18461
|
+
return;
|
|
18462
|
+
if (ts8.isClassDeclaration(node) && node.name?.text === className) {
|
|
18463
|
+
found = node;
|
|
18464
|
+
return;
|
|
18465
|
+
}
|
|
18466
|
+
ts8.forEachChild(node, walk);
|
|
18467
|
+
};
|
|
18468
|
+
walk(sourceFile);
|
|
18469
|
+
return found;
|
|
18470
|
+
}, getClassDecorators = (cls) => {
|
|
18471
|
+
const modifiers = ts8.getDecorators(cls) ?? [];
|
|
18472
|
+
return [...modifiers];
|
|
18473
|
+
}, findComponentDecorator = (cls) => {
|
|
18474
|
+
for (const decorator of getClassDecorators(cls)) {
|
|
18475
|
+
const expr = decorator.expression;
|
|
18476
|
+
if (ts8.isCallExpression(expr)) {
|
|
18477
|
+
const fn2 = expr.expression;
|
|
18478
|
+
if (ts8.isIdentifier(fn2) && fn2.text === "Component") {
|
|
18479
|
+
return decorator;
|
|
18480
|
+
}
|
|
18481
|
+
}
|
|
18482
|
+
}
|
|
18483
|
+
return null;
|
|
18484
|
+
}, getDecoratorArgsObject = (decorator) => {
|
|
18485
|
+
const call = decorator.expression;
|
|
18486
|
+
if (!ts8.isCallExpression(call))
|
|
18487
|
+
return null;
|
|
18488
|
+
const arg = call.arguments[0];
|
|
18489
|
+
if (!arg || !ts8.isObjectLiteralExpression(arg))
|
|
18490
|
+
return null;
|
|
18491
|
+
return arg;
|
|
18492
|
+
}, getProperty = (obj, name) => {
|
|
18493
|
+
for (const prop of obj.properties) {
|
|
18494
|
+
if (ts8.isPropertyAssignment(prop) && (ts8.isIdentifier(prop.name) && prop.name.text === name || ts8.isStringLiteral(prop.name) && prop.name.text === name)) {
|
|
18495
|
+
return prop.initializer;
|
|
18496
|
+
}
|
|
18497
|
+
}
|
|
18498
|
+
return null;
|
|
18499
|
+
}, getStringProperty = (obj, name) => {
|
|
18500
|
+
const expr = getProperty(obj, name);
|
|
18501
|
+
if (!expr)
|
|
18502
|
+
return null;
|
|
18503
|
+
if (ts8.isStringLiteral(expr) || ts8.isNoSubstitutionTemplateLiteral(expr)) {
|
|
18504
|
+
return expr.text;
|
|
18505
|
+
}
|
|
18506
|
+
return null;
|
|
18507
|
+
}, getBooleanProperty = (obj, name) => {
|
|
18508
|
+
const expr = getProperty(obj, name);
|
|
18509
|
+
if (!expr)
|
|
18510
|
+
return null;
|
|
18511
|
+
if (expr.kind === ts8.SyntaxKind.TrueKeyword)
|
|
18512
|
+
return true;
|
|
18513
|
+
if (expr.kind === ts8.SyntaxKind.FalseKeyword)
|
|
18514
|
+
return false;
|
|
18515
|
+
return null;
|
|
18516
|
+
}, inheritsDecoratedClass = (cls) => {
|
|
18517
|
+
const heritage = cls.heritageClauses ?? [];
|
|
18518
|
+
for (const clause of heritage) {
|
|
18519
|
+
if (clause.token !== ts8.SyntaxKind.ExtendsKeyword)
|
|
18520
|
+
continue;
|
|
18521
|
+
if (clause.types.length > 0)
|
|
18522
|
+
return true;
|
|
18523
|
+
}
|
|
18524
|
+
return false;
|
|
18525
|
+
}, readDecoratorMeta = (args) => {
|
|
18526
|
+
const styleUrlsExpr = getProperty(args, "styleUrls");
|
|
18527
|
+
const stylesExpr = getProperty(args, "styles");
|
|
18528
|
+
const importsExpr = getProperty(args, "imports");
|
|
18529
|
+
const styleUrls = [];
|
|
18530
|
+
if (styleUrlsExpr && ts8.isArrayLiteralExpression(styleUrlsExpr)) {
|
|
18531
|
+
for (const el of styleUrlsExpr.elements) {
|
|
18532
|
+
if (ts8.isStringLiteral(el))
|
|
18533
|
+
styleUrls.push(el.text);
|
|
18534
|
+
}
|
|
18535
|
+
}
|
|
18536
|
+
const styles = [];
|
|
18537
|
+
if (stylesExpr) {
|
|
18538
|
+
if (ts8.isArrayLiteralExpression(stylesExpr)) {
|
|
18539
|
+
for (const el of stylesExpr.elements) {
|
|
18540
|
+
if (ts8.isStringLiteral(el) || ts8.isNoSubstitutionTemplateLiteral(el)) {
|
|
18541
|
+
styles.push(el.text);
|
|
18542
|
+
}
|
|
18543
|
+
}
|
|
18544
|
+
} else if (ts8.isStringLiteral(stylesExpr) || ts8.isNoSubstitutionTemplateLiteral(stylesExpr)) {
|
|
18545
|
+
styles.push(stylesExpr.text);
|
|
18546
|
+
}
|
|
18547
|
+
}
|
|
18548
|
+
return {
|
|
18549
|
+
selector: getStringProperty(args, "selector"),
|
|
18550
|
+
templateUrl: getStringProperty(args, "templateUrl"),
|
|
18551
|
+
template: getStringProperty(args, "template"),
|
|
18552
|
+
styleUrl: getStringProperty(args, "styleUrl"),
|
|
18553
|
+
styleUrls,
|
|
18554
|
+
styles,
|
|
18555
|
+
standalone: getBooleanProperty(args, "standalone") ?? true,
|
|
18556
|
+
preserveWhitespaces: getBooleanProperty(args, "preserveWhitespaces") ?? false,
|
|
18557
|
+
importsExpr: importsExpr && ts8.isArrayLiteralExpression(importsExpr) ? importsExpr : null
|
|
18558
|
+
};
|
|
18559
|
+
}, extractDecoratorInput = (prop) => {
|
|
18560
|
+
const decorators = ts8.getDecorators(prop) ?? [];
|
|
18561
|
+
for (const decorator of decorators) {
|
|
18562
|
+
const expr = decorator.expression;
|
|
18563
|
+
if (!ts8.isCallExpression(expr))
|
|
18564
|
+
continue;
|
|
18565
|
+
const fn2 = expr.expression;
|
|
18566
|
+
if (!ts8.isIdentifier(fn2) || fn2.text !== "Input")
|
|
18567
|
+
continue;
|
|
18568
|
+
const classPropertyName = prop.name.getText();
|
|
18569
|
+
let bindingPropertyName = classPropertyName;
|
|
18570
|
+
let required = false;
|
|
18571
|
+
const arg = expr.arguments[0];
|
|
18572
|
+
if (arg) {
|
|
18573
|
+
if (ts8.isStringLiteral(arg)) {
|
|
18574
|
+
bindingPropertyName = arg.text;
|
|
18575
|
+
} else if (ts8.isObjectLiteralExpression(arg)) {
|
|
18576
|
+
const aliasNode = getStringProperty(arg, "alias");
|
|
18577
|
+
if (aliasNode !== null)
|
|
18578
|
+
bindingPropertyName = aliasNode;
|
|
18579
|
+
required = getBooleanProperty(arg, "required") ?? false;
|
|
18580
|
+
}
|
|
18581
|
+
}
|
|
18582
|
+
return {
|
|
18583
|
+
classPropertyName,
|
|
18584
|
+
meta: {
|
|
18585
|
+
classPropertyName,
|
|
18586
|
+
bindingPropertyName,
|
|
18587
|
+
required,
|
|
18588
|
+
isSignal: false,
|
|
18589
|
+
transformFunction: null
|
|
18590
|
+
}
|
|
18591
|
+
};
|
|
18592
|
+
}
|
|
18593
|
+
return null;
|
|
18594
|
+
}, isInputSignalCall = (init) => {
|
|
18595
|
+
if (ts8.isCallExpression(init)) {
|
|
18596
|
+
const fn2 = init.expression;
|
|
18597
|
+
if (ts8.isIdentifier(fn2) && fn2.text === "input")
|
|
18598
|
+
return true;
|
|
18599
|
+
if (ts8.isPropertyAccessExpression(fn2) && ts8.isIdentifier(fn2.expression) && fn2.expression.text === "input") {
|
|
18600
|
+
return true;
|
|
18601
|
+
}
|
|
18602
|
+
}
|
|
18603
|
+
return false;
|
|
18604
|
+
}, extractSignalInput = (prop) => {
|
|
18605
|
+
if (!prop.initializer || !isInputSignalCall(prop.initializer))
|
|
18606
|
+
return null;
|
|
18607
|
+
const classPropertyName = prop.name.getText();
|
|
18608
|
+
const call = prop.initializer;
|
|
18609
|
+
let required = false;
|
|
18610
|
+
if (ts8.isPropertyAccessExpression(call.expression) && ts8.isIdentifier(call.expression.name) && call.expression.name.text === "required") {
|
|
18611
|
+
required = true;
|
|
18612
|
+
}
|
|
18613
|
+
let bindingPropertyName = classPropertyName;
|
|
18614
|
+
const optsArg = call.arguments[required ? 0 : 1];
|
|
18615
|
+
if (optsArg && ts8.isObjectLiteralExpression(optsArg)) {
|
|
18616
|
+
const aliasNode = getStringProperty(optsArg, "alias");
|
|
18617
|
+
if (aliasNode !== null)
|
|
18618
|
+
bindingPropertyName = aliasNode;
|
|
18619
|
+
}
|
|
18620
|
+
return {
|
|
18621
|
+
classPropertyName,
|
|
18622
|
+
meta: {
|
|
18623
|
+
classPropertyName,
|
|
18624
|
+
bindingPropertyName,
|
|
18625
|
+
required,
|
|
18626
|
+
isSignal: true,
|
|
18627
|
+
transformFunction: null
|
|
18628
|
+
}
|
|
18629
|
+
};
|
|
18630
|
+
}, extractDecoratorOutput = (prop) => {
|
|
18631
|
+
const decorators = ts8.getDecorators(prop) ?? [];
|
|
18632
|
+
for (const decorator of decorators) {
|
|
18633
|
+
const expr = decorator.expression;
|
|
18634
|
+
if (!ts8.isCallExpression(expr))
|
|
18635
|
+
continue;
|
|
18636
|
+
const fn2 = expr.expression;
|
|
18637
|
+
if (!ts8.isIdentifier(fn2) || fn2.text !== "Output")
|
|
18638
|
+
continue;
|
|
18639
|
+
const classPropertyName = prop.name.getText();
|
|
18640
|
+
let bindingName = classPropertyName;
|
|
18641
|
+
const arg = expr.arguments[0];
|
|
18642
|
+
if (arg && ts8.isStringLiteral(arg))
|
|
18643
|
+
bindingName = arg.text;
|
|
18644
|
+
return { classPropertyName, bindingName };
|
|
18645
|
+
}
|
|
18646
|
+
return null;
|
|
18647
|
+
}, isOutputSignalCall = (init) => {
|
|
18648
|
+
if (ts8.isCallExpression(init)) {
|
|
18649
|
+
const fn2 = init.expression;
|
|
18650
|
+
if (ts8.isIdentifier(fn2) && fn2.text === "output")
|
|
18651
|
+
return true;
|
|
18652
|
+
if (ts8.isPropertyAccessExpression(fn2) && ts8.isIdentifier(fn2.expression) && fn2.expression.text === "output") {
|
|
18653
|
+
return true;
|
|
18654
|
+
}
|
|
18655
|
+
}
|
|
18656
|
+
return false;
|
|
18657
|
+
}, extractSignalOutput = (prop) => {
|
|
18658
|
+
if (!prop.initializer || !isOutputSignalCall(prop.initializer))
|
|
18659
|
+
return null;
|
|
18660
|
+
const classPropertyName = prop.name.getText();
|
|
18661
|
+
const call = prop.initializer;
|
|
18662
|
+
let bindingName = classPropertyName;
|
|
18663
|
+
const optsArg = call.arguments[0];
|
|
18664
|
+
if (optsArg && ts8.isObjectLiteralExpression(optsArg)) {
|
|
18665
|
+
const aliasNode = getStringProperty(optsArg, "alias");
|
|
18666
|
+
if (aliasNode !== null)
|
|
18667
|
+
bindingName = aliasNode;
|
|
18668
|
+
}
|
|
18669
|
+
return { classPropertyName, bindingName };
|
|
18670
|
+
}, extractInputsAndOutputs = (cls) => {
|
|
18671
|
+
const inputs = {};
|
|
18672
|
+
const outputs = {};
|
|
18673
|
+
for (const member of cls.members) {
|
|
18674
|
+
if (!ts8.isPropertyDeclaration(member))
|
|
18675
|
+
continue;
|
|
18676
|
+
const decoratorIn = extractDecoratorInput(member);
|
|
18677
|
+
if (decoratorIn) {
|
|
18678
|
+
inputs[decoratorIn.classPropertyName] = decoratorIn.meta;
|
|
18679
|
+
continue;
|
|
18680
|
+
}
|
|
18681
|
+
const signalIn = extractSignalInput(member);
|
|
18682
|
+
if (signalIn) {
|
|
18683
|
+
inputs[signalIn.classPropertyName] = signalIn.meta;
|
|
18684
|
+
continue;
|
|
18685
|
+
}
|
|
18686
|
+
const decoratorOut = extractDecoratorOutput(member);
|
|
18687
|
+
if (decoratorOut) {
|
|
18688
|
+
outputs[decoratorOut.classPropertyName] = decoratorOut.bindingName;
|
|
18689
|
+
continue;
|
|
18690
|
+
}
|
|
18691
|
+
const signalOut = extractSignalOutput(member);
|
|
18692
|
+
if (signalOut) {
|
|
18693
|
+
outputs[signalOut.classPropertyName] = signalOut.bindingName;
|
|
18694
|
+
}
|
|
18695
|
+
}
|
|
18696
|
+
return { inputs, outputs };
|
|
18697
|
+
}, resolveAndReadResource = (componentDir, url) => {
|
|
18698
|
+
const abs = resolve31(componentDir, url);
|
|
18699
|
+
if (!existsSync25(abs))
|
|
18700
|
+
return null;
|
|
18701
|
+
return readFileSync20(abs, "utf8");
|
|
18702
|
+
}, collectStyles = (decoratorMeta, componentDir) => {
|
|
18703
|
+
const styles = [...decoratorMeta.styles];
|
|
18704
|
+
const urls = [];
|
|
18705
|
+
if (decoratorMeta.styleUrl)
|
|
18706
|
+
urls.push(decoratorMeta.styleUrl);
|
|
18707
|
+
urls.push(...decoratorMeta.styleUrls);
|
|
18708
|
+
for (const url of urls) {
|
|
18709
|
+
const css = resolveAndReadResource(componentDir, url);
|
|
18710
|
+
if (css === null)
|
|
18711
|
+
return { styles, missing: url };
|
|
18712
|
+
styles.push(css);
|
|
18713
|
+
}
|
|
18714
|
+
return { styles, missing: null };
|
|
18715
|
+
}, tryFastHmr = async (params) => {
|
|
18716
|
+
const { componentFilePath, className } = params;
|
|
18717
|
+
const projectRoot = params.projectRoot ?? process.cwd();
|
|
18718
|
+
if (!existsSync25(componentFilePath)) {
|
|
18719
|
+
return fail("file-not-found", componentFilePath);
|
|
18720
|
+
}
|
|
18721
|
+
let compiler;
|
|
18722
|
+
try {
|
|
18723
|
+
compiler = await import("@angular/compiler");
|
|
18724
|
+
} catch (err) {
|
|
18725
|
+
return fail("unexpected-error", `import @angular/compiler: ${err}`);
|
|
18726
|
+
}
|
|
18727
|
+
const tsSource = readFileSync20(componentFilePath, "utf8");
|
|
18728
|
+
const sourceFile = ts8.createSourceFile(componentFilePath, tsSource, ts8.ScriptTarget.ES2022, true, ts8.ScriptKind.TS);
|
|
18729
|
+
const classNode = findClassDeclaration(sourceFile, className);
|
|
18730
|
+
if (!classNode) {
|
|
18731
|
+
return fail("class-not-found", `${className} in ${componentFilePath}`);
|
|
18732
|
+
}
|
|
18733
|
+
if (inheritsDecoratedClass(classNode)) {
|
|
18734
|
+
return fail("inherits-decorated-class");
|
|
18735
|
+
}
|
|
18736
|
+
const decorator = findComponentDecorator(classNode);
|
|
18737
|
+
if (!decorator)
|
|
18738
|
+
return fail("no-component-decorator");
|
|
18739
|
+
const decoratorArgs = getDecoratorArgsObject(decorator);
|
|
18740
|
+
if (!decoratorArgs)
|
|
18741
|
+
return fail("unsupported-decorator-args");
|
|
18742
|
+
const decoratorMeta = readDecoratorMeta(decoratorArgs);
|
|
18743
|
+
if (!decoratorMeta.standalone)
|
|
18744
|
+
return fail("not-standalone");
|
|
18745
|
+
const componentDir = dirname18(componentFilePath);
|
|
18746
|
+
let templateText;
|
|
18747
|
+
let templatePath;
|
|
18748
|
+
if (decoratorMeta.template !== null) {
|
|
18749
|
+
templateText = decoratorMeta.template;
|
|
18750
|
+
templatePath = componentFilePath;
|
|
18751
|
+
} else if (decoratorMeta.templateUrl) {
|
|
18752
|
+
const tplAbs = resolve31(componentDir, decoratorMeta.templateUrl);
|
|
18753
|
+
if (!existsSync25(tplAbs)) {
|
|
18754
|
+
return fail("template-resource-not-found", tplAbs);
|
|
18755
|
+
}
|
|
18756
|
+
templateText = readFileSync20(tplAbs, "utf8");
|
|
18757
|
+
templatePath = tplAbs;
|
|
18758
|
+
} else {
|
|
18759
|
+
return fail("unsupported-decorator-args", "missing template/templateUrl");
|
|
18760
|
+
}
|
|
18761
|
+
const { styles, missing: missingStyle } = collectStyles(decoratorMeta, componentDir);
|
|
18762
|
+
if (missingStyle) {
|
|
18763
|
+
return fail("style-resource-not-found", missingStyle);
|
|
18764
|
+
}
|
|
18765
|
+
let parsed;
|
|
18766
|
+
try {
|
|
18767
|
+
parsed = compiler.parseTemplate(templateText, templatePath, {
|
|
18768
|
+
preserveWhitespaces: decoratorMeta.preserveWhitespaces
|
|
18769
|
+
});
|
|
18770
|
+
} catch (err) {
|
|
18771
|
+
return fail("template-parse-error", String(err));
|
|
18772
|
+
}
|
|
18773
|
+
if (parsed.errors && parsed.errors.length > 0) {
|
|
18774
|
+
return fail("template-parse-error", parsed.errors.map((e) => e.toString()).join(`
|
|
18775
|
+
`));
|
|
18776
|
+
}
|
|
18777
|
+
const className_ = classNode.name;
|
|
18778
|
+
if (!className_)
|
|
18779
|
+
return fail("class-not-found", "anonymous class");
|
|
18780
|
+
const wrappedClass = new compiler.WrappedNodeExpr(className_);
|
|
18781
|
+
const { inputs, outputs } = extractInputsAndOutputs(classNode);
|
|
18782
|
+
const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
|
|
18783
|
+
const sourceFileObj = new compiler.ParseSourceFile(tsSource, componentFilePath);
|
|
18784
|
+
const zeroLoc = new compiler.ParseLocation(sourceFileObj, 0, 0, 0);
|
|
18785
|
+
const typeSourceSpan = new compiler.ParseSourceSpan(zeroLoc, zeroLoc);
|
|
18786
|
+
const importsArray = [];
|
|
18787
|
+
if (decoratorMeta.importsExpr) {
|
|
18788
|
+
for (const el of decoratorMeta.importsExpr.elements) {
|
|
18789
|
+
importsArray.push(new compiler.WrappedNodeExpr(el));
|
|
18790
|
+
}
|
|
18791
|
+
}
|
|
18792
|
+
const declarations = importsArray.map((expr) => ({
|
|
18793
|
+
kind: 0,
|
|
18794
|
+
type: expr,
|
|
18795
|
+
selector: "",
|
|
18796
|
+
inputs: [],
|
|
18797
|
+
outputs: [],
|
|
18798
|
+
exportAs: null,
|
|
18799
|
+
isComponent: false
|
|
18800
|
+
}));
|
|
18801
|
+
const meta = {
|
|
18802
|
+
name: className,
|
|
18803
|
+
type: { value: wrappedClass, type: wrappedClass },
|
|
18804
|
+
typeArgumentCount: 0,
|
|
18805
|
+
typeSourceSpan,
|
|
18806
|
+
deps: null,
|
|
18807
|
+
selector: decoratorMeta.selector,
|
|
18808
|
+
queries: [],
|
|
18809
|
+
viewQueries: [],
|
|
18810
|
+
host: {
|
|
18811
|
+
attributes: {},
|
|
18812
|
+
listeners: {},
|
|
18813
|
+
properties: {},
|
|
18814
|
+
specialAttributes: {}
|
|
18815
|
+
},
|
|
18816
|
+
lifecycle: { usesOnChanges: false },
|
|
18817
|
+
inputs,
|
|
18818
|
+
outputs,
|
|
18819
|
+
usesInheritance: false,
|
|
18820
|
+
controlCreate: null,
|
|
18821
|
+
exportAs: null,
|
|
18822
|
+
providers: null,
|
|
18823
|
+
isStandalone: true,
|
|
18824
|
+
isSignal: false,
|
|
18825
|
+
hostDirectives: null,
|
|
18826
|
+
template: {
|
|
18827
|
+
nodes: parsed.nodes,
|
|
18828
|
+
ngContentSelectors: parsed.ngContentSelectors ?? [],
|
|
18829
|
+
preserveWhitespaces: decoratorMeta.preserveWhitespaces
|
|
18830
|
+
},
|
|
18831
|
+
declarations,
|
|
18832
|
+
defer: { mode: 0, blocks: new Map },
|
|
18833
|
+
declarationListEmitMode: 0,
|
|
18834
|
+
styles,
|
|
18835
|
+
encapsulation: 0,
|
|
18836
|
+
animations: null,
|
|
18837
|
+
viewProviders: null,
|
|
18838
|
+
relativeContextFilePath: projectRelPath,
|
|
18839
|
+
i18nUseExternalIds: false,
|
|
18840
|
+
changeDetection: null,
|
|
18841
|
+
relativeTemplatePath: null,
|
|
18842
|
+
hasDirectiveDependencies: importsArray.length > 0
|
|
18843
|
+
};
|
|
18844
|
+
let compiled;
|
|
18845
|
+
try {
|
|
18846
|
+
const pool = new compiler.ConstantPool;
|
|
18847
|
+
const bindingParser = compiler.makeBindingParser();
|
|
18848
|
+
compiled = compiler.compileComponentFromMetadata(meta, pool, bindingParser);
|
|
18849
|
+
const namespaceDependencies = [
|
|
18850
|
+
{ moduleName: "@angular/core", assignedName: "\u0275hmr0" }
|
|
18851
|
+
];
|
|
18852
|
+
const callback = compiler.compileHmrUpdateCallback([
|
|
18853
|
+
{
|
|
18854
|
+
name: "\u0275cmp",
|
|
18855
|
+
initializer: compiled.expression,
|
|
18856
|
+
statements: compiled.statements ?? []
|
|
18857
|
+
}
|
|
18858
|
+
], pool.statements, {
|
|
18859
|
+
type: wrappedClass,
|
|
18860
|
+
className,
|
|
18861
|
+
filePath: projectRelPath,
|
|
18862
|
+
namespaceDependencies,
|
|
18863
|
+
localDependencies: []
|
|
18864
|
+
});
|
|
18865
|
+
const namespaceMap = new Map;
|
|
18866
|
+
for (const dep of namespaceDependencies) {
|
|
18867
|
+
namespaceMap.set(dep.moduleName, dep.assignedName);
|
|
18868
|
+
}
|
|
18869
|
+
const importGenerator = createHmrImportGenerator(namespaceMap);
|
|
18870
|
+
const tsFunctionDecl = translateStatement(sourceFile, callback, importGenerator);
|
|
18871
|
+
const exportedDecl = ts8.factory.updateFunctionDeclaration(tsFunctionDecl, [
|
|
18872
|
+
ts8.factory.createToken(ts8.SyntaxKind.ExportKeyword),
|
|
18873
|
+
ts8.factory.createToken(ts8.SyntaxKind.DefaultKeyword)
|
|
18874
|
+
], tsFunctionDecl.asteriskToken, tsFunctionDecl.name, tsFunctionDecl.typeParameters, tsFunctionDecl.parameters, tsFunctionDecl.type, tsFunctionDecl.body);
|
|
18875
|
+
const printer = ts8.createPrinter({
|
|
18876
|
+
newLine: ts8.NewLineKind.LineFeed,
|
|
18877
|
+
removeComments: false
|
|
18878
|
+
});
|
|
18879
|
+
const tsSourceText = printer.printNode(ts8.EmitHint.Unspecified, exportedDecl, sourceFile);
|
|
18880
|
+
const moduleText = ts8.transpileModule(tsSourceText, {
|
|
18881
|
+
compilerOptions: {
|
|
18882
|
+
module: ts8.ModuleKind.ES2022,
|
|
18883
|
+
target: ts8.ScriptTarget.ES2022
|
|
18884
|
+
},
|
|
18885
|
+
fileName: componentFilePath,
|
|
18886
|
+
reportDiagnostics: false
|
|
18887
|
+
}).outputText;
|
|
18888
|
+
return { ok: true, moduleText, componentSource: sourceFile };
|
|
18889
|
+
} catch (err) {
|
|
18890
|
+
return fail("unexpected-error", String(err));
|
|
18891
|
+
}
|
|
18892
|
+
};
|
|
18893
|
+
var init_fastHmrCompiler = __esm(() => {
|
|
18894
|
+
init_hmrImportGenerator();
|
|
18895
|
+
init_typescript_translator();
|
|
18896
|
+
});
|
|
18897
|
+
|
|
18898
|
+
// src/dev/angular/hmrCompiler.ts
|
|
18899
|
+
var exports_hmrCompiler = {};
|
|
18900
|
+
__export(exports_hmrCompiler, {
|
|
18901
|
+
getCachedHmrProgram: () => getCachedHmrProgram,
|
|
18902
|
+
getApplyMetadataModule: () => getApplyMetadataModule,
|
|
18903
|
+
findClassNodeById: () => findClassNodeById,
|
|
18904
|
+
encodeHmrComponentId: () => encodeHmrComponentId,
|
|
18905
|
+
compileAngularForHmr: () => compileAngularForHmr
|
|
18906
|
+
});
|
|
18907
|
+
import { existsSync as existsSync26 } from "fs";
|
|
18908
|
+
import { basename as basename12, dirname as dirname19, join as join29, relative as relative14, resolve as resolve32 } from "path";
|
|
18909
|
+
import { performance as performance2 } from "perf_hooks";
|
|
18910
|
+
import ts9 from "typescript";
|
|
18911
|
+
var globalCache, getCachedHmrProgram = () => globalCache.__ABSOLUTE_ANGULAR_HMR_PROGRAM__ ?? null, setCachedHmrProgram = (program) => {
|
|
18912
|
+
globalCache.__ABSOLUTE_ANGULAR_HMR_PROGRAM__ = program;
|
|
18913
|
+
}, resolveTypescriptLibDirCached = null, resolveTypescriptLibDir = () => {
|
|
18914
|
+
if (resolveTypescriptLibDirCached)
|
|
18915
|
+
return resolveTypescriptLibDirCached;
|
|
18916
|
+
const tsPath = __require.resolve("typescript");
|
|
18917
|
+
const tsRootDir = dirname19(tsPath);
|
|
18918
|
+
resolveTypescriptLibDirCached = tsRootDir.endsWith("lib") ? tsRootDir : resolve32(tsRootDir, "lib");
|
|
18919
|
+
return resolveTypescriptLibDirCached;
|
|
18920
|
+
}, buildHmrCompilerOptions = (base) => ({
|
|
18921
|
+
...base,
|
|
18922
|
+
emitDecoratorMetadata: true,
|
|
18923
|
+
esModuleInterop: true,
|
|
18924
|
+
experimentalDecorators: true,
|
|
18925
|
+
module: ts9.ModuleKind.ESNext,
|
|
18926
|
+
moduleResolution: ts9.ModuleResolutionKind.Bundler,
|
|
18927
|
+
newLine: ts9.NewLineKind.LineFeed,
|
|
18928
|
+
noEmit: false,
|
|
18929
|
+
noLib: false,
|
|
18930
|
+
rootDir: process.cwd(),
|
|
18931
|
+
skipLibCheck: true,
|
|
18932
|
+
target: ts9.ScriptTarget.ES2022,
|
|
18933
|
+
_enableHmr: true,
|
|
18934
|
+
enableHmr: true
|
|
18935
|
+
}), ANGULAR_COMPILER_OPTIONS_CACHE, loadAngularCompilerOptions = async () => {
|
|
18936
|
+
if (ANGULAR_COMPILER_OPTIONS_CACHE.value) {
|
|
18937
|
+
return ANGULAR_COMPILER_OPTIONS_CACHE.value;
|
|
18938
|
+
}
|
|
18939
|
+
const { readConfiguration } = await import("@angular/compiler-cli");
|
|
18940
|
+
const config = readConfiguration("./tsconfig.json");
|
|
18941
|
+
ANGULAR_COMPILER_OPTIONS_CACHE.value = config.options;
|
|
18942
|
+
return config.options;
|
|
18943
|
+
}, cachedTsconfigMtime = 0, refreshAngularCompilerOptionsIfStale = async () => {
|
|
18944
|
+
const tsconfigPath = resolve32(process.cwd(), "tsconfig.json");
|
|
18945
|
+
if (!existsSync26(tsconfigPath))
|
|
18946
|
+
return;
|
|
18947
|
+
const stat3 = await import("fs/promises").then((m) => m.stat(tsconfigPath));
|
|
18948
|
+
if (stat3.mtimeMs > cachedTsconfigMtime) {
|
|
18949
|
+
ANGULAR_COMPILER_OPTIONS_CACHE.value = null;
|
|
18950
|
+
cachedTsconfigMtime = stat3.mtimeMs;
|
|
18951
|
+
}
|
|
18952
|
+
}, compileAngularForHmr = async (inputPaths, outDir, modifiedResourceFiles = null) => {
|
|
18953
|
+
await refreshAngularCompilerOptionsIfStale();
|
|
18954
|
+
await import("@angular/compiler");
|
|
18955
|
+
const { performCompilation, EmitFlags } = await import("@angular/compiler-cli");
|
|
18956
|
+
const baseOptions = await loadAngularCompilerOptions();
|
|
18957
|
+
const options = buildHmrCompilerOptions(baseOptions);
|
|
18958
|
+
options.outDir = outDir;
|
|
18959
|
+
options.target = ts9.ScriptTarget.ES2022;
|
|
18960
|
+
options.experimentalDecorators = true;
|
|
18961
|
+
options.emitDecoratorMetadata = true;
|
|
18962
|
+
options.newLine = ts9.NewLineKind.LineFeed;
|
|
18963
|
+
options.incremental = false;
|
|
18964
|
+
options.tsBuildInfoFile = undefined;
|
|
18965
|
+
const tsLibDir = resolveTypescriptLibDir();
|
|
18966
|
+
const host = ts9.createCompilerHost(options);
|
|
18967
|
+
const originalGetDefaultLibLocation = host.getDefaultLibLocation;
|
|
18968
|
+
host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
18969
|
+
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
18970
|
+
host.getDefaultLibFileName = (opts) => {
|
|
18971
|
+
const fileName = originalGetDefaultLibFileName ? originalGetDefaultLibFileName(opts) : "lib.d.ts";
|
|
18972
|
+
return basename12(fileName);
|
|
18973
|
+
};
|
|
18974
|
+
const originalGetSourceFile = host.getSourceFile;
|
|
18975
|
+
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
18976
|
+
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
18977
|
+
return originalGetSourceFile?.call(host, join29(tsLibDir, fileName), languageVersion, onError);
|
|
18978
|
+
}
|
|
18979
|
+
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
18980
|
+
};
|
|
18981
|
+
const emitted = {};
|
|
18982
|
+
const resolvedOutDir = resolve32(outDir);
|
|
18983
|
+
host.writeFile = (fileName, text) => {
|
|
18984
|
+
const normalized = fileName.replace(/\\/g, "/");
|
|
18985
|
+
const rel = normalized.startsWith(resolvedOutDir.replace(/\\/g, "/")) ? relative14(resolvedOutDir, normalized).replace(/\\/g, "/") : relative14(process.cwd(), normalized).replace(/\\/g, "/");
|
|
18986
|
+
emitted[rel] = text;
|
|
18987
|
+
};
|
|
18988
|
+
const oldProgram = getCachedHmrProgram();
|
|
18989
|
+
const performArgs = {
|
|
18990
|
+
emitFlags: EmitFlags.Default,
|
|
18991
|
+
forceEmit: true,
|
|
18992
|
+
host,
|
|
18993
|
+
options,
|
|
18994
|
+
rootNames: inputPaths
|
|
18995
|
+
};
|
|
18996
|
+
if (modifiedResourceFiles && modifiedResourceFiles.size > 0) {
|
|
18997
|
+
performArgs.modifiedResourceFiles = new Set(modifiedResourceFiles);
|
|
18998
|
+
}
|
|
18999
|
+
if (oldProgram) {
|
|
19000
|
+
performArgs.oldProgram = oldProgram;
|
|
19001
|
+
}
|
|
19002
|
+
const compileResult = performCompilation(performArgs);
|
|
19003
|
+
const program = compileResult.program;
|
|
19004
|
+
if (program)
|
|
19005
|
+
setCachedHmrProgram(program);
|
|
19006
|
+
return {
|
|
19007
|
+
program,
|
|
19008
|
+
emitted,
|
|
19009
|
+
diagnostics: compileResult.diagnostics ?? []
|
|
19010
|
+
};
|
|
19011
|
+
}, findClassNodeById = (program, encodedId) => {
|
|
19012
|
+
const decoded = decodeURIComponent(encodedId);
|
|
19013
|
+
const at2 = decoded.lastIndexOf("@");
|
|
19014
|
+
if (at2 === -1)
|
|
19015
|
+
return null;
|
|
19016
|
+
const filePath = decoded.slice(0, at2);
|
|
19017
|
+
const className = decoded.slice(at2 + 1);
|
|
19018
|
+
const tsProgram = program.compiler.getCurrentProgram();
|
|
19019
|
+
const absoluteCandidate = resolve32(process.cwd(), filePath).replace(/\\/g, "/");
|
|
19020
|
+
const matchesPath = (sourceFileName) => {
|
|
19021
|
+
const normalized = sourceFileName.replace(/\\/g, "/");
|
|
19022
|
+
if (normalized === absoluteCandidate)
|
|
19023
|
+
return true;
|
|
19024
|
+
if (normalized === filePath)
|
|
19025
|
+
return true;
|
|
19026
|
+
return normalized.endsWith("/" + filePath) || normalized.endsWith(filePath);
|
|
19027
|
+
};
|
|
19028
|
+
let sourceFile = tsProgram.getSourceFile(absoluteCandidate) ?? null;
|
|
19029
|
+
if (!sourceFile) {
|
|
19030
|
+
for (const candidate of tsProgram.getSourceFiles()) {
|
|
19031
|
+
if (matchesPath(candidate.fileName)) {
|
|
19032
|
+
sourceFile = candidate;
|
|
19033
|
+
break;
|
|
19034
|
+
}
|
|
19035
|
+
}
|
|
19036
|
+
}
|
|
19037
|
+
if (!sourceFile)
|
|
19038
|
+
return null;
|
|
19039
|
+
let found = null;
|
|
19040
|
+
const walk = (node) => {
|
|
19041
|
+
if (found)
|
|
19042
|
+
return;
|
|
19043
|
+
if (ts9.isClassDeclaration(node) && node.name?.text === className) {
|
|
19044
|
+
found = node;
|
|
19045
|
+
return;
|
|
19046
|
+
}
|
|
19047
|
+
ts9.forEachChild(node, walk);
|
|
19048
|
+
};
|
|
19049
|
+
walk(sourceFile);
|
|
19050
|
+
return found;
|
|
19051
|
+
}, getApplyMetadataModule = async (encodedId) => {
|
|
19052
|
+
const decoded = decodeURIComponent(encodedId);
|
|
19053
|
+
const at2 = decoded.lastIndexOf("@");
|
|
19054
|
+
if (at2 === -1)
|
|
19055
|
+
return null;
|
|
19056
|
+
const filePathRel = decoded.slice(0, at2);
|
|
19057
|
+
const className = decoded.slice(at2 + 1);
|
|
19058
|
+
const componentFilePath = resolve32(process.cwd(), filePathRel);
|
|
19059
|
+
const fastStart = performance2.now();
|
|
19060
|
+
const fast = await tryFastHmr({ componentFilePath, className });
|
|
19061
|
+
if (fast.ok) {
|
|
19062
|
+
logInfo(`[ng-hmr fast] ${className} ${(performance2.now() - fastStart).toFixed(1)}ms`);
|
|
19063
|
+
return fast.moduleText;
|
|
19064
|
+
}
|
|
19065
|
+
logWarn(`[ng-hmr slow] ${className} fast path bailed (${fast.reason}${fast.detail ? `: ${fast.detail}` : ""}), falling back to ngtsc`);
|
|
19066
|
+
const program = getCachedHmrProgram();
|
|
19067
|
+
if (!program)
|
|
19068
|
+
return null;
|
|
19069
|
+
const node = findClassNodeById(program, encodedId);
|
|
19070
|
+
if (!node)
|
|
19071
|
+
return null;
|
|
19072
|
+
return program.compiler.emitHmrUpdateModule(node);
|
|
19073
|
+
}, encodeHmrComponentId = (absoluteFilePath, className) => {
|
|
19074
|
+
const projectRel = relative14(process.cwd(), absoluteFilePath).replace(/\\/g, "/");
|
|
19075
|
+
return encodeURIComponent(`${projectRel}@${className}`);
|
|
19076
|
+
};
|
|
19077
|
+
var init_hmrCompiler = __esm(() => {
|
|
19078
|
+
init_logger();
|
|
19079
|
+
init_fastHmrCompiler();
|
|
19080
|
+
globalCache = globalThis;
|
|
19081
|
+
ANGULAR_COMPILER_OPTIONS_CACHE = {
|
|
19082
|
+
value: null
|
|
19083
|
+
};
|
|
19084
|
+
});
|
|
19085
|
+
|
|
17492
19086
|
// src/utils/ssrErrorPage.ts
|
|
17493
19087
|
var ssrErrorPage = (framework, error) => {
|
|
17494
19088
|
const frameworkColors2 = {
|
|
@@ -17620,11 +19214,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
17620
19214
|
__export(exports_simpleHTMLHMR, {
|
|
17621
19215
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
17622
19216
|
});
|
|
17623
|
-
import { resolve as
|
|
19217
|
+
import { resolve as resolve33 } from "path";
|
|
17624
19218
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
17625
19219
|
let htmlContent;
|
|
17626
19220
|
try {
|
|
17627
|
-
const resolvedPath =
|
|
19221
|
+
const resolvedPath = resolve33(htmlFilePath);
|
|
17628
19222
|
const file4 = Bun.file(resolvedPath);
|
|
17629
19223
|
if (!await file4.exists()) {
|
|
17630
19224
|
return null;
|
|
@@ -17650,11 +19244,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
17650
19244
|
__export(exports_simpleHTMXHMR, {
|
|
17651
19245
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
17652
19246
|
});
|
|
17653
|
-
import { resolve as
|
|
19247
|
+
import { resolve as resolve34 } from "path";
|
|
17654
19248
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
17655
19249
|
let htmlContent;
|
|
17656
19250
|
try {
|
|
17657
|
-
const resolvedPath =
|
|
19251
|
+
const resolvedPath = resolve34(htmxFilePath);
|
|
17658
19252
|
const file4 = Bun.file(resolvedPath);
|
|
17659
19253
|
if (!await file4.exists()) {
|
|
17660
19254
|
return null;
|
|
@@ -17676,8 +19270,8 @@ var handleHTMXUpdate = async (htmxFilePath) => {
|
|
|
17676
19270
|
var init_simpleHTMXHMR = () => {};
|
|
17677
19271
|
|
|
17678
19272
|
// src/dev/rebuildTrigger.ts
|
|
17679
|
-
import { existsSync as
|
|
17680
|
-
import { basename as
|
|
19273
|
+
import { existsSync as existsSync27 } from "fs";
|
|
19274
|
+
import { basename as basename13, dirname as dirname20, relative as relative15, resolve as resolve35 } from "path";
|
|
17681
19275
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequentially = (items, action) => items.reduce((chain, item) => chain.then(() => action(item)), Promise.resolve()), getStyleTransformConfig = (config) => createStyleTransformConfig(config.stylePreprocessors, config.postcss), recompileTailwindForFastPath = async (state, config, files) => {
|
|
17682
19276
|
if (!config.tailwind)
|
|
17683
19277
|
return;
|
|
@@ -17765,11 +19359,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17765
19359
|
detectedFw = detected !== "ignored" ? detected : affectedFrameworks[0];
|
|
17766
19360
|
}
|
|
17767
19361
|
return { ...parsed, framework: detectedFw };
|
|
17768
|
-
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) &&
|
|
19362
|
+
}, isValidDeletedAffectedFile = (affectedFile, deletedPathResolved, processedFiles) => affectedFile !== deletedPathResolved && !processedFiles.has(affectedFile) && existsSync27(affectedFile), collectDeletedFileAffected = (state, filePathInSet, processedFiles, validFiles) => {
|
|
17769
19363
|
state.fileHashes.delete(filePathInSet);
|
|
17770
19364
|
try {
|
|
17771
19365
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
17772
|
-
const deletedPathResolved =
|
|
19366
|
+
const deletedPathResolved = resolve35(filePathInSet);
|
|
17773
19367
|
affectedFiles.forEach((affectedFile) => {
|
|
17774
19368
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
17775
19369
|
validFiles.push(affectedFile);
|
|
@@ -17783,7 +19377,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17783
19377
|
if (!dependents || dependents.size === 0) {
|
|
17784
19378
|
return;
|
|
17785
19379
|
}
|
|
17786
|
-
const dependentFiles = Array.from(dependents).filter((file4) =>
|
|
19380
|
+
const dependentFiles = Array.from(dependents).filter((file4) => existsSync27(file4));
|
|
17787
19381
|
if (dependentFiles.length === 0) {
|
|
17788
19382
|
return;
|
|
17789
19383
|
}
|
|
@@ -17799,7 +19393,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17799
19393
|
try {
|
|
17800
19394
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, normalizedFilePath);
|
|
17801
19395
|
affectedFiles.forEach((affectedFile) => {
|
|
17802
|
-
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath &&
|
|
19396
|
+
if (!processedFiles.has(affectedFile) && affectedFile !== normalizedFilePath && existsSync27(affectedFile)) {
|
|
17803
19397
|
validFiles.push(affectedFile);
|
|
17804
19398
|
processedFiles.add(affectedFile);
|
|
17805
19399
|
}
|
|
@@ -17813,7 +19407,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17813
19407
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
17814
19408
|
return;
|
|
17815
19409
|
}
|
|
17816
|
-
const normalizedFilePath =
|
|
19410
|
+
const normalizedFilePath = resolve35(filePathInSet);
|
|
17817
19411
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
17818
19412
|
validFiles.push(normalizedFilePath);
|
|
17819
19413
|
processedFiles.add(normalizedFilePath);
|
|
@@ -17824,7 +19418,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17824
19418
|
collectChangedFileAffected(state, normalizedFilePath, processedFiles, validFiles);
|
|
17825
19419
|
}, processFilePathSet = (state, filePathSet, processedFiles, validFiles) => {
|
|
17826
19420
|
filePathSet.forEach((filePathInSet) => {
|
|
17827
|
-
if (!
|
|
19421
|
+
if (!existsSync27(filePathInSet)) {
|
|
17828
19422
|
collectDeletedFileAffected(state, filePathInSet, processedFiles, validFiles);
|
|
17829
19423
|
return;
|
|
17830
19424
|
}
|
|
@@ -17917,8 +19511,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17917
19511
|
return;
|
|
17918
19512
|
}
|
|
17919
19513
|
if (framework === "unknown") {
|
|
17920
|
-
invalidate(
|
|
17921
|
-
const relPath =
|
|
19514
|
+
invalidate(resolve35(filePath));
|
|
19515
|
+
const relPath = relative15(process.cwd(), filePath);
|
|
17922
19516
|
logHmrUpdate(relPath);
|
|
17923
19517
|
return;
|
|
17924
19518
|
}
|
|
@@ -17944,7 +19538,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17944
19538
|
const userEditedFiles = new Set;
|
|
17945
19539
|
state.fileChangeQueue.forEach((filePaths) => {
|
|
17946
19540
|
for (const filePath2 of filePaths) {
|
|
17947
|
-
userEditedFiles.add(
|
|
19541
|
+
userEditedFiles.add(resolve35(filePath2));
|
|
17948
19542
|
}
|
|
17949
19543
|
});
|
|
17950
19544
|
state.lastUserEditedFiles = userEditedFiles;
|
|
@@ -17968,12 +19562,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17968
19562
|
return componentFile;
|
|
17969
19563
|
}
|
|
17970
19564
|
const tsCounterpart = componentFile.replace(/\.html$/, ".ts");
|
|
17971
|
-
if (
|
|
19565
|
+
if (existsSync27(tsCounterpart)) {
|
|
17972
19566
|
return tsCounterpart;
|
|
17973
19567
|
}
|
|
17974
19568
|
if (!graph)
|
|
17975
19569
|
return componentFile;
|
|
17976
|
-
const dependents = graph.dependents.get(
|
|
19570
|
+
const dependents = graph.dependents.get(resolve35(componentFile));
|
|
17977
19571
|
if (!dependents)
|
|
17978
19572
|
return componentFile;
|
|
17979
19573
|
for (const dep of dependents) {
|
|
@@ -17982,7 +19576,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17982
19576
|
}
|
|
17983
19577
|
return componentFile;
|
|
17984
19578
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
17985
|
-
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") &&
|
|
19579
|
+
const pageEntries = angularFiles.filter((file4) => file4.endsWith(".ts") && resolve35(file4).startsWith(angularPagesPath));
|
|
17986
19580
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
17987
19581
|
return pageEntries;
|
|
17988
19582
|
}
|
|
@@ -17991,7 +19585,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
17991
19585
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
17992
19586
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
17993
19587
|
affected.forEach((file4) => {
|
|
17994
|
-
if (file4.endsWith(".ts") &&
|
|
19588
|
+
if (file4.endsWith(".ts") && resolve35(file4).startsWith(angularPagesPath)) {
|
|
17995
19589
|
resolvedPages.add(file4);
|
|
17996
19590
|
}
|
|
17997
19591
|
});
|
|
@@ -18010,18 +19604,21 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18010
19604
|
const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
|
|
18011
19605
|
return clientRoots.length === 1 ? clientRoots[0] ?? projectRoot : commonAncestor2(clientRoots, projectRoot);
|
|
18012
19606
|
}, updateServerManifestEntry = (state, artifact) => {
|
|
18013
|
-
const fileWithHash =
|
|
19607
|
+
const fileWithHash = basename13(artifact.path);
|
|
18014
19608
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
18015
19609
|
if (!baseName) {
|
|
18016
19610
|
return;
|
|
18017
19611
|
}
|
|
18018
19612
|
state.manifest[toPascal(baseName)] = artifact.path;
|
|
18019
|
-
}, bundleAngularClient = async (state, clientPaths, buildDir) => {
|
|
19613
|
+
}, bundleAngularClient = async (state, clientPaths, buildDir, userAngularRoot) => {
|
|
18020
19614
|
const { build: bunBuild9 } = await Promise.resolve(globalThis.Bun);
|
|
18021
19615
|
const { generateManifest: generateManifest2 } = await Promise.resolve().then(() => (init_generateManifest(), exports_generateManifest));
|
|
18022
19616
|
const { getAngularVendorPaths: getAngularVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
19617
|
+
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
19618
|
+
const { createAngularHmrInjectionPlugin: createAngularHmrInjectionPlugin2 } = await Promise.resolve().then(() => (init_hmrInjectionPlugin(), exports_hmrInjectionPlugin));
|
|
18023
19619
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
18024
19620
|
const depVendorPaths = globalThis.__depVendorPaths ?? {};
|
|
19621
|
+
const generatedAngularRoot = getFrameworkGeneratedDir2("angular");
|
|
18025
19622
|
let angVendorPaths = getAngularVendorPaths2();
|
|
18026
19623
|
if (!angVendorPaths) {
|
|
18027
19624
|
const { computeAngularVendorPaths: computeAngularVendorPaths2 } = await Promise.resolve().then(() => (init_buildAngularVendor(), exports_buildAngularVendor));
|
|
@@ -18044,7 +19641,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18044
19641
|
naming: "[dir]/[name].[hash].[ext]",
|
|
18045
19642
|
outdir: buildDir,
|
|
18046
19643
|
plugins: [
|
|
18047
|
-
createStylePreprocessorPlugin(getStyleTransformConfig(state.config))
|
|
19644
|
+
createStylePreprocessorPlugin(getStyleTransformConfig(state.config)),
|
|
19645
|
+
createAngularHmrInjectionPlugin2({
|
|
19646
|
+
generatedAngularRoot,
|
|
19647
|
+
userAngularRoot,
|
|
19648
|
+
projectRoot: process.cwd()
|
|
19649
|
+
})
|
|
18048
19650
|
],
|
|
18049
19651
|
root: clientRoot,
|
|
18050
19652
|
target: "browser",
|
|
@@ -18066,11 +19668,36 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18066
19668
|
}, filterToUserEdits = (candidates, userEditedFiles) => {
|
|
18067
19669
|
if (!userEditedFiles || userEditedFiles.size === 0)
|
|
18068
19670
|
return candidates;
|
|
18069
|
-
const filtered = candidates.filter((file4) => userEditedFiles.has(
|
|
19671
|
+
const filtered = candidates.filter((file4) => userEditedFiles.has(resolve35(file4)));
|
|
18070
19672
|
return filtered.length > 0 ? filtered : candidates;
|
|
19673
|
+
}, broadcastAngularComponentUpdates = async (state, angularDir) => {
|
|
19674
|
+
const userEdited = state.lastUserEditedFiles ?? new Set;
|
|
19675
|
+
if (userEdited.size === 0)
|
|
19676
|
+
return;
|
|
19677
|
+
const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
|
|
19678
|
+
const { encodeHmrComponentId: encodeHmrComponentId2 } = await Promise.resolve().then(() => (init_hmrCompiler(), exports_hmrCompiler));
|
|
19679
|
+
const broadcastedIds = new Set;
|
|
19680
|
+
const broadcastTimestamp = Date.now();
|
|
19681
|
+
for (const editedFile of userEdited) {
|
|
19682
|
+
const owners = resolveOwningComponents2({
|
|
19683
|
+
changedFilePath: editedFile,
|
|
19684
|
+
userAngularRoot: angularDir
|
|
19685
|
+
});
|
|
19686
|
+
for (const { componentFilePath, className } of owners) {
|
|
19687
|
+
const id = encodeHmrComponentId2(componentFilePath, className);
|
|
19688
|
+
if (broadcastedIds.has(id))
|
|
19689
|
+
continue;
|
|
19690
|
+
broadcastedIds.add(id);
|
|
19691
|
+
broadcastToClients(state, {
|
|
19692
|
+
data: { id, timestamp: broadcastTimestamp },
|
|
19693
|
+
type: "angular:component-update"
|
|
19694
|
+
});
|
|
19695
|
+
logInfo(`[ng-hmr broadcast] ${className}`);
|
|
19696
|
+
}
|
|
19697
|
+
}
|
|
18071
19698
|
}, broadcastAngularPageUpdates = (state, pagesToUpdate, manifest, startTime, classification) => {
|
|
18072
19699
|
pagesToUpdate.forEach((angularPagePath) => {
|
|
18073
|
-
const fileName =
|
|
19700
|
+
const fileName = basename13(angularPagePath);
|
|
18074
19701
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
18075
19702
|
const pascalName = toPascal(baseName);
|
|
18076
19703
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -18094,6 +19721,12 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18094
19721
|
}, compileAndBundleAngular = async (state, pageEntries, angularDir) => {
|
|
18095
19722
|
const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
18096
19723
|
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, getStyleTransformConfig(state.config));
|
|
19724
|
+
try {
|
|
19725
|
+
const { compileAngularForHmr: compileAngularForHmr2 } = await Promise.resolve().then(() => (init_hmrCompiler(), exports_hmrCompiler));
|
|
19726
|
+
await compileAngularForHmr2(pageEntries, state.resolvedPaths.buildDir, state.lastUserEditedFiles ?? null);
|
|
19727
|
+
} catch (err) {
|
|
19728
|
+
logWarn(`[hmr] surgical-HMR shadow compile skipped: ${err instanceof Error ? err.message : String(err)}`);
|
|
19729
|
+
}
|
|
18097
19730
|
const { getAngularServerVendorPaths: getAngularServerVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
18098
19731
|
const angServerVendorPaths = getAngularServerVendorPaths2();
|
|
18099
19732
|
const ssrPaths = angServerVendorPaths ? serverPaths.map((serverPath) => serverPath.replace(/\.js$/, ".ssr.js")) : serverPaths;
|
|
@@ -18109,20 +19742,20 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18109
19742
|
await rewriteImports3(ssrPaths, angServerVendorPaths);
|
|
18110
19743
|
}
|
|
18111
19744
|
serverPaths.forEach((serverPath, idx) => {
|
|
18112
|
-
const fileBase =
|
|
19745
|
+
const fileBase = basename13(serverPath, ".js");
|
|
18113
19746
|
const ssrPath = ssrPaths[idx] ?? serverPath;
|
|
18114
|
-
state.manifest[toPascal(fileBase)] =
|
|
19747
|
+
state.manifest[toPascal(fileBase)] = resolve35(ssrPath);
|
|
18115
19748
|
});
|
|
18116
19749
|
if (clientPaths.length > 0) {
|
|
18117
|
-
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
|
|
19750
|
+
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir, angularDir);
|
|
18118
19751
|
}
|
|
18119
19752
|
}, handleAngularFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
18120
19753
|
const angularDir = config.angularDirectory ?? "";
|
|
18121
19754
|
const angularFiles = filesToRebuild.filter((file4) => detectFramework(file4, state.resolvedPaths) === "angular");
|
|
18122
19755
|
for (const file4 of angularFiles) {
|
|
18123
|
-
state.fileHashes.set(
|
|
19756
|
+
state.fileHashes.set(resolve35(file4), computeFileHash(file4));
|
|
18124
19757
|
}
|
|
18125
|
-
const angularPagesPath =
|
|
19758
|
+
const angularPagesPath = resolve35(angularDir, "pages");
|
|
18126
19759
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
18127
19760
|
if (pageEntries.length > 0) {
|
|
18128
19761
|
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
@@ -18135,12 +19768,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18135
19768
|
const filesToClassify = filterToUserEdits(angularFiles, state.lastUserEditedFiles);
|
|
18136
19769
|
const classification = collapseClassifications(filesToClassify.map(classifyAngularEdit));
|
|
18137
19770
|
broadcastAngularPageUpdates(state, pagesToUpdate, manifest, startTime, classification);
|
|
19771
|
+
await broadcastAngularComponentUpdates(state, angularDir);
|
|
18138
19772
|
onRebuildComplete({ hmrState: state, manifest });
|
|
18139
19773
|
return manifest;
|
|
18140
19774
|
}, getModuleUrl = async (pageFile) => {
|
|
18141
19775
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
18142
19776
|
invalidateModule2(pageFile);
|
|
18143
|
-
const rel =
|
|
19777
|
+
const rel = relative15(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
18144
19778
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
18145
19779
|
warmCache2(url);
|
|
18146
19780
|
return url;
|
|
@@ -18149,11 +19783,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18149
19783
|
if (isComponentFile2)
|
|
18150
19784
|
return primaryFile;
|
|
18151
19785
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
18152
|
-
const nearest = findNearestComponent2(
|
|
19786
|
+
const nearest = findNearestComponent2(resolve35(primaryFile));
|
|
18153
19787
|
return nearest ?? primaryFile;
|
|
18154
19788
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
18155
19789
|
for (const file4 of reactFiles) {
|
|
18156
|
-
state.fileHashes.set(
|
|
19790
|
+
state.fileHashes.set(resolve35(file4), computeFileHash(file4));
|
|
18157
19791
|
}
|
|
18158
19792
|
markSsrCacheDirty("react");
|
|
18159
19793
|
const primaryFile = reactFiles.find((file4) => !file4.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
@@ -18172,7 +19806,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18172
19806
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
18173
19807
|
if (pageModuleUrl) {
|
|
18174
19808
|
const serverDuration = Date.now() - startTime;
|
|
18175
|
-
state.lastHmrPath =
|
|
19809
|
+
state.lastHmrPath = relative15(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
18176
19810
|
state.lastHmrFramework = "react";
|
|
18177
19811
|
broadcastToClients(state, {
|
|
18178
19812
|
data: {
|
|
@@ -18235,7 +19869,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18235
19869
|
});
|
|
18236
19870
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
18237
19871
|
for (const file4 of svelteFiles) {
|
|
18238
|
-
state.fileHashes.set(
|
|
19872
|
+
state.fileHashes.set(resolve35(file4), computeFileHash(file4));
|
|
18239
19873
|
}
|
|
18240
19874
|
markSsrCacheDirty("svelte");
|
|
18241
19875
|
const serverDuration = Date.now() - startTime;
|
|
@@ -18260,8 +19894,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18260
19894
|
const serverEntries = [...svelteServerPaths];
|
|
18261
19895
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
18262
19896
|
const { getFrameworkGeneratedDir: getFrameworkGeneratedDir2 } = await Promise.resolve().then(() => (init_generatedDir(), exports_generatedDir));
|
|
18263
|
-
const serverRoot =
|
|
18264
|
-
const serverOutDir =
|
|
19897
|
+
const serverRoot = resolve35(getFrameworkGeneratedDir2("svelte"), "server");
|
|
19898
|
+
const serverOutDir = resolve35(buildDir, basename13(svelteDir));
|
|
18265
19899
|
const [serverResult, clientResult] = await Promise.all([
|
|
18266
19900
|
serverEntries.length > 0 ? bunBuild9({
|
|
18267
19901
|
entrypoints: serverEntries,
|
|
@@ -18303,7 +19937,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18303
19937
|
const duration = Date.now() - startTime;
|
|
18304
19938
|
const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
|
|
18305
19939
|
broadcastFiles.forEach((sveltePagePath) => {
|
|
18306
|
-
const fileName =
|
|
19940
|
+
const fileName = basename13(sveltePagePath);
|
|
18307
19941
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
18308
19942
|
const pascalName = toPascal(baseName);
|
|
18309
19943
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -18358,7 +19992,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18358
19992
|
});
|
|
18359
19993
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
18360
19994
|
for (const file4 of [...vueFiles, ...nonVueFiles]) {
|
|
18361
|
-
state.fileHashes.set(
|
|
19995
|
+
state.fileHashes.set(resolve35(file4), computeFileHash(file4));
|
|
18362
19996
|
}
|
|
18363
19997
|
markSsrCacheDirty("vue");
|
|
18364
19998
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -18386,7 +20020,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18386
20020
|
recursive: true,
|
|
18387
20021
|
withFileTypes: true
|
|
18388
20022
|
});
|
|
18389
|
-
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) =>
|
|
20023
|
+
return entries.filter((entry) => entry.isFile() && EMBER_PAGE_EXTENSIONS.some((ext) => entry.name.endsWith(ext))).map((entry) => resolve35(emberPagesPath, entry.name));
|
|
18390
20024
|
} catch {
|
|
18391
20025
|
return [];
|
|
18392
20026
|
}
|
|
@@ -18398,10 +20032,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18398
20032
|
return state.manifest;
|
|
18399
20033
|
}
|
|
18400
20034
|
for (const file4 of emberFiles) {
|
|
18401
|
-
state.fileHashes.set(
|
|
20035
|
+
state.fileHashes.set(resolve35(file4), computeFileHash(file4));
|
|
18402
20036
|
}
|
|
18403
|
-
const emberPagesPath =
|
|
18404
|
-
const directPageEntries = emberFiles.filter((file4) =>
|
|
20037
|
+
const emberPagesPath = resolve35(emberDir, "pages");
|
|
20038
|
+
const directPageEntries = emberFiles.filter((file4) => resolve35(file4).startsWith(emberPagesPath));
|
|
18405
20039
|
const allPageEntries = directPageEntries.length > 0 ? directPageEntries : await collectAllEmberPages(emberPagesPath);
|
|
18406
20040
|
if (allPageEntries.length === 0) {
|
|
18407
20041
|
onRebuildComplete({ hmrState: state, manifest: state.manifest });
|
|
@@ -18410,15 +20044,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18410
20044
|
const { compileEmber: compileEmber2 } = await Promise.resolve().then(() => (init_compileEmber(), exports_compileEmber));
|
|
18411
20045
|
const { serverPaths } = await compileEmber2(allPageEntries, emberDir, process.cwd(), true);
|
|
18412
20046
|
for (const serverPath of serverPaths) {
|
|
18413
|
-
const fileBase =
|
|
18414
|
-
state.manifest[toPascal(fileBase)] =
|
|
20047
|
+
const fileBase = basename13(serverPath, ".js");
|
|
20048
|
+
state.manifest[toPascal(fileBase)] = resolve35(serverPath);
|
|
18415
20049
|
}
|
|
18416
20050
|
const { invalidateEmberSsrCache: invalidateEmberSsrCache2 } = await Promise.resolve().then(() => (init_ember(), exports_ember));
|
|
18417
20051
|
invalidateEmberSsrCache2();
|
|
18418
20052
|
const duration = Date.now() - startTime;
|
|
18419
20053
|
const [primary] = emberFiles;
|
|
18420
20054
|
if (primary) {
|
|
18421
|
-
state.lastHmrPath =
|
|
20055
|
+
state.lastHmrPath = relative15(process.cwd(), primary).replace(/\\/g, "/");
|
|
18422
20056
|
state.lastHmrFramework = "ember";
|
|
18423
20057
|
logHmrUpdate(primary, "ember", duration);
|
|
18424
20058
|
}
|
|
@@ -18481,7 +20115,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18481
20115
|
});
|
|
18482
20116
|
}
|
|
18483
20117
|
}, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
|
|
18484
|
-
const scriptBaseName =
|
|
20118
|
+
const scriptBaseName = basename13(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
|
|
18485
20119
|
const pascalName = toPascal(scriptBaseName);
|
|
18486
20120
|
const scriptPath = manifest[pascalName] || null;
|
|
18487
20121
|
if (!scriptPath) {
|
|
@@ -18503,8 +20137,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18503
20137
|
if (!buildReference?.source) {
|
|
18504
20138
|
return;
|
|
18505
20139
|
}
|
|
18506
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname :
|
|
18507
|
-
islandFiles.add(
|
|
20140
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve35(dirname20(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
20141
|
+
islandFiles.add(resolve35(sourcePath));
|
|
18508
20142
|
}, resolveIslandSourceFiles = async (config) => {
|
|
18509
20143
|
const registryPath = config.islands?.registry;
|
|
18510
20144
|
if (!registryPath) {
|
|
@@ -18512,7 +20146,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18512
20146
|
}
|
|
18513
20147
|
const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
|
|
18514
20148
|
const islandFiles = new Set([
|
|
18515
|
-
|
|
20149
|
+
resolve35(buildInfo.resolvedRegistryPath)
|
|
18516
20150
|
]);
|
|
18517
20151
|
for (const definition of buildInfo.definitions) {
|
|
18518
20152
|
resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
|
|
@@ -18523,7 +20157,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18523
20157
|
if (islandFiles.size === 0) {
|
|
18524
20158
|
return false;
|
|
18525
20159
|
}
|
|
18526
|
-
return filesToRebuild.some((file4) => islandFiles.has(
|
|
20160
|
+
return filesToRebuild.some((file4) => islandFiles.has(resolve35(file4)));
|
|
18527
20161
|
}, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
|
|
18528
20162
|
const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
|
|
18529
20163
|
if (!shouldReload) {
|
|
@@ -18558,10 +20192,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18558
20192
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
18559
20193
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
18560
20194
|
if (isSingle) {
|
|
18561
|
-
return
|
|
20195
|
+
return resolve35(state.resolvedPaths.buildDir, "pages");
|
|
18562
20196
|
}
|
|
18563
|
-
const dirName = framework === "html" ?
|
|
18564
|
-
return
|
|
20197
|
+
const dirName = framework === "html" ? basename13(config.htmlDirectory ?? "html") : basename13(config.htmxDirectory ?? "htmx");
|
|
20198
|
+
return resolve35(state.resolvedPaths.buildDir, dirName, "pages");
|
|
18565
20199
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
18566
20200
|
try {
|
|
18567
20201
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -18599,8 +20233,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18599
20233
|
const shouldRefreshAllPages = htmlPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
18600
20234
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
|
|
18601
20235
|
await runSequentially(pageFilesToUpdate, async (pageFile) => {
|
|
18602
|
-
const htmlPageName =
|
|
18603
|
-
const builtHtmlPagePath =
|
|
20236
|
+
const htmlPageName = basename13(pageFile);
|
|
20237
|
+
const builtHtmlPagePath = resolve35(outputHtmlPages, htmlPageName);
|
|
18604
20238
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
18605
20239
|
});
|
|
18606
20240
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -18608,7 +20242,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18608
20242
|
if (!cssFile) {
|
|
18609
20243
|
return;
|
|
18610
20244
|
}
|
|
18611
|
-
const cssBaseName =
|
|
20245
|
+
const cssBaseName = basename13(getStyleBaseName(cssFile));
|
|
18612
20246
|
const cssPascalName = toPascal(cssBaseName);
|
|
18613
20247
|
const cssKey = `${cssPascalName}CSS`;
|
|
18614
20248
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -18657,15 +20291,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18657
20291
|
type: "vue-update"
|
|
18658
20292
|
});
|
|
18659
20293
|
}, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
|
|
18660
|
-
const fileName =
|
|
20294
|
+
const fileName = basename13(vuePagePath);
|
|
18661
20295
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
18662
20296
|
const pascalName = toPascal(baseName);
|
|
18663
20297
|
const vueRoot = config.vueDirectory;
|
|
18664
|
-
const hmrId = vueRoot ?
|
|
20298
|
+
const hmrId = vueRoot ? relative15(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
18665
20299
|
const cssKey = `${pascalName}CSS`;
|
|
18666
20300
|
const cssUrl = manifest[cssKey] || null;
|
|
18667
20301
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
18668
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
20302
|
+
const hmrMeta = vueHmrMetadata2.get(resolve35(vuePagePath));
|
|
18669
20303
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
18670
20304
|
if (changeType === "style-only") {
|
|
18671
20305
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -18703,7 +20337,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18703
20337
|
if (!cssFile) {
|
|
18704
20338
|
return;
|
|
18705
20339
|
}
|
|
18706
|
-
const cssBaseName =
|
|
20340
|
+
const cssBaseName = basename13(getStyleBaseName(cssFile));
|
|
18707
20341
|
const cssPascalName = toPascal(cssBaseName);
|
|
18708
20342
|
const cssKey = `${cssPascalName}CSS`;
|
|
18709
20343
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -18721,7 +20355,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18721
20355
|
});
|
|
18722
20356
|
}, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
|
|
18723
20357
|
try {
|
|
18724
|
-
const fileName =
|
|
20358
|
+
const fileName = basename13(sveltePagePath);
|
|
18725
20359
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
18726
20360
|
const pascalName = toPascal(baseName);
|
|
18727
20361
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -18783,7 +20417,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18783
20417
|
if (!cssFile) {
|
|
18784
20418
|
return;
|
|
18785
20419
|
}
|
|
18786
|
-
const cssBaseName =
|
|
20420
|
+
const cssBaseName = basename13(getStyleBaseName(cssFile));
|
|
18787
20421
|
const cssPascalName = toPascal(cssBaseName);
|
|
18788
20422
|
const cssKey = `${cssPascalName}CSS`;
|
|
18789
20423
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -18801,7 +20435,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18801
20435
|
});
|
|
18802
20436
|
}, broadcastAngularPageHmrUpdate = (state, angularPagePath, manifest, duration, classification) => {
|
|
18803
20437
|
try {
|
|
18804
|
-
const fileName =
|
|
20438
|
+
const fileName = basename13(angularPagePath);
|
|
18805
20439
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
18806
20440
|
const pascalName = toPascal(baseName);
|
|
18807
20441
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -18834,6 +20468,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18834
20468
|
if (angularFiles.length === 0) {
|
|
18835
20469
|
return;
|
|
18836
20470
|
}
|
|
20471
|
+
broadcastAngularComponentUpdates(state, config.angularDirectory);
|
|
18837
20472
|
const angularCssFiles = angularFiles.filter(isStylePath);
|
|
18838
20473
|
const isCssOnlyChange = angularFiles.every(isStylePath) && angularCssFiles.length > 0;
|
|
18839
20474
|
const angularPageFiles = angularFiles.filter((file4) => file4.replace(/\\/g, "/").includes("/pages/"));
|
|
@@ -18903,8 +20538,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
18903
20538
|
const shouldRefreshAllPages = htmxPageFiles.length === 0 && shouldRefreshFromIslandChange;
|
|
18904
20539
|
const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
|
|
18905
20540
|
await runSequentially(pageFilesToUpdate, async (htmxPageFile) => {
|
|
18906
|
-
const htmxPageName =
|
|
18907
|
-
const builtHtmxPagePath =
|
|
20541
|
+
const htmxPageName = basename13(htmxPageFile);
|
|
20542
|
+
const builtHtmxPagePath = resolve35(outputHtmxPages, htmxPageName);
|
|
18908
20543
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
18909
20544
|
});
|
|
18910
20545
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -19013,7 +20648,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
19013
20648
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
19014
20649
|
writeFs(destPath, html);
|
|
19015
20650
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
19016
|
-
const destPath =
|
|
20651
|
+
const destPath = resolve35(outputDir, basename13(sourceFile));
|
|
19017
20652
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
19018
20653
|
const source = await Bun.file(sourceFile).text();
|
|
19019
20654
|
await Bun.write(destPath, source);
|
|
@@ -19293,7 +20928,7 @@ __export(exports_buildDepVendor, {
|
|
|
19293
20928
|
buildDepVendor: () => buildDepVendor
|
|
19294
20929
|
});
|
|
19295
20930
|
import { mkdirSync as mkdirSync13 } from "fs";
|
|
19296
|
-
import { join as
|
|
20931
|
+
import { join as join30 } from "path";
|
|
19297
20932
|
import { rm as rm10 } from "fs/promises";
|
|
19298
20933
|
var {build: bunBuild9, Glob: Glob9 } = globalThis.Bun;
|
|
19299
20934
|
var toSafeFileName6 = (specifier) => {
|
|
@@ -19347,7 +20982,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
19347
20982
|
framework: Array.from(framework).filter(isResolvable4)
|
|
19348
20983
|
};
|
|
19349
20984
|
}, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
|
|
19350
|
-
const { readFileSync:
|
|
20985
|
+
const { readFileSync: readFileSync21 } = await import("fs");
|
|
19351
20986
|
const transpiler5 = new Bun.Transpiler({ loader: "js" });
|
|
19352
20987
|
const newSpecs = new Set;
|
|
19353
20988
|
for (const spec of specs) {
|
|
@@ -19362,7 +20997,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
19362
20997
|
}
|
|
19363
20998
|
let content;
|
|
19364
20999
|
try {
|
|
19365
|
-
content =
|
|
21000
|
+
content = readFileSync21(resolved, "utf-8");
|
|
19366
21001
|
} catch {
|
|
19367
21002
|
continue;
|
|
19368
21003
|
}
|
|
@@ -19404,7 +21039,7 @@ var toSafeFileName6 = (specifier) => {
|
|
|
19404
21039
|
}), buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
19405
21040
|
const entries = await Promise.all(specifiers.map(async (specifier) => {
|
|
19406
21041
|
const safeName = toSafeFileName6(specifier);
|
|
19407
|
-
const entryPath =
|
|
21042
|
+
const entryPath = join30(tmpDir, `${safeName}.ts`);
|
|
19408
21043
|
await Bun.write(entryPath, await generateVendorEntrySource(specifier));
|
|
19409
21044
|
return { entryPath, specifier };
|
|
19410
21045
|
}));
|
|
@@ -19465,9 +21100,9 @@ var toSafeFileName6 = (specifier) => {
|
|
|
19465
21100
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
19466
21101
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
19467
21102
|
return {};
|
|
19468
|
-
const vendorDir =
|
|
21103
|
+
const vendorDir = join30(buildDir, "vendor");
|
|
19469
21104
|
mkdirSync13(vendorDir, { recursive: true });
|
|
19470
|
-
const tmpDir =
|
|
21105
|
+
const tmpDir = join30(buildDir, "_dep_vendor_tmp");
|
|
19471
21106
|
mkdirSync13(tmpDir, { recursive: true });
|
|
19472
21107
|
const allSpecs = new Set(initialSpecs);
|
|
19473
21108
|
const alreadyScanned = new Set;
|
|
@@ -19549,8 +21184,8 @@ __export(exports_devBuild, {
|
|
|
19549
21184
|
devBuild: () => devBuild
|
|
19550
21185
|
});
|
|
19551
21186
|
import { readdir as readdir5 } from "fs/promises";
|
|
19552
|
-
import { statSync as
|
|
19553
|
-
import { resolve as
|
|
21187
|
+
import { statSync as statSync4 } from "fs";
|
|
21188
|
+
import { resolve as resolve36 } from "path";
|
|
19554
21189
|
var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
19555
21190
|
const configuredDirs = [
|
|
19556
21191
|
config.reactDirectory,
|
|
@@ -19573,7 +21208,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
19573
21208
|
return Object.keys(config).length > 0 ? config : null;
|
|
19574
21209
|
}, reloadConfig = async () => {
|
|
19575
21210
|
try {
|
|
19576
|
-
const configPath2 =
|
|
21211
|
+
const configPath2 = resolve36(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
19577
21212
|
const source = await Bun.file(configPath2).text();
|
|
19578
21213
|
return parseDirectoryConfig(source);
|
|
19579
21214
|
} catch {
|
|
@@ -19658,7 +21293,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
19658
21293
|
state.fileChangeQueue.clear();
|
|
19659
21294
|
}
|
|
19660
21295
|
}, handleCachedReload = async () => {
|
|
19661
|
-
const serverMtime =
|
|
21296
|
+
const serverMtime = statSync4(resolve36(Bun.main)).mtimeMs;
|
|
19662
21297
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
19663
21298
|
globalThis.__hmrServerMtime = serverMtime;
|
|
19664
21299
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -19695,8 +21330,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
19695
21330
|
return true;
|
|
19696
21331
|
}, resolveAbsoluteVersion2 = async () => {
|
|
19697
21332
|
const candidates = [
|
|
19698
|
-
|
|
19699
|
-
|
|
21333
|
+
resolve36(import.meta.dir, "..", "..", "package.json"),
|
|
21334
|
+
resolve36(import.meta.dir, "..", "package.json")
|
|
19700
21335
|
];
|
|
19701
21336
|
const [candidate, ...remaining] = candidates;
|
|
19702
21337
|
if (!candidate) {
|
|
@@ -19722,7 +21357,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
19722
21357
|
const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
|
|
19723
21358
|
await Promise.all(entries.filter((entry) => entry.endsWith(".js")).map(async (entry) => {
|
|
19724
21359
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
19725
|
-
const bytes = await Bun.file(
|
|
21360
|
+
const bytes = await Bun.file(resolve36(vendorDir, entry)).bytes();
|
|
19726
21361
|
assetStore.set(webPath, bytes);
|
|
19727
21362
|
}));
|
|
19728
21363
|
}, devBuild = async (config) => {
|
|
@@ -19790,11 +21425,11 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
19790
21425
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
19791
21426
|
recordStep("populate asset store", stepStartedAt);
|
|
19792
21427
|
stepStartedAt = performance.now();
|
|
19793
|
-
const reactVendorDir =
|
|
19794
|
-
const angularVendorDir =
|
|
19795
|
-
const svelteVendorDir =
|
|
19796
|
-
const vueVendorDir =
|
|
19797
|
-
const depVendorDir =
|
|
21428
|
+
const reactVendorDir = resolve36(state.resolvedPaths.buildDir, "react", "vendor");
|
|
21429
|
+
const angularVendorDir = resolve36(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
21430
|
+
const svelteVendorDir = resolve36(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
21431
|
+
const vueVendorDir = resolve36(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
21432
|
+
const depVendorDir = resolve36(state.resolvedPaths.buildDir, "vendor");
|
|
19798
21433
|
const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
|
|
19799
21434
|
const [, angularSpecs, , , , , depPaths] = await Promise.all([
|
|
19800
21435
|
config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir) : Promise.resolve(undefined),
|
|
@@ -19872,7 +21507,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
|
|
|
19872
21507
|
manifest
|
|
19873
21508
|
};
|
|
19874
21509
|
globalThis.__hmrDevResult = result;
|
|
19875
|
-
globalThis.__hmrServerMtime =
|
|
21510
|
+
globalThis.__hmrServerMtime = statSync4(resolve36(Bun.main)).mtimeMs;
|
|
19876
21511
|
return result;
|
|
19877
21512
|
};
|
|
19878
21513
|
var init_devBuild = __esm(() => {
|
|
@@ -19909,5 +21544,5 @@ export {
|
|
|
19909
21544
|
build
|
|
19910
21545
|
};
|
|
19911
21546
|
|
|
19912
|
-
//# debugId=
|
|
21547
|
+
//# debugId=694BCF01757C9B7164756E2164756E21
|
|
19913
21548
|
//# sourceMappingURL=build.js.map
|