@dxtmisha/scripts 0.6.3 → 0.7.6

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 (121) hide show
  1. package/bin/ai-doc.ts +1 -3
  2. package/bin/build-functional.ts +5 -0
  3. package/bin/design-flags.ts +5 -0
  4. package/bin/design-wiki-storm.ts +9 -0
  5. package/package.json +14 -8
  6. package/src/classes/Ai/AiAbstract.ts +14 -1
  7. package/src/classes/Ai/AiGoogleLite.ts +2 -1
  8. package/src/classes/Build/__tests__/buildFunctional.test.ts +43 -0
  9. package/src/classes/Build/buildFunctional.ts +54 -0
  10. package/src/classes/Component/ComponentCreator.ts +1 -0
  11. package/src/classes/Component/ComponentItem.ts +15 -0
  12. package/src/classes/Component/ComponentWiki.ts +8 -0
  13. package/src/classes/Component/ComponentWikiFile.ts +2 -0
  14. package/src/classes/Component/__tests__/ComponentCreator.test.ts +71 -0
  15. package/src/classes/Component/__tests__/ComponentItem.test.ts +71 -0
  16. package/src/classes/Design/DesignCommand.ts +65 -10
  17. package/src/classes/Design/DesignComponent.ts +303 -39
  18. package/src/classes/Design/DesignConstructor.ts +49 -20
  19. package/src/classes/Design/DesignConstructors.ts +61 -2
  20. package/src/classes/Design/DesignFlags.ts +215 -0
  21. package/src/classes/Design/DesignReplace.ts +11 -7
  22. package/src/classes/Design/DesignStructure.ts +8 -6
  23. package/src/classes/Design/DesignStructureClasses.ts +8 -4
  24. package/src/classes/Design/DesignStructureItemAbstract.ts +11 -2
  25. package/src/classes/Design/DesignStructureRead.ts +8 -4
  26. package/src/classes/Design/DesignStructureStyles.ts +8 -4
  27. package/src/classes/Design/DesignTypes.ts +53 -28
  28. package/src/classes/Design/DesignTypescript.ts +11 -2
  29. package/src/classes/Design/DesignUi.ts +74 -4
  30. package/src/classes/Design/DesignWiki.ts +4 -6
  31. package/src/classes/Design/DesignWikiStorm.ts +94 -0
  32. package/src/classes/Design/DesignWikiStormItem.ts +246 -0
  33. package/src/classes/Git/GitRead.ts +1 -0
  34. package/src/classes/Git/__tests__/GitRead.test.ts +70 -0
  35. package/src/classes/Library/LibraryAiWiki.ts +127 -0
  36. package/src/classes/Library/LibraryAiWikiItem.ts +79 -0
  37. package/src/classes/Library/LibraryExport.ts +0 -2
  38. package/src/classes/Library/LibraryFlags.ts +9 -7
  39. package/src/classes/Library/LibraryItems.ts +22 -13
  40. package/src/classes/Library/LibraryList.ts +189 -0
  41. package/src/classes/Library/LibraryMedia.ts +22 -8
  42. package/src/classes/Library/LibraryPlugin.ts +73 -0
  43. package/src/classes/Library/LibraryTypes.ts +130 -0
  44. package/src/classes/Package/PackageInit.ts +12 -4
  45. package/src/classes/Package/PackageItem.ts +16 -5
  46. package/src/classes/Properties/Properties.ts +14 -3
  47. package/src/classes/Properties/PropertiesCache.ts +19 -20
  48. package/src/classes/Properties/PropertiesConfig.ts +46 -26
  49. package/src/classes/Properties/PropertiesConvector.ts +10 -6
  50. package/src/classes/Properties/PropertiesFile.ts +27 -31
  51. package/src/classes/Properties/PropertiesImport.ts +10 -7
  52. package/src/classes/Properties/PropertiesItems.ts +19 -12
  53. package/src/classes/Properties/PropertiesKeys.ts +15 -9
  54. package/src/classes/Properties/PropertiesMain.ts +13 -7
  55. package/src/classes/Properties/PropertiesPalette.ts +12 -6
  56. package/src/classes/Properties/PropertiesPath.ts +17 -11
  57. package/src/classes/Properties/PropertiesScss.ts +10 -8
  58. package/src/classes/Properties/PropertiesSeparator.ts +9 -11
  59. package/src/classes/Properties/PropertiesSettings.ts +8 -6
  60. package/src/classes/Properties/PropertiesStandard.ts +5 -6
  61. package/src/classes/Properties/PropertiesTool.ts +16 -9
  62. package/src/classes/Properties/PropertiesTypes.ts +12 -12
  63. package/src/classes/Properties/PropertiesValues.ts +14 -14
  64. package/src/classes/Properties/PropertiesWrap.ts +5 -6
  65. package/src/classes/Properties/convector/convectorColor.ts +5 -3
  66. package/src/classes/Properties/to/PropertiesToAbstract.ts +18 -4
  67. package/src/classes/Styles/Styles.ts +1 -0
  68. package/src/composables/__tests__/useAi.test.ts +75 -0
  69. package/src/config.ts +9 -0
  70. package/src/functions/__tests__/getComponentPaths.test.ts +19 -0
  71. package/src/functions/__tests__/getConfigAi.test.ts +26 -0
  72. package/src/functions/__tests__/getConstructorProperties.test.ts +51 -0
  73. package/src/functions/__tests__/getDirname.test.ts +31 -0
  74. package/src/functions/__tests__/getNameDirByPaths.test.ts +40 -0
  75. package/src/functions/__tests__/getPackageJson.test.ts +34 -0
  76. package/src/functions/__tests__/hasNativeDirname.test.ts +18 -0
  77. package/src/functions/__tests__/toPathStandardSep.test.ts +31 -0
  78. package/src/functions/getConfigAi.ts +3 -2
  79. package/src/functions/toPathStandardSep.ts +1 -1
  80. package/src/library-ai.ts +0 -1
  81. package/src/library.ts +10 -0
  82. package/src/media/properties/css.ts +3 -1
  83. package/src/media/templates/component/{DesignComponentWikiAi.vue → DesignComponentAiWiki.vue} +2 -2
  84. package/src/media/templates/component/props.ts +2 -3
  85. package/src/media/templates/component/styleToken.scss +1 -1
  86. package/src/media/templates/component/wiki.ts +6 -12
  87. package/src/media/templates/component/wikiData.ts +28 -0
  88. package/src/media/templates/constructors/props.ts +3 -4
  89. package/src/media/templates/packages/figma/README.md +1 -0
  90. package/src/media/templates/packages/figma/ai.sample.config.ts +2 -0
  91. package/src/media/templates/packages/figma/design.config.json +3 -0
  92. package/src/media/templates/packages/figma/index.html +12 -0
  93. package/src/media/templates/packages/figma/manifest.json +25 -0
  94. package/src/media/templates/packages/figma/package.json +37 -0
  95. package/src/media/templates/packages/figma/src/App.vue +9 -0
  96. package/src/media/templates/packages/figma/src/classes/_.gitignore.txt +1 -0
  97. package/src/media/templates/packages/figma/src/code.ts +16 -0
  98. package/src/media/templates/packages/figma/src/components/_.gitignore.txt +1 -0
  99. package/src/media/templates/packages/figma/src/composables/_.gitignore.txt +1 -0
  100. package/src/media/templates/packages/figma/src/functions/_.gitignore.txt +1 -0
  101. package/src/media/templates/packages/figma/src/library.ts +0 -0
  102. package/src/media/templates/packages/figma/src/main.ts +4 -0
  103. package/src/media/templates/packages/figma/src/media/_.gitignore.txt +1 -0
  104. package/src/media/templates/packages/figma/src/storybook/_.gitignore.txt +1 -0
  105. package/src/media/templates/packages/figma/src/types/_.gitignore.txt +1 -0
  106. package/src/media/templates/packages/figma/src/vite-env.d.ts +1 -0
  107. package/src/media/templates/packages/figma/tsconfig.app.json +12 -0
  108. package/src/media/templates/packages/figma/tsconfig.json +7 -0
  109. package/src/media/templates/packages/figma/tsconfig.node.json +8 -0
  110. package/src/media/templates/packages/figma/vite.config.ts +7 -0
  111. package/src/media/templates/packages/library/src/main.ts +1 -1
  112. package/src/media/templates/packages/project/design.config.json +3 -0
  113. package/src/media/templates/packages/project/index.html +1 -2
  114. package/src/media/templates/packages/project/public/_.gitignore.txt +0 -0
  115. package/src/media/templates/packages/project/src/main.ts +2 -1
  116. package/src/media/templates/packages/project/src/vite-env.d.ts +1 -0
  117. package/src/types/configTypes.ts +6 -0
  118. package/src/types/designTypes.ts +12 -0
  119. package/src/types/libraryTypes.ts +1 -1
  120. package/src/types/webTypes.ts +105 -0
  121. /package/src/media/templates/packages/{library/public/_.gitignore.txt → figma/src/config.ts} +0 -0
