@nitra/cursor 1.4.1 → 1.5.1

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/mdc/spell.mdc DELETED
@@ -1,155 +0,0 @@
1
- ---
2
- description: Перевірка правопису в текстових файлах
3
- alwaysApply: true
4
- version: '1.3'
5
- ---
6
-
7
- У корені проєкту має бути `.cspell.json` і залежності для cspell у кореневому `package.json` (зазвичай `devDependencies`).
8
-
9
- У кореневому `package.json` додай скрипт CLI **cspell** (об’єднай з блоками з розділів нижче в одному файлі):
10
-
11
- ```json title="package.json"
12
- "scripts": {
13
- "lint-spell": "npx cspell ."
14
- }
15
- ```
16
-
17
- Додай workflow `.github/workflows/lint-spell.yml`:
18
-
19
- ```yaml
20
- name: Lint Spell
21
-
22
- on:
23
- push:
24
- branches:
25
- - dev
26
- paths:
27
- - '.cspell.json'
28
- - '**/*.js'
29
- - '**/*.ts'
30
- - '**/*.vue'
31
- - '**/*.html'
32
- - '**/*.css'
33
- - '**/*.scss'
34
- - '**/*.less'
35
- - '**/*.json'
36
- - '**/*.jsonc'
37
- - '**/*.yaml'
38
- - '**/*.yml'
39
- - '**/*.toml'
40
- - '**/*.xml'
41
- - '**/*.md'
42
- - '**/*.mdс'
43
- - '**/*.txt'
44
- - '**/*.go'
45
- - '**/*.py'
46
- - '**/*.php'
47
-
48
- pull_request:
49
- branches:
50
- - dev
51
-
52
- concurrency:
53
- group: ${{ github.ref }}-${{ github.workflow }}
54
- cancel-in-progress: true
55
-
56
- jobs:
57
- cspell:
58
- runs-on: ubuntu-latest
59
- steps:
60
- - uses: actions/checkout@v4
61
-
62
- - uses: oven-sh/setup-bun@v2
63
-
64
- - name: Cache Bun dependencies
65
- uses: actions/cache@v4
66
- with:
67
- path: |
68
- ~/.bun/install/cache
69
- node_modules
70
- key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
71
- restore-keys: |
72
- ${{ runner.os }}-bun-
73
-
74
- - name: Install dependencies
75
- run: bun install --frozen-lockfile
76
-
77
- - name: Cspell
78
- run: bun run lint-spell
79
- ```
80
-
81
- **Без дублювання CI:** якщо в `.github/workflows` уже є workflow з тими самими кроками `cspell`, видали зайвий — перевірка правопису має виконуватися в одному місці.
82
-
83
- ## Базовий варіант (без окремого словника української)
84
-
85
- Якщо текст переважно англійською та достатньо корпоративного словника (@nitra/cspell-dict; у полі `language` cspell лишається тег `nitra`):
86
-
87
- ```json title=".cspell.json"
88
- {
89
- "version": "0.2",
90
- "language": "nitra",
91
- "ignorePaths": ["**/node_modules/**", "**/vscode-extension/**", "**/.git/**", ".vscode", "report"],
92
- "import": ["@nitra/cspell-dict/cspell-ext.json"],
93
- "words": []
94
- }
95
- ```
96
-
97
- ```json title="package.json"
98
- {
99
- "scripts": {
100
- "lint-spell": "npx cspell ."
101
- },
102
- "devDependencies": {
103
- "@nitra/cspell-dict": "^1.0.185"
104
- }
105
- }
106
- ```
107
-
108
- ## Проєкт з українською мовою
109
-
110
- Якщо в репозиторії є українська документація, коментарі або рядки в коді — потрібен **окремий словник** `@cspell/dict-uk-ua`, інакше cspell не перевірятиме український правопис коректно.
111
-
112
- **1. Залежності** — додай пакет словника поруч із `@nitra/cspell-dict`:
113
-
114
- ```json title="package.json"
115
- {
116
- "scripts": {
117
- "lint-spell": "npx cspell ."
118
- },
119
- "devDependencies": {
120
- "@nitra/cspell-dict": "^1.0.185",
121
- "@cspell/dict-uk-ua": "^4.0.6"
122
- }
123
- }
124
- ```
125
-
126
- Встановлення: `bun add -d @cspell/dict-uk-ua` (або `npm i -D @cspell/dict-uk-ua`).
127
-
128
- **2. `.cspell.json`** — у полі `language` має бути `uk` (разом з іншими мовами через кому), у `import` — підключення розширення українського словника:
129
-
130
- ```json title=".cspell.json"
131
- {
132
- "version": "0.2",
133
- "language": "en,uk,nitra",
134
- "ignorePaths": ["**/node_modules/**", "**/vscode-extension/**", "**/.git/**", ".vscode", "report"],
135
- "import": [
136
- "@nitra/cspell-dict/cspell-ext.json",
137
- "@cspell/dict-uk-ua/cspell-ext.json"
138
- ],
139
- "words": []
140
- }
141
- ```
142
-
143
- Підлаштуй `language` під проєкт (наприклад додай `ru-ru`, якщо потрібна перевірка російською). Порядок у `import` може впливати на пріоритет словників — тримай корпоративний `@nitra/cspell-dict` там, де зручно для ваших правил.
144
-
145
- ## Локальні виключення
146
-
147
- У секції `words` у `.cspell.json` додають власні терміни, імена та скорочення, яких немає в словниках.
148
-
149
- ## Інші мови
150
-
151
- Для іншої мови встанови відповідний пакет `@cspell/dict-*`, додай його `cspell-ext.json` у `import` і код мови в `language`. Огляд словників: [streetsidesoftware/cspell-dicts](https://github.com/streetsidesoftware/cspell-dicts).
152
-
153
- ## Перевірка
154
-
155
- `npx @nitra/cursor check spell`
@@ -1,57 +0,0 @@
1
- import { existsSync } from 'node:fs'
2
- import { readFile } from 'node:fs/promises'
3
-
4
- /**
5
- * Перевіряє відповідність проєкту правилам spell.mdc
6
- * @returns {Promise<number>} 0 — все OK, 1 — є проблеми
7
- */
8
- export async function check() {
9
- let exitCode = 0
10
- const pass = msg => console.log(` ✅ ${msg}`)
11
- const fail = msg => {
12
- console.log(` ❌ ${msg}`)
13
- exitCode = 1
14
- }
15
-
16
- if (existsSync('.cspell.json')) {
17
- const cfg = JSON.parse(await readFile('.cspell.json', 'utf8'))
18
-
19
- cfg.version === '0.2'
20
- ? pass('.cspell.json version: 0.2')
21
- : fail('.cspell.json version має бути "0.2"')
22
-
23
- cfg.language
24
- ? pass(`.cspell.json language: "${cfg.language}"`)
25
- : fail('.cspell.json не містить поле language')
26
-
27
- const imports = cfg.import || []
28
- imports.some(i => i.includes('@nitra/cspell-dict'))
29
- ? pass('.cspell.json імпортує @nitra/cspell-dict')
30
- : fail('.cspell.json не імпортує @nitra/cspell-dict/cspell-ext.json')
31
-
32
- Array.isArray(cfg.ignorePaths)
33
- ? pass('.cspell.json містить ignorePaths')
34
- : fail('.cspell.json не містить ignorePaths')
35
- } else {
36
- fail('.cspell.json не існує — створи його')
37
- }
38
-
39
- if (existsSync('package.json')) {
40
- const pkg = JSON.parse(await readFile('package.json', 'utf8'))
41
- const devDeps = pkg.devDependencies || {}
42
-
43
- devDeps['@nitra/cspell-dict']
44
- ? pass('@nitra/cspell-dict є в devDependencies')
45
- : fail('@nitra/cspell-dict відсутній — bun add -d @nitra/cspell-dict')
46
-
47
- if (existsSync('.cspell.json')) {
48
- const cfg = JSON.parse(await readFile('.cspell.json', 'utf8'))
49
- const hasUkImport = (cfg.import || []).some(i => i.includes('@cspell/dict-uk-ua'))
50
- if (hasUkImport && !devDeps['@cspell/dict-uk-ua']) {
51
- fail('.cspell.json імпортує @cspell/dict-uk-ua, але пакет відсутній в devDependencies')
52
- }
53
- }
54
- }
55
-
56
- return exitCode
57
- }
@@ -1,26 +0,0 @@
1
- ---
2
- name: n-lint
3
- description: >-
4
- Запускає всі скрипти lint-* з package.json і виправляє зауваження лінтерів (fix + ручні правки)
5
- ---
6
-
7
- # n-lint — усі lint-скрипти та нуль зауважень
8
-
9
- ## Мета
10
-
11
- Виконати кожен скрипт з префіксом `lint-` у `package.json` і усунути всі зауваження лінтерів.
12
-
13
- ## Охоплення
14
-
15
- 1. Корінь: усі `lint-*` з `scripts`.
16
- 2. Якщо є `workspaces` — те саме в кожному workspace-пакеті; `bun run` з каталогу цього пакета.
17
-
18
- ## Кроки
19
-
20
- 1. За потреби: `bun i` у корені / у пакеті.
21
- 2. Для кожного `lint-*`: `bun run <ім'я>` з відповідного каталогу.
22
- 3. На помилках: auto-fix (якщо є), інакше правки в коді/конфігах; повторюй доки скрипт завершується з `0`.
23
-
24
- ## Підсумок
25
-
26
- Перелічи запущені скрипти та зміни; опиши блокери, якщо лишились.