@kirill.konshin/lint 0.4.5 → 0.4.7
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/dist/lintPrepare.d.ts.map +1 -1
- package/dist/lintPrepare.js +9 -3
- package/package.json +1 -1
- package/rules/github.md +16 -21
- package/rules/gitlab.md +15 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lintPrepare.d.ts","sourceRoot":"","sources":["../src/lintPrepare.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG;AASH,KAAK,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5D,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5C,KAAK,YAAY,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAuB1F;;GAEG;AACH,wBAAgB,SAAS,IAAI,IAAI,EAAE,CAwBlC;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,KAAK,EAAE,CAQpC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAYhE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAc9D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAY1D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAA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,IAAI,CAY1D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,EAAE,CA2BpE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKjD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAenG;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,CAW9D;AAED;;GAEG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAuD3B"}
|
package/dist/lintPrepare.js
CHANGED
|
@@ -197,9 +197,15 @@ export function symlinkClaudeMd(cwd) {
|
|
|
197
197
|
*/
|
|
198
198
|
export function generateAgentsFile(rules, cwd, customSection) {
|
|
199
199
|
const relativeRulesDir = path.relative(cwd, RULES_DIR).split(path.sep).join('/');
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
/**
|
|
201
|
+
* @see https://code.claude.com/docs/en/memory#import-additional-files
|
|
202
|
+
* @see https://github.com/anthropics/claude-code/issues/13614 @import -> @path/file.md in Claude
|
|
203
|
+
* @see https://github.com/openai/codex/issues/17401 - no @path/file.md in Codex yet
|
|
204
|
+
*/
|
|
205
|
+
const links = rules
|
|
206
|
+
.map((rule) => `- @${relativeRulesDir}/${rule.file} [${rule.file}](${relativeRulesDir}/${rule.file})`)
|
|
207
|
+
.join('\n');
|
|
208
|
+
const generated = `${HEADER}\n\n${links}\n\n${FOOTER}\n\n${GENERATED_MARKER}`;
|
|
203
209
|
return customSection ? `${generated}\n\n${customSection}\n` : `${generated}\n`;
|
|
204
210
|
}
|
|
205
211
|
/**
|
package/package.json
CHANGED
package/rules/github.md
CHANGED
|
@@ -3,8 +3,13 @@ type: always_apply
|
|
|
3
3
|
description: Set of rules for projects which use Github
|
|
4
4
|
paths:
|
|
5
5
|
- '**/.github/*.yml'
|
|
6
|
+
- '**/.github/**/*.yml'
|
|
7
|
+
- '**/.github/**/*.yaml'
|
|
6
8
|
---
|
|
7
9
|
|
|
10
|
+
- Agentic review MUST verify this effective CI order: checkout -> enable Corepack -> setup Node with Yarn cache -> restore build caches -> immutable install -> prepare -> verification (lint/test/build) -> publish; publishing MUST depend on successful verification.
|
|
11
|
+
- In multi-job workflows, use job-specific build-cache keys with a same-run fallback so downstream jobs reuse upstream results without immutable-key collisions.
|
|
12
|
+
|
|
8
13
|
# Example Workflow
|
|
9
14
|
|
|
10
15
|
```yml
|
|
@@ -42,46 +47,36 @@ jobs:
|
|
|
42
47
|
- name: Checkout Repo
|
|
43
48
|
uses: actions/checkout@v4
|
|
44
49
|
|
|
50
|
+
- name: Enable Corepack
|
|
51
|
+
run: corepack enable
|
|
52
|
+
|
|
45
53
|
- name: Setup Node.js
|
|
46
54
|
uses: actions/setup-node@v6
|
|
47
55
|
with:
|
|
48
|
-
node-version:
|
|
56
|
+
node-version: 24
|
|
49
57
|
registry-url: 'https://registry.npmjs.org'
|
|
50
58
|
cache: yarn
|
|
51
59
|
cache-dependency-path: yarn.lock
|
|
52
60
|
|
|
53
|
-
- name: Enable Corepack
|
|
54
|
-
run: corepack enable
|
|
55
|
-
|
|
56
|
-
- name: Get yarn cache directory path
|
|
57
|
-
id: yarn-cache-dir-path
|
|
58
|
-
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
|
59
|
-
|
|
60
|
-
- uses: actions/cache@v6
|
|
61
|
-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
62
|
-
with:
|
|
63
|
-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
64
|
-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
65
|
-
restore-keys: |
|
|
66
|
-
${{ runner.os }}-yarn-
|
|
67
|
-
|
|
68
61
|
#TODO https://turbo.build/repo/docs/guides/ci-vendors/github-actions#remote-caching
|
|
69
62
|
#TODO https://turborepo.dev/docs/guides/ci-vendors/github-actions#remote-caching-with-github-actionscache
|
|
70
63
|
- name: Cache Turbo
|
|
71
64
|
uses: actions/cache@v6
|
|
72
65
|
with:
|
|
73
66
|
path: .turbo
|
|
74
|
-
key: ${{ runner.os }}-turbo-${{ github.
|
|
67
|
+
key: ${{ runner.os }}-turbo-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
|
|
75
68
|
restore-keys: |
|
|
69
|
+
${{ runner.os }}-turbo-${{ github.run_id }}-${{ github.run_attempt }}-
|
|
76
70
|
${{ runner.os }}-turbo-
|
|
77
71
|
|
|
78
|
-
- name: Cache
|
|
72
|
+
- name: Cache Nx
|
|
79
73
|
uses: actions/cache@v6
|
|
80
74
|
with:
|
|
81
|
-
path: .nx
|
|
82
|
-
key: ${{ runner.os }}-
|
|
75
|
+
path: .nx/cache
|
|
76
|
+
key: ${{ runner.os }}-nx-${{ github.run_id }}-${{ github.run_attempt }}-${{ github.job }}
|
|
83
77
|
restore-keys: |
|
|
84
|
-
${{ runner.os }}-
|
|
78
|
+
${{ runner.os }}-nx-${{ github.run_id }}-${{ github.run_attempt }}-
|
|
79
|
+
${{ runner.os }}-nx-
|
|
85
80
|
|
|
86
81
|
- name: Install dependencies
|
|
87
82
|
run: yarn install --immutable
|
package/rules/gitlab.md
CHANGED
|
@@ -3,10 +3,14 @@ type: always_apply
|
|
|
3
3
|
description: Set of rules for projects which use Gitlab
|
|
4
4
|
paths:
|
|
5
5
|
- '**/.gitlab-ci.yml'
|
|
6
|
+
- '**/.gitlab/**/*.yml'
|
|
7
|
+
- '**/.gitlab/**/*.yaml'
|
|
6
8
|
---
|
|
7
9
|
|
|
8
10
|
- Always collect coverage from tests
|
|
9
11
|
- Always publish important build stats as artifacts
|
|
12
|
+
- Agentic review MUST verify this effective CI order: checkout and cache restore -> enable Corepack -> immutable install -> prepare -> verification (lint/test/build) -> publish; publishing MUST depend on successful verification.
|
|
13
|
+
- Keep local build-cache keys job-specific in parallel pipelines; use a remote Nx or Turbo cache when results must be shared across jobs.
|
|
10
14
|
|
|
11
15
|
# Example
|
|
12
16
|
|
|
@@ -18,21 +22,23 @@ variables:
|
|
|
18
22
|
|
|
19
23
|
cache:
|
|
20
24
|
- key:
|
|
25
|
+
prefix: yarn
|
|
21
26
|
files:
|
|
22
27
|
- yarn.lock # dependencies cached based on lockfile
|
|
23
28
|
paths:
|
|
24
|
-
- .yarn
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
- .yarn/cache
|
|
30
|
+
policy: pull-push
|
|
31
|
+
# Job-specific keys prevent parallel jobs from replacing each other's local build cache.
|
|
32
|
+
- key: build-$CI_JOB_NAME_SLUG-$CI_COMMIT_REF_SLUG
|
|
33
|
+
fallback_keys:
|
|
34
|
+
- build-$CI_JOB_NAME_SLUG-$CI_DEFAULT_BRANCH
|
|
30
35
|
paths:
|
|
31
|
-
-
|
|
32
|
-
-
|
|
36
|
+
- .turbo
|
|
37
|
+
- .nx/cache
|
|
33
38
|
- '**/.tscache'
|
|
34
39
|
- '**/.tsbuildinfo'
|
|
35
40
|
- '**/.next/cache'
|
|
41
|
+
policy: pull-push
|
|
36
42
|
|
|
37
43
|
stages:
|
|
38
44
|
- install
|
|
@@ -80,11 +86,4 @@ build:
|
|
|
80
86
|
- web/build
|
|
81
87
|
```
|
|
82
88
|
|
|
83
|
-
Cache
|
|
84
|
-
|
|
85
|
-
```yaml
|
|
86
|
-
- .yarn/cache
|
|
87
|
-
- .yarn/unplugged
|
|
88
|
-
- .yarn/build-state.yml
|
|
89
|
-
- .yarn/install-state.gz
|
|
90
|
-
```
|
|
89
|
+
- Use Nx Cloud or Turbo Remote Cache when build results must be shared safely across parallel jobs.
|