teamix-evo 0.20.1 → 0.20.2
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/README.md +1 -1
- package/dist/core/index.js +40 -3
- package/dist/core/index.js.map +1 -1
- package/dist/index.js +76 -6
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -170,7 +170,7 @@ TEAMIX_DEBUG=1 teamix-evo tokens init opentrek
|
|
|
170
170
|
|
|
171
171
|
| 命令 | 说明 |
|
|
172
172
|
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
173
|
-
| `teamix-evo init [-y] [--dry-run] [--variant <n>]` | 普通版接入:检测冲突 → wizard →
|
|
173
|
+
| `teamix-evo init [-y] [--dry-run] [--variant <n>]` | 普通版接入:检测冲突 → wizard → 静默落地 → 自动提交,并校验默认 Git 工作区干净 |
|
|
174
174
|
| `teamix-evo update [--dry-run] [--cwd <dir>]` | 一键升级已装资源(tokens + skills,ADR 0003 三态 + ADR 0035 短路) |
|
|
175
175
|
| `teamix-evo migrate [--cwd <dir>] [--json]` | shadcn 项目迁移前置检查(AI skill 引导实际迁移) |
|
|
176
176
|
| `teamix-evo graft [--variant <v>] [--json] [--cwd <dir>]` | 叠加 Teamix Evo 到传统组件库项目(双栈共存,ADR 0047) |
|
package/dist/core/index.js
CHANGED
|
@@ -2502,7 +2502,16 @@ async function listBizUiEntries(variant, packageRoot) {
|
|
|
2502
2502
|
import * as path14 from "path";
|
|
2503
2503
|
import * as fs12 from "fs";
|
|
2504
2504
|
import { execa } from "execa";
|
|
2505
|
-
|
|
2505
|
+
function renderEslintConfig(tailwindCssConfigPath) {
|
|
2506
|
+
const tailwindSettings = tailwindCssConfigPath ? `
|
|
2507
|
+
{
|
|
2508
|
+
settings: {
|
|
2509
|
+
tailwindcss: {
|
|
2510
|
+
cssConfigPath: '${tailwindCssConfigPath}',
|
|
2511
|
+
},
|
|
2512
|
+
},
|
|
2513
|
+
},` : "";
|
|
2514
|
+
return `/**
|
|
2506
2515
|
* teamix-evo consumer ESLint preset \u2014 9 token-discipline rules.
|
|
2507
2516
|
* - Repo-wide: no-color-literal / no-arbitrary-tw-value / no-raw-color-scale /
|
|
2508
2517
|
* no-large-radius / prefer-gap-over-space / no-manual-dark-classnames /
|
|
@@ -2513,8 +2522,30 @@ var ESLINT_CONFIG_CONTENT = `/**
|
|
|
2513
2522
|
*/
|
|
2514
2523
|
import consumerPreset from '@teamix-evo/eslint-config/presets/consumer';
|
|
2515
2524
|
|
|
2516
|
-
export default [
|
|
2525
|
+
export default [
|
|
2526
|
+
...consumerPreset,${tailwindSettings}
|
|
2527
|
+
];
|
|
2517
2528
|
`;
|
|
2529
|
+
}
|
|
2530
|
+
var TAILWIND_CSS_CANDIDATES = [
|
|
2531
|
+
"src/index.css",
|
|
2532
|
+
"src/globals.css",
|
|
2533
|
+
"src/app/globals.css",
|
|
2534
|
+
"app/globals.css",
|
|
2535
|
+
"styles/globals.css",
|
|
2536
|
+
"src/styles/tailwind.css"
|
|
2537
|
+
];
|
|
2538
|
+
async function detectTailwindCssConfigPath(projectRoot) {
|
|
2539
|
+
for (const candidate of TAILWIND_CSS_CANDIDATES) {
|
|
2540
|
+
const content = await readFileOrNull(path14.join(projectRoot, candidate));
|
|
2541
|
+
if (content && /@(?:import\s+['"]tailwindcss(?:\/[^'"]*)?['"]|theme\b|tailwind\b)/.test(
|
|
2542
|
+
content
|
|
2543
|
+
)) {
|
|
2544
|
+
return `./${candidate}`;
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
return null;
|
|
2548
|
+
}
|
|
2518
2549
|
var STYLELINT_CONFIG_CONTENT = `/** @type {import('stylelint').Config} */
|
|
2519
2550
|
module.exports = {
|
|
2520
2551
|
extends: ['@teamix-evo/stylelint-config/presets/consumer'],
|
|
@@ -2579,7 +2610,13 @@ async function runLintInit(options) {
|
|
|
2579
2610
|
let wroteEslint = false;
|
|
2580
2611
|
let wroteStylelint = false;
|
|
2581
2612
|
if (eslintNeedsWrite) {
|
|
2582
|
-
await
|
|
2613
|
+
const tailwindCssConfigPath = await detectTailwindCssConfigPath(
|
|
2614
|
+
projectRoot
|
|
2615
|
+
);
|
|
2616
|
+
await writeFileSafe(
|
|
2617
|
+
eslintConfigPath,
|
|
2618
|
+
renderEslintConfig(tailwindCssConfigPath)
|
|
2619
|
+
);
|
|
2583
2620
|
logger.debug(`Wrote eslint.config.js \u2192 ${eslintConfigPath}`);
|
|
2584
2621
|
wroteEslint = true;
|
|
2585
2622
|
}
|