@nitra/cursor 1.15.1 → 1.16.0
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 +12 -0
- package/bin/n-cursor.js +4 -4
- package/package.json +1 -1
- package/rules/abie/fix.mjs +3 -3
- package/rules/abie/js/applies.mjs +2 -2
- package/rules/abie/js/env_dns.mjs +3 -3
- package/rules/abie/js/firebase_hosting.mjs +1 -1
- package/rules/abie/js/hc_pairing.mjs +4 -4
- package/rules/abie/js/ua_http_route.mjs +6 -6
- package/rules/abie/js/ua_node_selector.mjs +5 -5
- package/rules/adr/fix.mjs +3 -3
- package/rules/adr/js/hooks.mjs +7 -7
- package/rules/bun/fix.mjs +3 -3
- package/rules/bun/js/layout.mjs +1 -1
- package/rules/capacitor/fix.mjs +3 -3
- package/rules/capacitor/js/platforms.mjs +1 -1
- package/rules/changelog/fix.mjs +3 -3
- package/rules/changelog/js/consistency.mjs +2 -2
- package/rules/changelog/{utils → lib}/package-manifest.mjs +1 -1
- package/rules/ci4/fix.mjs +3 -3
- package/rules/docker/fix.mjs +3 -3
- package/rules/docker/js/lint.mjs +4 -4
- package/rules/docker/lint/lint.mjs +4 -4
- package/rules/efes/fix.mjs +3 -3
- package/rules/feedback/fix.mjs +3 -3
- package/rules/ga/fix.mjs +3 -3
- package/rules/ga/js/workflows.mjs +4 -4
- package/rules/ga/lint/lint.mjs +2 -2
- package/rules/graphql/fix.mjs +3 -3
- package/rules/graphql/js/tooling.mjs +4 -4
- package/rules/hasura/fix.mjs +3 -3
- package/rules/hasura/js/internal_urls.mjs +2 -2
- package/rules/image-avif/fix.mjs +3 -3
- package/rules/image-avif/js/avif_generation.mjs +3 -3
- package/rules/image-compress/fix.mjs +3 -3
- package/rules/image-compress/js/package_setup.mjs +1 -1
- package/rules/js-bun-db/fix.mjs +3 -3
- package/rules/js-bun-db/js/safety.mjs +3 -3
- package/rules/js-bun-redis/fix.mjs +3 -3
- package/rules/js-bun-redis/js/imports.mjs +3 -3
- package/{scripts/utils → rules/js-bun-redis/lib}/redis-imports.mjs +1 -1
- package/rules/js-lint/fix.mjs +3 -3
- package/rules/js-lint/js/tooling.mjs +1 -1
- package/rules/js-lint/js/utils_imports.mjs +199 -0
- package/rules/js-lint/js-lint.mdc +2 -0
- package/rules/js-lint/{utils → lib}/rebuild-oxlint-canonical.mjs +1 -1
- package/rules/js-mssql/fix.mjs +3 -3
- package/rules/js-mssql/js/deps.mjs +3 -3
- package/rules/js-run/fix.mjs +3 -3
- package/rules/js-run/js/runtime.mjs +9 -9
- package/rules/k8s/fix.mjs +3 -3
- package/rules/k8s/js/manifests.mjs +3 -3
- package/rules/k8s/lint/lint.mjs +2 -2
- package/rules/nginx-default-tpl/fix.mjs +3 -3
- package/rules/nginx-default-tpl/js/template.mjs +3 -3
- package/rules/npm-module/fix.mjs +3 -3
- package/rules/npm-module/js/package_structure.mjs +2 -2
- package/rules/php/fix.mjs +3 -3
- package/rules/php/js/tooling.mjs +1 -1
- package/rules/php/lint/lint.mjs +1 -1
- package/rules/rego/fix.mjs +3 -3
- package/rules/rego/js/applies.mjs +2 -2
- package/rules/rego/lint/lint.mjs +1 -1
- package/rules/rust/fix.mjs +3 -3
- package/rules/rust/js/applies.mjs +2 -2
- package/rules/rust/{utils → lib}/has-cargo-toml.mjs +1 -1
- package/rules/security/fix.mjs +3 -3
- package/rules/security/js/sample_secret.mjs +1 -1
- package/rules/security/js/trufflehog.mjs +2 -2
- package/rules/style-lint/fix.mjs +3 -3
- package/rules/style-lint/js/tooling.mjs +2 -2
- package/rules/tauri/fix.mjs +3 -3
- package/rules/tauri/js/tooling.mjs +2 -2
- package/rules/test/fix.mjs +3 -3
- package/rules/test/js/location.mjs +2 -2
- package/rules/text/fix.mjs +3 -3
- package/rules/text/js/formatting.mjs +2 -2
- package/rules/text/lint/lint.mjs +2 -2
- package/rules/vue/fix.mjs +3 -3
- package/rules/vue/js/packages.mjs +4 -4
- package/scripts/auto-rules.mjs +3 -3
- package/scripts/{utils → lib}/check-reporter.mjs +1 -1
- package/scripts/{utils → lib}/resolve-target-files.mjs +1 -1
- package/scripts/{utils → lib}/run-conftest-batch.mjs +1 -1
- package/scripts/{utils → lib}/run-lint-step.mjs +1 -1
- package/scripts/{utils → lib}/run-rule-cli.mjs +1 -1
- package/scripts/{utils → lib}/run-standard-lint.mjs +2 -2
- package/scripts/{utils → lib}/run-standard-rule.mjs +2 -2
- package/scripts/rename-yaml-extensions.mjs +1 -1
- /package/rules/abie/{utils → lib}/enabled.mjs +0 -0
- /package/rules/abie/{utils → lib}/env-dns.mjs +0 -0
- /package/rules/abie/{utils → lib}/hc-yaml.mjs +0 -0
- /package/rules/abie/{utils → lib}/http-route.mjs +0 -0
- /package/rules/abie/{utils → lib}/k8s-tree.mjs +0 -0
- /package/rules/abie/{utils → lib}/kustomization-patches.mjs +0 -0
- /package/rules/abie/{utils → lib}/overlay-paths.mjs +0 -0
- /package/rules/abie/{utils → lib}/yaml.mjs +0 -0
- /package/rules/docker/{utils → lib}/docker-hadolint.mjs +0 -0
- /package/rules/docker/{utils → lib}/docker-mirror.mjs +0 -0
- /package/rules/graphql/{utils → lib}/graphql-gql-scan.mjs +0 -0
- /package/rules/js-bun-db/{utils → lib}/bun-sql-scan.mjs +0 -0
- /package/rules/js-mssql/{utils → lib}/mssql-pool-scan.mjs +0 -0
- /package/rules/js-run/{utils → lib}/bunyan-imports.mjs +0 -0
- /package/rules/js-run/{utils → lib}/check-env-scan.mjs +0 -0
- /package/rules/js-run/{utils → lib}/conn-file-rules.mjs +0 -0
- /package/rules/js-run/{utils → lib}/conn-imports-scan.mjs +0 -0
- /package/rules/js-run/{utils → lib}/promise-settimeout-scan.mjs +0 -0
- /package/rules/vue/{utils → lib}/vue-forbidden-imports.mjs +0 -0
- /package/scripts/{utils → lib}/check-mdc-template-refs.mjs +0 -0
- /package/scripts/{utils → lib}/discover-check-rules-from-cursor.mjs +0 -0
- /package/scripts/{utils → lib}/discover-checkable-rules.mjs +0 -0
- /package/scripts/{utils → lib}/generated-markdown.mjs +0 -0
- /package/scripts/{utils → lib}/gha-workflow.mjs +0 -0
- /package/scripts/{utils → lib}/inline-template-links.mjs +0 -0
- /package/scripts/{utils → lib}/list-rule-ids.mjs +0 -0
- /package/scripts/{utils → lib}/load-cursor-config.mjs +0 -0
- /package/scripts/{utils → lib}/read-n-cursor-config-lite.mjs +0 -0
- /package/scripts/{utils → lib}/run-rule.mjs +0 -0
- /package/scripts/{utils → lib}/template.mjs +0 -0
- /package/scripts/{utils → lib}/workspaces.mjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
Формат — [Keep a Changelog](https://keepachangelog.com/uk/1.1.0/), нумерація — [SemVer](https://semver.org/lang/uk/).
|
|
6
6
|
|
|
7
|
+
## [1.16.0] - 2026-05-24
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **`utils/` vs `lib/` (js-lint.mdc):** усі 10 каталогів `npm/rules/<rule>/utils/` перейменовано в `npm/rules/<rule>/lib/` — їхній вміст domain-bound (запускає hadolint, парсить kustomize/k8s-tree, конкретні AST-сканери правила, читання `.n-cursor.json` тощо), що за правилом `utils/` vs `lib/` має жити в `lib/`. Зачеплені правила: `abie`, `changelog`, `docker`, `graphql`, `js-bun-db`, `js-lint`, `js-mssql`, `js-run`, `rust`, `vue`. Тести й `__fixtures__/` переїхали разом із батьківським каталогом. 26 внутрішніх `'../utils/'`-імпортів у `js/`/`lint/` і 3 зовнішніх з `npm/scripts/auto-rules.mjs` оновлено на `'../lib/'` / `'../<rule>/lib/'`. JSDoc-шлях у `npm/rules/js-lint/lib/rebuild-oxlint-canonical.mjs` (приклад запуску) і JSDoc-натяк у `npm/rules/rust/lib/has-cargo-toml.mjs` теж оновлені.
|
|
12
|
+
- **`npm/scripts/utils/` розщеплено на `utils/` + `lib/`:** 19 файлів (`run-rule`, `run-rule-cli`, `run-standard-rule`, `run-standard-lint`, `run-lint-step`, `run-conftest-batch`, `discover-checkable-rules`, `discover-check-rules-from-cursor`, `list-rule-ids`, `load-cursor-config`, `read-n-cursor-config-lite`, `resolve-target-files`, `check-mdc-template-refs`, `check-reporter`, `gha-workflow`, `generated-markdown`, `inline-template-links`, `template`, `workspaces`) і 14 відповідних тестів + `__fixtures__/` переїхали у `npm/scripts/lib/`. У `npm/scripts/utils/` залишилися 9 справді generic-файлів (`ast-scan-utils`, `find-package-json-paths`, `pass`, `resolve-cmd`, `test-helpers`, `walk-cache`, `walkDir`, `with-lock`, `worktree-fingerprint`) + 4 їхні тести. `~220` імпортів `scripts/utils/<lib-file>` по всьому `npm/` оновлено на `scripts/lib/<lib-file>`; внутрішні lib→utils переходи (`check-reporter→pass`, `resolve-target-files→walkDir`, `run-conftest-batch→resolve-cmd`, `run-lint-step→resolve-cmd`, `run-rule-cli→walk-cache`, `run-standard-lint→with-lock`, `run-standard-rule→walk-cache,with-lock`) переписані на `'../utils/<file>'`; lib-тести з залежністю від `test-helpers` — на `'../../utils/test-helpers.mjs'`.
|
|
13
|
+
- **`scripts/utils/redis-imports.mjs` → `npm/rules/js-bun-redis/lib/redis-imports.mjs`** (+тест). Симетрично до `bunyan-imports`/`vue-forbidden-imports`: per-rule сканер живе в самому правилі, а не в спільних скриптах. Імпорт `scripts/utils/ast-scan-utils.mjs` зберігся (це справді generic helper).
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Новий концерн `js-lint.utils_imports`** (`npm/rules/js-lint/js/utils_imports.mjs`): обходить кожен `utils/`-каталог у monorepo-воркспейсах і падає, якщо знаходить relative-імпорт з `..` у не-тестовому `.[cm]?[jt]sx?`-файлі. Дозволені лише same-dir (`./X`), bare-пакети та `node:*`; cross-rule, конфіги проєкту чи sibling-utils → fail з підказкою «перенеси у `lib/`». Тести (`*.test.mjs`) і будь-який `__fixtures__/` пропускаються — тестам легально треба `../X`. У `js-lint.mdc` під секцією «Структура спільних модулів: `utils/` vs `lib/`» додано абзац про автоматичну перевірку.
|
|
18
|
+
|
|
7
19
|
## [1.15.1] - 2026-05-24
|
|
8
20
|
|
|
9
21
|
### Fixed
|
package/bin/n-cursor.js
CHANGED
|
@@ -70,8 +70,8 @@ import { cwd, env } from 'node:process'
|
|
|
70
70
|
import { fileURLToPath } from 'node:url'
|
|
71
71
|
|
|
72
72
|
import { buildAgentsCommandBulletItems } from '../scripts/build-agents-commands.mjs'
|
|
73
|
-
import { formatGeneratedMarkdownLines, renderAgentsTemplate } from '../scripts/
|
|
74
|
-
import { inlineTemplateLinks } from '../scripts/
|
|
73
|
+
import { formatGeneratedMarkdownLines, renderAgentsTemplate } from '../scripts/lib/generated-markdown.mjs'
|
|
74
|
+
import { inlineTemplateLinks } from '../scripts/lib/inline-template-links.mjs'
|
|
75
75
|
import {
|
|
76
76
|
detectAutoRules,
|
|
77
77
|
detectLegacyRuleIds,
|
|
@@ -81,8 +81,8 @@ import {
|
|
|
81
81
|
} from '../scripts/auto-rules.mjs'
|
|
82
82
|
import { detectAutoSkills } from '../scripts/auto-skills.mjs'
|
|
83
83
|
import { runStopHookCli } from '../scripts/claude-stop-hook.mjs'
|
|
84
|
-
import { discoverCheckRulesFromCursorRules } from '../scripts/
|
|
85
|
-
import { listRuleIds } from '../scripts/
|
|
84
|
+
import { discoverCheckRulesFromCursorRules } from '../scripts/lib/discover-check-rules-from-cursor.mjs'
|
|
85
|
+
import { listRuleIds } from '../scripts/lib/list-rule-ids.mjs'
|
|
86
86
|
import { ensureNitraCursorInRootDevDependencies } from '../scripts/ensure-nitra-cursor-dev-dependencies.mjs'
|
|
87
87
|
import { runLintDocker } from '../rules/docker/lint/lint.mjs'
|
|
88
88
|
import { runLintGaCli } from '../rules/ga/lint/lint.mjs'
|
package/package.json
CHANGED
package/rules/abie/fix.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Якщо повертає `false` — CLI пропускає всі концерни (JS і policy) цього правила.
|
|
4
4
|
* `check()` друкує тільки context-pass; решта концернів роблять справжню роботу.
|
|
5
5
|
*/
|
|
6
|
-
import { createCheckReporter } from '../../../scripts/
|
|
6
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
7
7
|
|
|
8
|
-
import { isAbieRuleEnabled } from '../
|
|
8
|
+
import { isAbieRuleEnabled } from '../lib/enabled.mjs'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @returns {Promise<boolean>} `true` — правило застосовне; `false` — пропустити
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
import { readFile } from 'node:fs/promises'
|
|
10
10
|
import { basename, relative } from 'node:path'
|
|
11
11
|
|
|
12
|
-
import { createCheckReporter } from '../../../scripts/
|
|
13
|
-
import { loadCursorIgnorePaths } from '../../../scripts/
|
|
12
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
13
|
+
import { loadCursorIgnorePaths } from '../../../scripts/lib/load-cursor-config.mjs'
|
|
14
14
|
|
|
15
|
-
import { abieEnvNameFromBasename, collectAbieEnvFiles, validateAbieEnvInternalUrls } from '../
|
|
15
|
+
import { abieEnvNameFromBasename, collectAbieEnvFiles, validateAbieEnvInternalUrls } from '../lib/env-dns.mjs'
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @returns {Promise<number>} результат
|
|
@@ -7,7 +7,7 @@ import { existsSync } from 'node:fs'
|
|
|
7
7
|
import { readdir } from 'node:fs/promises'
|
|
8
8
|
import { join } from 'node:path'
|
|
9
9
|
|
|
10
|
-
import { createCheckReporter } from '../../../scripts/
|
|
10
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
11
11
|
|
|
12
12
|
const SKIP_TOP_DIR_NAMES = new Set(['.git', 'node_modules'])
|
|
13
13
|
|
|
@@ -10,11 +10,11 @@ import { existsSync } from 'node:fs'
|
|
|
10
10
|
import { readFile } from 'node:fs/promises'
|
|
11
11
|
import { relative } from 'node:path'
|
|
12
12
|
|
|
13
|
-
import { createCheckReporter } from '../../../scripts/
|
|
14
|
-
import { loadCursorIgnorePaths } from '../../../scripts/
|
|
13
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
14
|
+
import { loadCursorIgnorePaths } from '../../../scripts/lib/load-cursor-config.mjs'
|
|
15
15
|
|
|
16
|
-
import { validateAbieHcModeline } from '../
|
|
17
|
-
import { collectDeploymentDirs, findK8sYamlFiles } from '../
|
|
16
|
+
import { validateAbieHcModeline } from '../lib/hc-yaml.mjs'
|
|
17
|
+
import { collectDeploymentDirs, findK8sYamlFiles } from '../lib/k8s-tree.mjs'
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @returns {Promise<number>} результат
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
import { readFile } from 'node:fs/promises'
|
|
11
11
|
import { relative } from 'node:path'
|
|
12
12
|
|
|
13
|
-
import { createCheckReporter } from '../../../scripts/
|
|
14
|
-
import { loadCursorIgnorePaths } from '../../../scripts/
|
|
13
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
14
|
+
import { loadCursorIgnorePaths } from '../../../scripts/lib/load-cursor-config.mjs'
|
|
15
15
|
|
|
16
|
-
import { analyzeAbieSharedBackendRefsInPackageK8s } from '../
|
|
17
|
-
import { findK8sYamlFiles } from '../
|
|
16
|
+
import { analyzeAbieSharedBackendRefsInPackageK8s } from '../lib/http-route.mjs'
|
|
17
|
+
import { findK8sYamlFiles } from '../lib/k8s-tree.mjs'
|
|
18
18
|
import {
|
|
19
19
|
getCombinedNginxRunPatchTextFromKustomization,
|
|
20
20
|
validateAbieNginxRunHttpRoutePatches
|
|
21
|
-
} from '../
|
|
21
|
+
} from '../lib/kustomization-patches.mjs'
|
|
22
22
|
import {
|
|
23
23
|
abiePackageDirFromK8sOverlay,
|
|
24
24
|
abieOverlayRequiresHttpRouteByVite,
|
|
25
25
|
isUaKustomizationPath
|
|
26
|
-
} from '../
|
|
26
|
+
} from '../lib/overlay-paths.mjs'
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* @returns {Promise<number>} результат
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
import { readFile } from 'node:fs/promises'
|
|
9
9
|
import { relative } from 'node:path'
|
|
10
10
|
|
|
11
|
-
import { createCheckReporter } from '../../../scripts/
|
|
12
|
-
import { loadCursorIgnorePaths } from '../../../scripts/
|
|
11
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
12
|
+
import { loadCursorIgnorePaths } from '../../../scripts/lib/load-cursor-config.mjs'
|
|
13
13
|
|
|
14
|
-
import { collectDeploymentDirs, findK8sYamlFiles } from '../
|
|
15
|
-
import { kustomizationHasAbieDeploymentNodeSelectorPatch } from '../
|
|
16
|
-
import { abieOverlayK8sTreeHasDeployment, isUaKustomizationPath } from '../
|
|
14
|
+
import { collectDeploymentDirs, findK8sYamlFiles } from '../lib/k8s-tree.mjs'
|
|
15
|
+
import { kustomizationHasAbieDeploymentNodeSelectorPatch } from '../lib/kustomization-patches.mjs'
|
|
16
|
+
import { abieOverlayK8sTreeHasDeployment, isUaKustomizationPath } from '../lib/overlay-paths.mjs'
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @returns {Promise<number>} результат
|
package/rules/adr/fix.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line 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
|
@@ -24,7 +24,7 @@ import { delimiter, dirname, join } from 'node:path'
|
|
|
24
24
|
import { env } from 'node:process'
|
|
25
25
|
import { fileURLToPath } from 'node:url'
|
|
26
26
|
|
|
27
|
-
import { createCheckReporter } from '../../../scripts/
|
|
27
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
28
28
|
|
|
29
29
|
/** Один hook-артефакт: bash-скрипт + його лог-файл, які перевіряємо однотипно. */
|
|
30
30
|
const HOOK_ARTIFACTS = /** @type {const} */ ([
|
|
@@ -82,7 +82,7 @@ function gitignoreLineCoversHookLog(line, logPath) {
|
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* Перевіряє наявність і канонічність одного hook-скрипта.
|
|
85
|
-
* @param {import('../../../../scripts/
|
|
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('../../../../scripts/
|
|
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('../../../../scripts/
|
|
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('../../../../scripts/
|
|
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('../../../../scripts/
|
|
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('../../../../scripts/
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
package/rules/bun/js/layout.mjs
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import { existsSync } from 'node:fs'
|
|
21
21
|
import { readFile } from 'node:fs/promises'
|
|
22
22
|
|
|
23
|
-
import { createCheckReporter } from '../../../scripts/
|
|
23
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
24
24
|
|
|
25
25
|
/** Розділювач токенів у `scripts.lint` (послідовність пробільних символів). */
|
|
26
26
|
const WHITESPACE_RE = /\s+/u
|
package/rules/capacitor/fix.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
|
@@ -25,7 +25,7 @@ import { existsSync } from 'node:fs'
|
|
|
25
25
|
import { readdir, readFile } from 'node:fs/promises'
|
|
26
26
|
import { join, relative } from 'node:path'
|
|
27
27
|
|
|
28
|
-
import { createCheckReporter } from '../../../scripts/
|
|
28
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
29
29
|
|
|
30
30
|
/** Мінімальна допустима мажорна версія Capacitor (capacitor.mdc) */
|
|
31
31
|
const MIN_CAPACITOR_MAJOR = 8
|
package/rules/changelog/fix.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
|
@@ -22,13 +22,13 @@ import { readFile } from 'node:fs/promises'
|
|
|
22
22
|
import { join } from 'node:path'
|
|
23
23
|
import { promisify } from 'node:util'
|
|
24
24
|
|
|
25
|
-
import { createCheckReporter } from '../../../scripts/
|
|
25
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
26
26
|
import {
|
|
27
27
|
getMonorepoProjectRootDirs,
|
|
28
28
|
manifestFilePath,
|
|
29
29
|
parsePyprojectFields,
|
|
30
30
|
readPackageManifest
|
|
31
|
-
} from '../
|
|
31
|
+
} from '../lib/package-manifest.mjs'
|
|
32
32
|
|
|
33
33
|
const execFileAsync = promisify(execFile)
|
|
34
34
|
|
|
@@ -8,7 +8,7 @@ import { dirname, join, relative } from 'node:path'
|
|
|
8
8
|
|
|
9
9
|
import { parse as parseToml } from 'smol-toml'
|
|
10
10
|
|
|
11
|
-
import { getMonorepoPackageRootDirs, isIgnoredWorkspaceRoot } from '../../../scripts/
|
|
11
|
+
import { getMonorepoPackageRootDirs, isIgnoredWorkspaceRoot } from '../../../scripts/lib/workspaces.mjs'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @typedef {'npm' | 'python'} PackageKind
|
package/rules/ci4/fix.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line 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,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line 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/js/lint.mjs
CHANGED
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
import { readFile } from 'node:fs/promises'
|
|
31
31
|
import { basename } from 'node:path'
|
|
32
32
|
|
|
33
|
-
import { getMirrorGcrHint, getFromImageToken } from '../
|
|
34
|
-
import { lintDockerfileWithHadolint, posixRel } from '../
|
|
35
|
-
import { createCheckReporter } from '../../../scripts/
|
|
36
|
-
import { loadCursorIgnorePaths } from '../../../scripts/
|
|
33
|
+
import { getMirrorGcrHint, getFromImageToken } from '../lib/docker-mirror.mjs'
|
|
34
|
+
import { lintDockerfileWithHadolint, posixRel } from '../lib/docker-hadolint.mjs'
|
|
35
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
36
|
+
import { loadCursorIgnorePaths } from '../../../scripts/lib/load-cursor-config.mjs'
|
|
37
37
|
import { walkDir } from '../../../scripts/utils/walkDir.mjs'
|
|
38
38
|
|
|
39
39
|
const NEWLINE_RE = /\r?\n/
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
import { basename } from 'node:path'
|
|
14
14
|
|
|
15
15
|
import { isRunAsCli } from '../../../scripts/cli-entry.mjs'
|
|
16
|
-
import { lintDockerfileWithHadolint, posixRel } from '../
|
|
17
|
-
import { createCheckReporter } from '../../../scripts/
|
|
18
|
-
import { loadCursorIgnorePaths } from '../../../scripts/
|
|
16
|
+
import { lintDockerfileWithHadolint, posixRel } from '../lib/docker-hadolint.mjs'
|
|
17
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
18
|
+
import { loadCursorIgnorePaths } from '../../../scripts/lib/load-cursor-config.mjs'
|
|
19
19
|
import { walkDir } from '../../../scripts/utils/walkDir.mjs'
|
|
20
|
-
import { runStandardLint } from '../../../scripts/
|
|
20
|
+
import { runStandardLint } from '../../../scripts/lib/run-standard-lint.mjs'
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Чи входить файл до набору lint-docker: Dockerfile або *.Dockerfile (*.dockerfile).
|
package/rules/efes/fix.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line 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,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line 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,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
|
@@ -20,11 +20,11 @@ import { execFileSync } from 'node:child_process'
|
|
|
20
20
|
import { basename, dirname, join } from 'node:path'
|
|
21
21
|
import { fileURLToPath } from 'node:url'
|
|
22
22
|
|
|
23
|
-
import { createCheckReporter } from '../../../scripts/
|
|
24
|
-
import { eventPathsIncludeExact, parseWorkflowYaml } from '../../../scripts/
|
|
23
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
24
|
+
import { eventPathsIncludeExact, parseWorkflowYaml } from '../../../scripts/lib/gha-workflow.mjs'
|
|
25
25
|
import { resolveCmd } from '../../../scripts/utils/resolve-cmd.mjs'
|
|
26
|
-
import { runConftestBatch } from '../../../scripts/
|
|
27
|
-
import { loadTemplate } from '../../../scripts/
|
|
26
|
+
import { runConftestBatch } from '../../../scripts/lib/run-conftest-batch.mjs'
|
|
27
|
+
import { loadTemplate } from '../../../scripts/lib/template.mjs'
|
|
28
28
|
|
|
29
29
|
const HERE = dirname(fileURLToPath(import.meta.url))
|
|
30
30
|
const GA_POLICY_DIR = join(HERE, '..', '..', 'policy')
|
package/rules/ga/lint/lint.mjs
CHANGED
|
@@ -31,8 +31,8 @@ import { platform } from 'node:process'
|
|
|
31
31
|
|
|
32
32
|
import { check as checkGa } from '../js/workflows.mjs'
|
|
33
33
|
import { resolveCmd } from '../../../scripts/utils/resolve-cmd.mjs'
|
|
34
|
-
import { runLintStep } from '../../../scripts/
|
|
35
|
-
import { runStandardLint } from '../../../scripts/
|
|
34
|
+
import { runLintStep } from '../../../scripts/lib/run-lint-step.mjs'
|
|
35
|
+
import { runStandardLint } from '../../../scripts/lib/run-standard-lint.mjs'
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Опис залежності preflight-ом: бінарник, для чого потрібен, і команди встановлення.
|
package/rules/graphql/fix.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { runStandardRule } from '../../scripts/
|
|
1
|
+
import { runStandardRule } from '../../scripts/lib/run-standard-rule.mjs'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Запускає правило: applies → JS-concerns → policy → mdc-refs (через runStandardRule).
|
|
5
5
|
* Library mode: викликається CLI orchestration через `import + run(ctx)`.
|
|
6
|
-
* @param {import('../../scripts/
|
|
6
|
+
* @param {import('../../scripts/lib/run-standard-rule.mjs').RuleContext} [ctx] контекст прогону (walkCache тощо)
|
|
7
7
|
* @returns {Promise<number>} 0 — OK, 1 — порушення
|
|
8
8
|
*/
|
|
9
9
|
export function run(ctx) {
|
|
@@ -13,7 +13,7 @@ export function run(ctx) {
|
|
|
13
13
|
if (import.meta.main) {
|
|
14
14
|
// Standalone: bun rules/<id>/fix.mjs — повний еквівалент `npx @nitra/cursor fix <id>`
|
|
15
15
|
// (config-loading + whitelist + summary). Дві ролі fix.mjs: library (run) + standalone (main).
|
|
16
|
-
const { runRuleCli } = await import('../../scripts/
|
|
16
|
+
const { runRuleCli } = await import('../../scripts/lib/run-rule-cli.mjs')
|
|
17
17
|
// eslint-disable-next-line unicorn/no-process-exit -- standalone entry-point має повертати exit-code для CI/IDE
|
|
18
18
|
process.exit(await runRuleCli(import.meta.dirname))
|
|
19
19
|
}
|
|
@@ -10,14 +10,14 @@ import { existsSync } from 'node:fs'
|
|
|
10
10
|
import { readFile } from 'node:fs/promises'
|
|
11
11
|
import { relative } from 'node:path'
|
|
12
12
|
|
|
13
|
-
import { createCheckReporter } from '../../../scripts/
|
|
13
|
+
import { createCheckReporter } from '../../../scripts/lib/check-reporter.mjs'
|
|
14
14
|
import {
|
|
15
15
|
isGqlScanSourceFile,
|
|
16
16
|
shouldSkipFileForGqlScan,
|
|
17
17
|
sourceFileHasGqlTaggedTemplate
|
|
18
|
-
} from '../
|
|
19
|
-
import { loadCursorIgnorePaths } from '../../../scripts/
|
|
20
|
-
import { runConftestBatch } from '../../../scripts/
|
|
18
|
+
} from '../lib/graphql-gql-scan.mjs'
|
|
19
|
+
import { loadCursorIgnorePaths } from '../../../scripts/lib/load-cursor-config.mjs'
|
|
20
|
+
import { runConftestBatch } from '../../../scripts/lib/run-conftest-batch.mjs'
|
|
21
21
|
import { walkDir } from '../../../scripts/utils/walkDir.mjs'
|
|
22
22
|
|
|
23
23
|
/** Очікуваний файл GraphQL Config у корені (graphql.mdc). */
|