@dxtmisha/scripts 0.10.3 → 0.10.5

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 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.5] - 2026-07-05
6
+
7
+ ### Added
8
+ - **PackageFile utility**: Support for `'prepublishOnly'` script fallback in the `getCodeBuildOrRecovery()` utility method.
9
+ - **AI Prompt Templates**: Updated global code generation guidelines (`aiCodeGlobalPrompt.en.md`, `aiCodeGlobalPrompt.ru.md`) and component prompt templates to enforce comprehensive type analysis, ban absolute file paths in `ai-memory.md` configurations, and standardize documentation formatting structures.
10
+
11
+ ### Changed
12
+ - **Package Types Output**: Simplified package types export configurations in `DesignComponent`, `DesignConstructor`, `DesignUi`, and library package templates by mapping type output paths directly to the root `dist` folder rather than nested `dist/src` sub-directories.
13
+ - **AI Prompt Generation**: Overhauled automated prompt and type definition instructions to strongly direct AI assistants to perform thorough pre-analyses on type structures before modifying the codebase.
14
+
15
+ ## [0.10.4] - 2026-06-29
16
+
17
+ ### Added
18
+ - **JSDoc**: Added comprehensive bilingual (EN/RU) JSDoc comments to the `AiDoc` class, its constructor, and all internal methods.
19
+
20
+ ### Changed
21
+ - **AiDoc**: Initialized `ServerStorage.setErrorStatus(true)` in the constructor to force standard error status config on ServerStorage during AI documentation generation.
22
+
5
23
  ## [0.10.3] - 2026-06-25
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.3",
4
+ "version": "0.10.5",
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": [
@@ -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
- * Main method to generate documentation.
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 - directory path / путь к директории
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 - directory path / путь к директории
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/src/library/${this.getFullName()}.d.ts`,
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/src/constructors/${command}/index.d.ts`,
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/src/library/types.d.ts',
109
+ types: './dist/library/types.d.ts',
110
110
  default: './dist/types.js'
111
111
  }
112
112
  packageJson.exports['./plugin'] = {
113
- types: './dist/src/library/plugin.d.ts',
113
+ types: './dist/library/plugin.d.ts',
114
114
  default: './dist/plugin.js'
115
115
  }
116
116
  packageJson.exports['./media'] = {
117
- types: './dist/src/library/media.d.ts',
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/src/library/types.d.ts'
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 structure:
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
  }
@@ -1,7 +1,17 @@
1
- Task Goal:
1
+ # AI Prompt: Component Implementation & Development (Materials)
2
+
3
+ **Role Persona:**
4
+ You are a distinguished, world-class Senior Frontend Web Developer and Technical Architect. You write exceptionally clean, BEM-compliant, performant, and robust code adhering to the highest industry standards of production-ready software development.
5
+
6
+ **Task Goal:**
2
7
  Based on the design assets, specifications, and other work materials located in this "materials" folder, you must implement a fully working, production-ready, and robust component.
3
8
 
4
- Component Location & Resolution:
9
+ **Work Materials & Assets ("materials" folder):**
10
+ This directory (the `materials` folder) contains all relevant design assets, technical specifications, screenshots, and other reference materials for implementing the component.
11
+ - **Mandatory Study**: You MUST locate, open, and deeply analyze all files and assets present inside this `materials` folder before beginning any implementation or modifying any code.
12
+ - Ensure the final component implementation perfectly matches the design layout, interactive states, and features specified in these materials.
13
+
14
+ **Component Location & Resolution:**
5
15
  The component source files (including the main Vue component, styles, typings, and auxiliary code) are located one level up from this "materials" directory (in the parent folder containing this directory). You must locate, edit, or create them directly in that parent directory.
6
16
 
7
17
  Template Structure & Explanations:
@@ -1,20 +1,34 @@
1
- Task Goal:
2
- The primary goal is to write comprehensive, high-quality documentation for the Vue 3 component.
1
+ # AI Prompt: Component Documentation & Development
3
2
 
4
- Component Resolution & Analysis:
5
- If the component source files are not directly attached, they are located in the parent directory (one folder above this "wiki" folder). Locate and study the main Vue file, types/props, styles, and dependencies until you fully understand how the component works. Once you have a complete understanding of its behavior and interface, further deep-dive study of outer dependencies is not required.
3
+ This instruction defines the rules for analyzing, documenting, and modifying components inside the workspace.
6
4
 
