@7n/rules 1.16.0 → 1.16.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.16.1] - 2026-07-18
4
+
5
+ ### Fixed
6
+
7
+ - taze-оркестратор на репо без кореневого package.json (чисто-Python/Rust): npm/bun-гілка тихо пропускається (лог + без npm-рядків у звіті) замість смертельного `bun install → exit 1` до екосистемних провайдерів. Знайдено live-прогоном lang-python плагіна на реальному Python-репо
8
+
3
9
  ## [1.16.0] - 2026-07-18
4
10
 
5
11
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7n/rules",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "description": "CLI еталонних правил і skills (префікс n-): синк у репозиторій, дельта-lint, конформність",
5
5
  "keywords": [
6
6
  "cli",
@@ -3,7 +3,7 @@ type: JS Module
3
3
  title: orchestrate.mjs
4
4
  resource: npm/skills/taze/js/orchestrate.mjs
5
5
  docgen:
6
- crc: a1a1ade0
6
+ crc: 256c4e77
7
7
  model: openai-codex/gpt-5.4-mini
8
8
  score: 100
9
9
  issues: judge:inaccurate:0.98
@@ -36,5 +36,6 @@ docgen:
36
36
 
37
37
  - Виконує файлові операції (копіювання/видалення бекапів) і запускає зовнішні команди — НЕ read-only.
38
38
  - Перед будь-якою мутацією перевіряє, що `cwd` — ізольований worktree (`assertRunningInWorktree`), інакше кидає виняток.
39
+ - npm/bun-гілка активна лише за кореневим package.json: на чисто-Python/Rust репо вона тихо пропускається (лог + без npm-рядків у звіті), а не валить прогін через `bun install → exit 1`.
39
40
  - Виняток усередині одного провайдера (bump/diff/команда) не зупиняє інших — фіксується в `error` запису екосистеми й у звіті; `ok` результату тоді false.
40
41
  - Падіння одного пакета в ізольованому виклику раннера не втрачає прогрес по інших записах.
@@ -289,19 +289,19 @@ function appendEcosystemSection(lines, eco) {
289
289
  * minorPatch: number,
290
290
  * totalChanged: number,
291
291
  * results: Array<{pkg:string, workspace:string, from:string, to:string, ok:boolean, error:string|null}>,
292
- * ecosystems?: Array<object>
293
- * }} args дані звіту (`ecosystems` — записи з `runEcosystem`, по одному на провайдера)
292
+ * ecosystems?: Array<object>,
293
+ * npmPresent?: boolean
294
+ * }} args дані звіту (`ecosystems` — записи з `runEcosystem`, по одному на провайдера;
295
+ * `npmPresent: false` — репо без кореневого package.json, npm-рядки не друкуються)
294
296
  * @returns {string} markdown-звіт
295
297
  */
