@absolutejs/absolute 0.20.0-beta.179 → 0.20.0-beta.180
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 +23 -0
- package/changelog.json +45 -0
- package/dist/angular/browser.js +2 -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 +21 -6
- package/dist/angular/index.js.map +6 -6
- package/dist/angular/server.js +21 -6
- package/dist/angular/server.js.map +6 -6
- package/dist/build.js +5357 -4945
- package/dist/build.js.map +27 -24
- package/dist/cli/build-fntmf42w.js +495 -0
- package/dist/cli/{buildDepVendor-qvsh6dsj.js → buildDepVendor-qnwfct22.js} +5 -3
- package/dist/cli/buildReactServerComponents-fq6mw10d.js +13 -0
- package/dist/cli/{compile-p5yv6ecp.js → compile-54rb8szn.js} +94 -125
- package/dist/cli/config/server.js +10 -5
- package/dist/cli/{dev-2hbcsvkp.js → dev-6s6g5tnk.js} +13 -14
- package/dist/cli/{expoProject-1qtw97js.js → expoProject-acgfaj3f.js} +2 -1
- package/dist/cli/generatedDir-239r7csr.js +9 -0
- package/dist/cli/{index-cksezef8.js → index-0gd30trc.js} +105 -851
- package/dist/cli/index-2wvysvjc.js +40 -0
- package/dist/cli/index-42xjh6gg.js +282 -0
- package/dist/cli/{index-qw98g1p6.js → index-47e8fwha.js} +4 -1
- package/dist/cli/index-65kqn88a.js +8 -0
- package/dist/cli/{index-2bxfhs32.js → index-6f448d7m.js} +0 -26
- package/dist/cli/index-972xxwgj.js +16 -0
- package/dist/cli/index-aqe25w4h.js +39 -0
- package/dist/cli/index-assqancr.js +51 -0
- package/dist/cli/{index-2shf4aya.js → index-c8rcfe5a.js} +4 -6
- package/dist/cli/index-cba1cemz.js +8 -0
- package/dist/cli/{index-3ff5ztt3.js → index-djkrb7pc.js} +1 -7
- package/dist/cli/index-dkfwkpc8.js +138 -0
- package/dist/cli/{index-92g14j47.js → index-dw44xa4x.js} +2 -1
- package/dist/cli/index-evsnq0n2.js +17 -0
- package/dist/cli/index-fxwf3n2v.js +224 -0
- package/dist/cli/{index-zyd80s3h.js → index-js2hksgv.js} +21 -295
- package/dist/cli/{index-bp60baze.js → index-jyap0bhv.js} +1 -1
- package/dist/cli/{index-9dzdbbfc.js → index-kx2d067c.js} +8 -6
- package/dist/cli/index-pb31zan6.js +9 -0
- package/dist/cli/index-sq0478b0.js +281 -0
- package/dist/cli/index-va274tsf.js +7 -0
- package/dist/cli/{index-yd672jyq.js → index-w6xsk8cv.js} +4 -1
- package/dist/cli/index-w79snsxv.js +461 -0
- package/dist/cli/index-x1vvn549.js +835 -0
- package/dist/cli/index-xf9sfr8a.js +243 -0
- package/dist/cli/index-ycqdxy55.js +754 -0
- package/dist/cli/index-z74cqxz0.js +131 -0
- package/dist/cli/index.js +10 -9
- package/dist/cli/{islands-6zgb7501.js → islands-17tfx8jf.js} +6 -17
- package/dist/cli/{ls-0hfx323m.js → ls-0wr74w0b.js} +10 -58
- package/dist/cli/{mobile-93vaawcz.js → mobile-hpqpy61f.js} +11 -8
- package/dist/cli/{prerender-010z771p.js → prerender-w65xp6h8.js} +2 -1
- package/dist/cli/{rewriteImports-z6629aww.js → rewriteImports-np2d2kvc.js} +4 -11
- package/dist/cli/rewriteImportsPlugin-c6hcb3x6.js +12 -0
- package/dist/cli/{start-asxb79rc.js → start-mbn2zgs2.js} +6 -4
- package/dist/cli/staticAnalyzeSpaRoutes-2nev05m1.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-6vgzp0rs.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-f85q9dqk.js +8 -0
- package/dist/cli/staticAnalyzeSpaRoutes-yakmg22g.js +7 -0
- package/dist/cli/{typecheck-m2j4tkdk.js → typecheck-488txsfc.js} +92 -18
- package/dist/cli/vueCompiler-8bzdmf08.js +7 -0
- package/dist/client/chunks/{react-khr6ewhr.js → react-g8r290b8.js} +37 -2
- package/dist/client/chunks/react-g8r290b8.js.map +10 -0
- package/dist/client/chunks/vue-zcpmka32.js +85 -0
- package/dist/client/chunks/vue-zcpmka32.js.map +10 -0
- package/dist/client/index.js +58 -10
- package/dist/client/index.js.map +4 -4
- package/dist/dev/client/handlers/vue.ts +116 -0
- package/dist/index.js +2472 -2058
- package/dist/index.js.map +26 -23
- package/dist/islands/browser.js +2 -2
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +2 -2
- package/dist/islands/index.js.map +3 -3
- package/dist/react/browser.js +2 -2
- package/dist/react/browser.js.map +3 -3
- package/dist/react/index.js +42 -11
- package/dist/react/index.js.map +10 -10
- package/dist/react/server.js +42 -11
- package/dist/react/server.js.map +10 -10
- package/dist/src/angular/ssrRender.d.ts +2 -2
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +6 -1
- package/dist/src/build/generateManifest.d.ts +15 -0
- package/dist/src/build/manifestKeys.d.ts +22 -0
- package/dist/src/cli/add/dependencies.d.ts +1 -1
- package/dist/src/cli/scripts/typecheck.d.ts +11 -0
- package/dist/src/client/hydrators/react.d.ts +10 -0
- package/dist/src/client/hydrators/vue.d.ts +13 -0
- package/dist/src/client/islandRuntime.d.ts +1 -1
- package/dist/src/core/islandManifest.d.ts +4 -0
- package/dist/src/core/islandPageContext.d.ts +8 -2
- package/dist/src/core/lookup.d.ts +16 -1
- package/dist/src/dev/importCost/instrument.d.ts +1 -1
- package/dist/src/dev/manifestKeysRefresher.d.ts +6 -0
- package/dist/src/dev/spaRouteRefresh.d.ts +13 -0
- package/dist/src/mobile/androidConformance.d.ts +1 -1
- package/dist/src/react/staticAnalyzeSpaRoutes.d.ts +6 -1
- package/dist/src/svelte/staticAnalyzeSpaRoutes.d.ts +1 -0
- package/dist/src/utils/logger.d.ts +5 -0
- package/dist/src/utils/spaRouteManifest.d.ts +1 -0
- package/dist/src/vue/components/Image.d.ts +4 -4
- package/dist/src/vue/components/StreamSlot.d.ts +1 -1
- package/dist/src/vue/components/SuspenseSlot.d.ts +2 -2
- package/dist/src/vue/staticAnalyzeSpaRoutes.d.ts +4 -0
- package/dist/svelte/browser.js +2 -2
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +25 -9
- package/dist/svelte/index.js.map +8 -8
- package/dist/svelte/server.js +25 -9
- package/dist/svelte/server.js.map +8 -8
- package/dist/types/globals.d.ts +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/island.d.ts +1 -1
- package/dist/types/manifest.d.ts +25 -0
- package/dist/vue/browser.js +2 -2
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +21 -6
- package/dist/vue/index.js.map +6 -6
- package/dist/vue/server.js +21 -6
- package/dist/vue/server.js.map +6 -6
- package/package.json +1 -1
- package/dist/client/chunks/react-khr6ewhr.js.map +0 -10
- package/dist/client/chunks/vue-db6ppn1f.js +0 -32
- package/dist/client/chunks/vue-db6ppn1f.js.map +0 -10
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./index-t8jmj8w1.js";
|
|
3
|
+
import"./index-aqe25w4h.js";
|
|
4
|
+
import"./index-47e8fwha.js";
|
|
5
|
+
import"./index-4j1twret.js";
|
|
6
|
+
import"./index-x1vvn549.js";
|
|
7
|
+
import"./index-w79snsxv.js";
|
|
8
|
+
import {
|
|
9
|
+
SENTINEL
|
|
10
|
+
} from "./index-jyap0bhv.js";
|
|
11
|
+
import"./index-z74cqxz0.js";
|
|
12
|
+
import"./index-evsnq0n2.js";
|
|
13
|
+
import"./index-xf9sfr8a.js";
|
|
14
|
+
import"./index-fxwf3n2v.js";
|
|
15
|
+
import"./index-dkfwkpc8.js";
|
|
16
|
+
import"./index-sq0478b0.js";
|
|
17
|
+
import"./index-43a1vvb7.js";
|
|
18
|
+
import"./index-pb31zan6.js";
|
|
19
|
+
import"./index-va274tsf.js";
|
|
20
|
+
import"./index-1ewba8ye.js";
|
|
21
|
+
import"./index-ycqdxy55.js";
|
|
22
|
+
import"./index-42xjh6gg.js";
|
|
23
|
+
import"./index-w6xsk8cv.js";
|
|
24
|
+
import"./index-qyxd5n9a.js";
|
|
25
|
+
import {
|
|
26
|
+
isTestSourcePath
|
|
27
|
+
} from "./index-65kqn88a.js";
|
|
28
|
+
import"./index-3ewt17wm.js";
|
|
29
|
+
import"./index-pr1skxen.js";
|
|
30
|
+
|
|
31
|
+
// src/core/build.ts
|
|
32
|
+
import {
|
|
33
|
+
copyFileSync,
|
|
34
|
+
cpSync,
|
|
35
|
+
existsSync as existsSync4,
|
|
36
|
+
mkdirSync as mkdirSync3,
|
|
37
|
+
readdirSync,
|
|
38
|
+
readFileSync as readFileSync2,
|
|
39
|
+
renameSync,
|
|
40
|
+
rmSync,
|
|
41
|
+
statSync as statSync2,
|
|
42
|
+
writeFileSync as writeFileSync2
|
|
43
|
+
} from "fs";
|
|
44
|
+
import {
|
|
45
|
+
basename as basename4,
|
|
46
|
+
dirname as dirname5,
|
|
47
|
+
extname as extname2,
|
|
48
|
+
join as join6,
|
|
49
|
+
relative as relative6,
|
|
50
|
+
resolve as resolve6,
|
|
51
|
+
sep as sep2
|
|
52
|
+
} from "path";
|
|
53
|
+
var {build: bunBuild, Glob } = globalThis.Bun;
|
|
54
|
+
|
|
55
|
+
// src/build/verifyAngularCoreUniqueness.ts
|
|
56
|
+
var importScanner = new Bun.Transpiler({ loader: "js" });
|
|
57
|
+
|
|
58
|
+
// src/build/generateReactIndexes.ts
|
|
59
|
+
import { existsSync, mkdirSync } from "fs";
|
|
60
|
+
import { basename, join, relative, resolve, sep } from "path";
|
|
61
|
+
var indexContentCache = new Map;
|
|
62
|
+
var resolveDevClientDir = () => {
|
|
63
|
+
const projectRoot = process.cwd();
|
|
64
|
+
const fromPackage = resolve(import.meta.dir, "../dev/client");
|
|
65
|
+
if (existsSync(fromPackage)) {
|
|
66
|
+
return fromPackage;
|
|
67
|
+
}
|
|
68
|
+
const fromNodeModules = resolve(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
|
|
69
|
+
if (existsSync(fromNodeModules))
|
|
70
|
+
return fromNodeModules;
|
|
71
|
+
return resolve(import.meta.dir, "./dev/client");
|
|
72
|
+
};
|
|
73
|
+
var devClientDir = resolveDevClientDir();
|
|
74
|
+
var errorOverlayPath = join(devClientDir, "errorOverlay.ts").replace(/\\/g, "/");
|
|
75
|
+
var hmrClientPath = join(devClientDir, "hmrClient.ts").replace(/\\/g, "/");
|
|
76
|
+
var refreshSetupPath = join(devClientDir, "reactRefreshSetup.ts").replace(/\\/g, "/");
|
|
77
|
+
var reactRefreshRuntimePath = join(devClientDir, "vendor", "reactRefreshRuntime.js").replace(/\\/g, "/");
|
|
78
|
+
|
|
79
|
+
// src/build/htmlScriptHMRPlugin.ts
|
|
80
|
+
var scriptLoaders = new Set(["ts", "js", "tsx", "jsx"]);
|
|
81
|
+
|
|
82
|
+
// src/utils/cspNonceRef.ts
|
|
83
|
+
var GETTER_KEY = Symbol.for("absolutejs.cspNonceGetter");
|
|
84
|
+
|
|
85
|
+
// src/utils/streamingSlots.ts
|
|
86
|
+
var CLOSING_BODY_TAG = "</body>";
|
|
87
|
+
var CLOSING_HEAD_TAG = "</head>";
|
|
88
|
+
var CLOSING_BODY_TAG_LENGTH = CLOSING_BODY_TAG.length;
|
|
89
|
+
var CLOSING_HEAD_TAG_LENGTH = CLOSING_HEAD_TAG.length;
|
|
90
|
+
|
|
91
|
+
// src/core/angularServerModule.ts
|
|
92
|
+
import { dirname, join as join2, relative as relative2 } from "path";
|
|
93
|
+
var serverCacheRoot = join2(process.cwd(), ".absolutejs", "islands", "angular");
|
|
94
|
+
var compiledModuleCache = new Map;
|
|
95
|
+
|
|
96
|
+
// src/core/svelteServerModule.ts
|
|
97
|
+
import { basename as basename2, dirname as dirname2, extname, join as join3, relative as relative3, resolve as resolve2 } from "path";
|
|
98
|
+
|
|
99
|
+
// src/svelte/lowerAwaitSlotSyntax.ts
|
|
100
|
+
var QUOTES = new Set(['"', "'", "`"]);
|
|
101
|
+
|
|
102
|
+
// src/svelte/router/lazyModule.ts
|
|
103
|
+
var LAZY_RESOLVED_KEY = Symbol.for("absolutejs.svelte.lazy-resolved");
|
|
104
|
+
|
|
105
|
+
// src/core/islandServerGeneration.ts
|
|
106
|
+
var readGeneration = () => globalThis.__absoluteIslandServerGeneration ?? 0;
|
|
107
|
+
var createIslandGenerationGuard = (reset) => {
|
|
108
|
+
let seen = readGeneration();
|
|
109
|
+
return () => {
|
|
110
|
+
const current = readGeneration();
|
|
111
|
+
if (current === seen)
|
|
112
|
+
return current;
|
|
113
|
+
seen = current;
|
|
114
|
+
reset();
|
|
115
|
+
return current;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// src/core/svelteServerModule.ts
|
|
120
|
+
var serverCacheRoot2 = join3(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
121
|
+
var compiledModuleCache2 = new Map;
|
|
122
|
+
var originalSourcePathCache = new Map;
|
|
123
|
+
var syncIslandGeneration = createIslandGenerationGuard(() => {
|
|
124
|
+
compiledModuleCache2.clear();
|
|
125
|
+
originalSourcePathCache.clear();
|
|
126
|
+
});
|
|
127
|
+
var transpiler = new Bun.Transpiler({
|
|
128
|
+
loader: "ts",
|
|
129
|
+
target: "browser"
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// src/core/vueServerModule.ts
|
|
133
|
+
import { basename as basename3, dirname as dirname3, join as join4, relative as relative4, resolve as resolve3 } from "path";
|
|
134
|
+
var {Transpiler } = globalThis.Bun;
|
|
135
|
+
var serverCacheRoot3 = join4(process.cwd(), ".absolutejs", "islands", "vue");
|
|
136
|
+
var compiledModuleCache3 = new Map;
|
|
137
|
+
var syncIslandGeneration2 = createIslandGenerationGuard(() => {
|
|
138
|
+
compiledModuleCache3.clear();
|
|
139
|
+
});
|
|
140
|
+
var transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
141
|
+
|
|
142
|
+
// src/core/renderIslandMarkup.ts
|
|
143
|
+
var resolvedServerComponentCache = new Map;
|
|
144
|
+
var resolvedServerBuildComponentCache = new Map;
|
|
145
|
+
var syncIslandGeneration3 = createIslandGenerationGuard(() => {
|
|
146
|
+
resolvedServerComponentCache.clear();
|
|
147
|
+
resolvedServerBuildComponentCache.clear();
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// src/build/stampedFileCache.ts
|
|
151
|
+
import { statSync } from "fs";
|
|
152
|
+
var STAMP_SETTLE_MS = 2000;
|
|
153
|
+
var createStampedFileCache = () => {
|
|
154
|
+
const entries = new Map;
|
|
155
|
+
const seen = new Set;
|
|
156
|
+
const read = (path, compute) => {
|
|
157
|
+
let stamp;
|
|
158
|
+
try {
|
|
159
|
+
const stats = statSync(path);
|
|
160
|
+
stamp = { mtimeMs: stats.mtimeMs, size: stats.size };
|
|
161
|
+
} catch {
|
|
162
|
+
return compute();
|
|
163
|
+
}
|
|
164
|
+
seen.add(path);
|
|
165
|
+
if (Date.now() - stamp.mtimeMs < STAMP_SETTLE_MS) {
|
|
166
|
+
entries.delete(path);
|
|
167
|
+
return compute();
|
|
168
|
+
}
|
|
169
|
+
const cached = entries.get(path);
|
|
170
|
+
if (cached && cached.mtimeMs === stamp.mtimeMs && cached.size === stamp.size) {
|
|
171
|
+
return cached.value;
|
|
172
|
+
}
|
|
173
|
+
const value = compute();
|
|
174
|
+
entries.set(path, { ...stamp, value });
|
|
175
|
+
return value;
|
|
176
|
+
};
|
|
177
|
+
const endPass = () => {
|
|
178
|
+
for (const path of entries.keys()) {
|
|
179
|
+
if (!seen.has(path))
|
|
180
|
+
entries.delete(path);
|
|
181
|
+
}
|
|
182
|
+
seen.clear();
|
|
183
|
+
};
|
|
184
|
+
return { endPass, read };
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// src/build/serverExternals.ts
|
|
188
|
+
var RUNTIME_LOADABLE_EXTENSIONS = new Set([
|
|
189
|
+
".cjs",
|
|
190
|
+
".js",
|
|
191
|
+
".json",
|
|
192
|
+
".mjs",
|
|
193
|
+
".node",
|
|
194
|
+
".wasm"
|
|
195
|
+
]);
|
|
196
|
+
var SFC_EXTENSIONS = new Set([".svelte", ".vue"]);
|
|
197
|
+
|
|
198
|
+
// src/build/missingReactRouter.ts
|
|
199
|
+
var LINK_WITHOUT_REACT_ROUTER = "For links between pages without client-side routing, import { Link } from '@absolutejs/absolute/react/components' instead: " + "it is the same <Link>, has no react-router dependency, and enableNavigation() turns its clicks into soft page navigations.";
|
|
200
|
+
|
|
201
|
+
// src/build/scanRouteRegistrations.ts
|
|
202
|
+
var ELYSIA_ROUTE_METHODS = new Set([
|
|
203
|
+
"all",
|
|
204
|
+
"delete",
|
|
205
|
+
"get",
|
|
206
|
+
"head",
|
|
207
|
+
"options",
|
|
208
|
+
"patch",
|
|
209
|
+
"post",
|
|
210
|
+
"put"
|
|
211
|
+
]);
|
|
212
|
+
var SKIP_DIRS = new Set([
|
|
213
|
+
".absolutejs",
|
|
214
|
+
".generated",
|
|
215
|
+
".git",
|
|
216
|
+
".next",
|
|
217
|
+
".svelte-kit",
|
|
218
|
+
".vercel",
|
|
219
|
+
"build",
|
|
220
|
+
"compiled",
|
|
221
|
+
"dist",
|
|
222
|
+
"node_modules"
|
|
223
|
+
]);
|
|
224
|
+
var SOURCE_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
225
|
+
|
|
226
|
+
// src/i18n/routing.ts
|
|
227
|
+
var RTL_SCRIPTS = new Set([
|
|
228
|
+
"Adlm",
|
|
229
|
+
"Arab",
|
|
230
|
+
"Aran",
|
|
231
|
+
"Hebr",
|
|
232
|
+
"Mand",
|
|
233
|
+
"Nkoo",
|
|
234
|
+
"Rohg",
|
|
235
|
+
"Samr",
|
|
236
|
+
"Syrc",
|
|
237
|
+
"Thaa"
|
|
238
|
+
]);
|
|
239
|
+
var RTL_LANGUAGES = new Set([
|
|
240
|
+
"ar",
|
|
241
|
+
"arc",
|
|
242
|
+
"ckb",
|
|
243
|
+
"dv",
|
|
244
|
+
"fa",
|
|
245
|
+
"he",
|
|
246
|
+
"iw",
|
|
247
|
+
"ps",
|
|
248
|
+
"sd",
|
|
249
|
+
"syr",
|
|
250
|
+
"ug",
|
|
251
|
+
"ur",
|
|
252
|
+
"yi"
|
|
253
|
+
]);
|
|
254
|
+
|
|
255
|
+
// src/core/devRouteRegistrationCallsite.ts
|
|
256
|
+
import { Elysia } from "elysia";
|
|
257
|
+
var ROUTE_CALLSITE_STORAGE_KEY = Symbol.for("absolutejs.devRouteRegistrationCallsiteStorage");
|
|
258
|
+
var ROUTE_CALLSITE_PATCHED_KEY = Symbol.for("absolutejs.devRouteRegistrationCallsitePatched");
|
|
259
|
+
var pageHandlerWrappers = new WeakMap;
|
|
260
|
+
|
|
261
|
+
// src/utils/generateSitemap.ts
|
|
262
|
+
var VALID_CHANGEFREQ = new Set([
|
|
263
|
+
"always",
|
|
264
|
+
"hourly",
|
|
265
|
+
"daily",
|
|
266
|
+
"weekly",
|
|
267
|
+
"monthly",
|
|
268
|
+
"yearly",
|
|
269
|
+
"never"
|
|
270
|
+
]);
|
|
271
|
+
|
|
272
|
+
// src/build/tailwindCompiler.ts
|
|
273
|
+
var compilerCache = new Map;
|
|
274
|
+
|
|
275
|
+
// src/dev/buildHMRClient.ts
|
|
276
|
+
import { existsSync as existsSync2 } from "fs";
|
|
277
|
+
import { resolve as resolve4 } from "path";
|
|
278
|
+
var resolveHmrClientPath = () => {
|
|
279
|
+
const projectRoot = process.cwd();
|
|
280
|
+
const fromSource = resolve4(import.meta.dir, "client/hmrClient.ts");
|
|
281
|
+
if (existsSync2(fromSource) && fromSource.startsWith(projectRoot)) {
|
|
282
|
+
return fromSource;
|
|
283
|
+
}
|
|
284
|
+
const fromNodeModules = resolve4(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
|
|
285
|
+
if (existsSync2(fromNodeModules))
|
|
286
|
+
return fromNodeModules;
|
|
287
|
+
return resolve4(import.meta.dir, "dev/client/hmrClient.ts");
|
|
288
|
+
};
|
|
289
|
+
var hmrClientPath2 = resolveHmrClientPath();
|
|
290
|
+
|
|
291
|
+
// src/build/rewriteReactImports.ts
|
|
292
|
+
var REFRESH_STUBS = "window.$RefreshReg$||(window.$RefreshReg$=function(){});" + `window.$RefreshSig$||(window.$RefreshSig$=function(){return function(t){return t}});
|
|
293
|
+
`;
|
|
294
|
+
|
|
295
|
+
// src/build/angularLinkerPlugin.ts
|
|
296
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
|
|
297
|
+
import { dirname as dirname4, join as join5, relative as relative5, resolve as resolve5 } from "path";
|
|
298
|
+
import { createHash } from "crypto";
|
|
299
|
+
var CACHE_ROOT = resolve5(".absolutejs", "cache", "angular-linker");
|
|
300
|
+
var ANGULAR_LINKER_CANDIDATE_RE = /[\\/]node_modules[\\/].*\.m?js$/;
|
|
301
|
+
var createAngularLinkerPlugin = (linkerJitMode) => ({
|
|
302
|
+
name: "angular-linker",
|
|
303
|
+
setup(bld) {
|
|
304
|
+
let needsLinking;
|
|
305
|
+
let babelTransform;
|
|
306
|
+
let linkerPlugin;
|
|
307
|
+
const cacheDir = join5(CACHE_ROOT, linkerJitMode ? "jit" : "aot");
|
|
308
|
+
bld.onLoad({ filter: ANGULAR_LINKER_CANDIDATE_RE }, async (args) => {
|
|
309
|
+
const source = await Bun.file(args.path).text();
|
|
310
|
+
if (!needsLinking) {
|
|
311
|
+
const specifier = "@angular/compiler-cli/linker";
|
|
312
|
+
const mod = await import(specifier);
|
|
313
|
+
({ needsLinking } = mod);
|
|
314
|
+
}
|
|
315
|
+
const checkLink = needsLinking;
|
|
316
|
+
if (!checkLink || !checkLink(args.path, source)) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const hash = createHash("md5").update(source).digest("hex");
|
|
320
|
+
const cachePath = join5(cacheDir, `${hash}.js`);
|
|
321
|
+
if (existsSync3(cachePath)) {
|
|
322
|
+
return {
|
|
323
|
+
contents: readFileSync(cachePath, "utf-8"),
|
|
324
|
+
loader: "js"
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
if (!babelTransform) {
|
|
328
|
+
const babelSpecifier = "@babel/core";
|
|
329
|
+
const babel = await import(babelSpecifier);
|
|
330
|
+
babelTransform = babel.transformSync;
|
|
331
|
+
}
|
|
332
|
+
if (!linkerPlugin) {
|
|
333
|
+
const linkerSpecifier = "@angular/compiler-cli/linker/babel";
|
|
334
|
+
const mod = await import(linkerSpecifier);
|
|
335
|
+
linkerPlugin = mod.createEs2015LinkerPlugin({
|
|
336
|
+
fileSystem: {
|
|
337
|
+
dirname: dirname4,
|
|
338
|
+
exists: existsSync3,
|
|
339
|
+
readFile: readFileSync,
|
|
340
|
+
relative: relative5,
|
|
341
|
+
resolve: resolve5
|
|
342
|
+
},
|
|
343
|
+
linkerJitMode,
|
|
344
|
+
logger: {
|
|
345
|
+
error: console.error,
|
|
346
|
+
level: 1,
|
|
347
|
+
warn: console.warn,
|
|
348
|
+
debug: () => {},
|
|
349
|
+
info: () => {}
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
const transform = babelTransform;
|
|
354
|
+
if (!transform) {
|
|
355
|
+
return { contents: source, loader: "js" };
|
|
356
|
+
}
|
|
357
|
+
const result = transform(source, {
|
|
358
|
+
compact: false,
|
|
359
|
+
filename: args.path,
|
|
360
|
+
filenameRelative: args.path,
|
|
361
|
+
plugins: [linkerPlugin],
|
|
362
|
+
sourceMaps: false
|
|
363
|
+
});
|
|
364
|
+
const linked = result?.code ?? source;
|
|
365
|
+
mkdirSync2(cacheDir, { recursive: true });
|
|
366
|
+
writeFileSync(cachePath, linked, "utf-8");
|
|
367
|
+
return { contents: linked, loader: "js" };
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
var angularLinkerPlugin = createAngularLinkerPlugin(false);
|
|
372
|
+
|
|
373
|
+
// src/build/injectVueComposableTracking.ts
|
|
374
|
+
var VUE_HMR_RUNTIME = [
|
|
375
|
+
`var __hmr_cs=(globalThis.__HMR_COMPOSABLE_STATE__??={});`,
|
|
376
|
+
`var __hmr_prev={};`,
|
|
377
|
+
`var __hmr_idx={};`,
|
|
378
|
+
`function __hmr_wrap(m,n,fn){`,
|
|
379
|
+
`if(typeof fn!=="function")return fn;`,
|
|
380
|
+
`if(!(m in __hmr_prev)){__hmr_prev[m]=__hmr_cs[m];__hmr_cs[m]={};}`,
|
|
381
|
+
`return function(){`,
|
|
382
|
+
`var k=m+"\\0"+n;var i=(__hmr_idx[k]=(__hmr_idx[k]??-1)+1);`,
|
|
383
|
+
`var r=fn.apply(this,arguments);`,
|
|
384
|
+
`if(r&&typeof r==="object"){`,
|
|
385
|
+
`var refs={};for(var p in r){var v=r[p];`,
|
|
386
|
+
`if(v&&typeof v==="object"&&"value"in v&&!v.effect&&typeof v.value!=="function")refs[p]=v;}`,
|
|
387
|
+
`(__hmr_cs[m][n]??=[])[i]=refs;`,
|
|
388
|
+
`var pr=__hmr_prev[m];`,
|
|
389
|
+
`if(pr&&pr[n]&&pr[n][i]){var old=pr[n][i];`,
|
|
390
|
+
`for(var p in old){var nv=r[p],ov=old[p];`,
|
|
391
|
+
`if(nv&&ov&&typeof nv==="object"&&"value"in nv&&!nv.effect&&typeof nv.value===typeof ov.value)nv.value=ov.value;}`,
|
|
392
|
+
`}}return r;};}`
|
|
393
|
+
].join("");
|
|
394
|
+
var LINE_TERMINATOR = new RegExp(`;\\s*(?://${SENTINEL}\\d+${SENTINEL})?\\s*$`);
|
|
395
|
+
|
|
396
|
+
// src/core/precompressed.ts
|
|
397
|
+
import { promisify } from "util";
|
|
398
|
+
import { brotliCompress, constants, gzip } from "zlib";
|
|
399
|
+
import { Elysia as Elysia2 } from "elysia";
|
|
400
|
+
var COMPRESSIBLE_EXTENSIONS = new Set([
|
|
401
|
+
".css",
|
|
402
|
+
".html",
|
|
403
|
+
".js",
|
|
404
|
+
".json",
|
|
405
|
+
".mjs",
|
|
406
|
+
".svg",
|
|
407
|
+
".txt",
|
|
408
|
+
".webmanifest",
|
|
409
|
+
".xml"
|
|
410
|
+
]);
|
|
411
|
+
var brotliAsync = promisify(brotliCompress);
|
|
412
|
+
var gzipAsync = promisify(gzip);
|
|
413
|
+
|
|
414
|
+
// src/core/build.ts
|
|
415
|
+
var SKIP_DIRS2 = new Set([
|
|
416
|
+
"build",
|
|
417
|
+
"node_modules",
|
|
418
|
+
".absolutejs",
|
|
419
|
+
"generated"
|
|
420
|
+
]);
|
|
421
|
+
var addWorkerPathIfExists = (file, relPath, workerPaths) => {
|
|
422
|
+
const absPath = resolve6(file, "..", relPath);
|
|
423
|
+
try {
|
|
424
|
+
statSync2(absPath);
|
|
425
|
+
workerPaths.add(absPath);
|
|
426
|
+
} catch {}
|
|
427
|
+
};
|
|
428
|
+
var extractWorkerSpecifiers = (file, patterns) => {
|
|
429
|
+
const content = readFileSync2(file, "utf-8");
|
|
430
|
+
const specifiers = [];
|
|
431
|
+
for (const pattern of patterns) {
|
|
432
|
+
pattern.lastIndex = 0;
|
|
433
|
+
let match;
|
|
434
|
+
while ((match = pattern.exec(content)) !== null) {
|
|
435
|
+
const [, relPath] = match;
|
|
436
|
+
if (!relPath)
|
|
437
|
+
continue;
|
|
438
|
+
specifiers.push(relPath);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return specifiers;
|
|
442
|
+
};
|
|
443
|
+
var workerSpecifierCache = createStampedFileCache();
|
|
444
|
+
var scanWorkerReferencesInDir = async (dir, patterns, references, memoise) => {
|
|
445
|
+
const glob = new Glob("**/*.{ts,tsx,js,jsx,svelte,vue}");
|
|
446
|
+
for await (const file of glob.scan({ absolute: true, cwd: dir })) {
|
|
447
|
+
if (isTestSourcePath(file))
|
|
448
|
+
continue;
|
|
449
|
+
const relToDir = file.slice(dir.length + 1);
|
|
450
|
+
const [firstSegment] = relToDir.split("/");
|
|
451
|
+
if (firstSegment && SKIP_DIRS2.has(firstSegment))
|
|
452
|
+
continue;
|
|
453
|
+
const specifiers = memoise ? workerSpecifierCache.read(file, () => extractWorkerSpecifiers(file, patterns)) : extractWorkerSpecifiers(file, patterns);
|
|
454
|
+
for (const relPath of specifiers)
|
|
455
|
+
references.push([file, relPath]);
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
var scanWorkerReferences = async (dirs, memoise = false) => {
|
|
459
|
+
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
460
|
+
const resolvePattern = /import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g;
|
|
461
|
+
const references = [];
|
|
462
|
+
await Promise.all(dirs.map((dir) => scanWorkerReferencesInDir(dir, [urlPattern, resolvePattern], references, memoise)));
|
|
463
|
+
if (memoise)
|
|
464
|
+
workerSpecifierCache.endPass();
|
|
465
|
+
const workerPaths = new Set;
|
|
466
|
+
for (const [file, relPath] of references) {
|
|
467
|
+
addWorkerPathIfExists(file, relPath, workerPaths);
|
|
468
|
+
}
|
|
469
|
+
return [...workerPaths];
|
|
470
|
+
};
|
|
471
|
+
var bunBuildPassKeys = [
|
|
472
|
+
"server",
|
|
473
|
+
"reactClient",
|
|
474
|
+
"nonReactClient",
|
|
475
|
+
"islandClient",
|
|
476
|
+
"globalCss",
|
|
477
|
+
"vueCss"
|
|
478
|
+
];
|
|
479
|
+
var bunBuildPassKeySet = new Set(["default", ...bunBuildPassKeys]);
|
|
480
|
+
var reservedBunBuildConfigKeys = new Set([
|
|
481
|
+
"entrypoints",
|
|
482
|
+
"outdir",
|
|
483
|
+
"outfile",
|
|
484
|
+
"root",
|
|
485
|
+
"target",
|
|
486
|
+
"format",
|
|
487
|
+
"throw",
|
|
488
|
+
"compile"
|
|
489
|
+
]);
|
|
490
|
+
var passLockedKeys = {
|
|
491
|
+
reactClient: new Set(["splitting"])
|
|
492
|
+
};
|
|
493
|
+
export {
|
|
494
|
+
scanWorkerReferences
|
|
495
|
+
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
isTestSourcePath,
|
|
4
3
|
isWorkspacePackageSpecifier
|
|
5
|
-
} from "./index-
|
|
4
|
+
} from "./index-djkrb7pc.js";
|
|
6
5
|
import"./index-t8jmj8w1.js";
|
|
7
6
|
import {
|
|
8
7
|
devProfileEnabled
|
|
9
|
-
} from "./index-
|
|
8
|
+
} from "./index-va274tsf.js";
|
|
10
9
|
import {
|
|
11
10
|
resolveVueFeatureFlags
|
|
12
11
|
} from "./index-jwfambwe.js";
|
|
12
|
+
import {
|
|
13
|
+
isTestSourcePath
|
|
14
|
+
} from "./index-65kqn88a.js";
|
|
13
15
|
import"./index-pr1skxen.js";
|
|
14
16
|
|
|
15
17
|
// src/build/buildDepVendor.ts
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
buildReactServerComponentsPass2,
|
|
4
|
+
reactServerPageManifestKeys2
|
|
5
|
+
} from "./index-w79snsxv.js";
|
|
6
|
+
import"./index-aqe25w4h.js";
|
|
7
|
+
import"./index-3ewt17wm.js";
|
|
8
|
+
import"./index-pr1skxen.js";
|
|
9
|
+
import"./index-t8jmj8w1.js";
|
|
10
|
+
export {
|
|
11
|
+
buildReactServerComponentsPass2 as buildReactServerComponentsPass,
|
|
12
|
+
reactServerPageManifestKeys2 as reactServerPageManifestKeys
|
|
13
|
+
};
|