@absolutejs/absolute 0.19.0-beta.1005 → 0.19.0-beta.1006

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-YncvOu/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-zOrQ5z/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-YncvOu/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-zOrQ5z/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-YncvOu/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-zOrQ5z/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
package/dist/build.js CHANGED
@@ -12586,6 +12586,25 @@ var init_compileSvelte = __esm(() => {
12586
12586
  transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
12587
12587
  });
12588
12588
 
12589
+ // src/build/parseVueSpaRoutes.ts
12590
+ var ROUTES_BLOCK_RE, ROUTE_ENTRY_RE, parseVueSpaRoutes = (source) => {
12591
+ const blockMatch = source.match(ROUTES_BLOCK_RE);
12592
+ if (!blockMatch?.[1])
12593
+ return [];
12594
+ const block = blockMatch[1];
12595
+ const entries = [];
12596
+ for (const match of block.matchAll(ROUTE_ENTRY_RE)) {
12597
+ const [, path, importPath] = match;
12598
+ if (path && importPath)
12599
+ entries.push({ importPath, path });
12600
+ }
12601
+ return entries;
12602
+ };
12603
+ var init_parseVueSpaRoutes = __esm(() => {
12604
+ ROUTES_BLOCK_RE = /export\s+const\s+routes\s*=\s*defineRoutes\s*\(\s*\[([\s\S]*?)\]\s*\)\s*;?/;
12605
+ ROUTE_ENTRY_RE = /path:\s*['"`]([^'"`]+)['"`][\s\S]*?import\(\s*['"`]([^'"`]+\.vue)['"`]\s*\)/g;
12606
+ });
12607
+
12589
12608
  // src/build/chainInlineSourcemaps.ts
12590
12609
  var exports_chainInlineSourcemaps = {};
12591
12610
  __export(exports_chainInlineSourcemaps, {
@@ -13113,6 +13132,7 @@ var resolveDevClientDir3 = () => {
13113
13132
  const { descriptor } = compiler.parse(sourceContent, {
13114
13133
  filename: sourceFilePath
13115
13134
  });
13135
+ const spaRoutes = isEntryPoint ? parseVueSpaRoutes(descriptor.script?.content ?? "") : [];
13116
13136
  const hmrId = generateVueHmrId(sourceFilePath, vueRootDir);
13117
13137
  const changeType = detectVueChangeType(sourceFilePath, descriptor);
13118
13138
  vueHmrMetadata.set(sourceFilePath, { changeType, hmrId });
@@ -13264,6 +13284,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
13264
13284
  cssPaths: cssOutputPaths,
13265
13285
  hmrId,
13266
13286
  serverPath: serverOutputPath,
13287
+ spaRoutes: spaRoutes.length > 0 ? spaRoutes : undefined,
13267
13288
  tsHelperPaths: [
13268
13289
  ...helperModulePaths.map((helper) => resolveHelperTsPath(dirname13(sourceFilePath), helper)),
13269
13290
  ...childBuildResults.flatMap((child) => child.tsHelperPaths)
@@ -13300,7 +13321,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
13300
13321
  clientPath: null,
13301
13322
  cssPaths: result.cssPaths,
13302
13323
  indexPath: null,
13303
- serverPath: result.serverPath
13324
+ serverPath: result.serverPath,
13325
+ sourcePath: resolvedEntryPath,
13326
+ spaRoutes: result.spaRoutes
13304
13327
  };
13305
13328
  }
13306
13329
  const entryBaseName = basename7(entryPath, ".vue");
@@ -13451,7 +13474,9 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
13451
13474
  clientPath: clientOutputFile,
13452
13475
  cssPaths: result.cssPaths,
13453
13476
  indexPath: indexOutputFile,
13454
- serverPath: result.serverPath
13477
+ serverPath: result.serverPath,
13478
+ sourcePath: resolvedEntryPath,
13479
+ spaRoutes: result.spaRoutes
13455
13480
  };
13456
13481
  }));
13457
13482
  const queue = Array.from(allTsHelperPaths);
@@ -13486,12 +13511,19 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
13486
13511
  await write3(outServerPath, transpiledCode);
13487
13512
  }));
13488
13513
  const isString = (value) => value !== null;
13514
+ const vueSpaRoutesBySource = new Map;
13515
+ for (const page of compiledPages) {
13516
+ if (page.spaRoutes && page.spaRoutes.length > 0) {
13517
+ vueSpaRoutesBySource.set(page.sourcePath, page.spaRoutes);
13518
+ }
13519
+ }
13489
13520
  return {
13490
13521
  hmrMetadata: new Map(vueHmrMetadata),
13491
13522
  vueClientPaths: compiledPages.map((p2) => p2.clientPath).filter(isString),
13492
13523
  vueCssPaths: compiledPages.flatMap((result) => result.cssPaths),
13493
13524
  vueIndexPaths: compiledPages.map((p2) => p2.indexPath).filter(isString),
13494
- vueServerPaths: compiledPages.map((result) => result.serverPath)
13525
+ vueServerPaths: compiledPages.map((result) => result.serverPath),
13526
+ vueSpaRoutesBySource
13495
13527
  };
13496
13528
  };
