@bensandee/tooling 0.16.0 → 0.17.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/README.md CHANGED
@@ -55,7 +55,7 @@ The tool auto-detects project structure, CI platform, project type, and Docker p
55
55
 
56
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.
57
57
 
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`.
58
+ When Docker packages are present, `repo:sync` generates a deploy workflow (`.forgejo/workflows/publish.yml` or `.github/workflows/publish.yml`) triggered on version tags (`v*.*.*`) that runs `pnpm exec tooling docker:publish`.
59
59
 
60
60
  #### Overrides
61
61
 
@@ -219,5 +219,3 @@ if (!result.success) {
219
219
  | `VerifyResult` | Result: `{ success: true, elapsedMs }` or `{ success: false, reason, message, elapsedMs }` |
220
220
  | `DockerVerifyExecutor` | Side-effect abstraction (exec, fetch, timers) for testability |
221
221
  | `ContainerInfo` | Container status info from `composePs` |
222
-
223
- ## [Changelog](./CHANGELOG.md)
package/dist/bin.mjs CHANGED
@@ -451,6 +451,21 @@ function createDryRunContext(config) {
451
451
  //#endregion
452
452
  //#region src/utils/tooling-config.ts
453
453
  const CONFIG_FILE = ".tooling.json";
454
+ const DeclarativeHealthCheckSchema = z.object({
455
+ name: z.string(),
456
+ url: z.string(),
457
+ status: z.number().int().optional()
458
+ });
459
+ const DockerVerifyConfigSchema = z.object({
460
+ composeFiles: z.array(z.string()).optional(),
461
+ envFile: z.string().optional(),
462
+ services: z.array(z.string()).optional(),
463
+ healthChecks: z.array(DeclarativeHealthCheckSchema).optional(),
464
+ buildCommand: z.string().optional(),
465
+ buildCwd: z.string().optional(),
466
+ timeoutMs: z.number().int().positive().optional(),
467
+ pollIntervalMs: z.number().int().positive().optional()
468
+ });
454
469
  const ToolingConfigSchema = z.object({
455
470
  structure: z.enum(["single", "monorepo"]).optional(),
456
471
  useEslintPlugin: z.boolean().optional(),
@@ -479,7 +494,8 @@ const ToolingConfigSchema = z.object({
479
494
  docker: z.record(z.string(), z.object({
480
495
  dockerfile: z.string(),
481
496
  context: z.string().default(".")
482
- })).optional()
497
+ })).optional(),
498
+ dockerVerify: DockerVerifyConfigSchema.optional()
483
499
  });
484
500
  /** Load saved tooling config from the target directory. Returns undefined if missing or invalid. */
485
501
  function loadToolingConfig(targetDir) {
@@ -639,8 +655,8 @@ function addReleaseDeps(deps, config) {
639
655
  function getAddedDevDepNames(config) {
640
656
  const deps = { ...ROOT_DEV_DEPS };
641
657
  if (config.structure !== "monorepo") Object.assign(deps, PER_PACKAGE_DEV_DEPS);
642
- deps["@bensandee/config"] = "0.8.1";
643
- deps["@bensandee/tooling"] = "0.16.0";
658
+ deps["@bensandee/config"] = "0.8.2";
659
+ deps["@bensandee/tooling"] = "0.17.0";
644
660
  if (config.formatter === "oxfmt") deps["oxfmt"] = "0.35.0";
645
661
  if (config.formatter === "prettier") deps["prettier"] = "3.8.1";
646
662
  addReleaseDeps(deps, config);
@@ -660,8 +676,8 @@ async function generatePackageJson(ctx) {
660
676
  if (ctx.config.releaseStrategy !== "none" && ctx.config.releaseStrategy !== "changesets") allScripts["trigger-release"] = "pnpm exec tooling release:trigger";
661
677
  const devDeps = { ...ROOT_DEV_DEPS };
662
678
  if (!isMonorepo) Object.assign(devDeps, PER_PACKAGE_DEV_DEPS);
663
- devDeps["@bensandee/config"] = isWorkspacePackage(ctx, "@bensandee/config") ? "workspace:*" : "0.8.1";
664
- devDeps["@bensandee/tooling"] = isWorkspacePackage(ctx, "@bensandee/tooling") ? "workspace:*" : "0.16.0";
679
+ devDeps["@bensandee/config"] = isWorkspacePackage(ctx, "@bensandee/config") ? "workspace:*" : "0.8.2";
680
+ devDeps["@bensandee/tooling"] = isWorkspacePackage(ctx, "@bensandee/tooling") ? "workspace:*" : "0.17.0";
665
681
  if (ctx.config.useEslintPlugin) devDeps["@bensandee/eslint-plugin"] = isWorkspacePackage(ctx, "@bensandee/eslint-plugin") ? "workspace:*" : "0.9.2";
666
682
  if (ctx.config.formatter === "oxfmt") devDeps["oxfmt"] = "0.35.0";
667
683
  if (ctx.config.formatter === "prettier") devDeps["prettier"] = "3.8.1";
@@ -2479,7 +2495,7 @@ async function generateDeployCi(ctx) {
2479
2495
  description: "Deploy CI workflow not applicable"
2480
2496
  };
2481
2497
  const isGitHub = ctx.config.ci === "github";
2482
- const workflowPath = isGitHub ? ".github/workflows/deploy.yml" : ".forgejo/workflows/deploy.yml";
2498
+ const workflowPath = isGitHub ? ".github/workflows/publish.yml" : ".forgejo/workflows/publish.yml";
2483
2499
  const nodeVersionYaml = hasEnginesNode(ctx) ? "node-version-file: package.json" : "node-version: \"24\"";
2484
2500
  const content = deployWorkflow(ctx.config.ci, nodeVersionYaml);
2485
2501
  if (ctx.exists(workflowPath)) {
@@ -4245,7 +4261,7 @@ const dockerBuildCommand = defineCommand({
4245
4261
  const main = defineCommand({
4246
4262
  meta: {
4247
4263
  name: "tooling",
4248
- version: "0.16.0",
4264
+ version: "0.17.0",
4249
4265
  description: "Bootstrap and maintain standardized TypeScript project tooling"
4250
4266
  },
4251
4267
  subCommands: {
@@ -4260,7 +4276,7 @@ const main = defineCommand({
4260
4276
  "docker:build": dockerBuildCommand
4261
4277
  }
4262
4278
  });
4263
- console.log(`@bensandee/tooling v0.16.0`);
4279
+ console.log(`@bensandee/tooling v0.17.0`);
4264
4280
  runMain(main);
4265
4281
  //#endregion
4266
4282
  export {};
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@bensandee/tooling",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "CLI tool to bootstrap and maintain standardized TypeScript project tooling",
5
5
  "bin": {
6
6
  "tooling": "./dist/bin.mjs"
7
7
  },
8
8
  "files": [
9
- "dist",
10
- "CHANGELOG.md"
9
+ "dist"
11
10
  ],
12
11
  "type": "module",
13
12
  "imports": {
@@ -42,7 +41,7 @@
42
41
  "tsdown": "0.21.2",
43
42
  "typescript": "5.9.3",
44
43
  "vitest": "4.0.18",
45
- "@bensandee/config": "0.8.1"
44
+ "@bensandee/config": "0.8.2"
46
45
  },
47
46
  "optionalDependencies": {
48
47
  "@changesets/cli": "^2.29.4",
package/CHANGELOG.md DELETED
@@ -1,242 +0,0 @@
1
- # @bensandee/tooling
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
-
9
- ## 0.15.0
10
-
11
- ### Minor Changes
12
-
13
- - 2ef37e2: Add `docker:build` and `docker:publish` CLI commands. Packages declare a `docker` field in their `package.json` with `dockerfile` and `context`, and the tooling handles `docker build` with the correct image name (`{repo}-{package}`). `docker:build --package .` enables a per-package `image:build` script for local testing. `docker:publish` builds all images, then tags/pushes them with semver variants (latest, vX.Y.Z, vX.Y, vX) from each package's own version. Also adds a deploy workflow generator (`setupDocker` config option) that emits a CI workflow triggered on version tags.
14
- - c09d233: Combine CI and release workflows for changesets strategy into a single check.yml with release job gated on check success
15
-
16
- ### Patch Changes
17
-
18
- - 6cae944: Prompt to overwrite outdated release workflows during repo:update instead of only merging missing steps
19
-
20
- ## 0.14.1
21
-
22
- ### Patch Changes
23
-
24
- - caeebd8: Add d.ts declaration file output and types export conditions
25
- - caeebd8: Bump tsdown from 0.21.0 to 0.21.2
26
- - Updated dependencies [caeebd8]
27
- - Updated dependencies [caeebd8]
28
- - @bensandee/common@0.1.2
29
-
30
- ## 0.14.0
31
-
32
- ### Minor Changes
33
-
34
- - e95d449: Add `--fail-fast` / `--no-fail-fast` flag to `checks:run` to control whether execution stops on the first failure. Defaults to fail-fast in dev and continue-on-error in CI.
35
- - 715a4ea: Add `@bensandee/tooling/docker-verify` subpath export: a TypeScript framework for Docker image verification with compose lifecycle management, HTTP health polling, container health monitoring, and signal-safe cleanup. Consumers import building blocks and compose them with custom validators instead of writing boilerplate.
36
- - 27c3480: Add `release:simple` command and rename CLI subcommands
37
-
38
- **Breaking changes:**
39
-
40
- - `release:create-forgejo-release` renamed to `forgejo:create-release`
41
- - `release:merge` renamed to `changesets:merge`
42
- - `releaseStrategy: "commit-and-tag-version"` renamed to `"simple"` in `.tooling.json` config
43
- - Generated CI workflow for commit-and-tag-version now uses `pnpm exec tooling release:simple` instead of inline shell commands
44
-
45
- **New feature:**
46
-
47
- `release:simple` — a CLI command that handles the full release lifecycle for projects using commit-and-tag-version:
48
-
49
- - Runs `commit-and-tag-version` to bump version, update CHANGELOG, and create a git tag
50
- - Pushes to origin with `--follow-tags`
51
- - Creates sliding version tags (vX, vX.Y) for flexible deployment pinning
52
- - Creates Forgejo or GitHub releases automatically
53
-
54
- ### Patch Changes
55
-
56
- - 715a4ea: Add README files to all published packages for npm registry documentation
57
- - 27c3480: Pre-populate `repo:init` prompts from saved `.tooling.json` config
58
-
59
- When re-running `repo:init` on a project with an existing `.tooling.json`, each prompt now defaults to the previously saved choice instead of the detection-based default. Press Enter to keep existing settings or change only what you need.
60
-
61
- - d448ec6: Update node tsconfig base to use `nodenext` module resolution with `allowImportingTsExtensions`, enabling `.ts` extensions in imports for projects running TypeScript natively on Node 24+. Migrate all tooling-cli imports to use `.ts` extensions and switch `#src` subpath mapping to `#src/*.ts`. Use extensionless imports for library packages.
62
- - c49593f: Add `commit-and-tag-version` and `@changesets/cli` as optional dependencies
63
-
64
- These tools are only needed when using their respective release strategies, so they're optional rather than required. Target projects already install them as devDependencies via the package-json generator.
65
-
66
- - Updated dependencies [715a4ea]
67
- - Updated dependencies [d448ec6]
68
- - @bensandee/common@0.1.1
69
-
70
- ## 0.13.0
71
-
72
- ### Minor Changes
73
-
74
- - bbe3634: Add `checks:run` command (renamed from `repo:run-checks`). Add `ci:check`, `tooling:check`, and `tooling:update` as generated package.json scripts. CI workflows now run `pnpm ci:check`. Managed scripts are updated on `repo:update`/`repo:check` if they don't reference the expected command.
75
-
76
- ### Patch Changes
77
-
78
- - f20b25d: `checks:run` now reads package.json to detect which scripts are defined. Undefined scripts show "(not defined)" instead of silently passing. Commands use `pnpm run` instead of `pnpm run --if-present`.
79
-
80
- ## 0.12.0
81
-
82
- ### Minor Changes
83
-
84
- - 5de6090: Add `repo:run-checks` command that runs all standard checks (build, typecheck, lint, test, format, knip, tooling:check, image:check) without short-circuiting, reporting a summary of failures at the end. Supports `--skip` to skip specific checks and `--add` to append custom checks. Generated CI workflows now use `pnpm check`, and the package.json generator produces `check` and `tooling:check` scripts pointing to this command. Managed scripts (`check`, `tooling:check`) are updated on `repo:update`/`repo:check` if they don't already reference the expected command.
85
-
86
- ## 0.11.0
87
-
88
- ### Minor Changes
89
-
90
- - 493ae65: Add `repo:run-checks` command that runs all standard checks (build, typecheck, lint, test, format, knip, repo:check) without short-circuiting, reporting a summary of failures at the end. Generated CI workflows and package.json `check` scripts now use this command. Skip `trigger-release` script for changesets release strategy.
91
-
92
- ### Patch Changes
93
-
94
- - ae18571: Add .pnpm-store to gitignore file
95
- - 916c1ee: Ensure `yaml-language-server` schema comment is added to existing Forgejo workflow files during update/merge
96
-
97
- ## 0.10.1
98
-
99
- ### Patch Changes
100
-
101
- - f131a3d: Add `pnpm why` to the allowed Bash commands in generated Claude settings
102
- - 1cb2ce8: Add yaml-language-server schema comments to generated Forgejo workflow files and update schema glob to match both .yml and .yaml extensions
103
-
104
- ## 0.10.0
105
-
106
- ### Minor Changes
107
-
108
- - 34a0e1e: feat: merge missing config into existing lefthook and CI workflow files instead of skipping
109
-
110
- Generators for `lefthook.yml`, CI check workflows, and release workflows now merge required
111
- entries into existing files rather than silently skipping them. This means `repo:update` can
112
- add new steps (e.g. a newly required CI check) to repos that were initialized before the step
113
- existed.
114
-
115
- Add `# @bensandee/tooling:ignore` in the first 10 lines of any YAML file to opt out of
116
- automatic merging.
117
-
118
- ### Patch Changes
119
-
120
- - 330cc2c: fix: use semantic JSON comparison in repo:check and repo:update to ignore formatting-only differences
121
-
122
- ## 0.9.0
123
-
124
- ### Minor Changes
125
-
126
- - 88f2a93: Require `.tooling.json` for `repo:update` and `repo:check` commands. Previously these commands would warn and continue with detected defaults when `.tooling.json` was missing, which could cause unexpected overwrites without proper archiving. Now they exit with an error directing the user to run `tooling repo:init` first.
127
-
128
- Write Forgejo workflow schema mapping to `.code-workspace` file when present, falling back to `.vscode/settings.json`. The `yaml.schemas` setting in `.vscode/settings.json` doesn't apply in VS Code multi-root workspaces.
129
-
130
- Improve post-init guidance: suggest a Claude Code prompt ("Execute the steps in .tooling-migrate.md") instead of "paste contents".
131
-
132
- ## 0.8.1
133
-
134
- ### Patch Changes
135
-
136
- - efcfdcc: Fix findOpenPr to filter PRs client-side by head.ref instead of relying on Forgejo's inconsistent head query parameter, which could match the wrong PR
137
- - 88aac23: Add forgejo workflow schema additions
138
- - e4c41d6: Fix wrong agent name in settings.json for claude
139
- - 43509b8: Pin @bensandee/\* package versions in generated package.json instead of using "latest". Versions are read from sibling package.json files at build time via tsdown's define feature, so they auto-update with each release.
140
- - 5e65e50: enhance ciWorkflow to support Forgejo email notifications
141
- - 60a5502: refactor generateClaudeSettings to handle monorepo structure and update tests for plugin integration
142
-
143
- ## 0.8.0
144
-
145
- ### Minor Changes
146
-
147
- - 375f7fd: Add claude skills to settings.json
148
-
149
- ### Patch Changes
150
-
151
- - 375098b: Add more safety restrictions to settings.json
152
- - b330adf: Fix bad update to tsconfig when not needed
153
-
154
- ## 0.7.3
155
-
156
- ### Patch Changes
157
-
158
- - 3257e04: Fix no-unsafe-json-parse rule and fix new lint errors
159
- - ca61fa7: Don't overwrite existing oxfmt config
160
- - 1bdf858: More intelligent addition of src folder to tsconfig
161
- - 8de49b9: Add line about adding packages when necessary to resolve errors
162
-
163
- ## 0.7.2
164
-
165
- ### Patch Changes
166
-
167
- - e48bc27: Fix bug where tsconfigs in packages would be force-updated even if solutions-style
168
-
169
- ## 0.7.1
170
-
171
- ### Patch Changes
172
-
173
- - 6ef4ea9: Fix tsconfig build/update issues
174
- - 3608a1a: Run pnpm update after repo:update
175
-
176
- ## 0.7.0
177
-
178
- ### Minor Changes
179
-
180
- - 912013d: Add repo:check command
181
- - 2545262: Add common package + error subclasses
182
-
183
- ### Patch Changes
184
-
185
- - Updated dependencies [2545262]
186
- - @bensandee/common@0.1.0
187
-
188
- ## 0.6.2
189
-
190
- ### Patch Changes
191
-
192
- - caa1270: Fix hang migrating repo:init
193
-
194
- ## 0.6.1
195
-
196
- ### Patch Changes
197
-
198
- - 2182ab3: fix bug where renovate.json5 wasn't cleaned up to use our preset
199
- - d811a96: Lefthook doesn't need an install step in package.json prepare
200
-
201
- ## 0.6.0
202
-
203
- ### Minor Changes
204
-
205
- - 94cd161: Updated default oxlint config to include more default rules.
206
-
207
- ## 0.5.1
208
-
209
- ### Patch Changes
210
-
211
- - e0bc32e: Improve migration for tsconfig and husky/lint-staged
212
- - 02c1a1b: Include version when running tooling cli
213
-
214
- ## 0.5.0
215
-
216
- ### Minor Changes
217
-
218
- - 58fc8a3: Add lefthook support in place of husky, lint-staged
219
-
220
- ## 0.4.0
221
-
222
- ### Minor Changes
223
-
224
- - e02953a: Bug fixing, move renovate config to standard location
225
- - 451908d: Restructure package names and exports.
226
-
227
- ## 0.3.0
228
-
229
- ### Minor Changes
230
-
231
- - 5e9719f: Many bug fixes
232
-
233
- ## 0.2.0
234
-
235
- ### Minor Changes
236
-
237
- - c376981: Initial release
238
-
239
- ### Patch Changes
240
-
241
- - 3fc9fe3: Support multiple release architectures (release-it, commit-and-tag-version and changsets)
242
- - 4004530: Add release-forgejo command to perform final steps of release creation in forgejo.