@bensandee/tooling 0.59.1 → 0.60.1

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.
@@ -61,6 +61,13 @@ interface ComposeConfig {
61
61
  projectName: string;
62
62
  /** Optional env file for compose. */
63
63
  envFile?: string;
64
+ /**
65
+ * Extra environment variables applied to every `docker compose` invocation.
66
+ * Used to inject a dynamically allocated `PORT` so the check stack avoids
67
+ * host port collisions. Shell env takes precedence over `--env-file` for
68
+ * compose variable interpolation.
69
+ */
70
+ env?: Record<string, string>;
64
71
  /** Service names to monitor for container-level health. */
65
72
  services: string[];
66
73
  }
@@ -220,6 +227,12 @@ declare const ToolingConfigSchema: z.ZodObject<{
220
227
  tolerancePp: z.ZodOptional<z.ZodNumber>;
221
228
  gateOnPullRequests: z.ZodOptional<z.ZodBoolean>;
222
229
  }, z.core.$strict>]>>;
230
+ deploy: z.ZodOptional<z.ZodObject<{
231
+ dispatchRepo: z.ZodString;
232
+ stack: z.ZodOptional<z.ZodString>;
233
+ workflow: z.ZodOptional<z.ZodString>;
234
+ ref: z.ZodOptional<z.ZodString>;
235
+ }, z.core.$strict>>;
223
236
  pnpmWorkspace: z.ZodOptional<z.ZodLiteral<false>>;
224
237
  }, z.core.$strict>;
225
238
  type ToolingConfig = z.infer<typeof ToolingConfigSchema>;
@@ -1,2 +1,2 @@
1
- import { a as composeArgs, c as composePs, f as lintComposeFiles, i as getContainerHealth, l as composeUp, n as runDockerCheck, o as composeDown, r as checkHttpHealth, s as composeLogs, t as deriveProjectName, u as createRealExecutor } from "../project-name-CAVRoqNy.mjs";
1
+ import { a as composeArgs, c as composePs, f as lintComposeFiles, i as getContainerHealth, l as composeUp, n as runDockerCheck, o as composeDown, r as checkHttpHealth, s as composeLogs, t as deriveProjectName, u as createRealExecutor } from "../project-name-BBKJ0AIn.mjs";
2
2
  export { checkHttpHealth, composeArgs, composeDown, composeLogs, composePs, composeUp, createRealExecutor, deriveProjectName, getContainerHealth, lintComposeFiles, runDockerCheck };
@@ -282,7 +282,10 @@ function runSmoketest(executor, config) {
282
282
  if (!config.smoketest) return;
283
283
  const [file, ...args] = config.smoketest;
284
284
  if (!file) return;
285
- executor.execInherit(file, args, { cwd: config.smoketestCwd ?? config.compose.cwd });
285
+ executor.execInherit(file, args, {
286
+ cwd: config.smoketestCwd ?? config.compose.cwd,
287
+ env: config.compose.env
288
+ });
286
289
  }
287
290
  /** Start the compose stack in detached mode. */
288
291
  function composeUp(executor, config) {
@@ -290,7 +293,10 @@ function composeUp(executor, config) {
290
293
  ...composeArgs(config),
291
294
  "up",
292
295
  "-d"
293
- ], { cwd: config.cwd });
296
+ ], {
297
+ cwd: config.cwd,
298
+ env: config.env
299
+ });
294
300
  }
295
301
  /** Tear down the compose stack, removing volumes and orphans. Swallows errors. */
296
302
  function composeDown(executor, config) {
@@ -300,7 +306,10 @@ function composeDown(executor, config) {
300
306
  "down",
301
307
  "-v",
302
308
  "--remove-orphans"
303
- ], { cwd: config.cwd });
309
+ ], {
310
+ cwd: config.cwd,
311
+ env: config.env
312
+ });
304
313
  } catch (_error) {}
305
314
  }
306
315
  /** Show logs for a specific service (or all services if not specified). Swallows errors. */
@@ -308,7 +317,10 @@ function composeLogs(executor, config, service) {
308
317
  try {
309
318
  const args = [...composeArgs(config), "logs"];
310
319
  if (service) args.push(service);
311
- executor.execInherit("docker", args, { cwd: config.cwd });
320
+ executor.execInherit("docker", args, {
321
+ cwd: config.cwd,
322
+ env: config.env
323
+ });
312
324
  } catch (_error) {}
313
325
  }
314
326
  /**
@@ -321,7 +333,10 @@ function composePs(executor, config) {
321
333
  "ps",
322
334
  "--format",
323
335
  "json"
324
- ], { cwd: config.cwd }).stdout.trim();
336
+ ], {
337
+ cwd: config.cwd,
338
+ env: config.env
339
+ }).stdout.trim();
325
340
  if (!output) return [];
326
341
  const ArraySchema = z.array(ContainerInfoSchema);
327
342
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bensandee/tooling",
3
- "version": "0.59.1",
3
+ "version": "0.60.1",
4
4
  "description": "CLI tool to bootstrap and maintain standardized TypeScript project tooling",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -54,7 +54,7 @@
54
54
  "prettier": "3.8.3",
55
55
  "release-it": "20.0.1",
56
56
  "tsdown": "0.22.0",
57
- "@bensandee/claude-hooks": "0.7.4",
57
+ "@bensandee/claude-hooks": "0.8.0",
58
58
  "@bensandee/config": "0.11.2"
59
59
  },
60
60
  "scripts": {
@@ -259,6 +259,30 @@
259
259
  }
260
260
  ]
261
261
  },
262
+ "deploy": {
263
+ "description": "Generate a deploy-dispatch step in the release workflow that triggers a workflow_dispatch event in another repo after a successful release. The resolved release token must have rights on `dispatchRepo`.",
264
+ "type": "object",
265
+ "properties": {
266
+ "dispatchRepo": {
267
+ "type": "string",
268
+ "description": "Target repository (owner/repo) whose workflow the release dispatches to trigger a deploy"
269
+ },
270
+ "stack": {
271
+ "description": "Deploy stack name passed as the `stack` input (default: package name, '-' → '_')",
272
+ "type": "string"
273
+ },
274
+ "workflow": {
275
+ "description": "Workflow filename or ID to dispatch in the target repo (default: 'deploy.yml')",
276
+ "type": "string"
277
+ },
278
+ "ref": {
279
+ "description": "Git ref to dispatch the workflow on (default: 'main')",
280
+ "type": "string"
281
+ }
282
+ },
283
+ "required": ["dispatchRepo"],
284
+ "additionalProperties": false
285
+ },
262
286
  "pnpmWorkspace": {
263
287
  "description": "Set to false to opt out of pnpm-workspace.yaml management (skips both generation and the repo:sync --check validation).",
264
288
  "type": "boolean",