13497
13529
  var init_compileVue = __esm(() => {
@@ -13499,6 +13531,7 @@ var init_compileVue = __esm(() => {
13499
13531
  init_generatedDir();
13500
13532
  init_resolvePackageImport();
13501
13533
  init_sourceMetadata();
13534
+ init_parseVueSpaRoutes();
13502
13535
  init_chainInlineSourcemaps();
13503
13536
  init_vueAutoRouterTransform();
13504
13537
  init_stylePreprocessor();
@@ -20140,7 +20173,13 @@ ${content.slice(firstUseIdx)}`;
20140
20173
  }
20141
20174
  const [
20142
20175
  { svelteServerPaths, svelteIndexPaths, svelteClientPaths },
20143
- { vueServerPaths, vueIndexPaths, vueClientPaths, vueCssPaths },
20176
+ {
20177
+ vueServerPaths,
20178
+ vueIndexPaths,
20179
+ vueClientPaths,
20180
+ vueCssPaths,
20181
+ vueSpaRoutesBySource
20182
+ },
20144
20183
  { clientPaths: angularClientPaths, serverPaths: angularServerPaths },
20145
20184
  { clientPaths: emberClientPaths, serverPaths: emberServerPaths },
20146
20185
  { svelteClientPaths: islandSvelteClientPaths },
@@ -20156,7 +20195,8 @@ ${content.slice(firstUseIdx)}`;
20156
20195
  vueClientPaths: [...emptyStringArray],
20157
20196
  vueCssPaths: [...emptyStringArray],
20158
20197
  vueIndexPaths: [...emptyStringArray],
20159
- vueServerPaths: [...emptyStringArray]
20198
+ vueServerPaths: [...emptyStringArray],
20199
+ vueSpaRoutesBySource: new Map
20160
20200
  },
20161
20201
  shouldCompileAngular ? tracePhase("compile/angular", async () => {
20162
20202
  const mod = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
@@ -20768,12 +20808,14 @@ ${content.slice(firstUseIdx)}`;
20768
20808
  }
20769
20809
  const fsPromises = await import("fs/promises");
20770
20810
  const siblingCssPaths = [];
20811
+ const serverJsByPascalName = new Map;
20771
20812
  await Promise.all(serverOutputs.map(async (artifact) => {
20772
20813
  if (extname8(artifact.path) !== ".js")
20773
20814
  return;
20774
20815
  const pascalName = stripHash(basename10(artifact.path), artifact.hash);
20775
20816
  if (!pascalName)
20776
20817
  return;
20818
+ serverJsByPascalName.set(pascalName, artifact);
20777
20819
  const cssArtifact = cssByName.get(`${toKebab(pascalName)}-compiled`);
20778
20820
  if (!cssArtifact)
20779
20821
  return;
@@ -20782,6 +20824,31 @@ ${content.slice(firstUseIdx)}`;
20782
20824
  siblingCssPaths.push(siblingCssPath);
20783
20825
  manifest[`${pascalName}Css`] = siblingCssPath;
20784
20826
  }));
20827
+ const spaSideManifestPaths = [];
20828
+ if (vueSpaRoutesBySource && vueSpaRoutesBySource.size > 0) {
20829
+ await Promise.all([...vueSpaRoutesBySource.entries()].map(async ([source, routes]) => {
20830
+ const parentName = basename10(source, ".vue");
20831
+ const parentArtifact = serverJsByPascalName.get(parentName);
20832
+ if (!parentArtifact)
20833
+ return;
20834
+ const sourceDir = dirname17(source);
20835
+ const entries = routes.flatMap(({ path, importPath }) => {
20836
+ const childSourcePath = resolve25(sourceDir, importPath);
20837
+ const childName = basename10(childSourcePath, ".vue");
20838
+ const childArtifact = serverJsByPascalName.get(childName);
20839
+ if (!childArtifact)
20840
+ return [];
20841
+ const cssPath = childArtifact.path.replace(/\.js$/, ".css");
20842
+ return [{ cssPath, path }];
20843
+ });
20844
+ if (entries.length === 0)
20845
+ return;
20846
+ const sideManifestPath = parentArtifact.path.replace(/\.js$/, ".spa.json");
20847
+ await fsPromises.writeFile(sideManifestPath, JSON.stringify(entries));
20848
+ spaSideManifestPaths.push(sideManifestPath);
20849
+ manifest[`${parentName}SpaManifest`] = sideManifestPath;
20850
+ }));
20851
+ }
20785
20852
  for (const serverPath of emberServerPaths) {
20786
20853
  const fileBase = basename10(serverPath, ".js");
20787
20854
  manifest[toPascal(fileBase)] = serverPath;
@@ -20877,6 +20944,7 @@ ${content.slice(firstUseIdx)}`;
20877
20944
  ...islandClientOutputs.map((a) => a.path),
20878
20945
  ...cssOutputs.map((a) => a.path),
20879
20946
  ...siblingCssPaths,
20947
+ ...spaSideManifestPaths,
20880
20948
  ...conventionOutputPaths
20881
20949
  ]));
20882
20950
  }
@@ -27095,5 +27163,5 @@ export {
27095
27163
  build
27096
27164
  };
27097
27165
 
27098
- //# debugId=563DFF6CF5262F3964756E2164756E21
27166
+ //# debugId=5A6BA864040BC45E64756E2164756E21
27099
27167
  //# sourceMappingURL=build.js.map