@@ -0,0 +1,19 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { getComponentPaths } from '../getComponentPaths'
3
+ import { UI_DIRS_COMPONENTS } from '../../config'
4
+
5
+ describe('getComponentPaths', () => {
6
+ it('should return an array containing UI_DIRS_COMPONENTS and the given path', () => {
7
+ const path = 'test-component'
8
+ const result = getComponentPaths(path)
9
+
10
+ expect(result).toEqual([...UI_DIRS_COMPONENTS, path])
11
+ })
12
+
13
+ it('it should work with nested paths', () => {
14
+ const path = 'nested/test-component'
15
+ const result = getComponentPaths(path)
16
+
17
+ expect(result).toEqual([...UI_DIRS_COMPONENTS, path])
18
+ })
19
+ })
@@ -0,0 +1,26 @@
1
+ import { describe, expect, it, vi } from 'vitest'
2
+ import { getConfigAi } from '../getConfigAi'
3
+ import { PropertiesConfig } from '../../classes/Properties/PropertiesConfig'
4
+
5
+ vi.mock('../../classes/Properties/PropertiesConfig', () => ({
6
+ PropertiesConfig: {
7
+ getAiKey: vi.fn(),
8
+ getAiModel: vi.fn()
9
+ }
10
+ }))
11
+
12
+ describe('getConfigAi', () => {
13
+ it('should return AI key and model from PropertiesConfig', () => {
14
+ const mockKey = 'test-key'
15
+ const mockModel = 'test-model'
16
+
17
+ vi.mocked(PropertiesConfig.getAiKey).mockReturnValue(mockKey)
18
+ vi.mocked(PropertiesConfig.getAiModel).mockReturnValue(mockModel)
19
+
20
+ const result = getConfigAi()
21
+
22
+ expect(result).toEqual([mockKey, mockModel])
23
+ expect(PropertiesConfig.getAiKey).toHaveBeenCalled()
24
+ expect(PropertiesConfig.getAiModel).toHaveBeenCalled()
25
+ })
26
+ })
@@ -0,0 +1,51 @@
1
+ import { describe, expect, it, vi, beforeEach } from 'vitest'
2
+ import { getConstructorProperties } from '../getConstructorProperties'
3
+ import { PropertiesFile } from '../../classes/Properties/PropertiesFile'
4
+ import { hasNativeDirname } from '../hasNativeDirname'
5
+
6
+ vi.mock('../../classes/Properties/PropertiesFile', () => ({
7
+ PropertiesFile: {
8
+ readFile: vi.fn()
9
+ }
10
+ }))
11
+
12
+ vi.mock('../hasNativeDirname', () => ({
13
+ hasNativeDirname: vi.fn()
14
+ }))
15
+
16
+ describe('getConstructorProperties', () => {
17
+ beforeEach(() => {
18
+ vi.clearAllMocks()
19
+ })
20
+
21
+ it('should return properties for given constructor names', () => {
22
+ const mockItem = { some: 'property' }
23
+ vi.mocked(hasNativeDirname).mockReturnValue(true)
24
+ vi.mocked(PropertiesFile.readFile).mockReturnValue(mockItem)
25
+
26
+ const result = getConstructorProperties(['Button', 'Input'])
27
+
28
+ expect(result).toEqual({
29
+ Button: mockItem,
30
+ Input: mockItem
31
+ })
32
+ expect(PropertiesFile.readFile).toHaveBeenCalledTimes(2)
33
+ })
34
+
35
+ it('should return an empty object if no constructors found or error occurs', () => {
36
+ vi.mocked(hasNativeDirname).mockReturnValue(true)
37
+ vi.mocked(PropertiesFile.readFile).mockReturnValue(undefined)
38
+
39
+ const result = getConstructorProperties(['NonExistent'])
40
+
41
+ expect(result).toEqual({})
42
+ })
43
+
44
+ it('should handles non-native dirname environment', () => {
45
+ vi.mocked(hasNativeDirname).mockReturnValue(false)
46
+ vi.mocked(PropertiesFile.readFile).mockReturnValue({ status: 'ok' })
47
+
48
+ const result = getConstructorProperties(['Button'])
49
+ expect(result).toEqual({ Button: { status: 'ok' } })
50
+ })
51
+ })
@@ -0,0 +1,31 @@
1
+ import { describe, expect, it, vi, beforeEach } from 'vitest'
2
+ import { getDirname } from '../getDirname'
3
+ import { hasNativeDirname } from '../hasNativeDirname'
4
+
5
+ vi.mock('../hasNativeDirname', () => ({
6
+ hasNativeDirname: vi.fn()
7
+ }))
8
+
9
+ // We can't easily mock import.meta.url or __dirname globally in a way that affects the module internally without ESM tricks,
10
+ // but we can at least test that it calls the right path based on hasNativeDirname
11
+ describe('getDirname', () => {
12
+ beforeEach(() => {
13
+ vi.clearAllMocks()
14
+ })
15
+
16
+ it('should return __dirname when hasNativeDirname is true', () => {
17
+ vi.mocked(hasNativeDirname).mockReturnValue(true)
18
+
19
+ // In a vitest environment with native support, __dirname should be defined
20
+ // We expect it to not throw and return a string
21
+ const result = getDirname()
22
+ expect(typeof result).toBe('string')
23
+ })
24
+
25
+ it('should return a path via fileURLToPath when hasNativeDirname is false', () => {
26
+ vi.mocked(hasNativeDirname).mockReturnValue(false)
27
+
28
+ const result = getDirname()
29
+ expect(typeof result).toBe('string')
30
+ })
31
+ })
@@ -0,0 +1,40 @@
1
+ import { describe, expect, it, vi, beforeEach } from 'vitest'
2
+ import { getNameDirByPaths } from '../getNameDirByPaths'
3
+ import { PropertiesFile } from '../../classes/Properties/PropertiesFile'
4
+
5
+ vi.mock('../../classes/Properties/PropertiesFile', () => ({
6
+ PropertiesFile: {
7
+ splitForDir: vi.fn(),
8
+ joinPath: vi.fn()
9
+ }
10
+ }))
11
+
12
+ describe('getNameDirByPaths', () => {
13
+ beforeEach(() => {
14
+ vi.clearAllMocks()
15
+ })
16
+
17
+ it('should return the last directory name from provided paths', () => {
18
+ const mockPaths = ['src', 'components', 'button']
19
+ const mockJoinedPath = 'src/components/button'
20
+ const mockSplitDirs = ['src', 'components', 'button']
21
+
22
+ vi.mocked(PropertiesFile.joinPath).mockReturnValue(mockJoinedPath)
23
+ vi.mocked(PropertiesFile.splitForDir).mockReturnValue(mockSplitDirs)
24
+
25
+ const result = getNameDirByPaths(mockPaths)
26
+
27
+ expect(result).toBe('button')
28
+ expect(PropertiesFile.joinPath).toHaveBeenCalledWith(mockPaths)
29
+ expect(PropertiesFile.splitForDir).toHaveBeenCalledWith(mockJoinedPath)
30
+ })
31
+
32
+ it('should work with a single path segment', () => {
33
+ const mockPaths = ['root']
34
+ vi.mocked(PropertiesFile.joinPath).mockReturnValue('root')
35
+ vi.mocked(PropertiesFile.splitForDir).mockReturnValue(['root'])
36
+
37
+ const result = getNameDirByPaths(mockPaths)
38
+ expect(result).toBe('root')
39
+ })
40
+ })
@@ -0,0 +1,34 @@
1
+ import { describe, expect, it, vi, beforeEach } from 'vitest'
2
+ import { getPackageJson } from '../getPackageJson'
3
+ import { PropertiesFile } from '../../classes/Properties/PropertiesFile'
4
+ import { UI_FILE_PACKAGE } from '../../config'
5
+
6
+ vi.mock('../../classes/Properties/PropertiesFile', () => ({
7
+ PropertiesFile: {
8
+ readFile: vi.fn()
9
+ }
10
+ }))
11
+
12
+ describe('getPackageJson', () => {
13
+ beforeEach(() => {
14
+ vi.clearAllMocks()
15
+ })
16
+
17
+ it('should return package.json content via PropertiesFile.readFile', () => {
18
+ const mockContent = { name: 'test-package', version: '1.0.0' }
19
+ vi.mocked(PropertiesFile.readFile).mockReturnValue(mockContent)
20
+
21
+ const result = getPackageJson()
22
+
23
+ expect(result).toEqual(mockContent)
24
+ expect(PropertiesFile.readFile).toHaveBeenCalledWith(UI_FILE_PACKAGE)
25
+ })
26
+
27
+ it('should return undefined if file reading fails', () => {
28
+ vi.mocked(PropertiesFile.readFile).mockReturnValue(undefined)
29
+
30
+ const result = getPackageJson()
31
+
32
+ expect(result).toBeUndefined()
33
+ })
34
+ })
@@ -0,0 +1,18 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { hasNativeDirname } from '../hasNativeDirname'
3
+
4
+ describe('hasNativeDirname', () => {
5
+ it('should return a boolean', () => {
6
+ const result = hasNativeDirname()
7
+ expect(typeof result).toBe('boolean')
8
+ })
9
+
10
+ it('it should return true if __dirname is defined', () => {
11
+ // In vitest/node environment, __dirname is usually defined
12
+ // We can't easily "un-define" it for a negative test without complex environment manipulation,
13
+ // but we can verify it returns true if it's there
14
+ if (typeof __dirname !== 'undefined') {
15
+ expect(hasNativeDirname()).toBe(true)
16
+ }
17
+ })
18
+ })
@@ -0,0 +1,31 @@
1
+ import { describe, expect, it, vi, beforeEach } from 'vitest'
2
+ import { toPathStandardSep } from '../toPathStandardSep'
3
+ import requirePath from 'path'
4
+
5
+ vi.mock('path', async (importOriginal) => {
6
+ const actual = await importOriginal<typeof import('path')>()
7
+ return {
8
+ ...actual,
9
+ default: {
10
+ ...actual,
11
+ sep: '/'
12
+ }
13
+ }
14
+ })
15
+
16
+ describe('toPathStandardSep', () => {
17
+ beforeEach(() => {
18
+ vi.clearAllMocks()
19
+ vi.mocked(requirePath).sep = '/'
20
+ })
21
+
22
+ it('should replace all forward slashes with the platform-specific separator', () => {
23
+ vi.mocked(requirePath).sep = '\\'
24
+ expect(toPathStandardSep('src/components/button')).toBe('src\\components\\button')
25
+ })
26
+
27
+ it('should not change the path if it already uses the correct separator (unix)', () => {
28
+ vi.mocked(requirePath).sep = '/'
29
+ expect(toPathStandardSep('src/components/button')).toBe('src/components/button')
30
+ })
31
+ })
@@ -5,9 +5,10 @@ import { PropertiesConfig } from '../classes/Properties/PropertiesConfig'
5
5
  *
