myoperator-ui 0.0.42 → 0.0.43
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 +18 -1
- package/package.json +10 -4
package/dist/index.js
CHANGED
|
@@ -1288,8 +1288,24 @@ async function init() {
|
|
|
1288
1288
|
}
|
|
1289
1289
|
return "tailwind.config.js";
|
|
1290
1290
|
};
|
|
1291
|
+
const detectTailwindPrefix = async (configFile) => {
|
|
1292
|
+
const configPath2 = path2.join(cwd, configFile);
|
|
1293
|
+
if (await fs2.pathExists(configPath2)) {
|
|
1294
|
+
const content = await fs2.readFile(configPath2, "utf-8");
|
|
1295
|
+
const prefixMatch = content.match(/prefix:\s*['"]([^'"]+)['"]/);
|
|
1296
|
+
if (prefixMatch) {
|
|
1297
|
+
return prefixMatch[1];
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
return "";
|
|
1301
|
+
};
|
|
1291
1302
|
const detectedCss = await detectGlobalCss();
|
|
1292
1303
|
const detectedTailwindConfig = await detectTailwindConfig();
|
|
1304
|
+
const detectedPrefix = await detectTailwindPrefix(detectedTailwindConfig);
|
|
1305
|
+
if (detectedPrefix) {
|
|
1306
|
+
console.log(chalk2.blue(` \u2139 Tailwind prefix "${detectedPrefix}" detected - components will use prefixed classes
|
|
1307
|
+
`));
|
|
1308
|
+
}
|
|
1293
1309
|
let tailwindVersion = detectedTailwindVersion;
|
|
1294
1310
|
if (!tailwindVersion) {
|
|
1295
1311
|
const response = await prompts2([
|
|
@@ -1318,7 +1334,8 @@ async function init() {
|
|
|
1318
1334
|
tailwind: {
|
|
1319
1335
|
...DEFAULT_CONFIG.tailwind,
|
|
1320
1336
|
config: tailwindConfig,
|
|
1321
|
-
css: globalCss
|
|
1337
|
+
css: globalCss,
|
|
1338
|
+
prefix: detectedPrefix
|
|
1322
1339
|
},
|
|
1323
1340
|
aliases: {
|
|
1324
1341
|
...DEFAULT_CONFIG.aliases,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myoperator-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
4
|
"description": "CLI for adding myOperator UI components to your project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -12,9 +12,14 @@
|
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
14
|
"generate-registry": "node scripts/generate-registry.js",
|
|
15
|
-
"
|
|
15
|
+
"validate-registry": "node scripts/validate-registry.js",
|
|
16
|
+
"verify-build": "node scripts/verify-build.js",
|
|
17
|
+
"build": "npm run generate-registry && tsup src/index.ts --format esm --dts && npm run verify-build",
|
|
16
18
|
"dev": "tsup src/index.ts --format esm --watch",
|
|
17
|
-
"typecheck": "tsc --noEmit"
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"prepublishOnly": "npm run build && npm run validate-registry"
|
|
18
23
|
},
|
|
19
24
|
"dependencies": {
|
|
20
25
|
"chalk": "^5.3.0",
|
|
@@ -28,7 +33,8 @@
|
|
|
28
33
|
"@types/node": "^20.11.0",
|
|
29
34
|
"@types/prompts": "^2.4.9",
|
|
30
35
|
"tsup": "^8.0.1",
|
|
31
|
-
"typescript": "^5.3.3"
|
|
36
|
+
"typescript": "^5.3.3",
|
|
37
|
+
"vitest": "^1.0.0"
|
|
32
38
|
},
|
|
33
39
|
"keywords": [
|
|
34
40
|
"myoperator",
|