@absolutejs/absolute 0.19.0-beta.785 → 0.19.0-beta.788
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/index.js +2 -2
- package/dist/angular/server.js +2 -2
- package/dist/build.js +2 -2
- package/dist/{chunk-g3j22qf6.js → chunk-6nyta6wa.js} +3 -3
- package/dist/{chunk-gq0zxpm0.js → chunk-7mtstdqn.js} +2 -2
- package/dist/{chunk-nhzf4az4.js → chunk-e3r9fxaa.js} +2 -2
- package/dist/{chunk-vvz7dcvq.js → chunk-h5eee7jy.js} +243 -5
- package/dist/chunk-h5eee7jy.js.map +15 -0
- package/dist/{chunk-hep68ja7.js → chunk-pjzn557h.js} +29 -126
- package/dist/{chunk-hep68ja7.js.map → chunk-pjzn557h.js.map} +3 -4
- package/dist/{chunk-xpkjbmd3.js → chunk-r0dg9rk3.js} +2 -2
- package/dist/{chunk-qk8kd3hr.js → chunk-v5vmsxmy.js} +3 -3
- package/dist/{chunk-qk8kd3hr.js.map → chunk-v5vmsxmy.js.map} +1 -1
- package/dist/{chunk-4bq79t8v.js → chunk-vqwjfp2e.js} +2 -2
- package/dist/index.js +56 -8
- package/dist/index.js.map +4 -3
- package/dist/react/index.js +2 -2
- package/dist/react/server.js +2 -2
- package/dist/src/core/index.d.ts +2 -0
- package/dist/svelte/index.js +2 -2
- package/dist/svelte/server.js +2 -2
- package/dist/vue/index.js +2 -2
- package/dist/vue/server.js +2 -2
- package/package.json +8 -8
- package/dist/chunk-vvz7dcvq.js.map +0 -13
- /package/dist/{chunk-g3j22qf6.js.map → chunk-6nyta6wa.js.map} +0 -0
- /package/dist/{chunk-gq0zxpm0.js.map → chunk-7mtstdqn.js.map} +0 -0
- /package/dist/{chunk-nhzf4az4.js.map → chunk-e3r9fxaa.js.map} +0 -0
- /package/dist/{chunk-xpkjbmd3.js.map → chunk-r0dg9rk3.js.map} +0 -0
- /package/dist/{chunk-4bq79t8v.js.map → chunk-vqwjfp2e.js.map} +0 -0
|
@@ -73,8 +73,9 @@ import {
|
|
|
73
73
|
loadIslandRegistryBuildInfo,
|
|
74
74
|
loadPageIslandMetadata,
|
|
75
75
|
logStartupTimingBlock,
|
|
76
|
-
setCurrentPageIslandMetadata
|
|
77
|
-
|
|
76
|
+
setCurrentPageIslandMetadata,
|
|
77
|
+
transformStaticPagesWithIslands
|
|
78
|
+
} from "./chunk-h5eee7jy.js";
|
|
78
79
|
import {
|
|
79
80
|
disposeTailwindCompiler,
|
|
80
81
|
incrementalTailwindBuild
|
|
@@ -96,9 +97,6 @@ import {
|
|
|
96
97
|
import {
|
|
97
98
|
toPascal
|
|
98
99
|
} from "./chunk-p5504p14.js";
|
|
99
|
-
import {
|
|
100
|
-
renderIslandMarkup
|
|
101
|
-
} from "./chunk-4m75s5xf.js";
|
|
102
100
|
import {
|
|
103
101
|
createStylePreprocessorPlugin,
|
|
104
102
|
createStyleTransformConfig,
|
|
@@ -128,10 +126,10 @@ import {
|
|
|
128
126
|
cpSync,
|
|
129
127
|
existsSync as existsSync4,
|
|
130
128
|
mkdirSync,
|
|
131
|
-
readFileSync
|
|
129
|
+
readFileSync,
|
|
132
130
|
rmSync,
|
|
133
131
|
statSync,
|
|
134
|
-
writeFileSync
|
|
132
|
+
writeFileSync
|
|
135
133
|
} from "fs";
|
|
136
134
|
import { basename as basename2, dirname, join as join2, relative, resolve as resolve3 } from "path";
|
|
137
135
|
import { cwd, env, exit } from "process";
|
|
@@ -181,101 +179,6 @@ var createHTMLScriptHMRPlugin = (htmlDir, htmxDir) => ({
|
|
|
181
179
|
}
|
|
182
180
|
});
|
|
183
181
|
|
|
184
|
-
// src/build/staticIslandPages.ts
|
|
185
|
-
import { readFileSync, writeFileSync } from "fs";
|
|
186
|
-
var ISLAND_TAG_RE_SOURCE = "<(?:absolute-island|island)\\b([^>]*?)(?:\\/\\>|>(?:[\\s\\S]*?)<\\/(?:absolute-island|island)>)";
|
|
187
|
-
var ATTRIBUTE_RE_SOURCE = `([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*(?:"([^"]*)"|'([^']*)')`;
|
|
188
|
-
var islandFrameworks = [
|
|
189
|
-
"react",
|
|
190
|
-
"svelte",
|
|
191
|
-
"vue",
|
|
192
|
-
"angular"
|
|
193
|
-
];
|
|
194
|
-
var islandHydrationModes = ["load", "idle", "visible", "none"];
|
|
195
|
-
var isRecord = (value) => typeof value === "object" && value !== null;
|
|
196
|
-
var isIslandFramework = (value) => islandFrameworks.some((framework) => framework === value);
|
|
197
|
-
var isIslandHydrationMode = (value) => islandHydrationModes.some((mode) => mode === value);
|
|
198
|
-
var parseHtmlAttributes = (attributeString) => {
|
|
199
|
-
const attributeRe = new RegExp(ATTRIBUTE_RE_SOURCE, "g");
|
|
200
|
-
const attributes = new Map;
|
|
201
|
-
let match = attributeRe.exec(attributeString);
|
|
202
|
-
while (match) {
|
|
203
|
-
const [, key, doubleQuotedValue, singleQuotedValue] = match;
|
|
204
|
-
match = attributeRe.exec(attributeString);
|
|
205
|
-
if (!key)
|
|
206
|
-
continue;
|
|
207
|
-
const value = doubleQuotedValue ?? singleQuotedValue ?? "";
|
|
208
|
-
attributes.set(key, value);
|
|
209
|
-
}
|
|
210
|
-
return attributes;
|
|
211
|
-
};
|
|
212
|
-
var parseIslandTag = (attributeString) => {
|
|
213
|
-
const attributes = parseHtmlAttributes(attributeString);
|
|
214
|
-
const framework = attributes.get("framework");
|
|
215
|
-
const component = attributes.get("component");
|
|
216
|
-
const hydrate = attributes.get("hydrate") ?? "load";
|
|
217
|
-
const propsSource = attributes.get("props") ?? "{}";
|
|
218
|
-
if (!framework || !component) {
|
|
219
|
-
return null;
|
|
220
|
-
}
|
|
221
|
-
if (!isIslandFramework(framework)) {
|
|
222
|
-
throw new Error(`Unsupported static island framework "${framework}".`);
|
|
223
|
-
}
|
|
224
|
-
if (!isIslandHydrationMode(hydrate)) {
|
|
225
|
-
throw new Error(`Unsupported static island hydrate mode "${hydrate}".`);
|
|
226
|
-
}
|
|
227
|
-
let parsedProps;
|
|
228
|
-
try {
|
|
229
|
-
const candidate = JSON.parse(propsSource);
|
|
230
|
-
parsedProps = isRecord(candidate) ? candidate : {};
|
|
231
|
-
} catch (error) {
|
|
232
|
-
throw new Error(`Failed to parse static island props JSON for ${framework}:${component}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
233
|
-
}
|
|
234
|
-
return {
|
|
235
|
-
component,
|
|
236
|
-
framework,
|
|
237
|
-
hydrate,
|
|
238
|
-
props: parsedProps
|
|
239
|
-
};
|
|
240
|
-
};
|
|
241
|
-
var transformStaticPageHtml = async (originalHtml, registry) => {
|
|
242
|
-
const islandTagRe = new RegExp(ISLAND_TAG_RE_SOURCE, "gi");
|
|
243
|
-
if (!islandTagRe.test(originalHtml)) {
|
|
244
|
-
return originalHtml;
|
|
245
|
-
}
|
|
246
|
-
islandTagRe.lastIndex = 0;
|
|
247
|
-
const segments = [];
|
|
248
|
-
let lastIndex = 0;
|
|
249
|
-
let match = islandTagRe.exec(originalHtml);
|
|
250
|
-
while (match) {
|
|
251
|
-
const [fullMatch, rawAttributeString] = match;
|
|
252
|
-
const attributeString = rawAttributeString ?? "";
|
|
253
|
-
segments.push({
|
|
254
|
-
before: originalHtml.slice(lastIndex, match.index),
|
|
255
|
-
fullMatch,
|
|
256
|
-
props: parseIslandTag(attributeString)
|
|
257
|
-
});
|
|
258
|
-
lastIndex = match.index + fullMatch.length;
|
|
259
|
-
match = islandTagRe.exec(originalHtml);
|
|
260
|
-
}
|
|
261
|
-
const renderedSegments = await Promise.all(segments.map(async (segment) => segment.before + (segment.props ? await renderIslandMarkup(registry, segment.props) : segment.fullMatch)));
|
|
262
|
-
return renderedSegments.join("") + originalHtml.slice(lastIndex);
|
|
263
|
-
};
|
|
264
|
-
var transformStaticPage = async (pagePath, registry) => {
|
|
265
|
-
const originalHtml = readFileSync(pagePath, "utf-8");
|
|
266
|
-
const transformedHtml = await transformStaticPageHtml(originalHtml, registry);
|
|
267
|
-
if (transformedHtml !== originalHtml) {
|
|
268
|
-
writeFileSync(pagePath, transformedHtml);
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
var transformStaticPagesWithIslands = async (registryPath, pagePaths) => {
|
|
272
|
-
if (!registryPath || pagePaths.length === 0) {
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
const { registry } = await loadIslandRegistryBuildInfo(registryPath);
|
|
276
|
-
await Promise.all(pagePaths.map((pagePath) => transformStaticPage(pagePath, registry)));
|
|
277
|
-
};
|
|
278
|
-
|
|
279
182
|
// src/build/outputLogs.ts
|
|
280
183
|
var outputLogs = (logs) => {
|
|
281
184
|
for (const log of logs) {
|
|
@@ -580,7 +483,7 @@ var collectWorkerPathsFromContent = (content, pattern, file, workerPaths) => {
|
|
|
580
483
|
}
|
|
581
484
|
};
|
|
582
485
|
var collectWorkerPathsFromFile = (file, patterns, workerPaths) => {
|
|
583
|
-
const content =
|
|
486
|
+
const content = readFileSync(file, "utf-8");
|
|
584
487
|
for (const pattern of patterns) {
|
|
585
488
|
collectWorkerPathsFromContent(content, pattern, file, workerPaths);
|
|
586
489
|
}
|
|
@@ -633,9 +536,9 @@ var copyReactDevIndexes = (reactIndexesPath, reactPagesPath, devIndexDir, readDi
|
|
|
633
536
|
const indexFiles = readDir(reactIndexesPath).filter((file) => file.endsWith(".tsx"));
|
|
634
537
|
const pagesRel = relative(process.cwd(), resolve3(reactPagesPath)).replace(/\\/g, "/");
|
|
635
538
|
for (const file of indexFiles) {
|
|
636
|
-
let content =
|
|
539
|
+
let content = readFileSync(join2(reactIndexesPath, file), "utf-8");
|
|
637
540
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
638
|
-
|
|
541
|
+
writeFileSync(join2(devIndexDir, file), content);
|
|
639
542
|
}
|
|
640
543
|
};
|
|
641
544
|
var copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
@@ -646,10 +549,10 @@ var copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexD
|
|
|
646
549
|
const indexFile = join2(svelteIndexDir, "pages", `${name}.js`);
|
|
647
550
|
if (!existsSync4(indexFile))
|
|
648
551
|
continue;
|
|
649
|
-
let content =
|
|
552
|
+
let content = readFileSync(indexFile, "utf-8");
|
|
650
553
|
const srcRel = relative(process.cwd(), resolve3(entry)).replace(/\\/g, "/");
|
|
651
554
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
652
|
-
|
|
555
|
+
writeFileSync(join2(devIndexDir, `${name}.svelte.js`), content);
|
|
653
556
|
}
|
|
654
557
|
};
|
|
655
558
|
var copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
@@ -660,10 +563,10 @@ var copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
|
660
563
|
const indexFile = join2(vueIndexDir, `${name}.js`);
|
|
661
564
|
if (!existsSync4(indexFile))
|
|
662
565
|
continue;
|
|
663
|
-
let content =
|
|
566
|
+
let content = readFileSync(indexFile, "utf-8");
|
|
664
567
|
const srcRel = relative(process.cwd(), resolve3(entry)).replace(/\\/g, "/");
|
|
665
568
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
666
|
-
|
|
569
|
+
writeFileSync(join2(devIndexDir, `${name}.vue.js`), content);
|
|
667
570
|
}
|
|
668
571
|
};
|
|
669
572
|
var resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
@@ -737,7 +640,7 @@ var VUE_HMR_RUNTIME = [
|
|
|
737
640
|
`}}return r;};}`
|
|
738
641
|
].join("");
|
|
739
642
|
var injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
740
|
-
let content =
|
|
643
|
+
let content = readFileSync(outputPath, "utf-8");
|
|
741
644
|
const usePattern = /^var\s+(use[A-Z]\w*)\s*=/gm;
|
|
742
645
|
const useNames = [];
|
|
743
646
|
let match;
|
|
@@ -758,7 +661,7 @@ var injectVueComposableTracking = (outputPath, projectRoot) => {
|
|
|
758
661
|
content = `${content.slice(0, firstUseIdx) + runtime}
|
|
759
662
|
${content.slice(firstUseIdx)}`;
|
|
760
663
|
content = wrapUseFunctions(content, useNames);
|
|
761
|
-
|
|
664
|
+
writeFileSync(outputPath, content);
|
|
762
665
|
};
|
|
763
666
|
var buildDevUrlFileMap = (urlReferencedFiles, projectRoot) => {
|
|
764
667
|
const urlFileMap = new Map;
|
|
@@ -791,7 +694,7 @@ var buildUrlFileMap = (urlReferencedFiles, hmr, projectRoot, buildPath, nonReact
|
|
|
791
694
|
var rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
792
695
|
const urlPattern = /new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
|
|
793
696
|
for (const outputPath of outputPaths) {
|
|
794
|
-
let content =
|
|
697
|
+
let content = readFileSync(outputPath, "utf-8");
|
|
795
698
|
let changed = false;
|
|
796
699
|
content = content.replace(urlPattern, (_match, relPath) => {
|
|
797
700
|
const targetName = basename2(relPath);
|
|
@@ -802,7 +705,7 @@ var rewriteUrlReferences = (outputPaths, urlFileMap) => {
|
|
|
802
705
|
return `new URL('${resolvedPath}', import.meta.url)`;
|
|
803
706
|
});
|
|
804
707
|
if (changed)
|
|
805
|
-
|
|
708
|
+
writeFileSync(outputPath, content);
|
|
806
709
|
}
|
|
807
710
|
};
|
|
808
711
|
var vueFeatureFlags = {
|
|
@@ -944,7 +847,7 @@ var build = async ({
|
|
|
944
847
|
const traceDir = join2(buildPath2, ".absolute-trace");
|
|
945
848
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
946
849
|
mkdirSync(traceDir, { recursive: true });
|
|
947
|
-
|
|
850
|
+
writeFileSync(join2(traceDir, `build-trace-${timestamp}.json`), JSON.stringify({
|
|
948
851
|
events: traceEvents,
|
|
949
852
|
frameworks: traceFrameworkNames,
|
|
950
853
|
generatedAt: new Date().toISOString(),
|
|
@@ -1641,13 +1544,13 @@ var build = async ({
|
|
|
1641
1544
|
const injectHMRIntoHTMLFile = (filePath, framework) => {
|
|
1642
1545
|
if (!hmrClientBundle)
|
|
1643
1546
|
return;
|
|
1644
|
-
let html =
|
|
1547
|
+
let html = readFileSync(filePath, "utf-8");
|
|
1645
1548
|
if (html.includes("data-hmr-client"))
|
|
1646
1549
|
return;
|
|
1647
1550
|
const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
|
|
1648
1551
|
const bodyClose = /<\/body\s*>/i.exec(html);
|
|
1649
1552
|
html = bodyClose ? html.slice(0, bodyClose.index) + tag + html.slice(bodyClose.index) : html + tag;
|
|
1650
|
-
|
|
1553
|
+
writeFileSync(filePath, html);
|
|
1651
1554
|
};
|
|
1652
1555
|
const processHtmlPages = async () => {
|
|
1653
1556
|
if (!(htmlDir && htmlPagesPath))
|
|
@@ -1742,9 +1645,9 @@ var build = async ({
|
|
|
1742
1645
|
writeBuildTrace(buildPath);
|
|
1743
1646
|
return { conventions: conventionsMap, manifest };
|
|
1744
1647
|
}
|
|
1745
|
-
|
|
1648
|
+
writeFileSync(join2(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
1746
1649
|
if (Object.keys(conventionsMap).length > 0) {
|
|
1747
|
-
|
|
1650
|
+
writeFileSync(join2(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
1748
1651
|
}
|
|
1749
1652
|
writeBuildTrace(buildPath);
|
|
1750
1653
|
if (tailwind && mode === "production") {
|
|
@@ -1754,7 +1657,7 @@ var build = async ({
|
|
|
1754
1657
|
};
|
|
1755
1658
|
|
|
1756
1659
|
// src/dev/dependencyGraph.ts
|
|
1757
|
-
import { existsSync as existsSync5, readFileSync as
|
|
1660
|
+
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
|
|
1758
1661
|
var {Glob: Glob5 } = globalThis.Bun;
|
|
1759
1662
|
import { resolve as resolve4 } from "path";
|
|
1760
1663
|
var emptyDependencyGraph = {
|
|
@@ -1944,15 +1847,15 @@ var extractDependenciesForFile = (filePath) => {
|
|
|
1944
1847
|
const lowerPath = filePath.toLowerCase();
|
|
1945
1848
|
const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
|
|
1946
1849
|
if (loader === "html") {
|
|
1947
|
-
const content =
|
|
1850
|
+
const content = readFileSync2(filePath, "utf-8");
|
|
1948
1851
|
return extractHtmlDependencies(filePath, content);
|
|
1949
1852
|
}
|
|
1950
1853
|
if (loader === "tsx" || loader === "js") {
|
|
1951
|
-
const content =
|
|
1854
|
+
const content = readFileSync2(filePath, "utf-8");
|
|
1952
1855
|
return extractJsDependencies(filePath, content, loader);
|
|
1953
1856
|
}
|
|
1954
1857
|
if (isSvelteOrVue) {
|
|
1955
|
-
const content =
|
|
1858
|
+
const content = readFileSync2(filePath, "utf-8");
|
|
1956
1859
|
return extractSvelteVueDependencies(filePath, content);
|
|
1957
1860
|
}
|
|
1958
1861
|
return [];
|
|
@@ -2283,10 +2186,10 @@ import { existsSync as existsSync7 } from "fs";
|
|
|
2283
2186
|
import { basename as basename4, dirname as dirname2, relative as relative2, resolve as resolve9 } from "path";
|
|
2284
2187
|
|
|
2285
2188
|
// src/dev/fileHashTracker.ts
|
|
2286
|
-
import { readFileSync as
|
|
2189
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
2287
2190
|
var computeFileHash = (filePath) => {
|
|
2288
2191
|
try {
|
|
2289
|
-
const fileContent =
|
|
2192
|
+
const fileContent = readFileSync3(filePath);
|
|
2290
2193
|
return Number(Bun.hash(fileContent));
|
|
2291
2194
|
} catch {
|
|
2292
2195
|
return UNFOUND_INDEX;
|
|
@@ -4440,5 +4343,5 @@ var devBuild = async (config) => {
|
|
|
4440
4343
|
|
|
4441
4344
|
export { build, devBuild };
|
|
4442
4345
|
|
|
4443
|
-
//# debugId=
|
|
4444
|
-
//# sourceMappingURL=chunk-
|
|
4346
|
+
//# debugId=5026BC8B88390C3464756E2164756E21
|
|
4347
|
+
//# sourceMappingURL=chunk-pjzn557h.js.map
|