@absolutejs/absolute 0.19.0-beta.764 → 0.19.0-beta.766

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/cli/index.js CHANGED
@@ -280,6 +280,7 @@ var init_loadConfig = __esm(() => {
280
280
  "assetsDirectory",
281
281
  "astroDirectory",
282
282
  "buildDirectory",
283
+ "bunBuild",
283
284
  "command",
284
285
  "config",
285
286
  "cwd",
@@ -877,6 +878,7 @@ var init_build = __esm(() => {
877
878
  // src/cli/scripts/compile.ts
878
879
  var exports_compile = {};
879
880
  __export(exports_compile, {
881
+ shouldEmbedCompiledAsset: () => shouldEmbedCompiledAsset,
880
882
  compile: () => compile
881
883
  });
882
884
  var {env: env3 } = globalThis.Bun;
@@ -950,7 +952,15 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
950
952
  return candidate;
951
953
  }
952
954
  return resolve8(import.meta.dir, "..", "..", "react", "jsxDevRuntimeCompat.js");
953
- }, jsxDevRuntimeCompatPath2, generateEntrypoint = (distDir, serverEntry, prerenderMap, version2) => {
955
+ }, jsxDevRuntimeCompatPath2, shouldEmbedCompiledAsset = (relativePath, skip = new Set) => {
956
+ if (skip.has(relativePath))
957
+ return false;
958
+ if (relativePath.split(/[\\/]/).includes(".generated"))
959
+ return false;
960
+ if (relativePath.includes("/server/"))
961
+ return false;
962
+ return true;
963
+ }, generateEntrypoint = (distDir, serverEntry, prerenderMap, version2) => {
954
964
  const allFiles = collectFiles2(distDir);
955
965
  const serverBundleName = `${basename2(serverEntry).replace(/\.[^.]+$/, "")}.js`;
956
966
  const skip = new Set([
@@ -958,16 +968,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
958
968
  "manifest.json",
959
969
  "_compile_entrypoint.ts"
960
970
  ]);
961
- const clientFiles = allFiles.filter((file) => {
962
- const rel = relative(distDir, file);
963
- if (skip.has(rel))
964
- return false;
965
- if (rel.includes(".generated"))
966
- return false;
967
- if (rel.includes("/server/"))
968
- return false;
969
- return true;
970
- });
971
+ const clientFiles = allFiles.filter((file) => shouldEmbedCompiledAsset(relative(distDir, file), skip));
971
972
  const imports = [];
972
973
  const mappings = [];
973
974
  clientFiles.forEach((filePath, idx) => {
package/dist/index.js CHANGED
@@ -3416,6 +3416,15 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
3416
3416
  if (isFromReact || isFromVue || isFromSvelte || isFromAngular)
3417
3417
  return `${pascalName}BundledCSS`;
3418
3418
  return `${pascalName}CSS`;
3419
+ }, getArtifactBaseName = (fileName, hash) => {
3420
+ const ext = extname4(fileName);
3421
+ const stem = ext ? fileName.slice(0, -ext.length) : fileName;
3422
+ if (!hash)
3423
+ return stem;
3424
+ const hashSuffix = `.${hash}`;
3425
+ if (stem.endsWith(hashSuffix))
3426
+ return stem.slice(0, -hashSuffix.length);
3427
+ return stem;
3419
3428
  }, generateManifest = (outputs, buildPath) => outputs.reduce((manifest, artifact) => {
3420
3429
  const normalizedArtifactPath = normalizePath(artifact.path);
3421
3430
  const normalizedBuildPath = normalizePath(buildPath);
@@ -3425,7 +3434,7 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
3425
3434
  const fileWithHash = segments.pop();
3426
3435
  if (!fileWithHash)
3427
3436
  return manifest;
3428
- const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
3437
+ const baseName = getArtifactBaseName(fileWithHash, artifact.hash);
3429
3438
  if (!baseName)
3430
3439
  return manifest;
3431
3440
  const pascalName = toPascal(baseName);
@@ -45707,7 +45716,43 @@ ${content.slice(firstUseIdx)}`;
45707
45716
  if (changed)
45708
45717
  writeFileSync7(outputPath, content);
45709
45718
  }
45710
- }, vueFeatureFlags, build2 = async ({
45719
+ }, vueFeatureFlags, bunBuildPassKeys, bunBuildPassKeySet, reservedBunBuildConfigKeys, isObject2 = (value2) => typeof value2 === "object" && value2 !== null, isBunBuildPassConfig = (config) => isObject2(config) && Object.keys(config).some((key) => bunBuildPassKeySet.has(key)), sanitizeBunBuildOverride = (override) => {
45720
+ if (!override)
45721
+ return {};
45722
+ const sanitized = { ...override };
45723
+ for (const key of reservedBunBuildConfigKeys) {
45724
+ delete sanitized[key];
45725
+ }
45726
+ return sanitized;
45727
+ }, resolveBunBuildOverride = (config, pass) => {
45728
+ if (!config)
45729
+ return {};
45730
+ if (!isBunBuildPassConfig(config)) {
45731
+ return sanitizeBunBuildOverride(config);
45732
+ }
45733
+ return sanitizeBunBuildOverride({
45734
+ ...config.default ?? {},
45735
+ ...config[pass] ?? {}
45736
+ });
45737
+ }, dedupe = (values) => [...new Set(values)], mergeBunBuildConfig = (base, override) => {
45738
+ const sanitized = sanitizeBunBuildOverride(override);
45739
+ const merged = {
45740
+ ...base,
45741
+ ...sanitized
45742
+ };
45743
+ return {
45744
+ ...merged,
45745
+ define: base.define || sanitized.define ? {
45746
+ ...sanitized.define ?? {},
45747
+ ...base.define ?? {}
45748
+ } : undefined,
45749
+ external: dedupe([
45750
+ ...base.external ?? [],
45751
+ ...sanitized.external ?? []
45752
+ ]),
45753
+ plugins: [...base.plugins ?? [], ...sanitized.plugins ?? []]
45754
+ };
45755
+ }, build2 = async ({
45711
45756
  buildDirectory = "build",
45712
45757
  assetsDirectory,
45713
45758
  publicDirectory,
@@ -45722,6 +45767,7 @@ ${content.slice(firstUseIdx)}`;
45722
45767
  stylePreprocessors,
45723
45768
  postcss,
45724
45769
  tailwind,
45770
+ bunBuild: bunBuildConfig,
45725
45771
  options,
45726
45772
  incrementalFiles,
45727
45773
  mode
@@ -46161,20 +46207,23 @@ ${content.slice(firstUseIdx)}`;
46161
46207
  ...svelteVendorPaths2 ?? {}
46162
46208
  };
46163
46209
  const htmlScriptPlugin = hmr ? createHTMLScriptHMRPlugin(htmlDir, htmxDir) : undefined;
46164
- const reactBuildConfig = reactClientEntryPoints.length > 0 ? {
46210
+ const reactBuildConfig = reactClientEntryPoints.length > 0 ? mergeBunBuildConfig({
46165
46211
  entrypoints: reactClientEntryPoints,
46166
46212
  ...Object.keys(reactExternalPaths).length > 0 ? { external: Object.keys(reactExternalPaths) } : {},
46167
46213
  format: "esm",
46168
46214
  minify: !isDev2,
46169
46215
  naming: `[dir]/[name].[hash].[ext]`,
46170
46216
  outdir: buildPath,
46171
- ...hmr ? { jsx: { development: true }, reactFastRefresh: true } : {},
46217
+ ...hmr ? {
46218
+ jsx: { development: true },
46219
+ reactFastRefresh: true
46220
+ } : {},
46172
46221
  plugins: [stylePreprocessorPlugin2],
46173
46222
  root: clientRoot,
46174
46223
  splitting: true,
46175
46224
  target: "browser",
46176
46225
  throw: false
46177
- } : undefined;
46226
+ }, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
46178
46227
  if (reactDir && reactClientEntryPoints.length > 0) {
46179
46228
  rmSync2(join20(buildPath, "react", "generated", "indexes"), {
46180
46229
  force: true,
@@ -46201,7 +46250,7 @@ ${content.slice(firstUseIdx)}`;
46201
46250
  globalCssResult,
46202
46251
  vueCssResult
46203
46252
  ] = await Promise.all([
46204
- serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7({
46253
+ serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7(mergeBunBuildConfig({
46205
46254
  entrypoints: serverEntryPoints,
46206
46255
  external: [
46207
46256
  "react",
@@ -46223,9 +46272,9 @@ ${content.slice(firstUseIdx)}`;
46223
46272
  target: "bun",
46224
46273
  throw: false,
46225
46274
  tsconfig: "./tsconfig.json"
46226
- })) : undefined,
46275
+ }, resolveBunBuildOverride(bunBuildConfig, "server")))) : undefined,
46227
46276
  reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
46228
- nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7({
46277
+ nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7(mergeBunBuildConfig({
46229
46278
  define: vueDirectory ? vueFeatureFlags : undefined,
46230
46279
  entrypoints: nonReactClientEntryPoints,
46231
46280
  external: Object.keys(nonReactExternalPaths),
@@ -46243,8 +46292,8 @@ ${content.slice(firstUseIdx)}`;
46243
46292
  target: "browser",
46244
46293
  throw: false,
46245
46294
  tsconfig: "./tsconfig.json"
46246
- })) : undefined,
46247
- islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7({
46295
+ }, resolveBunBuildOverride(bunBuildConfig, "nonReactClient")))) : undefined,
46296
+ islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7(mergeBunBuildConfig({
46248
46297
  define: vueDirectory ? vueFeatureFlags : undefined,
46249
46298
  entrypoints: islandClientEntryPoints,
46250
46299
  external: Object.keys(nonReactExternalPaths),
@@ -46261,8 +46310,8 @@ ${content.slice(firstUseIdx)}`;
46261
46310
  target: "browser",
46262
46311
  throw: false,
46263
46312
  tsconfig: "./tsconfig.json"
46264
- })) : undefined,
46265
- globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7({
46313
+ }, resolveBunBuildOverride(bunBuildConfig, "islandClient")))) : undefined,
46314
+ globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
46266
46315
  entrypoints: globalCssEntries,
46267
46316
  naming: `[dir]/[name].[hash].[ext]`,
46268
46317
  outdir: stylesDir ? join20(buildPath, basename8(stylesDir)) : buildPath,
@@ -46270,14 +46319,14 @@ ${content.slice(firstUseIdx)}`;
46270
46319
  root: stylesDir || clientRoot,
46271
46320
  target: "browser",
46272
46321
  throw: false
46273
- })) : undefined,
46274
- vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7({
46322
+ }, resolveBunBuildOverride(bunBuildConfig, "globalCss")))) : undefined,
46323
+ vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
46275
46324
  entrypoints: vueCssPaths,
46276
46325
  naming: `[name].[hash].[ext]`,
46277
46326
  outdir: join20(buildPath, assetsPath ? basename8(assetsPath) : "assets", "css"),
46278
46327
  target: "browser",
46279
46328
  throw: false
46280
- })) : undefined
46329
+ }, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
46281
46330
  ]);
