@absolutejs/absolute 0.20.0-beta.166 → 0.20.0-beta.168
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 +18 -0
- package/README.md +81 -0
- package/changelog.json +35 -0
- package/dist/angular/browser.js +3 -3
- 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 +211 -197
- package/dist/angular/index.js.map +8 -8
- package/dist/angular/server.js +211 -197
- package/dist/angular/server.js.map +8 -8
- package/dist/build.js +1333 -1005
- package/dist/build.js.map +13 -9
- package/dist/cli/{compile-30m09382.js → compile-ckn6epbb.js} +1 -1
- package/dist/cli/config/server.js +125 -112
- package/dist/cli/{dev-sxx8zyr6.js → dev-ny2vah78.js} +1 -1
- package/dist/cli/{index-vkba3289.js → index-8ez1ccm0.js} +1 -1
- package/dist/cli/{index-1ksy2h3r.js → index-psvsmg0x.js} +1 -1
- package/dist/cli/index.js +8 -8
- package/dist/cli/{islands-rq6wx0kh.js → islands-8sgky9gh.js} +1 -1
- package/dist/cli/{mobile-41sev6v0.js → mobile-ddggpe53.js} +2 -2
- package/dist/cli/{patchedBun-r3ykvvwz.js → patchedBun-g1d7528q.js} +1 -1
- package/dist/cli/{start-0ebxkwga.js → start-qj7664zr.js} +2 -2
- package/dist/cli/{typecheck-7yhekrc0.js → typecheck-8sdrcjz8.js} +208 -42
- package/dist/client/index.js +8 -3
- package/dist/client/index.js.map +4 -4
- package/dist/dev/client/cssUtils.ts +65 -3
- package/dist/dev/client/hmrClient.ts +3 -1
- package/dist/index.js +1411 -1082
- package/dist/index.js.map +15 -11
- package/dist/islands/browser.js +3 -3
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +3 -3
- package/dist/islands/index.js.map +3 -3
- package/dist/react/browser.js +3 -3
- package/dist/react/browser.js.map +3 -3
- package/dist/react/index.js +231 -217
- package/dist/react/index.js.map +9 -9
- package/dist/react/server.js +231 -191
- package/dist/react/server.js.map +9 -8
- package/dist/src/build/islandBootstrap.d.ts +22 -0
- package/dist/src/build/missingClientFrameworks.d.ts +29 -0
- package/dist/src/build/svelteDeclarations.d.ts +27 -0
- package/dist/src/cli/patchedBun.d.ts +2 -2
- package/dist/src/client/islandResolver.d.ts +3 -1
- package/dist/src/core/build.d.ts +1 -1
- package/dist/src/core/islandManifest.d.ts +10 -0
- package/dist/src/core/islandPageContext.d.ts +2 -0
- package/dist/src/dev/svelteDeclarationRefresher.d.ts +6 -0
- package/dist/svelte/browser.js +3 -3
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +211 -197
- package/dist/svelte/index.js.map +8 -8
- package/dist/svelte/server.js +211 -171
- package/dist/svelte/server.js.map +8 -7
- package/dist/vue/browser.js +3 -3
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +231 -217
- package/dist/vue/index.js.map +9 -9
- package/dist/vue/server.js +231 -191
- package/dist/vue/server.js.map +9 -8
- package/package.json +6 -1
- /package/dist/cli/{index-e6ysp900.js → index-z794p5qg.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// .angular-partial-tmp-
|
|
2
|
+
// .angular-partial-tmp-AWTuEE/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-AWTuEE/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-AWTuEE/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
|
@@ -107,11 +107,210 @@ var init_constants = __esm(() => {
|
|
|
107
107
|
TWO_THIRDS = 2 / 3;
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
// src/utils/getDurationString.ts
|
|
111
|
+
var getDurationString = (duration) => {
|
|
112
|
+
let durationString;
|
|
113
|
+
if (duration < MILLISECONDS_IN_A_SECOND) {
|
|
114
|
+
durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
|
|
115
|
+
} else if (duration < MILLISECONDS_IN_A_MINUTE) {
|
|
116
|
+
durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
|
|
117
|
+
} else {
|
|
118
|
+
const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
|
|
119
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
120
|
+
const seconds = totalSeconds % 60;
|
|
121
|
+
durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
|
|
122
|
+
}
|
|
123
|
+
return durationString;
|
|
124
|
+
};
|
|
125
|
+
var init_getDurationString = __esm(() => {
|
|
126
|
+
init_constants();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// src/utils/startupBanner.ts
|
|
130
|
+
var colors, MONTHS, formatTimestamp = () => {
|
|
131
|
+
const now = new Date;
|
|
132
|
+
const month = MONTHS[now.getMonth()];
|
|
133
|
+
const day = now.getDate().toString().padStart(2, "0");
|
|
134
|
+
let hours = now.getHours();
|
|
135
|
+
const minutes = now.getMinutes().toString().padStart(2, "0");
|
|
136
|
+
const seconds = now.getSeconds().toString().padStart(2, "0");
|
|
137
|
+
const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
|
|
138
|
+
hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
|
|
139
|
+
return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
|
|
140
|
+
}, startupBanner = (options) => {
|
|
141
|
+
const {
|
|
142
|
+
version,
|
|
143
|
+
readyDuration,
|
|
144
|
+
buildDuration,
|
|
145
|
+
port,
|
|
146
|
+
host,
|
|
147
|
+
networkUrl,
|
|
148
|
+
mobilePreviewUrl,
|
|
149
|
+
protocol = "http"
|
|
150
|
+
} = options;
|
|
151
|
+
const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
|
|
152
|
+
const ver = `${colors.dim}v${version}${colors.reset}`;
|
|
153
|
+
const time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;
|
|
154
|
+
const build = typeof buildDuration === "number" && Number.isFinite(buildDuration) ? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}` : "";
|
|
155
|
+
console.log("");
|
|
156
|
+
console.log(` ${name} ${ver} ${time}${build}`);
|
|
157
|
+
console.log("");
|
|
158
|
+
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === "0.0.0.0" ? "localhost" : host}:${port}/`);
|
|
159
|
+
if (networkUrl) {
|
|
160
|
+
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
|
|
161
|
+
}
|
|
162
|
+
if (mobilePreviewUrl) {
|
|
163
|
+
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
|
|
164
|
+
}
|
|
165
|
+
console.log("");
|
|
166
|
+
};
|
|
167
|
+
var init_startupBanner = __esm(() => {
|
|
168
|
+
init_constants();
|
|
169
|
+
init_getDurationString();
|
|
170
|
+
colors = {
|
|
171
|
+
bold: "\x1B[1m",
|
|
172
|
+
cyan: "\x1B[36m",
|
|
173
|
+
dim: "\x1B[2m",
|
|
174
|
+
green: "\x1B[32m",
|
|
175
|
+
reset: "\x1B[0m"
|
|
176
|
+
};
|
|
177
|
+
MONTHS = [
|
|
178
|
+
"Jan",
|
|
179
|
+
"Feb",
|
|
180
|
+
"Mar",
|
|
181
|
+
"Apr",
|
|
182
|
+
"May",
|
|
183
|
+
"Jun",
|
|
184
|
+
"Jul",
|
|
185
|
+
"Aug",
|
|
186
|
+
"Sep",
|
|
187
|
+
"Oct",
|
|
188
|
+
"Nov",
|
|
189
|
+
"Dec"
|
|
190
|
+
];
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// src/utils/logger.ts
|
|
194
|
+
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
195
|
+
const cwd = process.cwd();
|
|
196
|
+
let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
197
|
+
relative = relative.replace(/\\/g, "/");
|
|
198
|
+
if (!relative.startsWith("/")) {
|
|
199
|
+
relative = `/${relative}`;
|
|
200
|
+
}
|
|
201
|
+
return relative;
|
|
202
|
+
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
203
|
+
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
204
|
+
const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
|
|
205
|
+
let message = action;
|
|
206
|
+
if (options?.path) {
|
|
207
|
+
const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
|
|
208
|
+
message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
|
|
209
|
+
}
|
|
210
|
+
if (options?.duration !== undefined) {
|
|
211
|
+
message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
|
|
212
|
+
}
|
|
213
|
+
console.log(`${timestamp} ${tag} ${message}`);
|
|
214
|
+
}, logCssUpdate = (path, framework, duration) => {
|
|
215
|
+
log("css update", { duration, framework: framework ?? "css", path });
|
|
216
|
+
}, logError = (message, error) => {
|
|
217
|
+
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
218
|
+
const tag = `${colors2.red}[hmr]${colors2.reset}`;
|
|
219
|
+
const errorMsg = error instanceof Error ? error.message : error;
|
|
220
|
+
const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
|
|
221
|
+
console.error(`${timestamp} ${tag} ${fullMessage}`);
|
|
222
|
+
}, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
|
|
223
|
+
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
224
|
+
const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
|
|
225
|
+
const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
|
|
226
|
+
const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
|
|
227
|
+
const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
|
|
228
|
+
let action = "failed after";
|
|
229
|
+
if (outcome === "applied")
|
|
230
|
+
action = "applied in";
|
|
231
|
+
else if (outcome === "reloaded")
|
|
232
|
+
action = "falling back to reload after";
|
|
233
|
+
const kindLabel = kind ? `${kind} ` : "";
|
|
234
|
+
console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
|
|
235
|
+
}, logHmrUpdate = (path, framework, duration) => {
|
|
236
|
+
log("hmr update", { duration, framework, path });
|
|
237
|
+
}, logInfo = (message) => {
|
|
238
|
+
log(message);
|
|
239
|
+
}, logPageBuild = (path, framework, duration) => {
|
|
240
|
+
log("page build", { duration, framework, path });
|
|
241
|
+
}, logScriptUpdate = (path, framework, duration) => {
|
|
242
|
+
log("script update", { duration, framework, path });
|
|
243
|
+
}, logServerReload = () => {
|
|
244
|
+
log(`${colors2.cyan}server module reloaded${colors2.reset}`);
|
|
245
|
+
}, logWarn = (message) => {
|
|
246
|
+
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
247
|
+
const tag = `${colors2.yellow}[hmr]${colors2.reset}`;
|
|
248
|
+
console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
|
|
249
|
+
};
|
|
250
|
+
var init_logger = __esm(() => {
|
|
251
|
+
init_startupBanner();
|
|
252
|
+
colors2 = {
|
|
253
|
+
blue: "\x1B[34m",
|
|
254
|
+
bold: "\x1B[1m",
|
|
255
|
+
cyan: "\x1B[36m",
|
|
256
|
+
dim: "\x1B[2m",
|
|
257
|
+
green: "\x1B[32m",
|
|
258
|
+
magenta: "\x1B[35m",
|
|
259
|
+
red: "\x1B[31m",
|
|
260
|
+
reset: "\x1B[0m",
|
|
261
|
+
white: "\x1B[37m",
|
|
262
|
+
yellow: "\x1B[33m"
|
|
263
|
+
};
|
|
264
|
+
frameworkColors = {
|
|
265
|
+
angular: colors2.magenta,
|
|
266
|
+
assets: colors2.dim,
|
|
267
|
+
css: colors2.cyan,
|
|
268
|
+
html: colors2.white,
|
|
269
|
+
htmx: colors2.white,
|
|
270
|
+
react: colors2.blue,
|
|
271
|
+
svelte: colors2.yellow,
|
|
272
|
+
vue: colors2.green
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// src/core/islandManifest.ts
|
|
277
|
+
var ISLAND_BOOTSTRAP_MANIFEST_KEY = "AbsoluteIslandBootstrap", LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
|
|
278
|
+
const entries = {};
|
|
279
|
+
let found = false;
|
|
280
|
+
for (const [key, value] of Object.entries(manifest)) {
|
|
281
|
+
if (!key.startsWith(prefix))
|
|
282
|
+
continue;
|
|
283
|
+
const component = key.slice(prefix.length);
|
|
284
|
+
if (!component)
|
|
285
|
+
continue;
|
|
286
|
+
entries[component] = value;
|
|
287
|
+
found = true;
|
|
288
|
+
}
|
|
289
|
+
return found ? entries : undefined;
|
|
290
|
+
}, getIslandBootstrapPath = (manifest) => manifest[ISLAND_BOOTSTRAP_MANIFEST_KEY] ?? manifest[LEGACY_ISLAND_BOOTSTRAP_MANIFEST_KEY], getIslandManifestEntries = (manifest) => {
|
|
291
|
+
const islands = {};
|
|
292
|
+
const frameworks = ["react", "svelte", "vue", "angular"];
|
|
293
|
+
for (const framework of frameworks) {
|
|
294
|
+
const prefix = `Island${toIslandFrameworkSegment(framework)}`;
|
|
295
|
+
const entries = collectFrameworkIslands(manifest, prefix);
|
|
296
|
+
if (entries)
|
|
297
|
+
islands[framework] = entries;
|
|
298
|
+
}
|
|
299
|
+
return islands;
|
|
300
|
+
}, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
|
|
301
|
+
|
|
110
302
|
// src/core/islandPageContext.ts
|
|
111
|
-
var
|
|
303
|
+
var ISLAND_MARKER = 'data-island="true"', MANIFEST_MARKER = "__ABSOLUTE_MANIFEST__", ISLAND_STATE_MARKER = "__ABS_ISLAND_STATE__", CLOSING_HEAD_TAG = "</head>", warnedMissingBootstrap = false, warnIfBootstrapMissing = (manifest) => {
|
|
304
|
+
if (warnedMissingBootstrap || getIslandBootstrapPath(manifest))
|
|
305
|
+
return;
|
|
306
|
+
if (false)
|
|
307
|
+
;
|
|
308
|
+
warnedMissingBootstrap = true;
|
|
309
|
+
logWarn("A page contains islands, but the build manifest has no islands bootstrap, so they will render without hydrating. Set `islands.registry` in absolute.config.ts (a default bootstrap is generated from it) or point `islands.bootstrap` at a file that calls startIslands().");
|
|
310
|
+
}, buildIslandsHeadMarkup = (manifest) => {
|
|
112
311
|
const manifestScript = `<script>window.__ABSOLUTE_MANIFEST__ = ${JSON.stringify(manifest)}</script>`;
|
|
113
312
|
const islandStateScript = `<script>window.__ABS_ISLAND_STATE__ = ${JSON.stringify(globalThis.__ABS_ISLAND_STATE__ ?? {})}</script>`;
|
|
114
|
-
const bootstrapPath = manifest
|
|
313
|
+
const bootstrapPath = getIslandBootstrapPath(manifest);
|
|
115
314
|
const bootstrapScript = bootstrapPath ? `<script type="module" src="${bootstrapPath}"></script>` : "";
|
|
116
315
|
return `${manifestScript}${islandStateScript}${bootstrapScript}`;
|
|
117
316
|
}, injectHeadMarkup = (html, markup) => {
|
|
@@ -213,7 +412,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
|
|
|
213
412
|
}
|
|
214
413
|
}
|
|
215
414
|
});
|
|
216
|
-
}, pipeStreamWithIslandMarkerDetection = (stream, markup) => {
|
|
415
|
+
}, pipeStreamWithIslandMarkerDetection = (stream, markup, onIslandsDetected) => {
|
|
217
416
|
const encoder = new TextEncoder;
|
|
218
417
|
const decoder = new TextDecoder;
|
|
219
418
|
const headLookbehind = CLOSING_HEAD_TAG.length - 1;
|
|
@@ -226,6 +425,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
|
|
|
226
425
|
if (!held.includes(ISLAND_MARKER)) {
|
|
227
426
|
return { held, injected: false, pending: "", sawHead: true };
|
|
228
427
|
}
|
|
428
|
+
onIslandsDetected();
|
|
229
429
|
enqueue(controller, `${markup}${held}`);
|
|
230
430
|
return { held: "", injected: true, pending: "", sawHead: true };
|
|
231
431
|
};
|
|
@@ -293,6 +493,7 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
|
|
|
293
493
|
if (html.includes(MANIFEST_MARKER) || html.includes(ISLAND_STATE_MARKER)) {
|
|
294
494
|
return html;
|
|
295
495
|
}
|
|
496
|
+
warnIfBootstrapMissing(manifest);
|
|
296
497
|
return injectHeadMarkup(html, buildIslandsHeadMarkup(manifest));
|
|
297
498
|
}, injectIslandPageContextStream = (stream, options) => {
|
|
298
499
|
const manifest = globalThis.__absoluteManifest;
|
|
@@ -300,15 +501,19 @@ var BOOTSTRAP_MANIFEST_KEY = "BootstrapClient", ISLAND_MARKER = 'data-island="tr
|
|
|
300
501
|
return stream;
|
|
301
502
|
const markup = buildIslandsHeadMarkup(manifest);
|
|
302
503
|
if (options?.hasIslands === true) {
|
|
504
|
+
warnIfBootstrapMissing(manifest);
|
|
303
505
|
return pipeStreamWithHeadInjection(stream, markup);
|
|
304
506
|
}
|
|
305
507
|
if (options?.hasIslands === false) {
|
|
306
508
|
return stream;
|
|
307
509
|
}
|
|
308
|
-
return pipeStreamWithIslandMarkerDetection(stream, markup);
|
|
510
|
+
return pipeStreamWithIslandMarkerDetection(stream, markup, () => warnIfBootstrapMissing(manifest));
|
|
309
511
|
}, setCurrentIslandManifest = (manifest) => {
|
|
310
512
|
globalThis.__absoluteManifest = manifest;
|
|
311
513
|
};
|
|
514
|
+
var init_islandPageContext = __esm(() => {
|
|
515
|
+
init_logger();
|
|
516
|
+
});
|
|
312
517
|
|
|
313
518
|
// src/core/routeAssets.ts
|
|
314
519
|
var LINK_TAG_RE, REL_STYLESHEET_RE, HREF_RE, TITLE_RE, ENTITIES, ENTITY_RE, decodeEntities = (value) => value.replace(ENTITY_RE, (match) => ENTITIES[match] ?? match), readHeadStylesheets = (head) => {
|
|
@@ -2899,32 +3104,6 @@ var init_vueServerModule = __esm(() => {
|
|
|
2899
3104
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
2900
3105
|
});
|
|
2901
3106
|
|
|
2902
|
-
// src/core/islandManifest.ts
|
|
2903
|
-
var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1), collectFrameworkIslands = (manifest, prefix) => {
|
|
2904
|
-
const entries = {};
|
|
2905
|
-
let found = false;
|
|
2906
|
-
for (const [key, value] of Object.entries(manifest)) {
|
|
2907
|
-
if (!key.startsWith(prefix))
|
|
2908
|
-
continue;
|
|
2909
|
-
const component = key.slice(prefix.length);
|
|
2910
|
-
if (!component)
|
|
2911
|
-
continue;
|
|
2912
|
-
entries[component] = value;
|
|
2913
|
-
found = true;
|
|
2914
|
-
}
|
|
2915
|
-
return found ? entries : undefined;
|
|
2916
|
-
}, getIslandManifestEntries = (manifest) => {
|
|
2917
|
-
const islands = {};
|
|
2918
|
-
const frameworks = ["react", "svelte", "vue", "angular"];
|
|
2919
|
-
for (const framework of frameworks) {
|
|
2920
|
-
const prefix = `Island${toIslandFrameworkSegment(framework)}`;
|
|
2921
|
-
const entries = collectFrameworkIslands(manifest, prefix);
|
|
2922
|
-
if (entries)
|
|
2923
|
-
islands[framework] = entries;
|
|
2924
|
-
}
|
|
2925
|
-
return islands;
|
|
2926
|
-
}, getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
|
|
2927
|
-
|
|
2928
3107
|
// src/core/islands.ts
|
|
2929
3108
|
function getIslandComponent(component) {
|
|
2930
3109
|
if (isIslandComponentDefinition(component)) {
|
|
@@ -4363,172 +4542,6 @@ var init_streamingSlots = __esm(() => {
|
|
|
4363
4542
|
};
|
|
4364
4543
|
});
|
|
4365
4544
|
|
|
4366
|
-
// src/utils/getDurationString.ts
|
|
4367
|
-
var getDurationString = (duration) => {
|
|
4368
|
-
let durationString;
|
|
4369
|
-
if (duration < MILLISECONDS_IN_A_SECOND) {
|
|
4370
|
-
durationString = `${duration.toFixed(TIME_PRECISION)}ms`;
|
|
4371
|
-
} else if (duration < MILLISECONDS_IN_A_MINUTE) {
|
|
4372
|
-
durationString = `${(duration / MILLISECONDS_IN_A_SECOND).toFixed(TIME_PRECISION)}s`;
|
|
4373
|
-
} else {
|
|
4374
|
-
const totalSeconds = Math.round(duration / MILLISECONDS_IN_A_SECOND);
|
|
4375
|
-
const minutes = Math.floor(totalSeconds / 60);
|
|
4376
|
-
const seconds = totalSeconds % 60;
|
|
4377
|
-
durationString = seconds === 0 ? `${minutes}m` : `${minutes}m ${seconds}s`;
|
|
4378
|
-
}
|
|
4379
|
-
return durationString;
|
|
4380
|
-
};
|
|
4381
|
-
var init_getDurationString = __esm(() => {
|
|
4382
|
-
init_constants();
|
|
4383
|
-
});
|
|
4384
|
-
|
|
4385
|
-
// src/utils/startupBanner.ts
|
|
4386
|
-
var colors, MONTHS, formatTimestamp = () => {
|
|
4387
|
-
const now = new Date;
|
|
4388
|
-
const month = MONTHS[now.getMonth()];
|
|
4389
|
-
const day = now.getDate().toString().padStart(2, "0");
|
|
4390
|
-
let hours = now.getHours();
|
|
4391
|
-
const minutes = now.getMinutes().toString().padStart(2, "0");
|
|
4392
|
-
const seconds = now.getSeconds().toString().padStart(2, "0");
|
|
4393
|
-
const ampm = hours >= HOURS_IN_HALF_DAY ? "PM" : "AM";
|
|
4394
|
-
hours = hours % HOURS_IN_HALF_DAY || HOURS_IN_HALF_DAY;
|
|
4395
|
-
return `${month} ${day} ${hours}:${minutes}:${seconds} ${ampm}`;
|
|
4396
|
-
}, startupBanner = (options) => {
|
|
4397
|
-
const {
|
|
4398
|
-
version,
|
|
4399
|
-
readyDuration,
|
|
4400
|
-
buildDuration,
|
|
4401
|
-
port,
|
|
4402
|
-
host,
|
|
4403
|
-
networkUrl,
|
|
4404
|
-
mobilePreviewUrl,
|
|
4405
|
-
protocol = "http"
|
|
4406
|
-
} = options;
|
|
4407
|
-
const name = `${colors.cyan}${colors.bold}ABSOLUTEJS${colors.reset}`;
|
|
4408
|
-
const ver = `${colors.dim}v${version}${colors.reset}`;
|
|
4409
|
-
const time = `${colors.dim}ready in${colors.reset} ${colors.bold}${getDurationString(readyDuration)}${colors.reset}`;
|
|
4410
|
-
const build = typeof buildDuration === "number" && Number.isFinite(buildDuration) ? ` ${colors.dim}(build ${getDurationString(buildDuration)})${colors.reset}` : "";
|
|
4411
|
-
console.log("");
|
|
4412
|
-
console.log(` ${name} ${ver} ${time}${build}`);
|
|
4413
|
-
console.log("");
|
|
4414
|
-
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Local:${colors.reset} ${protocol}://${host === "0.0.0.0" ? "localhost" : host}:${port}/`);
|
|
4415
|
-
if (networkUrl) {
|
|
4416
|
-
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Network:${colors.reset} ${networkUrl}`);
|
|
4417
|
-
}
|
|
4418
|
-
if (mobilePreviewUrl) {
|
|
4419
|
-
console.log(` ${colors.green}\u279C${colors.reset} ${colors.bold}Mobile:${colors.reset} ${mobilePreviewUrl}`);
|
|
4420
|
-
}
|
|
4421
|
-
console.log("");
|
|
4422
|
-
};
|
|
4423
|
-
var init_startupBanner = __esm(() => {
|
|
4424
|
-
init_constants();
|
|
4425
|
-
init_getDurationString();
|
|
4426
|
-
colors = {
|
|
4427
|
-
bold: "\x1B[1m",
|
|
4428
|
-
cyan: "\x1B[36m",
|
|
4429
|
-
dim: "\x1B[2m",
|
|
4430
|
-
green: "\x1B[32m",
|
|
4431
|
-
reset: "\x1B[0m"
|
|
4432
|
-
};
|
|
4433
|
-
MONTHS = [
|
|
4434
|
-
"Jan",
|
|
4435
|
-
"Feb",
|
|
4436
|
-
"Mar",
|
|
4437
|
-
"Apr",
|
|
4438
|
-
"May",
|
|
4439
|
-
"Jun",
|
|
4440
|
-
"Jul",
|
|
4441
|
-
"Aug",
|
|
4442
|
-
"Sep",
|
|
4443
|
-
"Oct",
|
|
4444
|
-
"Nov",
|
|
4445
|
-
"Dec"
|
|
4446
|
-
];
|
|
4447
|
-
});
|
|
4448
|
-
|
|
4449
|
-
// src/utils/logger.ts
|
|
4450
|
-
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
4451
|
-
const cwd = process.cwd();
|
|
4452
|
-
let relative = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
4453
|
-
relative = relative.replace(/\\/g, "/");
|
|
4454
|
-
if (!relative.startsWith("/")) {
|
|
4455
|
-
relative = `/${relative}`;
|
|
4456
|
-
}
|
|
4457
|
-
return relative;
|
|
4458
|
-
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
4459
|
-
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
4460
|
-
const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
|
|
4461
|
-
let message = action;
|
|
4462
|
-
if (options?.path) {
|
|
4463
|
-
const pathColor = options.framework ? getFrameworkColor(options.framework) : colors2.white;
|
|
4464
|
-
message += ` ${pathColor}${formatPath(options.path)}${colors2.reset}`;
|
|
4465
|
-
}
|
|
4466
|
-
if (options?.duration !== undefined) {
|
|
4467
|
-
message += ` ${colors2.dim}(${options.duration}ms)${colors2.reset}`;
|
|
4468
|
-
}
|
|
4469
|
-
console.log(`${timestamp} ${tag} ${message}`);
|
|
4470
|
-
}, logCssUpdate = (path, framework, duration) => {
|
|
4471
|
-
log("css update", { duration, framework: framework ?? "css", path });
|
|
4472
|
-
}, logError = (message, error) => {
|
|
4473
|
-
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
4474
|
-
const tag = `${colors2.red}[hmr]${colors2.reset}`;
|
|
4475
|
-
const errorMsg = error instanceof Error ? error.message : error;
|
|
4476
|
-
const fullMessage = `${colors2.red}error${colors2.reset} ${message}${errorMsg ? `: ${errorMsg}` : ""}`;
|
|
4477
|
-
console.error(`${timestamp} ${tag} ${fullMessage}`);
|
|
4478
|
-
}, logHmrClientUpdate = (path, framework, duration, target, serverMs, clientMs, outcome = "applied", kind) => {
|
|
4479
|
-
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
4480
|
-
const targetLabel = target.startsWith("capacitor-") ? target.slice("capacitor-".length) : target;
|
|
4481
|
-
const tag = `${colors2.cyan}[hmr:${targetLabel}]${colors2.reset}`;
|
|
4482
|
-
const pathColor = framework ? getFrameworkColor(framework) : colors2.white;
|
|
4483
|
-
const breakdown = serverMs === undefined || clientMs === undefined ? "" : `; server ${serverMs}ms, client ${clientMs}ms`;
|
|
4484
|
-
let action = "failed after";
|
|
4485
|
-
if (outcome === "applied")
|
|
4486
|
-
action = "applied in";
|
|
4487
|
-
else if (outcome === "reloaded")
|
|
4488
|
-
action = "falling back to reload after";
|
|
4489
|
-
const kindLabel = kind ? `${kind} ` : "";
|
|
4490
|
-
console.log(`${timestamp} ${tag} ${framework ?? "update"} ${kindLabel}${pathColor}${formatPath(path)}${colors2.reset} ${colors2.dim}${action} ${duration}ms${breakdown}${colors2.reset}`);
|
|
4491
|
-
}, logHmrUpdate = (path, framework, duration) => {
|
|
4492
|
-
log("hmr update", { duration, framework, path });
|
|
4493
|
-
}, logInfo = (message) => {
|
|
4494
|
-
log(message);
|
|
4495
|
-
}, logPageBuild = (path, framework, duration) => {
|
|
4496
|
-
log("page build", { duration, framework, path });
|
|
4497
|
-
}, logScriptUpdate = (path, framework, duration) => {
|
|
4498
|
-
log("script update", { duration, framework, path });
|
|
4499
|
-
}, logServerReload = () => {
|
|
4500
|
-
log(`${colors2.cyan}server module reloaded${colors2.reset}`);
|
|
4501
|
-
}, logWarn = (message) => {
|
|
4502
|
-
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
4503
|
-
const tag = `${colors2.yellow}[hmr]${colors2.reset}`;
|
|
4504
|
-
console.log(`${timestamp} ${tag} ${colors2.yellow}warning ${message}${colors2.reset}`);
|
|
4505
|
-
};
|
|
4506
|
-
var init_logger = __esm(() => {
|
|
4507
|
-
init_startupBanner();
|
|
4508
|
-
colors2 = {
|
|
4509
|
-
blue: "\x1B[34m",
|
|
4510
|
-
bold: "\x1B[1m",
|
|
4511
|
-
cyan: "\x1B[36m",
|
|
4512
|
-
dim: "\x1B[2m",
|
|
4513
|
-
green: "\x1B[32m",
|
|
4514
|
-
magenta: "\x1B[35m",
|
|
4515
|
-
red: "\x1B[31m",
|
|
4516
|
-
reset: "\x1B[0m",
|
|
4517
|
-
white: "\x1B[37m",
|
|
4518
|
-
yellow: "\x1B[33m"
|
|
4519
|
-
};
|
|
4520
|
-
frameworkColors = {
|
|
4521
|
-
angular: colors2.magenta,
|
|
4522
|
-
assets: colors2.dim,
|
|
4523
|
-
css: colors2.cyan,
|
|
4524
|
-
html: colors2.white,
|
|
4525
|
-
htmx: colors2.white,
|
|
4526
|
-
react: colors2.blue,
|
|
4527
|
-
svelte: colors2.yellow,
|
|
4528
|
-
vue: colors2.green
|
|
4529
|
-
};
|
|
4530
|
-
});
|
|
4531
|
-
|
|
4532
4545
|
// src/islands/sourceMetadata.ts
|
|
4533
4546
|
var islandFrameworks2, islandHydrationModes2, isIslandFramework2 = (value) => islandFrameworks2.some((framework) => framework === value), isIslandHydrate2 = (value) => islandHydrationModes2.some((hydrate) => hydrate === value), parseIslandTagAttributes = (attributeString) => {
|
|
4534
4547
|
const frameworkMatch = attributeString.match(/\bframework\s*=\s*["']([^"']+)["']/);
|
|
@@ -15437,6 +15450,7 @@ var provideDeterministicEnv = (options = {}) => {
|
|
|
15437
15450
|
};
|
|
15438
15451
|
// src/angular/pageHandler.ts
|
|
15439
15452
|
init_constants();
|
|
15453
|
+
init_islandPageContext();
|
|
15440
15454
|
init_routeAssets();
|
|
15441
15455
|
init_inlinePageCss();
|
|
15442
15456
|
init_resolveConvention();
|
|
@@ -16673,5 +16687,5 @@ export {
|
|
|
16673
16687
|
withPendingTask
|
|
16674
16688
|
};
|
|
16675
16689
|
|
|
16676
|
-
//# debugId=
|
|
16690
|
+
//# debugId=41EA69A6F72F18D764756E2164756E21
|
|
16677
16691
|
//# sourceMappingURL=index.js.map
|