myoperator-ui 0.0.5 → 0.0.6

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -592,6 +592,17 @@ async function init() {
592
592
  process.exit(0);
593
593
  }
594
594
  }
595
+ const packageJsonPath = path2.join(cwd, "package.json");
596
+ let hasBootstrap = false;
597
+ let isESM = false;
598
+ if (await fs2.pathExists(packageJsonPath)) {
599
+ const packageJson = await fs2.readJson(packageJsonPath);
600
+ hasBootstrap = !!(packageJson.dependencies?.bootstrap || packageJson.devDependencies?.bootstrap);
601
+ isESM = packageJson.type === "module";
602
+ if (hasBootstrap) {
603
+ console.log(chalk2.blue(" \u2139 Bootstrap detected - will configure Tailwind to avoid conflicts\n"));
604
+ }
605
+ }
595
606
  const response = await prompts2([
596
607
  {
597
608
  type: "select",
@@ -607,7 +618,8 @@ async function init() {
607
618
  type: "confirm",
608
619
  name: "usePrefix",
609
620
  message: "Use a prefix for Tailwind classes? (recommended if using Bootstrap/other CSS frameworks)",
610
- initial: false
621
+ initial: hasBootstrap
622
+ // Auto-set to true if Bootstrap detected
611
623
  },
612
624
  {
613
625
  type: (prev) => prev ? "text" : null,
@@ -676,7 +688,7 @@ export function cn(...inputs: ClassValue[]) {
676
688
  const globalCssPath = path2.join(cwd, response.globalCss);
677
689
  let cssContent;
678
690
  if (response.tailwindVersion === "v4") {
679
- cssContent = prefix ? CSS_VARIABLES_V4_PREFIXED : CSS_VARIABLES_V4;
691
+ cssContent = prefix || hasBootstrap ? CSS_VARIABLES_V4_PREFIXED : CSS_VARIABLES_V4;
680
692
  } else {
681
693
  cssContent = CSS_VARIABLES_V3;
682
694
  }
@@ -727,7 +739,12 @@ export function cn(...inputs: ClassValue[]) {
727
739
  }
728
740
  }
729
741
  const postcssConfigPath = path2.join(cwd, "postcss.config.js");
730
- const postcssConfigContent = `export default {
742
+ const postcssConfigContent = isESM ? `export default {
743
+ plugins: {
744
+ '@tailwindcss/postcss': {},
745
+ },
746
+ }
747
+ ` : `module.exports = {
731
748
  plugins: {
732
749
  '@tailwindcss/postcss': {},
733
750
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",