@dxtmisha/scripts 0.11.7 → 1.0.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/CHANGELOG.md +67 -0
- package/ai-resources/componentMaterials.md +19 -0
- package/ai-resources/componentPrompt.md +381 -0
- package/ai-resources/componentWiki.md +13 -0
- package/bin/arguments.ts +168 -0
- package/bin/build-packages.ts +12 -2
- package/bin/build-publish-packages.ts +12 -2
- package/bin/design-component.ts +7 -1
- package/bin/design-constructor.ts +22 -3
- package/bin/design-figma.ts +26 -4
- package/bin/design-flags.ts +14 -2
- package/bin/design-library.ts +7 -1
- package/bin/design-package.ts +29 -5
- package/bin/design-prompt.ts +22 -3
- package/bin/design-screenshot.ts +12 -2
- package/bin/design-types-save.ts +32 -5
- package/bin/design-types.ts +32 -6
- package/bin/design-ui.ts +21 -3
- package/bin/design-wiki-storm.ts +11 -3
- package/dist/AiZAi-x3CInynJ.js +232 -0
- package/dist/PropertiesConfig-ChizwW5y.js +250 -0
- package/{src/config.ts → dist/config.d.ts} +179 -158
- package/dist/config.js +20 -0
- package/dist/figmaApiTypes-CArSsNW8.js +6 -0
- package/dist/library-ai.d.ts +482 -0
- package/dist/library-ai.js +2 -0
- package/dist/library-figma.d.ts +462 -0
- package/dist/library-figma.js +75 -0
- package/dist/library-ui.d.ts +586 -0
- package/dist/library-ui.js +3760 -0
- package/dist/library.d.ts +4677 -0
- package/dist/library.js +1436 -0
- package/dist/propertyTypes-DflziKuR.js +236 -0
- package/package.json +69 -20
- package/bin/ai-doc.ts +0 -7
- package/bin/build-functional.ts +0 -5
- package/bin/design-component-wiki.ts +0 -11
- package/src/classes/Ai/AiAbstract.ts +0 -242
- package/src/classes/Ai/AiClaude.ts +0 -26
- package/src/classes/Ai/AiClaudeAgent.ts +0 -16
- package/src/classes/Ai/AiClaudeAgentLite.ts +0 -86
- package/src/classes/Ai/AiClaudeCli.ts +0 -24
- package/src/classes/Ai/AiClaudeCliLite.ts +0 -108
- package/src/classes/Ai/AiClaudeLite.ts +0 -112
- package/src/classes/Ai/AiDoc.ts +0 -81
- package/src/classes/Ai/AiDocItem.ts +0 -27
- package/src/classes/Ai/AiDocItemAbstract.ts +0 -209
- package/src/classes/Ai/AiDocItemClasses.ts +0 -27
- package/src/classes/Ai/AiDocItemComposables.ts +0 -20
- package/src/classes/Ai/AiDocType.ts +0 -45
- package/src/classes/Ai/AiGoogle.ts +0 -26
- package/src/classes/Ai/AiGoogleCli.ts +0 -24
- package/src/classes/Ai/AiGoogleCliLite.ts +0 -108
- package/src/classes/Ai/AiGoogleLite.ts +0 -78
- package/src/classes/Ai/AiOpenAi.ts +0 -26
- package/src/classes/Ai/AiOpenAiLite.ts +0 -107
- package/src/classes/Ai/AiZAi.ts +0 -17
- package/src/classes/Ai/AiZAiLite.ts +0 -77
- package/src/classes/Ai/ApiTmp.ts +0 -43
- package/src/classes/BrowserItem.ts +0 -408
- package/src/classes/Build/BuildFunctional.ts +0 -54
- package/src/classes/Build/BuildPackages.ts +0 -137
- package/src/classes/Build/BuildPublishPackages.ts +0 -105
- package/src/classes/BuildItem.ts +0 -187
- package/src/classes/Component/ComponentCreator.ts +0 -45
- package/src/classes/Component/ComponentItem.ts +0 -161
- package/src/classes/Component/ComponentWiki.ts +0 -258
- package/src/classes/Component/ComponentWikiFile.ts +0 -138
- package/src/classes/Design/DesignCommand.ts +0 -243
- package/src/classes/Design/DesignComponent.ts +0 -824
- package/src/classes/Design/DesignConstructor.ts +0 -222
- package/src/classes/Design/DesignConstructors.ts +0 -101
- package/src/classes/Design/DesignFigma.ts +0 -61
- package/src/classes/Design/DesignFlags.ts +0 -215
- package/src/classes/Design/DesignReplace.ts +0 -672
- package/src/classes/Design/DesignScreenshot.ts +0 -133
- package/src/classes/Design/DesignStructure.ts +0 -201
- package/src/classes/Design/DesignStructureClasses.ts +0 -105
- package/src/classes/Design/DesignStructureItemAbstract.ts +0 -52
- package/src/classes/Design/DesignStructureRead.ts +0 -349
- package/src/classes/Design/DesignStructureStyles.ts +0 -45
- package/src/classes/Design/DesignTypes.ts +0 -94
- package/src/classes/Design/DesignTypesAi.ts +0 -135
- package/src/classes/Design/DesignTypesDescription.ts +0 -119
- package/src/classes/Design/DesignTypesMake.ts +0 -460
- package/src/classes/Design/DesignTypesMcp.ts +0 -90
- package/src/classes/Design/DesignTypesPrompts.ts +0 -332
- package/src/classes/Design/DesignTypescript.ts +0 -244
- package/src/classes/Design/DesignUi.ts +0 -143
- package/src/classes/Design/DesignWiki.ts +0 -52
- package/src/classes/Design/DesignWikiStorm.ts +0 -95
- package/src/classes/Design/DesignWikiStormItem.ts +0 -316
- package/src/classes/FigmaApi.ts +0 -190
- package/src/classes/Git/GitRead.ts +0 -261
- package/src/classes/Library/LibraryAiMcpItem.ts +0 -67
- package/src/classes/Library/LibraryAiPrompt.ts +0 -268
- package/src/classes/Library/LibraryAiPromptItem.ts +0 -331
- package/src/classes/Library/LibraryAiWiki.ts +0 -127
- package/src/classes/Library/LibraryAiWikiItem.ts +0 -79
- package/src/classes/Library/LibraryExport.ts +0 -167
- package/src/classes/Library/LibraryFlags.ts +0 -62
- package/src/classes/Library/LibraryItems.ts +0 -138
- package/src/classes/Library/LibraryList.ts +0 -189
- package/src/classes/Library/LibraryMedia.ts +0 -139
- package/src/classes/Library/LibraryPlugin.ts +0 -73
- package/src/classes/Library/LibraryTypes.ts +0 -130
- package/src/classes/Package/PackageFile.ts +0 -154
- package/src/classes/Package/PackageInit.ts +0 -54
- package/src/classes/Package/PackageItem.ts +0 -329
- package/src/classes/Properties/Properties.ts +0 -175
- package/src/classes/Properties/PropertiesCache.ts +0 -248
- package/src/classes/Properties/PropertiesConfig.ts +0 -213
- package/src/classes/Properties/PropertiesConvector.ts +0 -52
- package/src/classes/Properties/PropertiesFile.ts +0 -522
- package/src/classes/Properties/PropertiesImport.ts +0 -182
- package/src/classes/Properties/PropertiesItems.ts +0 -605
- package/src/classes/Properties/PropertiesKeys.ts +0 -121
- package/src/classes/Properties/PropertiesMain.ts +0 -138
- package/src/classes/Properties/PropertiesPalette.ts +0 -149
- package/src/classes/Properties/PropertiesPath.ts +0 -193
- package/src/classes/Properties/PropertiesScss.ts +0 -261
- package/src/classes/Properties/PropertiesSeparator.ts +0 -118
- package/src/classes/Properties/PropertiesSettings.ts +0 -104
- package/src/classes/Properties/PropertiesStandard.ts +0 -180
- package/src/classes/Properties/PropertiesTool.ts +0 -80
- package/src/classes/Properties/PropertiesTypes.ts +0 -147
- package/src/classes/Properties/PropertiesValues.ts +0 -75
- package/src/classes/Properties/PropertiesWrap.ts +0 -187
- package/src/classes/Properties/convector/convectorColor.ts +0 -27
- package/src/classes/Properties/convector/convectorFontFamilies.ts +0 -18
- package/src/classes/Properties/convector/convectorShadow.ts +0 -61
- package/src/classes/Properties/convector/convectorTypography.ts +0 -19
- package/src/classes/Properties/to/PropertiesToAbstract.ts +0 -51
- package/src/classes/Properties/to/PropertiesToAnimate.ts +0 -59
- package/src/classes/Properties/to/PropertiesToClass.ts +0 -49
- package/src/classes/Properties/to/PropertiesToClone.ts +0 -114
- package/src/classes/Properties/to/PropertiesToComponent.ts +0 -52
- package/src/classes/Properties/to/PropertiesToDrag.ts +0 -231
- package/src/classes/Properties/to/PropertiesToDuplicate.ts +0 -165
- package/src/classes/Properties/to/PropertiesToFull.ts +0 -36
- package/src/classes/Properties/to/PropertiesToLink.ts +0 -259
- package/src/classes/Properties/to/PropertiesToMedia.ts +0 -187
- package/src/classes/Properties/to/PropertiesToMulti.ts +0 -101
- package/src/classes/Properties/to/PropertiesToNone.ts +0 -46
- package/src/classes/Properties/to/PropertiesToPalette.ts +0 -241
- package/src/classes/Properties/to/PropertiesToProperty.ts +0 -31
- package/src/classes/Properties/to/PropertiesToRemove.ts +0 -33
- package/src/classes/Properties/to/PropertiesToReplace.ts +0 -77
- package/src/classes/Properties/to/PropertiesToRoot.ts +0 -40
- package/src/classes/Properties/to/PropertiesToSimilar.ts +0 -128
- package/src/classes/Properties/to/PropertiesToSort.ts +0 -146
- package/src/classes/Properties/to/PropertiesToState.ts +0 -65
- package/src/classes/Properties/to/PropertiesToStyle.ts +0 -52
- package/src/classes/Properties/to/PropertiesToSub.ts +0 -95
- package/src/classes/Properties/to/PropertiesToSubclass.ts +0 -76
- package/src/classes/Properties/to/PropertiesToVar.ts +0 -194
- package/src/classes/Properties/to/PropertiesToVariable.ts +0 -176
- package/src/classes/Styles/Styles.ts +0 -247
- package/src/classes/Styles/StylesClasses.ts +0 -86
- package/src/classes/Styles/StylesProperties.ts +0 -197
- package/src/classes/Styles/StylesRoot.ts +0 -103
- package/src/classes/Styles/StylesTool.ts +0 -112
- package/src/classes/Styles/to/StylesToAbstract.ts +0 -93
- package/src/classes/Styles/to/StylesToAnimate.ts +0 -19
- package/src/classes/Styles/to/StylesToClass.ts +0 -25
- package/src/classes/Styles/to/StylesToClassFull.ts +0 -19
- package/src/classes/Styles/to/StylesToContainer.ts +0 -24
- package/src/classes/Styles/to/StylesToMedia.ts +0 -19
- package/src/classes/Styles/to/StylesToProperty.ts +0 -123
- package/src/classes/Styles/to/StylesToRoot.ts +0 -14
- package/src/classes/Styles/to/StylesToSelector.ts +0 -71
- package/src/classes/Styles/to/StylesToVar.ts +0 -105
- package/src/classes/Styles/to/StylesToVirtual.ts +0 -33
- package/src/composables/useAi.ts +0 -38
- package/src/demo/ai.ts +0 -10
- package/src/functions/getComponentPaths.ts +0 -13
- package/src/functions/getConfigAi.ts +0 -14
- package/src/functions/getConstructorProperties.ts +0 -54
- package/src/functions/getDirname.ts +0 -17
- package/src/functions/getNameDirByPaths.ts +0 -16
- package/src/functions/getPackageJson.ts +0 -19
- package/src/functions/hasNativeDirname.ts +0 -8
- package/src/functions/run.ts +0 -47
- package/src/functions/toPathStandardSep.ts +0 -14
- package/src/library-ai.ts +0 -10
- package/src/library.ts +0 -73
- package/src/media/ai/ai-doc-types.ts +0 -21
- package/src/media/properties/css.ts +0 -634
- package/src/media/properties/cssSelector.ts +0 -74
- package/src/media/properties/cssVirtual.ts +0 -12
- package/src/media/properties/listSort.ts +0 -113
- package/src/media/properties/style.ts +0 -81
- package/src/media/templates/component/DesignComponent.mdx +0 -30
- package/src/media/templates/component/DesignComponent.stories.ts +0 -34
- package/src/media/templates/component/DesignComponent.vue +0 -54
- package/src/media/templates/component/DesignComponentAiWiki.vue +0 -25
- package/src/media/templates/component/index.ts +0 -13
- package/src/media/templates/component/props.ts +0 -27
- package/src/media/templates/component/styleToken.scss +0 -17
- package/src/media/templates/component/wiki.ts +0 -13
- package/src/media/templates/component/wikiData.ts +0 -28
- package/src/media/templates/componentDoc/ComponentDoc.vue +0 -26
- package/src/media/templates/componentDoc/index.ts +0 -12
- package/src/media/templates/componentDoc/materials/README.md +0 -8
- package/src/media/templates/componentDoc/materials/prompt.md +0 -38
- package/src/media/templates/componentDoc/subcomponents/_.gitignore.txt +0 -0
- package/src/media/templates/componentDoc/types.ts +0 -15
- package/src/media/templates/componentDoc/wiki/ComponentDoc.mdx +0 -13
- package/src/media/templates/componentDoc/wiki/ComponentDoc.stories.ts +0 -24
- package/src/media/templates/componentDoc/wiki/prompt.md +0 -41
- package/src/media/templates/constructors/Constructors.ts +0 -33
- package/src/media/templates/constructors/ConstructorsDesign.tsx +0 -129
- package/src/media/templates/constructors/basicTypes.ts +0 -0
- package/src/media/templates/constructors/index.ts +0 -5
- package/src/media/templates/constructors/props.ts +0 -28
- package/src/media/templates/constructors/style.scss +0 -5
- package/src/media/templates/constructors/types.ts +0 -47
- package/src/media/templates/packages/figma/README.md +0 -1
- package/src/media/templates/packages/figma/_.gitignore.txt +0 -29
- package/src/media/templates/packages/figma/ai.sample.config.ts +0 -2
- package/src/media/templates/packages/figma/design.config.json +0 -3
- package/src/media/templates/packages/figma/index.html +0 -12
- package/src/media/templates/packages/figma/manifest.json +0 -25
- package/src/media/templates/packages/figma/package.json +0 -37
- package/src/media/templates/packages/figma/src/App.vue +0 -9
- package/src/media/templates/packages/figma/src/classes/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/code.ts +0 -16
- package/src/media/templates/packages/figma/src/components/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/composables/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/config.ts +0 -0
- package/src/media/templates/packages/figma/src/functions/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/library.ts +0 -0
- package/src/media/templates/packages/figma/src/main.ts +0 -4
- package/src/media/templates/packages/figma/src/media/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/storybook/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/types/_.gitignore.txt +0 -1
- package/src/media/templates/packages/figma/src/vite-env.d.ts +0 -1
- package/src/media/templates/packages/figma/tsconfig.app.json +0 -12
- package/src/media/templates/packages/figma/tsconfig.json +0 -7
- package/src/media/templates/packages/figma/tsconfig.node.json +0 -8
- package/src/media/templates/packages/figma/vite.config.ts +0 -7
- package/src/media/templates/packages/library/README.md +0 -1
- package/src/media/templates/packages/library/_.gitignore.txt +0 -27
- package/src/media/templates/packages/library/ai-description.md +0 -15
- package/src/media/templates/packages/library/design.config.json +0 -3
- package/src/media/templates/packages/library/index.html +0 -12
- package/src/media/templates/packages/library/materials/README.md +0 -8
- package/src/media/templates/packages/library/materials/prompt.md +0 -45
- package/src/media/templates/packages/library/package.json +0 -46
- package/src/media/templates/packages/library/src/App.vue +0 -8
- package/src/media/templates/packages/library/src/classes/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/components/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/composables/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/functions/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/library.ts +0 -0
- package/src/media/templates/packages/library/src/main.ts +0 -6
- package/src/media/templates/packages/library/src/style.scss +0 -0
- package/src/media/templates/packages/library/src/types/_.gitignore.txt +0 -1
- package/src/media/templates/packages/library/src/vite-env.d.ts +0 -1
- package/src/media/templates/packages/library/tsconfig.app.json +0 -11
- package/src/media/templates/packages/library/tsconfig.json +0 -7
- package/src/media/templates/packages/library/tsconfig.node.json +0 -7
- package/src/media/templates/packages/library/vite.config.ts +0 -14
- package/src/media/templates/packages/nitro/README.md +0 -1
- package/src/media/templates/packages/nitro/_.gitignore.txt +0 -28
- package/src/media/templates/packages/nitro/index.html +0 -2
- package/src/media/templates/packages/nitro/package.json +0 -25
- package/src/media/templates/packages/nitro/server/plugins/ui-plugin.ts +0 -7
- package/src/media/templates/packages/nitro/server/routes/api/hello.ts +0 -13
- package/src/media/templates/packages/nitro/src/App.vue +0 -10
- package/src/media/templates/packages/nitro/src/assets/_.gitignore.txt +0 -0
- package/src/media/templates/packages/nitro/src/components/_.gitignore.txt +0 -0
- package/src/media/templates/packages/nitro/src/composables/_.gitignore.txt +0 -0
- package/src/media/templates/packages/nitro/src/entry-client.ts +0 -13
- package/src/media/templates/packages/nitro/src/entry-server.ts +0 -29
- package/src/media/templates/packages/nitro/src/main.ts +0 -14
- package/src/media/templates/packages/nitro/src/pages/HomePage.vue +0 -8
- package/src/media/templates/packages/nitro/src/router.ts +0 -11
- package/src/media/templates/packages/nitro/src/style.scss +0 -0
- package/src/media/templates/packages/nitro/src/templates/main.html +0 -21
- package/src/media/templates/packages/nitro/src/vite-env.d.ts +0 -11
- package/src/media/templates/packages/nitro/tsconfig.app.json +0 -14
- package/src/media/templates/packages/nitro/tsconfig.json +0 -7
- package/src/media/templates/packages/nitro/tsconfig.node.json +0 -12
- package/src/media/templates/packages/nitro/vite.config.ts +0 -17
- package/src/media/templates/packages/project/README.md +0 -1
- package/src/media/templates/packages/project/_.gitignore.txt +0 -28
- package/src/media/templates/packages/project/design.config.json +0 -3
- package/src/media/templates/packages/project/index.html +0 -12
- package/src/media/templates/packages/project/materials/README.md +0 -8
- package/src/media/templates/packages/project/materials/prompt.md +0 -41
- package/src/media/templates/packages/project/package.json +0 -13
- package/src/media/templates/packages/project/public/_.gitignore.txt +0 -0
- package/src/media/templates/packages/project/src/App.vue +0 -12
- package/src/media/templates/packages/project/src/assets/_.gitignore.txt +0 -0
- package/src/media/templates/packages/project/src/components/_.gitignore.txt +0 -0
- package/src/media/templates/packages/project/src/composables/_.gitignore.txt +0 -0
- package/src/media/templates/packages/project/src/main.ts +0 -6
- package/src/media/templates/packages/project/src/style.scss +0 -0
- package/src/media/templates/packages/project/src/vite-env.d.ts +0 -1
- package/src/media/templates/packages/project/tsconfig.app.json +0 -11
- package/src/media/templates/packages/project/tsconfig.json +0 -7
- package/src/media/templates/packages/project/tsconfig.node.json +0 -7
- package/src/media/templates/packages/project/vite.config.ts +0 -7
- package/src/media/templates/prompts/aiCodeGlobalPrompt.en.md +0 -22
- package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.md +0 -21
- package/src/media/templates/prompts/aiCodeVuePrompt.en.md +0 -17
- package/src/media/templates/prompts/aiCodeVuePrompt.ru.md +0 -17
- package/src/media/templates/prompts/aiDocClassPrompt.en.txt +0 -63
- package/src/media/templates/prompts/aiDocClassPrompt.ru.txt +0 -63
- package/src/media/templates/prompts/aiDocComposablePrompt.en.txt +0 -67
- package/src/media/templates/prompts/aiDocComposablePrompt.ru.txt +0 -67
- package/src/media/templates/prompts/aiDocFunctionPrompt.en.txt +0 -57
- package/src/media/templates/prompts/aiDocFunctionPrompt.ru.txt +0 -57
- package/src/media/templates/prompts/componentPrompt.en.txt +0 -182
- package/src/media/templates/prompts/componentPrompt.ru.txt +0 -182
- package/src/media/templates/prompts/demoClassEn.mdx +0 -111
- package/src/media/templates/prompts/demoClassRu.mdx +0 -111
- package/src/media/templates/prompts/demoComponentEn.mdx +0 -282
- package/src/media/templates/prompts/demoComponentRu.mdx +0 -282
- package/src/media/templates/prompts/demoComposableEn.mdx +0 -103
- package/src/media/templates/prompts/demoComposableRu.mdx +0 -103
- package/src/media/templates/prompts/demoDocEn.mdx +0 -30
- package/src/media/templates/prompts/demoDocRu.mdx +0 -30
- package/src/media/templates/viteComponentTemplateConfig.ts +0 -14
- package/src/types/aiTypes.ts +0 -19
- package/src/types/configTypes.ts +0 -69
- package/src/types/designTypes.ts +0 -167
- package/src/types/figmaApiTypes.ts +0 -337
- package/src/types/gitTypes.ts +0 -59
- package/src/types/libraryTypes.ts +0 -49
- package/src/types/propertyTypes.ts +0 -586
- package/src/types/screenshotTypes.ts +0 -55
- package/src/types/webTypes.ts +0 -134
- package/src/vite-env.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,73 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.0.0] - 2026-08-30
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`DesignTypes` Pipeline & Concurrency**:
|
|
9
|
+
- Added `aiTypesConcurrency` configuration option in `DesignUiConfig` (defaulting to `3`) to control parallel execution during AI type generation.
|
|
10
|
+
- Added `DesignTypesMakeFile.getListCache()` to read cached `.d.ts` definitions directly from `UI_DIR_AI_TYPES_LIST` without triggering compilation.
|
|
11
|
+
- Added `DesignTypesMcp.is()` check to prevent regenerating MCP server resource files when they already exist during `dxt-types-save`.
|
|
12
|
+
- Updated `ai-memory.md` prompt guidelines in templates and storybooks to prohibit modifying existing rules, restricting memory updates to duplicate removal and direct conflict resolution.
|
|
13
|
+
- Enhanced package root and path resolution in `DesignTypesBuild`.
|
|
14
|
+
- Modularized `DesignTypes` pipeline into abstract base classes (`DesignTypesPromptsAbstract`) and dedicated template modules (`DesignTypesPromptTemplates`).
|
|
15
|
+
- Added `.local` configuration file discovery and merging in `PropertiesConfig`, giving priority to local settings.
|
|
16
|
+
- Refactored configuration loading into static `PropertiesConfig.loadConfig()`.
|
|
17
|
+
- Added repository root scanning as an auxiliary library in `LibraryAiPrompt`.
|
|
18
|
+
- Updated `LibraryAiPromptItem.getPathString()` to handle optional subpaths cleanly.
|
|
19
|
+
- **CLI & Scaffolding**:
|
|
20
|
+
- Added centralized CLI argument parsing across executable scripts in `bin/`.
|
|
21
|
+
- Added dedicated `vite.config.ts` for scripts library building.
|
|
22
|
+
- **Template System Modernization**:
|
|
23
|
+
- Migrated template file loading to static raw Vite imports (`?raw`).
|
|
24
|
+
- Standardized in-memory template loading and AI prompt structures.
|
|
25
|
+
- **Tests & Documentation**:
|
|
26
|
+
- Added comprehensive unit test suites for `Styles`, composables, utility functions, and classes.
|
|
27
|
+
- Completed bilingual JSDoc annotations across all exports.
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **CLI Execution**: Migrated executable scripts in `packages/scripts/bin` from TypeScript (`.ts`) execution to compiled JavaScript.
|
|
31
|
+
- **Dependencies & Exports**: Updated package metadata, broadened peer dependencies, and updated export paths.
|
|
32
|
+
|
|
33
|
+
### Removed
|
|
34
|
+
- **Legacy Subsystems**:
|
|
35
|
+
- Removed obsolete `AiDoc` subsystem and legacy `ai-doc.md` generators.
|
|
36
|
+
- Removed deprecated `ComponentWiki` AI generator and related wiki templates.
|
|
37
|
+
- Removed obsolete `BuildFunctional` / `dxt-build-functional` binary script.
|
|
38
|
+
- Removed legacy `getDirname` and `hasNativeDirname` helper functions.
|
|
39
|
+
|
|
40
|
+
## [0.12.0] - 2026-08-21
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- **`LibraryAiMcp` Generator**:
|
|
44
|
+
- Added new `LibraryAiMcp` class (`src/classes/Library/LibraryAiMcp.ts`) that transforms aggregated MCP JSON resources (`ai-mcp-all-resources.json`) and system prompt (`ai-prompt.md`) into a fully typed TypeScript resource module (`ai-mcp-all-resources.ts`).
|
|
45
|
+
- Automatically generates dynamic import `handler` callbacks (`async () => (await import(...))?.default`) with `?raw` support for markdown, text, HTML, and CSS assets, enabling lazy, on-demand resource loading for `@dxtmisha/mcp`.
|
|
46
|
+
- Groups resources into package-level constants (`mcpConstructorResources`, `mcpD1Resources`, etc.), a grouped record map (`mcpPackageResources`), and an aggregated export (`mcpAllResources`, `export default mcpAllResources`).
|
|
47
|
+
- Added comprehensive unit test suite in `src/classes/Library/__tests__/LibraryAiMcp.test.ts`.
|
|
48
|
+
- **Constants & Exports**:
|
|
49
|
+
- Added `UI_FILE_AI_MCP_ALL_TS` (`'ai-mcp-all-resources.ts'`) in `src/config.ts`.
|
|
50
|
+
- Exported `LibraryAiMcp` from `src/library.ts`.
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
- **AI Prompt Generation (`LibraryAiPrompt`)**:
|
|
54
|
+
- Integrated `LibraryAiMcp.make()` invocation directly into `LibraryAiPrompt.make()` when the MCP flag is active, automatically synchronizing `ai-mcp-all-resources.ts` during prompt builds (`dxt-prompt`).
|
|
55
|
+
|
|
56
|
+
## [0.11.9] - 2026-08-21
|
|
57
|
+
|
|
58
|
+
### Fixed
|
|
59
|
+
- **AI Description Generation (`DesignTypesDescription`)**:
|
|
60
|
+
- Added emptiness check using `isFilled` for `content` and `code` in `toAiDescription()`, returning an empty string immediately if both inputs are empty to avoid redundant AI requests.
|
|
61
|
+
|
|
62
|
+
## [0.11.8] - 2026-08-20
|
|
63
|
+
|
|
64
|
+
### Changed
|
|
65
|
+
- **Screenshot Generation (`DesignScreenshot`)**:
|
|
66
|
+
- Added directory cleanup (`PropertiesFile.removeDir(pathDir)`) before recreating the destination folder in `DesignScreenshot.make()` to ensure fresh captures and eliminate stale image artifacts.
|
|
67
|
+
- Updated `DesignScreenshot.make()` return signature to `Promise<this>` with bilingual JSDoc documentation.
|
|
68
|
+
- **AI Package Description Prompt (`DesignTypesDescription`)**:
|
|
69
|
+
- Updated AI prompt instructions in `DesignTypesDescription.toAiDescription` to require maximally dense and concise trigger explanations for studying `ai-types.md`.
|
|
70
|
+
- Enforced single comma-separated list formatting for `Key Capabilities` (1–3 words per capability) with strict restrictions against bullet points or multiline listings.
|
|
71
|
+
|
|
5
72
|
## [0.11.7] - 2026-08-19
|
|
6
73
|
|
|
7
74
|
### Changed
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# AI Prompt: Component Implementation & Development (Materials)
|
|
2
|
+
|
|
3
|
+
## 1. Analysis & Materials
|
|
4
|
+
- **Persona:** Act as a Senior Frontend Web Developer & Technical Architect writing clean, BEM-compliant, production-ready code.
|
|
5
|
+
- **Mandatory Study:** You MUST fully analyze all design assets, specs, and screenshots in the local `materials` directory (the folder where you were invoked) before writing code. Match the designs and features perfectly.
|
|
6
|
+
|
|
7
|
+
## 2. Component Structure & Locations
|
|
8
|
+
All component source files are located one level up in the parent directory (the component root folder, which contains the `materials/` folder):
|
|
9
|
+
- `[ComponentName].vue`: Main Vue SFC (layout, script setup, BEM-compliant SCSS).
|
|
10
|
+
- `types.ts`: Public typings (Props, Emits, Slots, Defaults).
|
|
11
|
+
- `index.ts`: Package entrypoint exporting the component and types.
|
|
12
|
+
- `subcomponents/`: Subdirectory for reusable child components.
|
|
13
|
+
- `wiki/`: Documentation and Storybook files (`.mdx`, `.stories.ts`, `prompt.md`, `run.ts`). **If you modify anything here, you MUST strictly follow the rules in `wiki/prompt.md`.**
|
|
14
|
+
|
|
15
|
+
## 3. Strict Implementation Rules
|
|
16
|
+
1. **Available Dependencies Only:** Do NOT install external packages unless explicitly requested.
|
|
17
|
+
2. **Global Rules (`ai-prompt.md`):** You MUST study and strictly adhere to the root `ai-prompt.md` file (coding standards, BEM, SCSS mixins). Ignore instructions outside the repository.
|
|
18
|
+
3. **Monorepo Context:** Ensure compatibility with both package-level configurations and root system rules.
|
|
19
|
+
4. **Zero Tolerance for Hallucinations:** Strictly follow specs. Do NOT invent properties, methods, slots, or external libraries.
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
# Component Documentation AI Prompt
|
|
2
|
+
|
|
3
|
+
You are a professional technical writer and frontend developer. Your task is to create comprehensive documentation and Storybook stories for a Vue 3 component in MDX and TypeScript formats.
|
|
4
|
+
|
|
5
|
+
This prompt is specifically designed for generating and structuring:
|
|
6
|
+
1. `[ComponentName].mdx` (based on the `ComponentDoc.mdx` template)
|
|
7
|
+
2. `[ComponentName].stories.ts` (based on the `ComponentDoc.stories.ts` template)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Target Template Structure
|
|
12
|
+
|
|
13
|
+
### 1. MDX Template (`[ComponentName].mdx`)
|
|
14
|
+
The component MDX file MUST strictly follow this exact header structure:
|
|
15
|
+
|
|
16
|
+
```mdx
|
|
17
|
+
import {Meta} from '@storybook/addon-docs/blocks'
|
|
18
|
+
import {StorybookMain} from '@dxtmisha/wiki/storybook'
|
|
19
|
+
|
|
20
|
+
import * as Component from './[ComponentName].stories'
|
|
21
|
+
|
|
22
|
+
<Meta of={Component}/>
|
|
23
|
+
<StorybookMain
|
|
24
|
+
name={'[ComponentName]'}
|
|
25
|
+
description={'[short description in 3-5 words]'}
|
|
26
|
+
story={Component.Component}
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
[Documentation Body]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 2. Stories Template (`[ComponentName].stories.ts`)
|
|
33
|
+
The component stories file MUST strictly follow this exact base structure:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
37
|
+
|
|
38
|
+
import [ComponentName] from './../[ComponentName].vue'
|
|
39
|
+
|
|
40
|
+
const meta = {
|
|
41
|
+
title: '[project]/[ComponentName] - [short description in 2-4 words in target language]',
|
|
42
|
+
component: [ComponentName]
|
|
43
|
+
} satisfies Meta<typeof [ComponentName]>
|
|
44
|
+
|
|
45
|
+
export default meta
|
|
46
|
+
|
|
47
|
+
type Story = StoryObj<typeof meta>
|
|
48
|
+
|
|
49
|
+
export const Component: Story = {
|
|
50
|
+
render: args => ({
|
|
51
|
+
components: { [ComponentName] },
|
|
52
|
+
setup() {
|
|
53
|
+
return { args }
|
|
54
|
+
},
|
|
55
|
+
template: `<div>
|
|
56
|
+
<[ComponentName] v-bind="args" />
|
|
57
|
+
</div>`
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Documentation Body Structure (`[Documentation Body]`)
|
|
65
|
+
|
|
66
|
+
Follow this exact logical sequence in the body of `[ComponentName].mdx`:
|
|
67
|
+
|
|
68
|
+
### 1. Description
|
|
69
|
+
- Start directly with explanatory text (NO markdown heading `## Description` or `## Описание`).
|
|
70
|
+
- Provide a clear, cohesive paragraph explaining the purpose of the component, its core functionality, and key advantages.
|
|
71
|
+
|
|
72
|
+
### 2. Key Features
|
|
73
|
+
- Title: `**Key Features:**` on a separate line as bold text (NOT a markdown heading `##`).
|
|
74
|
+
- Format: Bulleted list with concise, capitalized sentences describing key capabilities.
|
|
75
|
+
```md
|
|
76
|
+
**Key Features:**
|
|
77
|
+
|
|
78
|
+
- Integration with Window, Bars, and List primitives
|
|
79
|
+
- Keyboard navigation through menu items
|
|
80
|
+
- Dynamic data loading and state synchronization
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 3. Typical Use Cases
|
|
84
|
+
- Title: `**Typical Use Cases:**` on a separate line as bold text (NOT a markdown heading `##`).
|
|
85
|
+
- Format: Bulleted list of practical scenarios and use cases.
|
|
86
|
+
```md
|
|
87
|
+
**Typical Use Cases:**
|
|
88
|
+
|
|
89
|
+
- Dropdown navigation menus
|
|
90
|
+
- Context menus triggered on right-click
|
|
91
|
+
- Action menus for data tables
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 4. Basic Usage
|
|
95
|
+
- Provide a clear, minimal Vue 3 Composition API `<script setup>` code example.
|
|
96
|
+
- All code examples in MDX MUST be wrapped in the `<Source />` component from `@storybook/addon-docs/blocks`:
|
|
97
|
+
```md
|
|
98
|
+
<Source
|
|
99
|
+
code={`
|
|
100
|
+
<script setup>
|
|
101
|
+
import { ref } from 'vue'
|
|
102
|
+
|
|
103
|
+
const value = ref('')
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<template>
|
|
107
|
+
<Component v-model="value" />
|
|
108
|
+
</template>
|
|
109
|
+
`}
|
|
110
|
+
language="html"
|
|
111
|
+
/>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 5. Logical Property Groups (Props)
|
|
115
|
+
- Do NOT create one giant flat list of all properties. Group related props by feature/topic (e.g., "Navigation", "Asynchronous Loading", "State Management", "Visual Styling").
|
|
116
|
+
- For each group:
|
|
117
|
+
- Heading: `## [Feature / Topic Name]`
|
|
118
|
+
- Text description explaining the interaction of these properties and the problem they solve.
|
|
119
|
+
- Property list: `- propName — description`
|
|
120
|
+
- Code example wrapped in `<Source code={\`...\`} language="html" />` demonstrating these properties working together.
|
|
121
|
+
|
|
122
|
+
### 6. Data Types (Optional)
|
|
123
|
+
- Heading: `## Data Types`
|
|
124
|
+
- Detail custom interfaces or data contracts if they are essential to understanding the component's data model.
|
|
125
|
+
|
|
126
|
+
### 7. Events
|
|
127
|
+
- Heading: `## Events`
|
|
128
|
+
- For each event:
|
|
129
|
+
- Subheading: `### \`eventName\`` (name wrapped in backticks).
|
|
130
|
+
- Paragraph describing when the event triggers.
|
|
131
|
+
- **Parameters:**
|
|
132
|
+
- Title: `**Parameters:**`
|
|
133
|
+
- List: `- \`paramName: ParamType\` — parameter description.`
|
|
134
|
+
- **Structure of Custom Types (if applicable):**
|
|
135
|
+
- Title: `**[TypeName] Structure:**`
|
|
136
|
+
- List: `- \`fieldName: FieldType\` — field description.`
|
|
137
|
+
- Code example wrapped in `<Source />` if the event handling logic is non-trivial.
|
|
138
|
+
|
|
139
|
+
### 8. Expose (Methods & Reactive Properties)
|
|
140
|
+
- Heading: `## Expose`
|
|
141
|
+
- Present public methods and reactive references exposed by `defineExpose`:
|
|
142
|
+
- Methods: `- \`methodName(param: Type): ReturnType\` — description.`
|
|
143
|
+
- Reactive variables (Refs/Computed): `- \`propertyName: PropertyType\` — description.`
|
|
144
|
+
|
|
145
|
+
### 9. Slots
|
|
146
|
+
- Heading: `## Slots`
|
|
147
|
+
- Present slots in clean signature format:
|
|
148
|
+
- Scoped slots: `- \`slotName(props: PropType): VNode\` — description.`
|
|
149
|
+
- Regular slots: `- \`slotName: VNode\` — description.`
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Storybook Layout Helpers (`.wiki-storybook-*`)
|
|
154
|
+
|
|
155
|
+
When writing Storybook stories (`*.stories.ts`) and MDX code examples, you MUST use the predefined layout helper classes from `@dxtmisha/wiki/styles/storybookStyle.scss`. Do not invent custom CSS classes or raw inline styles:
|
|
156
|
+
|
|
157
|
+
### 1. Containers & Layouts
|
|
158
|
+
- `.wiki-storybook-container` — enables container queries (`container-type: inline-size`).
|
|
159
|
+
- `.wiki-storybook-group` — 12-column CSS Grid layout (`grid-template-columns: repeat(12, 1fr)`) with standard `8px` gap.
|
|
160
|
+
- Modifiers: `&--gapX2` (`16px`), `&--gapX3` (`24px`), `&--gapX4` (`32px`).
|
|
161
|
+
- `.wiki-storybook-flex` — flexbox wrapper (`display: flex; flex-wrap: wrap; gap: 8px;`).
|
|
162
|
+
- `.wiki-storybook-flex-align-center` — horizontal flex wrapper with centered vertical alignment (`align-items: center; gap: 8px;`).
|
|
163
|
+
- `.wiki-storybook-flex-center` — perfectly centered flex layout (`align-items: center; justify-content: center; gap: 8px;`).
|
|
164
|
+
- `.wiki-storybook-flex-column` — vertical column layout (`display: flex; flex-direction: column; gap: 16px;`).
|
|
165
|
+
- `.wiki-storybook-decreased` — constrains showcase block width to `72%`.
|
|
166
|
+
- `.wiki-storybook-decreasedX2` — responsive width reduction (`64%` at `md`, `48%` at `lg`).
|
|
167
|
+
|
|
168
|
+
### 2. Showcase Items (`.wiki-storybook-item`)
|
|
169
|
+
Used to display components inside a unified visual frame (aspect-ratio `1/1` by default, border, rounded corners, hidden overflow):
|
|
170
|
+
- `.wiki-storybook-item__label` — small floaty label at top-left corner (`font-size: 12px`, translucent background) for labeling variations.
|
|
171
|
+
- `&--static` — static flow inside the block without absolute positioning.
|
|
172
|
+
- `&--padding` — adds standard `16px` padding.
|
|
173
|
+
- `&--paddingX2` — adds double standard `32px` padding.
|
|
174
|
+
- `&--rectangle` — `16:9` aspect ratio, spans 12 grid columns.
|
|
175
|
+
- `&--widescreen` — `32:9` aspect ratio, spans 12 grid columns.
|
|
176
|
+
- `&--compact` — `64:9` aspect ratio, spans 12 grid columns.
|
|
177
|
+
- `&--auto` — `auto` aspect ratio, spans 12 grid columns.
|
|
178
|
+
- `&--squared--xs`, `&--squared--sm`, `&--squared--md`, `&--squared--lg`, `&--squared--max` — responsive grid item spans across mobile, tablet, and desktop.
|
|
179
|
+
- `&--center` — centers internal elements with flexbox.
|
|
180
|
+
- `&--widthAuto` — sets width to `auto`.
|
|
181
|
+
- `&--overflowVisible` — sets `overflow: visible` (essential for dropdowns, popups, and menus).
|
|
182
|
+
- `&--overflowAuto` — sets `overflow: auto`.
|
|
183
|
+
- `&--borderNone` — removes default border.
|
|
184
|
+
- `&--rtl` — applies Right-to-Left (RTL) direction.
|
|
185
|
+
|
|
186
|
+
### 3. Mock Components & Placeholders
|
|
187
|
+
- `.wiki-storybook-card` — mock card (`320px` width, border, rounded `12px`):
|
|
188
|
+
- `.wiki-storybook-card__image` — cover image placeholder (`128px` height).
|
|
189
|
+
- `.wiki-storybook-card__content` — vertical column with `16px` padding and `16px` gap.
|
|
190
|
+
- `.wiki-storybook-card__label` — title (`20px` font size).
|
|
191
|
+
- `.wiki-storybook-card__information` — muted text (`14px` font size).
|
|
192
|
+
- `.wiki-storybook-card__actions` — actions row (`8px` gap).
|
|
193
|
+
- `.wiki-storybook-button` — standard story trigger button.
|
|
194
|
+
- Modifiers: `&--success` (green), `&--error` (red), `&--warning` (yellow), `&--info` (blue).
|
|
195
|
+
- `.wiki-storybook-input` — standard story text input field (`width: 100%; max-width: 320px`, padding `8px`, rounded `8px`, focus outline).
|
|
196
|
+
- `.wiki-storybook-dummy` — placeholder box (`32px` height, translucent grey).
|
|
197
|
+
- Colors: `&--color--blue`, `&--color--red`, `&--color--green`.
|
|
198
|
+
- Sizes: `&--size--sm` (`64px`), `&--size--md` (`128px`), `&--size--lg` (`256px`).
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## General Generation Rules
|
|
203
|
+
|
|
204
|
+
1. **Exact File Structure**:
|
|
205
|
+
- `[ComponentName].mdx` must begin with the `<Meta of={Component}/>` and `<StorybookMain ... />` blocks matching `ComponentDoc.mdx`.
|
|
206
|
+
- `[ComponentName].stories.ts` must export `meta` and story objects matching `ComponentDoc.stories.ts`.
|
|
207
|
+
2. **Storybook Meta Title**:
|
|
208
|
+
- `[ComponentName].stories.ts` must define `meta.title` with an appended short description of 2-4 words in the target language: `title: '[project]/[ComponentName] - [short description in 2-4 words]'`.
|
|
209
|
+
3. **Clean Typography**:
|
|
210
|
+
- Do NOT use markdown tables or horizontal rules (`---` or `***`).
|
|
211
|
+
- Structure all information using headings (`##`, `###`), bold section titles (`**Title:**`), bulleted lists, and `<Source />` code blocks.
|
|
212
|
+
4. **Purity and Precision**:
|
|
213
|
+
- Zero hallucinations: describe ONLY properties, methods, slots, and events that actually exist in the component code and types.
|
|
214
|
+
- All text and headings must be in the requested target language.
|
|
215
|
+
5. **Copy-Paste Ready**:
|
|
216
|
+
- Output complete, production-ready code with valid imports.
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Full Example
|
|
221
|
+
|
|
222
|
+
### `Menu.stories.ts` Example
|
|
223
|
+
```ts
|
|
224
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
225
|
+
|
|
226
|
+
import Menu from './../Menu.vue'
|
|
227
|
+
|
|
228
|
+
const meta = {
|
|
229
|
+
title: 'Ui/Menu - Dropdown navigation and context menus',
|
|
230
|
+
component: Menu
|
|
231
|
+
} satisfies Meta<typeof Menu>
|
|
232
|
+
|
|
233
|
+
export default meta
|
|
234
|
+
|
|
235
|
+
type Story = StoryObj<typeof meta>
|
|
236
|
+
|
|
237
|
+
export const Component: Story = {
|
|
238
|
+
render: args => ({
|
|
239
|
+
components: { Menu },
|
|
240
|
+
setup() {
|
|
241
|
+
return { args }
|
|
242
|
+
},
|
|
243
|
+
template: `<div>
|
|
244
|
+
<Menu v-bind="args">
|
|
245
|
+
<template #control="{ onclick }">
|
|
246
|
+
<button class="wiki-storybook-button" @click="onclick">Open Menu</button>
|
|
247
|
+
</template>
|
|
248
|
+
</Menu>
|
|
249
|
+
</div>`
|
|
250
|
+
})
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### `Menu.mdx` Example
|
|
255
|
+
```mdx
|
|
256
|
+
import {Meta} from '@storybook/addon-docs/blocks'
|
|
257
|
+
import {StorybookMain} from '@dxtmisha/wiki/storybook'
|
|
258
|
+
|
|
259
|
+
import * as Component from './Menu.stories'
|
|
260
|
+
|
|
261
|
+
<Meta of={Component}/>
|
|
262
|
+
<StorybookMain
|
|
263
|
+
name={'Menu'}
|
|
264
|
+
description={'Dropdown navigation and context menus'}
|
|
265
|
+
story={Component.Component}
|
|
266
|
+
/>
|
|
267
|
+
|
|
268
|
+
Component for creating popup menus, dropdown lists, and context menus with support for keyboard navigation, nested structures, and actions.
|
|
269
|
+
|
|
270
|
+
Menu combines the functionality of Window (positioning and visibility management), Bars (action panel), and List (displaying items and submenus). The component provides full control over the open/close state, search filtering, and item selection.
|
|
271
|
+
|
|
272
|
+
**Key Features:**
|
|
273
|
+
|
|
274
|
+
- Integration of Window, Bars, and List primitives
|
|
275
|
+
- Full keyboard navigation through menu items
|
|
276
|
+
- Nested submenus with unlimited depth
|
|
277
|
+
- Lite mode for optimizing rendering of large lists
|
|
278
|
+
- Dynamic search and item filtering
|
|
279
|
+
- Flexible positioning relative to anchor triggers
|
|
280
|
+
|
|
281
|
+
**Typical Use Cases:**
|
|
282
|
+
|
|
283
|
+
- Dropdown navigation menus
|
|
284
|
+
- Right-click context menus
|
|
285
|
+
- Table row action menus
|
|
286
|
+
- Selectors with integrated search
|
|
287
|
+
|
|
288
|
+
<Source
|
|
289
|
+
code={`
|
|
290
|
+
<script setup>
|
|
291
|
+
import { ref } from 'vue'
|
|
292
|
+
|
|
293
|
+
const isOpen = ref(false)
|
|
294
|
+
const menuItems = ref([
|
|
295
|
+
{ label: 'Create', value: 'create' },
|
|
296
|
+
{ label: 'Edit', value: 'edit' },
|
|
297
|
+
{ label: 'Delete', value: 'delete' }
|
|
298
|
+
])
|
|
299
|
+
|
|
300
|
+
const handleClick = (value) => {
|
|
301
|
+
console.log('Selected:', value)
|
|
302
|
+
isOpen.value = false
|
|
303
|
+
}
|
|
304
|
+
</script>
|
|
305
|
+
|
|
306
|
+
<template>
|
|
307
|
+
<Menu
|
|
308
|
+
v-model:open="isOpen"
|
|
309
|
+
:list="menuItems"
|
|
310
|
+
@click="handleClick"
|
|
311
|
+
>
|
|
312
|
+
<template #control="{ onclick }">
|
|
313
|
+
<button class="wiki-storybook-button" @click="onclick">Actions</button>
|
|
314
|
+
</template>
|
|
315
|
+
</Menu>
|
|
316
|
+
</template>
|
|
317
|
+
`}
|
|
318
|
+
language="html"
|
|
319
|
+
/>
|
|
320
|
+
|
|
321
|
+
## Navigation through Menu Items
|
|
322
|
+
|
|
323
|
+
The `previous()` and `next()` methods allow programmatic navigation through menu items relative to the currently selected item and the `step` property.
|
|
324
|
+
|
|
325
|
+
- `previous()` — moves selection to the previous item
|
|
326
|
+
- `next()` — moves selection to the next item
|
|
327
|
+
- `step` — number of items to step across (default: 1)
|
|
328
|
+
|
|
329
|
+
<Source
|
|
330
|
+
code={`
|
|
331
|
+
<script setup>
|
|
332
|
+
import { ref } from 'vue'
|
|
333
|
+
|
|
334
|
+
const menuRef = ref()
|
|
335
|
+
const selected = ref('item1')
|
|
336
|
+
</script>
|
|
337
|
+
|
|
338
|
+
<template>
|
|
339
|
+
<button class="wiki-storybook-button" @click="menuRef?.previous()">Previous</button>
|
|
340
|
+
<button class="wiki-storybook-button" @click="menuRef?.next()">Next</button>
|
|
341
|
+
|
|
342
|
+
<Menu
|
|
343
|
+
ref="menuRef"
|
|
344
|
+
v-model:selected="selected"
|
|
345
|
+
:list="[
|
|
346
|
+
{ label: 'Item 1', value: 'item1' },
|
|
347
|
+
{ label: 'Item 2', value: 'item2' }
|
|
348
|
+
]"
|
|
349
|
+
/>
|
|
350
|
+
</template>
|
|
351
|
+
`}
|
|
352
|
+
language="html"
|
|
353
|
+
/>
|
|
354
|
+
|
|
355
|
+
## Events
|
|
356
|
+
|
|
357
|
+
### `click`
|
|
358
|
+
|
|
359
|
+
Event fires when clicking on a menu item, returning the event payload and selected item data.
|
|
360
|
+
|
|
361
|
+
**Parameters:**
|
|
362
|
+
- `event: MouseEvent` — original DOM mouse event
|
|
363
|
+
- `value: EventClickValue` — object with item value and metadata
|
|
364
|
+
|
|
365
|
+
**EventClickValue Structure:**
|
|
366
|
+
- `type: string` — click target type identifier
|
|
367
|
+
- `value: any` — selected item value
|
|
368
|
+
- `detail: Record<string, any> | undefined` — additional event details
|
|
369
|
+
|
|
370
|
+
## Expose
|
|
371
|
+
|
|
372
|
+
- `previous(): void` — Moves the selection to the previous menu item.
|
|
373
|
+
- `next(): void` — Moves the selection to the next menu item.
|
|
374
|
+
|
|
375
|
+
## Slots
|
|
376
|
+
|
|
377
|
+
- `control(props: MenuControlItem): VNode` — Slot for placing the menu trigger element.
|
|
378
|
+
- `title(props: MenuControlItem): VNode` — Slot for custom window title content.
|
|
379
|
+
- `footer(props: MenuControlItem): VNode` — Slot for bottom action buttons or extra information.
|
|
380
|
+
- `default: VNode` — Main slot for custom body items.
|
|
381
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# AI Prompt: Component Documentation & Development
|
|
2
|
+
|
|
3
|
+
## 1. Analysis & Resources
|
|
4
|
+
- **Component Files:** If not attached, find Vue SFC (`*.vue`), `types.ts`, and styles in the parent directory (the component root, one level up from the current `wiki/` folder). Analyze them fully to understand the interface.
|
|
5
|
+
- **Master Templates:** You **MUST** read and strictly follow the formatting, rules, and styling classes in `node_modules/@dxtmisha/scripts/ai-resources/componentPrompt.md`.
|
|
6
|
+
|
|
7
|
+
## 2. Output & Modifications
|
|
8
|
+
- **Documentation (`.mdx`, `stories.ts`)** must be saved in the local `wiki/` directory (the folder where you were invoked).
|
|
9
|
+
- **Component Source (`.vue`, `types.ts`)** must be saved in the parent directory (one level up).
|
|
10
|
+
- **Storybook (`*.stories.ts`):**
|
|
11
|
+
- Append a 2-4 word description to `meta.title` in the target language: `title: '[project]/[ComponentName] - [short description]'`.
|
|
12
|
+
- **STRICTLY FORBIDDEN:** Do not use `argTypes` in the configuration.
|
|
13
|
+
- **IMPORTANT OVERRIDE:** Ignore any rules in `componentPrompt.md` about returning output in 5 text parts separated by "#########" or prohibitions on modifying files. You MUST directly modify and save the actual files in the workspace.
|
package/bin/arguments.ts
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import process from 'node:process'
|
|
2
|
+
import { parseArgs } from 'node:util'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CLI option specification for command argument parsing.
|
|
6
|
+
*
|
|
7
|
+
* Спецификация опции CLI для разбора аргументов команды.
|
|
8
|
+
*/
|
|
9
|
+
export interface CliOptionItem {
|
|
10
|
+
/** Option value type / Тип значения опции */
|
|
11
|
+
type: 'string' | 'boolean'
|
|
12
|
+
|
|
13
|
+
/** Short single-letter alias / Короткий однобуквенный алиас */
|
|
14
|
+
short?: string
|
|
15
|
+
|
|
16
|
+
/** Default value used when the option is omitted / Значение по умолчанию при отсутствии опции */
|
|
17
|
+
default?: string | boolean
|
|
18
|
+
|
|
19
|
+
/** Short option description shown in the help message / Краткое описание опции в сообщении справки */
|
|
20
|
+
description: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Parsed CLI values record type / Тип записи разобранных значений CLI */
|
|
24
|
+
type CliValues = Record<string, string | boolean | undefined>
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Parsed CLI option specification accepted by the Node.js parseArgs utility.
|
|
28
|
+
*
|
|
29
|
+
* Спецификация разобранной опции CLI, принимаемая утилитой parseArgs из Node.js.
|
|
30
|
+
*/
|
|
31
|
+
interface CliParsedOption {
|
|
32
|
+
/** Option value type / Тип значения опции */
|
|
33
|
+
type: 'string' | 'boolean'
|
|
34
|
+
|
|
35
|
+
/** Short single-letter alias / Короткий однобуквенный алиас */
|
|
36
|
+
short?: string
|
|
37
|
+
|
|
38
|
+
/** Default value used when the option is omitted / Значение по умолчанию при отсутствии опции */
|
|
39
|
+
default?: string | boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Parsed CLI arguments result returned from command argument parsing.
|
|
44
|
+
*
|
|
45
|
+
* Результат разбора аргументов CLI, возвращаемый при разборе аргументов команды.
|
|
46
|
+
*/
|
|
47
|
+
export interface CliParsedResults {
|
|
48
|
+
/** Parsed option values keyed by option name / Разобранные значения опций по имени опции */
|
|
49
|
+
values: CliValues
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* CLI option entry pairing the option name with its specification.
|
|
54
|
+
*
|
|
55
|
+
* Запись опции CLI, сопоставляющая имя опции с ее спецификацией.
|
|
56
|
+
*/
|
|
57
|
+
interface CliOptionEntry {
|
|
58
|
+
/** Option name / Имя опции */
|
|
59
|
+
name: string
|
|
60
|
+
|
|
61
|
+
/** Option specification / Спецификация опции */
|
|
62
|
+
option: CliOptionItem
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Parses command line arguments with strict validation and handles the --help flag.
|
|
67
|
+
*
|
|
68
|
+
* Разбирает аргументы командной строки со строгой валидацией и обрабатывает флаг --help.
|
|
69
|
+
* @param description short command description shown in the help message / краткое описание команды в сообщении справки
|
|
70
|
+
* @param usage command usage line / строка использования команды
|
|
71
|
+
* @param options command options specification / спецификация опций команды
|
|
72
|
+
* @returns parsed option values and positional arguments / разобранные значения опций и позиционные аргументы
|
|
73
|
+
*/
|
|
74
|
+
export function parseCliArguments(
|
|
75
|
+
description: string,
|
|
76
|
+
usage: string,
|
|
77
|
+
options: Record<string, CliOptionItem> = {}
|
|
78
|
+
): CliParsedResults {
|
|
79
|
+
const optionsParsed: Record<string, CliParsedOption> = {}
|
|
80
|
+
|
|
81
|
+
for (const [name, option] of Object.entries(options)) {
|
|
82
|
+
const optionParsed: CliParsedOption = {
|
|
83
|
+
type: option.type
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (option.short !== undefined) {
|
|
87
|
+
optionParsed.short = option.short
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (option.default !== undefined) {
|
|
91
|
+
optionParsed.default = option.default
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
optionsParsed[name] = optionParsed
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
optionsParsed.help = {
|
|
98
|
+
type: 'boolean',
|
|
99
|
+
short: 'h',
|
|
100
|
+
default: false
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const { values } = parseArgs({
|
|
104
|
+
options: optionsParsed,
|
|
105
|
+
strict: true
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
if (values.help) {
|
|
109
|
+
console.log(toHelpMessage(description, usage, options))
|
|
110
|
+
process.exit(0)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
values: values as CliValues
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Formats the help message with description, usage, and options list.
|
|
120
|
+
*
|
|
121
|
+
* Форматирует сообщение справки с описанием, использованием и списком опций.
|
|
122
|
+
* @param description short command description / краткое описание команды
|
|
123
|
+
* @param usage command usage line / строка использования команды
|
|
124
|
+
* @param options command options specification / спецификация опций команды
|
|
125
|
+
* @returns formatted help message / отформатированное сообщение справки
|
|
126
|
+
*/
|
|
127
|
+
function toHelpMessage(
|
|
128
|
+
description: string,
|
|
129
|
+
usage: string,
|
|
130
|
+
options: Record<string, CliOptionItem>
|
|
131
|
+
): string {
|
|
132
|
+
const entries: CliOptionEntry[] = [
|
|
133
|
+
{
|
|
134
|
+
name: 'help',
|
|
135
|
+
option: {
|
|
136
|
+
type: 'boolean',
|
|
137
|
+
short: 'h',
|
|
138
|
+
description: 'Show this help message and exit'
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
...Object.entries(options)
|
|
142
|
+
.map(
|
|
143
|
+
([name, option]) => ({ name, option })
|
|
144
|
+
)
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
const labels = entries.map(({ name, option }) => {
|
|
148
|
+
const short = option.short ? `-${option.short}, ` : ' '
|
|
149
|
+
|
|
150
|
+
return `${short}--${name}`
|
|
151
|
+
})
|
|
152
|
+
const labelWidth = Math.max(...labels.map(label => label.length)) + 2
|
|
153
|
+
|
|
154
|
+
const list = entries.map(({ option }, index) => {
|
|
155
|
+
const defaultValue = option.default !== undefined ? ` (default: ${String(option.default)})` : ''
|
|
156
|
+
|
|
157
|
+
return `${labels[index].padEnd(labelWidth)}${option.description}${defaultValue}`
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
return [
|
|
161
|
+
description,
|
|
162
|
+
'',
|
|
163
|
+
usage,
|
|
164
|
+
'',
|
|
165
|
+
'Options:',
|
|
166
|
+
...list
|
|
167
|
+
].join('\n')
|
|
168
|
+
}
|
package/bin/build-packages.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env vite-node
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import process from 'node:process'
|
|
4
|
+
import { parseCliArguments } from './arguments'
|
|
5
|
+
import { BuildPackages } from '../dist/library.js'
|
|
6
|
+
|
|
7
|
+
parseCliArguments(
|
|
8
|
+
'Scans, sorts, and builds monorepo packages managing build order by priorities.',
|
|
9
|
+
'Usage: dxt-build-packages'
|
|
10
|
+
)
|
|
4
11
|
|
|
5
12
|
new BuildPackages()
|
|
6
13
|
.make()
|
|
7
|
-
.
|
|
14
|
+
.catch((error) => {
|
|
15
|
+
console.error('dxt-build-packages failed:', error)
|
|
16
|
+
process.exit(1)
|
|
17
|
+
})
|