@absolutejs/absolute 0.20.0-beta.173 → 0.20.0-beta.175
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/changelog.json +71 -0
- package/dist/angular/browser.js +13 -2
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +113 -34
- package/dist/angular/index.js.map +12 -9
- package/dist/angular/server.js +113 -34
- package/dist/angular/server.js.map +12 -9
- package/dist/build.js +946 -731
- package/dist/build.js.map +40 -37
- package/dist/cli/{add-ae6mg79m.js → add-ntg96znk.js} +32 -31
- package/dist/cli/{compile-ndc36zna.js → compile-w2z6c9vt.js} +16 -14
- package/dist/cli/config/server.js +85 -65
- package/dist/cli/{dev-x49583aj.js → dev-8br5mr7t.js} +17 -3
- package/dist/cli/{expoProject-h404n2r8.js → expoProject-1qtw97js.js} +2 -1
- package/dist/cli/{generate-brvjesd6.js → generate-5vyz1s44.js} +7 -6
- package/dist/cli/{htmx-5twhjz7p.js → htmx-26hs6jdm.js} +2 -1
- package/dist/cli/{index-gyjxrnnz.js → index-23hvdyxf.js} +18 -16
- package/dist/cli/index-4j1twret.js +22 -0
- package/dist/cli/{index-z794p5qg.js → index-6522t968.js} +43 -21
- package/dist/cli/{index-25e7k849.js → index-7z1hh3fg.js} +4 -4
- package/dist/cli/{index-s0r5q839.js → index-cksezef8.js} +10 -8
- package/dist/cli/{index-q3snnhyd.js → index-enbw9484.js} +34 -33
- package/dist/cli/{index-b1wht4q5.js → index-kes8he5s.js} +6 -4
- package/dist/cli/{index-vh68jb0e.js → index-pkw3jktb.js} +17 -16
- package/dist/cli/{index-rervww4p.js → index-zyd80s3h.js} +119 -119
- package/dist/cli/index.js +11 -11
- package/dist/cli/{islands-p4vgx7a2.js → islands-bx67g15t.js} +8 -7
- package/dist/cli/{mobile-nqdkk3gd.js → mobile-we5q51ey.js} +5 -4
- package/dist/cli/{remove-abaf0w6k.js → remove-4jh862qa.js} +6 -5
- package/dist/cli/{start-t3cq57wn.js → start-srs11bm8.js} +5 -4
- package/dist/cli/{typecheck-fag7djt5.js → typecheck-7fvww3b7.js} +28 -26
- package/dist/client/chunks/index-4j1snyh2.js +18 -0
- package/dist/client/chunks/index-4j1snyh2.js.map +10 -0
- package/dist/client/chunks/{index-6b66nzyf.js → index-a3rpg5kw.js} +6 -16
- package/dist/client/chunks/{index-6b66nzyf.js.map → index-a3rpg5kw.js.map} +3 -4
- package/dist/client/chunks/{islands-s2ta5ajb.js → islands-mfjmdwnb.js} +11 -4
- package/dist/client/chunks/{islands-s2ta5ajb.js.map → islands-mfjmdwnb.js.map} +3 -3
- package/dist/client/chunks/{react-dcvkaba2.js → react-sprprqzs.js} +20 -4
- package/dist/client/chunks/react-sprprqzs.js.map +10 -0
- package/dist/client/chunks/svelte-6ewphsvj.js +30 -0
- package/dist/client/chunks/svelte-6ewphsvj.js.map +10 -0
- package/dist/client/chunks/{vue-a84fzp3v.js → vue-db6ppn1f.js} +14 -4
- package/dist/client/chunks/vue-db6ppn1f.js.map +10 -0
- package/dist/client/index.js +65 -8
- package/dist/client/index.js.map +4 -4
- package/dist/client/navigation.js +5 -3
- package/dist/client/navigation.js.map +2 -2
- package/dist/client/prefetch.js +1 -1
- package/dist/dev/client/handlers/islands.ts +85 -0
- package/dist/dev/client/hmrClient.ts +6 -0
- package/dist/dev/importCostReport.js +45 -26
- package/dist/index.js +1080 -852
- package/dist/index.js.map +41 -38
- package/dist/islands/index.js +57 -10
- package/dist/islands/index.js.map +9 -7
- package/dist/mobile/index.js +115 -95
- package/dist/mobile/index.js.map +6 -5
- package/dist/mobile/remoteMacAgentEntry.js +205 -651
- package/dist/react/browser.js +15 -4
- package/dist/react/browser.js.map +5 -5
- package/dist/react/components/client.js +506 -0
- package/dist/react/components/index.js +14 -15
- package/dist/react/components/index.js.map +4 -4
- package/dist/react/components/server/index.js +728 -0
- package/dist/react/hooks/index.js +14 -15
- package/dist/react/hooks/index.js.map +4 -4
- package/dist/react/index.js +66 -6
- package/dist/react/index.js.map +11 -9
- package/dist/react/router/browser.js +7 -8
- package/dist/react/router/browser.js.map +4 -4
- package/dist/react/router/index.js +7 -8
- package/dist/react/router/index.js.map +4 -4
- package/dist/react/server.js +14 -1
- package/dist/react/server.js.map +4 -4
- package/dist/src/build/buildReactServerComponents.d.ts +4 -0
- package/dist/src/build/islandEntries.d.ts +5 -0
- package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +3 -3
- package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +3 -3
- package/dist/src/client/hydrators/react.d.ts +7 -0
- package/dist/src/client/hydrators/svelte.d.ts +3 -0
- package/dist/src/client/hydrators/vue.d.ts +3 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +5 -0
- package/dist/src/core/islandServerGeneration.d.ts +3 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
- package/dist/src/dev/angular/hmrImportGenerator.d.ts +2 -2
- package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +2 -2
- package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +40 -40
- package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +3 -3
- package/dist/src/react/components/client.d.ts +4 -0
- package/dist/src/react/components/server/index.d.ts +8 -0
- package/dist/src/react/serverComponents/constants.d.ts +2 -1
- package/dist/src/utils/lazyTypescript.d.ts +3 -0
- package/dist/svelte/index.js +66 -6
- package/dist/svelte/index.js.map +10 -8
- package/dist/svelte/server.js +38 -3
- package/dist/svelte/server.js.map +6 -5
- package/dist/types/build.d.ts +3 -2
- package/dist/types/globals.d.ts +15 -0
- package/dist/vue/browser.js +26 -16
- package/dist/vue/browser.js.map +5 -5
- package/dist/vue/index.js +65 -21
- package/dist/vue/index.js.map +10 -9
- package/package.json +1 -1
- package/dist/client/chunks/react-dcvkaba2.js.map +0 -10
- package/dist/client/chunks/svelte-4yfa5bxa.js +0 -17
- package/dist/client/chunks/svelte-4yfa5bxa.js.map +0 -10
- package/dist/client/chunks/vue-a84fzp3v.js.map +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// .angular-partial-tmp-
|
|
2
|
+
// .angular-partial-tmp-0UabK1/src/core/streamingSlotRegistrar.ts
|
|
3
3
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
4
4
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
5
5
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// .angular-partial-tmp-
|
|
2
|
+
// .angular-partial-tmp-0UabK1/src/core/streamingSlotRegistrar.ts
|
|
3
3
|
var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
|
|
4
4
|
var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
|
|
5
5
|
var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
|
|
@@ -46,7 +46,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
|
|
|
46
46
|
getWarningController()?.maybeWarn(primitiveName);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
// .angular-partial-tmp-
|
|
49
|
+
// .angular-partial-tmp-0UabK1/src/core/streamingSlotRegistry.ts
|
|
50
50
|
var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
|
|
51
51
|
var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
|
|
52
52
|
var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
|
package/dist/angular/index.js
CHANGED
|
@@ -1665,6 +1665,19 @@ var init_ssrRender = __esm(() => {
|
|
|
1665
1665
|
selectorCache = new Map;
|
|
1666
1666
|
});
|
|
1667
1667
|
|
|
1668
|
+
// src/dev/client/cspNonce.ts
|
|
1669
|
+
var applyPageNonce = (element) => {
|
|
1670
|
+
const nonce = readPageNonce();
|
|
1671
|
+
if (nonce)
|
|
1672
|
+
element.nonce = nonce;
|
|
1673
|
+
return element;
|
|
1674
|
+
}, readPageNonce = () => {
|
|
1675
|
+
if (typeof document === "undefined")
|
|
1676
|
+
return;
|
|
1677
|
+
const carrier = document.querySelector("script[nonce], style[nonce]");
|
|
1678
|
+
return carrier?.nonce || undefined;
|
|
1679
|
+
};
|
|
1680
|
+
|
|
1668
1681
|
// src/angular/islands.ts
|
|
1669
1682
|
var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
|
|
1670
1683
|
const requestId = getSsrContextId();
|
|
@@ -3158,10 +3171,25 @@ var init_lazyModule = __esm(() => {
|
|
|
3158
3171
|
LAZY_RESOLVED_KEY = Symbol.for("absolutejs.svelte.lazy-resolved");
|
|
3159
3172
|
});
|
|
3160
3173
|
|
|
3174
|
+
// src/core/islandServerGeneration.ts
|
|
3175
|
+
var readGeneration = () => globalThis.__absoluteIslandServerGeneration ?? 0, bumpIslandServerGeneration = () => {
|
|
3176
|
+
globalThis.__absoluteIslandServerGeneration = readGeneration() + 1;
|
|
3177
|
+
}, createIslandGenerationGuard = (reset) => {
|
|
3178
|
+
let seen = readGeneration();
|
|
3179
|
+
return () => {
|
|
3180
|
+
const current = readGeneration();
|
|
3181
|
+
if (current === seen)
|
|
3182
|
+
return current;
|
|
3183
|
+
seen = current;
|
|
3184
|
+
reset();
|
|
3185
|
+
return current;
|
|
3186
|
+
};
|
|
3187
|
+
};
|
|
3188
|
+
|
|
3161
3189
|
// src/core/svelteServerModule.ts
|
|
3162
3190
|
import { mkdir as mkdir2, readdir as readdir2 } from "fs/promises";
|
|
3163
3191
|
import { basename as basename3, dirname as dirname3, extname as extname2, join as join6, relative as relative3, resolve as resolve4 } from "path";
|
|
3164
|
-
var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
3192
|
+
var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, syncIslandGeneration, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
3165
3193
|
const importPath = relative3(dirname3(from), target).replace(/\\/g, "/");
|
|
3166
3194
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
3167
3195
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
@@ -3228,7 +3256,9 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
|
|
|
3228
3256
|
}, getCachedModulePath2 = (sourcePath) => {
|
|
3229
3257
|
const relativeSourcePath = relative3(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
3230
3258
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
3231
|
-
|
|
3259
|
+
const generation = syncIslandGeneration();
|
|
3260
|
+
const generationSuffix = generation > 0 ? `.g${generation}` : "";
|
|
3261
|
+
return join6(serverCacheRoot2, `${normalizedSourcePath}${generationSuffix}.server.js`);
|
|
3232
3262
|
}, resolveSvelteImport = async (spec, from) => {
|
|
3233
3263
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
3234
3264
|
const resolved = resolvePackageImport(spec);
|
|
@@ -3260,6 +3290,7 @@ var serverCacheRoot2, compiledModuleCache2, originalSourcePathCache, transpiler,
|
|
|
3260
3290
|
}
|
|
3261
3291
|
await Bun.write(path, content);
|
|
3262
3292
|
}, compileSvelteServerModule = async (sourcePath) => {
|
|
3293
|
+
syncIslandGeneration();
|
|
3263
3294
|
const cachedModulePath = compiledModuleCache2.get(sourcePath);
|
|
3264
3295
|
if (cachedModulePath) {
|
|
3265
3296
|
return cachedModulePath;
|
|
@@ -3342,6 +3373,10 @@ var init_svelteServerModule = __esm(() => {
|
|
|
3342
3373
|
serverCacheRoot2 = join6(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
3343
3374
|
compiledModuleCache2 = new Map;
|
|
3344
3375
|
originalSourcePathCache = new Map;
|
|
3376
|
+
syncIslandGeneration = createIslandGenerationGuard(() => {
|
|
3377
|
+
compiledModuleCache2.clear();
|
|
3378
|
+
originalSourcePathCache.clear();
|
|
3379
|
+
});
|
|
3345
3380
|
transpiler = new Bun.Transpiler({
|
|
3346
3381
|
loader: "ts",
|
|
3347
3382
|
target: "browser"
|
|
@@ -3375,13 +3410,15 @@ import { readFileSync as readFileSync4, realpathSync } from "fs";
|
|
|
3375
3410
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
3376
3411
|
import { dirname as dirname4, join as join7, relative as relative4, resolve as resolve5 } from "path";
|
|
3377
3412
|
var {Transpiler } = globalThis.Bun;
|
|
3378
|
-
var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
3413
|
+
var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, syncIslandGeneration2, transpiler2, ensureRelativeImportPath2 = (from, target) => {
|
|
3379
3414
|
const importPath = relative4(dirname4(from), target).replace(/\\/g, "/");
|
|
3380
3415
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
3381
3416
|
}, getCachedModulePath3 = (sourcePath) => {
|
|
3382
3417
|
const relativeSourcePath = relative4(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
3383
3418
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
3384
|
-
|
|
3419
|
+
const generation = syncIslandGeneration2();
|
|
3420
|
+
const generationSuffix = generation > 0 ? `.g${generation}` : "";
|
|
3421
|
+
return join7(serverCacheRoot3, `${normalizedSourcePath}${generationSuffix}.server.js`);
|
|
3385
3422
|
}, writeIfChanged2 = async (path, content) => {
|
|
3386
3423
|
const targetFile = Bun.file(path);
|
|
3387
3424
|
if (await targetFile.exists()) {
|
|
@@ -3408,6 +3445,7 @@ var ISLAND_COMPONENT_ID_LENGTH = 8, serverCacheRoot3, compiledModuleCache3, tran
|
|
|
3408
3445
|
`) : nonVueLines.join(`
|
|
3409
3446
|
`);
|
|
3410
3447
|
}, extractRelativeVueImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => typeof importPath === "string" && importPath.startsWith(".") && importPath.endsWith(".vue")), compileVueServerModule = async (sourcePath) => {
|
|
3448
|
+
syncIslandGeneration2();
|
|
3411
3449
|
const cachedModulePath = compiledModuleCache3.get(sourcePath);
|
|
3412
3450
|
if (cachedModulePath)
|
|
3413
3451
|
return cachedModulePath;
|
|
@@ -3468,6 +3506,9 @@ var init_vueServerModule = __esm(() => {
|
|
|
3468
3506
|
init_isFile();
|
|
3469
3507
|
serverCacheRoot3 = join7(process.cwd(), ".absolutejs", "islands", "vue");
|
|
3470
3508
|
compiledModuleCache3 = new Map;
|
|
3509
|
+
syncIslandGeneration2 = createIslandGenerationGuard(() => {
|
|
3510
|
+
compiledModuleCache3.clear();
|
|
3511
|
+
});
|
|
3471
3512
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
3472
3513
|
});
|
|
3473
3514
|
|
|
@@ -3510,7 +3551,7 @@ var init_islandMarkupAttributes = __esm(() => {
|
|
|
3510
3551
|
});
|
|
3511
3552
|
|
|
3512
3553
|
// src/core/renderIslandMarkup.ts
|
|
3513
|
-
var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, nextIslandId = () => {
|
|
3554
|
+
var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, syncIslandGeneration3, nextIslandId = () => {
|
|
3514
3555
|
islandSequence += 1;
|
|
3515
3556
|
return `island-${islandSequence}`;
|
|
3516
3557
|
}, isRecord5 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord5(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => {
|
|
@@ -3524,6 +3565,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
3524
3565
|
const loadedModule = await import(compiledModulePath);
|
|
3525
3566
|
return "default" in loadedModule ? loadedModule.default : loadedModule;
|
|
3526
3567
|
}, loadServerBuildComponent = async (buildReferencePath) => {
|
|
3568
|
+
syncIslandGeneration3();
|
|
3527
3569
|
const cachedBuildComponent = resolvedServerBuildComponentCache.get(buildReferencePath);
|
|
3528
3570
|
if (cachedBuildComponent) {
|
|
3529
3571
|
return cachedBuildComponent;
|
|
@@ -3562,6 +3604,7 @@ var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildCompone
|
|
|
3562
3604
|
}
|
|
3563
3605
|
return loadServerImportComponent(resolvedComponent);
|
|
3564
3606
|
}, resolveServerIslandComponent = async (component) => {
|
|
3607
|
+
syncIslandGeneration3();
|
|
3565
3608
|
const cachedResolvedComponent = resolvedServerComponentCache.get(component);
|
|
3566
3609
|
if (cachedResolvedComponent) {
|
|
3567
3610
|
return cachedResolvedComponent;
|
|
@@ -3660,6 +3703,10 @@ var init_renderIslandMarkup = __esm(() => {
|
|
|
3660
3703
|
init_islands2();
|
|
3661
3704
|
resolvedServerComponentCache = new Map;
|
|
3662
3705
|
resolvedServerBuildComponentCache = new Map;
|
|
3706
|
+
syncIslandGeneration3 = createIslandGenerationGuard(() => {
|
|
3707
|
+
resolvedServerComponentCache.clear();
|
|
3708
|
+
resolvedServerBuildComponentCache.clear();
|
|
3709
|
+
});
|
|
3663
3710
|
});
|
|
3664
3711
|
|
|
3665
3712
|
// src/core/devRouteRegistrationCallsite.ts
|
|
@@ -4956,6 +5003,26 @@ var init_partialPrerender = __esm(() => {
|
|
|
4956
5003
|
SINK_STORAGE_KEY = Symbol.for("absolutejs.partialPrerenderHolesSink");
|
|
4957
5004
|
});
|
|
4958
5005
|
|
|
5006
|
+
// src/utils/lazyTypescript.ts
|
|
5007
|
+
import { createRequire as createRequire2 } from "module";
|
|
5008
|
+
var loaded, loadTypescript = () => {
|
|
5009
|
+
if (loaded)
|
|
5010
|
+
return loaded;
|
|
5011
|
+
const requireFromHere = createRequire2(import.meta.url);
|
|
5012
|
+
const typescript = requireFromHere("typescript");
|
|
5013
|
+
loaded = typescript;
|
|
5014
|
+
return typescript;
|
|
5015
|
+
}, createLazyTypescript = () => {
|
|
5016
|
+
const target = Object.create(null);
|
|
5017
|
+
return new Proxy(target, {
|
|
5018
|
+
get: (_target, key) => Reflect.get(loadTypescript(), key),
|
|
5019
|
+
has: (_target, key) => Reflect.has(loadTypescript(), key)
|
|
5020
|
+
});
|
|
5021
|
+
}, lazyTypescript;
|
|
5022
|
+
var init_lazyTypescript = __esm(() => {
|
|
5023
|
+
lazyTypescript = createLazyTypescript();
|
|
5024
|
+
});
|
|
5025
|
+
|
|
4959
5026
|
// src/islands/sourceMetadata.ts
|
|
4960
5027
|
var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => islandFrameworks2.some((framework) => framework === value), isIslandHydrate2 = (value) => islandHydrationModes2.some((hydrate) => hydrate === value), parseIslandTagAttributes = (attributeString) => {
|
|
4961
5028
|
const frameworkMatch = attributeString.match(/\bframework\s*=\s*["']([^"']+)["']/);
|
|
@@ -5505,22 +5572,22 @@ var GENERATED_DIR_NAME = "generated", ABSOLUTE_CACHE_DIR_NAME = ".absolutejs", g
|
|
|
5505
5572
|
var init_generatedDir = () => {};
|
|
5506
5573
|
|
|
5507
5574
|
// src/build/downlevelAsyncForZone.ts
|
|
5508
|
-
import ts from "typescript";
|
|
5509
5575
|
var ASYNC_KEYWORD, downlevelAsyncForZone = (code, fileName) => {
|
|
5510
5576
|
if (!isAngularZoneMode() || !ASYNC_KEYWORD.test(code))
|
|
5511
5577
|
return code;
|
|
5512
|
-
return
|
|
5578
|
+
return lazyTypescript.transpileModule(code, {
|
|
5513
5579
|
compilerOptions: {
|
|
5514
5580
|
importHelpers: false,
|
|
5515
|
-
module:
|
|
5581
|
+
module: lazyTypescript.ModuleKind.ESNext,
|
|
5516
5582
|
sourceMap: false,
|
|
5517
|
-
target:
|
|
5583
|
+
target: lazyTypescript.ScriptTarget.ES2016,
|
|
5518
5584
|
useDefineForClassFields: false
|
|
5519
5585
|
},
|
|
5520
5586
|
fileName: fileName.replace(/\.[cm]?[tj]sx?$/, ".js")
|
|
5521
5587
|
}).outputText;
|
|
5522
5588
|
};
|
|
5523
5589
|
var init_downlevelAsyncForZone = __esm(() => {
|
|
5590
|
+
init_lazyTypescript();
|
|
5524
5591
|
ASYNC_KEYWORD = /\basync\b/;
|
|
5525
5592
|
});
|
|
5526
5593
|
|
|
@@ -5534,7 +5601,6 @@ __export(exports_compileAngular, {
|
|
|
5534
5601
|
import { existsSync as existsSync5, readFileSync as readFileSync6, promises as fs } from "fs";
|
|
5535
5602
|
import { join as join9, basename as basename4, sep, dirname as dirname5, resolve as resolve6, relative as relative5 } from "path";
|
|
5536
5603
|
var {Glob } = globalThis.Bun;
|
|
5537
|
-
import ts2 from "typescript";
|
|
5538
5604
|
var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) => {
|
|
5539
5605
|
const temporaryPath = `${path}.tmp.${process.pid}.${atomicWriteSequence++}`;
|
|
5540
5606
|
try {
|
|
@@ -5549,7 +5615,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5549
5615
|
}, readTsconfigPathAliases = () => {
|
|
5550
5616
|
try {
|
|
5551
5617
|
const configPath = resolve6(process.cwd(), "tsconfig.json");
|
|
5552
|
-
const config =
|
|
5618
|
+
const config = lazyTypescript.readConfigFile(configPath, lazyTypescript.sys.readFile).config;
|
|
5553
5619
|
const compilerOptions = config?.compilerOptions ?? {};
|
|
5554
5620
|
const baseUrl = resolve6(process.cwd(), compilerOptions.baseUrl ?? ".");
|
|
5555
5621
|
const aliases = Object.entries(compilerOptions.paths ?? {}).map(([pattern, replacements]) => ({ pattern, replacements }));
|
|
@@ -5678,7 +5744,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5678
5744
|
return resolve6(import.meta.dir, "./dev/client");
|
|
5679
5745
|
}, devClientDir, hmrClientPath, formatDiagnosticMessage = (diagnostic) => {
|
|
5680
5746
|
try {
|
|
5681
|
-
return
|
|
5747
|
+
return lazyTypescript.flattenDiagnosticMessageText(diagnostic.messageText, `
|
|
5682
5748
|
`);
|
|
5683
5749
|
} catch {
|
|
5684
5750
|
return String(diagnostic.messageText || "Unknown error");
|
|
@@ -5686,7 +5752,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5686
5752
|
}, throwOnCompilationErrors = (diagnostics) => {
|
|
5687
5753
|
if (!diagnostics?.length)
|
|
5688
5754
|
return;
|
|
5689
|
-
const errors = diagnostics.filter((diag) => diag.category ===
|
|
5755
|
+
const errors = diagnostics.filter((diag) => diag.category === lazyTypescript.DiagnosticCategory.Error);
|
|
5690
5756
|
if (!errors.length)
|
|
5691
5757
|
return;
|
|
5692
5758
|
const fullMessage = errors.map(formatDiagnosticMessage).join(`
|
|
@@ -5728,22 +5794,22 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5728
5794
|
}
|
|
5729
5795
|
return `${path}.js${query}`;
|
|
5730
5796
|
}, isRelativeModuleSpecifier = (specifier) => specifier.startsWith("./") || specifier.startsWith("../"), extractLocalImportSpecifiers = (source, fileName) => {
|
|
5731
|
-
const sourceFile =
|
|
5797
|
+
const sourceFile = lazyTypescript.createSourceFile(fileName, source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.TS);
|
|
5732
5798
|
const specifiers = [];
|
|
5733
5799
|
const addSpecifier = (node) => {
|
|
5734
|
-
if (!node || !
|
|
5800
|
+
if (!node || !lazyTypescript.isStringLiteralLike(node))
|
|
5735
5801
|
return;
|
|
5736
5802
|
const specifier = node.text;
|
|
5737
5803
|
if (isRelativeModuleSpecifier(specifier))
|
|
5738
5804
|
specifiers.push(specifier);
|
|
5739
5805
|
};
|
|
5740
5806
|
const visit = (node) => {
|
|
5741
|
-
if (
|
|
5807
|
+
if (lazyTypescript.isImportDeclaration(node) || lazyTypescript.isExportDeclaration(node)) {
|
|
5742
5808
|
addSpecifier(node.moduleSpecifier);
|
|
5743
|
-
} else if (
|
|
5809
|
+
} else if (lazyTypescript.isCallExpression(node) && node.expression.kind === lazyTypescript.SyntaxKind.ImportKeyword) {
|
|
5744
5810
|
addSpecifier(node.arguments[0]);
|
|
5745
5811
|
}
|
|
5746
|
-
|
|
5812
|
+
lazyTypescript.forEachChild(node, visit);
|
|
5747
5813
|
};
|
|
5748
5814
|
visit(sourceFile);
|
|
5749
5815
|
return specifiers;
|
|
@@ -5891,25 +5957,25 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5891
5957
|
emitDecoratorMetadata: true,
|
|
5892
5958
|
esModuleInterop: true,
|
|
5893
5959
|
experimentalDecorators: true,
|
|
5894
|
-
module:
|
|
5895
|
-
moduleResolution:
|
|
5896
|
-
newLine:
|
|
5960
|
+
module: lazyTypescript.ModuleKind.ESNext,
|
|
5961
|
+
moduleResolution: lazyTypescript.ModuleResolutionKind.Bundler,
|
|
5962
|
+
newLine: lazyTypescript.NewLineKind.LineFeed,
|
|
5897
5963
|
noLib: false,
|
|
5898
5964
|
outDir,
|
|
5899
5965
|
skipLibCheck: true,
|
|
5900
|
-
target:
|
|
5966
|
+
target: lazyTypescript.ScriptTarget.ES2022,
|
|
5901
5967
|
...config.options
|
|
5902
5968
|
};
|
|
5903
|
-
options.target =
|
|
5969
|
+
options.target = lazyTypescript.ScriptTarget.ES2022;
|
|
5904
5970
|
options.experimentalDecorators = true;
|
|
5905
5971
|
options.emitDecoratorMetadata = true;
|
|
5906
|
-
options.newLine =
|
|
5972
|
+
options.newLine = lazyTypescript.NewLineKind.LineFeed;
|
|
5907
5973
|
options.outDir = outDir;
|
|
5908
5974
|
options.noEmit = false;
|
|
5909
5975
|
options.incremental = false;
|
|
5910
5976
|
options.tsBuildInfoFile = undefined;
|
|
5911
5977
|
options.rootDir = process.cwd();
|
|
5912
|
-
const host = await traceAngularPhase("aot/create-compiler-host", () =>
|
|
5978
|
+
const host = await traceAngularPhase("aot/create-compiler-host", () => lazyTypescript.createCompilerHost(options));
|
|
5913
5979
|
const originalGetDefaultLibLocation = host.getDefaultLibLocation;
|
|
5914
5980
|
host.getDefaultLibLocation = () => tsLibDir || (originalGetDefaultLibLocation ? originalGetDefaultLibLocation() : "");
|
|
5915
5981
|
const originalGetDefaultLibFileName = host.getDefaultLibFileName;
|
|
@@ -5955,7 +6021,7 @@ var atomicWriteSequence = 0, writeTextFileAtomically = async (path, content) =>
|
|
|
5955
6021
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
5956
6022
|
const source = transformedSources.get(resolve6(fileName));
|
|
5957
6023
|
if (source) {
|
|
5958
|
-
return
|
|
6024
|
+
return lazyTypescript.createSourceFile(fileName, source, languageVersion, true);
|
|
5959
6025
|
}
|
|
5960
6026
|
return originalGetSourceFileForCompile?.call(host, fileName, languageVersion, onError);
|
|
5961
6027
|
};
|
|
@@ -6484,8 +6550,8 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
6484
6550
|
}
|
|
6485
6551
|
}
|
|
6486
6552
|
return allOutputs;
|
|
6487
|
-
}, ROUTER_OUTLET_PATTERN, COMPONENT_MARKER_PATTERN, isExportedClass = (statement) =>
|
|
6488
|
-
if (!
|
|
6553
|
+
}, ROUTER_OUTLET_PATTERN, COMPONENT_MARKER_PATTERN, isExportedClass = (statement) => lazyTypescript.isClassDeclaration(statement) && statement.name !== undefined && (lazyTypescript.getModifiers(statement) ?? []).some((modifier) => modifier.kind === lazyTypescript.SyntaxKind.ExportKeyword), statementReferencesClass = (statement, className, sourceFile) => {
|
|
6554
|
+
if (!lazyTypescript.isExpressionStatement(statement))
|
|
6489
6555
|
return false;
|
|
6490
6556
|
const text = statement.getText(sourceFile);
|
|
6491
6557
|
return new RegExp(`^\\s*${className}\\s*=`).test(text) || new RegExp(`\u0275setClassMetadata\\(\\s*${className}\\b`).test(text);
|
|
@@ -6493,16 +6559,16 @@ export const __ABSOLUTE_PAGE_USES_LEGACY_ANIMATIONS__ = true;
|
|
|
6493
6559
|
const defaultMatch = source.match(/export\s+default\s+([A-Za-z_$][\w$]*)\s*;/);
|
|
6494
6560
|
if (defaultMatch)
|
|
6495
6561
|
return defaultMatch[1] ?? null;
|
|
6496
|
-
const sourceFile =
|
|
6562
|
+
const sourceFile = lazyTypescript.createSourceFile("page.js", source, lazyTypescript.ScriptTarget.Latest, true, lazyTypescript.ScriptKind.JS);
|
|
6497
6563
|
const exportedNames = new Set;
|
|
6498
6564
|
for (const statement of sourceFile.statements) {
|
|
6499
|
-
if (!
|
|
6565
|
+
if (!lazyTypescript.isExportDeclaration(statement) || statement.moduleSpecifier || !statement.exportClause || !lazyTypescript.isNamedExports(statement.exportClause))
|
|
6500
6566
|
continue;
|
|
6501
6567
|
for (const element of statement.exportClause.elements) {
|
|
6502
6568
|
exportedNames.add((element.propertyName ?? element.name).text);
|
|
6503
6569
|
}
|
|
6504
6570
|
}
|
|
6505
|
-
const candidates = sourceFile.statements.filter(
|
|
6571
|
+
const candidates = sourceFile.statements.filter(lazyTypescript.isClassDeclaration).filter((statement) => isExportedClass(statement) || exportedNames.has(statement.name?.text ?? "")).map((statement) => {
|
|
6506
6572
|
const className = statement.name?.text ?? "";
|
|
6507
6573
|
const related = sourceFile.statements.filter((other) => statementReferencesClass(other, className, sourceFile)).map((other) => other.getText(sourceFile));
|
|
6508
6574
|
const text = [statement.getText(sourceFile), ...related].join(`
|
|
@@ -6692,7 +6758,7 @@ import '@angular/compiler';
|
|
|
6692
6758
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
6693
6759
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
6694
6760
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
6695
|
-
import { ${changeDetectionImport}, REQUEST_CONTEXT } from '@angular/core';
|
|
6761
|
+
import { ${changeDetectionImport}, CSP_NONCE, REQUEST_CONTEXT } from '@angular/core';
|
|
6696
6762
|
import { APP_BASE_HREF as __abs_APP_BASE_HREF } from '@angular/common';
|
|
6697
6763
|
import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
|
|
6698
6764
|
import * as pageModule from '${normalizedImportPath}';
|
|
@@ -6709,6 +6775,12 @@ var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-ra
|
|
|
6709
6775
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
6710
6776
|
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
6711
6777
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
6778
|
+
// Under secureHeaders() the policy only allows <style> elements that carry
|
|
6779
|
+
// the page's nonce. Angular adds one for every component it renders or
|
|
6780
|
+
// hot-updates in the browser, so hand it the nonce the server put on the
|
|
6781
|
+
// page (browsers hide the attribute's value; the property keeps it).
|
|
6782
|
+
var cspNonce = (document.querySelector('script[nonce], style[nonce]') || {}).nonce;
|
|
6783
|
+
if (cspNonce) contextProviders.push({ provide: CSP_NONCE, useValue: cspNonce });
|
|
6712
6784
|
// Page-level providers are injected directly into the page module's
|
|
6713
6785
|
// server output by \`compileAngular\`'s providers-injection step
|
|
6714
6786
|
// (\`...appProviders, provideRouter(routes), { APP_BASE_HREF }\`),
|
|
@@ -6812,7 +6884,7 @@ ${zoneImport}import '@angular/compiler';
|
|
|
6812
6884
|
import { bootstrapApplication } from '@angular/platform-browser';
|
|
6813
6885
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
6814
6886
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
6815
|
-
import { enableProdMode, ${changeDetectionImport}, REQUEST_CONTEXT } from '@angular/core';
|
|
6887
|
+
import { enableProdMode, ${changeDetectionImport}, CSP_NONCE, REQUEST_CONTEXT } from '@angular/core';
|
|
6816
6888
|
import { APP_BASE_HREF as __abs_APP_BASE_HREF } from '@angular/common';
|
|
6817
6889
|
import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
|
|
6818
6890
|
import * as pageModule from '${normalizedImportPath}';
|
|
@@ -6829,6 +6901,12 @@ var pageHasRawStreamingSlots = Boolean(document.querySelector('[data-absolute-ra
|
|
|
6829
6901
|
var pageHasStreamingSlots = Boolean(document.querySelector('[data-absolute-slot="true"]'));
|
|
6830
6902
|
var isClientRender = window.__ABSOLUTE_PAGE_RENDER_MODE__ === 'client';
|
|
6831
6903
|
var contextProviders = [{ provide: REQUEST_CONTEXT, useValue: requestContext }];
|
|
6904
|
+
// Under secureHeaders() the policy only allows <style> elements that carry
|
|
6905
|
+
// the page's nonce. Angular adds one for every component it renders or
|
|
6906
|
+
// hot-updates in the browser, so hand it the nonce the server put on the
|
|
6907
|
+
// page (browsers hide the attribute's value; the property keeps it).
|
|
6908
|
+
var cspNonce = (document.querySelector('script[nonce], style[nonce]') || {}).nonce;
|
|
6909
|
+
if (cspNonce) contextProviders.push({ provide: CSP_NONCE, useValue: cspNonce });
|
|
6832
6910
|
// Page-level providers are injected directly into the page module's
|
|
6833
6911
|
// server output by \`compileAngular\`'s providers-injection step
|
|
6834
6912
|
// (\`...appProviders, provideRouter(routes), { APP_BASE_HREF }\`),
|
|
@@ -6929,6 +7007,7 @@ window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
|
6929
7007
|
};
|
|
6930
7008
|
};
|
|
6931
7009
|
var init_compileAngular = __esm(() => {
|
|
7010
|
+
init_lazyTypescript();
|
|
6932
7011
|
init_constants();
|
|
6933
7012
|
init_sourceMetadata();
|
|
6934
7013
|
init_lowerDeferSyntax();
|
|
@@ -17268,5 +17347,5 @@ export {
|
|
|
17268
17347
|
withPendingTask
|
|
17269
17348
|
};
|
|
17270
17349
|
|
|
17271
|
-
//# debugId=
|
|
17350
|
+
//# debugId=F46FD0E47DF0EDC864756E2164756E21
|
|
17272
17351
|
//# sourceMappingURL=index.js.map
|