@outfitter/tooling 0.2.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.
- package/.markdownlint-cli2.jsonc +66 -0
- package/README.md +168 -0
- package/biome.json +74 -0
- package/dist/cli/check.d.ts +19 -0
- package/dist/cli/check.js +9 -0
- package/dist/cli/fix.d.ts +19 -0
- package/dist/cli/fix.js +9 -0
- package/dist/cli/index.js +353 -0
- package/dist/cli/init.d.ts +31 -0
- package/dist/cli/init.js +11 -0
- package/dist/cli/pre-push.d.ts +8 -0
- package/dist/cli/pre-push.js +7 -0
- package/dist/cli/upgrade-bun.d.ts +8 -0
- package/dist/cli/upgrade-bun.js +7 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.js +28 -0
- package/dist/registry/build.js +128 -0
- package/dist/registry/index.d.ts +3 -0
- package/dist/registry/index.js +12 -0
- package/dist/registry/schema.d.ts +2 -0
- package/dist/registry/schema.js +11 -0
- package/dist/shared/@outfitter/tooling-75j500dv.js +142 -0
- package/dist/shared/@outfitter/tooling-g83d0kjv.js +23 -0
- package/dist/shared/@outfitter/tooling-kcvs6mys.js +1 -0
- package/dist/shared/@outfitter/tooling-qm7jeg0d.js +99 -0
- package/dist/shared/@outfitter/tooling-s4eqq91d.js +20 -0
- package/dist/shared/@outfitter/tooling-sjm8nebx.d.ts +109 -0
- package/dist/shared/@outfitter/tooling-xaxdr9da.js +58 -0
- package/dist/shared/@outfitter/tooling-xx1146e3.js +20 -0
- package/lefthook.yml +30 -0
- package/package.json +116 -0
- package/registry/registry.json +78 -0
- package/tsconfig.preset.bun.json +7 -0
- package/tsconfig.preset.json +40 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Outfitter markdownlint preset
|
|
3
|
+
// https://github.com/DavidAnson/markdownlint
|
|
4
|
+
|
|
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
|
+
|
|
12
|
+
// Line length - disabled for prose flexibility
|
|
13
|
+
"MD013": false,
|
|
14
|
+
|
|
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
|
+
|
|
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
|
+
|
|
25
|
+
// Links
|
|
26
|
+
"MD034": true, // No bare URLs (use <url> or [text](url))
|
|
27
|
+
|
|
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
|
+
|
|
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
|
+
|
|
50
|
+
// Emphasis
|
|
51
|
+
"MD049": { "style": "asterisk" }, // Emphasis style: *italic*
|
|
52
|
+
"MD050": { "style": "asterisk" } // Strong style: **bold**
|
|
53
|
+
},
|
|
54
|
+
|
|
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
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# @outfitter/tooling
|
|
2
|
+
|
|
3
|
+
Dev tooling configuration presets and CLI for Outfitter projects.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Configuration Presets**: Biome, TypeScript, Lefthook, and markdownlint configs
|
|
8
|
+
- **CLI Commands**: Initialize configs, upgrade Bun, TDD-aware pre-push hooks
|
|
9
|
+
- **Registry System**: Composable config blocks for scaffolding
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bun add -D @outfitter/tooling
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Peer dependencies (optional):
|
|
18
|
+
- `ultracite` — Biome wrapper for formatting/linting
|
|
19
|
+
- `lefthook` — Git hooks
|
|
20
|
+
- `markdownlint-cli2` — Markdown linting
|
|
21
|
+
|
|
22
|
+
## CLI Commands
|
|
23
|
+
|
|
24
|
+
### `tooling init`
|
|
25
|
+
|
|
26
|
+
Initialize tooling configuration in the current project. Copies preset configs for Biome, TypeScript, Lefthook, and markdownlint.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bunx @outfitter/tooling init
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### `tooling check [paths...]`
|
|
33
|
+
|
|
34
|
+
Run linting checks (wraps ultracite).
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
bunx @outfitter/tooling check
|
|
38
|
+
bunx @outfitter/tooling check src/
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### `tooling fix [paths...]`
|
|
42
|
+
|
|
43
|
+
Fix linting issues (wraps ultracite).
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
bunx @outfitter/tooling fix
|
|
47
|
+
bunx @outfitter/tooling fix src/
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### `tooling upgrade-bun [version]`
|
|
51
|
+
|
|
52
|
+
Upgrade Bun version across the project. Updates:
|
|
53
|
+
- `.bun-version`
|
|
54
|
+
- `engines.bun` in all package.json files
|
|
55
|
+
- `@types/bun` dependency versions (leaves "latest" alone)
|
|
56
|
+
- `bun.lock`
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Upgrade to latest
|
|
60
|
+
bunx @outfitter/tooling upgrade-bun
|
|
61
|
+
|
|
62
|
+
# Upgrade to specific version
|
|
63
|
+
bunx @outfitter/tooling upgrade-bun 1.4.0
|
|
64
|
+
|
|
65
|
+
# Skip installing Bun and updating lockfile
|
|
66
|
+
bunx @outfitter/tooling upgrade-bun 1.4.0 --no-install
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### `tooling pre-push`
|
|
70
|
+
|
|
71
|
+
TDD-aware pre-push test hook. Detects RED phase branches and skips tests by design.
|
|
72
|
+
|
|
73
|
+
RED phase branches follow these patterns:
|
|
74
|
+
- `*-tests` (e.g., `feature/auth-tests`)
|
|
75
|
+
- `*/tests` (e.g., `feature/auth/tests`)
|
|
76
|
+
- `*_tests` (e.g., `feature/auth_tests`)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Normal usage (in lefthook.yml)
|
|
80
|
+
bunx @outfitter/tooling pre-push
|
|
81
|
+
|
|
82
|
+
# Force skip tests
|
|
83
|
+
bunx @outfitter/tooling pre-push --force
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Configuration Presets
|
|
87
|
+
|
|
88
|
+
### Biome
|
|
89
|
+
|
|
90
|
+
Extends our Biome config in your `biome.json`:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"extends": ["@outfitter/tooling/biome.json"]
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### TypeScript
|
|
99
|
+
|
|
100
|
+
Extends our TypeScript config in your `tsconfig.json`:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"extends": "@outfitter/tooling/tsconfig.preset.json"
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Or for Bun-specific projects:
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"extends": "@outfitter/tooling/tsconfig.preset.bun.json"
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Lefthook
|
|
117
|
+
|
|
118
|
+
Extends our git hooks in your `.lefthook.yml`:
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
extends:
|
|
122
|
+
- node_modules/@outfitter/tooling/lefthook.yml
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Default hooks:
|
|
126
|
+
- **pre-commit**: Runs ultracite on staged files, typechecks
|
|
127
|
+
- **pre-push**: Runs build, then TDD-aware tests via `tooling pre-push`
|
|
128
|
+
|
|
129
|
+
### markdownlint
|
|
130
|
+
|
|
131
|
+
Copy or reference the config:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Copy to project
|
|
135
|
+
cp node_modules/@outfitter/tooling/.markdownlint-cli2.jsonc .
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Registry System
|
|
139
|
+
|
|
140
|
+
The tooling package includes a registry of composable config blocks for the `outfitter` CLI scaffolding system.
|
|
141
|
+
|
|
142
|
+
Available blocks:
|
|
143
|
+
- `claude` — Claude Code settings and hooks
|
|
144
|
+
- `biome` — Biome/Ultracite configuration
|
|
145
|
+
- `lefthook` — Git hooks configuration
|
|
146
|
+
- `markdownlint` — Markdown linting configuration
|
|
147
|
+
- `bootstrap` — Project bootstrap script
|
|
148
|
+
- `scaffolding` — Full starter kit (combines all above)
|
|
149
|
+
|
|
150
|
+
## Exports
|
|
151
|
+
|
|
152
|
+
| Export | Description |
|
|
153
|
+
|--------|-------------|
|
|
154
|
+
| `./biome.json` | Biome configuration preset |
|
|
155
|
+
| `./tsconfig.preset.json` | TypeScript preset (general) |
|
|
156
|
+
| `./tsconfig.preset.bun.json` | TypeScript preset (Bun) |
|
|
157
|
+
| `./lefthook.yml` | Lefthook hooks configuration |
|
|
158
|
+
| `./.markdownlint-cli2.jsonc` | markdownlint configuration |
|
|
159
|
+
|
|
160
|
+
## Related
|
|
161
|
+
|
|
162
|
+
- [@outfitter/contracts](../contracts/README.md) — Result types and error patterns
|
|
163
|
+
- [@outfitter/cli](../cli/README.md) — CLI framework
|
|
164
|
+
- [@outfitter/kit](../kit/README.md) — Version coordination
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
MIT
|
package/biome.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
|
3
|
+
"root": false,
|
|
4
|
+
"javascript": {
|
|
5
|
+
"globals": ["Bun"]
|
|
6
|
+
},
|
|
7
|
+
"linter": {
|
|
8
|
+
"rules": {
|
|
9
|
+
"complexity": {
|
|
10
|
+
"useLiteralKeys": "off",
|
|
11
|
+
"noVoid": "off",
|
|
12
|
+
"noExcessiveCognitiveComplexity": "off"
|
|
13
|
+
},
|
|
14
|
+
"performance": {
|
|
15
|
+
"useTopLevelRegex": "off"
|
|
16
|
+
},
|
|
17
|
+
"style": {
|
|
18
|
+
"useBlockStatements": "off"
|
|
19
|
+
},
|
|
20
|
+
"suspicious": {
|
|
21
|
+
"noConsole": "error"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"vcs": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"clientKind": "git",
|
|
28
|
+
"useIgnoreFile": true
|
|
29
|
+
},
|
|
30
|
+
"files": {
|
|
31
|
+
"ignoreUnknown": true,
|
|
32
|
+
"includes": ["!**/node_modules", "!**/dist", "!**/.turbo", "!**/*.gen.ts"]
|
|
33
|
+
},
|
|
34
|
+
"overrides": [
|
|
35
|
+
{
|
|
36
|
+
"includes": ["packages/*/src/index.ts", "apps/*/src/index.ts", "**/index.ts"],
|
|
37
|
+
"linter": {
|
|
38
|
+
"rules": {
|
|
39
|
+
"performance": {
|
|
40
|
+
"noBarrelFile": "off"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"includes": ["**/*.test.ts", "**/__tests__/**/*"],
|
|
47
|
+
"linter": {
|
|
48
|
+
"rules": {
|
|
49
|
+
"suspicious": {
|
|
50
|
+
"useAwait": "off",
|
|
51
|
+
"noConsole": "off"
|
|
52
|
+
},
|
|
53
|
+
"performance": {
|
|
54
|
+
"noDelete": "off"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"includes": [
|
|
61
|
+
"apps/**/*.ts",
|
|
62
|
+
"scripts/**/*.ts",
|
|
63
|
+
"**/scripts/**/*.ts"
|
|
64
|
+
],
|
|
65
|
+
"linter": {
|
|
66
|
+
"rules": {
|
|
67
|
+
"suspicious": {
|
|
68
|
+
"noConsole": "off"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI check command - Run linting checks (wraps ultracite)
|
|
3
|
+
*/
|
|
4
|
+
/** Options for the check command */
|
|
5
|
+
interface CheckOptions {
|
|
6
|
+
paths?: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Build the ultracite check command
|
|
10
|
+
* @param options - Command options
|
|
11
|
+
* @returns Array of command arguments
|
|
12
|
+
*/
|
|
13
|
+
declare function buildCheckCommand(options: CheckOptions): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Run the check command
|
|
16
|
+
* @param paths - Paths to check
|
|
17
|
+
*/
|
|
18
|
+
declare function runCheck(paths?: string[]): Promise<void>;
|
|
19
|
+
export { runCheck, buildCheckCommand };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI fix command - Fix linting issues (wraps ultracite)
|
|
3
|
+
*/
|
|
4
|
+
/** Options for the fix command */
|
|
5
|
+
interface FixOptions {
|
|
6
|
+
paths?: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Build the ultracite fix command
|
|
10
|
+
* @param options - Command options
|
|
11
|
+
* @returns Array of command arguments
|
|
12
|
+
*/
|
|
13
|
+
declare function buildFixCommand(options: FixOptions): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Run the fix command
|
|
16
|
+
* @param paths - Paths to fix
|
|
17
|
+
*/
|
|
18
|
+
declare function runFix(paths?: string[]): Promise<void>;
|
|
19
|
+
export { runFix, buildFixCommand };
|