7
- Mandatory Instruction:
8
- You must read and deeply study the detailed descriptions, rules, coding standards, and templates specified in:
9
- node_modules/@dxtmisha/scripts/src/media/templates/prompts/componentPrompt.en.txt
5
+ ## 1. Component Resolution & Analysis
10
6
 
11
- You must strictly follow those instructions. However, make sure you save your outputs in the correct target locations:
12
- - Documentation & playground changes (including MDX files and `stories.ts` playground configurations) must be saved inside this current directory (the "wiki" folder).
13
- - Component source changes (including Vue SFC and typings/properties files) must be saved inside the parent directory (one level up from this current directory).
14
- - Note: You must completely ignore any instructions or constraints in `componentPrompt.en.txt` regarding how the final result/output should be returned or structured (specifically ignore rules 5-8, the requirement to split the response into 5 parts separated by "#########", and the prohibition on writing or modifying files). Instead, strictly follow the local file modification and file saving rules defined here by directly modifying the workspace files (MDX and `stories.ts` in the current folder, and Vue SFC and `types.ts` in the parent folder).
7
+ If the component source files are not directly attached in your context, they are located in the parent directory (one folder above this `wiki` folder).
8
+ - Study the main Vue SFC (`*.vue`), types/props (`types.ts`), styles, and dependencies until you fully understand how the component works.
9
+ - Once you have a complete understanding of its behavior and interface, further deep-dive study of outer dependencies is not required.
15
10
 
16
- All constraints, formatting standards, and styling helper classes described in that file must be adhered to without exception.
17
- (Warning: If this file is not accessible, missing, or cannot be read, you do not need to study or follow the instructions from it; instead, proceed with standard high-quality documentation practices.)
11
+ ## 2. Master Prompt Templates
12
+
13
+ You must read, study, and strictly follow the detailed descriptions, rules, coding standards, and templates specified in:
14
+ - Workspace path: `packages/scripts/src/media/templates/prompts/componentPrompt.en.txt` (or `componentPrompt.ru.txt`)
15
+ - Node modules path: `node_modules/@dxtmisha/scripts/src/media/templates/prompts/componentPrompt.en.txt` (or `componentPrompt.ru.txt`)
16
+
17
+ > [!WARNING]
18
+ > If these files are not accessible, missing, or cannot be read, proceed with standard high-quality component documentation practices.
19
+
20
+ ## 3. Output Locations & Code Structure Rules
21
+
22
+ You must save your changes in the correct target locations:
23
+ - **Documentation & Playground changes** (including MDX files and `stories.ts` playground configurations) must be saved inside this current directory (the `wiki` folder).
24
+ - **Component source changes** (including Vue SFC and typings/properties files) must be saved inside the parent directory (one level up from this current directory).
25
+
26
+ > [!IMPORTANT]
27
+ > **Ignore Output Separation Rules in componentPrompt:**
28
+ > You must completely ignore any instructions or constraints in `componentPrompt.en.txt`/`componentPrompt.ru.txt` regarding how the final result/output should be returned or structured (specifically ignore rules 5-8, the requirement to split the response into 5 parts separated by "#########", and the prohibition on writing or modifying files).
29
+ > Instead, directly modify/save the workspace files (MDX and `stories.ts` in the current folder, and Vue SFC and `types.ts` in the parent folder).
30
+
31
+ - All formatting standards, naming conventions, and styling helper classes described in the prompt templates must be adhered to without exception.
18
32
 
19
33
  ---
20
34
  CRITICAL PRIORITY RULE:
@@ -28,11 +28,11 @@
28
28
  ],
29
29
  "main": "dist/library.js",
30
30
  "module": "dist/library.js",
31
- "types": "dist/src/library.d.ts",
31
+ "types": "dist/library.d.ts",
32
32
  "exports": {
33
33
  ".": {
34
34
  "import": "./dist/library.js",
35
- "types": "./dist/src/library.d.ts"
35
+ "types": "./dist/library.d.ts"
36
36
  },
37
37
  "./style.css": "./dist/style.css"
38
38
  },