46282
46331
  const serverLogs = serverResult?.logs ?? [];
46283
46332
  const serverOutputs = serverResult?.outputs ?? [];
@@ -46561,6 +46610,25 @@ var init_build = __esm(() => {
46561
46610
  __VUE_PROD_DEVTOOLS__: isDev2 ? "true" : "false",
46562
46611
  __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDev2 ? "true" : "false"
46563
46612
  };
46613
+ bunBuildPassKeys = [
46614
+ "server",
46615
+ "reactClient",
46616
+ "nonReactClient",
46617
+ "islandClient",
46618
+ "globalCss",
46619
+ "vueCss"
46620
+ ];
46621
+ bunBuildPassKeySet = new Set(["default", ...bunBuildPassKeys]);
46622
+ reservedBunBuildConfigKeys = new Set([
46623
+ "entrypoints",
46624
+ "outdir",
46625
+ "outfile",
46626
+ "root",
46627
+ "target",
46628
+ "format",
46629
+ "throw",
46630
+ "compile"
46631
+ ]);
46564
46632
  });
46565
46633
 
46566
46634
  // src/dev/dependencyGraph.ts
@@ -51486,6 +51554,7 @@ var RESERVED_TOP_LEVEL_KEYS = new Set([
51486
51554
  "assetsDirectory",
51487
51555
  "astroDirectory",
51488
51556
  "buildDirectory",
51557
+ "bunBuild",
51489
51558
  "command",
51490
51559
  "config",
51491
51560
  "cwd",
@@ -52671,8 +52740,8 @@ var TypeSystemPolicy;
52671
52740
  }
52672
52741
  TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
52673
52742
  function IsObjectLike(value2) {
52674
- const isObject2 = IsObject2(value2);
52675
- return TypeSystemPolicy2.AllowArrayObject ? isObject2 : isObject2 && !IsArray2(value2);
52743
+ const isObject3 = IsObject2(value2);
52744
+ return TypeSystemPolicy2.AllowArrayObject ? isObject3 : isObject3 && !IsArray2(value2);
52676
52745
  }
52677
52746
  TypeSystemPolicy2.IsObjectLike = IsObjectLike;
52678
52747
  function IsRecordLike(value2) {
@@ -58763,5 +58832,5 @@ export {
58763
58832
  ANGULAR_INIT_TIMEOUT_MS
58764
58833
  };
58765
58834
 
58766
- //# debugId=076CED2F51B54E1564756E2164756E21
58835
+ //# debugId=5BEDAE621CA2EF3664756E2164756E21
58767
58836
  //# sourceMappingURL=index.js.map