@dxtmisha/scripts 0.6.3 → 0.7.2
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/bin/ai-doc.ts +1 -3
- package/bin/build-functional.ts +5 -0
- package/bin/design-flags.ts +5 -0
- package/package.json +10 -6
- package/src/classes/Build/buildFunctional.ts +39 -0
- package/src/classes/Design/DesignCommand.ts +52 -2
- package/src/classes/Design/DesignComponent.ts +73 -16
- package/src/classes/Design/DesignConstructor.ts +40 -15
- package/src/classes/Design/DesignConstructors.ts +57 -2
- package/src/classes/Design/DesignFlags.ts +199 -0
- package/src/classes/Design/DesignReplace.ts +1 -1
- package/src/classes/Design/DesignUi.ts +41 -2
- package/src/classes/Library/LibraryAiWiki.ts +126 -0
- package/src/classes/Library/LibraryAiWikiItem.ts +79 -0
- package/src/classes/Library/LibraryExport.ts +0 -2
- package/src/classes/Library/LibraryItems.ts +13 -4
- package/src/classes/Library/LibraryList.ts +184 -0
- package/src/classes/Library/LibraryMedia.ts +1 -2
- package/src/classes/Library/LibraryPlugin.ts +70 -0
- package/src/classes/Library/LibraryTypes.ts +106 -0
- package/src/classes/Package/PackageItem.ts +3 -1
- package/src/classes/Properties/PropertiesConfig.ts +9 -0
- package/src/classes/Properties/PropertiesFile.ts +5 -3
- package/src/classes/Styles/Styles.ts +1 -0
- package/src/config.ts +7 -0
- package/src/library.ts +4 -0
- package/src/media/templates/component/{DesignComponentWikiAi.vue → DesignComponentAiWiki.vue} +2 -2
- package/src/media/templates/component/props.ts +2 -3
- package/src/media/templates/component/styleToken.scss +1 -1
- package/src/media/templates/constructors/props.ts +3 -4
- package/src/media/templates/packages/library/src/main.ts +1 -1
- package/src/media/templates/packages/project/design.config.json +3 -0
- package/src/media/templates/packages/project/index.html +1 -2
- package/src/media/templates/packages/project/src/main.ts +2 -1
- package/src/media/templates/packages/project/src/vite-env.d.ts +1 -0
- package/src/types/configTypes.ts +3 -0
- package/src/types/designTypes.ts +12 -0
- package/src/types/libraryTypes.ts +1 -1
- /package/src/media/templates/packages/{library → project}/public/_.gitignore.txt +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { LibraryItems } from './LibraryItems'
|
|
2
|
+
|
|
3
|
+
import { forEach, toCamelCase, toKebabCase, uniqueArray } from '@dxtmisha/functional-basic'
|
|
4
|
+
import { getPackageJson } from '../../functions/getPackageJson'
|
|
5
|
+
|
|
6
|
+
import { PropertiesConfig } from '../Properties/PropertiesConfig'
|
|
7
|
+
import { PropertiesFile } from '../Properties/PropertiesFile'
|
|
8
|
+
|
|
9
|
+
import { UI_DIRS_STYLES, UI_FILE_NAME_DESIGN } from '../../config'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Class for creating a file with a list of components.
|
|
13
|
+
*
|
|
14
|
+
* Класс для создания файла со списком компонентов.
|
|
15
|
+
*/
|
|
16
|
+
export class LibraryList {
|
|
17
|
+
protected readonly packageName: string
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Constructor
|
|
21
|
+
* @param items object for working with the list of components / объект для работы со списком компонентов
|
|
22
|
+
*/
|
|
23
|
+
constructor(
|
|
24
|
+
protected readonly items: LibraryItems
|
|
25
|
+
) {
|
|
26
|
+
this.packageName = getPackageJson()?.name
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Creates files with a list of components.
|
|
31
|
+
*
|
|
32
|
+
* Создает файлы со списком компонентов.
|
|
33
|
+
*/
|
|
34
|
+
make(): this {
|
|
35
|
+
const list = this.getComponents()
|
|
36
|
+
const listReg = this.getComponentsReg()
|
|
37
|
+
|
|
38
|
+
this.items.write(
|
|
39
|
+
UI_FILE_NAME_DESIGN,
|
|
40
|
+
[
|
|
41
|
+
'import type { PluginComponentImports } from \'@dxtmisha/constructor/plugin\'',
|
|
42
|
+
'',
|
|
43
|
+
`// count: ${this.items.getCount()}`,
|
|
44
|
+
`export const designName: string = '${PropertiesConfig.getDesignName()}'`,
|
|
45
|
+
`export const packageName: string = '${this.packageName}'`,
|
|
46
|
+
`export const componentsReg: RegExp = ${listReg}`,
|
|
47
|
+
`export const styleVarsReg: RegExp = ${this.getVarsReg()}`,
|
|
48
|
+
'',
|
|
49
|
+
'export const componentsList: PluginComponentImports = [',
|
|
50
|
+
list.join(',\r\n'),
|
|
51
|
+
']'
|
|
52
|
+
]
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
return this
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns a list of components for the file.
|
|
60
|
+
*
|
|
61
|
+
* Возвращает список компонентов для файла.
|
|
62
|
+
*/
|
|
63
|
+
protected getComponents(): string[] {
|
|
64
|
+
const list: string[] = []
|
|
65
|
+
|
|
66
|
+
if (this.packageName) {
|
|
67
|
+
forEach(
|
|
68
|
+
this.items.getComponentList(),
|
|
69
|
+
(item) => {
|
|
70
|
+
list.push(` {
|
|
71
|
+
name: '${item.codeFull}',
|
|
72
|
+
reg: ${this.getReg([item.name], true)}
|
|
73
|
+
}`
|
|
74
|
+
)
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return list
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Returns a regular expression for all components.
|
|
83
|
+
*
|
|
84
|
+
* Возвращает регулярное выражение для всех компонентов.
|
|
85
|
+
*/
|
|
86
|
+
protected getComponentsReg(): string {
|
|
87
|
+
const names: string[] = forEach(
|
|
88
|
+
this.items.getComponentList(),
|
|
89
|
+
item => item.name
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return this.getReg(names)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Returns a list of design names.
|
|
97
|
+
*
|
|
98
|
+
* Возвращает список названий дизайнов.
|
|
99
|
+
*/
|
|
100
|
+
protected getDesigns(): string[] {
|
|
101
|
+
return [
|
|
102
|
+
PropertiesConfig.getDesignName(),
|
|
103
|
+
...(PropertiesConfig.getDesignAlternativeName() ?? [])
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Generates a regular expression for the list of names.
|
|
109
|
+
*
|
|
110
|
+
* Генерирует регулярное выражение для списка имен.
|
|
111
|
+
* @param names list of names / список имен
|
|
112
|
+
* @param only exact match / точное совпадение
|
|
113
|
+
*/
|
|
114
|
+
protected getReg(
|
|
115
|
+
names: string[],
|
|
116
|
+
only: boolean = false
|
|
117
|
+
): string {
|
|
118
|
+
const designs = this.getDesigns().join('|')
|
|
119
|
+
const namesReg = this.getRegName(names)
|
|
120
|
+
let code = `((${designs})-?(${namesReg}))`
|
|
121
|
+
|
|
122
|
+
if (only) {
|
|
123
|
+
code = `^${code}$`
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return `/${code}/ig`
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Formats names for regular expression.
|
|
131
|
+
*
|
|
132
|
+
* Форматирует имена для регулярного выражения.
|
|
133
|
+
* @param names list of names / список имен
|
|
134
|
+
*/
|
|
135
|
+
protected getRegName(names: string[]): string {
|
|
136
|
+
return forEach(
|
|
137
|
+
names,
|
|
138
|
+
name => toKebabCase(name)
|
|
139
|
+
.replace('-', '-?')
|
|
140
|
+
).join('|')
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Returns a list of CSS variables.
|
|
145
|
+
*
|
|
146
|
+
* Возвращает список CSS переменных.
|
|
147
|
+
*/
|
|
148
|
+
protected getVars(): string[] {
|
|
149
|
+
const design: string = toCamelCase(PropertiesConfig.getDesignName())
|
|
150
|
+
const path = [...UI_DIRS_STYLES, PropertiesConfig.getProjectName(), 'vars.scss']
|
|
151
|
+
const context = PropertiesFile.readFileOnly(path)
|
|
152
|
+
const data: string[] = []
|
|
153
|
+
|
|
154
|
+
if (context) {
|
|
155
|
+
const vars = context.match(/(?<=--)[^: ]+(?=:)/g)
|
|
156
|
+
|
|
157
|
+
if (vars) {
|
|
158
|
+
vars.forEach((varName) => {
|
|
159
|
+
const value = varName.match(/^([^-]+)-(.*?)$/)
|
|
160
|
+
|
|
161
|
+
if (
|
|
162
|
+
value
|
|
163
|
+
&& value?.[1] === design
|
|
164
|
+
&& value?.[2]
|
|
165
|
+
) {
|
|
166
|
+
const varName = value[2].split('-')
|
|
167
|
+
|
|
168
|
+
if (varName.length > 2) {
|
|
169
|
+
varName.pop()
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
data.push(varName.join('-'))
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return uniqueArray(data)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
protected getVarsReg(): string {
|
|
182
|
+
return `/(?<=var\\(--)(${this.getVars().join('|')})/ig`
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -20,7 +20,6 @@ export class LibraryMedia {
|
|
|
20
20
|
* Constructor
|
|
21
21
|
* @param items object for working with the list of components/ объект для работы со списком компонентов
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
23
|
constructor(
|
|
25
24
|
protected readonly items: LibraryItems
|
|
26
25
|
) {
|
|
@@ -117,7 +116,7 @@ export class LibraryMedia {
|
|
|
117
116
|
const data: string[] = []
|
|
118
117
|
|
|
119
118
|
this.getIconImport().forEach((item) => {
|
|
120
|
-
data.push(`
|
|
119
|
+
data.push(`const ${item.name} = async () => (await import('${item.path}'))?.default`)
|
|
121
120
|
})
|
|
122
121
|
|
|
123
122
|
return data
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { toCamelCaseFirst, toKebabCase } from '@dxtmisha/functional-basic'
|
|
2
|
+
|
|
3
|
+
import { PropertiesConfig } from '../Properties/PropertiesConfig'
|
|
4
|
+
import { LibraryItems } from './LibraryItems'
|
|
5
|
+
|
|
6
|
+
import { UI_FILE_NAME_PLUGIN } from '../../config'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Class for creating a plugin file.
|
|
10
|
+
*
|
|
11
|
+
* Класс для создания файла плагина.
|
|
12
|
+
*/
|
|
13
|
+
export class LibraryPlugin {
|
|
14
|
+
/**
|
|
15
|
+
* Constructor
|
|
16
|
+
* @param items object for working with the list of components / объект для работы со списком компонентов
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
protected readonly items: LibraryItems
|
|
20
|
+
) {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Creates a plugin file.
|
|
25
|
+
*
|
|
26
|
+
* Создает файл плагина.
|
|
27
|
+
*/
|
|
28
|
+
make(): this {
|
|
29
|
+
const design = PropertiesConfig.getDesignName()
|
|
30
|
+
|
|
31
|
+
this.items.write(
|
|
32
|
+
UI_FILE_NAME_PLUGIN,
|
|
33
|
+
[
|
|
34
|
+
'import type { Plugin as VitePlugin } from \'vite\'',
|
|
35
|
+
'import { type PluginOptions, Plugin } from \'@dxtmisha/constructor/plugin\'',
|
|
36
|
+
'',
|
|
37
|
+
'import {',
|
|
38
|
+
' componentsList,',
|
|
39
|
+
' componentsReg,',
|
|
40
|
+
' designName,',
|
|
41
|
+
' packageName,',
|
|
42
|
+
' styleVarsReg',
|
|
43
|
+
'} from \'./design\'',
|
|
44
|
+
'',
|
|
45
|
+
'/**',
|
|
46
|
+
' * Initializes the Vite plugin for the design system.',
|
|
47
|
+
' *',
|
|
48
|
+
' * Инициализирует плагин Vite для дизайн-системы.',
|
|
49
|
+
' * @param options plugin options / настройки плагина',
|
|
50
|
+
' */',
|
|
51
|
+
`export function ui${toCamelCaseFirst(design)}VitePlugin(`,
|
|
52
|
+
' options: PluginOptions = {}',
|
|
53
|
+
'): VitePlugin {',
|
|
54
|
+
' return new Plugin(',
|
|
55
|
+
' designName,',
|
|
56
|
+
' packageName,',
|
|
57
|
+
' componentsReg,',
|
|
58
|
+
' styleVarsReg,',
|
|
59
|
+
' componentsList,',
|
|
60
|
+
` 'vite-plugin-${toKebabCase(design)}-ui',`,
|
|
61
|
+
' options',
|
|
62
|
+
' )',
|
|
63
|
+
' .init()',
|
|
64
|
+
'}'
|
|
65
|
+
]
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
return this
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { PropertiesConfig } from '../Properties/PropertiesConfig'
|
|
2
|
+
import { LibraryItems } from './LibraryItems'
|
|
3
|
+
|
|
4
|
+
import type { LibraryData } from '../../types/libraryTypes'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Class for creating a file with type exports.
|
|
8
|
+
*
|
|
9
|
+
* Класс для создания файла с экспортом типов.
|
|
10
|
+
*/
|
|
11
|
+
export class LibraryTypes {
|
|
12
|
+
/**
|
|
13
|
+
* Constructor
|
|
14
|
+
* @param items object for working with the list of components / объект для работы со списком компонентов
|
|
15
|
+
*/
|
|
16
|
+
constructor(
|
|
17
|
+
protected readonly items: LibraryItems
|
|
18
|
+
) {
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Creates a file with type exports.
|
|
23
|
+
*
|
|
24
|
+
* Создает файл с экспортом типов.
|
|
25
|
+
*/
|
|
26
|
+
make(): void {
|
|
27
|
+
this.items.write(
|
|
28
|
+
'types',
|
|
29
|
+
[
|
|
30
|
+
...this.initImports(),
|
|
31
|
+
'',
|
|
32
|
+
...this.initExports(),
|
|
33
|
+
'',
|
|
34
|
+
'declare module \'@vue/runtime-core\' {',
|
|
35
|
+
' export interface GlobalComponents {',
|
|
36
|
+
...this.initGlobalComponentsVue(),
|
|
37
|
+
' }',
|
|
38
|
+
'}'
|
|
39
|
+
]
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the path to the component.
|
|
45
|
+
*
|
|
46
|
+
* Возвращает путь к компоненту.
|
|
47
|
+
* @param component component data / данные компонента
|
|
48
|
+
*/
|
|
49
|
+
protected getPathComponent(component: LibraryData): string {
|
|
50
|
+
return `../components/${PropertiesConfig.getProjectName()}/${component.dir}`
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Returns a list of imports for the file.
|
|
55
|
+
*
|
|
56
|
+
* Возвращает список импортов для файла.
|
|
57
|
+
*/
|
|
58
|
+
protected initImports(): string[] {
|
|
59
|
+
const list: string[] = []
|
|
60
|
+
|
|
61
|
+
this.items.getComponentList()
|
|
62
|
+
.forEach((component) => {
|
|
63
|
+
list.push(
|
|
64
|
+
`import _${component.codeFull} from '${this.getPathComponent(component)}/${component.codeFull}.vue'`
|
|
65
|
+
)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
return list
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Returns a list of exports for the file.
|
|
73
|
+
*
|
|
74
|
+
* Возвращает список экспортов для файла.
|
|
75
|
+
*/
|
|
76
|
+
protected initExports(): string[] {
|
|
77
|
+
const list: string[] = []
|
|
78
|
+
|
|
79
|
+
this.items.getComponentList()
|
|
80
|
+
.forEach((component) => {
|
|
81
|
+
list.push(
|
|
82
|
+
`export const ${component.codeFull} = _${component.codeFull}`
|
|
83
|
+
)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
return list
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Returns a list of global components for Vue.
|
|
91
|
+
*
|
|
92
|
+
* Возвращает список глобальных компонентов для Vue.
|
|
93
|
+
*/
|
|
94
|
+
protected initGlobalComponentsVue(): string[] {
|
|
95
|
+
const list: string[] = []
|
|
96
|
+
|
|
97
|
+
this.items.getComponentList()
|
|
98
|
+
.forEach((component) => {
|
|
99
|
+
list.push(
|
|
100
|
+
` ${component.codeFull}: typeof ${component.codeFull}`
|
|
101
|
+
)
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
return list
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import requirePath from 'node:path'
|
|
4
4
|
import { fileURLToPath } from 'node:url'
|
|
5
|
+
import { isFilled } from '@dxtmisha/functional-basic'
|
|
5
6
|
import { hasNativeDirname } from '../../functions/hasNativeDirname'
|
|
6
7
|
|
|
7
8
|
import { PropertiesConfig } from '../Properties/PropertiesConfig'
|
|
@@ -92,7 +93,7 @@ export class PackageInitItem {
|
|
|
92
93
|
* Получает файлы шаблонов, если указан путь к шаблонам.
|
|
93
94
|
*/
|
|
94
95
|
protected getTemplates(): PackageInitItemFile[] {
|
|
95
|
-
if (this.templates) {
|
|
96
|
+
if (isFilled(this.templates)) {
|
|
96
97
|
return this.getFileByList([this.templates])
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -191,6 +192,7 @@ export class PackageInitItem {
|
|
|
191
192
|
protected writeFile(path: string, content: string): void {
|
|
192
193
|
const contentEdit = content
|
|
193
194
|
.replace(/@packages\/library/g, this.getProjectName())
|
|
195
|
+
.replace(/\[name]/g, this.getName())
|
|
194
196
|
|
|
195
197
|
PropertiesFile.writeByPath(path, contentEdit)
|
|
196
198
|
PropertiesFile.chmod(path)
|
|
@@ -38,6 +38,15 @@ export class PropertiesConfig {
|
|
|
38
38
|
return this.config.name ?? 'ui'
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Returns alternative design names.
|
|
43
|
+
*
|
|
44
|
+
* Возвращает альтернативные названия дизайна.
|
|
45
|
+
*/
|
|
46
|
+
static getDesignAlternativeName(): string[] | undefined {
|
|
47
|
+
return this.config?.alternativeName
|
|
48
|
+
}
|
|
49
|
+
|
|
41
50
|
/**
|
|
42
51
|
* Returns the separator symbol.
|
|
43
52
|
*
|
|
@@ -7,7 +7,7 @@ import { hasNativeDirname } from '../../functions/hasNativeDirname'
|
|
|
7
7
|
import { UI_FILE_INDEX, UI_MODULES, UI_PROJECT_NAME } from '../../config'
|
|
8
8
|
|
|
9
9
|
export type PropertiesFilePath = string | string[]
|
|
10
|
-
export type PropertiesFileValue<T = any> = string | Record<string, T>
|
|
10
|
+
export type PropertiesFileValue<T = any> = string | Record<string, T> | Buffer
|
|
11
11
|
|
|
12
12
|
const dirnamePath = hasNativeDirname() ? __dirname : requirePath.dirname(fileURLToPath(import.meta.url))
|
|
13
13
|
|
|
@@ -417,16 +417,18 @@ export class PropertiesFile {
|
|
|
417
417
|
* Записывает по выбранному пути.
|
|
418
418
|
* @param path path to the file/ путь к файлу
|
|
419
419
|
* @param value values for storage/ значения для хранения
|
|
420
|
+
* @param transform whether to transform the value/ преобразовывать ли значение
|
|
420
421
|
*/
|
|
421
422
|
static writeByPath<T extends PropertiesFileValue>(
|
|
422
423
|
path: PropertiesFilePath,
|
|
423
|
-
value: T
|
|
424
|
+
value: T,
|
|
425
|
+
transform: boolean = true
|
|
424
426
|
): void {
|
|
425
427
|
this.createDir(path)
|
|
426
428
|
|
|
427
429
|
requireFs.writeFileSync(
|
|
428
430
|
this.joinPath(path),
|
|
429
|
-
typeof value === 'object' ? JSON.stringify(value) : value
|
|
431
|
+
transform && typeof value === 'object' ? JSON.stringify(value, undefined, 2) : value as any
|
|
430
432
|
)
|
|
431
433
|
}
|
|
432
434
|
|
package/src/config.ts
CHANGED
|
@@ -21,6 +21,7 @@ export const UI_FLAG_NOT_EXPORT = /\/\/ *export:none/
|
|
|
21
21
|
|
|
22
22
|
/** Folder where all the code is stored/ Папка, где хранится весь код */
|
|
23
23
|
export const UI_DIR_IN = 'src'
|
|
24
|
+
export const UI_DIR_AI = 'ai'
|
|
24
25
|
/** Components directory name/ Название директории компонентов */
|
|
25
26
|
export const UI_DIR_COMPONENTS = 'components'
|
|
26
27
|
/** Constructors directory name/ Название директории конструкторов */
|
|
@@ -34,6 +35,7 @@ export const UI_DIR_DIST_TEMPORARY = 'dist-temporary'
|
|
|
34
35
|
export const UI_DIR_PROMPT = 'prompt'
|
|
35
36
|
export const UI_DIR_PACKAGES = 'packages'
|
|
36
37
|
|
|
38
|
+
export const UI_DIRS_AI_WIKI = [UI_DIR_IN, UI_DIR_WIKI, UI_DIR_AI]
|
|
37
39
|
/** Name of the path to tokens/ Название пути к токенам */
|
|
38
40
|
export const UI_DIRS_TOKENS = [UI_DIR_IN, 'media']
|
|
39
41
|
/** Directory containing the list of icons/ Директория со списком иконок */
|
|
@@ -74,6 +76,10 @@ export const UI_FILE_NAME_FLAGS = 'flags'
|
|
|
74
76
|
/** File name for storing media data and icons/ Название файла для хранения медиа-данных и иконок */
|
|
75
77
|
export const UI_FILE_NAME_MEDIA = 'media'
|
|
76
78
|
|
|
79
|
+
/** File name for the list of component descriptions/ Название файла для список описаний компонентов */
|
|
80
|
+
export const UI_FILE_NAME_DESIGN = 'design'
|
|
81
|
+
export const UI_FILE_NAME_PLUGIN = 'plugin'
|
|
82
|
+
|
|
77
83
|
/** File name for the list of component descriptions for the wiki/ Название файла для список описаний компонентов для wiki */
|
|
78
84
|
export const UI_FILE_NAME_WIKI = 'wiki'
|
|
79
85
|
|
|
@@ -84,6 +90,7 @@ export const UI_FILE_NAME_VITE_WORKERS = 'vite-workers.config.ts'
|
|
|
84
90
|
export const UI_FILE_INDEX = 'index.ts'
|
|
85
91
|
|
|
86
92
|
export const UI_FILE_AI_TYPES = 'ai-types.txt'
|
|
93
|
+
export const UI_FILE_STYLE_SCSS = 'style.scss'
|
|
87
94
|
|
|
88
95
|
/** SCSS file extension/ Расширение файлов SCSS */
|
|
89
96
|
export const UI_EXTENSION_STYLE = 'scss'
|
package/src/library.ts
CHANGED
|
@@ -10,10 +10,14 @@ 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'
|
|
16
17
|
export * from './classes/Git/GitRead'
|
|
18
|
+
export * from './classes/Library/LibraryExport'
|
|
19
|
+
export * from './classes/Library/LibraryList'
|
|
20
|
+
export * from './classes/Library/LibraryPlugin'
|
|
17
21
|
export * from './classes/Properties/PropertiesFile'
|
|
18
22
|
|
|
19
23
|
// Composables
|
package/src/media/templates/component/{DesignComponentWikiAi.vue → DesignComponentAiWiki.vue}
RENAMED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
// :component-import [!] System label / Системная метка
|
|
8
8
|
|
|
9
9
|
defineOptions({
|
|
10
|
-
name: '
|
|
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="
|
|
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
|
-
|
|
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
|
|
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/
|
|
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,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
type ConstructorsPropsToken = {
|
|
2
2
|
// :type [!] System label / Системная метка
|
|
3
3
|
// :type [!] System label / Системная метка
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
export
|
|
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
|
|
16
|
-
}
|
|
15
|
+
export type ConstructorsProps = ConstructorsPropsBasic & ConstructorsPropsToken
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
* Default value for property.
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title
|
|
6
|
+
<title>@packages/library</title>
|
|
8
7
|
</head>
|
|
9
8
|
<body>
|
|
10
9
|
<div id="app"></div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
package/src/types/configTypes.ts
CHANGED
|
@@ -12,6 +12,9 @@ export type DesignUiConfig = {
|
|
|
12
12
|
/** Design system name / Название дизайн-системы */
|
|
13
13
|
name: string
|
|
14
14
|
|
|
15
|
+
/** Alternative names / Альтернативные названия */
|
|
16
|
+
alternativeName?: string[]
|
|
17
|
+
|
|
15
18
|
/**
|
|
16
19
|
* Abbreviation symbol, this key will be used to separate into sub-branches /
|
|
17
20
|
* Символ сокращения, такой ключ будет разделять на под-ветки
|
package/src/types/designTypes.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { PropertyItem } from './propertyTypes'
|
|
2
2
|
|
|
3
|
+
/** Item for design flags / Элемент флагов дизайна */
|
|
4
|
+
export type DesignFlagsItem = {
|
|
5
|
+
/** Flag name / Название флага */
|
|
6
|
+
name: string
|
|
7
|
+
/** X coordinate / Координата X */
|
|
8
|
+
x: number
|
|
9
|
+
/** Y coordinate / Координата Y */
|
|
10
|
+
y: number
|
|
11
|
+
}
|
|
12
|
+
/** List of design flags items / Список элементов флагов дизайна */
|
|
13
|
+
export type DesignFlagsList = DesignFlagsItem[]
|
|
14
|
+
|
|
3
15
|
/** Design structure state with hierarchy and property information / Состояние структуры дизайна с иерархией и информацией о свойствах */
|
|
4
16
|
export type DesignStructureState = {
|
|
5
17
|
/** Element index identifier / Идентификатор индекса элемента */
|
|
@@ -23,7 +23,7 @@ export type LibraryItem = {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** List of library items / Список элементов библиотеки */
|
|
26
|
-
export type
|
|
26
|
+
export type LibraryAll = LibraryItem[]
|
|
27
27
|
|
|
28
28
|
/** Library files item with name, path and file list / Элемент файлов библиотеки с именем, путём и списком файлов */
|
|
29
29
|
export type LibraryFilesItem = {
|
|
File without changes
|