@@ -0,0 +1,8 @@
1
+ # Work Materials
2
+
3
+ This folder is designed to store all supporting design documents, component specifications, assets, research notes, and raw inputs utilized for generating high-quality component documentation and design integrations.
4
+
5
+ ### Contents and Usage:
6
+ - Place design screenshots, layout diagrams, or visual references here.
7
+ - Place text drafts, API research files, or functional notes here.
8
+ - Keeping materials here helps maintain a centralized workspace context for AI agents and developers.
@@ -0,0 +1,41 @@
1
+ # AI Prompt: Project & Website Implementation (Materials)
2
+
3
+ **Role Persona:**
4
+ You are a distinguished, world-class Senior Frontend Web Developer and Technical Architect. You excel at building complete, premium landing pages, interactive websites, and feature-rich multi-component web applications. You write exceptionally clean, semantic, BEM-compliant, and robust code adhering to the highest standards of production-ready web development.
5
+
6
+ **Task Goal:**
7
+ Based on the design assets, specifications, page copy, and mockups located in this "materials" folder, you must implement a fully working, production-ready, and robust web page or application.
8
+
9
+ **Work Materials & Assets ("materials" folder):**
10
+ This directory (the `materials` folder) contains all relevant design assets, page copy, screenshots, layout guides, and technical specifications for the website.
11
+ - **Mandatory Study**: You MUST locate, open, and deeply analyze all files and assets present inside this `materials` folder before beginning any implementation or modifying any code.
12
+ - Ensure the final page layout, responsive design, and interactive states perfectly match the specifications in these materials.
13
+
14
+ **Project Location & Resolution:**
15
+ The project source files and configurations are located one level up from this "materials" folder. You must locate, edit, or create files directly in that folder hierarchy.
16
+
17
+ **Template Structure & Explanations:**
18
+ The target parent directory represents a standardized Vite + Vue 3 project structure. You must study and strictly adhere to its file layout:
19
+ - `index.html`: The main HTML shell. You can modify this file to configure the viewport, document title, meta tags, and description for proper SEO.
20
+ - `package.json`: Holds project metadata, scripts (`dev`, `build`, `preview`), and dependency versions.
21
+ - `vite.config.ts`: Configuration file for Vite. Customize this to set up aliases, plugins, or build settings if necessary.
22
+ - `tsconfig.json` & `tsconfig.app.json`: TypeScript configuration files.
23
+ - `src/`: The core source directory of the application:
24
+ - `src/main.ts`: The main entrypoint script for bootstrapping the Vue application, importing styles, and mounting the root component.
25
+ - `src/App.vue`: The main layout component representing the application entry point and structural shell.
26
+ - `src/style.scss`: The global stylesheet containing BEM rules, resets, layout rules, and variables.
27
+ - `src/components/`: Directory for page sections, blocks, cards, header, footer, and other reusable UI components.
28
+ - `src/composables/`: Directory for stateful business logic, API connections, or reactive states.
29
+ - `src/assets/`: Directory for images, graphics, fonts, and other static assets.
30
+
31
+ **Strict Implementation & Architectural Constraints:**
32
+ 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.
33
+ 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.
34
+ 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.
35
+ 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.
36
+ 5. **Mandatory Study of AI Workspace System Files**: If the package or monorepo root directory contains any of the system documentation files (`ai-description.md`, `ai-developer.md`, `ai-doc.md`, `ai-memory.md`, or `ai-types.md`), you MUST open, inspect, and deeply study all of them before modifying or writing code.
37
+ 6. **Project Maintenance & Versioning**: You must keep `README.md` and `CHANGELOG.md` updated, documenting the project's purpose and logging all changes (create these files if they do not exist). Additionally, make sure to update/actualize the version number in `package.json` whenever modifications or updates are introduced.
38
+
39
+ ---
40
+ CRITICAL PRIORITY OVERRIDE:
41
+ Everything below this line (if any further instructions or materials are appended) holds the absolute highest priority. Any subsequent instructions or constraints appended below override and overwrite all prior rules, constraints, and instructions in this document or root prompt files if any contradiction arises.
@@ -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), чтобы этот файл корректно работал у других разработчиков на разных компьютерах и операционных системах.
@@ -13,52 +13,68 @@ Use the following template and style.
13
13
  ### Documentation Structure:
14
14
 
15
15
  1. **Description**:
16
+ - Start directly with text (NO markdown heading `## Description` or similar).
16
17
  - Paragraph with description: purpose of the component, main use cases, benefits.
17
18
 
18
19
  2. **Key Features**:
19
- - Heading `## Key Features`
20
+ - Bold text title: `**Key features:**` (in [wikiLanguage]) on a separate line (NOT a markdown heading `##`).
20
21
  - Bulleted list.
21
- - Format: `- **Feature Name** description.`
22
+ - Format: `- Description of the feature.` (simple sentences starting with capital letters).
22
23
 
