@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.
Files changed (335) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/ai-resources/componentMaterials.md +19 -0
  3. package/ai-resources/componentPrompt.md +381 -0
  4. package/ai-resources/componentWiki.md +13 -0
  5. package/bin/arguments.ts +168 -0
  6. package/bin/build-packages.ts +12 -2
  7. package/bin/build-publish-packages.ts +12 -2
  8. package/bin/design-component.ts +7 -1
  9. package/bin/design-constructor.ts +22 -3
  10. package/bin/design-figma.ts +26 -4
  11. package/bin/design-flags.ts +14 -2
  12. package/bin/design-library.ts +7 -1
  13. package/bin/design-package.ts +29 -5
  14. package/bin/design-prompt.ts +22 -3
  15. package/bin/design-screenshot.ts +12 -2
  16. package/bin/design-types-save.ts +32 -5
  17. package/bin/design-types.ts +32 -6
  18. package/bin/design-ui.ts +21 -3
  19. package/bin/design-wiki-storm.ts +11 -3
  20. package/dist/AiZAi-x3CInynJ.js +232 -0
  21. package/dist/PropertiesConfig-ChizwW5y.js +250 -0
  22. package/{src/config.ts → dist/config.d.ts} +179 -158
  23. package/dist/config.js +20 -0
  24. package/dist/figmaApiTypes-CArSsNW8.js +6 -0
  25. package/dist/library-ai.d.ts +482 -0
  26. package/dist/library-ai.js +2 -0
  27. package/dist/library-figma.d.ts +462 -0
  28. package/dist/library-figma.js +75 -0
  29. package/dist/library-ui.d.ts +586 -0
  30. package/dist/library-ui.js +3760 -0
  31. package/dist/library.d.ts +4677 -0
  32. package/dist/library.js +1436 -0
  33. package/dist/propertyTypes-DflziKuR.js +236 -0
  34. package/package.json +69 -20
  35. package/bin/ai-doc.ts +0 -7
  36. package/bin/build-functional.ts +0 -5
  37. package/bin/design-component-wiki.ts +0 -11
  38. package/src/classes/Ai/AiAbstract.ts +0 -242
  39. package/src/classes/Ai/AiClaude.ts +0 -26
  40. package/src/classes/Ai/AiClaudeAgent.ts +0 -16
  41. package/src/classes/Ai/AiClaudeAgentLite.ts +0 -86
  42. package/src/classes/Ai/AiClaudeCli.ts +0 -24
  43. package/src/classes/Ai/AiClaudeCliLite.ts +0 -108
  44. package/src/classes/Ai/AiClaudeLite.ts +0 -112
  45. package/src/classes/Ai/AiDoc.ts +0 -81
  46. package/src/classes/Ai/AiDocItem.ts +0 -27
  47. package/src/classes/Ai/AiDocItemAbstract.ts +0 -209
  48. package/src/classes/Ai/AiDocItemClasses.ts +0 -27
  49. package/src/classes/Ai/AiDocItemComposables.ts +0 -20
  50. package/src/classes/Ai/AiDocType.ts +0 -45
  51. package/src/classes/Ai/AiGoogle.ts +0 -26
  52. package/src/classes/Ai/AiGoogleCli.ts +0 -24
  53. package/src/classes/Ai/AiGoogleCliLite.ts +0 -108
  54. package/src/classes/Ai/AiGoogleLite.ts +0 -78
  55. package/src/classes/Ai/AiOpenAi.ts +0 -26
  56. package/src/classes/Ai/AiOpenAiLite.ts +0 -107
  57. package/src/classes/Ai/AiZAi.ts +0 -17
  58. package/src/classes/Ai/AiZAiLite.ts +0 -77
  59. package/src/classes/Ai/ApiTmp.ts +0 -43
  60. package/src/classes/BrowserItem.ts +0 -408
  61. package/src/classes/Build/BuildFunctional.ts +0 -54
  62. package/src/classes/Build/BuildPackages.ts +0 -137
  63. package/src/classes/Build/BuildPublishPackages.ts +0 -105
  64. package/src/classes/BuildItem.ts +0 -187
  65. package/src/classes/Component/ComponentCreator.ts +0 -45
  66. package/src/classes/Component/ComponentItem.ts +0 -161
  67. package/src/classes/Component/ComponentWiki.ts +0 -258
  68. package/src/classes/Component/ComponentWikiFile.ts +0 -138
  69. package/src/classes/Design/DesignCommand.ts +0 -243
  70. package/src/classes/Design/DesignComponent.ts +0 -824
  71. package/src/classes/Design/DesignConstructor.ts +0 -222
  72. package/src/classes/Design/DesignConstructors.ts +0 -101
  73. package/src/classes/Design/DesignFigma.ts +0 -61
  74. package/src/classes/Design/DesignFlags.ts +0 -215
  75. package/src/classes/Design/DesignReplace.ts +0 -672
  76. package/src/classes/Design/DesignScreenshot.ts +0 -133
  77. package/src/classes/Design/DesignStructure.ts +0 -201
  78. package/src/classes/Design/DesignStructureClasses.ts +0 -105
  79. package/src/classes/Design/DesignStructureItemAbstract.ts +0 -52
  80. package/src/classes/Design/DesignStructureRead.ts +0 -349
  81. package/src/classes/Design/DesignStructureStyles.ts +0 -45
  82. package/src/classes/Design/DesignTypes.ts +0 -94
  83. package/src/classes/Design/DesignTypesAi.ts +0 -135
  84. package/src/classes/Design/DesignTypesDescription.ts +0 -119
  85. package/src/classes/Design/DesignTypesMake.ts +0 -460
  86. package/src/classes/Design/DesignTypesMcp.ts +0 -90
  87. package/src/classes/Design/DesignTypesPrompts.ts +0 -332
  88. package/src/classes/Design/DesignTypescript.ts +0 -244
  89. package/src/classes/Design/DesignUi.ts +0 -143
  90. package/src/classes/Design/DesignWiki.ts +0 -52
  91. package/src/classes/Design/DesignWikiStorm.ts +0 -95
  92. package/src/classes/Design/DesignWikiStormItem.ts +0 -316
  93. package/src/classes/FigmaApi.ts +0 -190
  94. package/src/classes/Git/GitRead.ts +0 -261
  95. package/src/classes/Library/LibraryAiMcpItem.ts +0 -67
  96. package/src/classes/Library/LibraryAiPrompt.ts +0 -268
  97. package/src/classes/Library/LibraryAiPromptItem.ts +0 -331
  98. package/src/classes/Library/LibraryAiWiki.ts +0 -127
  99. package/src/classes/Library/LibraryAiWikiItem.ts +0 -79
  100. package/src/classes/Library/LibraryExport.ts +0 -167
  101. package/src/classes/Library/LibraryFlags.ts +0 -62
  102. package/src/classes/Library/LibraryItems.ts +0 -138
  103. package/src/classes/Library/LibraryList.ts +0 -189
  104. package/src/classes/Library/LibraryMedia.ts +0 -139
  105. package/src/classes/Library/LibraryPlugin.ts +0 -73
  106. package/src/classes/Library/LibraryTypes.ts +0 -130
  107. package/src/classes/Package/PackageFile.ts +0 -154
  108. package/src/classes/Package/PackageInit.ts +0 -54
  109. package/src/classes/Package/PackageItem.ts +0 -329
  110. package/src/classes/Properties/Properties.ts +0 -175
  111. package/src/classes/Properties/PropertiesCache.ts +0 -248
  112. package/src/classes/Properties/PropertiesConfig.ts +0 -213
  113. package/src/classes/Properties/PropertiesConvector.ts +0 -52
  114. package/src/classes/Properties/PropertiesFile.ts +0 -522
  115. package/src/classes/Properties/PropertiesImport.ts +0 -182
  116. package/src/classes/Properties/PropertiesItems.ts +0 -605
  117. package/src/classes/Properties/PropertiesKeys.ts +0 -121
  118. package/src/classes/Properties/PropertiesMain.ts +0 -138
  119. package/src/classes/Properties/PropertiesPalette.ts +0 -149
  120. package/src/classes/Properties/PropertiesPath.ts +0 -193
  121. package/src/classes/Properties/PropertiesScss.ts +0 -261
  122. package/src/classes/Properties/PropertiesSeparator.ts +0 -118
  123. package/src/classes/Properties/PropertiesSettings.ts +0 -104
  124. package/src/classes/Properties/PropertiesStandard.ts +0 -180
  125. package/src/classes/Properties/PropertiesTool.ts +0 -80
  126. package/src/classes/Properties/PropertiesTypes.ts +0 -147
  127. package/src/classes/Properties/PropertiesValues.ts +0 -75
  128. package/src/classes/Properties/PropertiesWrap.ts +0 -187
  129. package/src/classes/Properties/convector/convectorColor.ts +0 -27
  130. package/src/classes/Properties/convector/convectorFontFamilies.ts +0 -18
  131. package/src/classes/Properties/convector/convectorShadow.ts +0 -61
  132. package/src/classes/Properties/convector/convectorTypography.ts +0 -19
  133. package/src/classes/Properties/to/PropertiesToAbstract.ts +0 -51
  134. package/src/classes/Properties/to/PropertiesToAnimate.ts +0 -59
  135. package/src/classes/Properties/to/PropertiesToClass.ts +0 -49
  136. package/src/classes/Properties/to/PropertiesToClone.ts +0 -114
  137. package/src/classes/Properties/to/PropertiesToComponent.ts +0 -52
  138. package/src/classes/Properties/to/PropertiesToDrag.ts +0 -231
  139. package/src/classes/Properties/to/PropertiesToDuplicate.ts +0 -165
  140. package/src/classes/Properties/to/PropertiesToFull.ts +0 -36
  141. package/src/classes/Properties/to/PropertiesToLink.ts +0 -259
  142. package/src/classes/Properties/to/PropertiesToMedia.ts +0 -187
  143. package/src/classes/Properties/to/PropertiesToMulti.ts +0 -101
  144. package/src/classes/Properties/to/PropertiesToNone.ts +0 -46
  145. package/src/classes/Properties/to/PropertiesToPalette.ts +0 -241
  146. package/src/classes/Properties/to/PropertiesToProperty.ts +0 -31
  147. package/src/classes/Properties/to/PropertiesToRemove.ts +0 -33
  148. package/src/classes/Properties/to/PropertiesToReplace.ts +0 -77
  149. package/src/classes/Properties/to/PropertiesToRoot.ts +0 -40
  150. package/src/classes/Properties/to/PropertiesToSimilar.ts +0 -128
  151. package/src/classes/Properties/to/PropertiesToSort.ts +0 -146
  152. package/src/classes/Properties/to/PropertiesToState.ts +0 -65
  153. package/src/classes/Properties/to/PropertiesToStyle.ts +0 -52
  154. package/src/classes/Properties/to/PropertiesToSub.ts +0 -95
  155. package/src/classes/Properties/to/PropertiesToSubclass.ts +0 -76
  156. package/src/classes/Properties/to/PropertiesToVar.ts +0 -194
  157. package/src/classes/Properties/to/PropertiesToVariable.ts +0 -176
  158. package/src/classes/Styles/Styles.ts +0 -247
  159. package/src/classes/Styles/StylesClasses.ts +0 -86
  160. package/src/classes/Styles/StylesProperties.ts +0 -197
  161. package/src/classes/Styles/StylesRoot.ts +0 -103
  162. package/src/classes/Styles/StylesTool.ts +0 -112
  163. package/src/classes/Styles/to/StylesToAbstract.ts +0 -93
  164. package/src/classes/Styles/to/StylesToAnimate.ts +0 -19
  165. package/src/classes/Styles/to/StylesToClass.ts +0 -25
  166. package/src/classes/Styles/to/StylesToClassFull.ts +0 -19
  167. package/src/classes/Styles/to/StylesToContainer.ts +0 -24
  168. package/src/classes/Styles/to/StylesToMedia.ts +0 -19
  169. package/src/classes/Styles/to/StylesToProperty.ts +0 -123
  170. package/src/classes/Styles/to/StylesToRoot.ts +0 -14
  171. package/src/classes/Styles/to/StylesToSelector.ts +0 -71
  172. package/src/classes/Styles/to/StylesToVar.ts +0 -105
  173. package/src/classes/Styles/to/StylesToVirtual.ts +0 -33
  174. package/src/composables/useAi.ts +0 -38
  175. package/src/demo/ai.ts +0 -10
  176. package/src/functions/getComponentPaths.ts +0 -13
  177. package/src/functions/getConfigAi.ts +0 -14
  178. package/src/functions/getConstructorProperties.ts +0 -54
  179. package/src/functions/getDirname.ts +0 -17
  180. package/src/functions/getNameDirByPaths.ts +0 -16
  181. package/src/functions/getPackageJson.ts +0 -19
  182. package/src/functions/hasNativeDirname.ts +0 -8
  183. package/src/functions/run.ts +0 -47
  184. package/src/functions/toPathStandardSep.ts +0 -14
  185. package/src/library-ai.ts +0 -10
  186. package/src/library.ts +0 -73
  187. package/src/media/ai/ai-doc-types.ts +0 -21
  188. package/src/media/properties/css.ts +0 -634
  189. package/src/media/properties/cssSelector.ts +0 -74
  190. package/src/media/properties/cssVirtual.ts +0 -12
  191. package/src/media/properties/listSort.ts +0 -113
  192. package/src/media/properties/style.ts +0 -81
  193. package/src/media/templates/component/DesignComponent.mdx +0 -30
  194. package/src/media/templates/component/DesignComponent.stories.ts +0 -34
  195. package/src/media/templates/component/DesignComponent.vue +0 -54
  196. package/src/media/templates/component/DesignComponentAiWiki.vue +0 -25
  197. package/src/media/templates/component/index.ts +0 -13
  198. package/src/media/templates/component/props.ts +0 -27
  199. package/src/media/templates/component/styleToken.scss +0 -17
  200. package/src/media/templates/component/wiki.ts +0 -13
  201. package/src/media/templates/component/wikiData.ts +0 -28
  202. package/src/media/templates/componentDoc/ComponentDoc.vue +0 -26
  203. package/src/media/templates/componentDoc/index.ts +0 -12
  204. package/src/media/templates/componentDoc/materials/README.md +0 -8
  205. package/src/media/templates/componentDoc/materials/prompt.md +0 -38
  206. package/src/media/templates/componentDoc/subcomponents/_.gitignore.txt +0 -0
  207. package/src/media/templates/componentDoc/types.ts +0 -15
  208. package/src/media/templates/componentDoc/wiki/ComponentDoc.mdx +0 -13
  209. package/src/media/templates/componentDoc/wiki/ComponentDoc.stories.ts +0 -24
  210. package/src/media/templates/componentDoc/wiki/prompt.md +0 -41
  211. package/src/media/templates/constructors/Constructors.ts +0 -33
  212. package/src/media/templates/constructors/ConstructorsDesign.tsx +0 -129
  213. package/src/media/templates/constructors/basicTypes.ts +0 -0
  214. package/src/media/templates/constructors/index.ts +0 -5
  215. package/src/media/templates/constructors/props.ts +0 -28
  216. package/src/media/templates/constructors/style.scss +0 -5
  217. package/src/media/templates/constructors/types.ts +0 -47
  218. package/src/media/templates/packages/figma/README.md +0 -1
  219. package/src/media/templates/packages/figma/_.gitignore.txt +0 -29
  220. package/src/media/templates/packages/figma/ai.sample.config.ts +0 -2
  221. package/src/media/templates/packages/figma/design.config.json +0 -3
  222. package/src/media/templates/packages/figma/index.html +0 -12
  223. package/src/media/templates/packages/figma/manifest.json +0 -25
  224. package/src/media/templates/packages/figma/package.json +0 -37
  225. package/src/media/templates/packages/figma/src/App.vue +0 -9
  226. package/src/media/templates/packages/figma/src/classes/_.gitignore.txt +0 -1
  227. package/src/media/templates/packages/figma/src/code.ts +0 -16
  228. package/src/media/templates/packages/figma/src/components/_.gitignore.txt +0 -1
  229. package/src/media/templates/packages/figma/src/composables/_.gitignore.txt +0 -1
  230. package/src/media/templates/packages/figma/src/config.ts +0 -0
  231. package/src/media/templates/packages/figma/src/functions/_.gitignore.txt +0 -1
  232. package/src/media/templates/packages/figma/src/library.ts +0 -0
  233. package/src/media/templates/packages/figma/src/main.ts +0 -4
  234. package/src/media/templates/packages/figma/src/media/_.gitignore.txt +0 -1
  235. package/src/media/templates/packages/figma/src/storybook/_.gitignore.txt +0 -1
  236. package/src/media/templates/packages/figma/src/types/_.gitignore.txt +0 -1
  237. package/src/media/templates/packages/figma/src/vite-env.d.ts +0 -1
  238. package/src/media/templates/packages/figma/tsconfig.app.json +0 -12
  239. package/src/media/templates/packages/figma/tsconfig.json +0 -7
  240. package/src/media/templates/packages/figma/tsconfig.node.json +0 -8
  241. package/src/media/templates/packages/figma/vite.config.ts +0 -7
  242. package/src/media/templates/packages/library/README.md +0 -1
  243. package/src/media/templates/packages/library/_.gitignore.txt +0 -27
  244. package/src/media/templates/packages/library/ai-description.md +0 -15
  245. package/src/media/templates/packages/library/design.config.json +0 -3
  246. package/src/media/templates/packages/library/index.html +0 -12
  247. package/src/media/templates/packages/library/materials/README.md +0 -8
  248. package/src/media/templates/packages/library/materials/prompt.md +0 -45
  249. package/src/media/templates/packages/library/package.json +0 -46
  250. package/src/media/templates/packages/library/src/App.vue +0 -8
  251. package/src/media/templates/packages/library/src/classes/_.gitignore.txt +0 -1
  252. package/src/media/templates/packages/library/src/components/_.gitignore.txt +0 -1
  253. package/src/media/templates/packages/library/src/composables/_.gitignore.txt +0 -1
  254. package/src/media/templates/packages/library/src/functions/_.gitignore.txt +0 -1
  255. package/src/media/templates/packages/library/src/library.ts +0 -0
  256. package/src/media/templates/packages/library/src/main.ts +0 -6
  257. package/src/media/templates/packages/library/src/style.scss +0 -0
  258. package/src/media/templates/packages/library/src/types/_.gitignore.txt +0 -1
  259. package/src/media/templates/packages/library/src/vite-env.d.ts +0 -1
  260. package/src/media/templates/packages/library/tsconfig.app.json +0 -11
  261. package/src/media/templates/packages/library/tsconfig.json +0 -7
  262. package/src/media/templates/packages/library/tsconfig.node.json +0 -7
  263. package/src/media/templates/packages/library/vite.config.ts +0 -14
  264. package/src/media/templates/packages/nitro/README.md +0 -1
  265. package/src/media/templates/packages/nitro/_.gitignore.txt +0 -28
  266. package/src/media/templates/packages/nitro/index.html +0 -2
  267. package/src/media/templates/packages/nitro/package.json +0 -25
  268. package/src/media/templates/packages/nitro/server/plugins/ui-plugin.ts +0 -7
  269. package/src/media/templates/packages/nitro/server/routes/api/hello.ts +0 -13
  270. package/src/media/templates/packages/nitro/src/App.vue +0 -10
  271. package/src/media/templates/packages/nitro/src/assets/_.gitignore.txt +0 -0
  272. package/src/media/templates/packages/nitro/src/components/_.gitignore.txt +0 -0
  273. package/src/media/templates/packages/nitro/src/composables/_.gitignore.txt +0 -0
  274. package/src/media/templates/packages/nitro/src/entry-client.ts +0 -13
  275. package/src/media/templates/packages/nitro/src/entry-server.ts +0 -29
  276. package/src/media/templates/packages/nitro/src/main.ts +0 -14
  277. package/src/media/templates/packages/nitro/src/pages/HomePage.vue +0 -8
  278. package/src/media/templates/packages/nitro/src/router.ts +0 -11
  279. package/src/media/templates/packages/nitro/src/style.scss +0 -0
  280. package/src/media/templates/packages/nitro/src/templates/main.html +0 -21
  281. package/src/media/templates/packages/nitro/src/vite-env.d.ts +0 -11
  282. package/src/media/templates/packages/nitro/tsconfig.app.json +0 -14
  283. package/src/media/templates/packages/nitro/tsconfig.json +0 -7
  284. package/src/media/templates/packages/nitro/tsconfig.node.json +0 -12
  285. package/src/media/templates/packages/nitro/vite.config.ts +0 -17
  286. package/src/media/templates/packages/project/README.md +0 -1
  287. package/src/media/templates/packages/project/_.gitignore.txt +0 -28
  288. package/src/media/templates/packages/project/design.config.json +0 -3
  289. package/src/media/templates/packages/project/index.html +0 -12
  290. package/src/media/templates/packages/project/materials/README.md +0 -8
  291. package/src/media/templates/packages/project/materials/prompt.md +0 -41
  292. package/src/media/templates/packages/project/package.json +0 -13
  293. package/src/media/templates/packages/project/public/_.gitignore.txt +0 -0
  294. package/src/media/templates/packages/project/src/App.vue +0 -12
  295. package/src/media/templates/packages/project/src/assets/_.gitignore.txt +0 -0
  296. package/src/media/templates/packages/project/src/components/_.gitignore.txt +0 -0
  297. package/src/media/templates/packages/project/src/composables/_.gitignore.txt +0 -0
  298. package/src/media/templates/packages/project/src/main.ts +0 -6
  299. package/src/media/templates/packages/project/src/style.scss +0 -0
  300. package/src/media/templates/packages/project/src/vite-env.d.ts +0 -1
  301. package/src/media/templates/packages/project/tsconfig.app.json +0 -11
  302. package/src/media/templates/packages/project/tsconfig.json +0 -7
  303. package/src/media/templates/packages/project/tsconfig.node.json +0 -7
  304. package/src/media/templates/packages/project/vite.config.ts +0 -7
  305. package/src/media/templates/prompts/aiCodeGlobalPrompt.en.md +0 -22
  306. package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.md +0 -21
  307. package/src/media/templates/prompts/aiCodeVuePrompt.en.md +0 -17
  308. package/src/media/templates/prompts/aiCodeVuePrompt.ru.md +0 -17
  309. package/src/media/templates/prompts/aiDocClassPrompt.en.txt +0 -63
  310. package/src/media/templates/prompts/aiDocClassPrompt.ru.txt +0 -63
  311. package/src/media/templates/prompts/aiDocComposablePrompt.en.txt +0 -67
  312. package/src/media/templates/prompts/aiDocComposablePrompt.ru.txt +0 -67
  313. package/src/media/templates/prompts/aiDocFunctionPrompt.en.txt +0 -57
  314. package/src/media/templates/prompts/aiDocFunctionPrompt.ru.txt +0 -57
  315. package/src/media/templates/prompts/componentPrompt.en.txt +0 -182
  316. package/src/media/templates/prompts/componentPrompt.ru.txt +0 -182
  317. package/src/media/templates/prompts/demoClassEn.mdx +0 -111
  318. package/src/media/templates/prompts/demoClassRu.mdx +0 -111
  319. package/src/media/templates/prompts/demoComponentEn.mdx +0 -282
  320. package/src/media/templates/prompts/demoComponentRu.mdx +0 -282
  321. package/src/media/templates/prompts/demoComposableEn.mdx +0 -103
  322. package/src/media/templates/prompts/demoComposableRu.mdx +0 -103
  323. package/src/media/templates/prompts/demoDocEn.mdx +0 -30
  324. package/src/media/templates/prompts/demoDocRu.mdx +0 -30
  325. package/src/media/templates/viteComponentTemplateConfig.ts +0 -14
  326. package/src/types/aiTypes.ts +0 -19
  327. package/src/types/configTypes.ts +0 -69
  328. package/src/types/designTypes.ts +0 -167
  329. package/src/types/figmaApiTypes.ts +0 -337
  330. package/src/types/gitTypes.ts +0 -59
  331. package/src/types/libraryTypes.ts +0 -49
  332. package/src/types/propertyTypes.ts +0 -586
  333. package/src/types/screenshotTypes.ts +0 -55
  334. package/src/types/webTypes.ts +0 -134
  335. package/src/vite-env.d.ts +0 -1
