@alxwlw/stack 1.1.0 → 1.1.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.
@@ -10,9 +10,9 @@
10
10
  "dependency-cruiser": "18.1.0",
11
11
  "vitest": "4.1.10",
12
12
  "@playwright/test": "1.62.0",
13
- "@alxwlw/stack": "1.1.0",
14
- "@alxwlw/oxlint-config": "1.1.0",
15
- "@alxwlw/tsconfig": "1.1.0"
13
+ "@alxwlw/stack": "1.1.2",
14
+ "@alxwlw/oxlint-config": "1.1.2",
15
+ "@alxwlw/tsconfig": "1.1.2"
16
16
  },
17
17
  "libs": {
18
18
  "@nestjs/core": "12.0.1",
@@ -1,6 +1,7 @@
1
1
  // markdownlint-cli2 config — stack canon (sync-managed verbatim; never edit
2
- // in a repo — repo-local ignore paths go in .markdownlintignore, which
3
- // markdownlint-cli2 honors natively).
2
+ // in a repo). Repo-specific ignore paths go in .markdownlintignore (gitignore
3
+ // syntax; seeded once by `stack sync`, repo-owned afterwards): markdownlint-cli2
4
+ // has no ignore file by default, so the `gitignore` option below points it there.
4
5
  //
5
6
  // Scope: **semantic** markdown linting only. Formatting (line wrap,
6
7
  // list marker style, trailing whitespace, etc.) is handled by oxfmt
@@ -90,6 +91,8 @@
90
91
  "MD045": false, // no-alt-text: too many screenshots lack alt
91
92
  },
92
93
  "globs": ["**/*.md", "**/*.mdx"],
94
+ // Makes cli2 read the repo-owned ignore file (gitignore syntax).
95
+ "gitignore": ".markdownlintignore",
93
96
  "ignores": [
94
97
  // Build artifacts
95
98
  "**/node_modules/**",
@@ -107,6 +110,9 @@
107
110
  // their commit history for no benefit.
108
111
  "docs/specs/**",
109
112
  "docs/plans/**",
113
+ // The same records under the superpowers plugin's default layout.
114
+ "docs/superpowers/specs/**",
115
+ "docs/superpowers/plans/**",
110
116
  ".superpowers/**",
111
117
  // Brainstorming docs — idea exploration, not operational
112
118
  "docs/ideas/**",
@@ -1,4 +1,6 @@
1
1
  # Repo-local markdownlint ignores — YOURS to edit (seeded once by
2
- # `stack sync`, never overwritten). gitignore-style patterns.
3
- # The rule set lives in the sync-managed .markdownlint-cli2.jsonc — never edit
4
- # that file; add repo-specific ignore paths HERE.
2
+ # `stack sync`, never overwritten). gitignore syntax: `vendor` or `vendor/`
3
+ # ignores that directory (a bare name matches at any depth); `docs/x/**` is
4
+ # anchored to the repo root. markdownlint-cli2 reads this file because the
5
+ # sync-managed .markdownlint-cli2.jsonc points its `gitignore` option here —
6
+ # never edit that file; add repo-specific ignore paths HERE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alxwlw/stack",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
package/src/catalogs.ts CHANGED
@@ -48,7 +48,9 @@ export function planCatalogs(repoRoot: string, canon: Canon): Drift[] {
48
48
  // double quotes otherwise, so a freshly-synced workspace fails `oxfmt --check`.
49
49
  // ponytail: doc общий на весь план, файл пишется на каждую запись; один flush в
50
50
  // конце, если ~40 записей первого sync станут заметны.
51
- writeFileSync(path, doc.toString({ singleQuote: true }));
51
+ // lineWidth: 0 — без переноса: по умолчанию yaml режет скаляры длиннее 80 колонок во
52
+ // всём документе, и sync переписал бы строки, к каталогам не относящиеся.
53
+ writeFileSync(path, doc.toString({ singleQuote: true, lineWidth: 0 }));
52
54
  },
53
55
  });
54
56
  }
package/src/cli.ts CHANGED
@@ -5,6 +5,7 @@ import { parseArgs } from 'node:util';
5
5
  import { loadCanon } from './canon.ts';
6
6
  import { checkRepo, syncRepo } from './check.ts';
7
7
  import { type Profile, PROFILES, readStackConfig, StackConfigError } from './config.ts';
8
+ import { type Finding, isDrift } from './findings.ts';
8
9
  import { initConfig } from './init.ts';
9
10
 
10
11
  function fail(message: string): never {
@@ -29,6 +30,17 @@ function parseCliArgs() {
29
30
  }
30
31
  }
31
32
 
33
+ // Подсказка под находками: stack sync закрывает только Drift; правила deps.ts — отчёт без действия.
34
+ function fixHint(blocking: Finding[]): string {
35
+ const total = blocking.length;
36
+ const bySync = blocking.filter(isDrift).length;
37
+ if (bySync === total) return `${total} finding(s). Fix with: stack sync`;
38
+ if (bySync === 0) {
39
+ return `${total} finding(s). stack sync does not fix these — fix them by hand (see above)`;
40
+ }
41
+ return `${total} finding(s): ${bySync} fixable with: stack sync, ${total - bySync} to fix by hand (see above)`;
42
+ }
43
+
32
44
  const { values, positionals } = parseCliArgs();
33
45
 
34
46
  const repoRoot = values.repo ?? process.cwd();
@@ -61,7 +73,7 @@ try {
61
73
  }
62
74
  for (const f of blocking) console.error(`${f.code}: ${f.target} — ${f.message}`);
63
75
  if (blocking.length) {
64
- console.error(`\n${blocking.length} finding(s). Fix with: stack sync`);
76
+ console.error(`\n${fixHint(blocking)}`);
65
77
  process.exit(1);
66
78
  }
67
79
  console.log('canon: no drift');
package/src/findings.ts CHANGED
@@ -29,6 +29,11 @@ export interface Drift extends Finding {
29
29
  apply(): void;
30
30
  }
31
31
 
32
+ // Drift — находка, которую закрывает `stack sync` (у неё есть apply); остальное правят руками.
33
+ export function isDrift(f: Finding): f is Drift {
34
+ return typeof (f as Partial<Drift>).apply === 'function';
35
+ }
36
+
32
37
  export function covers(e: Exception, f: Finding): boolean {
33
38
  const a = f.address;
34
39
  if (!a) return false;