23
24
  3. **Typical Use Cases**:
24
- - Heading `## Typical Use Cases`
25
+ - Bold text title: `**Typical use cases:**` or `**Typical Usage Scenarios:**` (in [wikiLanguage]) on a separate line (NOT a markdown heading `##`).
25
26
  - Bulleted list.
26
- - Format: `- Use case.`
27
+ - Format: `- Use case description.`
27
28
 
28
29
  4. **Basic Usage**:
29
- - Code example using the component.
30
- ```html
31
- <script setup>
32
- // Script code
33
- </script>
34
-
35
- <template>
36
- <Component />
37
- </template>
38
- ```
30
+ - Code example showing basic usage of the component.
31
+ - Code examples MUST be wrapped using the Storybook `<Source />` component instead of standard markdown backticks. Add `import { Source } from '@storybook/addon-docs/blocks';` at the top of the MDX file if not already present.
32
+ Format:
33
+ ```md
34
+ <Source
35
+ code={`
36
+ <script setup>
37
+ // Script code
38
+ </script>
39
+
40
+ <template>
41
+ <Component />
42
+ </template>
43
+ `}
44
+ language="html"
45
+ />
46
+ ```
39
47
 
40
48
  5. **Logical Property Groups (Props)**:
41
49
  - Do not create a single general list of all properties. Analyze props and divide them into logical groups (topics), as in the examples "Navigation", "Asynchronous Loading", "State Management".
42
50
  - For each group create a separate section:
43
- - Heading `## Functionality Name` (e.g., "AJAX Loading" or "Navigation").
51
+ - Heading `## Functionality Name` (in [wikiLanguage], e.g., "AJAX Loading" or "Navigation").
44
52
  - Text description: Explain how the properties of this group work together and what problem they solve.
45
53
  - List of group properties: `- propName — description`.
46
- - Code example: Show the use of specifically these properties together.
54
+ - Code example: Show the use of specifically these properties together. Wrap the code example using the Storybook `<Source />` component:
55
+ ```md
56
+ <Source
57
+ code={`
58
+ // code here
59
+ `}
60
+ language="html"
61
+ />
62
+ ```
47
63
  - Skip obvious properties (standard attributes) if they do not affect specific logic.
48
64
 
49
65
  6. **Data Types** (Optional, if there are additional important types not described in the Function section):
50
- - Heading `## Data Types`
66
+ - Heading `## Data Types` (in [wikiLanguage], e.g., "Data Types" or "Типы данных")
51
67
 
52
68
  7. **Events**:
53
- - Heading `## Events`
69
+ - Heading `## Events` (in [wikiLanguage], e.g., "Events" or "События")
54
70
  - For each event:
55
71
  - Header `### `eventName`` (the name must be wrapped in backticks).
56
72
  - A brief paragraph describing when the event triggers.
57
73
  - **Parameters:**
58
- - Header: `**Parameters:**`
74
+ - Header: `**Parameters:**` (in [wikiLanguage], e.g., "Parameters:" or "Параметры:")
59
75
  - List: `- `paramName: paramType` — parameter description.`
60
76
  - **Structure of Custom Types (if applicable):**
61
- - Header: `**TypeName structure:**` (or `**TypeName structure:** same as for `otherEventName` event` if identical).
77
+ - Header: `**TypeName structure:**` (in [wikiLanguage], e.g., "EventClickValue structure:" or "Структура EventClickValue:") (or `**TypeName structure:** same as for `otherEventName` event` if identical).
62
78
  - List: `- `fieldName: fieldType` — field description.`
63
79
  - **Code Example (if the event is complex):**
64
80
  - Code examples MUST be wrapped using the Storybook `<Source />` component instead of standard markdown backticks. Remember to add `import { Source } from '@storybook/addon-docs/blocks';` at the top of the MDX file if not already present:
@@ -74,25 +90,27 @@ Use the following template and style.
74
90
  ```
75
91
 
76
92
  8. **Expose (Component Methods & Properties)**:
77
- - Heading `## Expose`
93
+ - Heading `## Expose` (in [wikiLanguage], e.g., "Expose" or "Expose")
78
94
  - Under the heading, present the list of public methods, reactive references (Refs), and computed variables exposed by the component, in the clean, signature-based bullet format:
79
95
  - For methods: `- `methodName(paramName: paramType): returnType` — Description.`
80
96
  - For reactive states (Refs/Computed): `- `propertyName: PropertyType` — Description.`
81
97
  - Standard types include `boolean`, `void`, `Ref<any>`, `ComputedRef<any>`, etc.
82
98
 
83
99
  9. **Slots**:
84
- - Heading `## Slots`
100
+ - Heading `## Slots` (in [wikiLanguage], e.g., "Slots" or "Слоты")
85
101
  - Under the heading, present the list of slots in the clean, signature-based bullet format:
86
102
  - For slots without parameters: `- `slotName: Type` — Description.`
87
103
  - For slots with parameters: `- `slotName(paramName: paramType): Type` — Description.`
88
104
  - Standard return type is usually `VNode` or `any`.
89
105
 
90
- ### Storybook Layout Helpers (storybookStyle.scss):
106
+
107
+ ### Storybook Layout Helpers:
91
108
  When writing Storybook stories (`*.stories.ts`) and examples in the MDX documentation, you MUST use the predefined showcase helper classes. These styles are imported globally and start with the `.wiki-storybook-` prefix. Do not write custom inline styles or new CSS classes for showcase layout, positioning, placeholders, or containers; use the following helper classes:
92
109
 
93
110
  - **Containers & Layouts**:
94
111
  - `.wiki-storybook-container` — enables container queries (`container-type: inline-size`).
95
112
  - `.wiki-storybook-group` — a 12-column CSS Grid layout (`grid-template-columns: repeat(12, 1fr)`) with an `8px` gap, perfect for presenting multiple items or variations.
113
+ - Modifiers: `&--gapX2` (gap `16px`), `&--gapX3` (gap `24px`), `&--gapX4` (gap `32px`).
96
114
  - `.wiki-storybook-flex` — basic flexbox wrapper (`display: flex; flex-wrap: wrap`) with an `8px` gap.
97
115
  - `.wiki-storybook-flex-align-center` — same as flex wrapper, but aligns items vertically (`align-items: center`).
98
116
  - `.wiki-storybook-flex-center` — centers items horizontally and vertically with an `8px` gap.
@@ -104,6 +122,7 @@ When writing Storybook stories (`*.stories.ts`) and examples in the MDX document
104
122
  Used to display components inside a unified visual frame (aspect-ratio `1/1` by default, border, rounded corners, hidden overflow):
105
123
  - `.wiki-storybook-item__label` — a small floaty label at the top-left corner (`font-size: 12px`, semi-transparent blurred background) for labeling specific variations. Use `.wiki-storybook-item__label--static` to make it flow statically inside the block without absolute positioning.
106
124
  - `&--padding` — adds standard `16px` padding inside the item box.
125
+ - `&--paddingX2` — adds double standard `32px` padding.
107
126
  - `&--rectangle` — sets a `16:9` aspect ratio and spans all 12 columns in a grid.
108
127
  - `&--widescreen` — sets a `32:9` aspect ratio and spans all 12 columns in a grid.
109
128
  - `&--compact` — sets a `64:9` aspect ratio and spans all 12 columns in a grid.
@@ -112,6 +131,8 @@ When writing Storybook stories (`*.stories.ts`) and examples in the MDX document
112
131
  - `&--center` — flex-centers internal elements.
113
132
  - `&--widthAuto` — sets width to `auto`.
114
133
  - `&--overflowVisible` — overrides `overflow: hidden` to `overflow: visible` (useful for dropdowns or modals).
134
+ - `&--overflowAuto` — sets overflow to `auto`.
135
+ - `&--borderNone` — hides default border.
115
136
  - `&--rtl` — sets Right-to-Left (RTL) text and flex layout direction.
116
137
 
117
138
  - **Mock Components & Placeholders**:
@@ -134,9 +155,10 @@ When writing Storybook stories (`*.stories.ts`) and examples in the MDX document
134
155
  3.2. Try to keep original descriptions unchanged.
135
156
  4. Use the correct terminology (Props, Events, Slots, Expose).
136
157
  4.1. All headings must be in [wikiLanguage].
137
- 4.2. In Storybook stories and MDX code examples, you MUST use the predefined layout helper classes from `storybookStyle.scss` (described above) instead of inline styles or custom CSS blocks.
158
+ 4.2. In Storybook stories and MDX code examples, you MUST use the predefined layout helper classes (described above) instead of inline styles or custom CSS blocks.
138
159
  4.3. Do not modify the original component code under any circumstances unless explicitly requested.