296
- export function formatReport({ minorPatch, totalChanged, results, ecosystems = [] }) {
297
- const lines = [
298
- '## taze: підсумок',
299
- '',
300
- `- **Оновлено (minor/patch):** ${minorPatch}`,
301
- `- **Major-оновлення:** ${results.length}`
302
- ]
303
- for (const r of results) {
304
- lines.push(formatResultLine(r, r.workspace))
298
+ export function formatReport({ minorPatch, totalChanged, results, ecosystems = [], npmPresent = true }) {
299
+ const lines = ['## taze: підсумок', '']
300
+ if (npmPresent) {
301
+ lines.push(`- **Оновлено (minor/patch):** ${minorPatch}`, `- **Major-оновлення:** ${results.length}`)
302
+ for (const r of results) {
303
+ lines.push(formatResultLine(r, r.workspace))
304
+ }
305
305
  }
306
306
 
307
307
  let ecosystemsTotal = 0
@@ -339,27 +339,37 @@ export async function runTazeOrchestrator(options = {}) {
339
339
 
340
340
  assertRunningInWorktree(cwd, spawnFn)
341
341
 
342
- log('📦 Бекап package.json...')
343
- const backedUpWorkspaces = await backupWorkspacePackageFiles(cwd, deps)
342
+ // npm/bun-гілка активна лише за кореневим package.json — на чисто-Python/Rust
343
+ // репо `bun install` падає з exit 1, і без цього гейта весь прогін гинув би
344
+ // до екосистемних провайдерів. Той самий принцип «тиші», що й для мовних
345
+ // екосистем: немає сигналу — немає ані кроків, ані згадки у звіті.
346
+ const npmPresent = existsSync(join(cwd, 'package.json'))
347
+ let diff = { major: [], minorPatch: 0, totalChanged: 0 }
348
+ const results = []
349
+ if (npmPresent) {
350
+ log('📦 Бекап package.json...')
351
+ const backedUpWorkspaces = await backupWorkspacePackageFiles(cwd, deps)
344
352
 
345
- log('⬆️ bunx taze -w -r latest...')
346
- runCommand('bunx', ['taze', '-w', '-r', 'latest'], cwd, spawnFn)
347
- log('📥 bun install...')
348
- runCommand('bun', ['install'], cwd, spawnFn)
353
+ log('⬆️ bunx taze -w -r latest...')
354
+ runCommand('bunx', ['taze', '-w', '-r', 'latest'], cwd, spawnFn)
355
+ log('📥 bun install...')
356
+ runCommand('bun', ['install'], cwd, spawnFn)
349
357
 
350
- const collectDiff = deps.collectTazeDiff ?? collectTazeDiff
351
- const diff = await collectDiff(cwd)
352
- log(`🔍 diff: ${diff.major.length} major, ${diff.minorPatch} minor/patch`)
358
+ const collectDiff = deps.collectTazeDiff ?? collectTazeDiff
359
+ diff = await collectDiff(cwd)
360
+ log(`🔍 diff: ${diff.major.length} major, ${diff.minorPatch} minor/patch`)
353
361
 
354
- const results = []
355
- for (const entry of diff.major) {
356
- log(`🔧 ${entry.pkg} (${entry.workspace}): ${entry.from} → ${entry.to}...`)
357
- const outcome = await call(runner, buildDependencyPrompt(entry), cwd, deps)
358
- results.push({ ...entry, ...outcome })
359
- log(outcome.ok ? ` ✅ ${entry.pkg}` : ` ❌ ${entry.pkg}: ${outcome.error}`)
360
- }
362
+ for (const entry of diff.major) {
363
+ log(`🔧 ${entry.pkg} (${entry.workspace}): ${entry.from} ${entry.to}...`)
364
+ const outcome = await call(runner, buildDependencyPrompt(entry), cwd, deps)
365
+ results.push({ ...entry, ...outcome })
366
+ log(outcome.ok ? ` ✅ ${entry.pkg}` : ` ❌ ${entry.pkg}: ${outcome.error}`)
367
+ }
361
368
 
362
- await cleanupBackups(cwd, backedUpWorkspaces, deps)
369
+ await cleanupBackups(cwd, backedUpWorkspaces, deps)
370
+ } else {
371
+ log('⏭ npm/bun: кореневого package.json немає — гілка пропущена')
372
+ }
363
373
 
364
374
  const providers = deps.ecosystemProviders ?? [rustProvider, ...(await loadPluginTazeProviders(cwd, log, deps))]
365
375
  const ecosystems = []
@@ -367,7 +377,13 @@ export async function runTazeOrchestrator(options = {}) {
367
377
  ecosystems.push(await runEcosystem(provider, { cwd, runner, log, deps, spawnFn, call }))
368
378
  }
369
379
 
370
- const report = formatReport({ minorPatch: diff.minorPatch, totalChanged: diff.totalChanged, results, ecosystems })
380
+ const report = formatReport({
381
+ minorPatch: diff.minorPatch,
382
+ totalChanged: diff.totalChanged,
383
+ results,
384
+ ecosystems,
385
+ npmPresent
386
+ })
371
387
  log(report)
372
388
 
373
389
  const ecosystemsOk = ecosystems.every(eco => eco.error === null && eco.results.every(r => r.ok))