@treeui/mcp 0.5.0 → 0.6.0
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/{chunk-TRJAXZUC.js → chunk-ITEC3SEF.js} +2097 -377
- package/dist/cli.cjs +2097 -377
- package/dist/cli.js +1 -1
- package/dist/index.cjs +2114 -374
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +22 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -46,6 +46,7 @@ interface TreeuiComponentEntry {
|
|
|
46
46
|
selection: TreeuiSelectionProfile;
|
|
47
47
|
setup: TreeuiComponentSetup;
|
|
48
48
|
recipes: string[];
|
|
49
|
+
practices: string[];
|
|
49
50
|
}
|
|
50
51
|
interface TreeuiDecisionGuideOption {
|
|
51
52
|
use: string;
|
|
@@ -64,6 +65,13 @@ interface TreeuiRecipe {
|
|
|
64
65
|
compose: string[];
|
|
65
66
|
notes: string[];
|
|
66
67
|
}
|
|
68
|
+
interface TreeuiPractice {
|
|
69
|
+
id: string;
|
|
70
|
+
title: string;
|
|
71
|
+
summary: string;
|
|
72
|
+
rules: string[];
|
|
73
|
+
components: string[];
|
|
74
|
+
}
|
|
67
75
|
interface TreeuiSetupEntry {
|
|
68
76
|
install: {
|
|
69
77
|
packageManagerExamples: Record<string, string>;
|
|
@@ -105,6 +113,7 @@ interface TreeuiCatalog {
|
|
|
105
113
|
packageVersion: string;
|
|
106
114
|
decisionGuides: TreeuiDecisionGuide[];
|
|
107
115
|
recipes: TreeuiRecipe[];
|
|
116
|
+
practices: TreeuiPractice[];
|
|
108
117
|
setup: TreeuiSetupEntry;
|
|
109
118
|
components: TreeuiComponentEntry[];
|
|
110
119
|
tokens: TreeuiTokenEntry[];
|
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ interface TreeuiComponentEntry {
|
|
|
46
46
|
selection: TreeuiSelectionProfile;
|
|
47
47
|
setup: TreeuiComponentSetup;
|
|
48
48
|
recipes: string[];
|
|
49
|
+
practices: string[];
|
|
49
50
|
}
|
|
50
51
|
interface TreeuiDecisionGuideOption {
|
|
51
52
|
use: string;
|
|
@@ -64,6 +65,13 @@ interface TreeuiRecipe {
|
|
|
64
65
|
compose: string[];
|
|
65
66
|
notes: string[];
|
|
66
67
|
}
|
|
68
|
+
interface TreeuiPractice {
|
|
69
|
+
id: string;
|
|
70
|
+
title: string;
|
|
71
|
+
summary: string;
|
|
72
|
+
rules: string[];
|
|
73
|
+
components: string[];
|
|
74
|
+
}
|
|
67
75
|
interface TreeuiSetupEntry {
|
|
68
76
|
install: {
|
|
69
77
|
packageManagerExamples: Record<string, string>;
|
|
@@ -105,6 +113,7 @@ interface TreeuiCatalog {
|
|
|
105
113
|
packageVersion: string;
|
|
106
114
|
decisionGuides: TreeuiDecisionGuide[];
|
|
107
115
|
recipes: TreeuiRecipe[];
|
|
116
|
+
practices: TreeuiPractice[];
|
|
108
117
|
setup: TreeuiSetupEntry;
|
|
109
118
|
components: TreeuiComponentEntry[];
|
|
110
119
|
tokens: TreeuiTokenEntry[];
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
searchComponents,
|
|
12
12
|
searchRecipes,
|
|
13
13
|
searchTokens
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ITEC3SEF.js";
|
|
15
15
|
|
|
16
16
|
// src/catalog-source.ts
|
|
17
17
|
import fs from "fs";
|
|
@@ -512,6 +512,21 @@ var normalizeRecipes = (value) => {
|
|
|
512
512
|
};
|
|
513
513
|
});
|
|
514
514
|
};
|
|
515
|
+
var normalizePractices = (value) => {
|
|
516
|
+
if (!Array.isArray(value)) {
|
|
517
|
+
return [];
|
|
518
|
+
}
|
|
519
|
+
return value.map((practice) => {
|
|
520
|
+
const record = practice;
|
|
521
|
+
return {
|
|
522
|
+
id: String(record.id),
|
|
523
|
+
title: String(record.title),
|
|
524
|
+
summary: stringifyValue(record.summary) ?? "",
|
|
525
|
+
rules: normalizeStringList(record.rules),
|
|
526
|
+
components: normalizeStringList(record.components)
|
|
527
|
+
};
|
|
528
|
+
});
|
|
529
|
+
};
|
|
515
530
|
var loadYamlDocuments = (filePath) => parseAllDocuments(readText(filePath)).map((document) => document.toJSON()).filter((document) => Boolean(document));
|
|
516
531
|
var buildStoryIndex = (repoRoot) => {
|
|
517
532
|
const storiesDir = path.join(repoRoot, "apps/docs/src/stories");
|
|
@@ -550,10 +565,12 @@ var buildCatalogFromRepo = (repoRoot) => {
|
|
|
550
565
|
const setupDoc = loadYamlDocuments(path.join(docsDir, "SETUP.yaml"))[0] ?? {};
|
|
551
566
|
const recipesDoc = loadYamlDocuments(path.join(docsDir, "RECIPES.yaml"))[0] ?? {};
|
|
552
567
|
const contractsDoc = loadYamlDocuments(path.join(docsDir, "CONTRACTS.yaml"))[0] ?? {};
|
|
568
|
+
const practicesDoc = JSON.parse(readText(path.join(docsDir, "practices.json")));
|
|
553
569
|
const componentProfiles = selectionDoc.component_profiles ?? {};
|
|
554
570
|
const componentSetup = setupDoc.component_setup ?? {};
|
|
555
571
|
const aliasMap = contractsDoc.compatibility_aliases ?? {};
|
|
556
572
|
const recipes = normalizeRecipes(recipesDoc.recipes);
|
|
573
|
+
const practices = normalizePractices(practicesDoc.practices);
|
|
557
574
|
const components = fs.readdirSync(componentsDir).filter((fileName) => fileName.endsWith(".yaml")).flatMap((fileName) => {
|
|
558
575
|
const filePath = path.join(componentsDir, fileName);
|
|
559
576
|
return loadYamlDocuments(filePath).flatMap((document) => {
|
|
@@ -572,6 +589,7 @@ var buildCatalogFromRepo = (repoRoot) => {
|
|
|
572
589
|
)
|
|
573
590
|
);
|
|
574
591
|
const componentRecipes = recipes.filter((recipe) => recipe.compose.includes(name)).map((recipe) => recipe.id);
|
|
592
|
+
const componentPractices = practices.filter((practice) => practice.components.includes(name)).map((practice) => practice.id);
|
|
575
593
|
const entry = {
|
|
576
594
|
name,
|
|
577
595
|
legacyAlias: aliasMap[name] ?? aliases.find((alias) => alias.startsWith("Tree")),
|
|
@@ -593,7 +611,8 @@ var buildCatalogFromRepo = (repoRoot) => {
|
|
|
593
611
|
behavior: normalizeStringList(document.behavior),
|
|
594
612
|
selection,
|
|
595
613
|
setup: setup2,
|
|
596
|
-
recipes: componentRecipes
|
|
614
|
+
recipes: componentRecipes,
|
|
615
|
+
practices: componentPractices
|
|
597
616
|
};
|
|
598
617
|
return [entry];
|
|
599
618
|
});
|
|
@@ -636,6 +655,7 @@ var buildCatalogFromRepo = (repoRoot) => {
|
|
|
636
655
|
packageVersion: vuePackage.version,
|
|
637
656
|
decisionGuides: normalizeDecisionGuides(selectionDoc.decision_guides),
|
|
638
657
|
recipes,
|
|
658
|
+
practices,
|
|
639
659
|
setup,
|
|
640
660
|
components,
|
|
641
661
|
tokens: buildTokenEntries()
|