@absolutejs/absolute 0.19.0-beta.767 → 0.19.0-beta.769

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/build.js CHANGED
@@ -41379,7 +41379,7 @@ ${t.join(`
41379
41379
  import { mkdir as mkdir2, rm as rm2 } from "fs/promises";
41380
41380
  import { dirname as dirname5, join as join7 } from "path";
41381
41381
  var {build: bunBuild } = globalThis.Bun;
41382
- var TAILWIND_NATIVE_TEMP_DIR = ".absolute-tailwind-native", postprocessTailwindCss = async (css, outputPath, styleTransformConfig) => compileStyleSource(outputPath, css, "css", styleTransformConfig), compileTailwind = async (input, output, buildPath, styleTransformConfig) => {
41382
+ var TAILWIND_NATIVE_TEMP_DIR = ".absolute-tailwind-native", TAILWIND_CANDIDATE_EXTENSION_PATTERN, isTailwindCandidate = (filePath) => TAILWIND_CANDIDATE_EXTENSION_PATTERN.test(filePath), postprocessTailwindCss = async (css, outputPath, styleTransformConfig) => compileStyleSource(outputPath, css, "css", styleTransformConfig), compileTailwind = async (input, output, buildPath, styleTransformConfig) => {
41383
41383
  const outputPath = join7(buildPath, output);
41384
41384
  const tempDir = join7(buildPath, TAILWIND_NATIVE_TEMP_DIR);
41385
41385
  await mkdir2(dirname5(outputPath), { recursive: true });
@@ -41413,6 +41413,7 @@ ${details}` : ""}`);
41413
41413
  }, compileTailwindConfig = async (tailwind, buildPath, styleTransformConfig) => compileTailwind(tailwind.input, tailwind.output, buildPath, styleTransformConfig);
41414
41414
  var init_compileTailwind = __esm(() => {
41415
41415
  init_stylePreprocessor();
41416
+ TAILWIND_CANDIDATE_EXTENSION_PATTERN = /\.(html?|m?[jt]sx?|cjs|vue|svelte|astro|mdx?|css|s[ac]ss|less|styl(?:us)?)$/i;
41416
41417
  });
41417
41418
 
41418
41419
  // src/utils/imageProcessing.ts
@@ -45757,7 +45758,7 @@ ${content.slice(firstUseIdx)}`;
45757
45758
  recursive: true
45758
45759
  }));
45759
45760
  }
45760
- const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isStylePath)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig)) : undefined;
45761
+ const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isTailwindCandidate)) ? tracePhase("tailwind/build", () => compileTailwindConfig(tailwind, buildPath, styleTransformConfig)) : undefined;
45761
45762
  const emptyConventionResult = {
45762
45763
  conventions: undefined,
45763
45764
  pageFiles: []
@@ -45941,20 +45942,42 @@ ${content.slice(firstUseIdx)}`;
45941
45942
  vueConventionSources.length > 0 && vueDir ? tracePhase("compile/convention-vue", () => Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false, styleTransformConfig))) : { vueServerPaths: emptyStringArray },
45942
45943
  angularConventionSources.length > 0 && angularDir ? tracePhase("compile/convention-angular", () => Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularConventionSources, angularDir, hmr, styleTransformConfig))) : { serverPaths: emptyStringArray }
45943
45944
  ]);
45944
- const copyConventionFiles = (framework, sources, compiledPaths) => {
45945
+ const bundleConventionFiles = async (framework, compiledPaths) => {
45945
45946
  const destDir = join20(buildPath, "conventions", framework);
45947
+ rmSync2(destDir, { force: true, recursive: true });
45946
45948
  mkdirSync10(destDir, { recursive: true });
45947
45949
  const destPaths = [];
45948
- for (const compiledPath of compiledPaths) {
45949
- const dest = join20(destDir, basename7(compiledPath));
45950
- copyFileSync(compiledPath, dest);
45951
- destPaths.push(dest);
45950
+ for (let idx = 0;idx < compiledPaths.length; idx++) {
45951
+ const compiledPath = compiledPaths[idx];
45952
+ if (!compiledPath)
45953
+ continue;
45954
+ const name = basename7(compiledPath).replace(/\.[^.]+$/, "");
45955
+ const result = await bunBuild7({
45956
+ entrypoints: [compiledPath],
45957
+ format: "esm",
45958
+ minify: !isDev,
45959
+ naming: `${idx}-${name}.[ext]`,
45960
+ outdir: destDir,
45961
+ splitting: false,
45962
+ target: "bun",
45963
+ throw: false
45964
+ });
45965
+ if (!result.success) {
45966
+ outputLogs(result.logs);
45967
+ throw new Error(`Failed to bundle ${framework} convention: ${compiledPath}`);
45968
+ }
45969
+ const output = result.outputs.find((artifact) => artifact.path.endsWith(".js"));
45970
+ if (!output)
45971
+ throw new Error(`${framework} convention did not emit JavaScript: ${compiledPath}`);
45972
+ destPaths.push(output.path);
45952
45973
  }
45953
45974
  return destPaths;
45954
45975
  };
45955
- const svelteDests = copyConventionFiles("svelte", svelteConventionSources, svelteConvResult.svelteServerPaths);
45956
- const vueDests = copyConventionFiles("vue", vueConventionSources, vueConvResult.vueServerPaths);
45957
- const angularDests = copyConventionFiles("angular", angularConventionSources, angularConvResult.serverPaths);
45976
+ const [svelteDests, vueDests, angularDests] = await Promise.all([
45977
+ tracePhase("bundle/convention-svelte", () => bundleConventionFiles("svelte", svelteConvResult.svelteServerPaths)),
45978
+ tracePhase("bundle/convention-vue", () => bundleConventionFiles("vue", vueConvResult.vueServerPaths)),
45979
+ tracePhase("bundle/convention-angular", () => bundleConventionFiles("angular", angularConvResult.serverPaths))
45980
+ ]);
45958
45981
  conventionOutputPaths = [
45959
45982
  ...reactConvPaths,
45960
45983
  ...svelteDests,
@@ -50426,5 +50449,5 @@ export {
50426
50449
  build
50427
50450
  };
50428
50451
 
50429
- //# debugId=BF84B2675251199D64756E2164756E21
50452
+ //# debugId=E855F3D6F1E1C35964756E2164756E21
50430
50453
  //# sourceMappingURL=build.js.map