@readystack/gitlab-ci-break-lint 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -35,7 +35,7 @@ Claude Code · Cursor · Windsurf · any MCP client - add to your MCP config:
35
35
  { "mcpServers": { "gitlab-ci-break-lint": { "command": "npx", "args": ["-y", "@readystack/gitlab-ci-break-lint", "--mcp"] } } }
36
36
  ```
37
37
 
38
- Tools: `check_text` and `check_file` (free) · `check_dir` (licence; the full sweep is free for 7 days). The agent gets every finding with the line number.
38
+ Tools: `check_text` and `check_file` (free) · `check_dir` (licence). The agent gets every finding with the line number.
39
39
 
40
40
  ## Use in CI
41
41
 
@@ -46,7 +46,7 @@ Tools: `check_text` and `check_file` (free) · `check_dir` (licence; the full sw
46
46
 
47
47
  (container: `docker run --rm -v "$PWD:/work" getreadystack/gitlab-ci-break-lint --dir /work --ci`)
48
48
 
49
- Try the full run free for 7 days no key needed. Then one licence, 7-day refund, no questions. Set `READYSTACK_LICENSE=<key>` or run `--license <key>` once.
49
+ The folder sweep, reports and CI mode need one licence one payment, no subscription. Set `READYSTACK_LICENSE=<key>` or run `--license <key>` once.
50
50
 
51
51
  [Get a licence](https://buy.polar.sh/polar_cl_d7bGnhvRyjV580fnsaQ89C7TIU15QgC3kcWpO0NZLGc)
52
52
 
@@ -0,0 +1,54 @@
1
+ # GitLab CI Break Lint
2
+
3
+ ![GitLab CI Break Lint](https://getreadystack.com/img/promo/sku139792_result_card.jpg)
4
+
5
+ Names the .gitlab-ci.yml lines your runner will reject after the next GitLab major upgrade
6
+
7
+ ## Install
8
+
9
+ ```
10
+ npx @readystack/gitlab-ci-break-lint file
11
+ ```
12
+
13
+ Node 18+. The same 16 rules as the VS Code extension, from a terminal or CI.
14
+
15
+ ## Free
16
+
17
+ - Lint the pipeline file you have open and get every retired keyword, GitHub Actions leftover and invalid job wiring with its line number and its replacement line.
18
+ - `--rules` lists every rule
19
+
20
+ ## With a licence ($29 once)
21
+
22
+ - Scan every pipeline file in the repository in one pass and export a dated Markdown upgrade report (file, line, keyword, replacement) to attach to the change ticket.
23
+
24
+ ```
25
+ @readystack/gitlab-ci-break-lint --dir ./templates --report html --out report.html
26
+ ```
27
+
28
+ A freelance DevOps engineer's hour runs about $100, and reading a repository's pipelines by hand against a removals list is most of a morning.
29
+
30
+ ## Use from an AI agent (MCP)
31
+
32
+ Claude Code · Cursor · Windsurf · any MCP client - add to your MCP config:
33
+
34
+ ```json
35
+ { "mcpServers": { "gitlab-ci-break-lint": { "command": "npx", "args": ["-y", "@readystack/gitlab-ci-break-lint", "--mcp"] } } }
36
+ ```
37
+
38
+ Tools: `check_text` and `check_file` (free) · `check_dir` (licence; the full sweep is free for 7 days). The agent gets every finding with the line number.
39
+
40
+ ## Use in CI
41
+
42
+ ```yaml
43
+ - name: GitLab CI Break Lint
44
+ run: npx -y @readystack/gitlab-ci-break-lint --dir . --ci
45
+ ```
46
+
47
+ (container: `docker run --rm -v "$PWD:/work" getreadystack/gitlab-ci-break-lint --dir /work --ci`)
48
+
49
+ Try the full run free for 7 days — no key needed. Then one licence, 7-day refund, no questions. Set `READYSTACK_LICENSE=<key>` or run `--license <key>` once.
50
+
51
+ [Get a licence](https://buy.polar.sh/polar_cl_d7bGnhvRyjV580fnsaQ89C7TIU15QgC3kcWpO0NZLGc)
52
+
53
+
54
+ <!-- gitlab ci break lint -->
package/cli.js CHANGED
@@ -16,7 +16,7 @@ function isText(p) { try { const b = fs.readFileSync(p); if (b.length > 2 * 1024
16
16
  function walk(dir, exts, out) {
17
17
  let ents = []; try { ents = fs.readdirSync(dir, { withFileTypes: true }); } catch (e) { return out; }
18
18
  for (const e of ents) {
19
- if (e.name === 'node_modules' || e.name === '.git' || e.name.startsWith('.')) continue;
19
+ if (['node_modules', '.git', '.hg', '.svn', '.venv', 'venv', '.tox', '.cache', '.next', '.nuxt', '.terraform', '__pycache__'].includes(e.name)) continue; // s158 — .github · .gitlab-ci.yml · .env · .well-known 은 본다 (옛 줄은 점으로 시작하는 것을 전부 건너뛰어 워크플로 검사기가 .github/workflows 를 못 봤다)
20
20
  const p = path.join(dir, e.name);
21
21
  if (e.isDirectory()) walk(p, exts, out);
22
22
  else if ((!exts.length || exts.includes(path.extname(e.name).toLowerCase())) && isText(p)) out.push(p);
@@ -39,23 +39,55 @@ function render(rows, fmt) {
39
39
  return o;
40
40
  }
41
41
  function trialState() {
42
+ // s158 — ⚑7일 무료 없음: 새 체험은 ⛔열지 않는다 · 이미 시작된 체험(trial.json)만 끝까지 지킨다 (읽기 전용)
42
43
  if (process.env.READYSTACK_NO_TRIAL) return { active: false };
43
44
  try {
44
45
  const p = path.join(path.dirname(lic.storePath()), S.bin + '.trial.json');
45
- let t = null; try { t = JSON.parse(fs.readFileSync(p, 'utf8')); } catch (e) {}
46
- if (!t || !t.until) { t = { until: new Date(Date.now() + 7 * 24 * 3600 * 1000).toISOString().slice(0, 10) }; fs.mkdirSync(path.dirname(p), { recursive: true }); fs.writeFileSync(p, JSON.stringify(t)); }
47
- return { active: new Date(t.until + 'T23:59:59Z').getTime() > Date.now(), until: t.until };
46
+ const t = JSON.parse(fs.readFileSync(p, 'utf8'));
47
+ return { active: !!(t && t.until) && new Date(t.until + 'T23:59:59Z').getTime() > Date.now(), until: t && t.until };
48
48
  } catch (e) { return { active: false }; }
49
49
  }
50
+ // ★s158 2026-09-23 — the free run SPEAKS about the rest of the folder (vsix: auto.js · crx: welcome tab).
51
+ // The answer for the named files is complete and free; the next step is shown with the user's OWN numbers:
52
+ // "this folder has N more matching files - M issues in K of them" + the one command that sweeps them.
53
+ // Never blocks, never starts a trial (s158: no free trial - the free answer on the named files is the "try it"), human seat only, 400 files / 1.5 s cap.
54
+ function folderHint(done) {
55
+ if (!process.stderr.isTTY || process.env.CI || process.env.READYSTACK_NO_HINT || !done.length) return;
56
+ const base = path.dirname(path.resolve(done[0]));
57
+ const seen = new Set(done.map((f) => path.resolve(f)));
58
+ const all = walk(base, S.exts || [], []).filter((f) => !seen.has(path.resolve(f)));
59
+ if (!all.length) return;
60
+ const t0 = Date.now(); let issues = 0, hitFiles = 0, scanned = 0;
61
+ for (const f of all.slice(0, 400)) { if (Date.now() - t0 > 1500) break; let t = ''; try { t = fs.readFileSync(f, 'utf8'); } catch (e) { continue; } scanned++; const h = scan(t, f); if (h.length) { issues += h.length; hitFiles++; } }
62
+ const rel = path.relative(process.cwd(), base) || '.';
63
+ const tail = trialState().active ? 'free during your trial' : '$' + S.price + ' once';
64
+ const more = all.length + ' more matching file' + (all.length > 1 ? 's' : '');
65
+ const found = issues ? ' - ' + (scanned < all.length ? 'at least ' : '') + issues + ' issue' + (issues > 1 ? 's' : '') + ' in ' + hitFiles + ' of them' : ' - no issues found in them';
66
+ process.stderr.write('\n' + (rel === '.' ? 'This folder' : rel) + ' has ' + more + found + '.\n' + (issues ? 'Sweep them all: ' + S.bin + ' --dir ' + (/\s/.test(rel) ? JSON.stringify(rel) : rel) + ' (' + tail + ')\n' : ''));
67
+ }
68
+ let _usePinged = false;
69
+ function pingUse() {
70
+ try {
71
+ if (_usePinged) return; _usePinged = true;
72
+ if (process.env.DO_NOT_TRACK === '1' || process.env.READYSTACK_NO_TELEMETRY || process.env.CI) return;
73
+ if (!(process.stdout.isTTY || process.stdin.isTTY)) return; // human seat only (s152)
74
+ const https = require('https');
75
+ const body = JSON.stringify({ t: 'use', slug: S.bin, src: 'cli', why: 'free' });
76
+ const req = https.request({ hostname: 'getreadystack.com', path: '/api/ev', method: 'POST', timeout: 3000,
77
+ headers: { 'content-type': 'application/json', 'content-length': Buffer.byteLength(body), 'user-agent': 'readystack-cli/' + S.bin } }, function (res) { res.resume(); });
78
+ req.on('timeout', function () { req.destroy(); }); req.on('error', function () {});
79
+ req.write(body); req.end();
80
+ } catch (e) {}
81
+ }
50
82
  function mcpServe() {
51
83
  process.env.READYSTACK_MCP = '1'; // s152 - 에이전트(Claude Code·Cursor)가 부른 세션은 사람 자리다 · 키 판 핑 src=mcp
52
- // s144 — MCP server over stdio (newline-delimited JSON-RPC · no dependencies). Free: check_text · check_file. Licence (7-day trial): check_dir.
84
+ // s144 — MCP server over stdio (newline-delimited JSON-RPC · no dependencies). Free: check_text · check_file. Licence (s158: no free trial): check_dir.
53
85
  const rl = require('readline').createInterface({ input: process.stdin });
54
86
  const send = (o) => process.stdout.write(JSON.stringify(o) + '\n');
55
87
  const tools = [
56
88
  { name: 'check_text', description: S.name + ' - run all ' + RULE_N + ' checks on a text (free)', inputSchema: { type: 'object', properties: { text: { type: 'string', description: 'file contents' }, path: { type: 'string', description: 'optional file name for context' } }, required: ['text'] } },
57
89
  { name: 'check_file', description: S.name + ' - run all checks on one file by path (free)', inputSchema: { type: 'object', properties: { path: { type: 'string' } }, required: ['path'] } },
58
- { name: 'check_dir', description: S.name + ' - sweep a folder and return every finding (licence; the full run is free for 7 days)', inputSchema: { type: 'object', properties: { dir: { type: 'string' }, ext: { type: 'string', description: 'optional extension filter, e.g. .html' } }, required: ['dir'] } }
90
+ { name: 'check_dir', description: S.name + ' - sweep a folder and return every finding (licence; $' + S.price + ' once)', inputSchema: { type: 'object', properties: { dir: { type: 'string' }, ext: { type: 'string', description: 'optional extension filter, e.g. .html' } }, required: ['dir'] } }
59
91
  ];
60
92
  const result = (id, rows) => send({ jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: render(rows, 'text') }], structuredContent: { tool: S.name, rules: RULE_N, files: rows } } });
61
93
  const fail = (id, text) => send({ jsonrpc: '2.0', id, result: { content: [{ type: 'text', text }], isError: true } });
@@ -72,7 +104,7 @@ function mcpServe() {
72
104
  if (name === 'check_file') return result(id, [{ file: args.path, hits: scan(fs.readFileSync(args.path, 'utf8'), args.path) }]);
73
105
  if (name === 'check_dir') {
74
106
  const r = await lic.ensure();
75
- if (!r.ok && !trialState().active) return fail(id, S.need_key + ' Get a licence ($' + S.price + ', once, 7-day refund): ' + lic.BUY_URL);
107
+ if (!r.ok && !trialState().active) return fail(id, S.need_key + ' Get a licence ($' + S.price + ', once): ' + lic.BUY_URL);
76
108
  const files = walk(args.dir, args.ext ? [args.ext] : (S.exts || []), []);
77
109
  return result(id, files.map((f) => { let t = ''; try { t = fs.readFileSync(f, 'utf8'); } catch (e) { return { file: f, hits: [], error: String(e.message) }; } return { file: f, hits: scan(t, f) }; }));
78
110
  }
@@ -90,7 +122,7 @@ function help() {
90
122
  ' ' + S.bin + ' --license <key> store your licence key (or set READYSTACK_LICENSE)',
91
123
  ' ' + S.bin + ' --rules list the ' + RULE_N + ' rules',
92
124
  ' ' + S.bin + ' --mcp run as an MCP server (stdio) for Claude Code / Cursor / Windsurf - free checks, folder sweep needs a licence', '',
93
- 'Free: ' + S.free, 'Licence ($' + S.price + ', once, 7-day refund): ' + S.paid, 'Get a licence: ' + lic.BUY_URL, ''].join('\n');
125
+ 'Free: ' + S.free, 'Licence ($' + S.price + ', once): ' + S.paid, 'Get a licence: ' + lic.BUY_URL, ''].join('\n');
94
126
  }
95
127
  (async function main() {
96
128
  try { const _feed = await lic.pullFeed(); if (_feed && Array.isArray(_feed.rules)) { if (Array.isArray(ENGINE.RULES)) for (const r of _feed.rules) ENGINE.RULES.push(r); } } catch (e) {} // ★s134 구독 피드 병합 (키 있는 손님만)
@@ -106,9 +138,16 @@ function help() {
106
138
  if (paid) {
107
139
  const r = await lic.ensure();
108
140
  if (!r.ok) {
109
- const t = trialState(); // s144 reverse trial: the full run is free for 7 days from the first paid use, then the key
110
- if (t.active) process.stderr.write('Trial: the full run is free until ' + t.until + ' — after that $' + S.price + ' once (7-day refund). Get a licence: ' + lic.BUY_URL + '\n');
111
- else { process.stderr.write(S.need_key + '\n set READYSTACK_LICENSE=<key> or ' + S.bin + ' --license <key>\n Get a licence ($' + S.price + ', once): ' + lic.BUY_URL + '\n'); process.exit(2); }
141
+ const t = trialState(); // s158 7 무료 없음 · 이미 시작된 체험만 지킨다
142
+ if (t.active) process.stderr.write('Trial: the full run is free until ' + t.until + ' — after that $' + S.price + ' once. Get a licence: ' + lic.BUY_URL + '\n');
143
+ else {
144
+ // s158 — the key is asked WITH the customer's own count (endowment · open loop): how many issues this folder holds.
145
+ let own = '';
146
+ if (dir) { try { const all = walk(dir, exts, []); let n = 0, k = 0, sc = 0; const t0 = Date.now();
147
+ for (const f of all.slice(0, 2000)) { if (Date.now() - t0 > 4000) break; let tx = ''; try { tx = fs.readFileSync(f, 'utf8'); } catch (e) { continue; } sc++; const h = scan(tx, f); if (h.length) { n += h.length; k++; } }
148
+ if (n) own = dir + ': ' + (sc < all.length ? 'at least ' : '') + n + ' issue' + (n > 1 ? 's' : '') + ' in ' + k + ' of ' + all.length + ' files.\n'; } catch (e) {} }
149
+ process.stderr.write(own + S.need_key + '\n set READYSTACK_LICENSE=<key> or ' + S.bin + ' --license <key>\n Get a licence ($' + S.price + ' once): ' + lic.BUY_URL + '\n'); process.exit(2);
150
+ }
112
151
  }
113
152
  }
114
153
  const files = dir ? walk(dir, exts, []) : a.filter((x, i) => !x.startsWith('--') && !['--dir', '--report', '--out', '--ext', '--license'].includes(a[i - 1]));
@@ -116,6 +155,7 @@ function help() {
116
155
  const rows = files.map((f) => { let t = ''; try { t = fs.readFileSync(f, 'utf8'); } catch (e) { return { file: f, hits: [], error: String(e.message) }; } return { file: f, hits: scan(t) }; });
117
156
  const text = render(rows, fmt || 'text');
118
157
  if (out) fs.writeFileSync(out, text); else process.stdout.write(text.endsWith('\n') ? text : text + '\n');
158
+ if (!paid) { try { folderHint(files); } catch (e) {} pingUse(); } // s158 — a free run ends with the user's own folder count + one anonymous 'used' count (human seat only)
119
159
  const errors = rows.reduce((n, r) => n + r.hits.filter((h) => h.sev === 'error').length, 0);
120
160
  if (ci && errors) process.exit(1);
121
161
  })().catch((e) => { process.stderr.write(String(e && e.stack || e) + '\n'); process.exit(3); });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readystack/gitlab-ci-break-lint",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Names the .gitlab-ci.yml lines your runner will reject after the next GitLab major upgrade",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {