myoperator-ui 0.0.41 → 0.0.42
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/index.js +12 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1122,15 +1122,14 @@ var CSS_VARIABLES_V3 = `@tailwind base;
|
|
|
1122
1122
|
}
|
|
1123
1123
|
|
|
1124
1124
|
`;
|
|
1125
|
-
var getTailwindConfig = (
|
|
1125
|
+
var getTailwindConfig = (disablePreflight = false) => `/** @type {import('tailwindcss').Config} */
|
|
1126
1126
|
export default {
|
|
1127
1127
|
darkMode: ["class"],
|
|
1128
1128
|
content: [
|
|
1129
|
-
|
|
1130
|
-
"./src
|
|
1131
|
-
"./src/**/*.{js,ts,jsx,tsx}",`}
|
|
1129
|
+
"./index.html",
|
|
1130
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
1132
1131
|
],
|
|
1133
|
-
${
|
|
1132
|
+
${disablePreflight ? `corePlugins: {
|
|
1134
1133
|
preflight: false,
|
|
1135
1134
|
},
|
|
1136
1135
|
` : ""}theme: {
|
|
@@ -1293,7 +1292,7 @@ async function init() {
|
|
|
1293
1292
|
const detectedTailwindConfig = await detectTailwindConfig();
|
|
1294
1293
|
let tailwindVersion = detectedTailwindVersion;
|
|
1295
1294
|
if (!tailwindVersion) {
|
|
1296
|
-
const
|
|
1295
|
+
const response = await prompts2([
|
|
1297
1296
|
{
|
|
1298
1297
|
type: "select",
|
|
1299
1298
|
name: "tailwindVersion",
|
|
@@ -1305,13 +1304,13 @@ async function init() {
|
|
|
1305
1304
|
initial: 0
|
|
1306
1305
|
}
|
|
1307
1306
|
]);
|
|
1308
|
-
tailwindVersion =
|
|
1307
|
+
tailwindVersion = response.tailwindVersion;
|
|
1309
1308
|
}
|
|
1310
1309
|
const componentsPath = "src/components/ui";
|
|
1311
1310
|
const utilsPath = "src/lib/utils.ts";
|
|
1312
1311
|
const tailwindConfig = detectedTailwindConfig;
|
|
1313
1312
|
const globalCss = detectedCss;
|
|
1314
|
-
const
|
|
1313
|
+
const disablePreflight = hasBootstrap;
|
|
1315
1314
|
const spinner = ora2("Initializing project...").start();
|
|
1316
1315
|
try {
|
|
1317
1316
|
const config = {
|
|
@@ -1412,12 +1411,12 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
1412
1411
|
if (tailwindVersion === "v3" && tailwindConfig) {
|
|
1413
1412
|
const tailwindConfigPath = path2.join(cwd, tailwindConfig);
|
|
1414
1413
|
if (!await fs2.pathExists(tailwindConfigPath)) {
|
|
1415
|
-
await fs2.writeFile(tailwindConfigPath, getTailwindConfig(
|
|
1414
|
+
await fs2.writeFile(tailwindConfigPath, getTailwindConfig(disablePreflight));
|
|
1416
1415
|
tailwindUpdated = true;
|
|
1417
1416
|
} else {
|
|
1418
1417
|
const existingConfig = await fs2.readFile(tailwindConfigPath, "utf-8");
|
|
1419
1418
|
if (!existingConfig.includes("hsl(var(--destructive))") && !existingConfig.includes("hsl(var(--ring))")) {
|
|
1420
|
-
await fs2.writeFile(tailwindConfigPath, getTailwindConfig(
|
|
1419
|
+
await fs2.writeFile(tailwindConfigPath, getTailwindConfig(disablePreflight));
|
|
1421
1420
|
tailwindUpdated = true;
|
|
1422
1421
|
}
|
|
1423
1422
|
}
|
|
@@ -1470,7 +1469,7 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
1470
1469
|
}
|
|
1471
1470
|
}
|
|
1472
1471
|
spinner.text = "Installing dependencies...";
|
|
1473
|
-
const deps =
|
|
1472
|
+
const deps = tailwindVersion === "v4" ? "clsx tailwind-merge class-variance-authority @radix-ui/react-slot lucide-react" : "clsx tailwind-merge class-variance-authority @radix-ui/react-slot lucide-react tailwindcss-animate tailwindcss@^3.4.0 autoprefixer";
|
|
1474
1473
|
try {
|
|
1475
1474
|
execSync(`npm install ${deps}`, { cwd, stdio: "pipe" });
|
|
1476
1475
|
console.log(chalk2.green("\n \u2713 Installed dependencies"));
|
|
@@ -1496,8 +1495,8 @@ export function cn(...inputs: ClassValue[]) {
|
|
|
1496
1495
|
}
|
|
1497
1496
|
if (tailwindUpdated) {
|
|
1498
1497
|
console.log(chalk2.green(` \u2713 Updated ${tailwindConfig} with theme colors`));
|
|
1499
|
-
if (
|
|
1500
|
-
console.log(chalk2.blue(` \u2139
|
|
1498
|
+
if (disablePreflight) {
|
|
1499
|
+
console.log(chalk2.blue(` \u2139 Preflight disabled for Bootstrap compatibility`));
|
|
1501
1500
|
}
|
|
1502
1501
|
}
|
|
1503
1502
|
if (postcssCreated) {
|