@dxtmisha/scripts 0.11.8 → 1.1.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 +77 -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 +34 -3
- 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 +27 -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-BiLAcdFy.js +232 -0
- package/dist/PropertiesConfig-BKZz_FWW.js +262 -0
- package/{src/config.ts → dist/config.d.ts} +185 -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 +4910 -0
- package/dist/library.js +1568 -0
- package/dist/propertyTypes-C64u6rT3.js +236 -0
- package/package.json +76 -27
- 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 -140
- 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 -121
- 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
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process'
|
|
2
|
-
import { ServerStorage } from '@dxtmisha/functional-basic'
|
|
3
|
-
|
|
4
|
-
import { PropertiesFile } from '../Properties/PropertiesFile'
|
|
5
|
-
import { BrowserItem } from '../BrowserItem'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Class for automatic capturing of screenshots by running dev server.
|
|
9
|
-
*
|
|
10
|
-
* Класс для автоматического захвата скриншотов путем запуска сервера разработки.
|
|
11
|
-
*/
|
|
12
|
-
export class DesignScreenshot {
|
|
13
|
-
/** indicates if screenshot process is running / указывает, запущен ли процесс создания скриншота */
|
|
14
|
-
protected isReading: boolean = false
|
|
15
|
-
|
|
16
|
-
/** server url / URL сервера */
|
|
17
|
-
protected url?: string
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Constructor
|
|
21
|
-
* @param file output path / путь к файлу
|
|
22
|
-
*/
|
|
23
|
-
constructor(
|
|
24
|
-
protected readonly file: string = './ai-screenshot/screenshot'
|
|
25
|
-
) {
|
|
26
|
-
ServerStorage.setErrorStatus(true)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Starts the screenshot process.
|
|
31
|
-
*
|
|
32
|
-
* Запускает процесс создания скриншота.
|
|
33
|
-
* @returns this instance / этот экземпляр
|
|
34
|
-
*/
|
|
35
|
-
async make(): Promise<this> {
|
|
36
|
-
console.info('Screenshot')
|
|
37
|
-
|
|
38
|
-
const pathDir = PropertiesFile.getPathDir(`${this.file}.file`)
|
|
39
|
-
|
|
40
|
-
PropertiesFile.removeDir(pathDir)
|
|
41
|
-
PropertiesFile.createDir(pathDir)
|
|
42
|
-
|
|
43
|
-
this.makeServer()
|
|
44
|
-
|
|
45
|
-
return this
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* screenshot trigger listener.
|
|
50
|
-
*
|
|
51
|
-
* Слушатель триггера для создания скриншота.
|
|
52
|
-
* @returns capture success status / статус успешного захвата
|
|
53
|
-
*/
|
|
54
|
-
protected readonly listener = async (): Promise<boolean> => {
|
|
55
|
-
if (
|
|
56
|
-
this.url
|
|
57
|
-
&& !this.isReading
|
|
58
|
-
) {
|
|
59
|
-
this.isReading = true
|
|
60
|
-
|
|
61
|
-
console.info('URL', this.url)
|
|
62
|
-
|
|
63
|
-
const browser = new BrowserItem(this.url, { height: 1024 * 12 })
|
|
64
|
-
await browser.screenshot(this.file)
|
|
65
|
-
|
|
66
|
-
PropertiesFile.writeByPath(
|
|
67
|
-
`${this.file}-code.html`,
|
|
68
|
-
await browser.getBody()
|
|
69
|
-
)
|
|
70
|
-
PropertiesFile.writeByPath(
|
|
71
|
-
`${this.file}-styles.css`,
|
|
72
|
-
await browser.getStyles()
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
return true
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return false
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* spawns development server.
|
|
83
|
-
*
|
|
84
|
-
* Запускает сервер разработки.
|
|
85
|
-
* @returns this instance / этот экземпляр
|
|
86
|
-
*/
|
|
87
|
-
protected makeServer(): this {
|
|
88
|
-
const server = spawn(
|
|
89
|
-
'npm',
|
|
90
|
-
['run', 'dev'],
|
|
91
|
-
{
|
|
92
|
-
shell: true,
|
|
93
|
-
stdio: 'pipe'
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
server.stdout?.on('data', (data) => {
|
|
98
|
-
console.log('Server', 'start')
|
|
99
|
-
|
|
100
|
-
const dataString = data.toString()
|
|
101
|
-
this.makeUrl(dataString)
|
|
102
|
-
|
|
103
|
-
if (this.url) {
|
|
104
|
-
console.info('Server', 'init')
|
|
105
|
-
|
|
106
|
-
this.listener()
|
|
107
|
-
.then((success: boolean) => {
|
|
108
|
-
if (success) {
|
|
109
|
-
server.kill()
|
|
110
|
-
|
|
111
|
-
console.info('Server', 'kill')
|
|
112
|
-
}
|
|
113
|
-
})
|
|
114
|
-
}
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
server.stderr?.on('data', (data) => {
|
|
118
|
-
console.error(`Server Error: ${data.toString()}`)
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
return this
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* extracts server url from console output.
|
|
126
|
-
*
|
|
127
|
-
* Извлекает URL сервера из консольного вывода.
|
|
128
|
-
* @param data command output / вывод команды
|
|
129
|
-
* @returns this instance / этот экземпляр
|
|
130
|
-
*/
|
|
131
|
-
makeUrl(data: string): this {
|
|
132
|
-
const match = data.match(/(https?:\/\/localhost\S+)/)
|
|
133
|
-
|
|
134
|
-
if (match) {
|
|
135
|
-
this.url = match[1]
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return this
|
|
139
|
-
}
|
|
140
|
-
}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { toCamelCase, toCamelCaseFirst } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { PropertiesConfig } from '../Properties/PropertiesConfig'
|
|
6
|
-
import { PropertiesCache } from '../Properties/PropertiesCache'
|
|
7
|
-
import { DesignStructureRead } from './DesignStructureRead'
|
|
8
|
-
import { DesignStructureClasses } from './DesignStructureClasses'
|
|
9
|
-
import { DesignStructureStyles } from './DesignStructureStyles'
|
|
10
|
-
|
|
11
|
-
import type {
|
|
12
|
-
DesignStructureClassesList,
|
|
13
|
-
DesignStructureList
|
|
14
|
-
} from '../../types/designTypes'
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
UI_DIR_STRUCTURE,
|
|
18
|
-
UI_STRUCTURE_CLASSES
|
|
19
|
-
} from '../../config'
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Class for managing and resolving the data structure of a design system component.
|
|
23
|
-
* It serves as a central hub for reading component metadata, generating class mappings, and resolving style tokens.
|
|
24
|
-
*
|
|
25
|
-
* Класс для управления и разрешения структуры данных компонента дизайн-системы.
|
|
26
|
-
* Служит центральным узлом для чтения метаданных компонента, генерации маппингов классов и разрешения стилевых токенов.
|
|
27
|
-
*/
|
|
28
|
-
export class DesignStructure {
|
|
29
|
-
protected readonly component: string
|
|
30
|
-
|
|
31
|
-
protected items?: DesignStructureList
|
|
32
|
-
protected itemsClasses?: DesignStructureClassesList
|
|
33
|
-
protected itemsStyles?: string[]
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Constructor for DesignStructure.
|
|
37
|
-
*
|
|
38
|
-
* Конструктор для DesignStructure.
|
|
39
|
-
* @param component component name or identifier / название или идентификатор компонента
|
|
40
|
-
*/
|
|
41
|
-
constructor(
|
|
42
|
-
component?: string
|
|
43
|
-
) {
|
|
44
|
-
this.component = toCamelCase(component ?? 'component')
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Getting all data from the structure.
|
|
49
|
-
*
|
|
50
|
-
* Получение всех данных из структуры.
|
|
51
|
-
*/
|
|
52
|
-
get(): DesignStructureList {
|
|
53
|
-
if (this.items === undefined) {
|
|
54
|
-
this.items = this.make()
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return this.items
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Obtaining a list of subclasses from a structure.
|
|
62
|
-
*
|
|
63
|
-
* Получение списка подклассов из структуры.
|
|
64
|
-
*/
|
|
65
|
-
getClasses(): DesignStructureClassesList {
|
|
66
|
-
if (this.itemsClasses === undefined) {
|
|
67
|
-
this.itemsClasses = this.makeClasses()
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return this.itemsClasses
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Returns all styles from tokens.
|
|
75
|
-
*
|
|
76
|
-
* Возвращает все стили из токенов.
|
|
77
|
-
*/
|
|
78
|
-
getStyles(): string[] {
|
|
79
|
-
if (this.itemsStyles === undefined) {
|
|
80
|
-
this.itemsStyles = this.makeStyles()
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return this.itemsStyles
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Returns the name of the design.
|
|
88
|
-
*
|
|
89
|
-
* Возвращает название дизайна.
|
|
90
|
-
*/
|
|
91
|
-
getDesign(): string {
|
|
92
|
-
return PropertiesConfig.getDesignName()
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Returns the name of the design with a capital letter.
|
|
97
|
-
*
|
|
98
|
-
* Возвращает название дизайна с заглавной буквы.
|
|
99
|
-
*/
|
|
100
|
-
getDesignFirst(): string {
|
|
101
|
-
return toCamelCaseFirst(PropertiesConfig.getDesignName())
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Returns the name of the component.
|
|
106
|
-
*
|
|
107
|
-
* Возвращает название компонента.
|
|
108
|
-
*/
|
|
109
|
-
getComponentName(): string {
|
|
110
|
-
return this.component
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Returns the name of the component with a capital letter.
|
|
115
|
-
*
|
|
116
|
-
* Возвращает название компонента с заглавной буквой.
|
|
117
|
-
*/
|
|
118
|
-
getComponentNameFirst(): string {
|
|
119
|
-
return toCamelCaseFirst(this.component)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Returns the full name of the component, including design and component name.
|
|
124
|
-
*
|
|
125
|
-
* Возвращает полное название компонента, включая название дизайна и компонента.
|
|
126
|
-
*/
|
|
127
|
-
getFullComponentName(): string {
|
|
128
|
-
const design = this.getDesignFirst()
|
|
129
|
-
const component = this.getComponentNameFirst()
|
|
130
|
-
|
|
131
|
-
return `${design}${component}`
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Returns the names of component files.
|
|
136
|
-
*
|
|
137
|
-
* Возвращает названия файлов компонентов.
|
|
138
|
-
*/
|
|
139
|
-
getFileName(): string {
|
|
140
|
-
return toCamelCaseFirst(this.getPathName())
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Returns the name of the cache file.
|
|
145
|
-
* It contains all processed properties.
|
|
146
|
-
*
|
|
147
|
-
* Возвращает название файла для кэша.
|
|
148
|
-
* Это полный массив со всеми обработанными свойствами.
|
|
149
|
-
*/
|
|
150
|
-
getPathName(): string {
|
|
151
|
-
return `${PropertiesConfig.getDesignName()}-${this.component}`
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Returns the name of the file with data about the subclass.
|
|
156
|
-
*
|
|
157
|
-
* Возвращает название файла с данными о подклассе.
|
|
158
|
-
*/
|
|
159
|
-
protected getPathClasses(): string {
|
|
160
|
-
return `${this.getPathName()}-${UI_STRUCTURE_CLASSES}`
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Data generation.
|
|
165
|
-
*
|
|
166
|
-
* Генерация данных.
|
|
167
|
-
*/
|
|
168
|
-
protected make(): DesignStructureList {
|
|
169
|
-
return PropertiesCache.get<DesignStructureList>(
|
|
170
|
-
[UI_DIR_STRUCTURE],
|
|
171
|
-
this.getPathName(),
|
|
172
|
-
() => {
|
|
173
|
-
return new DesignStructureRead(this.component).get()
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Generation of data for the subclass.
|
|
180
|
-
*
|
|
181
|
-
* Генерация данных для подкласса.
|
|
182
|
-
*/
|
|
183
|
-
protected makeClasses(): DesignStructureClassesList {
|
|
184
|
-
return PropertiesCache.get<DesignStructureClassesList>(
|
|
185
|
-
[UI_DIR_STRUCTURE],
|
|
186
|
-
this.getPathClasses(),
|
|
187
|
-
() => {
|
|
188
|
-
return new DesignStructureClasses(this.component).get()
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Performing transformation of tokens into styles for the component.
|
|
195
|
-
*
|
|
196
|
-
* Выполнение преобразования токенов в стили для компонента.
|
|
197
|
-
*/
|
|
198
|
-
protected makeStyles(): string[] {
|
|
199
|
-
return new DesignStructureStyles(this.component).get()
|
|
200
|
-
}
|
|
201
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { forEach, isFilled, isObjectNotArray, toCamelCase } from '@dxtmisha/functional-basic'
|
|
4
|
-
|
|
5
|
-
import { DesignStructureItemAbstract } from './DesignStructureItemAbstract'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
type PropertyItem,
|
|
9
|
-
PropertyKey,
|
|
10
|
-
PropertyType
|
|
11
|
-
} from '../../types/propertyTypes'
|
|
12
|
-
import {
|
|
13
|
-
type DesignStructureClassesList
|
|
14
|
-
} from '../../types/designTypes'
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Class for resolving and generating a hierarchical list of CSS classes for a component.
|
|
18
|
-
* It recursively parses component properties to identify subclasses and build BEM-compliant class names.
|
|
19
|
-
*
|
|
20
|
-
* Класс для разрешения и генерации иерархического списка CSS-классов для компонента.
|
|
21
|
-
* Рекурсивно анализирует свойства компонента для идентификации подклассов и построения имен классов, соответствующих BEM.
|
|
22
|
-
*/
|
|
23
|
-
export class DesignStructureClasses extends DesignStructureItemAbstract<DesignStructureClassesList> {
|
|
24
|
-
protected data: DesignStructureClassesList = []
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Constructor for DesignStructureClasses.
|
|
28
|
-
*
|
|
29
|
-
* Конструктор для DesignStructureClasses.
|
|
30
|
-
* @param component component name used as the base for class generation / имя компонента, используемое в качестве базы для генерации классов
|
|
31
|
-
*/
|
|
32
|
-
constructor(
|
|
33
|
-
component: string
|
|
34
|
-
) {
|
|
35
|
-
super(component)
|
|
36
|
-
this.data = this.make(this.items?.value)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Returns records that meet state conditions.
|
|
41
|
-
*
|
|
42
|
-
* Возвращает записи, удовлетворяющие условиям состояния.
|
|
43
|
-
* @param properties input data/ входной данный
|
|
44
|
-
* @param parent ancestor name/ название предка
|
|
45
|
-
*/
|
|
46
|
-
protected make(
|
|
47
|
-
properties?: PropertyItem['value'],
|
|
48
|
-
parent: string[] = []
|
|
49
|
-
): DesignStructureClassesList {
|
|
50
|
-
const list: DesignStructureClassesList = []
|
|
51
|
-
if (
|
|
52
|
-
isFilled(properties)
|
|
53
|
-
&& isObjectNotArray(properties)
|
|
54
|
-
) {
|
|
55
|
-
forEach(properties, (item) => {
|
|
56
|
-
if (this.isClasses(item)) {
|
|
57
|
-
const names = this.getNames(item, parent)
|
|
58
|
-
|
|
59
|
-
list.push(
|
|
60
|
-
{
|
|
61
|
-
index: toCamelCase(names.join('-')),
|
|
62
|
-
full: item?.[PropertyKey.fullName] ?? false,
|
|
63
|
-
className: names.join('__')
|
|
64
|
-
},
|
|
65
|
-
...this.make(item?.value, names)
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return list
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Does this property belong to the class.
|
|
76
|
-
*
|
|
77
|
-
* Является ли это свойство частью класса.
|
|
78
|
-
* @param item object for checking/ объект для проверки
|
|
79
|
-
*/
|
|
80
|
-
protected isClasses(item: PropertyItem): boolean {
|
|
81
|
-
return Boolean(
|
|
82
|
-
item?.[PropertyKey.variable] === PropertyType.subclass || item?.[PropertyKey.subclass]
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Obtaining the name of the class.
|
|
88
|
-
*
|
|
89
|
-
* Получение имени класса.
|
|
90
|
-
* @param item object for checking/ объект для проверки
|
|
91
|
-
* @param parent list of names of ancestors/ список имен предков
|
|
92
|
-
*/
|
|
93
|
-
protected getNames(
|
|
94
|
-
item: PropertyItem,
|
|
95
|
-
parent: string[]
|
|
96
|
-
): string[] {
|
|
97
|
-
const name = item?.[PropertyKey.nameIndex] ?? item?.[PropertyKey.index] ?? ''
|
|
98
|
-
|
|
99
|
-
if (item?.[PropertyKey.fullName]) {
|
|
100
|
-
return [name]
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return [...parent, name]
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// export:none
|
|
2
|
-
|
|
3
|
-
import { Properties } from '../Properties/Properties'
|
|
4
|
-
import { PropertiesConfig } from '../Properties/PropertiesConfig'
|
|
5
|
-
|
|
6
|
-
import type { PropertyItemsItem } from '../../types/propertyTypes'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Base abstract class for structural component items.
|
|
10
|
-
* It provides the foundation for resolving component properties and metadata from the design system's central storage.
|
|
11
|
-
*
|
|
12
|
-
* Базовый абстрактный класс для структурных элементов компонента.
|
|
13
|
-
* Предоставляет основу для разрешения свойств и метаданных компонента из центрального хранилища дизайн-системы.
|
|
14
|
-
*/
|
|
15
|
-
export abstract class DesignStructureItemAbstract<D> {
|
|
16
|
-
protected properties: Properties
|
|
17
|
-
protected items?: PropertyItemsItem
|
|
18
|
-
|
|
19
|
-
protected abstract data: D
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Constructor for DesignStructureItemAbstract.
|
|
23
|
-
*
|
|
24
|
-
* Конструктор для DesignStructureItemAbstract.
|
|
25
|
-
* @param component component name for which the structure is being resolved / имя компонента, для которого разрешается структура
|
|
26
|
-
*/
|
|
27
|
-
protected constructor(
|
|
28
|
-
protected readonly component: string
|
|
29
|
-
) {
|
|
30
|
-
this.properties = new Properties()
|
|
31
|
-
this.items = this.properties.get().getInfo(this.getLink())
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Getting all data about dependencies of the current component.
|
|
36
|
-
*
|
|
37
|
-
* Получение всех данных об зависимостях у текущего компонента.
|
|
38
|
-
*/
|
|
39
|
-
get(): D {
|
|
40
|
-
return this.data
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Returns a reference to the component.
|
|
45
|
-
*
|
|
46
|
-
* Возвращает ссылку на компонент.
|
|
47
|
-
* Это полный массив со всеми обработанными свойствами.
|
|
48
|
-
*/
|
|
49
|
-
protected getLink(): string {
|
|
50
|
-
return `{${PropertiesConfig.getDesignName()}.${this.component}}`
|
|
51
|
-
}
|
|
52
|
-
}
|