@outfitter/tooling 0.3.3 → 0.3.5
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/.markdownlint-cli2.jsonc +55 -55
- package/README.md +33 -24
- package/dist/bun-version-compat.d.ts +2 -0
- package/dist/bun-version-compat.js +10 -0
- package/dist/cli/check-boundary-invocations.d.ts +34 -0
- package/dist/cli/check-boundary-invocations.js +14 -0
- package/dist/cli/check-bunup-registry.d.ts +36 -0
- package/dist/cli/check-bunup-registry.js +12 -0
- package/dist/cli/check-changeset.d.ts +82 -0
- package/dist/cli/check-changeset.js +24 -0
- package/dist/cli/check-clean-tree.d.ts +36 -0
- package/dist/cli/check-clean-tree.js +14 -0
- package/dist/cli/check-exports.d.ts +3 -0
- package/dist/cli/check-exports.js +17 -0
- package/dist/cli/check-home-paths.d.ts +31 -0
- package/dist/cli/check-home-paths.js +12 -0
- package/dist/cli/check-markdown-links.d.ts +42 -0
- package/dist/cli/check-markdown-links.js +13 -0
- package/dist/cli/check-readme-imports.d.ts +61 -0
- package/dist/{shared/chunk-7tdgbqb0.js → cli/check-readme-imports.js} +7 -6
- package/dist/cli/check-tsdoc.d.ts +5 -0
- package/dist/cli/check-tsdoc.js +42 -0
- package/dist/cli/check.d.ts +19 -0
- package/dist/cli/check.js +10 -0
- package/dist/cli/fix.d.ts +19 -0
- package/dist/cli/fix.js +10 -0
- package/dist/cli/index.js +61 -1218
- package/dist/cli/init.d.ts +31 -0
- package/dist/cli/init.js +12 -0
- package/dist/cli/internal/exports-analysis.d.ts +2 -0
- package/dist/cli/internal/exports-analysis.js +10 -0
- package/dist/cli/internal/exports-fs.d.ts +17 -0
- package/dist/cli/internal/exports-fs.js +9 -0
- package/dist/cli/internal/pre-push-checks.d.ts +2 -0
- package/dist/cli/internal/pre-push-checks.js +37 -0
- package/dist/cli/internal/tsdoc-analysis.d.ts +3 -0
- package/dist/cli/internal/tsdoc-analysis.js +26 -0
- package/dist/cli/internal/tsdoc-formatting.d.ts +3 -0
- package/dist/cli/internal/tsdoc-formatting.js +10 -0
- package/dist/cli/internal/tsdoc-types.d.ts +2 -0
- package/dist/cli/internal/tsdoc-types.js +16 -0
- package/dist/cli/pre-push.d.ts +7 -0
- package/dist/cli/pre-push.js +29 -0
- package/dist/cli/upgrade-bun.d.ts +8 -0
- package/dist/cli/upgrade-bun.js +9 -0
- package/dist/index.d.ts +9 -186
- package/dist/index.js +4 -42
- package/dist/registry/build.d.ts +4 -0
- package/dist/registry/build.js +279 -0
- package/dist/registry/index.d.ts +3 -0
- package/dist/registry/index.js +1 -0
- package/dist/registry/schema.d.ts +2 -0
- package/dist/registry/schema.js +28 -0
- package/dist/shared/@outfitter/tooling-0zjz8eg9.js +106 -0
- package/dist/shared/@outfitter/tooling-1hez6j9d.js +21 -0
- package/dist/shared/@outfitter/tooling-2vv5y3s4.js +145 -0
- package/dist/shared/{chunk-cmde0fwx.js → @outfitter/tooling-5xxctk9b.js} +12 -138
- package/dist/shared/@outfitter/tooling-5ynz680q.js +59 -0
- package/dist/shared/@outfitter/tooling-7437rmy6.js +39 -0
- package/dist/shared/@outfitter/tooling-8qcwr06t.d.ts +74 -0
- package/dist/shared/@outfitter/tooling-9ram55dd.js +69 -0
- package/dist/shared/@outfitter/tooling-9vs606gq.d.ts +3 -0
- package/dist/shared/@outfitter/tooling-a4bfx4be.js +21 -0
- package/dist/shared/@outfitter/tooling-a59br34g.js +32 -0
- package/dist/shared/@outfitter/tooling-a6q3zh7t.js +86 -0
- package/dist/shared/@outfitter/tooling-amrbp7cm.js +102 -0
- package/dist/shared/@outfitter/tooling-ayps7c4x.js +58 -0
- package/dist/shared/@outfitter/tooling-c8q6mj8z.js +228 -0
- package/dist/shared/@outfitter/tooling-cb0b8wsx.d.ts +57 -0
- package/dist/shared/@outfitter/tooling-ctmgnap5.js +19 -0
- package/dist/shared/@outfitter/tooling-f8q38e9z.d.ts +16 -0
- package/dist/shared/@outfitter/tooling-gcdvsqqp.js +73 -0
- package/dist/shared/@outfitter/tooling-h5dnevjw.js +139 -0
- package/dist/shared/@outfitter/tooling-j8d1h2zd.d.ts +10 -0
- package/dist/shared/@outfitter/tooling-ja1zg5yc.js +214 -0
- package/dist/shared/@outfitter/tooling-jnrs9rqd.js +4 -0
- package/dist/shared/@outfitter/tooling-mkynjra9.js +23 -0
- package/dist/shared/@outfitter/tooling-mq2xvz96.js +285 -0
- package/dist/shared/@outfitter/tooling-pq47jv6t.js +213 -0
- package/dist/shared/@outfitter/tooling-sjm8nebx.d.ts +109 -0
- package/dist/shared/@outfitter/tooling-stgnc2zx.d.ts +85 -0
- package/dist/shared/@outfitter/tooling-tj9p41vj.d.ts +55 -0
- package/dist/shared/@outfitter/tooling-vjmhvpjq.d.ts +29 -0
- package/dist/shared/@outfitter/tooling-wwm97f47.js +81 -0
- package/dist/shared/@outfitter/tooling-y43b117h.d.ts +13 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +8 -0
- package/lefthook.yml +5 -1
- package/package.json +140 -131
- package/registry/registry.json +19 -12
- package/tsconfig.preset.bun.json +5 -5
- package/tsconfig.preset.json +33 -33
- package/biome.json +0 -81
- package/dist/shared/chunk-3s189drz.js +0 -4
package/.markdownlint-cli2.jsonc
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
// Outfitter markdownlint preset
|
|
3
|
+
// https://github.com/DavidAnson/markdownlint
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
"config": {
|
|
6
|
+
// Headings
|
|
7
|
+
"MD003": { "style": "atx" }, // ATX-style headings (# Heading)
|
|
8
|
+
"MD022": { "lines_above": 1, "lines_below": 1 }, // Blank lines around headings
|
|
9
|
+
"MD024": { "siblings_only": true }, // Allow duplicate headings in different sections
|
|
10
|
+
"MD041": false, // First line doesn't need to be h1 (frontmatter, etc.)
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// Line length - disabled for prose flexibility
|
|
13
|
+
"MD013": false,
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
// Lists
|
|
16
|
+
"MD004": { "style": "dash" }, // Unordered list style: dash (-)
|
|
17
|
+
"MD007": { "indent": 2 }, // List indentation: 2 spaces
|
|
18
|
+
"MD032": true, // Blank lines around lists
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
// Code blocks
|
|
21
|
+
"MD040": true, // Fenced code blocks should have a language
|
|
22
|
+
"MD046": { "style": "fenced" }, // Code block style: fenced (```)
|
|
23
|
+
"MD048": { "style": "backtick" }, // Code fence style: backticks
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
// Links
|
|
26
|
+
"MD034": true, // No bare URLs (use <url> or [text](url))
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
// Whitespace
|
|
29
|
+
"MD009": { "br_spaces": 2 }, // Allow 2 trailing spaces for <br>
|
|
30
|
+
"MD010": { "spaces_per_tab": 2 }, // Tabs to spaces
|
|
31
|
+
"MD012": { "maximum": 1 }, // Max 1 consecutive blank line
|
|
32
|
+
"MD047": true, // Files should end with newline
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
// HTML - allow for GitHub-specific elements
|
|
35
|
+
"MD033": {
|
|
36
|
+
"allowed_elements": [
|
|
37
|
+
"details",
|
|
38
|
+
"summary",
|
|
39
|
+
"kbd",
|
|
40
|
+
"br",
|
|
41
|
+
"sup",
|
|
42
|
+
"sub",
|
|
43
|
+
"img",
|
|
44
|
+
"picture",
|
|
45
|
+
"source",
|
|
46
|
+
"a",
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
// Emphasis
|
|
51
|
+
"MD049": { "style": "asterisk" }, // Emphasis style: *italic*
|
|
52
|
+
"MD050": { "style": "asterisk" }, // Strong style: **bold**
|
|
53
|
+
},
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
// Ignore patterns
|
|
56
|
+
"ignores": [
|
|
57
|
+
"node_modules/**",
|
|
58
|
+
"**/node_modules/**",
|
|
59
|
+
"dist/**",
|
|
60
|
+
"**/dist/**",
|
|
61
|
+
".turbo/**",
|
|
62
|
+
"**/.turbo/**",
|
|
63
|
+
"CHANGELOG.md",
|
|
64
|
+
"**/CHANGELOG.md",
|
|
65
|
+
],
|
|
66
66
|
}
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Dev tooling configuration presets and CLI for Outfitter projects.
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **Configuration Presets**:
|
|
7
|
+
- **Configuration Presets**: oxlint, TypeScript, Lefthook, and markdownlint configs
|
|
8
8
|
- **CLI Commands**: Initialize configs, upgrade Bun, TDD-aware pre-push hooks
|
|
9
9
|
- **Registry System**: Composable config blocks for scaffolding
|
|
10
10
|
|
|
@@ -15,7 +15,8 @@ bun add -D @outfitter/tooling
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Peer dependencies (optional):
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
- `ultracite` — oxlint/oxfmt wrapper for formatting/linting
|
|
19
20
|
- `lefthook` — Git hooks
|
|
20
21
|
- `markdownlint-cli2` — Markdown linting
|
|
21
22
|
|
|
@@ -23,7 +24,7 @@ Peer dependencies (optional):
|
|
|
23
24
|
|
|
24
25
|
### `tooling init`
|
|
25
26
|
|
|
26
|
-
Initialize tooling configuration in the current project. Copies preset configs for
|
|
27
|
+
Initialize tooling configuration in the current project. Copies preset configs for oxlint, TypeScript, Lefthook, and markdownlint.
|
|
27
28
|
|
|
28
29
|
```bash
|
|
29
30
|
bunx @outfitter/tooling init
|
|
@@ -50,6 +51,7 @@ bunx @outfitter/tooling fix src/
|
|
|
50
51
|
### `tooling upgrade-bun [version]`
|
|
51
52
|
|
|
52
53
|
Upgrade Bun version across the project. Updates:
|
|
54
|
+
|
|
53
55
|
- `.bun-version`
|
|
54
56
|
- `engines.bun` in all package.json files
|
|
55
57
|
- `@types/bun` dependency versions (leaves "latest" alone)
|
|
@@ -71,13 +73,16 @@ bunx @outfitter/tooling upgrade-bun 1.4.0 --no-install
|
|
|
71
73
|
TDD-aware pre-push strict verification hook. Detects RED phase branches and skips verification by design.
|
|
72
74
|
|
|
73
75
|
RED phase branches follow these patterns:
|
|
76
|
+
|
|
74
77
|
- `*-tests` (e.g., `feature/auth-tests`)
|
|
75
78
|
- `*/tests` (e.g., `feature/auth/tests`)
|
|
76
79
|
- `*_tests` (e.g., `feature/auth_tests`)
|
|
77
80
|
|
|
78
81
|
Verification order:
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
|
|
83
|
+
1. Run `verify:push` if present.
|
|
84
|
+
2. Otherwise run `verify:ci` if present.
|
|
85
|
+
3. Otherwise run strict fallback: `typecheck`, `check|lint`, `build`, `test`.
|
|
81
86
|
|
|
82
87
|
```bash
|
|
83
88
|
# Normal usage (in lefthook.yml)
|
|
@@ -108,7 +113,15 @@ bunx @outfitter/tooling check-bunup-registry
|
|
|
108
113
|
|
|
109
114
|
### `tooling check-changeset`
|
|
110
115
|
|
|
111
|
-
Validate that
|
|
116
|
+
Validate that release-relevant package changes in the current PR diff include a
|
|
117
|
+
changeset.
|
|
118
|
+
|
|
119
|
+
- In GitHub `pull_request` CI, the command diffs against the PR's current
|
|
120
|
+
`base.sha...head.sha` from the event payload. This keeps stacked PRs valid
|
|
121
|
+
after lower branches merge and Graphite retargets descendants.
|
|
122
|
+
- Outside `pull_request` CI, it falls back to `origin/main...HEAD`.
|
|
123
|
+
- Test-only package files are ignored: `src/__tests__/`, `src/__snapshots__/`,
|
|
124
|
+
`*.test.*`, and `*.spec.*`.
|
|
112
125
|
|
|
113
126
|
```bash
|
|
114
127
|
bunx @outfitter/tooling check-changeset
|
|
@@ -169,16 +182,6 @@ bunx @outfitter/tooling check-readme-imports --json
|
|
|
169
182
|
|
|
170
183
|
## Configuration Presets
|
|
171
184
|
|
|
172
|
-
### Biome
|
|
173
|
-
|
|
174
|
-
Extends our Biome config in your `biome.json`:
|
|
175
|
-
|
|
176
|
-
```json
|
|
177
|
-
{
|
|
178
|
-
"extends": ["@outfitter/tooling/biome.json"]
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
185
|
### TypeScript
|
|
183
186
|
|
|
184
187
|
Extends our TypeScript config in your `tsconfig.json`:
|
|
@@ -207,6 +210,7 @@ extends:
|
|
|
207
210
|
```
|
|
208
211
|
|
|
209
212
|
Default hooks:
|
|
213
|
+
|
|
210
214
|
- **pre-commit**: Runs ultracite on staged files, typechecks
|
|
211
215
|
- **pre-push**: Runs TDD-aware strict verification via `tooling pre-push`
|
|
212
216
|
|
|
@@ -224,8 +228,9 @@ cp node_modules/@outfitter/tooling/.markdownlint-cli2.jsonc .
|
|
|
224
228
|
The tooling package includes a registry of composable config blocks for the `outfitter` CLI scaffolding system.
|
|
225
229
|
|
|
226
230
|
Available blocks:
|
|
231
|
+
|
|
227
232
|
- `claude` — Claude Code settings and hooks
|
|
228
|
-
- `
|
|
233
|
+
- `linter` — oxlint/Ultracite configuration
|
|
229
234
|
- `lefthook` — Git hooks configuration
|
|
230
235
|
- `markdownlint` — Markdown linting configuration
|
|
231
236
|
- `bootstrap` — Project bootstrap script
|
|
@@ -245,13 +250,17 @@ bun run apps/outfitter/src/cli.ts repo check boundary-invocations --cwd .
|
|
|
245
250
|
|
|
246
251
|
## Exports
|
|
247
252
|
|
|
248
|
-
| Export
|
|
249
|
-
|
|
250
|
-
| `./
|
|
251
|
-
| `./tsconfig.preset.json`
|
|
252
|
-
| `./tsconfig.preset.bun.json` |
|
|
253
|
-
| `./
|
|
254
|
-
|
|
|
253
|
+
| Export | Description |
|
|
254
|
+
| ---------------------------- | -------------------------------------- |
|
|
255
|
+
| `./registry` | Tooling block registry API |
|
|
256
|
+
| `./tsconfig` | Alias for `./tsconfig.preset.json` |
|
|
257
|
+
| `./tsconfig-bun` | Alias for `./tsconfig.preset.bun.json` |
|
|
258
|
+
| `./tsconfig.preset.json` | TypeScript preset (general) |
|
|
259
|
+
| `./tsconfig.preset.bun.json` | TypeScript preset (Bun) |
|
|
260
|
+
| `./lefthook` | Alias for `./lefthook.yml` |
|
|
261
|
+
| `./lefthook.yml` | Lefthook hooks configuration |
|
|
262
|
+
| `./.markdownlint-cli2` | Alias for `./.markdownlint-cli2.jsonc` |
|
|
263
|
+
| `./.markdownlint-cli2.jsonc` | markdownlint configuration |
|
|
255
264
|
|
|
256
265
|
## Related
|
|
257
266
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface ScriptLocation {
|
|
2
|
+
readonly file: string;
|
|
3
|
+
readonly scriptName: string;
|
|
4
|
+
readonly command: string;
|
|
5
|
+
}
|
|
6
|
+
interface BoundaryViolation extends ScriptLocation {
|
|
7
|
+
readonly rule: "root-runs-package-src" | "cd-package-then-runs-src";
|
|
8
|
+
}
|
|
9
|
+
interface ReadScriptEntriesOptions {
|
|
10
|
+
readonly appManifestRelativePaths?: readonly string[];
|
|
11
|
+
readonly readPackageJson?: (filePath: string) => Promise<{
|
|
12
|
+
scripts?: Record<string, string>;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Detect whether a single script command violates boundary invocation rules.
|
|
17
|
+
*/
|
|
18
|
+
declare function detectBoundaryViolation(location: ScriptLocation): BoundaryViolation | null;
|
|
19
|
+
/**
|
|
20
|
+
* Find all boundary violations across package/app script maps.
|
|
21
|
+
*/
|
|
22
|
+
declare function findBoundaryViolations(entries: readonly {
|
|
23
|
+
file: string;
|
|
24
|
+
scripts: Readonly<Record<string, string>>;
|
|
25
|
+
}[]): BoundaryViolation[];
|
|
26
|
+
declare function readScriptEntries(cwd: string, options?: ReadScriptEntriesOptions): Promise<{
|
|
27
|
+
file: string;
|
|
28
|
+
scripts: Record<string, string>;
|
|
29
|
+
}[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Run boundary invocation checks against root/apps package scripts.
|
|
32
|
+
*/
|
|
33
|
+
declare function runCheckBoundaryInvocations(): Promise<void>;
|
|
34
|
+
export { runCheckBoundaryInvocations, readScriptEntries, findBoundaryViolations, detectBoundaryViolation, ScriptLocation, BoundaryViolation };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
detectBoundaryViolation,
|
|
4
|
+
findBoundaryViolations,
|
|
5
|
+
readScriptEntries,
|
|
6
|
+
runCheckBoundaryInvocations
|
|
7
|
+
} from "../shared/@outfitter/tooling-amrbp7cm.js";
|
|
8
|
+
import"../shared/@outfitter/tooling-jnrs9rqd.js";
|
|
9
|
+
export {
|
|
10
|
+
runCheckBoundaryInvocations,
|
|
11
|
+
readScriptEntries,
|
|
12
|
+
findBoundaryViolations,
|
|
13
|
+
detectBoundaryViolation
|
|
14
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Result of checking bunup workspace registration */
|
|
2
|
+
interface RegistryCheckResult {
|
|
3
|
+
readonly ok: boolean;
|
|
4
|
+
readonly missing: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Extract the package name from a build script containing `bunup --filter`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* extractBunupFilterName("bunup --filter @outfitter/logging")
|
|
11
|
+
* // => "@outfitter/logging"
|
|
12
|
+
*
|
|
13
|
+
* extractBunupFilterName("cd ../.. && bunup --filter @outfitter/types")
|
|
14
|
+
* // => "@outfitter/types"
|
|
15
|
+
*
|
|
16
|
+
* extractBunupFilterName("tsc --noEmit")
|
|
17
|
+
* // => null
|
|
18
|
+
*/
|
|
19
|
+
declare function extractBunupFilterName(script: string): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Find packages that have `bunup --filter` build scripts but are not
|
|
22
|
+
* registered in the bunup workspace config.
|
|
23
|
+
*
|
|
24
|
+
* @param packagesWithFilter - Package names that have `bunup --filter` in their build script
|
|
25
|
+
* @param registeredNames - Package names registered in bunup.config.ts
|
|
26
|
+
* @returns Result with sorted list of missing packages
|
|
27
|
+
*/
|
|
28
|
+
declare function findUnregisteredPackages(packagesWithFilter: string[], registeredNames: string[]): RegistryCheckResult;
|
|
29
|
+
/**
|
|
30
|
+
* Run bunup registry check across all workspace packages.
|
|
31
|
+
*
|
|
32
|
+
* Scans packages/*/package.json for build scripts containing `bunup --filter`,
|
|
33
|
+
* then verifies each is registered in bunup.config.ts.
|
|
34
|
+
*/
|
|
35
|
+
declare function runCheckBunupRegistry(): Promise<void>;
|
|
36
|
+
export { runCheckBunupRegistry, findUnregisteredPackages, extractBunupFilterName, RegistryCheckResult };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
extractBunupFilterName,
|
|
4
|
+
findUnregisteredPackages,
|
|
5
|
+
runCheckBunupRegistry
|
|
6
|
+
} from "../shared/@outfitter/tooling-wwm97f47.js";
|
|
7
|
+
import"../shared/@outfitter/tooling-jnrs9rqd.js";
|
|
8
|
+
export {
|
|
9
|
+
runCheckBunupRegistry,
|
|
10
|
+
findUnregisteredPackages,
|
|
11
|
+
extractBunupFilterName
|
|
12
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** Result of checking whether changesets are required */
|
|
2
|
+
interface ChangesetCheckResult {
|
|
3
|
+
readonly ok: boolean;
|
|
4
|
+
readonly missingFor: string[];
|
|
5
|
+
}
|
|
6
|
+
interface ChangesetIgnoredReference {
|
|
7
|
+
readonly file: string;
|
|
8
|
+
readonly packages: string[];
|
|
9
|
+
}
|
|
10
|
+
interface GitDiffRange {
|
|
11
|
+
readonly base: string;
|
|
12
|
+
readonly head: string;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly source: "pull_request" | "default";
|
|
15
|
+
}
|
|
16
|
+
declare function getReleasableChangedPackages(changedPackages: readonly string[], ignoredPackages: readonly string[]): string[];
|
|
17
|
+
/**
|
|
18
|
+
* Extract unique package names from changed file paths.
|
|
19
|
+
*
|
|
20
|
+
* Only considers release-relevant files matching the pattern
|
|
21
|
+
* "packages/NAME/src/...". Test-only sources are ignored so stacked follow-up
|
|
22
|
+
* PRs do not need changesets for coverage-only edits.
|
|
23
|
+
*
|
|
24
|
+
* @param files - List of changed file paths relative to repo root
|
|
25
|
+
* @returns Sorted array of unique package names
|
|
26
|
+
*/
|
|
27
|
+
declare function getChangedPackagePaths(files: string[]): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Extract changeset filenames from changed file paths.
|
|
30
|
+
*
|
|
31
|
+
* Only considers files matching `.changeset/*.md`, excluding README.md.
|
|
32
|
+
* This checks the git diff rather than disk, ensuring only changesets added
|
|
33
|
+
* in the current PR are counted.
|
|
34
|
+
*
|
|
35
|
+
* @param files - List of changed file paths relative to repo root
|
|
36
|
+
* @returns Array of changeset filenames (e.g. `["happy-turtle.md"]`)
|
|
37
|
+
*/
|
|
38
|
+
declare function getChangedChangesetFiles(files: string[]): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Determine whether releasable packages are fully covered by the current PR changesets.
|
|
41
|
+
*
|
|
42
|
+
* Returns `ok: true` when either no releasable packages changed or every
|
|
43
|
+
* releasable package is mentioned in at least one changed changeset file.
|
|
44
|
+
* Returns `ok: false` with the list of uncovered releasable packages when
|
|
45
|
+
* changeset coverage is incomplete.
|
|
46
|
+
*
|
|
47
|
+
* @param releasablePackages - Changed packages that are not ignored by changeset config
|
|
48
|
+
* @param changesetFiles - Changeset filenames found in `.changeset/`
|
|
49
|
+
* @param coveredPackages - Workspace package names referenced by the changed changesets
|
|
50
|
+
*/
|
|
51
|
+
declare function checkChangesetRequired(releasablePackages: string[], changesetFiles: string[], coveredPackages?: string[]): ChangesetCheckResult;
|
|
52
|
+
declare function parseIgnoredPackagesFromChangesetConfig(jsonContent: string): string[];
|
|
53
|
+
declare function parseChangesetFrontmatterPackageNames(markdownContent: string): string[];
|
|
54
|
+
declare function resolveGitDiffRange(input: {
|
|
55
|
+
readonly eventName?: string | undefined;
|
|
56
|
+
readonly eventPath?: string | undefined;
|
|
57
|
+
readonly readEventFile?: ((path: string) => string) | undefined;
|
|
58
|
+
}): GitDiffRange;
|
|
59
|
+
declare function findIgnoredPackageReferences(input: {
|
|
60
|
+
readonly changesetFiles: readonly string[];
|
|
61
|
+
readonly ignoredPackages: readonly string[];
|
|
62
|
+
readonly readChangesetFile: (filename: string) => string;
|
|
63
|
+
}): ChangesetIgnoredReference[];
|
|
64
|
+
interface CheckChangesetOptions {
|
|
65
|
+
readonly skip?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Run check-changeset to verify release-relevant PR deltas include changeset files.
|
|
69
|
+
*
|
|
70
|
+
* Resolves the current diff range from pull request metadata in CI and falls
|
|
71
|
+
* back to `origin/main...HEAD` elsewhere. Release-relevant package changes in
|
|
72
|
+
* that diff must be covered by a current changeset.
|
|
73
|
+
*
|
|
74
|
+
* Skips silently when:
|
|
75
|
+
* - `NO_CHANGESET=1` env var is set
|
|
76
|
+
* - `--skip` flag is passed
|
|
77
|
+
* - `GITHUB_EVENT_NAME=push` (post-merge on main)
|
|
78
|
+
* - No packages have source changes
|
|
79
|
+
* - Git diff fails (local dev without origin)
|
|
80
|
+
*/
|
|
81
|
+
declare function runCheckChangeset(options?: CheckChangesetOptions): Promise<void>;
|
|
82
|
+
export { runCheckChangeset, resolveGitDiffRange, parseIgnoredPackagesFromChangesetConfig, parseChangesetFrontmatterPackageNames, getReleasableChangedPackages, getChangedPackagePaths, getChangedChangesetFiles, findIgnoredPackageReferences, checkChangesetRequired, GitDiffRange, CheckChangesetOptions, ChangesetIgnoredReference, ChangesetCheckResult };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
checkChangesetRequired,
|
|
4
|
+
findIgnoredPackageReferences,
|
|
5
|
+
getChangedChangesetFiles,
|
|
6
|
+
getChangedPackagePaths,
|
|
7
|
+
getReleasableChangedPackages,
|
|
8
|
+
parseChangesetFrontmatterPackageNames,
|
|
9
|
+
parseIgnoredPackagesFromChangesetConfig,
|
|
10
|
+
resolveGitDiffRange,
|
|
11
|
+
runCheckChangeset
|
|
12
|
+
} from "../shared/@outfitter/tooling-mq2xvz96.js";
|
|
13
|
+
import"../shared/@outfitter/tooling-jnrs9rqd.js";
|
|
14
|
+
export {
|
|
15
|
+
runCheckChangeset,
|
|
16
|
+
resolveGitDiffRange,
|
|
17
|
+
parseIgnoredPackagesFromChangesetConfig,
|
|
18
|
+
parseChangesetFrontmatterPackageNames,
|
|
19
|
+
getReleasableChangedPackages,
|
|
20
|
+
getChangedPackagePaths,
|
|
21
|
+
getChangedChangesetFiles,
|
|
22
|
+
findIgnoredPackageReferences,
|
|
23
|
+
checkChangesetRequired
|
|
24
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check-clean-tree command — asserts the working tree has no modified or untracked files.
|
|
3
|
+
*
|
|
4
|
+
* Pure core functions for parsing git output and determining tree cleanliness.
|
|
5
|
+
* The CLI runner in {@link runCheckCleanTree} handles git invocation and output.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/** Status of the working tree after verification steps */
|
|
10
|
+
interface TreeStatus {
|
|
11
|
+
readonly clean: boolean;
|
|
12
|
+
readonly modified: string[];
|
|
13
|
+
readonly untracked: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Parse `git diff --name-only` output into a list of modified file paths.
|
|
17
|
+
*/
|
|
18
|
+
declare function parseGitDiff(diffOutput: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Parse `git ls-files --others --exclude-standard` output into a list of untracked file paths.
|
|
21
|
+
*/
|
|
22
|
+
declare function parseUntrackedFiles(lsOutput: string): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Determine if the tree status represents a clean working tree.
|
|
25
|
+
*/
|
|
26
|
+
declare function isCleanTree(status: TreeStatus): boolean;
|
|
27
|
+
interface CheckCleanTreeOptions {
|
|
28
|
+
readonly paths?: string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Run clean-tree check against the current working directory.
|
|
32
|
+
*
|
|
33
|
+
* Exits 0 if clean, 1 if dirty files are found.
|
|
34
|
+
*/
|
|
35
|
+
declare function runCheckCleanTree(options?: CheckCleanTreeOptions): Promise<void>;
|
|
36
|
+
export { runCheckCleanTree, parseUntrackedFiles, parseGitDiff, isCleanTree, TreeStatus, CheckCleanTreeOptions };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
isCleanTree,
|
|
4
|
+
parseGitDiff,
|
|
5
|
+
parseUntrackedFiles,
|
|
6
|
+
runCheckCleanTree
|
|
7
|
+
} from "../shared/@outfitter/tooling-gcdvsqqp.js";
|
|
8
|
+
import"../shared/@outfitter/tooling-jnrs9rqd.js";
|
|
9
|
+
export {
|
|
10
|
+
runCheckCleanTree,
|
|
11
|
+
parseUntrackedFiles,
|
|
12
|
+
parseGitDiff,
|
|
13
|
+
isCleanTree
|
|
14
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CheckExportsOptions, resolveJsonMode, runCheckExports } from "../shared/@outfitter/tooling-y43b117h.js";
|
|
2
|
+
import { CheckResult, CompareInput, ExportDrift, ExportMap, PackageResult, compareExports, entryToSubpath } from "../shared/@outfitter/tooling-cb0b8wsx.js";
|
|
3
|
+
export { runCheckExports, resolveJsonMode, entryToSubpath, compareExports, PackageResult, ExportMap, ExportDrift, CompareInput, CheckResult, CheckExportsOptions };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
resolveJsonMode,
|
|
4
|
+
runCheckExports
|
|
5
|
+
} from "../shared/@outfitter/tooling-0zjz8eg9.js";
|
|
6
|
+
import"../shared/@outfitter/tooling-a6q3zh7t.js";
|
|
7
|
+
import {
|
|
8
|
+
compareExports,
|
|
9
|
+
entryToSubpath
|
|
10
|
+
} from "../shared/@outfitter/tooling-ayps7c4x.js";
|
|
11
|
+
import"../shared/@outfitter/tooling-jnrs9rqd.js";
|
|
12
|
+
export {
|
|
13
|
+
runCheckExports,
|
|
14
|
+
resolveJsonMode,
|
|
15
|
+
entryToSubpath,
|
|
16
|
+
compareExports
|
|
17
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
interface HomePathLeak {
|
|
2
|
+
readonly line: number;
|
|
3
|
+
readonly column: number;
|
|
4
|
+
readonly matchedText: string;
|
|
5
|
+
readonly lineText: string;
|
|
6
|
+
}
|
|
7
|
+
interface FileHomePathLeak extends HomePathLeak {
|
|
8
|
+
readonly filePath: string;
|
|
9
|
+
}
|
|
10
|
+
interface HomePathScanReadFailure {
|
|
11
|
+
readonly filePath: string;
|
|
12
|
+
readonly reason: string;
|
|
13
|
+
}
|
|
14
|
+
declare function findHomePathLeaks(content: string, homePathOrPattern: string | RegExp): HomePathLeak[];
|
|
15
|
+
interface ScanHomePathOptions {
|
|
16
|
+
readonly cwd?: string;
|
|
17
|
+
readonly homeDir?: string;
|
|
18
|
+
readonly readFile?: (path: string, encoding: "utf-8") => string;
|
|
19
|
+
}
|
|
20
|
+
interface RunCheckHomePathsOptions {
|
|
21
|
+
readonly setExitCode?: (code: number) => void;
|
|
22
|
+
readonly stderr?: Pick<typeof process.stderr, "write">;
|
|
23
|
+
readonly scanOptions?: ScanHomePathOptions;
|
|
24
|
+
}
|
|
25
|
+
interface HomePathScanResult {
|
|
26
|
+
readonly leaks: readonly FileHomePathLeak[];
|
|
27
|
+
readonly failures: readonly HomePathScanReadFailure[];
|
|
28
|
+
}
|
|
29
|
+
declare function scanFilesForHardcodedHomePaths(filePaths: readonly string[], options?: ScanHomePathOptions): HomePathScanResult;
|
|
30
|
+
declare function runCheckHomePaths(paths: readonly string[], options?: RunCheckHomePathsOptions): void;
|
|
31
|
+
export { scanFilesForHardcodedHomePaths, runCheckHomePaths, findHomePathLeaks, ScanHomePathOptions, RunCheckHomePathsOptions, HomePathScanResult, HomePathScanReadFailure, HomePathLeak, FileHomePathLeak };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
findHomePathLeaks,
|
|
4
|
+
runCheckHomePaths,
|
|
5
|
+
scanFilesForHardcodedHomePaths
|
|
6
|
+
} from "../shared/@outfitter/tooling-h5dnevjw.js";
|
|
7
|
+
import"../shared/@outfitter/tooling-jnrs9rqd.js";
|
|
8
|
+
export {
|
|
9
|
+
scanFilesForHardcodedHomePaths,
|
|
10
|
+
runCheckHomePaths,
|
|
11
|
+
findHomePathLeaks
|
|
12
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** A relative link extracted from a markdown file. */
|
|
2
|
+
interface MarkdownLink {
|
|
3
|
+
/** The link target path (anchors stripped). */
|
|
4
|
+
readonly target: string;
|
|
5
|
+
/** 1-based line number where the link appears. */
|
|
6
|
+
readonly line: number;
|
|
7
|
+
}
|
|
8
|
+
/** A broken link with its source file context. */
|
|
9
|
+
interface BrokenLink {
|
|
10
|
+
/** Relative path of the source markdown file. */
|
|
11
|
+
readonly source: string;
|
|
12
|
+
/** The link target that could not be resolved. */
|
|
13
|
+
readonly target: string;
|
|
14
|
+
/** 1-based line number in the source file. */
|
|
15
|
+
readonly line: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Extract relative markdown links from content, skipping external URLs,
|
|
19
|
+
* bare anchors, code fences, and inline code.
|
|
20
|
+
*
|
|
21
|
+
* @param content - Raw markdown content
|
|
22
|
+
* @returns Array of extracted links with line numbers
|
|
23
|
+
*/
|
|
24
|
+
declare function extractMarkdownLinks(content: string): MarkdownLink[];
|
|
25
|
+
/**
|
|
26
|
+
* Validate that relative links in the given markdown files resolve to
|
|
27
|
+
* existing files on disk.
|
|
28
|
+
*
|
|
29
|
+
* @param rootDir - Absolute path to the project root
|
|
30
|
+
* @param files - Relative file paths (from rootDir) to check
|
|
31
|
+
* @returns Array of broken links
|
|
32
|
+
*/
|
|
33
|
+
declare function validateLinks(rootDir: string, files: readonly string[]): Promise<BrokenLink[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Run check-markdown-links across the project.
|
|
36
|
+
*
|
|
37
|
+
* @param rootDir - Project root directory
|
|
38
|
+
* @param patterns - Glob patterns for file discovery (defaults to standard set)
|
|
39
|
+
* @returns Exit code (0 = all valid, 1 = broken links found)
|
|
40
|
+
*/
|
|
41
|
+
declare function runCheckMarkdownLinks(rootDir: string, patterns?: readonly string[]): Promise<number>;
|
|
42
|
+
export { validateLinks, runCheckMarkdownLinks, extractMarkdownLinks, MarkdownLink, BrokenLink };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
import {
|
|
4
|
+
extractMarkdownLinks,
|
|
5
|
+
runCheckMarkdownLinks,
|
|
6
|
+
validateLinks
|
|
7
|
+
} from "../shared/@outfitter/tooling-ja1zg5yc.js";
|
|
8
|
+
import"../shared/@outfitter/tooling-jnrs9rqd.js";
|
|
9
|
+
export {
|
|
10
|
+
validateLinks,
|
|
11
|
+
runCheckMarkdownLinks,
|
|
12
|
+
extractMarkdownLinks
|
|
13
|
+
};
|