@absolutejs/absolute 0.19.0-beta.809 → 0.19.0-beta.810
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/browser.js +1 -17
- package/dist/angular/browser.js.map +5 -6
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +1 -11
- package/dist/angular/index.js.map +4 -4
- package/dist/angular/server.js +1 -10
- package/dist/angular/server.js.map +5 -6
- package/dist/build.js +265 -216
- package/dist/build.js.map +6 -5
- package/dist/client/index.js +1 -4
- package/dist/client/index.js.map +3 -3
- package/dist/index.js +280 -231
- package/dist/index.js.map +6 -5
- package/dist/islands/index.js +1 -4
- package/dist/islands/index.js.map +3 -3
- package/dist/react/index.js +1 -4
- package/dist/react/index.js.map +3 -3
- package/dist/src/angular/browser.d.ts +0 -1
- package/dist/src/angular/index.d.ts +0 -1
- package/dist/src/angular/requestProviders.d.ts +0 -1
- package/dist/src/angular/server.d.ts +0 -1
- package/dist/src/core/build.d.ts +1 -1
- package/dist/src/utils/buildDirectoryLock.d.ts +5 -0
- package/dist/svelte/index.js +1 -4
- package/dist/svelte/index.js.map +3 -3
- package/dist/vue/index.js +1 -4
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -2056,13 +2056,11 @@ var ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER = "x-skip-transfer-cache", buildAbs
|
|
|
2056
2056
|
};
|
|
2057
2057
|
|
|
2058
2058
|
// src/angular/requestProviders.ts
|
|
2059
|
-
import { REQUEST, REQUEST_CONTEXT, RESPONSE_INIT } from "@angular/core";
|
|
2060
2059
|
var buildRequestProviders = (deps, request, requestContext, responseInit) => [
|
|
2061
2060
|
{ provide: deps.REQUEST, useValue: request ?? null },
|
|
2062
2061
|
{ provide: deps.REQUEST_CONTEXT, useValue: requestContext ?? null },
|
|
2063
2062
|
{ provide: deps.RESPONSE_INIT, useValue: responseInit ?? null }
|
|
2064
2063
|
];
|
|
2065
|
-
var init_requestProviders = () => {};
|
|
2066
2064
|
|
|
2067
2065
|
// src/angular/ssrRender.ts
|
|
2068
2066
|
var routePropsCache, cacheRouteData = (pagePath, data) => {
|
|
@@ -2148,7 +2146,6 @@ var routePropsCache, cacheRouteData = (pagePath, data) => {
|
|
|
2148
2146
|
};
|
|
2149
2147
|
var init_ssrRender = __esm(() => {
|
|
2150
2148
|
init_registerClientScript();
|
|
2151
|
-
init_requestProviders();
|
|
2152
2149
|
routePropsCache = new Map;
|
|
2153
2150
|
selectorCache = new Map;
|
|
2154
2151
|
});
|
|
@@ -9575,6 +9572,53 @@ var commonAncestor = (paths, fallback) => {
|
|
|
9575
9572
|
};
|
|
9576
9573
|
var init_commonAncestor = () => {};
|
|
9577
9574
|
|
|
9575
|
+
// src/utils/buildDirectoryLock.ts
|
|
9576
|
+
import { mkdir as mkdir3, rm as rm4, stat as stat2, writeFile as writeFile4 } from "fs/promises";
|
|
9577
|
+
import { dirname as dirname8, join as join13 } from "path";
|
|
9578
|
+
var DEFAULT_LOCK_TIMEOUT_MS = 120000, DEFAULT_STALE_LOCK_MS, LOCK_POLL_MS = 250, isAlreadyExistsError = (error) => error instanceof Error && ("code" in error) && error.code === "EEXIST", lockPathForBuildDirectory = (buildDirectory) => join13(dirname8(buildDirectory), `.${buildDirectory.split(/[\\/]/).pop()}.lock`), acquireBuildDirectoryLock = async (buildDirectory, options = {}) => {
|
|
9579
|
+
const lockPath = lockPathForBuildDirectory(buildDirectory);
|
|
9580
|
+
const staleLockMs = options.staleLockMs ?? DEFAULT_STALE_LOCK_MS;
|
|
9581
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS;
|
|
9582
|
+
const start = Date.now();
|
|
9583
|
+
while (true) {
|
|
9584
|
+
try {
|
|
9585
|
+
await mkdir3(lockPath);
|
|
9586
|
+
await writeFile4(join13(lockPath, "owner"), JSON.stringify({
|
|
9587
|
+
buildDirectory,
|
|
9588
|
+
createdAt: new Date().toISOString(),
|
|
9589
|
+
pid: process.pid
|
|
9590
|
+
}, null, 2));
|
|
9591
|
+
return async () => {
|
|
9592
|
+
await rm4(lockPath, { force: true, recursive: true }).catch(() => {});
|
|
9593
|
+
};
|
|
9594
|
+
} catch (error) {
|
|
9595
|
+
if (!isAlreadyExistsError(error))
|
|
9596
|
+
throw error;
|
|
9597
|
+
try {
|
|
9598
|
+
const lockStat = await stat2(lockPath);
|
|
9599
|
+
if (Date.now() - lockStat.mtimeMs > staleLockMs) {
|
|
9600
|
+
await rm4(lockPath, { force: true, recursive: true });
|
|
9601
|
+
continue;
|
|
9602
|
+
}
|
|
9603
|
+
} catch {}
|
|
9604
|
+
if (Date.now() - start > timeoutMs) {
|
|
9605
|
+
throw new Error(`Timed out waiting for AbsoluteJS build directory lock: ${buildDirectory}`);
|
|
9606
|
+
}
|
|
9607
|
+
await Bun.sleep(LOCK_POLL_MS);
|
|
9608
|
+
}
|
|
9609
|
+
}
|
|
9610
|
+
}, withBuildDirectoryLock = async (buildDirectory, action) => {
|
|
9611
|
+
const release = await acquireBuildDirectoryLock(buildDirectory);
|
|
9612
|
+
try {
|
|
9613
|
+
return await action();
|
|
9614
|
+
} finally {
|
|
9615
|
+
await release();
|
|
9616
|
+
}
|
|
9617
|
+
};
|
|
9618
|
+
var init_buildDirectoryLock = __esm(() => {
|
|
9619
|
+
DEFAULT_STALE_LOCK_MS = 10 * 60000;
|
|
9620
|
+
});
|
|
9621
|
+
|
|
9578
9622
|
// src/utils/validateSafePath.ts
|
|
9579
9623
|
import { resolve as resolve13, relative as relative6 } from "path";
|
|
9580
9624
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
@@ -9728,10 +9772,10 @@ __export(exports_compileSvelte, {
|
|
|
9728
9772
|
clearSvelteCompilerCache: () => clearSvelteCompilerCache
|
|
9729
9773
|
});
|
|
9730
9774
|
import { existsSync as existsSync14 } from "fs";
|
|
9731
|
-
import { mkdir as
|
|
9775
|
+
import { mkdir as mkdir4, stat as stat3 } from "fs/promises";
|
|
9732
9776
|
import {
|
|
9733
|
-
dirname as
|
|
9734
|
-
join as
|
|
9777
|
+
dirname as dirname9,
|
|
9778
|
+
join as join14,
|
|
9735
9779
|
basename as basename4,
|
|
9736
9780
|
extname as extname5,
|
|
9737
9781
|
resolve as resolve14,
|
|
@@ -9771,7 +9815,7 @@ var resolveDevClientDir2 = () => {
|
|
|
9771
9815
|
return /\b__require\b/.test(stripped) ? code : stripped;
|
|
9772
9816
|
}, exists = async (path) => {
|
|
9773
9817
|
try {
|
|
9774
|
-
await
|
|
9818
|
+
await stat3(path);
|
|
9775
9819
|
return true;
|
|
9776
9820
|
} catch {
|
|
9777
9821
|
return false;
|
|
@@ -9779,7 +9823,7 @@ var resolveDevClientDir2 = () => {
|
|
|
9779
9823
|
}, resolveRelativeModule2 = async (spec, from) => {
|
|
9780
9824
|
if (!spec.startsWith("."))
|
|
9781
9825
|
return null;
|
|
9782
|
-
const basePath = resolve14(
|
|
9826
|
+
const basePath = resolve14(dirname9(from), spec);
|
|
9783
9827
|
const candidates = [
|
|
9784
9828
|
basePath,
|
|
9785
9829
|
`${basePath}.ts`,
|
|
@@ -9790,14 +9834,14 @@ var resolveDevClientDir2 = () => {
|
|
|
9790
9834
|
`${basePath}.svelte`,
|
|
9791
9835
|
`${basePath}.svelte.ts`,
|
|
9792
9836
|
`${basePath}.svelte.js`,
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9837
|
+
join14(basePath, "index.ts"),
|
|
9838
|
+
join14(basePath, "index.js"),
|
|
9839
|
+
join14(basePath, "index.mjs"),
|
|
9840
|
+
join14(basePath, "index.cjs"),
|
|
9841
|
+
join14(basePath, "index.json"),
|
|
9842
|
+
join14(basePath, "index.svelte"),
|
|
9843
|
+
join14(basePath, "index.svelte.ts"),
|
|
9844
|
+
join14(basePath, "index.svelte.js")
|
|
9801
9845
|
];
|
|
9802
9846
|
const checks = await Promise.all(candidates.map(exists));
|
|
9803
9847
|
return candidates.find((_2, index) => checks[index]) ?? null;
|
|
@@ -9806,7 +9850,7 @@ var resolveDevClientDir2 = () => {
|
|
|
9806
9850
|
const resolved = resolvePackageImport(spec);
|
|
9807
9851
|
return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
|
|
9808
9852
|
}
|
|
9809
|
-
const basePath = resolve14(
|
|
9853
|
+
const basePath = resolve14(dirname9(from), spec);
|
|
9810
9854
|
const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
|
|
9811
9855
|
if (!explicit) {
|
|
9812
9856
|
const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
|
|
@@ -9835,11 +9879,11 @@ var resolveDevClientDir2 = () => {
|
|
|
9835
9879
|
});
|
|
9836
9880
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
|
|
9837
9881
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
9838
|
-
const generatedDir =
|
|
9839
|
-
const clientDir =
|
|
9840
|
-
const indexDir =
|
|
9841
|
-
const serverDir =
|
|
9842
|
-
await Promise.all([clientDir, indexDir, serverDir].map((dir) =>
|
|
9882
|
+
const generatedDir = join14(svelteRoot, "generated");
|
|
9883
|
+
const clientDir = join14(generatedDir, "client");
|
|
9884
|
+
const indexDir = join14(generatedDir, "indexes");
|
|
9885
|
+
const serverDir = join14(generatedDir, "server");
|
|
9886
|
+
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir4(dir, { recursive: true })));
|
|
9843
9887
|
const dev = env.NODE_ENV !== "production";
|
|
9844
9888
|
const build = async (src) => {
|
|
9845
9889
|
const memoized = cache.get(src);
|
|
@@ -9866,8 +9910,8 @@ var resolveDevClientDir2 = () => {
|
|
|
9866
9910
|
const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
|
|
9867
9911
|
const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedServer) : preprocessedServer;
|
|
9868
9912
|
const transpiledClient = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedClient) : preprocessedClient;
|
|
9869
|
-
const rawRel =
|
|
9870
|
-
const relDir = rawRel.startsWith("..") ? `_ext/${relative7(process.cwd(),
|
|
9913
|
+
const rawRel = dirname9(relative7(svelteRoot, src)).replace(/\\/g, "/");
|
|
9914
|
+
const relDir = rawRel.startsWith("..") ? `_ext/${relative7(process.cwd(), dirname9(src)).replace(/\\/g, "/")}` : rawRel;
|
|
9871
9915
|
const baseName = basename4(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
9872
9916
|
const importPaths = Array.from(transpiledServer.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
9873
9917
|
const resolvedModuleImports = await Promise.all(importPaths.map((importPath) => resolveRelativeModule2(importPath, src)));
|
|
@@ -9876,8 +9920,8 @@ var resolveDevClientDir2 = () => {
|
|
|
9876
9920
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
9877
9921
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
9878
9922
|
const externalRewrites = new Map;
|
|
9879
|
-
const ssrOutputDir =
|
|
9880
|
-
const clientOutputDir =
|
|
9923
|
+
const ssrOutputDir = dirname9(join14(serverDir, relDir, `${baseName}.js`));
|
|
9924
|
+
const clientOutputDir = dirname9(join14(clientDir, relDir, `${baseName}.js`));
|
|
9881
9925
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
9882
9926
|
const rawSpec = importPaths[idx];
|
|
9883
9927
|
if (!rawSpec)
|
|
@@ -9942,11 +9986,11 @@ var resolveDevClientDir2 = () => {
|
|
|
9942
9986
|
code += islandMetadataExports;
|
|
9943
9987
|
return code;
|
|
9944
9988
|
};
|
|
9945
|
-
const ssrPath =
|
|
9946
|
-
const clientPath =
|
|
9989
|
+
const ssrPath = join14(serverDir, relDir, `${baseName}.js`);
|
|
9990
|
+
const clientPath = join14(clientDir, relDir, `${baseName}.js`);
|
|
9947
9991
|
await Promise.all([
|
|
9948
|
-
|
|
9949
|
-
|
|
9992
|
+
mkdir4(dirname9(ssrPath), { recursive: true }),
|
|
9993
|
+
mkdir4(dirname9(clientPath), { recursive: true })
|
|
9950
9994
|
]);
|
|
9951
9995
|
if (isModule) {
|
|
9952
9996
|
const bundle = rewriteExternalImports(generate("client"), "client");
|
|
@@ -9973,10 +10017,10 @@ var resolveDevClientDir2 = () => {
|
|
|
9973
10017
|
};
|
|
9974
10018
|
const roots = await Promise.all(entryPoints.map(build));
|
|
9975
10019
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
9976
|
-
const relClientDir =
|
|
10020
|
+
const relClientDir = dirname9(relative7(clientDir, client));
|
|
9977
10021
|
const name = basename4(client, extname5(client));
|
|
9978
|
-
const indexPath =
|
|
9979
|
-
const importRaw = relative7(
|
|
10022
|
+
const indexPath = join14(indexDir, relClientDir, `${name}.js`);
|
|
10023
|
+
const importRaw = relative7(dirname9(indexPath), client).split(sep2).join("/");
|
|
9980
10024
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
9981
10025
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
9982
10026
|
import "${hmrClientPath3}";
|
|
@@ -10047,14 +10091,14 @@ if (typeof window !== "undefined") {
|
|
|
10047
10091
|
setTimeout(releaseStreamingSlots, 0);
|
|
10048
10092
|
}
|
|
10049
10093
|
}`;
|
|
10050
|
-
await
|
|
10094
|
+
await mkdir4(dirname9(indexPath), { recursive: true });
|
|
10051
10095
|
return write(indexPath, bootstrap);
|
|
10052
10096
|
}));
|
|
10053
10097
|
return {
|
|
10054
10098
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
10055
10099
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
10056
|
-
const rel =
|
|
10057
|
-
return
|
|
10100
|
+
const rel = dirname9(relative7(clientDir, client));
|
|
10101
|
+
return join14(indexDir, rel, basename4(client));
|
|
10058
10102
|
}),
|
|
10059
10103
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
10060
10104
|
};
|
|
@@ -10068,7 +10112,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
10068
10112
|
init_lowerAwaitSlotSyntax();
|
|
10069
10113
|
init_renderToReadableStream();
|
|
10070
10114
|
devClientDir2 = resolveDevClientDir2();
|
|
10071
|
-
hmrClientPath3 =
|
|
10115
|
+
hmrClientPath3 = join14(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
10072
10116
|
persistentCache = new Map;
|
|
10073
10117
|
sourceHashCache = new Map;
|
|
10074
10118
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
@@ -10084,12 +10128,12 @@ __export(exports_compileVue, {
|
|
|
10084
10128
|
clearVueHmrCaches: () => clearVueHmrCaches
|
|
10085
10129
|
});
|
|
10086
10130
|
import { existsSync as existsSync15 } from "fs";
|
|
10087
|
-
import { mkdir as
|
|
10131
|
+
import { mkdir as mkdir5 } from "fs/promises";
|
|
10088
10132
|
import {
|
|
10089
10133
|
basename as basename5,
|
|
10090
|
-
dirname as
|
|
10134
|
+
dirname as dirname10,
|
|
10091
10135
|
isAbsolute as isAbsolute3,
|
|
10092
|
-
join as
|
|
10136
|
+
join as join15,
|
|
10093
10137
|
relative as relative8,
|
|
10094
10138
|
resolve as resolve15
|
|
10095
10139
|
} from "path";
|
|
@@ -10208,12 +10252,12 @@ var resolveDevClientDir3 = () => {
|
|
|
10208
10252
|
const childComponentPaths = importPaths.filter((path) => path.startsWith(".") && path.endsWith(".vue"));
|
|
10209
10253
|
const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
|
|
10210
10254
|
const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue") && !isStylePath(path));
|
|
10211
|
-
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve15(
|
|
10255
|
+
const stylePathsImported = importPaths.filter((path) => (path.startsWith(".") || isAbsolute3(path)) && isStylePath(path)).map((path) => isAbsolute3(path) ? path : resolve15(dirname10(sourceFilePath), path));
|
|
10212
10256
|
for (const stylePath of stylePathsImported) {
|
|
10213
10257
|
addStyleImporter(sourceFilePath, stylePath);
|
|
10214
10258
|
}
|
|
10215
10259
|
const childBuildResults = await Promise.all([
|
|
10216
|
-
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve15(
|
|
10260
|
+
...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve15(dirname10(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
|
|
10217
10261
|
...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
|
|
10218
10262
|
]);
|
|
10219
10263
|
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
@@ -10222,7 +10266,7 @@ var resolveDevClientDir3 = () => {
|
|
|
10222
10266
|
inlineTemplate: false
|
|
10223
10267
|
}) : { bindings: {}, content: "export default {};" };
|
|
10224
10268
|
const strippedScript = stripExports(compiledScript.content);
|
|
10225
|
-
const sourceDir =
|
|
10269
|
+
const sourceDir = dirname10(sourceFilePath);
|
|
10226
10270
|
const transpiledScript = transpiler3.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_2, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs(relativeImport, sourceDir)}${quoteEnd}`);
|
|
10227
10271
|
const packageImportRewrites = new Map;
|
|
10228
10272
|
for (const [bareImport, absolutePath] of packageComponentPaths) {
|
|
@@ -10259,8 +10303,8 @@ var resolveDevClientDir3 = () => {
|
|
|
10259
10303
|
];
|
|
10260
10304
|
let cssOutputPaths = [];
|
|
10261
10305
|
if (isEntryPoint && allCss.length) {
|
|
10262
|
-
const cssOutputFile =
|
|
10263
|
-
await
|
|
10306
|
+
const cssOutputFile = join15(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
10307
|
+
await mkdir5(dirname10(cssOutputFile), { recursive: true });
|
|
10264
10308
|
await write2(cssOutputFile, allCss.join(`
|
|
10265
10309
|
`));
|
|
10266
10310
|
cssOutputPaths = [cssOutputFile];
|
|
@@ -10290,9 +10334,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10290
10334
|
};
|
|
10291
10335
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
10292
10336
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
10293
|
-
const clientOutputPath =
|
|
10294
|
-
const serverOutputPath =
|
|
10295
|
-
const relDir =
|
|
10337
|
+
const clientOutputPath = join15(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
10338
|
+
const serverOutputPath = join15(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
10339
|
+
const relDir = dirname10(relativeFilePath);
|
|
10296
10340
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
10297
10341
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_2, prefix, dots) => {
|
|
10298
10342
|
const upCount = dots.split("/").length - 1;
|
|
@@ -10304,15 +10348,15 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10304
10348
|
let result2 = code;
|
|
10305
10349
|
for (const [bareImport, paths] of packageImportRewrites) {
|
|
10306
10350
|
const targetPath = mode === "server" ? paths.server : paths.client;
|
|
10307
|
-
let rel = relative8(
|
|
10351
|
+
let rel = relative8(dirname10(outputPath), targetPath).replace(/\\/g, "/");
|
|
10308
10352
|
if (!rel.startsWith("."))
|
|
10309
10353
|
rel = `./${rel}`;
|
|
10310
10354
|
result2 = result2.replaceAll(bareImport, rel);
|
|
10311
10355
|
}
|
|
10312
10356
|
return result2;
|
|
10313
10357
|
};
|
|
10314
|
-
await
|
|
10315
|
-
await
|
|
10358
|
+
await mkdir5(dirname10(clientOutputPath), { recursive: true });
|
|
10359
|
+
await mkdir5(dirname10(serverOutputPath), { recursive: true });
|
|
10316
10360
|
await write2(clientOutputPath, rewritePackageImports(adjustImports(clientCode), clientOutputPath, "client"));
|
|
10317
10361
|
await write2(serverOutputPath, rewritePackageImports(adjustImports(serverCode), serverOutputPath, "server"));
|
|
10318
10362
|
const result = {
|
|
@@ -10322,7 +10366,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10322
10366
|
hmrId,
|
|
10323
10367
|
serverPath: serverOutputPath,
|
|
10324
10368
|
tsHelperPaths: [
|
|
10325
|
-
...helperModulePaths.map((helper) => resolve15(
|
|
10369
|
+
...helperModulePaths.map((helper) => resolve15(dirname10(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
|
|
10326
10370
|
...childBuildResults.flatMap((child) => child.tsHelperPaths)
|
|
10327
10371
|
]
|
|
10328
10372
|
};
|
|
@@ -10331,16 +10375,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10331
10375
|
return result;
|
|
10332
10376
|
}, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
|
|
10333
10377
|
const compiler = await import("@vue/compiler-sfc");
|
|
10334
|
-
const generatedDir =
|
|
10335
|
-
const clientOutputDir =
|
|
10336
|
-
const indexOutputDir =
|
|
10337
|
-
const serverOutputDir =
|
|
10338
|
-
const cssOutputDir =
|
|
10378
|
+
const generatedDir = join15(vueRootDir, "generated");
|
|
10379
|
+
const clientOutputDir = join15(generatedDir, "client");
|
|
10380
|
+
const indexOutputDir = join15(generatedDir, "indexes");
|
|
10381
|
+
const serverOutputDir = join15(generatedDir, "server");
|
|
10382
|
+
const cssOutputDir = join15(generatedDir, "compiled");
|
|
10339
10383
|
await Promise.all([
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10384
|
+
mkdir5(clientOutputDir, { recursive: true }),
|
|
10385
|
+
mkdir5(indexOutputDir, { recursive: true }),
|
|
10386
|
+
mkdir5(serverOutputDir, { recursive: true }),
|
|
10387
|
+
mkdir5(cssOutputDir, { recursive: true })
|
|
10344
10388
|
]);
|
|
10345
10389
|
const buildCache = new Map;
|
|
10346
10390
|
const allTsHelperPaths = new Set;
|
|
@@ -10352,16 +10396,16 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10352
10396
|
}, buildCache, true, vueRootDir, compiler, stylePreprocessors);
|
|
10353
10397
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
10354
10398
|
const entryBaseName = basename5(entryPath, ".vue");
|
|
10355
|
-
const indexOutputFile =
|
|
10356
|
-
const clientOutputFile =
|
|
10357
|
-
await
|
|
10399
|
+
const indexOutputFile = join15(indexOutputDir, `${entryBaseName}.js`);
|
|
10400
|
+
const clientOutputFile = join15(clientOutputDir, relative8(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
10401
|
+
await mkdir5(dirname10(indexOutputFile), { recursive: true });
|
|
10358
10402
|
const vueHmrImports = isDev ? [
|
|
10359
10403
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
10360
10404
|
`import "${hmrClientPath4}";`
|
|
10361
10405
|
] : [];
|
|
10362
10406
|
await write2(indexOutputFile, [
|
|
10363
10407
|
...vueHmrImports,
|
|
10364
|
-
`import Comp from "${relative8(
|
|
10408
|
+
`import Comp from "${relative8(dirname10(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
10365
10409
|
'import { createSSRApp, createApp } from "vue";',
|
|
10366
10410
|
"",
|
|
10367
10411
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -10482,10 +10526,10 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
10482
10526
|
const sourceCode = await file2(tsPath).text();
|
|
10483
10527
|
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
10484
10528
|
const relativeJsPath = relative8(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
10485
|
-
const outClientPath =
|
|
10486
|
-
const outServerPath =
|
|
10487
|
-
await
|
|
10488
|
-
await
|
|
10529
|
+
const outClientPath = join15(clientOutputDir, relativeJsPath);
|
|
10530
|
+
const outServerPath = join15(serverOutputDir, relativeJsPath);
|
|
10531
|
+
await mkdir5(dirname10(outClientPath), { recursive: true });
|
|
10532
|
+
await mkdir5(dirname10(outServerPath), { recursive: true });
|
|
10489
10533
|
await write2(outClientPath, transpiledCode);
|
|
10490
10534
|
await write2(outServerPath, transpiledCode);
|
|
10491
10535
|
}));
|
|
@@ -10503,7 +10547,7 @@ var init_compileVue = __esm(() => {
|
|
|
10503
10547
|
init_sourceMetadata();
|
|
10504
10548
|
init_stylePreprocessor();
|
|
10505
10549
|
devClientDir3 = resolveDevClientDir3();
|
|
10506
|
-
hmrClientPath4 =
|
|
10550
|
+
hmrClientPath4 = join15(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
10507
10551
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
10508
10552
|
scriptCache = new Map;
|
|
10509
10553
|
scriptSetupCache = new Map;
|
|
@@ -10984,7 +11028,7 @@ __export(exports_compileAngular, {
|
|
|
10984
11028
|
compileAngular: () => compileAngular
|
|
10985
11029
|
});
|
|
10986
11030
|
import { existsSync as existsSync16, readFileSync as readFileSync10, promises as fs } from "fs";
|
|
10987
|
-
import { join as
|
|
11031
|
+
import { join as join16, basename as basename6, sep as sep3, dirname as dirname11, resolve as resolve16, relative as relative9 } from "path";
|
|
10988
11032
|
import ts2 from "typescript";
|
|
10989
11033
|
var traceAngularPhase = async (name, fn2, metadata) => {
|
|
10990
11034
|
const tracePhase = globalThis.__absoluteBuildTracePhase;
|
|
@@ -11026,10 +11070,10 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11026
11070
|
`${candidate}.tsx`,
|
|
11027
11071
|
`${candidate}.js`,
|
|
11028
11072
|
`${candidate}.jsx`,
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11032
|
-
|
|
11073
|
+
join16(candidate, "index.ts"),
|
|
11074
|
+
join16(candidate, "index.tsx"),
|
|
11075
|
+
join16(candidate, "index.js"),
|
|
11076
|
+
join16(candidate, "index.jsx")
|
|
11033
11077
|
];
|
|
11034
11078
|
return candidates.find((file3) => existsSync16(file3));
|
|
11035
11079
|
}, createLegacyAngularAnimationUsageResolver = (rootDir) => {
|
|
@@ -11101,7 +11145,7 @@ var traceAngularPhase = async (name, fn2, metadata) => {
|
|
|
11101
11145
|
if (scan.usesLegacyAnimations)
|
|
11102
11146
|
return true;
|
|
11103
11147
|
for (const specifier of scan.imports) {
|
|
11104
|
-
const importedPath = resolveLocalImport(specifier,
|
|
11148
|
+
const importedPath = resolveLocalImport(specifier, dirname11(resolved));
|
|
11105
11149
|
if (importedPath && await visit(importedPath, visited)) {
|
|
11106
11150
|
return true;
|
|
11107
11151
|
}
|
|
@@ -11166,7 +11210,7 @@ ${registrations}
|
|
|
11166
11210
|
return specifier.replace(/\.ts$/, ".js");
|
|
11167
11211
|
if (hasJsLikeExtension(specifier))
|
|
11168
11212
|
return specifier;
|
|
11169
|
-
const importerDir =
|
|
11213
|
+
const importerDir = dirname11(importerOutputPath);
|
|
11170
11214
|
const fileCandidate = resolve16(importerDir, `${specifier}.js`);
|
|
11171
11215
|
if (outputFiles?.has(fileCandidate) || existsSync16(fileCandidate)) {
|
|
11172
11216
|
return `${specifier}.js`;
|
|
@@ -11199,16 +11243,16 @@ ${registrations}
|
|
|
11199
11243
|
}, resolveLocalTsImport = (fromFile, specifier) => {
|
|
11200
11244
|
if (!isRelativeModuleSpecifier(specifier))
|
|
11201
11245
|
return null;
|
|
11202
|
-
const basePath = resolve16(
|
|
11246
|
+
const basePath = resolve16(dirname11(fromFile), specifier);
|
|
11203
11247
|
const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
|
|
11204
11248
|
`${basePath}.ts`,
|
|
11205
11249
|
`${basePath}.tsx`,
|
|
11206
11250
|
`${basePath}.mts`,
|
|
11207
11251
|
`${basePath}.cts`,
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11252
|
+
join16(basePath, "index.ts"),
|
|
11253
|
+
join16(basePath, "index.tsx"),
|
|
11254
|
+
join16(basePath, "index.mts"),
|
|
11255
|
+
join16(basePath, "index.cts")
|
|
11212
11256
|
];
|
|
11213
11257
|
return candidates.map((candidate) => resolve16(candidate)).find((candidate) => existsSync16(candidate) && !candidate.endsWith(".d.ts")) ?? null;
|
|
11214
11258
|
}, readFileForAotTransform = async (fileName, readFile5) => {
|
|
@@ -11234,15 +11278,15 @@ ${registrations}
|
|
|
11234
11278
|
const paths = [];
|
|
11235
11279
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11236
11280
|
if (templateUrlMatch?.[1])
|
|
11237
|
-
paths.push(
|
|
11281
|
+
paths.push(join16(fileDir, templateUrlMatch[1]));
|
|
11238
11282
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11239
11283
|
if (styleUrlMatch?.[1])
|
|
11240
|
-
paths.push(
|
|
11284
|
+
paths.push(join16(fileDir, styleUrlMatch[1]));
|
|
11241
11285
|
const styleUrlsMatch = findUncommentedMatch(source, /styleUrls\s*:\s*\[([^\]]+)\]/);
|
|
11242
11286
|
const urlMatches = styleUrlsMatch?.[1]?.match(/['"]([^'"]+)['"]/g);
|
|
11243
11287
|
if (urlMatches) {
|
|
11244
11288
|
for (const urlMatch of urlMatches) {
|
|
11245
|
-
paths.push(
|
|
11289
|
+
paths.push(join16(fileDir, urlMatch.replace(/['"]/g, "")));
|
|
11246
11290
|
}
|
|
11247
11291
|
}
|
|
11248
11292
|
return paths.map((path) => resolve16(path));
|
|
@@ -11257,13 +11301,13 @@ ${registrations}
|
|
|
11257
11301
|
return null;
|
|
11258
11302
|
}
|
|
11259
11303
|
}, writeResourceCacheFile = async (cachePath, source) => {
|
|
11260
|
-
await fs.mkdir(
|
|
11304
|
+
await fs.mkdir(dirname11(cachePath), { recursive: true });
|
|
11261
11305
|
await fs.writeFile(cachePath, JSON.stringify({
|
|
11262
11306
|
source,
|
|
11263
11307
|
version: 1
|
|
11264
11308
|
}), "utf-8");
|
|
11265
11309
|
}, resolveResourceTransformCachePath = async (filePath, source, stylePreprocessors) => {
|
|
11266
|
-
const resourcePaths = collectAngularResourcePaths(source,
|
|
11310
|
+
const resourcePaths = collectAngularResourcePaths(source, dirname11(filePath));
|
|
11267
11311
|
const resourceContents = await Promise.all(resourcePaths.map(async (resourcePath) => {
|
|
11268
11312
|
const content = await fs.readFile(resourcePath, "utf-8");
|
|
11269
11313
|
return `${resourcePath}\x00${content}`;
|
|
@@ -11276,7 +11320,7 @@ ${registrations}
|
|
|
11276
11320
|
safeStableStringify(stylePreprocessors ?? null)
|
|
11277
11321
|
].join("\x00");
|
|
11278
11322
|
const cacheKey2 = Bun.hash(cacheInput).toString(BASE_36_RADIX);
|
|
11279
|
-
return
|
|
11323
|
+
return join16(process.cwd(), ".absolutejs", "cache", "angular-resources", `${cacheKey2}.json`);
|
|
11280
11324
|
}, precomputeAotResourceTransforms = async (inputPaths, readFile5, stylePreprocessors) => {
|
|
11281
11325
|
const transformedSources = new Map;
|
|
11282
11326
|
const visited = new Set;
|
|
@@ -11303,7 +11347,7 @@ ${registrations}
|
|
|
11303
11347
|
transformedSource = cached.source;
|
|
11304
11348
|
} else {
|
|
11305
11349
|
stats.cacheMisses += 1;
|
|
11306
|
-
const transformed = await inlineResources(source,
|
|
11350
|
+
const transformed = await inlineResources(source, dirname11(resolvedPath), stylePreprocessors);
|
|
11307
11351
|
transformedSource = transformed.source;
|
|
11308
11352
|
await writeResourceCacheFile(cachePath, transformedSource);
|
|
11309
11353
|
}
|
|
@@ -11322,7 +11366,7 @@ ${registrations}
|
|
|
11322
11366
|
return { stats, transformedSources };
|
|
11323
11367
|
}, compileAngularFiles = async (inputPaths, outDir, stylePreprocessors) => {
|
|
11324
11368
|
const islandMetadataByOutputPath = await traceAngularPhase("aot/island-metadata", () => new Map(inputPaths.map((inputPath) => {
|
|
11325
|
-
const outputPath = resolve16(
|
|
11369
|
+
const outputPath = resolve16(join16(outDir, relative9(process.cwd(), resolve16(inputPath)).replace(/\.[cm]?[tj]sx?$/, ".js")));
|
|
11326
11370
|
return [
|
|
11327
11371
|
outputPath,
|
|
11328
11372
|
buildIslandMetadataExports(readFileSync10(inputPath, "utf-8"))
|
|
@@ -11332,7 +11376,7 @@ ${registrations}
|
|
|
11332
11376
|
const { readConfiguration, performCompilation, EmitFlags } = await traceAngularPhase("aot/import-compiler-cli", () => import("@angular/compiler-cli"));
|
|
11333
11377
|
const tsLibDir = await traceAngularPhase("aot/resolve-typescript-lib", () => {
|
|
11334
11378
|
const tsPath = __require.resolve("typescript");
|
|
11335
|
-
const tsRootDir =
|
|
11379
|
+
const tsRootDir = dirname11(tsPath);
|
|
11336
11380
|
return tsRootDir.endsWith("lib") ? tsRootDir : resolve16(tsRootDir, "lib");
|
|
11337
11381
|
});
|
|
11338
11382
|
const config = await traceAngularPhase("aot/read-configuration", () => readConfiguration("./tsconfig.json"));
|
|
@@ -11369,7 +11413,7 @@ ${registrations}
|
|
|
11369
11413
|
const originalGetSourceFile = host.getSourceFile;
|
|
11370
11414
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
11371
11415
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
11372
|
-
const resolvedPath =
|
|
11416
|
+
const resolvedPath = join16(tsLibDir, fileName);
|
|
11373
11417
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
11374
11418
|
}
|
|
11375
11419
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -11424,7 +11468,7 @@ ${registrations}
|
|
|
11424
11468
|
const entries = await traceAngularPhase("aot/postprocess-emitted-js", () => {
|
|
11425
11469
|
const rawEntries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => ({
|
|
11426
11470
|
content,
|
|
11427
|
-
target:
|
|
11471
|
+
target: join16(outDir, fileName)
|
|
11428
11472
|
}));
|
|
11429
11473
|
const outputFiles = new Set(rawEntries.map(({ target }) => resolve16(target)));
|
|
11430
11474
|
return rawEntries.map(({ content, target }) => {
|
|
@@ -11446,7 +11490,7 @@ ${registrations}
|
|
|
11446
11490
|
});
|
|
11447
11491
|
});
|
|
11448
11492
|
await traceAngularPhase("aot/write-output", () => Promise.all(entries.map(async ({ target, content }) => {
|
|
11449
|
-
await fs.mkdir(
|
|
11493
|
+
await fs.mkdir(dirname11(target), { recursive: true });
|
|
11450
11494
|
await fs.writeFile(target, content, "utf-8");
|
|
11451
11495
|
})), { outputs: entries.length });
|
|
11452
11496
|
return await traceAngularPhase("aot/collect-output-paths", () => entries.map(({ target }) => target), { outputs: entries.length });
|
|
@@ -11599,7 +11643,7 @@ ${fields}
|
|
|
11599
11643
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
11600
11644
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11601
11645
|
if (templateUrlMatch?.[1]) {
|
|
11602
|
-
const templatePath =
|
|
11646
|
+
const templatePath = join16(fileDir, templateUrlMatch[1]);
|
|
11603
11647
|
if (!existsSync16(templatePath)) {
|
|
11604
11648
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
11605
11649
|
}
|
|
@@ -11630,7 +11674,7 @@ ${fields}
|
|
|
11630
11674
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
11631
11675
|
const templateUrlMatch = findUncommentedMatch(source, /templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11632
11676
|
if (templateUrlMatch?.[1]) {
|
|
11633
|
-
const templatePath =
|
|
11677
|
+
const templatePath = join16(fileDir, templateUrlMatch[1]);
|
|
11634
11678
|
if (!existsSync16(templatePath)) {
|
|
11635
11679
|
throw new Error(`Unable to inline Angular templateUrl "${templateUrlMatch[1]}": file not found at ${templatePath}`);
|
|
11636
11680
|
}
|
|
@@ -11667,7 +11711,7 @@ ${fields}
|
|
|
11667
11711
|
return source;
|
|
11668
11712
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
11669
11713
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
11670
|
-
return readAndEscapeFile(
|
|
11714
|
+
return readAndEscapeFile(join16(fileDir, styleUrl), stylePreprocessors);
|
|
11671
11715
|
});
|
|
11672
11716
|
const results = await Promise.all(stylePromises);
|
|
11673
11717
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -11678,7 +11722,7 @@ ${fields}
|
|
|
11678
11722
|
const styleUrlMatch = findUncommentedMatch(source, /styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
11679
11723
|
if (!styleUrlMatch?.[1])
|
|
11680
11724
|
return source;
|
|
11681
|
-
const escaped = await readAndEscapeFile(
|
|
11725
|
+
const escaped = await readAndEscapeFile(join16(fileDir, styleUrlMatch[1]), stylePreprocessors);
|
|
11682
11726
|
if (!escaped)
|
|
11683
11727
|
return source;
|
|
11684
11728
|
return source.slice(0, styleUrlMatch.index) + `styles: [\`${escaped}\`]` + source.slice(styleUrlMatch.index + styleUrlMatch[0].length);
|
|
@@ -11713,10 +11757,10 @@ ${fields}
|
|
|
11713
11757
|
`${candidate}.tsx`,
|
|
11714
11758
|
`${candidate}.js`,
|
|
11715
11759
|
`${candidate}.jsx`,
|
|
11716
|
-
|
|
11717
|
-
|
|
11718
|
-
|
|
11719
|
-
|
|
11760
|
+
join16(candidate, "index.ts"),
|
|
11761
|
+
join16(candidate, "index.tsx"),
|
|
11762
|
+
join16(candidate, "index.js"),
|
|
11763
|
+
join16(candidate, "index.jsx")
|
|
11720
11764
|
];
|
|
11721
11765
|
return candidates.find((file3) => existsSync16(file3));
|
|
11722
11766
|
};
|
|
@@ -11740,10 +11784,10 @@ ${fields}
|
|
|
11740
11784
|
}
|
|
11741
11785
|
};
|
|
11742
11786
|
const toOutputPath = (sourcePath) => {
|
|
11743
|
-
const inputDir =
|
|
11787
|
+
const inputDir = dirname11(sourcePath);
|
|
11744
11788
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
11745
11789
|
const fileBase = basename6(sourcePath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
11746
|
-
return
|
|
11790
|
+
return join16(outDir, relativeDir, fileBase);
|
|
11747
11791
|
};
|
|
11748
11792
|
const transpileAndRewrite = (sourceCode, relativeDir, actualPath, importRewrites) => {
|
|
11749
11793
|
let processedContent = angularTranspiler.transformSync(sourceCode);
|
|
@@ -11791,12 +11835,12 @@ ${fields}
|
|
|
11791
11835
|
if (!existsSync16(actualPath))
|
|
11792
11836
|
return;
|
|
11793
11837
|
let sourceCode = await fs.readFile(actualPath, "utf-8");
|
|
11794
|
-
const inlined = await inlineResources(sourceCode,
|
|
11795
|
-
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source,
|
|
11796
|
-
const inputDir =
|
|
11838
|
+
const inlined = await inlineResources(sourceCode, dirname11(actualPath), stylePreprocessors);
|
|
11839
|
+
sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname11(actualPath)).source;
|
|
11840
|
+
const inputDir = dirname11(actualPath);
|
|
11797
11841
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
11798
11842
|
const fileBase = basename6(actualPath).replace(/\.[cm]?[tj]sx?$/, ".js");
|
|
11799
|
-
const targetDir =
|
|
11843
|
+
const targetDir = join16(outDir, relativeDir);
|
|
11800
11844
|
const targetPath = toOutputPath(actualPath);
|
|
11801
11845
|
const localImports = [];
|
|
11802
11846
|
const importRewrites = new Map;
|
|
@@ -11850,13 +11894,13 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
11850
11894
|
}
|
|
11851
11895
|
return allOutputs;
|
|
11852
11896
|
}, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
|
|
11853
|
-
const compiledParent =
|
|
11897
|
+
const compiledParent = join16(outRoot, "generated");
|
|
11854
11898
|
if (entryPoints.length === 0) {
|
|
11855
11899
|
const emptyPaths = [];
|
|
11856
11900
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
11857
11901
|
}
|
|
11858
11902
|
const compiledRoot = compiledParent;
|
|
11859
|
-
const indexesDir =
|
|
11903
|
+
const indexesDir = join16(compiledParent, "indexes");
|
|
11860
11904
|
await traceAngularPhase("setup/create-indexes-dir", () => fs.mkdir(indexesDir, { recursive: true }));
|
|
11861
11905
|
const aotOutputs = hmr ? [] : await traceAngularPhase("aot/compile-files", () => compileAngularFiles(entryPoints.map((entry) => resolve16(entry)), compiledRoot, stylePreprocessors), { entries: entryPoints.length });
|
|
11862
11906
|
const usesLegacyAngularAnimations = await traceAngularPhase("setup/legacy-animation-resolver", () => createLegacyAngularAnimationUsageResolver(outRoot));
|
|
@@ -11870,9 +11914,9 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
11870
11914
|
const fileBase = basename6(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
11871
11915
|
const jsName = `${fileBase}.js`;
|
|
11872
11916
|
const compiledFallbackPaths = [
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11917
|
+
join16(compiledRoot, relativeEntry),
|
|
11918
|
+
join16(compiledRoot, "pages", jsName),
|
|
11919
|
+
join16(compiledRoot, jsName)
|
|
11876
11920
|
].map((file3) => resolve16(file3));
|
|
11877
11921
|
const resolveRawServerFile = (candidatePaths) => {
|
|
11878
11922
|
const normalizedCandidates = [
|
|
@@ -11916,7 +11960,7 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
11916
11960
|
const usesLegacyAnimations = await traceAngularPhase("wrapper/detect-legacy-animations", () => usesLegacyAngularAnimations(resolvedEntry), { entry: resolvedEntry });
|
|
11917
11961
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
11918
11962
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
11919
|
-
const clientFile =
|
|
11963
|
+
const clientFile = join16(indexesDir, jsName);
|
|
11920
11964
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync16(clientFile) && (usesLegacyAnimations || !original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__")) && (!usesLegacyAnimations || original.includes("__ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__"))) {
|
|
11921
11965
|
return {
|
|
11922
11966
|
clientPath: clientFile,
|
|
@@ -12152,8 +12196,8 @@ var init_compileAngular = __esm(() => {
|
|
|
12152
12196
|
init_lowerDeferSyntax();
|
|
12153
12197
|
init_stylePreprocessor();
|
|
12154
12198
|
devClientDir4 = resolveDevClientDir4();
|
|
12155
|
-
hmrClientPath5 =
|
|
12156
|
-
hmrRuntimePath =
|
|
12199
|
+
hmrClientPath5 = join16(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
12200
|
+
hmrRuntimePath = join16(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
|
|
12157
12201
|
jitContentCache = new Map;
|
|
12158
12202
|
wrapperOutputCache = new Map;
|
|
12159
12203
|
});
|
|
@@ -12165,8 +12209,8 @@ __export(exports_buildReactVendor, {
|
|
|
12165
12209
|
buildReactVendor: () => buildReactVendor
|
|
12166
12210
|
});
|
|
12167
12211
|
import { existsSync as existsSync17, mkdirSync as mkdirSync6 } from "fs";
|
|
12168
|
-
import { join as
|
|
12169
|
-
import { rm as
|
|
12212
|
+
import { join as join17, resolve as resolve17 } from "path";
|
|
12213
|
+
import { rm as rm5 } from "fs/promises";
|
|
12170
12214
|
var {build: bunBuild2 } = globalThis.Bun;
|
|
12171
12215
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
12172
12216
|
const candidates = [
|
|
@@ -12219,14 +12263,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
12219
12263
|
`)}
|
|
12220
12264
|
`;
|
|
12221
12265
|
}, buildReactVendor = async (buildDir) => {
|
|
12222
|
-
const vendorDir =
|
|
12266
|
+
const vendorDir = join17(buildDir, "react", "vendor");
|
|
12223
12267
|
mkdirSync6(vendorDir, { recursive: true });
|
|
12224
|
-
const tmpDir =
|
|
12268
|
+
const tmpDir = join17(buildDir, "_vendor_tmp");
|
|
12225
12269
|
mkdirSync6(tmpDir, { recursive: true });
|
|
12226
12270
|
const specifiers = resolveVendorSpecifiers();
|
|
12227
12271
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12228
12272
|
const safeName = toSafeFileName(specifier);
|
|
12229
|
-
const entryPath =
|
|
12273
|
+
const entryPath = join17(tmpDir, `${safeName}.ts`);
|
|
12230
12274
|
const source = await generateEntrySource(specifier);
|
|
12231
12275
|
await Bun.write(entryPath, source);
|
|
12232
12276
|
return entryPath;
|
|
@@ -12241,7 +12285,7 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
12241
12285
|
target: "browser",
|
|
12242
12286
|
throw: false
|
|
12243
12287
|
});
|
|
12244
|
-
await
|
|
12288
|
+
await rm5(tmpDir, { force: true, recursive: true });
|
|
12245
12289
|
if (!result.success) {
|
|
12246
12290
|
console.warn("\u26A0\uFE0F React vendor build had errors:", result.logs);
|
|
12247
12291
|
}
|
|
@@ -12274,8 +12318,8 @@ __export(exports_buildAngularVendor, {
|
|
|
12274
12318
|
buildAngularServerVendor: () => buildAngularServerVendor
|
|
12275
12319
|
});
|
|
12276
12320
|
import { mkdirSync as mkdirSync7 } from "fs";
|
|
12277
|
-
import { join as
|
|
12278
|
-
import { rm as
|
|
12321
|
+
import { join as join18 } from "path";
|
|
12322
|
+
import { rm as rm6 } from "fs/promises";
|
|
12279
12323
|
var {build: bunBuild3, Glob: Glob6 } = globalThis.Bun;
|
|
12280
12324
|
var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => jitMode ? [...REQUIRED_ANGULAR_SPECIFIERS_BASE, "@angular/compiler"] : REQUIRED_ANGULAR_SPECIFIERS_BASE, SERVER_ONLY_ANGULAR_SPECIFIERS, SCAN_SKIP_DIRS, isResolvable2 = (specifier) => {
|
|
12281
12325
|
try {
|
|
@@ -12371,14 +12415,14 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12371
12415
|
await collectTransitiveAngularSpecs([...angular, ...transitiveRoots], angular);
|
|
12372
12416
|
return Array.from(angular).filter(isResolvable2);
|
|
12373
12417
|
}, buildAngularVendor = async (buildDir, directories = [], linkerJitMode = false, depVendorSpecifiers = []) => {
|
|
12374
|
-
const vendorDir =
|
|
12418
|
+
const vendorDir = join18(buildDir, "angular", "vendor");
|
|
12375
12419
|
mkdirSync7(vendorDir, { recursive: true });
|
|
12376
|
-
const tmpDir =
|
|
12420
|
+
const tmpDir = join18(buildDir, "_angular_vendor_tmp");
|
|
12377
12421
|
mkdirSync7(tmpDir, { recursive: true });
|
|
12378
12422
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12379
12423
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12380
12424
|
const safeName = toSafeFileName2(specifier);
|
|
12381
|
-
const entryPath =
|
|
12425
|
+
const entryPath = join18(tmpDir, `${safeName}.ts`);
|
|
12382
12426
|
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
12383
12427
|
return entryPath;
|
|
12384
12428
|
}));
|
|
@@ -12394,7 +12438,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12394
12438
|
target: "browser",
|
|
12395
12439
|
throw: false
|
|
12396
12440
|
});
|
|
12397
|
-
await
|
|
12441
|
+
await rm6(tmpDir, { force: true, recursive: true });
|
|
12398
12442
|
if (!result.success) {
|
|
12399
12443
|
console.warn("\u26A0\uFE0F Angular vendor build had errors:", result.logs);
|
|
12400
12444
|
}
|
|
@@ -12409,9 +12453,9 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12409
12453
|
const specifiers = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12410
12454
|
return computeAngularVendorPaths(specifiers);
|
|
12411
12455
|
}, buildAngularServerVendor = async (buildDir, directories = [], linkerJitMode = false) => {
|
|
12412
|
-
const vendorDir =
|
|
12456
|
+
const vendorDir = join18(buildDir, "angular", "vendor", "server");
|
|
12413
12457
|
mkdirSync7(vendorDir, { recursive: true });
|
|
12414
|
-
const tmpDir =
|
|
12458
|
+
const tmpDir = join18(buildDir, "_angular_server_vendor_tmp");
|
|
12415
12459
|
mkdirSync7(tmpDir, { recursive: true });
|
|
12416
12460
|
const browserSpecs = await resolveAngularSpecifiers(directories, linkerJitMode);
|
|
12417
12461
|
const allSpecs = new Set(browserSpecs);
|
|
@@ -12422,7 +12466,7 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12422
12466
|
const specifiers = Array.from(allSpecs);
|
|
12423
12467
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12424
12468
|
const safeName = toSafeFileName2(specifier);
|
|
12425
|
-
const entryPath =
|
|
12469
|
+
const entryPath = join18(tmpDir, `${safeName}.ts`);
|
|
12426
12470
|
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
12427
12471
|
return entryPath;
|
|
12428
12472
|
}));
|
|
@@ -12437,16 +12481,16 @@ var REQUIRED_ANGULAR_SPECIFIERS_BASE, requiredAngularSpecifiers = (jitMode) => j
|
|
|
12437
12481
|
target: "bun",
|
|
12438
12482
|
throw: false
|
|
12439
12483
|
});
|
|
12440
|
-
await
|
|
12484
|
+
await rm6(tmpDir, { force: true, recursive: true });
|
|
12441
12485
|
if (!result.success) {
|
|
12442
12486
|
console.warn("\u26A0\uFE0F Angular server vendor build had errors:", result.logs);
|
|
12443
12487
|
}
|
|
12444
12488
|
return specifiers;
|
|
12445
12489
|
}, computeAngularServerVendorPaths = (buildDir, specifiers) => {
|
|
12446
12490
|
const paths = {};
|
|
12447
|
-
const vendorDir =
|
|
12491
|
+
const vendorDir = join18(buildDir, "angular", "vendor", "server");
|
|
12448
12492
|
for (const specifier of specifiers) {
|
|
12449
|
-
paths[specifier] =
|
|
12493
|
+
paths[specifier] = join18(vendorDir, `${toSafeFileName2(specifier)}.js`);
|
|
12450
12494
|
}
|
|
12451
12495
|
return paths;
|
|
12452
12496
|
}, computeAngularServerVendorPathsAsync = async (buildDir, directories = [], linkerJitMode = true) => {
|
|
@@ -12497,17 +12541,17 @@ __export(exports_buildVueVendor, {
|
|
|
12497
12541
|
buildVueVendor: () => buildVueVendor
|
|
12498
12542
|
});
|
|
12499
12543
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
12500
|
-
import { join as
|
|
12501
|
-
import { rm as
|
|
12544
|
+
import { join as join19 } from "path";
|
|
12545
|
+
import { rm as rm7 } from "fs/promises";
|
|
12502
12546
|
var {build: bunBuild4 } = globalThis.Bun;
|
|
12503
12547
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
12504
|
-
const vendorDir =
|
|
12548
|
+
const vendorDir = join19(buildDir, "vue", "vendor");
|
|
12505
12549
|
mkdirSync8(vendorDir, { recursive: true });
|
|
12506
|
-
const tmpDir =
|
|
12550
|
+
const tmpDir = join19(buildDir, "_vue_vendor_tmp");
|
|
12507
12551
|
mkdirSync8(tmpDir, { recursive: true });
|
|
12508
12552
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
12509
12553
|
const safeName = toSafeFileName3(specifier);
|
|
12510
|
-
const entryPath =
|
|
12554
|
+
const entryPath = join19(tmpDir, `${safeName}.ts`);
|
|
12511
12555
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
12512
12556
|
`);
|
|
12513
12557
|
return entryPath;
|
|
@@ -12527,7 +12571,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
12527
12571
|
target: "browser",
|
|
12528
12572
|
throw: false
|
|
12529
12573
|
});
|
|
12530
|
-
await
|
|
12574
|
+
await rm7(tmpDir, { force: true, recursive: true });
|
|
12531
12575
|
if (!result.success) {
|
|
12532
12576
|
console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
|
|
12533
12577
|
return;
|
|
@@ -12535,7 +12579,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
12535
12579
|
const { readFileSync: readFileSync11, writeFileSync: writeFileSync6, readdirSync } = await import("fs");
|
|
12536
12580
|
const files = readdirSync(vendorDir).filter((f2) => f2.endsWith(".js"));
|
|
12537
12581
|
for (const file3 of files) {
|
|
12538
|
-
const filePath =
|
|
12582
|
+
const filePath = join19(vendorDir, file3);
|
|
12539
12583
|
const content = readFileSync11(filePath, "utf-8");
|
|
12540
12584
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
12541
12585
|
continue;
|
|
@@ -12562,8 +12606,8 @@ __export(exports_buildSvelteVendor, {
|
|
|
12562
12606
|
buildSvelteVendor: () => buildSvelteVendor
|
|
12563
12607
|
});
|
|
12564
12608
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
12565
|
-
import { join as
|
|
12566
|
-
import { rm as
|
|
12609
|
+
import { join as join20 } from "path";
|
|
12610
|
+
import { rm as rm8 } from "fs/promises";
|
|
12567
12611
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
12568
12612
|
var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
12569
12613
|
try {
|
|
@@ -12576,13 +12620,13 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
12576
12620
|
const specifiers = resolveVendorSpecifiers2();
|
|
12577
12621
|
if (specifiers.length === 0)
|
|
12578
12622
|
return;
|
|
12579
|
-
const vendorDir =
|
|
12623
|
+
const vendorDir = join20(buildDir, "svelte", "vendor");
|
|
12580
12624
|
mkdirSync9(vendorDir, { recursive: true });
|
|
12581
|
-
const tmpDir =
|
|
12625
|
+
const tmpDir = join20(buildDir, "_svelte_vendor_tmp");
|
|
12582
12626
|
mkdirSync9(tmpDir, { recursive: true });
|
|
12583
12627
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12584
12628
|
const safeName = toSafeFileName4(specifier);
|
|
12585
|
-
const entryPath =
|
|
12629
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
12586
12630
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
12587
12631
|
`);
|
|
12588
12632
|
return entryPath;
|
|
@@ -12597,7 +12641,7 @@ var svelteSpecifiers, isResolvable3 = (specifier) => {
|
|
|
12597
12641
|
target: "browser",
|
|
12598
12642
|
throw: false
|
|
12599
12643
|
});
|
|
12600
|
-
await
|
|
12644
|
+
await rm8(tmpDir, { force: true, recursive: true });
|
|
12601
12645
|
if (!result.success) {
|
|
12602
12646
|
console.warn("\u26A0\uFE0F Svelte vendor build had errors:", result.logs);
|
|
12603
12647
|
}
|
|
@@ -12655,11 +12699,11 @@ var escapeRegex2 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), jsRewrit
|
|
|
12655
12699
|
if (Object.keys(vendorPaths).length === 0)
|
|
12656
12700
|
return;
|
|
12657
12701
|
const { readdirSync } = await import("fs");
|
|
12658
|
-
const { join:
|
|
12702
|
+
const { join: join21 } = await import("path");
|
|
12659
12703
|
const allFiles = [];
|
|
12660
12704
|
for (const dir of vendorDirs) {
|
|
12661
12705
|
try {
|
|
12662
|
-
const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) =>
|
|
12706
|
+
const files = readdirSync(dir).filter((f2) => f2.endsWith(".js")).map((f2) => join21(dir, f2));
|
|
12663
12707
|
allFiles.push(...files);
|
|
12664
12708
|
} catch {}
|
|
12665
12709
|
}
|
|
@@ -12735,7 +12779,7 @@ import {
|
|
|
12735
12779
|
statSync,
|
|
12736
12780
|
writeFileSync as writeFileSync6
|
|
12737
12781
|
} from "fs";
|
|
12738
|
-
import { basename as basename7, dirname as
|
|
12782
|
+
import { basename as basename7, dirname as dirname12, extname as extname6, join as join21, relative as relative10, resolve as resolve18 } from "path";
|
|
12739
12783
|
import { cwd, env as env2, exit } from "process";
|
|
12740
12784
|
var {build: bunBuild6, Glob: Glob7 } = globalThis.Bun;
|
|
12741
12785
|
var isDev, isBuildTraceEnabled = () => {
|
|
@@ -12813,8 +12857,8 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12813
12857
|
mkdirSync10(htmxDestDir, { recursive: true });
|
|
12814
12858
|
const glob = new Glob7("htmx*.min.js");
|
|
12815
12859
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
12816
|
-
const src =
|
|
12817
|
-
const dest =
|
|
12860
|
+
const src = join21(htmxDir, relPath);
|
|
12861
|
+
const dest = join21(htmxDestDir, "htmx.min.js");
|
|
12818
12862
|
copyFileSync(src, dest);
|
|
12819
12863
|
return;
|
|
12820
12864
|
}
|
|
@@ -12889,7 +12933,7 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12889
12933
|
vuePagesPath
|
|
12890
12934
|
}) => {
|
|
12891
12935
|
const { readdirSync: readDir } = await import("fs");
|
|
12892
|
-
const devIndexDir =
|
|
12936
|
+
const devIndexDir = join21(buildPath, "_src_indexes");
|
|
12893
12937
|
mkdirSync10(devIndexDir, { recursive: true });
|
|
12894
12938
|
if (reactIndexesPath && reactPagesPath) {
|
|
12895
12939
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -12907,35 +12951,35 @@ var isDev, isBuildTraceEnabled = () => {
|
|
|
12907
12951
|
const indexFiles = readDir(reactIndexesPath).filter((file3) => file3.endsWith(".tsx"));
|
|
12908
12952
|
const pagesRel = relative10(process.cwd(), resolve18(reactPagesPath)).replace(/\\/g, "/");
|
|
12909
12953
|
for (const file3 of indexFiles) {
|
|
12910
|
-
let content = readFileSync11(
|
|
12954
|
+
let content = readFileSync11(join21(reactIndexesPath, file3), "utf-8");
|
|
12911
12955
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
12912
|
-
writeFileSync6(
|
|
12956
|
+
writeFileSync6(join21(devIndexDir, file3), content);
|
|
12913
12957
|
}
|
|
12914
12958
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
12915
|
-
const svelteIndexDir =
|
|
12959
|
+
const svelteIndexDir = join21(svelteDir, "generated", "indexes");
|
|
12916
12960
|
const sveltePageEntries = svelteEntries.filter((file3) => resolve18(file3).startsWith(resolve18(sveltePagesPath)));
|
|
12917
12961
|
for (const entry of sveltePageEntries) {
|
|
12918
12962
|
const name = basename7(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
12919
|
-
const indexFile =
|
|
12963
|
+
const indexFile = join21(svelteIndexDir, "pages", `${name}.js`);
|
|
12920
12964
|
if (!existsSync18(indexFile))
|
|
12921
12965
|
continue;
|
|
12922
12966
|
let content = readFileSync11(indexFile, "utf-8");
|
|
12923
12967
|
const srcRel = relative10(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
|
|
12924
12968
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
12925
|
-
writeFileSync6(
|
|
12969
|
+
writeFileSync6(join21(devIndexDir, `${name}.svelte.js`), content);
|
|
12926
12970
|
}
|
|
12927
12971
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
12928
|
-
const vueIndexDir =
|
|
12972
|
+
const vueIndexDir = join21(vueDir, "generated", "indexes");
|
|
12929
12973
|
const vuePageEntries = vueEntries.filter((file3) => resolve18(file3).startsWith(resolve18(vuePagesPath)));
|
|
12930
12974
|
for (const entry of vuePageEntries) {
|
|
12931
12975
|
const name = basename7(entry, ".vue");
|
|
12932
|
-
const indexFile =
|
|
12976
|
+
const indexFile = join21(vueIndexDir, `${name}.js`);
|
|
12933
12977
|
if (!existsSync18(indexFile))
|
|
12934
12978
|
continue;
|
|
12935
12979
|
let content = readFileSync11(indexFile, "utf-8");
|
|
12936
12980
|
const srcRel = relative10(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
|
|
12937
12981
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
12938
|
-
writeFileSync6(
|
|
12982
|
+
writeFileSync6(join21(devIndexDir, `${name}.vue.js`), content);
|
|
12939
12983
|
}
|
|
12940
12984
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
12941
12985
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -13086,7 +13130,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13086
13130
|
]),
|
|
13087
13131
|
plugins: [...base.plugins ?? [], ...sanitized.plugins ?? []]
|
|
13088
13132
|
};
|
|
13089
|
-
},
|
|
13133
|
+
}, buildUnlocked = async ({
|
|
13090
13134
|
buildDirectory = "build",
|
|
13091
13135
|
assetsDirectory,
|
|
13092
13136
|
publicDirectory,
|
|
@@ -13156,10 +13200,10 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13156
13200
|
restoreTracePhase();
|
|
13157
13201
|
return;
|
|
13158
13202
|
}
|
|
13159
|
-
const traceDir =
|
|
13203
|
+
const traceDir = join21(buildPath2, ".absolute-trace");
|
|
13160
13204
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
13161
13205
|
mkdirSync10(traceDir, { recursive: true });
|
|
13162
|
-
writeFileSync6(
|
|
13206
|
+
writeFileSync6(join21(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
13163
13207
|
events: traceEvents,
|
|
13164
13208
|
frameworks: traceFrameworkNames,
|
|
13165
13209
|
generatedAt: new Date().toISOString(),
|
|
@@ -13189,14 +13233,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13189
13233
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
13190
13234
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
13191
13235
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
13192
|
-
const reactIndexesPath = reactDir &&
|
|
13193
|
-
const reactPagesPath = reactDir &&
|
|
13194
|
-
const htmlPagesPath = htmlDir &&
|
|
13195
|
-
const htmlScriptsPath = htmlDir &&
|
|
13196
|
-
const sveltePagesPath = svelteDir &&
|
|
13197
|
-
const vuePagesPath = vueDir &&
|
|
13198
|
-
const htmxPagesPath = htmxDir &&
|
|
13199
|
-
const angularPagesPath = angularDir &&
|
|
13236
|
+
const reactIndexesPath = reactDir && join21(reactDir, "generated", "indexes");
|
|
13237
|
+
const reactPagesPath = reactDir && join21(reactDir, "pages");
|
|
13238
|
+
const htmlPagesPath = htmlDir && join21(htmlDir, "pages");
|
|
13239
|
+
const htmlScriptsPath = htmlDir && join21(htmlDir, "scripts");
|
|
13240
|
+
const sveltePagesPath = svelteDir && join21(svelteDir, "pages");
|
|
13241
|
+
const vuePagesPath = vueDir && join21(vueDir, "pages");
|
|
13242
|
+
const htmxPagesPath = htmxDir && join21(htmxDir, "pages");
|
|
13243
|
+
const angularPagesPath = angularDir && join21(angularDir, "pages");
|
|
13200
13244
|
const frontends = [
|
|
13201
13245
|
reactDir,
|
|
13202
13246
|
htmlDir,
|
|
@@ -13227,19 +13271,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13227
13271
|
htmlDir,
|
|
13228
13272
|
vueDir,
|
|
13229
13273
|
angularDir,
|
|
13230
|
-
islandBootstrapPath &&
|
|
13274
|
+
islandBootstrapPath && dirname12(islandBootstrapPath)
|
|
13231
13275
|
].filter((dir) => Boolean(dir));
|
|
13232
13276
|
const clientRoot = isSingle ? sourceClientRoots[0] ?? projectRoot : commonAncestor(sourceClientRoots, projectRoot);
|
|
13233
13277
|
const serverDirMap = [];
|
|
13234
13278
|
if (svelteDir)
|
|
13235
13279
|
serverDirMap.push({
|
|
13236
13280
|
dir: svelteDir,
|
|
13237
|
-
subdir:
|
|
13281
|
+
subdir: join21("generated", "server")
|
|
13238
13282
|
});
|
|
13239
13283
|
if (vueDir)
|
|
13240
13284
|
serverDirMap.push({
|
|
13241
13285
|
dir: vueDir,
|
|
13242
|
-
subdir:
|
|
13286
|
+
subdir: join21("generated", "server")
|
|
13243
13287
|
});
|
|
13244
13288
|
if (angularDir)
|
|
13245
13289
|
serverDirMap.push({ dir: angularDir, subdir: "generated" });
|
|
@@ -13249,8 +13293,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13249
13293
|
const [firstEntry] = serverDirMap;
|
|
13250
13294
|
if (!firstEntry)
|
|
13251
13295
|
throw new Error("Expected at least one server directory entry");
|
|
13252
|
-
serverRoot =
|
|
13253
|
-
serverOutDir =
|
|
13296
|
+
serverRoot = join21(firstEntry.dir, firstEntry.subdir);
|
|
13297
|
+
serverOutDir = join21(buildPath, basename7(firstEntry.dir));
|
|
13254
13298
|
} else if (serverDirMap.length > 1) {
|
|
13255
13299
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
13256
13300
|
serverOutDir = buildPath;
|
|
@@ -13278,7 +13322,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13278
13322
|
await tracePhase("react/index-generation", () => generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr));
|
|
13279
13323
|
}
|
|
13280
13324
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f2) => f2.includes("/assets/")))) {
|
|
13281
|
-
await tracePhase("assets/copy", () => cpSync(assetsPath,
|
|
13325
|
+
await tracePhase("assets/copy", () => cpSync(assetsPath, join21(buildPath, "assets"), {
|
|
13282
13326
|
force: true,
|
|
13283
13327
|
recursive: true
|
|
13284
13328
|
}));
|
|
@@ -13327,7 +13371,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13327
13371
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
13328
13372
|
if (entry.startsWith(resolve18(reactIndexesPath))) {
|
|
13329
13373
|
const pageName = basename7(entry, ".tsx");
|
|
13330
|
-
return
|
|
13374
|
+
return join21(reactPagesPath, `${pageName}.tsx`);
|
|
13331
13375
|
}
|
|
13332
13376
|
return null;
|
|
13333
13377
|
}) : allReactEntries;
|
|
@@ -13424,7 +13468,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13424
13468
|
const compileReactConventions = async () => {
|
|
13425
13469
|
if (reactConventionSources.length === 0)
|
|
13426
13470
|
return emptyStringArray;
|
|
13427
|
-
const destDir =
|
|
13471
|
+
const destDir = join21(buildPath, "conventions", "react");
|
|
13428
13472
|
rmSync2(destDir, { force: true, recursive: true });
|
|
13429
13473
|
mkdirSync10(destDir, { recursive: true });
|
|
13430
13474
|
const destPaths = [];
|
|
@@ -13440,7 +13484,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13440
13484
|
naming: `${idx}-[name].[ext]`,
|
|
13441
13485
|
outdir: destDir,
|
|
13442
13486
|
plugins: [stylePreprocessorPlugin2],
|
|
13443
|
-
root:
|
|
13487
|
+
root: dirname12(source),
|
|
13444
13488
|
target: "bun",
|
|
13445
13489
|
throw: false,
|
|
13446
13490
|
tsconfig: "./tsconfig.json"
|
|
@@ -13468,7 +13512,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13468
13512
|
angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
|
|
13469
13513
|
]);
|
|
13470
13514
|
const bundleConventionFiles = async (framework, compiledPaths) => {
|
|
13471
|
-
const destDir =
|
|
13515
|
+
const destDir = join21(buildPath, "conventions", framework);
|
|
13472
13516
|
rmSync2(destDir, { force: true, recursive: true });
|
|
13473
13517
|
mkdirSync10(destDir, { recursive: true });
|
|
13474
13518
|
const destPaths = [];
|
|
@@ -13541,7 +13585,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13541
13585
|
}
|
|
13542
13586
|
})) : {
|
|
13543
13587
|
entries: [],
|
|
13544
|
-
generatedRoot:
|
|
13588
|
+
generatedRoot: join21(buildPath, "_island_entries")
|
|
13545
13589
|
};
|
|
13546
13590
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
13547
13591
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -13577,7 +13621,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13577
13621
|
return {};
|
|
13578
13622
|
}
|
|
13579
13623
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
13580
|
-
const refreshEntry =
|
|
13624
|
+
const refreshEntry = join21(reactIndexesPath, "_refresh.tsx");
|
|
13581
13625
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
13582
13626
|
reactClientEntryPoints.push(refreshEntry);
|
|
13583
13627
|
}
|
|
@@ -13680,19 +13724,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13680
13724
|
throw: false
|
|
13681
13725
|
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
13682
13726
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
13683
|
-
rmSync2(
|
|
13727
|
+
rmSync2(join21(buildPath, "react", "generated", "indexes"), {
|
|
13684
13728
|
force: true,
|
|
13685
13729
|
recursive: true
|
|
13686
13730
|
});
|
|
13687
13731
|
}
|
|
13688
13732
|
if (angularDir && angularClientPaths.length > 0) {
|
|
13689
|
-
rmSync2(
|
|
13733
|
+
rmSync2(join21(buildPath, "angular", "indexes"), {
|
|
13690
13734
|
force: true,
|
|
13691
13735
|
recursive: true
|
|
13692
13736
|
});
|
|
13693
13737
|
}
|
|
13694
13738
|
if (islandClientEntryPoints.length > 0) {
|
|
13695
|
-
rmSync2(
|
|
13739
|
+
rmSync2(join21(buildPath, "islands"), {
|
|
13696
13740
|
force: true,
|
|
13697
13741
|
recursive: true
|
|
13698
13742
|
});
|
|
@@ -13758,7 +13802,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13758
13802
|
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild6(mergeBunBuildConfig({
|
|
13759
13803
|
entrypoints: globalCssEntries,
|
|
13760
13804
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
13761
|
-
outdir: stylesDir ?
|
|
13805
|
+
outdir: stylesDir ? join21(buildPath, basename7(stylesDir)) : buildPath,
|
|
13762
13806
|
plugins: [stylePreprocessorPlugin2],
|
|
13763
13807
|
root: stylesDir || clientRoot,
|
|
13764
13808
|
target: "browser",
|
|
@@ -13767,7 +13811,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13767
13811
|
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild6(mergeBunBuildConfig({
|
|
13768
13812
|
entrypoints: vueCssPaths,
|
|
13769
13813
|
naming: `[name].[hash].[ext]`,
|
|
13770
|
-
outdir:
|
|
13814
|
+
outdir: join21(buildPath, assetsPath ? basename7(assetsPath) : "assets", "css"),
|
|
13771
13815
|
target: "browser",
|
|
13772
13816
|
throw: false
|
|
13773
13817
|
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
@@ -13835,7 +13879,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13835
13879
|
const { rewriteImports: rewriteImports2 } = await Promise.resolve().then(() => (init_rewriteImports(), exports_rewriteImports));
|
|
13836
13880
|
const jsArtifacts = serverOutputs.filter((artifact) => artifact.path.endsWith(".js"));
|
|
13837
13881
|
await tracePhase("postprocess/server-angular-vendor-imports", () => Promise.all(jsArtifacts.map(async (artifact) => {
|
|
13838
|
-
const fileDir =
|
|
13882
|
+
const fileDir = dirname12(artifact.path);
|
|
13839
13883
|
const relativePaths = {};
|
|
13840
13884
|
for (const [specifier, absolute] of Object.entries(angularServerVendorPaths2)) {
|
|
13841
13885
|
const rel = relative10(fileDir, absolute);
|
|
@@ -13915,7 +13959,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13915
13959
|
const processHtmlPages = async () => {
|
|
13916
13960
|
if (!(htmlDir && htmlPagesPath))
|
|
13917
13961
|
return;
|
|
13918
|
-
const outputHtmlPages = isSingle ?
|
|
13962
|
+
const outputHtmlPages = isSingle ? join21(buildPath, "pages") : join21(buildPath, basename7(htmlDir), "pages");
|
|
13919
13963
|
mkdirSync10(outputHtmlPages, { recursive: true });
|
|
13920
13964
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
13921
13965
|
force: true,
|
|
@@ -13937,14 +13981,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
13937
13981
|
const processHtmxPages = async () => {
|
|
13938
13982
|
if (!(htmxDir && htmxPagesPath))
|
|
13939
13983
|
return;
|
|
13940
|
-
const outputHtmxPages = isSingle ?
|
|
13984
|
+
const outputHtmxPages = isSingle ? join21(buildPath, "pages") : join21(buildPath, basename7(htmxDir), "pages");
|
|
13941
13985
|
mkdirSync10(outputHtmxPages, { recursive: true });
|
|
13942
13986
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
13943
13987
|
force: true,
|
|
13944
13988
|
recursive: true
|
|
13945
13989
|
});
|
|
13946
13990
|
if (shouldCopyHtmx) {
|
|
13947
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
13991
|
+
const htmxDestDir = isSingle ? buildPath : join21(buildPath, basename7(htmxDir));
|
|
13948
13992
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
13949
13993
|
}
|
|
13950
13994
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -14005,15 +14049,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
14005
14049
|
writeBuildTrace(buildPath);
|
|
14006
14050
|
return { conventions: conventionsMap, manifest };
|
|
14007
14051
|
}
|
|
14008
|
-
writeFileSync6(
|
|
14052
|
+
writeFileSync6(join21(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
14009
14053
|
if (Object.keys(conventionsMap).length > 0) {
|
|
14010
|
-
writeFileSync6(
|
|
14054
|
+
writeFileSync6(join21(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
14011
14055
|
}
|
|
14012
14056
|
writeBuildTrace(buildPath);
|
|
14013
14057
|
if (tailwind && mode === "production") {
|
|
14014
14058
|
disposeTailwindCompiler(tailwind.input);
|
|
14015
14059
|
}
|
|
14016
14060
|
return { conventions: conventionsMap, manifest };
|
|
14061
|
+
}, build = async (config) => {
|
|
14062
|
+
const projectRoot = cwd();
|
|
14063
|
+
const buildPath = validateSafePath(config.buildDirectory ?? "build", projectRoot);
|
|
14064
|
+
return await withBuildDirectoryLock(buildPath, () => buildUnlocked(config));
|
|
14017
14065
|
};
|
|
14018
14066
|
var init_build = __esm(() => {
|
|
14019
14067
|
init_constants();
|
|
@@ -14038,6 +14086,7 @@ var init_build = __esm(() => {
|
|
|
14038
14086
|
init_cleanStaleOutputs();
|
|
14039
14087
|
init_cleanup();
|
|
14040
14088
|
init_commonAncestor();
|
|
14089
|
+
init_buildDirectoryLock();
|
|
14041
14090
|
init_logger();
|
|
14042
14091
|
init_validateSafePath();
|
|
14043
14092
|
isDev = env2.NODE_ENV === "development";
|
|
@@ -14557,7 +14606,7 @@ var init_pathUtils = __esm(() => {
|
|
|
14557
14606
|
// src/dev/fileWatcher.ts
|
|
14558
14607
|
import { watch } from "fs";
|
|
14559
14608
|
import { existsSync as existsSync20 } from "fs";
|
|
14560
|
-
import { join as
|
|
14609
|
+
import { join as join22, resolve as resolve21 } from "path";
|
|
14561
14610
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
14562
14611
|
try {
|
|
14563
14612
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -14584,7 +14633,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
14584
14633
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
14585
14634
|
return;
|
|
14586
14635
|
}
|
|
14587
|
-
const fullPath =
|
|
14636
|
+
const fullPath = join22(absolutePath, filename).replace(/\\/g, "/");
|
|
14588
14637
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
14589
14638
|
return;
|
|
14590
14639
|
}
|
|
@@ -14733,7 +14782,7 @@ var init_assetStore = __esm(() => {
|
|
|
14733
14782
|
|
|
14734
14783
|
// src/islands/pageMetadata.ts
|
|
14735
14784
|
import { readFileSync as readFileSync13 } from "fs";
|
|
14736
|
-
import { dirname as
|
|
14785
|
+
import { dirname as dirname13, resolve as resolve23 } from "path";
|
|
14737
14786
|
var pagePatterns, getPageDirs = (config) => [
|
|
14738
14787
|
{ dir: config.angularDirectory, framework: "angular" },
|
|
14739
14788
|
{ dir: config.reactDirectory, framework: "react" },
|
|
@@ -14752,7 +14801,7 @@ var pagePatterns, getPageDirs = (config) => [
|
|
|
14752
14801
|
const source = definition.buildReference?.source;
|
|
14753
14802
|
if (!source)
|
|
14754
14803
|
continue;
|
|
14755
|
-
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve23(
|
|
14804
|
+
const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve23(dirname13(buildInfo.resolvedRegistryPath), source);
|
|
14756
14805
|
lookup.set(`${definition.framework}:${definition.component}`, resolve23(resolvedSource));
|
|
14757
14806
|
}
|
|
14758
14807
|
return lookup;
|
|
@@ -15140,7 +15189,7 @@ __export(exports_moduleServer, {
|
|
|
15140
15189
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
15141
15190
|
});
|
|
15142
15191
|
import { existsSync as existsSync21, readFileSync as readFileSync15, statSync as statSync2 } from "fs";
|
|
15143
|
-
import { basename as basename9, dirname as
|
|
15192
|
+
import { basename as basename9, dirname as dirname14, extname as extname7, resolve as resolve26, relative as relative11 } from "path";
|
|
15144
15193
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
15145
15194
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
15146
15195
|
const allExports = [];
|
|
@@ -15225,7 +15274,7 @@ ${stubs}
|
|
|
15225
15274
|
};
|
|
15226
15275
|
result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
|
|
15227
15276
|
result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
|
|
15228
|
-
const fileDir =
|
|
15277
|
+
const fileDir = dirname14(filePath);
|
|
15229
15278
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
15230
15279
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
|
|
15231
15280
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
@@ -15720,20 +15769,20 @@ export default {};
|
|
|
15720
15769
|
return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
|
|
15721
15770
|
if (!TRANSPILABLE.has(ext))
|
|
15722
15771
|
return;
|
|
15723
|
-
const
|
|
15772
|
+
const stat4 = statSync2(filePath);
|
|
15724
15773
|
const resolvedVueDir = vueDir ? resolve26(vueDir) : undefined;
|
|
15725
15774
|
const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
15726
|
-
setTransformed(filePath, content,
|
|
15775
|
+
setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
15727
15776
|
return jsResponse(content);
|
|
15728
15777
|
}, transformAndCacheSvelte = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
|
|
15729
|
-
const
|
|
15778
|
+
const stat4 = statSync2(filePath);
|
|
15730
15779
|
const content = await transformSvelteFile(filePath, projectRoot, rewriter, stylePreprocessors);
|
|
15731
|
-
setTransformed(filePath, content,
|
|
15780
|
+
setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
15732
15781
|
return jsResponse(content);
|
|
15733
15782
|
}, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
|
|
15734
|
-
const
|
|
15783
|
+
const stat4 = statSync2(filePath);
|
|
15735
15784
|
const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
|
|
15736
|
-
setTransformed(filePath, content,
|
|
15785
|
+
setTransformed(filePath, content, stat4.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
15737
15786
|
return jsResponse(content);
|
|
15738
15787
|
}, transformErrorResponse = (err) => {
|
|
15739
15788
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
@@ -15906,7 +15955,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
15906
15955
|
|
|
15907
15956
|
// src/dev/rebuildTrigger.ts
|
|
15908
15957
|
import { existsSync as existsSync22 } from "fs";
|
|
15909
|
-
import { basename as basename10, dirname as
|
|
15958
|
+
import { basename as basename10, dirname as dirname15, relative as relative12, resolve as resolve29 } from "path";
|
|
15910
15959
|
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) => {
|
|
15911
15960
|
if (!config.tailwind)
|
|
15912
15961
|
return;
|
|
@@ -16771,7 +16820,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
|
|
|
16771
16820
|
if (!buildReference?.source) {
|
|
16772
16821
|
return;
|
|
16773
16822
|
}
|
|
16774
|
-
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve29(
|
|
16823
|
+
const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve29(dirname15(buildInfo.resolvedRegistryPath), buildReference.source);
|
|
16775
16824
|
islandFiles.add(resolve29(sourcePath));
|
|
16776
16825
|
}, resolveIslandSourceFiles = async (config) => {
|
|
16777
16826
|
const registryPath = config.islands?.registry;
|
|
@@ -17550,8 +17599,8 @@ __export(exports_buildDepVendor, {
|
|
|
17550
17599
|
buildDepVendor: () => buildDepVendor
|
|
17551
17600
|
});
|
|
17552
17601
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
17553
|
-
import { join as
|
|
17554
|
-
import { rm as
|
|
17602
|
+
import { join as join23 } from "path";
|
|
17603
|
+
import { rm as rm9 } from "fs/promises";
|
|
17555
17604
|
var {build: bunBuild7, Glob: Glob9 } = globalThis.Bun;
|
|
17556
17605
|
var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_"), isResolvable4 = (specifier) => {
|
|
17557
17606
|
try {
|
|
@@ -17645,7 +17694,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17645
17694
|
}, buildDepVendorPass = async (specifiers, vendorDir, tmpDir) => {
|
|
17646
17695
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
17647
17696
|
const safeName = toSafeFileName5(specifier);
|
|
17648
|
-
const entryPath =
|
|
17697
|
+
const entryPath = join23(tmpDir, `${safeName}.ts`);
|
|
17649
17698
|
await Bun.write(entryPath, generateVendorEntrySource(specifier));
|
|
17650
17699
|
return entryPath;
|
|
17651
17700
|
}));
|
|
@@ -17664,9 +17713,9 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17664
17713
|
const { dep: initialSpecs, framework: frameworkRoots } = await scanBareImports(directories);
|
|
17665
17714
|
if (initialSpecs.length === 0 && frameworkRoots.length === 0)
|
|
17666
17715
|
return {};
|
|
17667
|
-
const vendorDir =
|
|
17716
|
+
const vendorDir = join23(buildDir, "vendor");
|
|
17668
17717
|
mkdirSync11(vendorDir, { recursive: true });
|
|
17669
|
-
const tmpDir =
|
|
17718
|
+
const tmpDir = join23(buildDir, "_dep_vendor_tmp");
|
|
17670
17719
|
mkdirSync11(tmpDir, { recursive: true });
|
|
17671
17720
|
const allSpecs = new Set(initialSpecs);
|
|
17672
17721
|
const alreadyScanned = new Set;
|
|
@@ -17686,7 +17735,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
17686
17735
|
if (!success) {
|
|
17687
17736
|
console.warn("\u26A0\uFE0F Dependency vendor build had errors:", result.logs);
|
|
17688
17737
|
}
|
|
17689
|
-
await
|
|
17738
|
+
await rm9(tmpDir, { force: true, recursive: true });
|
|
17690
17739
|
const paths = {};
|
|
17691
17740
|
for (const specifier of allSpecs) {
|
|
17692
17741
|
paths[specifier] = `/vendor/${toSafeFileName5(specifier)}.js`;
|
|
@@ -18096,5 +18145,5 @@ export {
|
|
|
18096
18145
|
build
|
|
18097
18146
|
};
|
|
18098
18147
|
|
|
18099
|
-
//# debugId=
|
|
18148
|
+
//# debugId=C28D21060C56A41A64756E2164756E21
|
|
18100
18149
|
//# sourceMappingURL=build.js.map
|