@nitra/cursor 1.13.72 → 1.13.73

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
@@ -4,6 +4,12 @@
4
4
 
5
5
  Формат — [Keep a Changelog](https://keepachangelog.com/uk/1.1.0/), нумерація — [SemVer](https://semver.org/lang/uk/).
6
6
 
7
+ ## [1.13.73] - 2026-05-21
8
+
9
+ ### Fixed
10
+
11
+ - **Збір workspace-коренів** — `getMonorepoPackageRootDirs` / `getMonorepoProjectRootDirs` більше не трактують `package.json` у `node_modules/`, `.git/`, `.venv/`, `venv/` як воркспейси (glob ignore + `isIgnoredWorkspaceRoot`). Усуває хибні `check changelog` на транзитивних залежностях (наприклад `node-gyp/gyp`).
12
+
7
13
  ## [1.13.72] - 2026-05-21
8
14
 
9
15
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nitra/cursor",
3
- "version": "1.13.72",
3
+ "version": "1.13.73",
4
4
  "description": "CLI для завантаження cursor-правил (префікс n-) у локальний репозиторій",
5
5
  "keywords": [
6
6
  "cli",
@@ -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 } from './workspaces.mjs'
11
+ import { getMonorepoPackageRootDirs, isIgnoredWorkspaceRoot } from './workspaces.mjs'
12
12
 
13
13
  /**
14
14
  * @typedef {'npm' | 'python'} PackageKind
@@ -132,12 +132,12 @@ export async function getMonorepoProjectRootDirs(repoRoot = '.') {
132
132
  const absDir = dirname(join(repoRoot, relPy))
133
133
  const relRoot = relative(repoRoot, absDir)
134
134
  const ws = relRoot === '' ? '.' : relRoot
135
- if (!existsSync(join(repoRoot, ws, 'package.json'))) {
135
+ if (!isIgnoredWorkspaceRoot(ws) && !existsSync(join(repoRoot, ws, 'package.json'))) {
136
136
  roots.add(ws)
137
137
  }
138
138
  }
139
139
 
140
- const list = [...roots]
140
+ const list = [...roots].filter(ws => !isIgnoredWorkspaceRoot(ws))
141
141
  list.sort((a, b) => {
142
142
  if (a === '.') return -1
143
143
  if (b === '.') return 1
@@ -9,6 +9,32 @@ import { glob, readFile } from 'node:fs/promises'
9
9
  import { dirname, join, relative } from 'node:path'
10
10
 
11
11
  const TRAILING_SLASH_RE = /\/$/
12
+ const LEADING_DOTSLASH_RE = /^\.\//
13
+
14
+ /** Glob-ігнор для workspace-патернів із `*` (узгоджено з `package-manifest.mjs`). */
15
+ export const WORKSPACE_GLOB_IGNORE = Object.freeze([
16
+ '**/node_modules/**',
17
+ '**/.git/**',
18
+ '**/.venv/**',
19
+ '**/venv/**'
20
+ ])
21
+
22
+ /**
23
+ * Чи слід виключити каталог зі списку workspace-коренів (не стосується `.`).
24
+ * @param {string} ws відносний шлях воркспейсу
25
+ * @returns {boolean} true — пропустити
26
+ */
27
+ export function isIgnoredWorkspaceRoot(ws) {
28
+ if (ws === '.') return false
29
+ const p = ws.replaceAll('\\', '/').replace(LEADING_DOTSLASH_RE, '')
30
+ const segments = p.split('/')
31
+ return (
32
+ segments.includes('node_modules') ||
33
+ segments.includes('.git') ||
34
+ segments.includes('.venv') ||
35
+ segments.includes('venv')
36
+ )
37
+ }
12
38
 
13
39
  /**
14
40
  * Нормалізує workspace-патерн до POSIX-формату і прибирає хвостові `/`.
@@ -33,16 +59,22 @@ function normalizeWorkspacePattern(pattern) {
33
59
  async function addWorkspaceRootsByPattern(roots, repoRoot, workspacePattern) {
34
60
  if (workspacePattern.includes('*')) {
35
61
  const globPat = `${workspacePattern}/package.json`
36
- for await (const relPkgJsonPath of glob(globPat, { cwd: repoRoot })) {
62
+ for await (const relPkgJsonPath of glob(globPat, {
63
+ cwd: repoRoot,
64
+ ignore: [...WORKSPACE_GLOB_IGNORE]
65
+ })) {
37
66
  const absPkgJsonPath = join(repoRoot, relPkgJsonPath)
38
67
  const relRoot = relative(repoRoot, dirname(absPkgJsonPath))
39
- roots.add(relRoot === '' ? '.' : relRoot)
68
+ const ws = relRoot === '' ? '.' : relRoot
69
+ if (!isIgnoredWorkspaceRoot(ws)) {
70
+ roots.add(ws)
71
+ }
40
72
  }
41
73
  return
42
74
  }
43
75
 
44
76
  const pkgJsonPath = join(repoRoot, workspacePattern, 'package.json')
45
- if (existsSync(pkgJsonPath)) {
77
+ if (existsSync(pkgJsonPath) && !isIgnoredWorkspaceRoot(workspacePattern)) {
46
78
  roots.add(workspacePattern)
47
79
  }
48
80
  }
@@ -77,7 +109,7 @@ export async function getMonorepoPackageRootDirs(repoRoot = '.') {
77
109
  const workspacePattern = normalizeWorkspacePattern(raw)
78
110
  await addWorkspaceRootsByPattern(roots, repoRoot, workspacePattern)
79
111
  }
80
- const list = [...roots]
112
+ const list = [...roots].filter(ws => !isIgnoredWorkspaceRoot(ws))
81
113
  list.sort((a, b) => {
82
114
  if (a === '.') return -1
83
115
  if (b === '.') return 1