@nitra/cursor 1.17.0 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/bin/n-cursor.js +16 -16
- package/package.json +2 -1
- package/rules/abie/fix.mjs +3 -3
- package/rules/adr/fix.mjs +3 -3
- package/rules/adr/js/hooks.mjs +6 -6
- package/rules/bun/fix.mjs +3 -3
- package/rules/capacitor/fix.mjs +3 -3
- package/rules/changelog/fix.mjs +3 -3
- package/rules/changelog/js/consistency.mjs +15 -15
- package/rules/ci4/fix.mjs +3 -3
- package/rules/docker/fix.mjs +3 -3
- package/rules/efes/fix.mjs +3 -3
- package/rules/feedback/fix.mjs +3 -3
- package/rules/ga/fix.mjs +3 -3
- package/rules/graphql/fix.mjs +3 -3
- package/rules/hasura/fix.mjs +3 -3
- package/rules/image-avif/fix.mjs +3 -3
- package/rules/image-compress/fix.mjs +3 -3
- package/rules/js-bun-db/fix.mjs +3 -3
- package/rules/js-bun-redis/fix.mjs +3 -3
- package/rules/js-lint/coverage/coverage.mjs +26 -36
- package/rules/js-lint/fix.mjs +3 -3
- package/rules/js-mssql/fix.mjs +3 -3
- package/rules/js-run/fix.mjs +3 -3
- package/rules/k8s/fix.mjs +3 -3
- package/rules/nginx-default-tpl/fix.mjs +3 -3
- package/rules/npm-module/fix.mjs +3 -3
- package/rules/php/fix.mjs +3 -3
- package/rules/rego/fix.mjs +3 -3
- package/rules/rust/coverage/coverage.mjs +22 -43
- package/rules/rust/fix.mjs +3 -3
- package/rules/rust/lib/has-cargo-toml.mjs +1 -3
- package/rules/security/fix.mjs +3 -3
- package/rules/style-lint/fix.mjs +3 -3
- package/rules/style-lint/js/tooling.mjs +1 -1
- package/rules/tauri/fix.mjs +3 -3
- package/rules/test/coverage/coverage.mjs +27 -25
- package/rules/test/fix.mjs +3 -3
- package/rules/test/js/cargo_mutants_config.mjs +65 -0
- package/rules/test/js/data/cargo_mutants_config/mutants.toml.baseline +4 -0
- package/rules/test/js/data/stryker_config/stryker.config.baseline.mjs +12 -0
- package/rules/test/js/location.mjs +1 -1
- package/rules/test/js/stryker_config.mjs +61 -0
- package/rules/test/test.mdc +16 -3
- package/rules/text/fix.mjs +3 -3
- package/rules/vue/fix.mjs +3 -3
- package/scripts/lib/run-rule-cli.mjs +11 -0
- package/scripts/lib/run-standard-rule.mjs +1 -1
- package/scripts/utils/resolve-cargo-manifest.mjs +62 -0
- package/scripts/utils/resolve-js-root.mjs +46 -0
- package/scripts/utils/with-lock.mjs +27 -16
- package/scripts/utils/worktree-fingerprint.mjs +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
Формат — [Keep a Changelog](https://keepachangelog.com/uk/1.1.0/), нумерація — [SemVer](https://semver.org/lang/uk/).
|
|
6
6
|
|
|
7
|
+
## [1.17.2] - 2026-05-24
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Правило `test`: два нових концерни — `stryker_config` і `cargo_mutants_config`. Self-gating через `.n-cursor.json#rules`: концерн активний лише якщо відповідне залежне правило (`js-lint` / `rust`) enabled. **Iterate-all-workspaces**: при відсутності цільового файлу копіює canonical baseline у КОЖЕН workspace-каталог (не лише workspaces[0]).
|
|
12
|
+
- `stryker.config.mjs` у кожному JS-root (всі workspaces з package.json, або cwd у single-package) — мінімум для роботи з `bun test`.
|
|
13
|
+
- `.cargo/mutants.toml` у каталозі КОЖНОГО Cargo.toml-маніфесту: корінь + workspaces (з підтримкою Tauri-патерну `<ws>/src-tauri/Cargo.toml`) — комент-плейсхолдер; cargo-mutants має робочі defaults.
|
|
14
|
+
- Спільні резолвери у `npm/scripts/utils/`: `resolveJsRoot` (single, для coverage-провайдера) + `resolveAllJsRoots` (plural, для test-концерну); `resolveCargoManifest` (single) + `resolveAllCargoManifests` (plural). Coverage-провайдери js-lint і rust реюзають single-варіанти.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- `test.mdc` 1.2 → 2.0 (major): `alwaysApply: true → false`; явні `globs` (`.n-cursor.json`, `package.json`, `Cargo.toml`, mutation-config-цілі, `*.test.mjs`). Нова секція «Налаштування mutation-testing» з посиланнями на baselines.
|
|
19
|
+
- `js-lint/coverage/coverage.mjs`: hint при missing `mutation.json` тепер вказує на `npx @nitra/cursor fix test`. `resolveJsRoot` витягнуто у спільний модуль.
|
|
20
|
+
- `rust/coverage/coverage.mjs`: `resolveCargoManifest` витягнуто у спільний модуль (контракт `null` замість throw для missing manifest; user-facing throw зберігся на callsite).
|
|
21
|
+
|
|
22
|
+
## [1.17.1] - 2026-05-24
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- **`js-lint/coverage/coverage.mjs` + `rust/coverage/coverage.mjs`** — `Bun.spawn` (runtime-only) замінено на `node:child_process.spawnSync`. CLI `n-cursor` запускається через `#!/usr/bin/env node` shebang, отже Node-runtime — `Bun.*` API недоступні в реальному прогоні (тести використовували ін'єктований runner і не виявляли цього). Тестова ін'єкція runner-а лишається тією самою (контракт `runJsCoverage`/`runStryker`/`runLlvmCov`/`runCargoMutants` mock-ів — без змін).
|
|
27
|
+
|
|
7
28
|
## [1.17.0] - 2026-05-24
|
|
8
29
|
|
|
9
30
|
### Added
|
package/bin/n-cursor.js
CHANGED
|
@@ -224,6 +224,22 @@ async function migrateLegacyConfigIfNeeded() {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
+
/**
|
|
228
|
+
* Повертає розпарсений package.json з кореня або null, якщо файл відсутній/некоректний.
|
|
229
|
+
* @returns {Promise<unknown | null>} обʼєкт package.json або null
|
|
230
|
+
*/
|
|
231
|
+
async function readRootPackageJsonSafe() {
|
|
232
|
+
const packageJsonPath = join(cwd(), 'package.json')
|
|
233
|
+
if (!existsSync(packageJsonPath)) {
|
|
234
|
+
return null
|
|
235
|
+
}
|
|
236
|
+
try {
|
|
237
|
+
return JSON.parse(await readFile(packageJsonPath, 'utf8'))
|
|
238
|
+
} catch {
|
|
239
|
+
return null
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
227
243
|
/**
|
|
228
244
|
* Зчитує конфіг .n-cursor.json з поточної директорії
|
|
229
245
|
* @param {{ bundledRulesDir?: string, bundledSkillsDir?: string }} [paths] каталоги з пакету-джерела (після `bun i` — зазвичай `node_modules/@nitra/cursor`)
|
|
@@ -237,22 +253,6 @@ async function readConfig(paths = {}) {
|
|
|
237
253
|
const availableRules = await discoverBundledRuleNames(bundledRulesDir)
|
|
238
254
|
const availableSkills = await discoverBundledSkillNames(bundledSkillsDir)
|
|
239
255
|
|
|
240
|
-
/**
|
|
241
|
-
* Повертає розпарсений package.json з кореня або null, якщо файл відсутній/некоректний.
|
|
242
|
-
* @returns {Promise<unknown | null>} Обʼєкт package.json або null, якщо файл недоступний чи JSON невалідний.
|
|
243
|
-
*/
|
|
244
|
-
async function readRootPackageJsonSafe() {
|
|
245
|
-
const packageJsonPath = join(cwd(), 'package.json')
|
|
246
|
-
if (!existsSync(packageJsonPath)) {
|
|
247
|
-
return null
|
|
248
|
-
}
|
|
249
|
-
try {
|
|
250
|
-
return JSON.parse(await readFile(packageJsonPath, 'utf8'))
|
|
251
|
-
} catch {
|
|
252
|
-
return null
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
256
|
/**
|
|
257
257
|
* Автодописує правила/skills за `rules/<rule>/auto.md` і синхронізує `$schema`.
|
|
258
258
|
* @param {Record<string, unknown>} parsedConfig сирий обʼєкт конфігу
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitra/cursor",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.2",
|
|
4
4
|
"description": "CLI для завантаження cursor-правил (префікс n-) у локальний репозиторій",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"types": "./types/bin/n-cursor.d.ts",
|
|
44
44
|
"scripts": {
|
|
45
45
|
"test": "bun test",
|
|
46
|
+
"test:coverage": "bun test --coverage",
|
|
46
47
|
"start": "bun ./bin/n-cursor.js",
|
|
47
48
|
"rename-yaml-extensions": "bun ./bin/n-cursor.js rename-yaml-extensions"
|
|
48
49
|
},
|
package/rules/abie/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/adr/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/adr/js/hooks.mjs
CHANGED
|
@@ -82,7 +82,7 @@ function gitignoreLineCoversHookLog(line, logPath) {
|
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Перевіряє наявність і канонічність одного hook-скрипта.
|
|
85
|
-
* @param {import('
|
|
85
|
+
* @param {import('../../../scripts/lib/check-reporter.mjs').CheckReporter} reporter репортер для збору результатів
|
|
86
86
|
* @param {string} scriptName базове ім'я скрипта (наприклад `capture-decisions.sh`)
|
|
87
87
|
* @returns {Promise<void>}
|
|
88
88
|
*/
|
|
@@ -111,7 +111,7 @@ async function checkHookScript(reporter, scriptName) {
|
|
|
111
111
|
* `.claude/settings.local.json`. Структуру (`hooks.Stop[]` містить групу з
|
|
112
112
|
* `capture-decisions.sh`; `settings.local.json` не дублює) валідують
|
|
113
113
|
* `npm/policy/adr/settings_json/` і `npm/policy/adr/settings_local_json/`.
|
|
114
|
-
* @param {import('
|
|
114
|
+
* @param {import('../../../scripts/lib/check-reporter.mjs').CheckReporter} reporter репортер
|
|
115
115
|
*/
|
|
116
116
|
function checkProjectSettings(reporter) {
|
|
117
117
|
const { pass, fail } = reporter
|
|
@@ -164,7 +164,7 @@ function cursorConfigHasStopHook(config, marker) {
|
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
166
|
* Перевіряє project-level Cursor hooks config для ADR stop-hooks.
|
|
167
|
-
* @param {import('
|
|
167
|
+
* @param {import('../../../scripts/lib/check-reporter.mjs').CheckReporter} reporter репортер
|
|
168
168
|
* @returns {Promise<void>}
|
|
169
169
|
*/
|
|
170
170
|
async function checkCursorHooks(reporter) {
|
|
@@ -190,7 +190,7 @@ async function checkCursorHooks(reporter) {
|
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* Перевіряє `.gitignore` на ігнорування лог-файлу одного хука.
|
|
193
|
-
* @param {import('
|
|
193
|
+
* @param {import('../../../scripts/lib/check-reporter.mjs').CheckReporter} reporter репортер для збору результатів
|
|
194
194
|
* @param {string} logName базове ім'я лог-файлу (наприклад `capture-decisions.log`)
|
|
195
195
|
* @param {string} gitignoreContent попередньо прочитаний вміст `.gitignore`
|
|
196
196
|
* @returns {void}
|
|
@@ -211,7 +211,7 @@ function checkGitignoreForLog(reporter, logName, gitignoreContent) {
|
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
213
|
* Перевіряє `.gitignore` для всіх hook-логів одним проходом.
|
|
214
|
-
* @param {import('
|
|
214
|
+
* @param {import('../../../scripts/lib/check-reporter.mjs').CheckReporter} reporter репортер для збору результатів
|
|
215
215
|
* @returns {Promise<void>}
|
|
216
216
|
*/
|
|
217
217
|
async function checkGitignore(reporter) {
|
|
@@ -251,7 +251,7 @@ function isBinaryInPath(name) {
|
|
|
251
251
|
/**
|
|
252
252
|
* Інформативна перевірка: чи доступний бодай один LLM CLI (`claude` або `cursor-agent`).
|
|
253
253
|
* Якщо жодного немає — це warning (`pass` з підказкою), бо хук просто мовчки no-op'ає.
|
|
254
|
-
* @param {import('
|
|
254
|
+
* @param {import('../../../scripts/lib/check-reporter.mjs').CheckReporter} reporter репортер для збору результатів
|
|
255
255
|
* @returns {void}
|
|
256
256
|
*/
|
|
257
257
|
function checkLlmCliAvailable(reporter) {
|
package/rules/bun/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/capacitor/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/changelog/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
|
@@ -247,7 +247,7 @@ async function workspaceHasRelevantChangesAgainstBase(baseRef, ws, subWorkspaces
|
|
|
247
247
|
/**
|
|
248
248
|
* Версія з маніфесту на `baseRef`.
|
|
249
249
|
* @param {string} baseRef параметр
|
|
250
|
-
* @param {import('
|
|
250
|
+
* @param {import('../lib/package-manifest.mjs').PackageManifest} manifest параметр
|
|
251
251
|
* @returns {Promise<string | null>} результат
|
|
252
252
|
*/
|
|
253
253
|
async function readBaseVersion(baseRef, manifest) {
|
|
@@ -308,8 +308,8 @@ async function defaultGetPublishedPyPiVersion(name) {
|
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
/**
|
|
311
|
-
* @param {import('
|
|
312
|
-
* @param {(name: string, kind?: import('
|
|
311
|
+
* @param {import('../lib/package-manifest.mjs').PackageManifest} manifest параметр
|
|
312
|
+
* @param {(name: string, kind?: import('../lib/package-manifest.mjs').PackageKind) => Promise<string | null>} getPublishedVersion параметр
|
|
313
313
|
* @returns {Promise<string | null>} результат
|
|
314
314
|
*/
|
|
315
315
|
function resolvePublishedVersion(manifest, getPublishedVersion) {
|
|
@@ -319,7 +319,7 @@ function resolvePublishedVersion(manifest, getPublishedVersion) {
|
|
|
319
319
|
|
|
320
320
|
/**
|
|
321
321
|
* @param {string} name пакет
|
|
322
|
-
* @param {import('
|
|
322
|
+
* @param {import('../lib/package-manifest.mjs').PackageKind} [kind] тип пакета
|
|
323
323
|
* @returns {Promise<string | null>} опублікована версія або null
|
|
324
324
|
*/
|
|
325
325
|
function defaultGetPublishedVersion(name, kind = 'npm') {
|
|
@@ -330,14 +330,14 @@ function defaultGetPublishedVersion(name, kind = 'npm') {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
/**
|
|
333
|
-
* @returns {(name: string, kind?: import('
|
|
333
|
+
* @returns {(name: string, kind?: import('../lib/package-manifest.mjs').PackageKind) => Promise<string | null>} стандартний резолвер
|
|
334
334
|
*/
|
|
335
335
|
function createDefaultGetPublishedVersion() {
|
|
336
336
|
return defaultGetPublishedVersion
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
/**
|
|
340
|
-
* @param {import('
|
|
340
|
+
* @param {import('../lib/package-manifest.mjs').PackageManifest} manifest параметр
|
|
341
341
|
* @param {(msg: string) => void} pass параметр
|
|
342
342
|
* @param {(msg: string) => void} fail параметр
|
|
343
343
|
*/
|
|
@@ -375,7 +375,7 @@ async function verifyChangelogEntry(ws, version, pass, fail) {
|
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
/**
|
|
378
|
-
* @param {import('
|
|
378
|
+
* @param {import('../lib/package-manifest.mjs').PackageManifest} manifest параметр
|
|
379
379
|
* @returns {string} результат
|
|
380
380
|
*/
|
|
381
381
|
function workspaceLabel(manifest) {
|
|
@@ -383,7 +383,7 @@ function workspaceLabel(manifest) {
|
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
/**
|
|
386
|
-
* @param {import('
|
|
386
|
+
* @param {import('../lib/package-manifest.mjs').PackageManifest} manifest параметр
|
|
387
387
|
* @param {string} Vcurrent параметр
|
|
388
388
|
* @param {string[]} subWorkspaces параметр
|
|
389
389
|
* @param {(msg: string) => void} pass параметр
|
|
@@ -438,9 +438,9 @@ async function checkPublishedWorkspacePendingGitChanges(manifest, Vcurrent, subW
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
/**
|
|
441
|
-
* @param {import('
|
|
441
|
+
* @param {import('../lib/package-manifest.mjs').PackageManifest} manifest параметр
|
|
442
442
|
* @param {string[]} subWorkspaces параметр
|
|
443
|
-
* @param {(name: string, kind?: import('
|
|
443
|
+
* @param {(name: string, kind?: import('../lib/package-manifest.mjs').PackageKind) => Promise<string | null>} getPublishedVersion параметр
|
|
444
444
|
* @param {(msg: string) => void} pass параметр
|
|
445
445
|
* @param {(msg: string) => void} fail параметр
|
|
446
446
|
* @returns {Promise<void>} результат
|
|
@@ -475,7 +475,7 @@ async function checkPublishedWorkspace(manifest, subWorkspaces, getPublishedVers
|
|
|
475
475
|
|
|
476
476
|
/**
|
|
477
477
|
* @param {string} comparisonRef ref/SHA для `git diff` / `git show`
|
|
478
|
-
* @param {import('
|
|
478
|
+
* @param {import('../lib/package-manifest.mjs').PackageManifest} manifest параметр
|
|
479
479
|
* @param {string} baseLabel параметр
|
|
480
480
|
* @param {(msg: string) => void} pass параметр
|
|
481
481
|
* @param {(msg: string) => void} fail параметр
|
|
@@ -507,7 +507,7 @@ async function checkLocalOnlyChangedWorkspace(comparisonRef, manifest, baseLabel
|
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
/**
|
|
510
|
-
* @param {import('
|
|
510
|
+
* @param {import('../lib/package-manifest.mjs').PackageManifest[]} localOnly параметр
|
|
511
511
|
* @param {string[]} subWorkspaces параметр
|
|
512
512
|
* @param {(msg: string) => void} pass параметр
|
|
513
513
|
* @param {(msg: string) => void} fail параметр
|
|
@@ -543,7 +543,7 @@ async function runLocalOnlyChecks(localOnly, subWorkspaces, pass, fail) {
|
|
|
543
543
|
|
|
544
544
|
/**
|
|
545
545
|
* @param {object} [opts] опції перевірки
|
|
546
|
-
* @param {(name: string, kind?: import('
|
|
546
|
+
* @param {(name: string, kind?: import('../lib/package-manifest.mjs').PackageKind) => Promise<string | null>} [opts.getPublishedVersion] перевизначення npm/PyPI у тестах
|
|
547
547
|
* @returns {Promise<number>} exit-код перевірки
|
|
548
548
|
*/
|
|
549
549
|
export async function check(opts = {}) {
|
|
@@ -558,11 +558,11 @@ export async function check(opts = {}) {
|
|
|
558
558
|
const isMonorepoRoot = subWorkspaces.length > 0
|
|
559
559
|
|
|
560
560
|
/**
|
|
561
|
-
@type {import('
|
|
561
|
+
@type {import('../lib/package-manifest.mjs').PackageManifest[]}
|
|
562
562
|
*/
|
|
563
563
|
const published = []
|
|
564
564
|
/**
|
|
565
|
-
@type {import('
|
|
565
|
+
@type {import('../lib/package-manifest.mjs').PackageManifest[]}
|
|
566
566
|
*/
|
|
567
567
|
const localOnly = []
|
|
568
568
|
|
package/rules/ci4/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/docker/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/efes/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/feedback/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/ga/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/graphql/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/hasura/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/image-avif/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/js-bun-db/fix.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isRunAsCli, runRuleCli } from '../../scripts/lib/run-rule-cli.mjs'
|
|
1
2
|
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -10,10 +11,9 @@ export function run(ctx) {
|
|
|
10
11
|
return runStandardRule(import.meta.dirname, ctx)
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
if (
|
|
14
|
+
if (isRunAsCli()) {
|
|
14
15
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
16
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
17
|
+
// eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|