@7n/rules 1.7.1 → 1.7.3

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
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.7.3] - 2026-07-16
4
+
5
+ ### Fixed
6
+
7
+ - Краш oxlint (напр. відсутній jsPlugin з канонічного `.oxlintrc.json`) тепер показує exit-код і хвости stderr/stdout замість глухого «json не розпарсено» — причину видно на CI одразу
8
+
9
+ ## [1.7.2] - 2026-07-16
10
+
11
+ ### Changed
12
+
13
+ - tauri release: рекомендувати завжди --target aarch64-apple-darwin замість universal-apple-darwin (lipo-merge не зливає другорядні [[bin]]-таргети)
14
+
3
15
  ## [1.7.1] - 2026-07-16
4
16
 
5
17
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/rules",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "CLI еталонних правил і skills (префікс n-): синк у репозиторій, дельта-lint, конформність",
5
5
  "keywords": [
6
6
  "cli",
@@ -63,8 +63,8 @@
63
63
  "rename-yaml-extensions": "bun ./bin/n-rules.js rename-yaml-extensions"
64
64
  },
65
65
  "dependencies": {
66
- "@7n/mt": "^0.5.1",
67
66
  "@7n/llm-lib": "^2.0.0",
67
+ "@7n/mt": "^0.5.1",
68
68
  "@zed-industries/agent-client-protocol": "^0.4.5",
69
69
  "ajv": "^8.20.0",
70
70
  "cli-progress": "^3.12.0",
@@ -3,7 +3,7 @@ type: JS Module
3
3
  title: main.mjs
4
4
  resource: npm/rules/js/eslint/main.mjs
5
5
  docgen:
6
- crc: 11a1340b
6
+ crc: 2d36631f
7
7
  model: omlx/gemma-4-e4b-it-OptiQ-4bit
8
8
  score: 100
9
9
  issues: judge:inaccurate:0.99
@@ -31,3 +31,5 @@ lint — проводить статичний аналіз коду (пофай
31
31
  - Перехоплює помилки і не пропускає винятків назовні (fail-safe).
32
32
 
33
33
  **warnIgnored: false.** ESLint конструюється з `warnIgnored: false` — файли з delta-списку, що матчать ignore-патерни `eslint.config.js` (наприклад, синковані `.pi/extensions/**` чи згенеровані `npm/types/**`), не рахуються порушеннями.
34
+
35
+ **Діагностика крашу oxlint.** Якщо oxlint завершився помилкою і json не розпарсено, у повідомлення DetectorError включаються exit-код і хвости stderr/stdout — інакше на CI причина (відсутній jsPlugin, конфіг, OOM) невидима.
@@ -24,11 +24,11 @@ export function filterJsFiles(files) {
24
24
  /**
25
25
  * @param {string[]} args аргументи запуску oxlint
26
26
  * @param {string} cwd робочий каталог
27
- * @returns {{ status: number, stdout: string }} код завершення й stdout процесу
27
+ * @returns {{ status: number, stdout: string, stderr: string }} код завершення, stdout і stderr процесу
28
28
  */
29
29
  function runOxlintJson(args, cwd) {
30
30
  const r = spawnSync('bunx', args, { cwd, encoding: 'utf8', maxBuffer: JSON_MAX_BUFFER })
31
- return { status: typeof r.status === 'number' ? r.status : 1, stdout: r.stdout ?? '' }
31
+ return { status: typeof r.status === 'number' ? r.status : 1, stdout: r.stdout ?? '', stderr: r.stderr ?? '' }
32
32
  }
33
33
 
34
34
  /**
@@ -64,7 +64,15 @@ async function collectFindings(js, cwd) {
64
64
  const oxRes = runOxlintJson(oxArgs, cwd)
65
65
  const ox = parseOxlint(oxRes.stdout)
66
66
  if (ox === null && oxRes.status !== 0) {
67
- throw new Error('oxlint завершився з помилкою (не lint-порушення) json не розпарсено')
67
+ // Хвости stdout/stderr інакше на CI причина крашу (OOM, конфіг, версія) невидима.
68
+ const tail = [oxRes.stderr, oxRes.stdout]
69
+ .map(t => t.trim().slice(-500))
70
+ .filter(t => t !== '')
71
+ .join('\n--- stdout: ')
72
+ const suffix = tail === '' ? '' : `\n${tail}`
73
+ throw new Error(
74
+ `oxlint завершився з помилкою (exit ${oxRes.status}, не lint-порушення) — json не розпарсено${suffix}`
75
+ )
68
76
  }
69
77
  return [...(ox ?? []), ...es]
70
78
  }
@@ -81,8 +81,10 @@ jobs:
81
81
  contents: write
82
82
  id-token: write # OIDC для Infisical
83
83
  steps:
84
- # ... checkout, rust-toolchain, потім (rust.mdc вимагає кеш, zizmor фейлить
84
+ # ... checkout, потім (rust.mdc вимагає кеш, zizmor фейлить
85
85
  # cache-poisoning у тег-тригереному release — прийнятий ризик приглушуємо inline):
86
+ - uses: dtolnay/rust-toolchain@stable
87
+ with: { targets: aarch64-apple-darwin }
86
88
  - uses: Swatinem/rust-cache@v2 # zizmor: ignore[cache-poisoning]
87
89
  - name: Sync app version from tag
88
90
  run: |
@@ -93,11 +95,12 @@ jobs:
93
95
  - uses: Infisical/secrets-action@v1
94
96
  with: { secret-path: '/updater' }
95
97
  - uses: tauri-apps/tauri-action@v0
96
- with: { projectPath: app }
98
+ with: { projectPath: app, args: '--target aarch64-apple-darwin' }
97
99
  ```
98
100
 
99
101
  - **«Sync app version from tag» має йти перед кроком `tauri-apps/tauri-action`** — тег `vX.Y.Z` є єдиним джерелом версії для build-артефактів; `tauri.conf.json#version` у робочому дереві не редагується вручну (він там лишається тим, що востаннє поставив `n-rules release`, і синхронізується цим кроком лише в CI, не в git).
100
102
  - Секрети підпису — з Infisical: Apple-сертифікати (`secret-path: /apple`) і `TAURI_SIGNING_PRIVATE_KEY` (`secret-path: /updater`) — обидва потрібні `tauri-apps/tauri-action`, щоб зібрати підписаний DMG з updater-артефактами.
103
+ - **macOS-таргет — завжди `aarch64-apple-darwin`, ніколи `universal-apple-darwin`.** Без умовного галуження за кількістю `[[bin]]` у крейті: lipo-merge крок `tauri-action` зливає між арками лише головний GUI-бінарник, а будь-який додатковий `[[bin]]`-таргет лишається поза `universal-apple-darwin`-директорією — бандлер падає на `Failed to copy binary from ".../universal-apple-darwin/release/<bin>": ... does not exist`. Синхронно звузити `with.targets` кроку `dtolnay/rust-toolchain@…` до `aarch64-apple-darwin` (без `x86_64-apple-darwin`).
101
104
 
102
105
  ### `tauri.conf.json` — updater-артефакти й endpoint
103
106