@limenet-ch/baseline 2.9.0

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.
Files changed (105) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +272 -0
  3. package/js/dist/bin.d.ts +2 -0
  4. package/js/dist/bin.js +59 -0
  5. package/js/dist/bin.js.map +1 -0
  6. package/js/dist/checks/allows-tooling-in-claude-settings-check.d.ts +11 -0
  7. package/js/dist/checks/allows-tooling-in-claude-settings-check.js +14 -0
  8. package/js/dist/checks/allows-tooling-in-claude-settings-check.js.map +1 -0
  9. package/js/dist/checks/biome-uses-local-schema-check.d.ts +21 -0
  10. package/js/dist/checks/biome-uses-local-schema-check.js +78 -0
  11. package/js/dist/checks/biome-uses-local-schema-check.js.map +1 -0
  12. package/js/dist/checks/calls-baseline-check.d.ts +11 -0
  13. package/js/dist/checks/calls-baseline-check.js +34 -0
  14. package/js/dist/checks/calls-baseline-check.js.map +1 -0
  15. package/js/dist/checks/check.d.ts +37 -0
  16. package/js/dist/checks/check.js +54 -0
  17. package/js/dist/checks/check.js.map +1 -0
  18. package/js/dist/checks/ci-sets-node-version-check.d.ts +10 -0
  19. package/js/dist/checks/ci-sets-node-version-check.js +43 -0
  20. package/js/dist/checks/ci-sets-node-version-check.js.map +1 -0
  21. package/js/dist/checks/claude-settings-check.d.ts +30 -0
  22. package/js/dist/checks/claude-settings-check.js +43 -0
  23. package/js/dist/checks/claude-settings-check.js.map +1 -0
  24. package/js/dist/checks/denies-env-reads-in-claude-settings-check.d.ts +13 -0
  25. package/js/dist/checks/denies-env-reads-in-claude-settings-check.js +25 -0
  26. package/js/dist/checks/denies-env-reads-in-claude-settings-check.js.map +1 -0
  27. package/js/dist/checks/does-not-have-copilot-or-junie-agent-files-check.d.ts +5 -0
  28. package/js/dist/checks/does-not-have-copilot-or-junie-agent-files-check.js +25 -0
  29. package/js/dist/checks/does-not-have-copilot-or-junie-agent-files-check.js.map +1 -0
  30. package/js/dist/checks/does-not-use-both-baseline-runners-check.d.ts +13 -0
  31. package/js/dist/checks/does-not-use-both-baseline-runners-check.js +30 -0
  32. package/js/dist/checks/does-not-use-both-baseline-runners-check.js.map +1 -0
  33. package/js/dist/checks/hardens-npm-supply-chain-check.d.ts +5 -0
  34. package/js/dist/checks/hardens-npm-supply-chain-check.js +68 -0
  35. package/js/dist/checks/hardens-npm-supply-chain-check.js.map +1 -0
  36. package/js/dist/checks/has-ci-jobs-check.d.ts +9 -0
  37. package/js/dist/checks/has-ci-jobs-check.js +14 -0
  38. package/js/dist/checks/has-ci-jobs-check.js.map +1 -0
  39. package/js/dist/checks/has-editorconfig-check.d.ts +6 -0
  40. package/js/dist/checks/has-editorconfig-check.js +42 -0
  41. package/js/dist/checks/has-editorconfig-check.js.map +1 -0
  42. package/js/dist/checks/has-npm-scripts-check.d.ts +5 -0
  43. package/js/dist/checks/has-npm-scripts-check.js +20 -0
  44. package/js/dist/checks/has-npm-scripts-check.js.map +1 -0
  45. package/js/dist/checks/has-trivy-config-check.d.ts +26 -0
  46. package/js/dist/checks/has-trivy-config-check.js +179 -0
  47. package/js/dist/checks/has-trivy-config-check.js.map +1 -0
  48. package/js/dist/checks/is-ci-lint-complete-check.d.ts +10 -0
  49. package/js/dist/checks/is-ci-lint-complete-check.js +25 -0
  50. package/js/dist/checks/is-ci-lint-complete-check.js.map +1 -0
  51. package/js/dist/checks/node-version-check.d.ts +5 -0
  52. package/js/dist/checks/node-version-check.js +77 -0
  53. package/js/dist/checks/node-version-check.js.map +1 -0
  54. package/js/dist/checks/periodic-check.d.ts +16 -0
  55. package/js/dist/checks/periodic-check.js +34 -0
  56. package/js/dist/checks/periodic-check.js.map +1 -0
  57. package/js/dist/checks/registry.d.ts +10 -0
  58. package/js/dist/checks/registry.js +56 -0
  59. package/js/dist/checks/registry.js.map +1 -0
  60. package/js/dist/checks/runs-ci-lint-hook-in-claude-settings-check.d.ts +6 -0
  61. package/js/dist/checks/runs-ci-lint-hook-in-claude-settings-check.js +26 -0
  62. package/js/dist/checks/runs-ci-lint-hook-in-claude-settings-check.js.map +1 -0
  63. package/js/dist/checks/updates-dependencies-check.d.ts +5 -0
  64. package/js/dist/checks/updates-dependencies-check.js +8 -0
  65. package/js/dist/checks/updates-dependencies-check.js.map +1 -0
  66. package/js/dist/checks/uses-release-it-check.d.ts +12 -0
  67. package/js/dist/checks/uses-release-it-check.js +40 -0
  68. package/js/dist/checks/uses-release-it-check.js.map +1 -0
  69. package/js/dist/commands/check.d.ts +7 -0
  70. package/js/dist/commands/check.js +59 -0
  71. package/js/dist/commands/check.js.map +1 -0
  72. package/js/dist/commands/install-skills.d.ts +16 -0
  73. package/js/dist/commands/install-skills.js +47 -0
  74. package/js/dist/commands/install-skills.js.map +1 -0
  75. package/js/dist/commands/periodic.d.ts +6 -0
  76. package/js/dist/commands/periodic.js +40 -0
  77. package/js/dist/commands/periodic.js.map +1 -0
  78. package/js/dist/index.d.ts +8 -0
  79. package/js/dist/index.js +9 -0
  80. package/js/dist/index.js.map +1 -0
  81. package/js/dist/policy.d.ts +45 -0
  82. package/js/dist/policy.js +145 -0
  83. package/js/dist/policy.js.map +1 -0
  84. package/js/dist/project.d.ts +26 -0
  85. package/js/dist/project.js +64 -0
  86. package/js/dist/project.js.map +1 -0
  87. package/js/dist/state.d.ts +21 -0
  88. package/js/dist/state.js +36 -0
  89. package/js/dist/state.js.map +1 -0
  90. package/js/dist/support/ci-jobs.d.ts +13 -0
  91. package/js/dist/support/ci-jobs.js +42 -0
  92. package/js/dist/support/ci-jobs.js.map +1 -0
  93. package/js/dist/support/npmrc.d.ts +10 -0
  94. package/js/dist/support/npmrc.js +36 -0
  95. package/js/dist/support/npmrc.js.map +1 -0
  96. package/js/dist/support/versions.d.ts +10 -0
  97. package/js/dist/support/versions.js +34 -0
  98. package/js/dist/support/versions.js.map +1 -0
  99. package/js/skills/creating-a-release/SKILL.md +45 -0
  100. package/js/skills/updating-dependencies/SKILL.md +104 -0
  101. package/package.json +67 -0
  102. package/policy/policy.json +131 -0
  103. package/policy/policy.schema.json +284 -0
  104. package/policy/templates/editorconfig +18 -0
  105. package/policy/templates/trivy.yaml +19 -0
