boss-css 0.0.15 → 0.0.16

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.
@@ -255,8 +255,8 @@ const init = async (config) => {
255
255
  packageJson
256
256
  });
257
257
  const isStencil = framework.id === "stencil";
258
- const cssAutoLoad = !isStencil;
259
- const detectedSrcRoot = await detectSrcRoot(cwd);
258
+ const cssAutoLoad = !isStencil && !isNext;
259
+ const detectedSrcRoot = await detectSrcRoot(cwd, isNext);
260
260
  const normalizedSrcRoot = normalizeRelativePath(await resolveTextValue({
261
261
  label: "Where is your source root?",
262
262
  value: flags.srcRoot,
@@ -559,7 +559,11 @@ const normalizePostcssMode = (value) => {
559
559
  if (normalized === "auto" || normalized === "manual" || normalized === "skip") return normalized;
560
560
  }
561
561
  };
562
- const detectSrcRoot = async (cwd) => {
562
+ const detectSrcRoot = async (cwd, isNext) => {
563
+ if (isNext) {
564
+ if (await exists(node_path.default.join(cwd, "src"))) return "src";
565
+ return ".";
566
+ }
563
567
  for (const candidate of [
564
568
  "src",
565
569
  "app",
@@ -1826,16 +1830,14 @@ const logInitSummary = ({ configDir, isNext, postcssMode, postcssDetection, conf
1826
1830
  if (isNext) {
1827
1831
  _clack_prompts.log.message("Next.js note:");
1828
1832
  if (selectedStrategyId === "classname-only") {
1829
- const importRoot = normalizeImportPath(node_path.default.relative(srcRoot, configDir));
1830
- const importStyles = normalizeImportPath(node_path.default.join(importRoot, "styles.css"));
1831
- _clack_prompts.log.message(`- Classname-only mode skips instrumentation. Import ${importStyles} in your app entry.`);
1833
+ _clack_prompts.log.message("- Classname-only mode skips instrumentation.");
1834
+ _clack_prompts.log.message("- Import Boss styles manually in your root layout (e.g. `import '../.bo$$/styles.css'`).");
1832
1835
  } else {
1833
1836
  _clack_prompts.log.message("- Updated instrumentation files with Boss CSS imports.");
1834
1837
  _clack_prompts.log.message("Boss PostCSS auto-disables dirDependencies when a Turbopack env flag is set.");
1835
1838
  if (!cssAutoLoad) {
1836
- const importRoot = normalizeImportPath(node_path.default.relative(srcRoot, configDir));
1837
- const importStyles = normalizeImportPath(node_path.default.join(importRoot, "styles.css"));
1838
- _clack_prompts.log.message(`- css.autoLoad is false. Import ${importStyles} in your app entry.`);
1839
+ _clack_prompts.log.message("- css.autoLoad is false.");
1840
+ _clack_prompts.log.message("- Import Boss styles manually in your root layout (e.g. `import '../.bo$$/styles.css'`).");
1839
1841
  }
1840
1842
  }
1841
1843
  } else {
@@ -251,8 +251,8 @@ const init = async (config) => {
251
251
  packageJson
252
252
  });
253
253
  const isStencil = framework.id === "stencil";
254
- const cssAutoLoad = !isStencil;
255
- const detectedSrcRoot = await detectSrcRoot(cwd);
254
+ const cssAutoLoad = !isStencil && !isNext;
255
+ const detectedSrcRoot = await detectSrcRoot(cwd, isNext);
256
256
  const normalizedSrcRoot = normalizeRelativePath(await resolveTextValue({
257
257
  label: "Where is your source root?",
258
258
  value: flags.srcRoot,
@@ -555,7 +555,11 @@ const normalizePostcssMode = (value) => {
555
555
  if (normalized === "auto" || normalized === "manual" || normalized === "skip") return normalized;
556
556
  }
557
557
  };
558
- const detectSrcRoot = async (cwd) => {
558
+ const detectSrcRoot = async (cwd, isNext) => {
559
+ if (isNext) {
560
+ if (await exists(path.join(cwd, "src"))) return "src";
561
+ return ".";
562
+ }
559
563
  for (const candidate of [
560
564
  "src",
561
565
  "app",
@@ -1822,16 +1826,14 @@ const logInitSummary = ({ configDir, isNext, postcssMode, postcssDetection, conf
1822
1826
  if (isNext) {
1823
1827
  log.message("Next.js note:");
1824
1828
  if (selectedStrategyId === "classname-only") {
1825
- const importRoot = normalizeImportPath(path.relative(srcRoot, configDir));
1826
- const importStyles = normalizeImportPath(path.join(importRoot, "styles.css"));
1827
- log.message(`- Classname-only mode skips instrumentation. Import ${importStyles} in your app entry.`);
1829
+ log.message("- Classname-only mode skips instrumentation.");
1830
+ log.message("- Import Boss styles manually in your root layout (e.g. `import '../.bo$$/styles.css'`).");
1828
1831
  } else {
1829
1832
  log.message("- Updated instrumentation files with Boss CSS imports.");
1830
1833
  log.message("Boss PostCSS auto-disables dirDependencies when a Turbopack env flag is set.");
1831
1834
  if (!cssAutoLoad) {
1832
- const importRoot = normalizeImportPath(path.relative(srcRoot, configDir));
1833
- const importStyles = normalizeImportPath(path.join(importRoot, "styles.css"));
1834
- log.message(`- css.autoLoad is false. Import ${importStyles} in your app entry.`);
1835
+ log.message("- css.autoLoad is false.");
1836
+ log.message("- Import Boss styles manually in your root layout (e.g. `import '../.bo$$/styles.css'`).");
1835
1837
  }
1836
1838
  }
1837
1839
  } else {