@bensandee/tooling 0.15.0 → 0.16.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/CHANGELOG.md +6 -0
- package/README.md +48 -22
- package/dist/bin.mjs +549 -541
- package/dist/docker-verify/index.mjs +1 -1
- package/dist/index.d.mts +0 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @bensandee/tooling
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- b3e6d83: Redesign as conventions-first tool: auto-detect project structure, CI platform, project type, and Docker packages from the filesystem. `.tooling.json` now stores overrides only. Replace `repo:init`/`repo:update`/`repo:check` with idempotent `repo:sync` (and `repo:sync --check`). Docker packages are discovered by convention (`Dockerfile` or `docker/Dockerfile` in package dirs) instead of requiring explicit config. First-run prompts reduced to release strategy, CI platform (if not detected), and formatter (if Prettier found).
|
|
8
|
+
|
|
3
9
|
## 0.15.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -8,19 +8,33 @@ CLI to bootstrap and maintain standardized TypeScript project tooling.
|
|
|
8
8
|
pnpm add -D @bensandee/tooling
|
|
9
9
|
|
|
10
10
|
# Or run directly
|
|
11
|
-
pnpm dlx @bensandee/tooling repo:
|
|
11
|
+
pnpm dlx @bensandee/tooling repo:sync
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
## Conventions
|
|
15
|
+
|
|
16
|
+
The tool auto-detects project structure, CI platform, project type, and Docker packages from the filesystem. `.tooling.json` stores **overrides only** — omitted fields use detected defaults. Runtime commands (`docker:build`, `checks:run`, `release:changesets`) work without running `repo:sync` first.
|
|
17
|
+
|
|
18
|
+
| Convention | Detection | Default | Override via |
|
|
19
|
+
| ----------------- | ----------------------------------------------------- | ---------------------------------------- | ------------------------------------ |
|
|
20
|
+
| Project structure | `pnpm-workspace.yaml` present | `single` | `structure` in `.tooling.json` |
|
|
21
|
+
| CI platform | `.github/workflows/` or `.forgejo/workflows/` dir | `none` | `ci` in `.tooling.json` |
|
|
22
|
+
| Project type | Dependencies in `package.json` (react, node, library) | `default` | `projectType` in `.tooling.json` |
|
|
23
|
+
| Docker packages | `Dockerfile` or `docker/Dockerfile` in package dirs | — | `docker` map in `.tooling.json` |
|
|
24
|
+
| Formatter | Existing prettier config detected | `oxfmt` | `formatter` in `.tooling.json` |
|
|
25
|
+
| Release strategy | Existing release config detected | monorepo: `changesets`, single: `simple` | `releaseStrategy` in `.tooling.json` |
|
|
26
|
+
|
|
14
27
|
## CLI commands
|
|
15
28
|
|
|
16
29
|
### Project management
|
|
17
30
|
|
|
18
|
-
| Command
|
|
19
|
-
|
|
|
20
|
-
| `tooling repo:
|
|
21
|
-
| `tooling repo:
|
|
22
|
-
| `tooling
|
|
23
|
-
|
|
31
|
+
| Command | Description |
|
|
32
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `tooling repo:sync [dir]` | Detect, generate, and sync project tooling (idempotent). First run prompts for release strategy, CI platform (if not detected), and formatter (if Prettier found). Subsequent runs are non-interactive. |
|
|
34
|
+
| `tooling repo:sync --check [dir]` | Dry-run drift detection. Exits 1 if files would change. CI-friendly. |
|
|
35
|
+
| `tooling checks:run` | Run project checks (build, typecheck, lint, knip, test). Flag: `--fail-fast`. |
|
|
36
|
+
|
|
37
|
+
**Flags:** `--yes` (accept all defaults), `--no-ci`, `--no-prompt`, `--eslint-plugin`
|
|
24
38
|
|
|
25
39
|
### Release management
|
|
26
40
|
|
|
@@ -34,23 +48,25 @@ pnpm dlx @bensandee/tooling repo:init
|
|
|
34
48
|
|
|
35
49
|
### Docker
|
|
36
50
|
|
|
37
|
-
| Command | Description
|
|
38
|
-
| ------------------------ |
|
|
39
|
-
| `tooling docker:build` | Build Docker images for
|
|
40
|
-
| `tooling docker:publish` | Build, tag, and push Docker images to a registry.
|
|
51
|
+
| Command | Description |
|
|
52
|
+
| ------------------------ | --------------------------------------------------- |
|
|
53
|
+
| `tooling docker:build` | Build Docker images for discovered Docker packages. |
|
|
54
|
+
| `tooling docker:publish` | Build, tag, and push Docker images to a registry. |
|
|
55
|
+
|
|
56
|
+
Docker packages are discovered automatically. Any package with a `Dockerfile` or `docker/Dockerfile` is a Docker package. Image names are derived as `{root-package-name}-{package-name}`, build context defaults to `.` (project root). For single-package repos, `Dockerfile` or `docker/Dockerfile` at the project root is checked.
|
|
41
57
|
|
|
42
|
-
|
|
58
|
+
When Docker packages are present, `repo:sync` generates a deploy workflow (`.forgejo/workflows/deploy.yml` or `.github/workflows/deploy.yml`) triggered on version tags (`v*.*.*`) that runs `pnpm exec tooling docker:publish`.
|
|
59
|
+
|
|
60
|
+
#### Overrides
|
|
61
|
+
|
|
62
|
+
To override defaults, add a `docker` entry to `.tooling.json`:
|
|
43
63
|
|
|
44
64
|
```json
|
|
45
65
|
{
|
|
46
|
-
"setupDocker": true,
|
|
47
66
|
"docker": {
|
|
48
67
|
"server": {
|
|
49
68
|
"dockerfile": "packages/server/docker/Dockerfile",
|
|
50
69
|
"context": "."
|
|
51
|
-
},
|
|
52
|
-
"client": {
|
|
53
|
-
"dockerfile": "packages/client/Dockerfile"
|
|
54
70
|
}
|
|
55
71
|
}
|
|
56
72
|
}
|
|
@@ -58,11 +74,9 @@ Both commands read Docker build config from the `docker` map in `.tooling.json`,
|
|
|
58
74
|
|
|
59
75
|
The `context` field defaults to `"."` (project root) when omitted. Versions for tagging are read from each package's own `package.json`.
|
|
60
76
|
|
|
61
|
-
The tooling derives image names as `{root-package-name}-{package-name}` (e.g. `my-app-server`) and runs `docker build -f <dockerfile> -t <image-name>:latest <context>` for each package.
|
|
62
|
-
|
|
63
77
|
#### `docker:build`
|
|
64
78
|
|
|
65
|
-
Builds all
|
|
79
|
+
Builds all discovered packages, or a single package with `--package`:
|
|
66
80
|
|
|
67
81
|
```bash
|
|
68
82
|
# Build all packages with docker config
|
|
@@ -106,11 +120,23 @@ Each package is tagged independently using its own version, so packages in a mon
|
|
|
106
120
|
| `DOCKER_USERNAME` | Registry username |
|
|
107
121
|
| `DOCKER_PASSWORD` | Registry password |
|
|
108
122
|
|
|
109
|
-
When `setupDocker` is enabled in `.tooling.json`, `repo:init` generates a deploy workflow (`.forgejo/workflows/deploy.yml` or `.github/workflows/deploy.yml`) triggered on version tags (`v*.*.*`) that runs `pnpm exec tooling docker:publish`.
|
|
110
|
-
|
|
111
123
|
## Config file
|
|
112
124
|
|
|
113
|
-
|
|
125
|
+
`.tooling.json` stores **overrides only** — fields where the project differs from what convention/detection produces. A fully conventional project has `{}` or no `.tooling.json` at all.
|
|
126
|
+
|
|
127
|
+
Available override fields:
|
|
128
|
+
|
|
129
|
+
| Field | Type | Default (detected) |
|
|
130
|
+
| -------------------- | ------- | -------------------------------------------------------------------------------- |
|
|
131
|
+
| `structure` | string | `"monorepo"` if `pnpm-workspace.yaml` present, else `"single"` |
|
|
132
|
+
| `useEslintPlugin` | boolean | `true` |
|
|
133
|
+
| `formatter` | string | `"prettier"` if config found, else `"oxfmt"` |
|
|
134
|
+
| `setupVitest` | boolean | `true` |
|
|
135
|
+
| `ci` | string | Detected from workflow dirs, else `"none"` |
|
|
136
|
+
| `setupRenovate` | boolean | `true` |
|
|
137
|
+
| `releaseStrategy` | string | Detected from existing config, else monorepo: `"changesets"`, single: `"simple"` |
|
|
138
|
+
| `projectType` | string | Auto-detected from `package.json` deps |
|
|
139
|
+
| `detectPackageTypes` | boolean | `true` |
|
|
114
140
|
|
|
115
141
|
## Library API
|
|
116
142
|
|