139
160
  4.4. Strictly follow all rules in this prompt. There is zero tolerance for hallucinations: do not invent, assume, or add any non-existent properties, methods, events, slots, or external package dependencies.
161
+ 4.5. Do not use horizontal lines (rules like `---` or `***`) and do not use markdown tables anywhere in the documentation. Structure all information using headings, paragraphs, lists, and code blocks.
140
162
  5. Do not add unnecessary introductions or conclusions, only MDX.
141
163
  6. Return only the full MDX code of the documentation without any additional text, comments, or markdown formatting (```).
142
164
  7. The result must be exclusively text (response), do not attach any files.
@@ -13,52 +13,68 @@
13
13
  ### Структура документации:
14
14
 
15
15
  1. **Описание**:
16
+ - Начинай непосредственно с текста (БЕЗ заголовка markdown `## Описание` или аналогичного).
16
17
  - Абзац с описанием: назначение компонента, основные сценарии использования, преимущества.
17
18
 
18
19
  2. **Основные возможности (Key Features)**:
19
- - Заголовок `## Основные возможности` (на языке [wikiLanguage])
20
+ - Полужирный заголовок списка: `**Основные возможности:**` (на языке [wikiLanguage]) на отдельной строке (НЕ заголовок markdown `##`).
20
21
  - Список с буллитами.
21
- - Формат: `- **Название фичи** описание.`
22
+ - Формат: `- Описание возможности.` (простые предложения, начинающиеся с заглавной буквы).
22
23
 
23
24
  3. **Типичные сценарии использования (Typical Use Cases)**:
24
- - Заголовок `## Типичные сценарии использования` (на языке [wikiLanguage])
25
+ - Полужирный заголовок списка: `**Типичные сценарии использования:**` (на языке [wikiLanguage]) на отдельной строке (НЕ заголовок markdown `##`).
25
26
  - Список с буллитами.
26
- - Формат: `- Сценарий.`
27
+ - Формат: `- Сценарий использования.`
27
28
 
28
29
  4. **Пример использования (Basic Usage)**:
29
30
  - Пример кода с использованием компонента.
30
- ```html
31
- <script setup>
32
- // Код скрипта
33
- </script>
34
-
35
- <template>
36
- <Component />
37
- </template>
38
- ```
31
+ - Примеры кода ОБЯЗАТЕЛЬНО должны быть обернуты в компонент Storybook `<Source />` вместо стандартного markdown-форматирования (три обратные кавычки). Добавь `import { Source } from '@storybook/addon-docs/blocks';` в самый верх MDX файла, если его там еще нет.
32
+ Формат:
33
+ ```md
34
+ <Source
35
+ code={`
36
+ <script setup>
37
+ // Код скрипта
38
+ </script>
39
+
40
+ <template>
41
+ <Component />
42
+ </template>
43
+ `}
44
+ language="html"
45
+ />
46
+ ```
39
47
 
40
48
  5. **Логические группы свойств (Props)**:
41
49
  - Не создавай единый общий список всех свойств. Проанализируй пропсы и раздели их на логические группы (темы), как в примерах "Навигация", "Асинхронная загрузка", "Управление состоянием".
42
50
  - Для каждой группы создай отдельный раздел:
43
- - Заголовок `## Название функциональности` (например, "AJAX загрузка" или "Навигация").
51
+ - Заголовок `## Название функциональности` (на языке [wikiLanguage], например, "AJAX загрузка" или "Навигация").
44
52
  - Текстовое описание: Объясни, как свойства этой группы работают вместе и какую задачу решают.
45
53
  - Список свойств группы: `- propName — описание`.
46
- - Пример кода: Покажи использование именно этих свойств в связке.
54
+ - Пример кода: Покажи использование именно этих свойств в связке. Пример кода ОБЯЗАТЕЛЬНО должен быть обернут в компонент Storybook `<Source />`:
55
+ ```md
56
+ <Source
57
+ code={`
58
+ // код здесь
59
+ `}
60
+ language="html"
61
+ />
62
+ ```
47
63
  - Пропусти очевидные свойства (стандартные атрибуты), если они не влияют на специфическую логику.
48
64
 
49
65
  6. **Типы данных** (Опционально, если есть дополнительные важные типы, которые не описаны в разделе Функция):
50
- - Заголовок `## Типы данных`
66
+ - Заголовок `## Типы данных` (на языке [wikiLanguage], например, "Data Types" или "Типы данных")
51
67
 
52
68
  7. **Events (События)**:
53
- - Заголовок `## Events`
69
+ - Заголовок `## Events` (на языке [wikiLanguage], например, "Events" или "События")
54
70
  - Для каждого события:
55
71
  - Заголовок `### \`имяСобытия\`` (имя события обязательно должно быть обернуто в обратные кавычки).
56
72
  - Краткое текстовое описание того, когда событие срабатывает.
57
73
  - **Параметры:**
58
- - Заголовок: `**Параметры:**`
74
+ - Заголовок: `**Параметры:**` (на языке [wikiLanguage], например, "Parameters:" или "Параметры:")
59
75
  - Список: `- \`имяПараметра: типПараметра\` — описание параметра.`
60
76
  - **Структура сложных типов (если применимо):**
61
- - Заголовок: `**Структура TypeName:**` (или `**Структура TypeName:** такая же, как для события \`другоеСобытие\``, если они идентичны).
77
+ - Заголовок: `**Структура TypeName:**` (на языке [wikiLanguage], например, "EventClickValue structure:" или "Структура EventClickValue:") (или `**Структура TypeName:** такая же, как для события \`другоеСобытие\``, если они идентичны).
62
78
  - Список: `- \`имяПоля: типПоля\` — описание поля.`
63
79
  - **Пример кода (если событие сложное):**
64
80
  - Примеры кода ОБЯЗАТЕЛЬНО должны быть обернуты в компонент Storybook `<Source />` вместо стандартного markdown-форматирования (три обратные кавычки). Не забудь добавить `import { Source } from '@storybook/addon-docs/blocks';` в самый верх MDX файла, если его там еще нет:
@@ -74,25 +90,27 @@
74
90
  ```
75
91
 
76
92
  8. **Expose (Публичные методы и свойства компонента)**:
77
- - Заголовок `## Expose`
93
+ - Заголовок `## Expose` (на языке [wikiLanguage], например, "Expose" или "Expose")
78
94
  - Внутри раздела выводи список публичных методов, реактивных ссылок (Refs) и вычисляемых свойств (Computed), доступных через ref компонента, в чистом маркированном формате сигнатур:
79
95
  - Для методов: `- `имяМетода(имяПараметра: типПараметра): возвращаемыйТип` — Описание.`
80
96
  - Для реактивных переменных/свойств: `- `имяСвойства: ТипСвойства` — Описание.`
81
97
  - Стандартные типы возвращаемых значений: `boolean`, `void`, `Ref<any>`, `ComputedRef<any>` и т.д.
82
98
 
83
99
  9. **Slots (Слоты)**:
84
- - Заголовок `## Slots`
100
+ - Заголовок `## Slots` (на языке [wikiLanguage], например, "Slots" or "Слоты")
85
101
  - Внутри раздела выводи список слотов в чистом маркированном формате сигнатур:
86
102
  - Для слотов без параметров: `- `имяСлота: Тип` — Описание.`
87
103
  - Для слотов с параметрами: `- `имяСлота(имяПараметра: типПараметра): Тип` — Описание.`
88
104
  - Стандартный тип возвращаемого значения обычно `VNode` или `any`.
89
105
 
90
- ### Вспомогательные стили Storybook (storybookStyle.scss):
106
+
107
+ ### Вспомогательные стили Storybook:
91
108
  При написании сценариев Storybook (`*.stories.ts`) и примеров кода в MDX-документации ОБЯЗАТЕЛЬНО используй предопределенные вспомогательные классы для демонстрации. Эти стили импортируются глобально и имеют префикс `.wiki-storybook-`. Избегай написания кастомных инлайн-стилей или новых CSS-классов для лейаута, позиционирования, заглушек или контейнеров. Используй следующие готовые классы:
92
109
 
93
110
  - **Контейнеры и сетки**:
94
111
  - `.wiki-storybook-container` — включает контейнерные запросы (`container-type: inline-size`).
95
112
  - `.wiki-storybook-group` — CSS Grid сетка на 12 колонок (`grid-template-columns: repeat(12, 1fr)`) с отступом `8px`. Отлично подходит для демонстрации нескольких вариантов компонента.
113
+ - Модификаторы: `&--gapX2` (отступ `16px`), `&--gapX3` (отступ `24px`), `&--gapX4` (отступ `32px`).
96
114
  - `.wiki-storybook-flex` — базовая flex-обертка (`display: flex; flex-wrap: wrap`) с отступом `8px`.
97
115
  - `.wiki-storybook-flex-align-center` — flex-обертка с центрированием элементов по вертикали (`align-items: center`).
98
116
  - `.wiki-storybook-flex-center` — полное центрирование элементов (горизонтальное и вертикальное) с отступом `8px`.
@@ -104,6 +122,7 @@
104
122
  Используются для отображения компонентов внутри единого визуального блока (по умолчанию aspect-ratio `1/1`, рамка, скругление углов, скрытый overflow):
105
123
  - `.wiki-storybook-item__label` — небольшая плавающая метка в левом верхнем углу (`font-size: 12px`, полупрозрачный размытый фон) для подписи вариаций. Класс `.wiki-storybook-item__label--static` делает метку статичной без абсолютного позиционирования.
106
124
  - `&--padding` — добавляет стандартные внутренние отступы `16px`.
125
+ - `&--paddingX2` — добавляет двойные стандартные отступы `32px`.
107
126
  - `&--rectangle` — устанавливает соотношение сторон `16:9` и растягивает блок на все 12 колонок в сетке.
108
127
  - `&--widescreen` — соотношение сторон `32:9`, растягивает блок на все 12 колонок в сетке.
109
128
  - `&--compact` — соотношение сторон `64:9`, растягивает блок на все 12 колонок в сетке.
@@ -112,12 +131,14 @@
112
131
  - `&--center` — выравнивает содержимое по центру с помощью flex.
113
132
  - `&--widthAuto` — устанавливает ширину `auto`.
114
133
  - `&--overflowVisible` — сбрасывает `overflow: hidden` на `overflow: visible` (необходимо для выпадающих меню, модалок).
134
+ - `&--overflowAuto` — включает автоматическую прокрутку (`overflow: auto`).
135
+ - `&--borderNone` — скрывает стандартную границу/рамку блока.
115
136
  - `&--rtl` — включает режим отображения справа налево (Right-to-Left).
116
137
 
117
138
  - **Тестовые компоненты и заглушки**:
118
139
  - `.wiki-storybook-card` — тестовая карточка (ширина `320px`, скругления, рамка) для симуляции реального интерфейса:
119
140
  - `.wiki-storybook-card__image` — обложка высотой 128px.
120
- - `.wiki-storybook-card__content` — вертикальный flex-контейнер с отступами `16px` и расстоянием `16px`.
141
+ - `.wiki-storybook-card__content` — vertical flex-контейнер с отступами `16px` и расстоянием `16px`.
121
142
  - `.wiki-storybook-card__label` — заголовок с размером шрифта `20px`.
122
143
  - `.wiki-storybook-card__information` — серый текст описания (`14px`).
123
144
  - `.wiki-storybook-card__actions` — горизонтальный контейнер для кнопок (`8px`).
@@ -134,9 +155,10 @@
134
155
  3.2. Старайся сохранять оригинальные описания без изменений.
135
156
  4. Используй правильную терминологию (Props, Events, Slots, Expose).
136
157
  4.1. Все заголовки должны быть на языке [wikiLanguage].
137
- 4.2. В сценариях Storybook и примерах MDX-кода вы ОБЯЗАНЫ использовать предопределенные классы-помощники разметки из `storybookStyle.scss` (описанные выше) вместо инлайн-стилей или кастомных блоков CSS.
158
+ 4.2. В сценариях Storybook и примерах MDX-кода вы ОБЯЗАНЫ использовать предопределенные классы-помощники разметки (описанные выше) вместо инлайн-стилей или кастомных блоков CSS.
138
159
  4.3. Ни при каких обстоятельствах не изменяй оригинальный код компонента, если об этом явно не попросили.
139
160
  4.4. Строго следуй всем правилам и инструкциям данного промпта. Никаких галлюцинаций: категорически запрещено придумывать, домысливать или добавлять несуществующие свойства (props), методы (expose), события (events), слоты (slots) или внешние зависимости.
161
+ 4.5. Не используй горизонтальные линии (разделители вроде `---` или `***`) и не используй таблицы markdown в документации. Структурируй всю информацию с помощью заголовков, абзацев, списков и блоков кода.
140
162
  5. Не добавляй лишних введений или заключений, только MDX.
141
163
  6. Верни только полный MDX-код документации без какого-либо дополнительного текста, комментариев или форматирования markdown (```).
142
164
  7. Результат должен быть исключительно в виде текста (ответа), не прикрепляй никаких файлов.