6
6
  * Возвращает конфигурацию ИИ: API ключ и модель.
7
7
  */
8
- export function getConfigAi(): [string, string] {
8
+ export function getConfigAi(): [string, string, Record<string, any>] {
9
9
  return [
10
10
  PropertiesConfig.getAiKey(),
11
- PropertiesConfig.getAiModel()
11
+ PropertiesConfig.getAiModel(),
12
+ PropertiesConfig.getAiConfig()
12
13
  ]
13
14
  }
@@ -10,5 +10,5 @@ import requirePath from 'path'
10
10
  * @returns The path with standard separators/ Путь со стандартными разделителями
11
11
  */
12
12
  export function toPathStandardSep(path: string): string {
13
- return path.replace('/', requirePath.sep)
13
+ return path.replace(/\//g, requirePath.sep)
14
14
  }
package/src/library-ai.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  // Classes
2
2
  export * from './classes/Ai/AiAbstract'
3
3
  export * from './classes/Ai/AiGoogleLite'
4
- export * from './classes/Ai/AiGoogleCliLite'
package/src/library.ts CHANGED
@@ -10,10 +10,19 @@ export * from './classes/Ai/AiGoogle'
10
10
  export * from './classes/Ai/AiGoogleCli'
11
11
  export * from './classes/Ai/AiGoogleCliLite'
12
12
  export * from './classes/Ai/AiGoogleLite'
13
+ export * from './classes/Build/buildFunctional'
13
14
  export * from './classes/BuildItem'
14
15
  export * from './classes/Design/DesignTypes'
15
16
  export * from './classes/Design/DesignTypescript'
17
+ export * from './classes/Design/DesignWikiStorm'
18
+ export * from './classes/Design/DesignWikiStormItem'
16
19
  export * from './classes/Git/GitRead'
20
+ export * from './classes/Library/LibraryAiWiki'
21
+ export * from './classes/Library/LibraryAiWikiItem'
22
+ export * from './classes/Library/LibraryExport'
23
+ export * from './classes/Library/LibraryList'
24
+ export * from './classes/Library/LibraryPlugin'
25
+ export * from './classes/Library/LibraryTypes'
17
26
  export * from './classes/Properties/PropertiesFile'
18
27
 
19
28
  // Composables
@@ -32,3 +41,4 @@ export * from './types/designTypes'
32
41
  export * from './types/gitTypes'
33
42
  export * from './types/libraryTypes'
34
43
  export * from './types/propertyTypes'
44
+ export * from './types/webTypes'
@@ -159,7 +159,9 @@ export const cssSizing: string[] = [
159
159
  'min-inline-size',
160
160
  'max-inline-size',
161
161
 
162
- 'tab-size' // используется для настройки ширины символа табуляции
162
+ 'tab-size', // используется для настройки ширины символа табуляции
163
+
164
+ 'field-sizing'
163
165
  ]
164
166
 
165
167
  export const cssContent: string[] = [
@@ -7,14 +7,14 @@
7
7
  // :component-import [!] System label / Системная метка
8
8
 
9
9
  defineOptions({
10
- name: 'DesignComponentWikiAi'
10
+ name: 'DesignComponentAiWiki'
11
11
  })
12
12
  </script>
13
13
 
14
14
  <!-- :component.once <template> -->
15
15
  <!-- :component.once <DxtTestWiki -->
16
16
  <!-- :component.once design="Design" -->
17
- <!-- :component.once :wiki="ImageWikiStorybook" -->
17
+ <!-- :component.once :wiki="ComponentWikiStorybook" -->
18
18
  <!-- :component.once :component="DesignComponent" -->
19
19
  <!-- :component.once > -->
20
20
  <!-- :component-render [!] System label / Системная метка -->
@@ -5,7 +5,7 @@ export const propsValues = {
5
5
  // :values [!] System label / Системная метка
6
6
  }
7
7
 
8
- interface PropsToken {
8
+ type PropsToken = {
9
9
  // :type [!] System label / Системная метка
10
10
  // :type [!] System label / Системная метка
11
11
  }
@@ -13,8 +13,7 @@ interface PropsToken {
13
13
  /**
14
14
  * Type describing incoming properties/ Тип, описывающий входящие свойства
15
15
  */
16
- export interface ComponentProps extends/* :component.once ComponentPropsBasic, */ PropsToken {
17
- }
16
+ export type ComponentProps = /* :component.once ComponentPropsBasic & */ PropsToken
18
17
 
19
18
  /**
20
19
  * Default value for property/ Значение по умолчанию для свойства
@@ -1,6 +1,6 @@
1
1
  // :component.once @use "../../../styles/[project]/properties";
2
2
  @use "@dxtmisha/styles/properties" as ui;
3
- // :component.once @use "@dxtmisha/constructor/Component/style" as Component;
3
+ // :component.once @use "@dxtmisha/constructor/style.scss" as Component;
4
4
 
5
5
  @include ui.initDesignBasic('[design].[component]') {
6
6
  // Basic styles for a component
@@ -1,19 +1,13 @@
1
- // :component.once import { type StorybookProps, WikiStorybook } from '@dxtmisha/wiki'
1
+ // :component.once import { WikiStorybook } from '@dxtmisha/wiki'
2
2
  // :component.once import { wiki, wikiDescriptions } from '@dxtmisha/wiki/media'
3
3
 
4
- // :component.once import { wiki[Design] } from '../../../wiki/wiki'
5
- // :component.once import { defaults } from './props'
6
-
7
- // :component.once const propsNames: StorybookProps = [
8
- // :component.once // :propsList [!] System label / Системная метка
9
- // :component.once // :propsList [!] System label / Системная метка
10
- // :component.once ]
4
+ // :component.once import { ComponentWikiData } from './wikiData'
11
5
 
12
6
  // :component.once export const ComponentWikiStorybook = new WikiStorybook(
13
- // :component.once 'Component',
14
- // :component.once propsNames,
15
- // :component.once defaults,
16
- // :component.once wiki[Design],
7
+ // :component.once ComponentWikiData.component,
8
+ // :component.once ComponentWikiData.props,
9
+ // :component.once ComponentWikiData.defaults,
10
+ // :component.once ComponentWikiData.wikiDesign,
17
11
  // :component.once wiki,
18
12
  // :component.once wikiDescriptions
19
13
  // :component.once )
@@ -0,0 +1,28 @@
1
+ // :component.once import { type StorybookProps, type StorybookSlots, type WikiDataItem } from '@dxtmisha/wiki'
2
+
3
+ // :component.once import { wiki[Design] } from '../../../wiki/wiki'
4
+ // :component.once import { defaults } from './props'
5
+
6
+ // :component.once const propsNames: StorybookProps = [
7
+ // :component.once // :propsList [!] System label / Системная метка
8
+ // :component.once // :propsList [!] System label / Системная метка
9
+ // :component.once ]
10
+
11
+ // :component.once const slotsNames: StorybookSlots = [
12
+ // :component.once // :slotsList [!] System label / Системная метка
13
+ // :component.once // :slotsList [!] System label / Системная метка
14
+ // :component.once ]
15
+
16
+ // :component.once const eventsNames: StorybookSlots = [
17
+ // :component.once // :eventsList [!] System label / Системная метка
18
+ // :component.once // :eventsList [!] System label / Системная метка
19
+ // :component.once ]
20
+
21
+ // :component.once export const ComponentWikiData: WikiDataItem = {
22
+ // :component.once component: 'Component',
23
+ // :component.once props: propsNames,
24
+ // :component.once slots: slotsNames,
25
+ // :component.once events: eventsNames,
26
+ // :component.once defaults,
27
+ // :component.once wikiDesign: wiki[Design]
28
+ // :component.once }
@@ -1,9 +1,9 @@
1
- interface ConstructorsPropsToken {
1
+ type ConstructorsPropsToken = {
2
2
  // :type [!] System label / Системная метка
3
3
  // :type [!] System label / Системная метка
4
4
  }
5
5
 
6
- export interface ConstructorsPropsBasic {
6
+ export type ConstructorsPropsBasic = {
7
7
  // TODO: Location for a custom property / Место для пользовательского свойства
8
8
  }
9
9
 
@@ -12,8 +12,7 @@ export interface ConstructorsPropsBasic {
12
12
  *
13
13
  * Тип, описывающий входящие свойства.
14
14
  */
15
- export interface ConstructorsProps extends ConstructorsPropsBasic, ConstructorsPropsToken {
16
- }
15
+ export type ConstructorsProps = ConstructorsPropsBasic & ConstructorsPropsToken
17
16
 
18
17
  /**
19
18
  * Default value for property.
@@ -0,0 +1 @@
1
+ # @packages/library
@@ -0,0 +1,2 @@
1
+ export const FIGMA_AI_KEY = ''
2
+ export const FIGMA_AI_MODEL = ''
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../design.config.json"
3
+ }
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8"/>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6
+ <title>@packages/library</title>
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.ts"></script>
11
+ </body>
12
+ </html>
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@packages/library",
3
+ "id": "--",
4
+ "api": "0.0.0",
5
+ "main": "dist/code.js",
6
+ "capabilities": [
7
+ "codegen",
8
+ "inspect"
9
+ ],
10
+ "enableProposedApi": false,
11
+ "documentAccess": "dynamic-page",
12
+ "editorType": [
13
+ "dev"
14
+ ],
15
+ "ui": "dist/index.html",
16
+ "codegenLanguages": [
17
+ {
18
+ "label": "Language Label",
19
+ "value": "language-value"
20
+ }
21
+ ],
22
+ "networkAccess": {
23
+ "allowedDomains": []
24
+ }
25
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@packages/library",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "description": "[description]",
7
+ "scripts": {
8
+ "dev": "vite",
9
+ "build": "vue-tsc -b && vite build --mode ui && vite build --mode code",
10
+ "build:ui:watch": "vue-tsc -b && vite build --mode ui --watch",
11
+ "build:code:watch": "vue-tsc -b && vite build --mode code --watch",
12
+ "preview": "vite preview",
13
+ "test": "vitest",
14
+ "component": "dxt-component",
15
+ "library": "dxt-library",
16
+ "wiki": "dxt-ai-doc src/storybook"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "package.json"
22
+ ],
23
+ "main": "dist/library.js",
24
+ "module": "dist/library.js",
25
+ "types": "dist/library.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "import": "./dist/library.js",
29
+ "types": "./dist/library.d.ts"
30
+ },
31
+ "./style.css": "./dist/style.css",
32
+ "./types/*": "./dist/*",
33
+ "./types/**/*.d.ts": "./dist/**/*.d.ts"
34
+ },
35
+ "dependencies": {},
36
+ "devDependencies": {}
37
+ }
@@ -0,0 +1,9 @@
1
+ <script setup lang="ts">
2
+
3
+ </script>
4
+
5
+ <template>
6
+ <div>@packages/library</div>
7
+ </template>
8
+
9
+ <style lang="scss"></style>
@@ -0,0 +1,16 @@
1
+ switch (figma.mode) {
2
+ case 'inspect':
3
+ figma.showUI(__html__)
4
+ break
5
+ case 'codegen':
6
+ figma.codegen.on('generate', async () => {
7
+ return [
8
+ {
9
+ title: 'Test generate',
10
+ language: 'PLAINTEXT',
11
+ code: 'code test'
12
+ }
13
+ ]
14
+ })
15
+ break
16
+ }
@@ -0,0 +1,4 @@
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+
4
+ createApp(App).mount('#app')
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "@dxtmisha/configuration/tsconfig/tsconfig.app.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "types": ["@figma/plugin-typings"]
6
+ },
7
+ "include": [
8
+ "src/**/*.ts",
9
+ "src/**/*.tsx",
10
+ "src/**/*.vue"
11
+ ]
12
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "@dxtmisha/configuration/tsconfig/tsconfig.node.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
+ "types": ["@figma/plugin-typings"]
6
+ },
7
+ "include": ["vite.config.ts"]
8
+ }
@@ -0,0 +1,7 @@
1
+ import { viteFigma } from '@dxtmisha/configuration/viteFigma'
2
+
3
+ // https://vite.dev/config/
4
+ export default viteFigma(
5
+ process.argv.includes('--watch'),
6
+ __dirname
7
+ )