@@ -0,0 +1,284 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/limenet/laravel-baseline/policy/policy.schema.json",
4
+ "title": "limenet baseline policy",
5
+ "description": "Policy values shared verbatim by the PHP (limenet/laravel-baseline) and JS (@limenet-ch/baseline) runners. Anything that is a value rather than logic belongs here, so a floor is bumped in one place.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "node",
10
+ "npm",
11
+ "biome",
12
+ "editorconfig",
13
+ "agentFiles",
14
+ "claude",
15
+ "ci",
16
+ "ciLint",
17
+ "trivy",
18
+ "baseline",
19
+ "npmScripts",
20
+ "periodic"
21
+ ],
22
+ "$defs": {
23
+ "ciJobTemplates": {
24
+ "description": "A single shared template the job must extend, or a list of templates any one of which is accepted.",
25
+ "oneOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" }, "minItems": 1 }]
26
+ }
27
+ },
28
+ "properties": {
29
+ "$schema": { "type": "string" },
30
+ "node": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["minMajor"],
34
+ "properties": {
35
+ "minMajor": {
36
+ "type": "string",
37
+ "description": "Lowest permitted Node major. Declarations below it are bumped to it; newer lines are left alone.",
38
+ "pattern": "^\\d+$"
39
+ }
40
+ }
41
+ },
42
+ "npm": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "required": ["minMajor", "constraint", "minReleaseAgeDays", "engineStrict"],
46
+ "properties": {
47
+ "minMajor": { "type": "string", "pattern": "^\\d+$" },
48
+ "constraint": {
49
+ "type": "string",
50
+ "description": "The engines.npm constraint written when none is present or the present one is too low."
51
+ },
52
+ "minReleaseAgeDays": {
53
+ "type": "integer",
54
+ "minimum": 0,
55
+ "description": "Install-time cooldown in days: npm skips versions younger than this."
56
+ },
57
+ "engineStrict": {
58
+ "type": "boolean",
59
+ "description": "Whether .npmrc must set engine-strict, making the engines requirement enforced rather than advisory."
60
+ }
61
+ }
62
+ },
63
+ "biome": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": ["configFile", "schema"],
67
+ "description": "Biome's config file and the $schema it must point at. The local path under node_modules always matches the installed Biome, so the file does not need editing on every Biome update — a versioned remote URL does.",
68
+ "properties": {
69
+ "configFile": {
70
+ "type": "string",
71
+ "description": "Project-relative path of Biome's config file. Checked only when it exists; the baseline does not require a project to use Biome."
72
+ },
73
+ "schema": {
74
+ "type": "string",
75
+ "description": "The value $schema must hold, resolved from node_modules rather than pinned to a released version."
76
+ }
77
+ }
78
+ },
79
+ "editorconfig": {
80
+ "type": "object",
81
+ "additionalProperties": false,
82
+ "required": ["template", "requiredProperties"],
83
+ "properties": {
84
+ "template": {
85
+ "type": "string",
86
+ "description": "Filename under policy/templates/ holding the canonical .editorconfig body."
87
+ },
88
+ "requiredProperties": {
89
+ "type": "array",
90
+ "items": { "type": "string" },
91
+ "description": "Substrings that must appear in an existing .editorconfig for it to count as complete."
92
+ }
93
+ }
94
+ },
95
+ "agentFiles": {
96
+ "type": "object",
97
+ "additionalProperties": false,
98
+ "required": ["forbidden"],
99
+ "properties": {
100
+ "forbidden": {
101
+ "type": "object",
102
+ "description": "Project-relative path => reason it must not exist. Rendered as \"Remove {path} — {reason}\".",
103
+ "additionalProperties": { "type": "string" }
104
+ }
105
+ }
106
+ },
107
+ "claude": {
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": ["allow", "deny", "ask", "ciLintHookCommand"],
111
+ "properties": {
112
+ "allow": {
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "required": ["shared", "php"],
116
+ "properties": {
117
+ "shared": {
118
+ "type": "array",
119
+ "items": { "type": "string" },
120
+ "description": "permissions.allow entries that apply to every project type."
121
+ },
122
+ "php": {
123
+ "type": "array",
124
+ "items": { "type": "string" },
125
+ "description": "permissions.allow entries that only make sense in a Laravel/DDEV project."
126
+ }
127
+ }
128
+ },
129
+ "deny": {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": ["shared"],
133
+ "properties": {
134
+ "shared": {
135
+ "type": "array",
136
+ "items": { "type": "string" },
137
+ "description": "permissions.deny entries that apply to every project type. Dynamic per-environment entries are derived at runtime, not listed here."
138
+ }
139
+ }
140
+ },
141
+ "ask": {
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "required": ["php"],
145
+ "properties": {
146
+ "php": {
147
+ "type": "array",
148
+ "items": { "type": "string" },
149
+ "description": "permissions.ask entries for the artisan commands that destroy database contents. Laravel/DDEV only. These prompt rather than deny, so the developer keeps an approval path."
150
+ }
151
+ }
152
+ },
153
+ "ciLintHookCommand": {
154
+ "type": "object",
155
+ "additionalProperties": false,
156
+ "required": ["php", "js"],
157
+ "properties": {
158
+ "php": { "type": "string" },
159
+ "js": { "type": "string" }
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "ci": {
165
+ "type": "object",
166
+ "additionalProperties": false,
167
+ "required": ["nodeVersionVariable", "requiredJobs"],
168
+ "properties": {
169
+ "nodeVersionVariable": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": ["name", "value"],
173
+ "description": "The CI variable that pins the Node version. Setting it lets the shared template resolve the version, which is what keeps CI and local in step now that DDEV's nodejs_version: auto is not in play.",
174
+ "properties": {
175
+ "name": { "type": "string" },
176
+ "value": { "type": "string" }
177
+ }
178
+ },
179
+ "requiredJobs": {
180
+ "type": "object",
181
+ "additionalProperties": false,
182
+ "required": ["php", "js"],
183
+ "description": "GitLab CI job name => the shared template it must extend, or a list of templates any one of which is accepted. The js set omits the php job.",
184
+ "properties": {
185
+ "php": {
186
+ "type": "object",
187
+ "additionalProperties": { "$ref": "#/$defs/ciJobTemplates" }
188
+ },
189
+ "js": {
190
+ "type": "object",
191
+ "additionalProperties": { "$ref": "#/$defs/ciJobTemplates" }
192
+ }
193
+ }
194
+ }
195
+ }
196
+ },
197
+ "ciLint": {
198
+ "type": "object",
199
+ "additionalProperties": false,
200
+ "required": ["required", "baselineCommand"],
201
+ "properties": {
202
+ "required": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "required": ["php", "js"],
206
+ "description": "Substrings the project's ci-lint script must contain — a composer script for php, an npm script for js.",
207
+ "properties": {
208
+ "php": { "type": "array", "items": { "type": "string" } },
209
+ "js": { "type": "array", "items": { "type": "string" } }
210
+ }
211
+ },
212
+ "baselineCommand": {
213
+ "type": "object",
214
+ "additionalProperties": false,
215
+ "required": ["js"],
216
+ "description": "How the baseline runner invokes itself from a project. The php runner hooks composer's post-update-cmd instead, which npm has no equivalent of.",
217
+ "properties": {
218
+ "js": { "type": "string" }
219
+ }
220
+ }
221
+ }
222
+ },
223
+ "trivy": {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": ["template", "configFile", "ignoreFile", "gitignoreEntry", "forbiddenKeys", "ciJob"],
227
+ "description": "Trivy's canonical setup. The template under policy/templates/ is both what a fix writes into an empty project and the requirement set itself: every scalar leaf must be equal in the project's file, every list leaf must be contained in it, and unlisted keys are the project's own business.",
228
+ "properties": {
229
+ "template": {
230
+ "type": "string",
231
+ "description": "Filename under policy/templates/ holding the canonical trivy.yaml body."
232
+ },
233
+ "configFile": {
234
+ "type": "string",
235
+ "description": "Project-relative path of Trivy's config file."
236
+ },
237
+ "ignoreFile": {
238
+ "type": "string",
239
+ "description": "Project-relative path of the ignore file, which must exist even when empty."
240
+ },
241
+ "gitignoreEntry": {
242
+ "type": "string",
243
+ "description": "The cache directory, as it must appear in .gitignore."
244
+ },
245
+ "forbiddenKeys": {
246
+ "type": "array",
247
+ "items": { "type": "string" },
248
+ "description": "Top-level keys that must NOT be set, leaving Trivy's own default behaviour in place."
249
+ },
250
+ "ciJob": { "type": "object", "additionalProperties": { "$ref": "#/$defs/ciJobTemplates" } }
251
+ }
252
+ },
253
+ "baseline": {
254
+ "type": "object",
255
+ "additionalProperties": false,
256
+ "required": ["composerPackage", "npmPackage"],
257
+ "description": "The two runners' own package names, so each can recognise the other's presence in a project.",
258
+ "properties": {
259
+ "composerPackage": { "type": "string" },
260
+ "npmPackage": { "type": "string" }
261
+ }
262
+ },
263
+ "npmScripts": {
264
+ "type": "object",
265
+ "additionalProperties": false,
266
+ "required": ["required"],
267
+ "properties": {
268
+ "required": {
269
+ "type": "array",
270
+ "items": { "type": "string" },
271
+ "description": "npm scripts every project must define."
272
+ }
273
+ }
274
+ },
275
+ "periodic": {
276
+ "type": "object",
277
+ "additionalProperties": false,
278
+ "required": ["defaultIntervalDays"],
279
+ "properties": {
280
+ "defaultIntervalDays": { "type": "integer", "minimum": 1 }
281
+ }
282
+ }
283
+ }
284
+ }
@@ -0,0 +1,18 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ indent_style = space
7
+ indent_size = 4
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
13
+
14
+ [*.{yml,yaml}]
15
+ indent_size = 2
16
+
17
+ [*.{js,css,json}]
18
+ indent_size = 2
@@ -0,0 +1,19 @@
1
+ ignorefile: .trivyignore.yaml
2
+ cache:
3
+ dir: .trivycache
4
+ scan:
5
+ skip-files:
6
+ - .env
7
+ - vendor/**/Dockerfile
8
+ skip-dirs:
9
+ - .ddev/
10
+ - storage/logs/
11
+ scanners:
12
+ - misconfig
13
+ - secret
14
+ - vuln
15
+ disable-telemetry: true
16
+ pkg:
17
+ include-dev-deps: true
18
+ disable-vex-notice: true
19
+ dependency-tree: true