@@ -1,222 +0,0 @@
1
- // export:none
2
-
3
- import { toCamelCase, toCamelCaseFirst } from '@dxtmisha/functional-basic'
4
-
5
- import { PropertiesFile } from '../Properties/PropertiesFile'
6
-
7
- import { DesignCommand } from './DesignCommand'
8
-
9
- import { UI_DIR_IN, UI_DIR_CONSTRUCTOR, UI_DIRS_LIBRARY } from '../../config'
10
-
11
- const FILE_PROPERTIES = 'properties.json'
12
- const FILE_PROPS = 'props.ts'
13
- const FILE_TYPES = 'types.ts'
14
- const FILE_TYPES_BASIC = 'basicTypes.ts'
15
- const FILE_STYLE = 'style.scss'
16
- const FILE_CODE = 'Constructors.ts'
17
- const FILE_CLASS = 'ConstructorsDesign.tsx'
18
- const FILE_INDEX = 'index.ts'
19
-
20
- /**
21
- * Class for generating files and configurations based on a component's constructor.
22
- * It automates the creation of property definitions, type files, styles, and integration logic for constructors.
23
- *
24
- * Класс для генерации файлов и конфигураций на основе конструктора компонента.
25
- * Автоматизирует создание определений свойств, файлов типов, стилей и логики интеграции для конструкторов.
26
- */
27
- export class DesignConstructor extends DesignCommand {
28
- protected DIR_SAMPLE: string = UI_DIR_CONSTRUCTOR
29
- protected dir: string[]
30
-
31
- /**
32
- * Constructor for DesignConstructor.
33
- *
34
- * Конструктор для DesignConstructor.
35
- * @param command component name or command identifier / название компонента или идентификатор команды
36
- * @param options additional key-value parameters / дополнительные параметры ключ-значение
37
- */
38
- constructor(
39
- command: string,
40
- options: Record<string, string> = {}
41
- ) {
42
- super(command, options)
43
-
44
- this.dir = [
45
- PropertiesFile.getRoot(),
46
- UI_DIR_IN,
47
- this.DIR_SAMPLE,
48
- this.getStructure().getComponentNameFirst()
49
- ]
50
- }
51
-
52
- /**
53
- * Initializes the creation of all files for the current team.
54
- *
55
- * Инициализирует создание всех файлов для текущей команды.
56
- */
57
- protected initMain(): void {
58
- this
59
- .makeProperties()
60
- .makeProps()
61
- .makeTypes()
62
- .makeTypesBasic()
63
- .makeStyle()
64
- .makeCode()
65
- .makeMain()
66
- .makeIndex()
67
- .makeFilePackage()
68
- .makeLibrary()
69
- }
70
-
71
- /**
72
- * This code generates the properties.json.
73
- *
74
- * Генерация файла properties.json.
75
- */
76
- protected makeProperties(): this {
77
- const file = FILE_PROPERTIES
78
-
79
- if (!this.isFile(file)) {
80
- this.write(file, '{\r\n}\r\n')
81
- }
82
-
83
- return this
84
- }
85
-
86
- /**
87
- * This code generates the props.ts.
88
- *
89
- * Генерация файла props.ts.
90
- */
91
- protected makeProps(): this {
92
- const file = FILE_PROPS
93
- const sample = this.readDefinable(file)
94
-
95
- sample
96
- .replaceType()
97
- .replaceDefault()
98
- .replaceProps()
99
-
100
- this.write(file, sample.get())
101
- return this
102
- }
103
-
104
- /**
105
- * This code generates the types.ts.
106
- *
107
- * Генерация файла types.ts.
108
- */
109
- protected makeTypes(): this {
110
- const file = FILE_TYPES
111
- const sample = this.readDefinable(file)
112
-
113
- sample.replaceClasses()
114
-
115
- this.write(file, sample.get())
116
- return this
117
- }
118
-
119
- /**
120
- * This code generates the basicTypes.ts.
121
- *
122
- * Генерация файла basicTypes.ts.
123
- */
124
- protected makeTypesBasic(): this {
125
- return this.makeFileStandard(FILE_TYPES_BASIC)
126
- }
127
-
128
- /**
129
- * This code generates the style.scss.
130
- *
131
- * Генерация файла style.scss.
132
- */
133
- protected makeStyle(): this {
134
- const file = FILE_STYLE
135
-
136
- if (!this.isFile(file)) {
137
- const sample = this.readDefinable(file)
138
- this.write(file, sample.get())
139
- }
140
-
141
- return this
142
- }
143
-
144
- /**
145
- * This code generates the Constructors.ts.
146
- *
147
- * Генерация файла Constructors.ts.
148
- */
149
- protected makeCode(): this {
150
- return this.makeFileStandard(FILE_CODE)
151
- }
152
-
153
- /**
154
- * This code generates the ConstructorsDesign.tsx.
155
- *
156
- * Генерация файла ConstructorsDesign.tsx.
157
- */
158
- protected makeMain(): this {
159
- return this.makeFileStandard(FILE_CLASS)
160
- }
161
-
162
- /**
163
- * This code generates the index.ts.
164
- *
165
- * Генерация файла index.ts.
166
- */
167
- protected makeIndex(): this {
168
- return this.makeFileStandard(FILE_INDEX)
169
- }
170
-
171
- /**
172
- * Generates a standard file based on a template.
173
- *
174
- * Генерирует стандартный файл на основе шаблона.
175
- * @param file file name/ имя файла
176
- */
177
- protected makeFileStandard(file: string): this {
178
- const sample = this.readDefinable(file)
179
-
180
- sample.replaceConstructorClasses()
181
-
182
- this.write(sample.getNameFile(file), sample.get())
183
- return this
184
- }
185
-
186
- /**
187
- * Updates the package.json file.
188
- *
189
- * Обновляет файл package.json.
190
- */
191
- protected makeFilePackage(): this {
192
- const command = this.getName()
193
- const name = `./${command}`
194
-
195
- this.updatePackage(
196
- `exports|${name}`,
197
- {
198
- types: `./dist/constructors/${command}/index.d.ts`,
199
- default: `./dist/${this.getNameMin()}.js`
200
- }
201
- )
202
-
203
- return this
204
- }
205
-
206
- /**
207
- * Generates a library file.
208
- *
209
- * Генерирует файл библиотеки.
210
- */
211
- protected makeLibrary(): this {
212
- const name = toCamelCase(this.getCommand())
213
-
214
- PropertiesFile.writeByPath(
215
- [...UI_DIRS_LIBRARY, `${name}.ts`],
216
- `export * from '../${UI_DIR_CONSTRUCTOR}/${toCamelCaseFirst(this.getCommand())}/index'
217
- `
218
- )
219
-
220
- return this
221
- }
222
- }
@@ -1,101 +0,0 @@
1
- // export:none
2
-
3
- import { isFilled, toCamelCaseFirst } from '@dxtmisha/functional-basic'
4
-
5
- import { PropertiesFile } from '../Properties/PropertiesFile'
6
- import { PropertiesCache } from '../Properties/PropertiesCache'
7
- import { DesignConstructor } from './DesignConstructor'
8
-
9
- import { UI_DIR_CONSTRUCTOR, UI_DIR_IN, UI_DIRS_LIBRARY, UI_FILE_STYLE_SCSS } from '../../config'
10
-
11
- /**
12
- * Class for orchestrating the generation and update of multiple design constructors.
13
- * It manages the collective lifecycle of component constructors, including bulk updates and shared style generation.
14
- *
15
- * Класс для управления генерацией и обновлением нескольких конструкторов дизайна.
16
- * Управляет коллективным жизненным циклом конструкторов компонентов, включая массовые обновления и генерацию общих стилей.
17
- */
18
- export class DesignConstructors {
19
- /**
20
- * Constructor for DesignConstructors.
21
- *
22
- * Конструктор для DesignConstructors.
23
- * @param name optional specific component name to process / необязательное имя конкретного компонента для обработки
24
- */
25
- constructor(
26
- protected readonly name?: string
27
- ) {
28
- }
29
-
30
- /**
31
- * Starts the process of creating or updating constructors.
32
- *
33
- * Запускает процесс создания или обновления конструкторов.
34
- */
35
- make(): void {
36
- PropertiesCache.clear()
37
-
38
- if (isFilled(this.name)) {
39
- new DesignConstructor(this.name).make()
40
- } else {
41
- this.getComponents()
42
- .forEach((component) => {
43
- console.log(`Constructor update: ${component}`)
44
- new DesignConstructor(component).make()
45
- })
46
- }
47
-
48
- this.makeStyle()
49
- }
50
-
51
- /**
52
- * Returns a list of components.
53
- *
54
- * Возвращает список компонентов.
55
- */
56
- getComponents(): string[] {
57
- return PropertiesFile.readDir(this.getDir())
58
- }
59
-
60
- /**
61
- * Returns a list of component styles.
62
- *
63
- * Возвращает список стилей компонентов.
64
- */
65
- getComponentsStyle(): string[] {
66
- const list: string[] = []
67
-
68
- this.getComponents()
69
- .forEach((component) => {
70
- const name = toCamelCaseFirst(component)
71
- list.push(`@forward "../constructors/${name}/style";`)
72
- })
73
-
74
- return list
75
- }
76
-
77
- /**
78
- * Returns the directory path for constructors.
79
- *
80
- * Возвращает путь к директории конструкторов.
81
- */
82
- protected getDir(): string[] {
83
- return [
84
- PropertiesFile.getRoot(),
85
- UI_DIR_IN,
86
- UI_DIR_CONSTRUCTOR
87
- ]
88
- }
89
-
90
- /**
91
- * Generates a common style file.
92
- *
93
- * Генерирует общий файл стилей.
94
- */
95
- protected makeStyle(): void {
96
- const path: string[] = [...UI_DIRS_LIBRARY, UI_FILE_STYLE_SCSS]
97
- const styles = this.getComponentsStyle()
98
-
99
- PropertiesFile.writeByPath(path, styles.join('\r\n'))
100
- }
101
- }
@@ -1,61 +0,0 @@
1
- import { FigmaApi } from '../FigmaApi'
2
- import { PropertiesConfig } from '../Properties/PropertiesConfig.ts'
3
-
4
- /**
5
- * Class for downloading and processing design assets from Figma API.
6
- * Serves as an abstraction for initializing SVG graphics and frame exports from specified Figma files.
7
- *
8
- * Класс для скачивания и обработки дизайн-ассетов из Figma API.
9
- * Служит абстракцией для инициализации SVG-графики и экспорта кадров из указанных файлов Figma.
10
- */
11
- export class DesignFigma {
12
- /** Figma REST API client instance / Экземпляр клиента REST API Figma */
13
- protected readonly api: FigmaApi
14
-
15
- /**
16
- * Creates an instance of DesignFigma.
17
- *
18
- * Создает экземпляр DesignFigma.
19
- * @param fileKey unique Figma file identifier / уникальный идентификатор файла Figma
20
- * @param nodeId target node or frame identifier in Figma file / идентификатор целевого узла или кадра в файле Figma
21
- * @param token Figma API access token / токен доступа к API Figma
22
- */
23
- constructor(
24
- protected readonly fileKey: string,
25
- protected readonly nodeId?: string,
26
- protected readonly token: string = PropertiesConfig.getFigmaToken()
27
- ) {
28
- this.api = new FigmaApi(token, fileKey, nodeId)
29
- }
30
-
31
- /**
32
- * Executes the main workflow for retrieving and logging Figma design image assets.
33
- *
34
- * Выполняет основной процесс получения и логирования графических ассетов дизайна Figma.
35
- */
36
- async make(): Promise<void> {
37
- console.log('Design Figma', await this.initImage())
38
- }
39
-
40
- /**
41
- * Requests SVG image export URLs for the specified node from Figma API.
42
- *
43
- * Запрашивает URL-адреса экспорта SVG-изображений для указанного узла через API Figma.
44
- * @returns map of node IDs to SVG image URLs, or undefined on error / карта ID узлов к URL SVG-изображений или undefined в случае ошибки
45
- */
46
- async initImage(): Promise<Record<string, string> | undefined> {
47
- const image = await this.api.fileImages({
48
- ids: this.nodeId as string,
49
- format: 'svg',
50
- svg_outline_text: false,
51
- svg_include_id: true,
52
- svg_include_node_id: true
53
- })
54
-
55
- if (image?.err) {
56
- return undefined
57
- }
58
-
59
- return image?.images
60
- }
61
- }
@@ -1,215 +0,0 @@
1
- // export:none
2
-
3
- import { Canvas, createCanvas, loadImage, type SKRSContext2D } from '@napi-rs/canvas'
4
- import { PropertiesFile } from '../Properties/PropertiesFile'
5
-
6
- import type { DesignFlagsItem, DesignFlagsList } from '../../types/designTypes'
7
-
8
- import { UI_DIR_IN } from '../../config'
9
-
10
- const DESIGN_FLAGS_FACTOR = 2
11
- const DESIGN_FLAGS_MIME = 'image/webp'
12
- const DESIGN_FLAGS_FILE_NAME_ITEM = 'flags.webp'
13
- const DESIGN_FLAGS_FILE_NAME = [UI_DIR_IN, 'assets', DESIGN_FLAGS_FILE_NAME_ITEM]
14
- const DESIGN_FLAGS_FILE_PATH = ['.', '..', 'assets', DESIGN_FLAGS_FILE_NAME_ITEM]
15
- const DESIGN_FLAGS_FILE_STYLE_NAME = [UI_DIR_IN, 'styles', 'flags.css']
16
- const DESIGN_FLAGS_CLASS_NAME = '.ui-sys-flags'
17
-
18
- /**
19
- * Class for generating a sprite image and CSS mapping from a directory of flag icons.
20
- * It automates the creation of a combined webp image and a CSS file with specific background-position utility classes.
21
- *
22
- * Класс для генерации спрайта и CSS-маппинга из директории иконок флагов.
23
- * Автоматизирует создание комбинированного изображения webp и CSS-файла с утилитарными классами для позиционирования фона.
24
- */
25
- export class DesignFlags {
26
- protected list: string[]
27
- protected data: DesignFlagsList = []
28
-
29
- protected x: number = 0
30
- protected y: number = 0
31
-
32
- protected square: number
33
- protected top: number
34
- protected left: number
35
-
36
- protected readonly canvas: Canvas
37
- protected readonly context: SKRSContext2D
38
-
39
- /**
40
- * Constructor for DesignFlags.
41
- *
42
- * Конструктор для DesignFlags.
43
- * @param dir path to the directory containing SVG icons / путь к директории с SVG-иконками
44
- * @param width width of a single flag in the sprite / ширина одного флага в спрайте
45
- * @param height height of a single flag in the sprite / высота одного флага в спрайте
46
- * @param columns number of columns in the sprite grid / количество колонок в сетке спрайта
47
- */
48
- constructor(
49
- protected readonly dir: string = 'src/assets/flags',
50
- protected readonly width: number = 96,
51
- protected readonly height: number = 72,
52
- protected readonly columns: number = 12
53
- ) {
54
- this.list = this.initList()
55
- this.square = this.initSquare()
56
- this.top = this.initTop()
57
- this.left = this.initLeft()
58
-
59
- this.canvas = this.initCanvas()
60
- this.context = this.initContext()
61
- }
62
-
63
- async make() {
64
- for (const file of this.list) {
65
- await this.addImage(file)
66
-
67
- this.data.push(this.addData(file))
68
- this.next()
69
- }
70
-
71
- this.save()
72
- this.saveStyle()
73
- }
74
-
75
- getLines(): number {
76
- return Math.ceil(this.list.length / this.columns)
77
- }
78
-
79
- /**
80
- * Returns the maximum width of the canvas.
81
- *
82
- * Возвращает максимальную ширину холста.
83
- */
84
- protected getCanvasWidth(): number {
85
- return this.columns * this.square
86
- }
87
-
88
- /**
89
- * Returns the maximum height of the canvas.
90
- *
91
- * Возвращает максимальную высоту холста.
92
- */
93
- protected getCanvasHeight(): number {
94
- return this.getLines() * this.square
95
- }
96
-
97
- protected getDx() {
98
- return (this.x * this.square) + this.left
99
- }
100
-
101
- protected getDy() {
102
- return (this.y * this.square) + this.top
103
- }
104
-
105
- protected getStyle(): string {
106
- const backgroundSizeColumns = this.columns * (this.square / this.width)
107
- const backgroundSizeLines = this.getLines() * (this.square / this.height)
108
-
109
- let style: string = `
110
- ${DESIGN_FLAGS_CLASS_NAME} {
111
- --sys-flags-width: ${this.width}px;
112
- --sys-flags-height: ${this.height}px;
113
- --sys-flags-top: ${this.top}px;
114
- --sys-flags-left: ${this.left}px;
115
- --sys-flags-lines: ${this.getLines()};
116
-
117
- background-image: url("${DESIGN_FLAGS_FILE_PATH.join('/')}");
118
- background-size: calc(100% * ${backgroundSizeColumns}) calc(100% * ${backgroundSizeLines});
119
- }
120
- `.trim()
121
-
122
- const x = 100 / (this.getCanvasWidth() - this.width)
123
- const y = 100 / (this.getCanvasHeight() - this.height)
124
-
125
- this.data.forEach((item) => {
126
- style += `
127
- ${DESIGN_FLAGS_CLASS_NAME}--${item.name} {
128
- background-position: ${item.x * x}% ${item.y * y}%;
129
- }`
130
- })
131
-
132
- return style
133
- }
134
-
135
- protected async addImage(file: string): Promise<void> {
136
- const path = PropertiesFile.joinPath([this.dir, file])
137
- const image = await loadImage(path)
138
-
139
- this.context.drawImage(
140
- image,
141
- this.getDx(),
142
- this.getDy(),
143
- this.width,
144
- this.height
145
- )
146
- }
147
-
148
- protected addData(file: string): DesignFlagsItem {
149
- return {
150
- name: file.replace(/\.[^.]+$/, ''),
151
- x: this.getDx(),
152
- y: this.getDy()
153
- }
154
- }
155
-
156
- protected next(): void {
157
- this.x++
158
-
159
- if (this.x >= this.columns) {
160
- this.x = 0
161
- this.y++
162
- }
163
- }
164
-
165
- protected save(): void {
166
- const buffer = this.canvas.toBuffer(DESIGN_FLAGS_MIME, 64)
167
-
168
- if (buffer) {
169
- PropertiesFile.writeByPath(
170
- DESIGN_FLAGS_FILE_NAME,
171
- buffer,
172
- false
173
- )
174
- }
175
- }
176
-
177
- protected saveStyle(): void {
178
- PropertiesFile.writeByPath(
179
- DESIGN_FLAGS_FILE_STYLE_NAME,
180
- this.getStyle()
181
- )
182
- }
183
-
184
- protected initCanvas(): Canvas {
185
- return createCanvas(
186
- this.getCanvasWidth(),
187
- this.getCanvasHeight()
188
- )
189
- }
190
-
191
- protected initContext(): SKRSContext2D {
192
- return this.canvas.getContext('2d', { alpha: true })
193
- }
194
-
195
- protected initLeft(): number {
196
- return (this.square / 2) - (this.width / 2)
197
- }
198
-
199
- protected initList(): string[] {
200
- return PropertiesFile.readDir(this.dir)
201
- .filter(dir => dir.endsWith('.svg'))
202
- }
203
-
204
- protected initSquare(): number {
205
- if (this.width >= this.height) {
206
- return this.width * DESIGN_FLAGS_FACTOR
207
- }
208
-
209
- return this.height * DESIGN_FLAGS_FACTOR
210
- }
211
-
212
- protected initTop(): number {
213
- return (this.square / 2) - (this.height / 2)
214
- }
215
- }