@dxtmisha/scripts 0.10.3 → 0.10.4
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 +8 -0
- package/package.json +1 -1
- package/src/classes/Ai/AiDoc.ts +27 -9
- package/src/classes/Design/DesignComponent.ts +1 -1
- package/src/classes/Design/DesignConstructor.ts +1 -1
- package/src/classes/Design/DesignUi.ts +4 -4
- package/src/classes/Library/LibraryAiPromptItem.ts +2 -1
- package/src/classes/Package/PackageFile.ts +4 -0
- package/src/media/templates/packages/library/package.json +2 -2
- package/src/media/templates/prompts/aiCodeGlobalPrompt.en.md +3 -2
- package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.md +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.10.4] - 2026-06-29
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **JSDoc**: Added comprehensive bilingual (EN/RU) JSDoc comments to the `AiDoc` class, its constructor, and all internal methods.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **AiDoc**: Initialized `ServerStorage.setErrorStatus(true)` in the constructor to force standard error status config on ServerStorage during AI documentation generation.
|
|
12
|
+
|
|
5
13
|
## [0.10.3] - 2026-06-25
|
|
6
14
|
|
|
7
15
|
### 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.4",
|
|
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": [
|
package/src/classes/Ai/AiDoc.ts
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
|
+
import { ServerStorage } from '@dxtmisha/functional-basic'
|
|
2
|
+
|
|
1
3
|
import { PropertiesConfig } from '../Properties/PropertiesConfig'
|
|
2
4
|
import { GitRead } from '../Git/GitRead'
|
|
3
5
|
import { AiDocType } from './AiDocType'
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Class for generating AI documentation.
|
|
9
|
+
* It manages the process of reading directories, fetching files, and
|
|
10
|
+
* delegating the documentation generation to specific processors.
|
|
7
11
|
*
|
|
8
|
-
* Класс для генерации AI
|
|
12
|
+
* Класс для генерации AI-документации.
|
|
13
|
+
* Управляет процессом чтения директорий, получения файлов и делегирования
|
|
14
|
+
* генерации документации специализированным процессорам.
|
|
9
15
|
*/
|
|
10
16
|
export class AiDoc {
|
|
11
17
|
/**
|
|
12
|
-
*
|
|
18
|
+
* Constructor for AiDoc. Sets error status config for ServerStorage.
|
|
19
|
+
*
|
|
20
|
+
* Конструктор для AiDoc. Устанавливает конфигурацию статуса ошибок для ServerStorage.
|
|
21
|
+
*/
|
|
22
|
+
constructor() {
|
|
23
|
+
ServerStorage.setErrorStatus(true)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Main method to generate documentation for configured directories.
|
|
13
28
|
*
|
|
14
|
-
* Основной метод для генерации
|
|
29
|
+
* Основной метод для генерации документации по настроенным директориям.
|
|
30
|
+
* @returns promise that resolves when generation is complete / промис, завершающийся по окончании генерации
|
|
15
31
|
*/
|
|
16
32
|
async make() {
|
|
17
33
|
const dirs = PropertiesConfig.getAiDocDirectory()
|
|
@@ -30,10 +46,11 @@ export class AiDoc {
|
|
|
30
46
|
}
|
|
31
47
|
|
|
32
48
|
/**
|
|
33
|
-
* Process a specific directory.
|
|
49
|
+
* Process a specific directory, generating documentation for its files.
|
|
34
50
|
*
|
|
35
|
-
* Обрабатывает конкретную
|
|
36
|
-
* @param dir
|
|
51
|
+
* Обрабатывает конкретную директорию, генерируя документацию для её файлов.
|
|
52
|
+
* @param dir directory path / путь к директории
|
|
53
|
+
* @returns promise that resolves when processing is complete / промис, завершающийся по окончании обработки
|
|
37
54
|
*/
|
|
38
55
|
async makeDirectory(dir: string) {
|
|
39
56
|
console.log('')
|
|
@@ -50,10 +67,11 @@ export class AiDoc {
|
|
|
50
67
|
}
|
|
51
68
|
|
|
52
69
|
/**
|
|
53
|
-
* Get list of files in a directory.
|
|
70
|
+
* Get filtered list of files in a directory via Git tracker.
|
|
54
71
|
*
|
|
55
|
-
* Получает список файлов в
|
|
56
|
-
* @param dir
|
|
72
|
+
* Получает отфильтрованный список файлов в директории через Git трекер.
|
|
73
|
+
* @param dir directory path / путь к директории
|
|
74
|
+
* @returns list of file paths / список путей к файлам
|
|
57
75
|
*/
|
|
58
76
|
protected getListByDirectory(dir: string) {
|
|
59
77
|
return GitRead.filterByDirectory(
|
|
@@ -793,7 +793,7 @@ export class DesignComponent extends DesignCommand {
|
|
|
793
793
|
this.updatePackage(
|
|
794
794
|
`exports|${name}`,
|
|
795
795
|
{
|
|
796
|
-
types: `./dist/
|
|
796
|
+
types: `./dist/library/${this.getFullName()}.d.ts`,
|
|
797
797
|
default: `./dist/${this.getFullName()}.js`
|
|
798
798
|
}
|
|
799
799
|
)
|
|
@@ -195,7 +195,7 @@ export class DesignConstructor extends DesignCommand {
|
|
|
195
195
|
this.updatePackage(
|
|
196
196
|
`exports|${name}`,
|
|
197
197
|
{
|
|
198
|
-
types: `./dist/
|
|
198
|
+
types: `./dist/constructors/${command}/index.d.ts`,
|
|
199
199
|
default: `./dist/${this.getNameMin()}.js`
|
|
200
200
|
}
|
|
201
201
|
)
|
|
@@ -106,15 +106,15 @@ export class DesignUi {
|
|
|
106
106
|
|
|
107
107
|
if (packageJson?.exports) {
|
|
108
108
|
packageJson.exports['.'] = {
|
|
109
|
-
types: './dist/
|
|
109
|
+
types: './dist/library/types.d.ts',
|
|
110
110
|
default: './dist/types.js'
|
|
111
111
|
}
|
|
112
112
|
packageJson.exports['./plugin'] = {
|
|
113
|
-
types: './dist/
|
|
113
|
+
types: './dist/library/plugin.d.ts',
|
|
114
114
|
default: './dist/plugin.js'
|
|
115
115
|
}
|
|
116
116
|
packageJson.exports['./media'] = {
|
|
117
|
-
types: './dist/
|
|
117
|
+
types: './dist/library/media.d.ts',
|
|
118
118
|
default: './dist/media.js'
|
|
119
119
|
}
|
|
120
120
|
packageJson.exports['./style.css'] = './dist/style.css'
|
|
@@ -123,7 +123,7 @@ export class DesignUi {
|
|
|
123
123
|
sass: './ui-properties.scss',
|
|
124
124
|
default: './ui-properties.scss'
|
|
125
125
|
}
|
|
126
|
-
packageJson.exports['./types.d.ts'] = './dist/
|
|
126
|
+
packageJson.exports['./types.d.ts'] = './dist/library/types.d.ts'
|
|
127
127
|
packageJson['web-types'] = './dist/web-types.json'
|
|
128
128
|
|
|
129
129
|
PropertiesFile.writeByPath(UI_FILE_PACKAGE, packageJson)
|
|
@@ -207,6 +207,7 @@ ${data.join('\n\n')}
|
|
|
207
207
|
|
|
208
208
|
return `
|
|
209
209
|
## Project context: Investigation required
|
|
210
|
+
You MUST read and carefully analyze the description of this project below. If there is even a 1% chance that the functionality, components, styles, or helpers from this project could be useful for your task, you MUST immediately start analyzing this project, studying its types, and checking its structure in full to prevent custom code duplication:
|
|
210
211
|
${this.readFile(UI_FILE_AI_PROMPT_DESCRIPTION)}
|
|
211
212
|
`.trim()
|
|
212
213
|
}
|
|
@@ -269,7 +270,7 @@ ${this.readFile(UI_FILE_AI_PROMPT_INFO)}
|
|
|
269
270
|
|
|
270
271
|
return `
|
|
271
272
|
## Project types: Essential for analysis
|
|
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
|
|
273
|
+
This file contains the complete type definitions, available utilities, and component structures 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, analyze, and study this type definition file COMPLETELY and IN FULL (NOT partially), as your absolute first action using the view_file tool. This is mandatory to fully understand its API, locate all existing utilities/helpers (полезности), and prevent writing duplicate code:
|
|
273
274
|
'${this.getPathString()}/${UI_FILE_AI_PROMPT_TYPES}'
|
|
274
275
|
`.trim()
|
|
275
276
|
}
|
|
@@ -122,6 +122,10 @@ export class PackageFile {
|
|
|
122
122
|
getCodeBuildOrRecovery(): string | undefined {
|
|
123
123
|
const scripts = this.getScripts()
|
|
124
124
|
|
|
125
|
+
if ('prepublishOnly' in scripts) {
|
|
126
|
+
return 'prepublishOnly'
|
|
127
|
+
}
|
|
128
|
+
|
|
125
129
|
if ('build-recovery' in scripts) {
|
|
126
130
|
return 'build-recovery'
|
|
127
131
|
}
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
],
|
|
29
29
|
"main": "dist/library.js",
|
|
30
30
|
"module": "dist/library.js",
|
|
31
|
-
"types": "dist/
|
|
31
|
+
"types": "dist/library.d.ts",
|
|
32
32
|
"exports": {
|
|
33
33
|
".": {
|
|
34
34
|
"import": "./dist/library.js",
|
|
35
|
-
"types": "./dist/
|
|
35
|
+
"types": "./dist/library.d.ts"
|
|
36
36
|
},
|
|
37
37
|
"./style.css": "./dist/style.css"
|
|
38
38
|
},
|
|
@@ -15,8 +15,8 @@ Your primary goal is to generate flawless, industrial-grade code that adheres to
|
|
|
15
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
16
|
3. Identify all paths, directories, or packages involved in the user request.
|
|
17
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.
|
|
18
|
+
5. Identify all paths to auxiliary documentation, types, or developer guides (such as `ai-types.md` or `ai-developer.md`) mentioned in those sections.
|
|
19
|
+
6. You MUST use the `view_file` tool to read and study ALL of these referenced files (specifically, if type files like `ai-types.md` or developer guides like `ai-developer.md` are specified for the packages you are working on, you MUST read them completely) 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
20
|
|
|
21
21
|
1. **"Copy-Paste Ready" Principle**:
|
|
22
22
|
- Generate code that can be copied and run without a single manual edit.
|
|
@@ -74,4 +74,5 @@ Your primary goal is to generate flawless, industrial-grade code that adheres to
|
|
|
74
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
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
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
|
+
- DO NOT specify absolute file paths (e.g., file:///... or machine-specific directories like /Users/...) in the memory file. All references to files inside the project must use relative paths (e.g., src/types/textTypes.ts) so that the file works seamlessly for other developers on different operating systems and computers.
|
|
77
78
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
2. В качестве АБСОЛЮТНО ВТОРОГО ДЕЙСТВИЯ, ты ОБЯЗАН использовать инструмент `view_file` для чтения главного файла `ai-prompt.md` в корне проекта. Ты ОБЯЗАН изучить описания ВСЕХ библиотек, упомянутых в этом файле. Если тебе кажется хотя бы на мизерный процент (1%), что в какой-либо библиотеке есть что-то подходящее или полезное для твоей задачи, ты ОБЯЗАН изучить все файлы в этой библиотеке, которые указаны в `ai-prompt.md` в разделе этой библиотеки. Тебе строго запрещено писать кастомные реализации (хелперы, стили, конфигурации, классы) или придумывать свое, не проверив предварительно существующую инфраструктуру рабочей области (например, `functional`, `functional-basic`).
|
|
16
16
|
3. Определи все пути пакетов или директорий, связанных с запросом.
|
|
17
17
|
4. Найди в промпте секции, соответствующие этим путям.
|
|
18
|
-
5. Выпиши все пути к вспомогательным файлам типов и
|
|
19
|
-
6. Ты ОБЯЗАН использовать инструмент `view_file` для чтения и изучения ВСЕХ этих файлов ДО ТОГО, как вызывать `list_dir` для папок компонентов, писать какие-либо планы/чек-листы или вносить/предлагать изменения в код. Нарушение этой последовательности является критическим нарушением протокола.
|
|
18
|
+
5. Выпиши все пути к вспомогательным файлам типов и руководств (таким как `ai-types.md` или `ai-developer.md`), упомянутые в этих секциях.
|
|
19
|
+
6. Ты ОБЯЗАН использовать инструмент `view_file` для чтения и изучения ВСЕХ этих файлов (в частности, если для пакетов, с которыми ты работаешь, указаны файлы типов `ai-types.md` или руководств `ai-developer.md`, ты ОБЯЗАН прочитать их полностью) ДО ТОГО, как вызывать `list_dir` для папок компонентов, писать какие-либо планы/чек-листы или вносить/предлагать изменения в код. Нарушение этой последовательности является критическим нарушением протокола.
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
@@ -76,3 +76,4 @@
|
|
|
76
76
|
- Активное применение: Ты ОБЯЗАН активно ПРИМЕНЯТЬ правила и ограничения из `ai-memory.md` ко всему генерируемому коду. Ограничения из этого файла имеют высший приоритет и переопределяют любые базовые предположения.
|
|
77
77
|
- ОСНОВНАЯ ЦЕЛЬ этого файла — хранение правил написания кода, архитектурных ограничений и принципов разработки (например: «не делай X, делай Y»), чтобы ИИ мог максимально правильно адаптировать и писать код.
|
|
78
78
|
- ЗАПРЕЩЕНО записывать туда историю изменений, списки обновленных файлов или сообщения в стиле коммитов (например: «обновлен файл X, обновлен пакет Y»). Файл должен содержать только актуальные стандарты, правила разработки и конструктивные требования к коду.
|
|
79
|
+
- ЗАПРЕЩЕНО указывать абсолютные пути к файлам (например, file:///... или локальные пути вроде /Users/...) в файле памяти. Все ссылки на файлы внутри проекта должны использовать относительные пути (например, src/types/textTypes.ts), чтобы этот файл корректно работал у других разработчиков на разных компьютерах и операционных системах.
|