@dxtmisha/scripts 0.10.0 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/src/classes/Design/DesignTypes.ts +7 -6
- package/src/classes/Design/DesignWikiStorm.ts +7 -7
- package/src/classes/Design/DesignWikiStormItem.ts +64 -34
- package/src/classes/Library/LibraryAiPrompt.ts +2 -2
- package/src/classes/Library/LibraryAiPromptItem.ts +2 -2
- package/src/config.ts +8 -8
- package/src/media/templates/componentDoc/materials/{prompt.txt → prompt.md} +4 -4
- package/src/media/templates/componentDoc/wiki/run.ts +1 -1
- package/src/media/templates/packages/library/package.json +7 -5
- package/src/media/templates/prompts/aiCodeGlobalPrompt.en.md +77 -0
- package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.md +78 -0
- package/src/types/webTypes.ts +33 -4
- package/src/media/templates/prompts/aiCodeGlobalPrompt.en.txt +0 -59
- package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.txt +0 -61
- /package/src/media/templates/componentDoc/wiki/{prompt.txt → prompt.md} +0 -0
- /package/src/media/templates/prompts/{aiCodeVuePrompt.en.txt → aiCodeVuePrompt.en.md} +0 -0
- /package/src/media/templates/prompts/{aiCodeVuePrompt.ru.txt → aiCodeVuePrompt.ru.md} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.10.3] - 2026-06-25
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **Web-Types Generation**: Modernized component Web-Types generation to support modern IDE contributions structure:
|
|
9
|
+
- Switched output generation schema from legacy HTML `'tags'` to the new `'vue-components'` syntax standard.
|
|
10
|
+
- Implemented typescript types (`WebTypesPropItem`, `WebTypesVueComponentItem`) to map components, slots, properties, symbols, events, descriptions, and JS interfaces.
|
|
11
|
+
|
|
12
|
+
## [0.10.2] - 2026-06-18
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- **AI Documentation Support**: Migrated template files from `.txt` to `.md` extensions (prompts, rules, and helper templates) to align with standard markdown format.
|
|
16
|
+
- **Developer Instructions**: Expanded default prompts with stricter code rules (banned `@ts-ignore`, mandated active usage of `ai-memory.md`).
|
|
17
|
+
|
|
18
|
+
## [0.10.1] - 2026-06-17
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
- **AI Guidelines**: Integrated package-scoped memory rules to instruct the AI assistant to read or create the package-level `ai-memory.md` files for persistent guidelines.
|
|
22
|
+
|
|
5
23
|
## [0.10.0] - 2026-05-20
|
|
6
24
|
|
|
7
25
|
### Added
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxtmisha/scripts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Development scripts and CLI tools for DXT UI projects - automated component generation, library building and project management tools",
|
|
7
7
|
"keywords": [
|
|
@@ -256,13 +256,14 @@ export class DesignTypes {
|
|
|
256
256
|
protected async toAiDescription(content: string): Promise<string> {
|
|
257
257
|
const generate = await this.toAi(
|
|
258
258
|
content,
|
|
259
|
-
'Analyze the provided code and generate a highly technical, concise project overview for another AI coding assistant. '
|
|
260
|
-
+ '
|
|
261
|
-
+ 'The description must be objective, factual, and free of marketing fluff. '
|
|
259
|
+
'Analyze the provided code and generate a highly technical, structured, and concise project overview specifically designed for another AI coding assistant. '
|
|
260
|
+
+ 'The description must enable the reading AI to immediately evaluate whether this library contains code, components, classes, or utilities useful for its current task, and when it is mandatory to read and analyze "ai-types.md". '
|
|
261
|
+
+ 'The description must be objective, factual, precise, and free of marketing fluff. '
|
|
262
262
|
+ 'Include: '
|
|
263
|
-
+ '1. Core Purpose: What is the primary function of this library?
|
|
264
|
-
+ '2.
|
|
265
|
-
+ '3.
|
|
263
|
+
+ '1. Core Purpose: What is the primary technical function of this library? '
|
|
264
|
+
+ '2. Key Expositions: What are the main classes, hooks, utilities, or components exposed by this project, and what specific tasks do they perform? '
|
|
265
|
+
+ '3. Triggers for Studying ai-types.md: Under what specific conditions, keywords, or coding requirements is this library indispensable, making it mandatory for the AI to study its "ai-types.md" file? '
|
|
266
|
+
+ '4. Integration Context: How does it connect with other technologies in the system stack? '
|
|
266
267
|
+ 'Ensure the structure is clean and enables immediate context retrieval. '
|
|
267
268
|
+ 'Return ONLY the resulting description text. No markdown, no labels like "Description:", no explanations. NOTHING but the pure content.'
|
|
268
269
|
)
|
|
@@ -6,7 +6,7 @@ import { PropertiesFile } from '../Properties/PropertiesFile'
|
|
|
6
6
|
import { LibraryItems } from '../Library/LibraryItems'
|
|
7
7
|
import { DesignWikiStormItem } from './DesignWikiStormItem'
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { WebTypesVueComponentItem, WebTypesVueJson } from '../../types/webTypes'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Engine for generating `web-types.json` to provide rich metadata and IDE support (IntelliSense) for the design system components in JetBrains editors (IntelliJ IDEA, WebStorm).
|
|
@@ -43,15 +43,15 @@ export class DesignWikiStorm {
|
|
|
43
43
|
|
|
44
44
|
if (packageFile) {
|
|
45
45
|
const data: WebTypesVueJson = {
|
|
46
|
-
$schema: 'https://
|
|
46
|
+
$schema: 'https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json',
|
|
47
47
|
framework: 'vue',
|
|
48
48
|
name: toCamelCaseFirst(PropertiesConfig.getDesignName()),
|
|
49
49
|
version: packageFile.version,
|
|
50
|
+
'js-types-syntax': 'typescript',
|
|
50
51
|
contributions: {
|
|
51
52
|
html: {
|
|
52
|
-
'types-syntax': 'typescript',
|
|
53
53
|
'description-markup': 'markdown',
|
|
54
|
-
'
|
|
54
|
+
'vue-components': await this.getComponents()
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -68,9 +68,9 @@ export class DesignWikiStorm {
|
|
|
68
68
|
*
|
|
69
69
|
* Создает или обновляет список компонентов.
|
|
70
70
|
*/
|
|
71
|
-
protected async getComponents(): Promise<
|
|
71
|
+
protected async getComponents(): Promise<WebTypesVueComponentItem[]> {
|
|
72
72
|
const packageFile = getPackageJson()
|
|
73
|
-
const tags:
|
|
73
|
+
const tags: WebTypesVueComponentItem[] = []
|
|
74
74
|
|
|
75
75
|
if (packageFile) {
|
|
76
76
|
for (const component of this.components.getComponentList()) {
|
|
@@ -85,7 +85,7 @@ export class DesignWikiStorm {
|
|
|
85
85
|
const tag = await item.get()
|
|
86
86
|
|
|
87
87
|
if (tag) {
|
|
88
|
-
tags.push(tag)
|
|
88
|
+
tags.push(tag as any)
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -6,7 +6,7 @@ import { PropertiesConfig } from '../Properties/PropertiesConfig'
|
|
|
6
6
|
import { PropertiesFile } from '../Properties/PropertiesFile'
|
|
7
7
|
|
|
8
8
|
import type { LibraryData } from '../../types/libraryTypes'
|
|
9
|
-
import type {
|
|
9
|
+
import type { WebTypesVueComponentItem, WebTypesPropItem, WebTypesSlots, WebTypesEventItem, WebTypesProperty } from '../../types/webTypes'
|
|
10
10
|
import { forEach } from '@dxtmisha/functional-basic'
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -46,73 +46,73 @@ export class DesignWikiStormItem {
|
|
|
46
46
|
*
|
|
47
47
|
* Возвращает определение тега для web-types.
|
|
48
48
|
*/
|
|
49
|
-
async get(): Promise<
|
|
49
|
+
async get(): Promise<WebTypesVueComponentItem | undefined> {
|
|
50
50
|
if (this.wiki) {
|
|
51
51
|
const name = `${toCamelCaseFirst(PropertiesConfig.getDesignName())}${this.wiki.getName()}`
|
|
52
52
|
|
|
53
|
-
const
|
|
53
|
+
const component: WebTypesVueComponentItem = {
|
|
54
54
|
name,
|
|
55
55
|
description: this.wiki.getDescription(),
|
|
56
56
|
source: {
|
|
57
57
|
module: `${this.project}/${name}`,
|
|
58
58
|
symbol: name
|
|
59
59
|
},
|
|
60
|
-
|
|
60
|
+
props: this.getProps()
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
const slots = await this.getSlots()
|
|
64
64
|
|
|
65
65
|
if (slots) {
|
|
66
|
-
|
|
66
|
+
component.slots = slots
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
const events = await this.getEvents()
|
|
70
70
|
|
|
71
|
-
if (events) {
|
|
72
|
-
|
|
71
|
+
if (events && events.length > 0) {
|
|
72
|
+
component.js = {
|
|
73
|
+
events
|
|
74
|
+
}
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
return
|
|
77
|
+
return component
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
return undefined
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
/**
|
|
82
|
-
* Returns the
|
|
84
|
+
* Returns the prop definition.
|
|
83
85
|
*
|
|
84
|
-
* Возвращает определение
|
|
86
|
+
* Возвращает определение свойства.
|
|
85
87
|
* @param item prop item / элемент свойства
|
|
86
88
|
*/
|
|
87
|
-
|
|
89
|
+
getProp(item: WikiStorybookProp): WebTypesPropItem {
|
|
88
90
|
const type = this.prepareType(item.getType())
|
|
91
|
+
const cleaned = type ? this.cleanType(type) : undefined
|
|
89
92
|
return {
|
|
90
93
|
name: item.getName(),
|
|
91
94
|
description: item.getDescription(),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
kind: 'expression',
|
|
95
|
-
type
|
|
96
|
-
}
|
|
95
|
+
default: item.getDefaultValue() ?? undefined,
|
|
96
|
+
type: cleaned
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* Returns a list of
|
|
101
|
+
* Returns a list of props.
|
|
102
102
|
*
|
|
103
|
-
* Возвращает список
|
|
103
|
+
* Возвращает список свойств.
|
|
104
104
|
*/
|
|
105
|
-
|
|
106
|
-
const
|
|
105
|
+
getProps(): WebTypesPropItem[] {
|
|
106
|
+
const props: WebTypesPropItem[] = []
|
|
107
107
|
|
|
108
108
|
if (this.wiki) {
|
|
109
109
|
this.wiki.getWikiObject()
|
|
110
110
|
.forEach(
|
|
111
|
-
|
|
111
|
+
item => props.push(this.getProp(item))
|
|
112
112
|
)
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
return
|
|
115
|
+
return props
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/**
|
|
@@ -127,11 +127,19 @@ export class DesignWikiStormItem {
|
|
|
127
127
|
const slots: WebTypesSlots = []
|
|
128
128
|
|
|
129
129
|
data.slots.forEach(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
slot => {
|
|
131
|
+
const vueProperties: WebTypesProperty[] = (slot.properties ?? []).map(p => ({
|
|
132
|
+
name: p.name,
|
|
133
|
+
type: p.type ? this.cleanType(p.type) : undefined,
|
|
134
|
+
description: p.description
|
|
135
|
+
}))
|
|
136
|
+
|
|
137
|
+
slots.push({
|
|
138
|
+
'name': slot.name,
|
|
139
|
+
'description': slot.description,
|
|
140
|
+
'vue-properties': vueProperties
|
|
141
|
+
})
|
|
142
|
+
}
|
|
135
143
|
)
|
|
136
144
|
|
|
137
145
|
return slots
|
|
@@ -145,18 +153,28 @@ export class DesignWikiStormItem {
|
|
|
145
153
|
*
|
|
146
154
|
* Возвращает список событий.
|
|
147
155
|
*/
|
|
148
|
-
async getEvents(): Promise<
|
|
156
|
+
async getEvents(): Promise<WebTypesEventItem[] | undefined> {
|
|
149
157
|
const data = await this.getData()
|
|
150
158
|
|
|
151
159
|
if (data && data.events) {
|
|
152
|
-
const events:
|
|
160
|
+
const events: WebTypesEventItem[] = []
|
|
153
161
|
|
|
154
162
|
data.events.forEach(
|
|
155
|
-
event =>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
event => {
|
|
164
|
+
let typeString = '() => void'
|
|
165
|
+
if (event.properties && event.properties.length > 0) {
|
|
166
|
+
const args = event.properties
|
|
167
|
+
.map(p => `${p.name}: ${p.type ? this.cleanType(p.type) : 'any'}`)
|
|
168
|
+
.join(', ')
|
|
169
|
+
typeString = `(${args}) => void`
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
events.push({
|
|
173
|
+
name: event.name,
|
|
174
|
+
description: event.description,
|
|
175
|
+
type: typeString
|
|
176
|
+
})
|
|
177
|
+
}
|
|
160
178
|
)
|
|
161
179
|
|
|
162
180
|
return events
|
|
@@ -262,6 +280,18 @@ export class DesignWikiStormItem {
|
|
|
262
280
|
return type
|
|
263
281
|
}
|
|
264
282
|
|
|
283
|
+
/**
|
|
284
|
+
* Cleans a type string by removing redundant parentheses, e.g., (CellClassesSub) | undefined -> CellClassesSub | undefined
|
|
285
|
+
*
|
|
286
|
+
* Очищает строку типа, удаляя лишние скобки, например: (CellClassesSub) | undefined -> CellClassesSub | undefined
|
|
287
|
+
*/
|
|
288
|
+
protected cleanType(type: string): string {
|
|
289
|
+
return type
|
|
290
|
+
.replace(/^\(([^()]+)\)$/, '$1')
|
|
291
|
+
.replace(/^\(([^()]+)\)\s*\|\s*undefined$/, '$1 | undefined')
|
|
292
|
+
.trim()
|
|
293
|
+
}
|
|
294
|
+
|
|
265
295
|
/**
|
|
266
296
|
* Initializes the wiki object.
|
|
267
297
|
*
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
import { PropertiesFile } from '../Properties/PropertiesFile'
|
|
8
8
|
import { LibraryAiPromptItem } from './LibraryAiPromptItem'
|
|
9
9
|
|
|
10
|
-
import vuePromptText from '../../media/templates/prompts/aiCodeVuePrompt.en.
|
|
11
|
-
import globalPromptText from '../../media/templates/prompts/aiCodeGlobalPrompt.en.
|
|
10
|
+
import vuePromptText from '../../media/templates/prompts/aiCodeVuePrompt.en.md?raw'
|
|
11
|
+
import globalPromptText from '../../media/templates/prompts/aiCodeGlobalPrompt.en.md?raw'
|
|
12
12
|
|
|
13
13
|
const LIBRARY_AI_PROMPT_LIST_DIRS = [
|
|
14
14
|
UI_MODULES
|
|
@@ -227,7 +227,7 @@ ${this.readFile(UI_FILE_AI_PROMPT_DESCRIPTION)}
|
|
|
227
227
|
|
|
228
228
|
return `
|
|
229
229
|
## Mandatory Study Before Development
|
|
230
|
-
|
|
230
|
+
As soon as you start working with this project (using any of its components/functionality, importing from it, or editing its code), you MUST read and study the architectural rules and instructions in this file as your absolute first action:
|
|
231
231
|
'${this.getPathString()}/${UI_FILE_AI_PROMPT_DEVELOPER}'
|
|
232
232
|
`.trim()
|
|
233
233
|
}
|
|
@@ -269,7 +269,7 @@ ${this.readFile(UI_FILE_AI_PROMPT_INFO)}
|
|
|
269
269
|
|
|
270
270
|
return `
|
|
271
271
|
## Project types: Essential for analysis
|
|
272
|
-
This file contains the complete type definitions for the project.
|
|
272
|
+
This file contains the complete type definitions for the project. As soon as you start working with this project (using any of its components/functionality, importing from it, or editing its code), you MUST read and study this type definition file as your absolute first action to understand its API and structure:
|
|
273
273
|
'${this.getPathString()}/${UI_FILE_AI_PROMPT_TYPES}'
|
|
274
274
|
`.trim()
|
|
275
275
|
}
|
package/src/config.ts
CHANGED
|
@@ -81,17 +81,17 @@ export const UI_FILE_PACKAGE = 'package.json'
|
|
|
81
81
|
export const UI_FILE_PROPERTY = 'properties.json'
|
|
82
82
|
|
|
83
83
|
/** AI prompt description file name / Название файла с описанием промпта AI */
|
|
84
|
-
export const UI_FILE_AI_PROMPT_DESCRIPTION = 'ai-description.
|
|
84
|
+
export const UI_FILE_AI_PROMPT_DESCRIPTION = 'ai-description.md'
|
|
85
85
|
/** AI prompt info file name / Название файла с информацией промпта AI */
|
|
86
|
-
export const UI_FILE_AI_PROMPT_INFO = 'ai-doc.
|
|
86
|
+
export const UI_FILE_AI_PROMPT_INFO = 'ai-doc.md'
|
|
87
87
|
/** AI prompt instruction file name / Название файла с инструкцией промпта AI */
|
|
88
|
-
export const UI_FILE_AI_PROMPT_INSTRUCTION = 'ai-instruction.
|
|
88
|
+
export const UI_FILE_AI_PROMPT_INSTRUCTION = 'ai-instruction.md'
|
|
89
89
|
/** AI prompt result file name / Название файла с результатом промпта AI */
|
|
90
|
-
export const UI_FILE_AI_PROMPT_PROMPT = 'ai-prompt.
|
|
90
|
+
export const UI_FILE_AI_PROMPT_PROMPT = 'ai-prompt.md'
|
|
91
91
|
/** AI prompt types file name / Название файла с типами промпта AI */
|
|
92
|
-
export const UI_FILE_AI_PROMPT_TYPES = 'ai-types.
|
|
92
|
+
export const UI_FILE_AI_PROMPT_TYPES = 'ai-types.md'
|
|
93
93
|
/** AI prompt developer file name / Название файла для разработчика AI */
|
|
94
|
-
export const UI_FILE_AI_PROMPT_DEVELOPER = 'ai-developer.
|
|
94
|
+
export const UI_FILE_AI_PROMPT_DEVELOPER = 'ai-developer.md'
|
|
95
95
|
|
|
96
96
|
/** File name for storing the list of flags/ Название файла для хранения списка флагов */
|
|
97
97
|
export const UI_FILE_NAME_FLAGS = 'flags'
|
|
@@ -117,9 +117,9 @@ export const UI_FILE_NAME_VITE_WORKERS = 'vite-workers.config.ts'
|
|
|
117
117
|
export const UI_FILE_INDEX = 'index.ts'
|
|
118
118
|
|
|
119
119
|
/** AI types file name / Название файла с типами AI */
|
|
120
|
-
export const UI_FILE_AI_TYPES = 'ai-types.
|
|
120
|
+
export const UI_FILE_AI_TYPES = 'ai-types.md'
|
|
121
121
|
/** AI description file name / Название файла с описанием AI */
|
|
122
|
-
export const UI_FILE_AI_DESCRIPTION = 'ai-description.
|
|
122
|
+
export const UI_FILE_AI_DESCRIPTION = 'ai-description.md'
|
|
123
123
|
/** Style SCSS file name / Название файла стилей SCSS */
|
|
124
124
|
export const UI_FILE_STYLE_SCSS = 'style.scss'
|
|
125
125
|
/** UI properties SCSS file name / Название файла свойств UI в SCSS */
|
|
@@ -13,13 +13,13 @@ The target parent directory (one level up from this "materials" directory) repre
|
|
|
13
13
|
- `wiki/`: Storybook playground configuration and documentation files:
|
|
14
14
|
- `[ComponentName].mdx`: MDX documentation tab/documentation configuration for Storybook.
|
|
15
15
|
- `[ComponentName].stories.ts`: Storybook stories/scenarios configuration.
|
|
16
|
-
- `prompt.
|
|
17
|
-
- `run.ts`: A script running `npx dxt-component-wiki` to write the MDX files automatically using `wiki/prompt.
|
|
16
|
+
- `prompt.md`: The system prompt directing how to generate MDX/Storybook documentation.
|
|
17
|
+
- `run.ts`: A script running `npx dxt-component-wiki` to write the MDX files automatically using `wiki/prompt.md`.
|
|
18
18
|
|
|
19
19
|
Strict Implementation & Architectural Constraints:
|
|
20
20
|
1. Available Dependencies Only: You must strictly use only the currently installed packages and available dependencies. Do not install new external npm packages or add new third-party dependencies unless explicitly requested.
|
|
21
|
-
2. Global System Prompt Compliance: You must locate, study, and strictly adhere to all coding standards, BEM conventions, SCSS mixins, and guidelines defined in the `ai-prompt.
|
|
22
|
-
3. Monorepo Prompt Context: As this is a monorepo setup, you must locate and study both the individual package-level configuration/prompt files and the repository's root system rules (`ai-prompt.
|
|
21
|
+
2. Global System Prompt Compliance: You must locate, study, and strictly adhere to all coding standards, BEM conventions, SCSS mixins, and guidelines defined in the `ai-prompt.md` file located up the folder tree in the root of the repository. Ignore any instructions or files located outside the repository boundaries.
|
|
22
|
+
3. Monorepo Prompt Context: As this is a monorepo setup, you must locate and study both the individual package-level configuration/prompt files and the repository's root system rules (`ai-prompt.md`) to ensure perfect compatibility with the local package architecture.
|
|
23
23
|
4. Zero Tolerance for Hallucinations: You must strictly follow all implementation rules and specifications without any deviation. Hallucinating, inventing properties, methods, slots, or external libraries is strictly forbidden.
|
|
24
24
|
|
|
25
25
|
---
|
|
@@ -7,7 +7,7 @@ import { readFileSync } from 'node:fs'
|
|
|
7
7
|
;(async () => {
|
|
8
8
|
try {
|
|
9
9
|
// You can add prompt generation logic here
|
|
10
|
-
const prompt = readFileSync(new URL('./prompt.
|
|
10
|
+
const prompt = readFileSync(new URL('./prompt.md', import.meta.url), 'utf-8')
|
|
11
11
|
|
|
12
12
|
const child = spawn(
|
|
13
13
|
'npx',
|
|
@@ -11,14 +11,16 @@
|
|
|
11
11
|
"test": "vitest",
|
|
12
12
|
"component": "dxt-component",
|
|
13
13
|
"library": "dxt-library",
|
|
14
|
-
"
|
|
14
|
+
"types": "npm run prepublishOnly && dxt-types",
|
|
15
|
+
"wiki": "dxt-ai-doc",
|
|
16
|
+
"prepublishOnly": "npm run library && npm run build",
|
|
17
|
+
"publish-to-npm": "npm publish --access public"
|
|
15
18
|
},
|
|
16
19
|
"files": [
|
|
17
20
|
"dist",
|
|
18
|
-
"ai-description.
|
|
19
|
-
"ai-doc.
|
|
20
|
-
"ai-
|
|
21
|
-
"ai-types.txt",
|
|
21
|
+
"ai-description.md",
|
|
22
|
+
"ai-doc.md",
|
|
23
|
+
"ai-types.md",
|
|
22
24
|
"CHANGELOG.md",
|
|
23
25
|
"LICENSE",
|
|
24
26
|
"package.json",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
### Global Development Principles (AI Code Promise)
|
|
2
|
+
|
|
3
|
+
Your primary goal is to generate flawless, industrial-grade code that adheres to dxt-ui standards. You promise to follow these rules strictly:
|
|
4
|
+
|
|
5
|
+
0. **Mandatory Deep Study**:
|
|
6
|
+
- Before developing anything for any project or package, you MUST study it completely to fully understand its architecture and stylistic guidelines.
|
|
7
|
+
- Before modifying or fixing any file, you MUST fully study its internal structure and logic first.
|
|
8
|
+
- If any instructions, paths, or files are specified as located inside `node_modules/` or any other external/linked directory, you MUST first check if this package exists locally in the workspace (for example, under `packages/`). If it does exist locally, you MUST resolve the paths to the local workspace package directory and study/modify the local source files instead.
|
|
9
|
+
- **CRITICAL FIRST STEP:** If any project, module, or instruction contains links or references to specific files (e.g. types, developer guides, descriptions), you MUST study all these referenced files as your absolute first action. As soon as you start working with a project, or notice that it is imported/used in the code you are working with, you must immediately read and study all these referenced files before doing any planning, proposing code changes, or writing code. This is mandatory and applies even if the files are located in `node_modules/` (always resolve them to the local workspace directory first if they exist locally).
|
|
10
|
+
- **STRICT BLOCKING GUARD (CHRONOLOGICAL ORDER RULES):**
|
|
11
|
+
1. As your ABSOLUTE FIRST ACTION, before taking any other steps, you MUST check if the `ai-memory.md` file exists in the specific package directory or the repository root depending on the files you are working on:
|
|
12
|
+
- If you are analyzing or modifying files that are located inside a package directory (e.g., any subdirectory under `packages/` like `packages/constructor/`, `packages/scripts/`, etc.), you MUST read/write the `ai-memory.md` file ONLY within that specific package directory (e.g. `packages/constructor/ai-memory.md` or `packages/scripts/ai-memory.md`). You are strictly FORBIDDEN from using, reading, or writing the global `ai-memory.md` in the repository root in this case.
|
|
13
|
+
- If and only if the files you are working with are root-level configurations or not part of any package under `packages/`, you may read/write the `ai-memory.md` file in the repository root.
|
|
14
|
+
If the required local package-level `ai-memory.md` (or root `ai-memory.md` for root-level files) exists, you MUST read it using `view_file`. If it does NOT exist, you MUST CREATE IT immediately using `write_to_file` as an empty file with only a single newline (no placeholder text, comments, or intro text).
|
|
15
|
+
2. As your ABSOLUTE SECOND ACTION, you MUST use the `view_file` tool to read the master `ai-prompt.md` file located in the project root. You MUST read the descriptions of ALL libraries mentioned in this file. If there is even a 1% chance that a library mentioned in `ai-prompt.md` contains functionality or utilities relevant to your task, you are OBLIGED to read and study all files associated with that library that are specified in the `ai-prompt.md` under its respective section. You are strictly forbidden from writing custom logic (helpers, styles, configs, classes) without first performing an exhaustive check of the workspace's existing infrastructure (like `functional`, `functional-basic`) via `grep_search` or `list_dir`.
|
|
16
|
+
3. Identify all paths, directories, or packages involved in the user request.
|
|
17
|
+
4. Scan the prompt for sections corresponding to those paths.
|
|
18
|
+
5. Identify all paths to auxiliary documentation, types, or developer guides mentioned in those sections.
|
|
19
|
+
6. You MUST use the `view_file` tool to read and study ALL of these referenced files BEFORE calling `list_dir` on sub-folders, writing any plans/checklists, or proposing/making code changes. Bypassing this order is a critical protocol violation.
|
|
20
|
+
|
|
21
|
+
1. **"Copy-Paste Ready" Principle**:
|
|
22
|
+
- Generate code that can be copied and run without a single manual edit.
|
|
23
|
+
- All imports must be absolute or correct relative paths.
|
|
24
|
+
- No `// ... rest of the code`, no `// imports here`. Only the complete, working file.
|
|
25
|
+
|
|
26
|
+
2. **Zero Tolerance for Hallucinations**:
|
|
27
|
+
- Use only the libraries and versions specified in the project's `package.json`.
|
|
28
|
+
- Do not invent API methods that do not exist in the current versions of dependencies.
|
|
29
|
+
- If information is insufficient, it is better to ask or point out the limitation than to hallucinate.
|
|
30
|
+
|
|
31
|
+
3. **Clean Code Standards**:
|
|
32
|
+
- **DRY & KISS**: Avoid duplication, write as simply and clearly as possible.
|
|
33
|
+
- **SOLID**: Every module, class, or function must have one clear responsibility.
|
|
34
|
+
- **Declarative Approach**: Prefer a declarative programming style (array functional methods, composition).
|
|
35
|
+
- **No Abbreviations**: Do not use shortened or abbreviated names for variables, properties, arguments, methods, classes, etc. (e.g., do not use `el`, `rect1`/`r1`, `dx`/`dy`, `val`, `temp`). All identifiers must be descriptive, complete, and self-explanatory.
|
|
36
|
+
- **Optimization and Clarity**: Write code that is highly optimized, performant, and clean, ensuring it is easy to read and understand.
|
|
37
|
+
- **Single Responsibility (KISS/SOLID)**: Avoid creating large "mega-functions" or monolithic blocks. Each function must be concise and perform exactly one focused task (1 function = 1 functionality).
|
|
38
|
+
|
|
39
|
+
4. **Uncompromising TypeScript**:
|
|
40
|
+
- No `any`. Use `unknown` if the type is truly unknown, or create generic types.
|
|
41
|
+
- Never use `@ts-ignore`. If a type check suppression is absolutely necessary due to external limitations, use `@ts-expect-error` with a descriptive comment explaining why.
|
|
42
|
+
- Always define interfaces for input and output data.
|
|
43
|
+
- Use `as const`, `readonly`, and enums/union types to increase reliability.
|
|
44
|
+
|
|
45
|
+
5. **Professional Documentation (TSDoc)**:
|
|
46
|
+
- Accompany all exported entities with TSDoc comments in the [wikiLanguage] language.
|
|
47
|
+
- Describe the purpose, parameters, return values, and potential exceptions.
|
|
48
|
+
- Usage examples in comments are encouraged for complex functions.
|
|
49
|
+
|
|
50
|
+
6. **Architectural Consistency**:
|
|
51
|
+
- Respect the project structure. If it is standard in the project to move logic into `composables` or `utils`, follow that pattern.
|
|
52
|
+
- Reuse existing infrastructure: Always check if the required functionality (e.g., API requests, state management, utilities) already exists in the project's core packages (like `@dxtmisha/functional` or `@dxtmisha/functional-basic`) before implementing it from scratch.
|
|
53
|
+
- Do not modify global styles or styles of base UI components unless explicitly requested.
|
|
54
|
+
|
|
55
|
+
7. **Security and Performance**:
|
|
56
|
+
- Write error-proof code (guard clauses, optional chaining `?.`, nullish coalescing `??`).
|
|
57
|
+
- Use explicit `try-catch` blocks for asynchronous operations. Never swallow errors silently; handle them appropriately or throw meaningful error messages.
|
|
58
|
+
- Avoid redundant calculations in loops and heavy operations in reactive dependencies.
|
|
59
|
+
|
|
60
|
+
8. **Aesthetics and Conciseness**:
|
|
61
|
+
- The code must be beautiful. Use logical indentation and group code by meaning.
|
|
62
|
+
- Save tokens by avoiding redundant comments where the code speaks for itself.
|
|
63
|
+
|
|
64
|
+
9. **Strict Adherence to Instructions & Optimization**:
|
|
65
|
+
- Perform all operations strictly in accordance with the provided commands and instructions.
|
|
66
|
+
- Avoid guessing or performing unrelated extra actions. However, you are encouraged to analyze the requirements, optimize the code, and propose or implement better technical solutions directly related to achieving the task's goals.
|
|
67
|
+
- Strictly adhere to the plan, checklists, and execution steps, while refining them for better quality and performance when needed.
|
|
68
|
+
|
|
69
|
+
10. **AI Workspace Memory (`ai-memory.md`)**:
|
|
70
|
+
- As enforced by the STRICT BLOCKING GUARD, `ai-memory.md` MUST be created and read locally inside the root of the specific package you are working with (e.g., `packages/constructor/ai-memory.md` for code in `packages/constructor`).
|
|
71
|
+
- Writing or reading `ai-memory.md` in the repository root when working on code inside a package is a critical violation of these rules.
|
|
72
|
+
- Whenever you receive feedback, corrections, or instructions from the developer, you MUST update that specific package's local `ai-memory.md` file.
|
|
73
|
+
- Explicit Memorization Requests: If the developer explicitly instructs you to "remember this", "keep this in mind", or makes a similar request regarding conventions or rules, you MUST immediately record this information in the relevant local `ai-memory.md` file.
|
|
74
|
+
- Active Application: You must actively APPLY the rules and constraints from `ai-memory.md` to all code you generate. Rules in this file override general assumptions and have the highest priority.
|
|
75
|
+
- The PRIMARY PURPOSE of this file is to store critical coding guidelines, specific architectural constraints, and "do's and don'ts" (e.g., "do not use X; use Y instead") to ensure the AI writes compliant, correct code.
|
|
76
|
+
- DO NOT store change logs, lists of modified files, or commit-like messages (e.g., "updated file X, updated package Y"). Keep the file clean, concise, and focused strictly on active rules, design decisions, and coding standards.
|
|
77
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
### Глобальные принципы разработки (AI Code Promise)
|
|
2
|
+
|
|
3
|
+
Твоя главная цель — генерировать безупречный, промышленный код, который соответствует стандартам dxt-ui. Ты обещаешь следовать этим правилам неукоснительно:
|
|
4
|
+
|
|
5
|
+
0. **Обязательное глубокое изучение**:
|
|
6
|
+
- Прежде чем разрабатывать что-либо для любого проекта или пакета, ты ОБЯЗАН полностью изучить его, чтобы детально понять его архитектуру и стилистику.
|
|
7
|
+
- Прежде чем изменять или исправлять любой файл, ты ОБЯЗАН полностью изучить его внутреннюю структуру и логику.
|
|
8
|
+
- Если в инструкциях, путях или файлах указано расположение внутри `node_modules/` или любой другой внешней/привязанной директории, ты ОБЯЗАН сначала проверить, существует ли этот пакет локально в рабочей области (например, в каталоге `packages/`). Если пакет существует локально, ты ОБЯЗАН переопределить пути на локальный каталог пакета рабочей области и изучать/изменять локальные исходные файлы вместо указанных.
|
|
9
|
+
- **КРИТИЧЕСКИЙ ПЕРВЫЙ ШАГ:** Если какой-либо проект, модуль или инструкция содержит ссылки или пути к конкретным файлам (например, типы, руководства для разработчиков, описания), ты ОБЯЗАН подробно изучить все эти файлы по ссылкам в первую очередь. Как только ты начинаешь работу с проектом или видишь, что он импортируется/используется в коде, над которым ты работаешь, ты должен незамедлительно прочитать и изучить все эти файлы по ссылкам, прежде чем приступать к планированию, предложению изменений или написанию кода. Это требование обязательно и распространяется в том числе на файлы, находящиеся в `node_modules/` (всегда сначала переопределяй пути на локальный каталог рабочей области, если они существуют локально).
|
|
10
|
+
- **БЛОКИРУЮЩИЙ КОНТРОЛЬ ПОСЛЕДОВАТЕЛЬНОСТИ (ПРАВИЛО ХРОНОЛОГИИ):**
|
|
11
|
+
1. В качестве АБСОЛЮТНО ПЕРВОГО ДЕЙСТВИЯ, прежде чем выполнять любые другие шаги, ты ОБЯЗАН проверить, существует ли файл `ai-memory.md` в директории конкретного пакета или корня репозитория, в зависимости от файлов, с которыми ты работаешь:
|
|
12
|
+
- Если ты анализируешь или изменяешь файлы, находящиеся внутри каталога пакета (например, в любом подкаталоге внутри `packages/`, таком как `packages/constructor/`, `packages/scripts/` и т.д.), ты ОБЯЗАН читать/записывать файл `ai-memory.md` ИСКЛЮЧИТЕЛЬНО внутри каталога этого конкретного пакета (например, `packages/constructor/ai-memory.md` или `packages/scripts/ai-memory.md`). Тебе строго ЗАПРЕЩЕНО использовать, читать или записывать глобальный `ai-memory.md` в корне всего репозитория в этом случае.
|
|
13
|
+
- Если и только если файлы, с которыми ты работаешь, являются конфигурациями корневого уровня или не относятся к какому-либо пакету внутри `packages/`, ты можешь читать/записывать `ai-memory.md` в корне репозитория.
|
|
14
|
+
Если требуемый локальный файл `ai-memory.md` пакета (или корневой `ai-memory.md` для файлов корневого уровня) существует, ты ОБЯЗАН прочитать его с помощью `view_file`. Если его НЕТ, ты ОБЯЗАН НЕМЕДЛЕННО СОЗДАТЬ ЕГО с помощью `write_to_file` как пустой файл с одной лишь новой строкой (без плейсхолдеров, комментариев или вводного текста).
|
|
15
|
+
2. В качестве АБСОЛЮТНО ВТОРОГО ДЕЙСТВИЯ, ты ОБЯЗАН использовать инструмент `view_file` для чтения главного файла `ai-prompt.md` в корне проекта. Ты ОБЯЗАН изучить описания ВСЕХ библиотек, упомянутых в этом файле. Если тебе кажется хотя бы на мизерный процент (1%), что в какой-либо библиотеке есть что-то подходящее или полезное для твоей задачи, ты ОБЯЗАН изучить все файлы в этой библиотеке, которые указаны в `ai-prompt.md` в разделе этой библиотеки. Тебе строго запрещено писать кастомные реализации (хелперы, стили, конфигурации, классы) или придумывать свое, не проверив предварительно существующую инфраструктуру рабочей области (например, `functional`, `functional-basic`).
|
|
16
|
+
3. Определи все пути пакетов или директорий, связанных с запросом.
|
|
17
|
+
4. Найди в промпте секции, соответствующие этим путям.
|
|
18
|
+
5. Выпиши все пути к вспомогательным файлам типов и руководств, упомянутые в этих секциях.
|
|
19
|
+
6. Ты ОБЯЗАН использовать инструмент `view_file` для чтения и изучения ВСЕХ этих файлов ДО ТОГО, как вызывать `list_dir` для папок компонентов, писать какие-либо планы/чек-листы или вносить/предлагать изменения в код. Нарушение этой последовательности является критическим нарушением протокола.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
1. **Принцип «Copy-Paste Ready» (Готовность к использованию)**:
|
|
24
|
+
- Генерируй код, который можно скопировать и запустить без единой правки.
|
|
25
|
+
- Все импорты должны быть абсолютными или корректными относительными.
|
|
26
|
+
- Никаких `// ... остальной код`, никаких `// импорты здесь`. Только полный, рабочий файл.
|
|
27
|
+
|
|
28
|
+
2. **Нулевая толерантность к галлюцинациям**:
|
|
29
|
+
- Используй только те библиотеки и версии, которые указаны в `package.json` проекта.
|
|
30
|
+
- Не выдумывай методы API, которых не существует в текущих версиях зависимостей.
|
|
31
|
+
- Если информации недостаточно — лучше спроси или укажи на ограничение, чем галлюцинируй.
|
|
32
|
+
|
|
33
|
+
3. **Стандарты чистого кода (Clean Code)**:
|
|
34
|
+
- **DRY & KISS**: Избегай дублирования, пиши максимально просто и понятно.
|
|
35
|
+
- **SOLID**: Каждый модуль, класс или функция должны иметь одну четкую ответственность.
|
|
36
|
+
- **Декларативность**: Отдавай предпочтение декларативному стилю программирования (функциональные методы массивов, композиция).
|
|
37
|
+
- **Никаких сокращений**: Запрещено использовать сокращенные имена для переменных, свойств, аргументов, методов, классов и т. д. (например, нельзя использовать `el`, `rect1`/`r1`, `dx`/`dy`, `val`, `temp`). Все идентификаторы должны быть информативными, полными и самодокументируемыми.
|
|
38
|
+
- **Оптимизация и понятность**: Код должен быть максимально оптимизированным, производительным и понятным, обеспечивающим легкое чтение и поддержку.
|
|
39
|
+
- **Принцип единой ответственности**: Избегай создания больших «мега-функций» или монолитных блоков. Каждая функция должна быть лаконичной и решать ровно одну задачу (1 функция — 1 функционал).
|
|
40
|
+
|
|
41
|
+
4. **Бескомпромиссный TypeScript**:
|
|
42
|
+
- Никаких `any`. Используй `unknown`, если тип действительно неизвестен, или создавай generic-типы.
|
|
43
|
+
- Никогда не используй `@ts-ignore`. Если подавление проверки типов абсолютно необходимо из-за внешних ограничений, используй `@ts-expect-error` с обязательным поясняющим комментарием.
|
|
44
|
+
- Всегда определяй интерфейсы для входных и выходных данных.
|
|
45
|
+
- Используй `as const`, `readonly` и перечисления (enums/union types) для повышения надежности.
|
|
46
|
+
|
|
47
|
+
5. **Профессиональное документирование (TSDoc)**:
|
|
48
|
+
- Сопровождай все экспортируемые сущности комментариями TSDoc на [wikiLanguage] языке.
|
|
49
|
+
- Описывай назначение, параметры, возвращаемые значения и возможные исключения.
|
|
50
|
+
- Примеры использования в комментариях приветствуются для сложных функций.
|
|
51
|
+
|
|
52
|
+
6. **Архитектурная консистентность**:
|
|
53
|
+
- Соблюдай структуру проекта. Если в проекте принято выносить логику в `composables` или `utils` — следуй этому паттерну.
|
|
54
|
+
- Переиспользование инфраструктуры: Всегда проверяй, существует ли необходимый функционал (например, API-запросы, управление состоянием, утилиты) в базовых пакетах проекта (таких как `@dxtmisha/functional` или `@dxtmisha/functional-basic`), прежде чем писать его с нуля.
|
|
55
|
+
- Не изменяй глобальные стили или стили базовых UI-компонентов, если это не было явно запрошено.
|
|
56
|
+
|
|
57
|
+
7. **Безопасность и Производительность**:
|
|
58
|
+
- Пиши код, защищенный от ошибок (guard clauses, опциональная цепочка `?.`, nullish coalescing `??`).
|
|
59
|
+
- Используй явные блоки `try-catch` для асинхронных операций. Никогда не "проглатывай" ошибки молча; обрабатывай их корректно или выбрасывай информативные сообщения об ошибках.
|
|
60
|
+
- Избегай лишних вычислений в циклах и тяжелых операций в реактивных зависимостях.
|
|
61
|
+
|
|
62
|
+
8. **Эстетика и Лаконичность**:
|
|
63
|
+
- Код должен быть красивым. Используй логические отступы и группировку кода по смыслу.
|
|
64
|
+
- Экономь токены, избегая избыточных комментариев там, где код говорит сам за себя.
|
|
65
|
+
|
|
66
|
+
9. **Строгое следование инструкциям и оптимизация**:
|
|
67
|
+
- Выполняй все действия строго в соответствии с предоставленными командами и инструкциями.
|
|
68
|
+
- Избегай додумывания или выполнения не связанных с задачей лишних действий. Тем не менее, приветствуется глубокий анализ требований, оптимизация кода, а также поиск и реализация лучших технических решений, напрямую направленных на достижение целей поставленной задачи.
|
|
69
|
+
- Строго придерживайся планов, чек-листов и шагов выполнения, улучшая и дорабатывая их для повышения качества и производительности по мере необходимости.
|
|
70
|
+
|
|
71
|
+
10. **Память ИИ Пространства (`ai-memory.md`)**:
|
|
72
|
+
- Как установлено в БЛОКИРУЮЩЕМ КОНТРОЛЕ ПОСЛЕДОВАТЕЛЬНОСТИ, `ai-memory.md` ОБЯЗАТЕЛЬНО должен быть создан и прочитан локально внутри корня того конкретного пакета, с которым ты работаешь (например, `packages/constructor/ai-memory.md` для кода в `packages/constructor`).
|
|
73
|
+
- Запись или чтение `ai-memory.md` в корне репозитория при работе с кодом внутри пакета является критическим нарушением правил.
|
|
74
|
+
- Каждый раз, когда ты получаешь замечания, исправления или инструкции от разработчика, ты ОБЯЗАН обновить локальный файл `ai-memory.md` именно этого конкретного пакета.
|
|
75
|
+
- Явные запросы на запоминание: Если разработчик явно просит «запомнить это», «иметь в виду» или делает аналогичный запрос касательно соглашений или правил, ты ОБЯЗАН немедленно зафиксировать эту информацию в соответствующем локальном файле `ai-memory.md`.
|
|
76
|
+
- Активное применение: Ты ОБЯЗАН активно ПРИМЕНЯТЬ правила и ограничения из `ai-memory.md` ко всему генерируемому коду. Ограничения из этого файла имеют высший приоритет и переопределяют любые базовые предположения.
|
|
77
|
+
- ОСНОВНАЯ ЦЕЛЬ этого файла — хранение правил написания кода, архитектурных ограничений и принципов разработки (например: «не делай X, делай Y»), чтобы ИИ мог максимально правильно адаптировать и писать код.
|
|
78
|
+
- ЗАПРЕЩЕНО записывать туда историю изменений, списки обновленных файлов или сообщения в стиле коммитов (например: «обновлен файл X, обновлен пакет Y»). Файл должен содержать только актуальные стандарты, правила разработки и конструктивные требования к коду.
|
package/src/types/webTypes.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type WebTypesInfo = {
|
|
|
17
17
|
export type WebTypesProperty = {
|
|
18
18
|
name: string
|
|
19
19
|
type?: string
|
|
20
|
+
description?: string
|
|
20
21
|
}
|
|
21
22
|
export type WebTypesProperties = WebTypesProperty[]
|
|
22
23
|
|
|
@@ -51,7 +52,8 @@ export type WebTypesAttributes = WebTypesAttributeItem[]
|
|
|
51
52
|
export type WebTypesEventItem
|
|
52
53
|
= WebTypesInfo
|
|
53
54
|
& {
|
|
54
|
-
arguments
|
|
55
|
+
arguments?: WebTypesProperties
|
|
56
|
+
type?: string
|
|
55
57
|
}
|
|
56
58
|
export type WebTypesEvents = WebTypesEventItem[]
|
|
57
59
|
|
|
@@ -85,21 +87,48 @@ export type WebTypesTagItem
|
|
|
85
87
|
}
|
|
86
88
|
export type WebTypesTags = WebTypesTagItem[]
|
|
87
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Prop definition for a Vue component.
|
|
92
|
+
*
|
|
93
|
+
* Определение свойства для Vue-компонента.
|
|
94
|
+
*/
|
|
95
|
+
export type WebTypesPropItem = WebTypesInfo & {
|
|
96
|
+
default?: string
|
|
97
|
+
type?: string
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Vue component definition for Web-Types.
|
|
102
|
+
*
|
|
103
|
+
* Определение Vue-компонента для Web-Types.
|
|
104
|
+
*/
|
|
105
|
+
export type WebTypesVueComponentItem = WebTypesInfo & {
|
|
106
|
+
source?: {
|
|
107
|
+
module?: string
|
|
108
|
+
symbol?: string
|
|
109
|
+
}
|
|
110
|
+
props?: WebTypesPropItem[]
|
|
111
|
+
slots?: WebTypesSlots
|
|
112
|
+
js?: {
|
|
113
|
+
events?: WebTypesEventItem[]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
88
117
|
/**
|
|
89
118
|
* Root object for Web Types JSON.
|
|
90
119
|
*
|
|
91
120
|
* Корневой объект для JSON Web Types.
|
|
92
121
|
*/
|
|
93
122
|
export type WebTypesVueJson = {
|
|
94
|
-
$schema:
|
|
123
|
+
$schema: string
|
|
95
124
|
framework: 'vue'
|
|
96
125
|
name: string
|
|
97
126
|
version: string
|
|
127
|
+
'js-types-syntax'?: 'typescript'
|
|
98
128
|
contributions: {
|
|
99
129
|
html: {
|
|
100
|
-
'types-syntax': 'typescript'
|
|
101
130
|
'description-markup': 'markdown'
|
|
102
|
-
'
|
|
131
|
+
'vue-components': WebTypesVueComponentItem[]
|
|
103
132
|
}
|
|
104
133
|
}
|
|
105
134
|
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
### Global Development Principles (AI Code Promise)
|
|
2
|
-
|
|
3
|
-
Your primary goal is to generate flawless, industrial-grade code that adheres to dxt-ui standards. You promise to follow these rules strictly:
|
|
4
|
-
|
|
5
|
-
0. **Mandatory Deep Study**:
|
|
6
|
-
- Before developing anything for any project or package, you MUST study it completely to fully understand its architecture and stylistic guidelines.
|
|
7
|
-
- Before modifying or fixing any file, you MUST fully study its internal structure and logic first.
|
|
8
|
-
- If any instructions, paths, or files are specified as located inside `node_modules/` or any other external/linked directory, you MUST first check if this package exists locally in the workspace (for example, under `packages/`). If it does exist locally, you MUST resolve the paths to the local workspace package directory and study/modify the local source files instead.
|
|
9
|
-
- **CRITICAL FIRST STEP:** If any project, module, or instruction contains links or references to specific files (e.g. types, developer guides, descriptions), you MUST study all these referenced files as your absolute first action. As soon as you start working with a project, or notice that it is imported/used in the code you are working with, you must immediately read and study all these referenced files before doing any planning, proposing code changes, or writing code. This is mandatory and applies even if the files are located in `node_modules/` (always resolve them to the local workspace directory first if they exist locally).
|
|
10
|
-
- **STRICT BLOCKING GUARD (CHRONOLOGICAL ORDER RULES):**
|
|
11
|
-
1. Identify all package paths involved in the user request (e.g. `/packages/constructor/...` maps to `@dxtmisha/constructor`).
|
|
12
|
-
2. Scan the prompt for sections corresponding to those packages.
|
|
13
|
-
3. Identify all paths to auxiliary documentation/types mentioned in those sections (e.g., `ai-types.txt`, `ai-developer.txt`).
|
|
14
|
-
4. You MUST use the `view_file` tool to read and study ALL of these referenced files BEFORE calling `list_dir` on component sub-folders, writing any plans/checklists, or proposing/making code changes. Bypassing this order is a critical protocol violation.
|
|
15
|
-
|
|
16
|
-
1. **"Copy-Paste Ready" Principle**:
|
|
17
|
-
- Generate code that can be copied and run without a single manual edit.
|
|
18
|
-
- All imports must be absolute or correct relative paths.
|
|
19
|
-
- No `// ... rest of the code`, no `// imports here`. Only the complete, working file.
|
|
20
|
-
|
|
21
|
-
2. **Zero Tolerance for Hallucinations**:
|
|
22
|
-
- Use only the libraries and versions specified in the project's `package.json`.
|
|
23
|
-
- Do not invent API methods that do not exist in the current versions of dependencies.
|
|
24
|
-
- If information is insufficient, it is better to ask or point out the limitation than to hallucinate.
|
|
25
|
-
|
|
26
|
-
3. **Clean Code Standards**:
|
|
27
|
-
- **DRY & KISS**: Avoid duplication, write as simply and clearly as possible.
|
|
28
|
-
- **SOLID**: Every module, class, or function must have one clear responsibility.
|
|
29
|
-
- **Declarative Approach**: Prefer a declarative programming style (array functional methods, composition).
|
|
30
|
-
- **No Abbreviations**: Do not use shortened or abbreviated names for variables, properties, arguments, methods, classes, etc. (e.g., do not use `el`, `rect1`/`r1`, `dx`/`dy`, `val`, `temp`). All identifiers must be descriptive, complete, and self-explanatory.
|
|
31
|
-
- **Optimization and Clarity**: Write code that is highly optimized, performant, and clean, ensuring it is easy to read and understand.
|
|
32
|
-
- **Single Responsibility (KISS/SOLID)**: Avoid creating large "mega-functions" or monolithic blocks. Each function must be concise and perform exactly one focused task (1 function = 1 functionality).
|
|
33
|
-
|
|
34
|
-
4. **Uncompromising TypeScript**:
|
|
35
|
-
- No `any`. Use `unknown` if the type is truly unknown, or create generic types.
|
|
36
|
-
- Always define interfaces for input and output data.
|
|
37
|
-
- Use `as const`, `readonly`, and enums/union types to increase reliability.
|
|
38
|
-
|
|
39
|
-
5. **Professional Documentation (TSDoc)**:
|
|
40
|
-
- Accompany all exported entities with TSDoc comments in the [wikiLanguage] language.
|
|
41
|
-
- Describe the purpose, parameters, return values, and potential exceptions.
|
|
42
|
-
- Usage examples in comments are encouraged for complex functions.
|
|
43
|
-
|
|
44
|
-
6. **Architectural Consistency**:
|
|
45
|
-
- Respect the project structure. If it is standard in the project to move logic into `composables` or `utils`, follow that pattern.
|
|
46
|
-
- Do not modify global styles or styles of base UI components unless explicitly requested.
|
|
47
|
-
|
|
48
|
-
7. **Security and Performance**:
|
|
49
|
-
- Write error-proof code (guard clauses, optional chaining `?.`, nullish coalescing `??`).
|
|
50
|
-
- Avoid redundant calculations in loops and heavy operations in reactive dependencies.
|
|
51
|
-
|
|
52
|
-
8. **Aesthetics and Conciseness**:
|
|
53
|
-
- The code must be beautiful. Use logical indentation and group code by meaning.
|
|
54
|
-
- Save tokens by avoiding redundant comments where the code speaks for itself.
|
|
55
|
-
|
|
56
|
-
9. **Strict Adherence to Instructions**:
|
|
57
|
-
- Perform all operations strictly in accordance with the provided commands and instructions.
|
|
58
|
-
- Avoid guessing, improvisation, or performing any unrequested or extra actions.
|
|
59
|
-
- Strictly adhere to the plan, checklists, and execution steps.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
### Глобальные принципы разработки (AI Code Promise)
|
|
2
|
-
|
|
3
|
-
Твоя главная цель — генерировать безупречный, промышленный код, который соответствует стандартам dxt-ui. Ты обещаешь следовать этим правилам неукоснительно:
|
|
4
|
-
|
|
5
|
-
0. **Обязательное глубокое изучение**:
|
|
6
|
-
- Прежде чем разрабатывать что-либо для любого проекта или пакета, ты ОБЯЗАН полностью изучить его, чтобы детально понять его архитектуру и стилистику.
|
|
7
|
-
- Прежде чем изменять или исправлять любой файл, ты ОБЯЗАН полностью изучить его внутреннюю структуру и логику.
|
|
8
|
-
- Если в инструкциях, путях или файлах указано расположение внутри `node_modules/` или любой другой внешней/привязанной директории, ты ОБЯЗАН сначала проверить, существует ли этот пакет локально в рабочей области (например, в каталоге `packages/`). Если пакет существует локально, ты ОБЯЗАН переопределить пути на локальный каталог пакета рабочей области и изучать/изменять локальные исходные файлы вместо указанных.
|
|
9
|
-
- **КРИТИЧЕСКИЙ ПЕРВЫЙ ШАГ:** Если какой-либо проект, модуль или инструкция содержит ссылки или пути к конкретным файлам (например, типы, руководства для разработчиков, описания), ты ОБЯЗАН подробно изучить все эти файлы по ссылкам в первую очередь. Как только ты начинаешь работу с проектом или видишь, что он импортируется/используется в коде, над которым ты работаешь, ты должен незамедлительно прочитать и изучить все эти файлы по ссылкам, прежде чем приступать к планированию, предложению изменений или написанию кода. Это требование обязательно и распространяется в том числе на файлы, находящиеся в `node_modules/` (всегда сначала переопределяй пути на локальный каталог рабочей области, если они существуют локально).
|
|
10
|
-
- **БЛОКИРУЮЩИЙ КОНТРОЛЬ ПОСЛЕДОВАТЕЛЬНОСТИ (ПРАВИЛО ХРОНОЛОГИИ):**
|
|
11
|
-
1. Определи все пути пакетов, связанных с запросом (например, `/packages/constructor/...` относится к `@dxtmisha/constructor`).
|
|
12
|
-
2. Найди в промпте секции, соответствующие этим пакетам.
|
|
13
|
-
3. Выпиши все пути к вспомогательным файлам типов и руководств, упомянутые в этих секциях (например, `ai-types.txt`, `ai-developer.txt`).
|
|
14
|
-
4. Ты ОБЯЗАН использовать инструмент `view_file` для чтения и изучения ВСЕХ этих файлов ДО ТОГО, как вызывать `list_dir` для папок компонентов, писать какие-либо планы/чек-листы или вносить/предлагать изменения в код. Нарушение этой последовательности является критическим нарушением протокола.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
1. **Принцип «Copy-Paste Ready» (Готовность к использованию)**:
|
|
19
|
-
- Генерируй код, который можно скопировать и запустить без единой правки.
|
|
20
|
-
- Все импорты должны быть абсолютными или корректными относительными.
|
|
21
|
-
- Никаких `// ... остальной код`, никаких `// импорты здесь`. Только полный, рабочий файл.
|
|
22
|
-
|
|
23
|
-
2. **Нулевая толерантность к галлюцинациям**:
|
|
24
|
-
- Используй только те библиотеки и версии, которые указаны в `package.json` проекта.
|
|
25
|
-
- Не выдумывай методы API, которых не существует в текущих версиях зависимостей.
|
|
26
|
-
- Если информации недостаточно — лучше спроси или укажи на ограничение, чем галлюцинируй.
|
|
27
|
-
|
|
28
|
-
3. **Стандарты чистого кода (Clean Code)**:
|
|
29
|
-
- **DRY & KISS**: Избегай дублирования, пиши максимально просто и понятно.
|
|
30
|
-
- **SOLID**: Каждый модуль, класс или функция должны иметь одну четкую ответственность.
|
|
31
|
-
- **Декларативность**: Отдавай предпочтение декларативному стилю программирования (функциональные методы массивов, композиция).
|
|
32
|
-
- **Никаких сокращений**: Запрещено использовать сокращенные имена для переменных, свойств, аргументов, методов, классов и т. д. (например, нельзя использовать `el`, `rect1`/`r1`, `dx`/`dy`, `val`, `temp`). Все идентификаторы должны быть информативными, полными и самодокументируемыми.
|
|
33
|
-
- **Оптимизация и понятность**: Код должен быть максимально оптимизированным, производительным и понятным, обеспечивающим легкое чтение и поддержку.
|
|
34
|
-
- **Принцип единой ответственности**: Избегай создания больших «мега-функций» или монолитных блоков. Каждая функция должна быть лаконичной и решать ровно одну задачу (1 функция — 1 функционал).
|
|
35
|
-
|
|
36
|
-
4. **Бескомпромиссный TypeScript**:
|
|
37
|
-
- Никаких `any`. Используй `unknown`, если тип действительно неизвестен, или создавай generic-типы.
|
|
38
|
-
- Всегда определяй интерфейсы для входных и выходных данных.
|
|
39
|
-
- Используй `as const`, `readonly` и перечисления (enums/union types) для повышения надежности.
|
|
40
|
-
|
|
41
|
-
5. **Профессиональное документирование (TSDoc)**:
|
|
42
|
-
- Сопровождай все экспортируемые сущности комментариями TSDoc на [wikiLanguage] языке.
|
|
43
|
-
- Описывай назначение, параметры, возвращаемые значения и возможные исключения.
|
|
44
|
-
- Примеры использования в комментариях приветствуются для сложных функций.
|
|
45
|
-
|
|
46
|
-
6. **Архитектурная консистентность**:
|
|
47
|
-
- Соблюдай структуру проекта. Если в проекте принято выносить логику в `composables` или `utils` — следуй этому паттерну.
|
|
48
|
-
- Не изменяй глобальные стили или стили базовых UI-компонентов, если это не было явно запрошено.
|
|
49
|
-
|
|
50
|
-
7. **Безопасность и Производительность**:
|
|
51
|
-
- Пиши код, защищенный от ошибок (guard clauses, опциональная цепочка `?.`, nullish coalescing `??`).
|
|
52
|
-
- Избегай лишних вычислений в циклах и тяжелых операций в реактивных зависимостях.
|
|
53
|
-
|
|
54
|
-
8. **Эстетика и Лаконичность**:
|
|
55
|
-
- Код должен быть красивым. Используй логические отступы и группировку кода по смыслу.
|
|
56
|
-
- Экономь токены, избегая избыточных комментариев там, где код говорит сам за себя.
|
|
57
|
-
|
|
58
|
-
9. **Строгое следование инструкциям**:
|
|
59
|
-
- Выполняй все действия строго в соответствии с предоставленными командами и инструкциями.
|
|
60
|
-
- Никакой самодеятельности, додумывания или выполнения лишних/незапрошенных действий.
|
|
61
|
-
- Строго придерживайся планов, чек-листов и шагов выполнения.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|