@bensandee/tooling 0.66.0 → 0.68.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 +10 -0
- package/dist/bin.mjs +1357 -290
- package/dist/index.d.mts +145 -1
- package/package.json +2 -6
- package/tooling.schema.json +6 -1
- package/dist/docker-check/index.d.mts +0 -299
- package/dist/docker-check/index.mjs +0 -2
- package/dist/project-name-CNaAmafB.mjs +0 -612
- package/dist/types-C6cLSf_a.d.mts +0 -146
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,146 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/json.d.ts
|
|
4
|
+
declare const PackageJsonSchema: z.ZodObject<{
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
version: z.ZodOptional<z.ZodString>;
|
|
7
|
+
private: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
type: z.ZodOptional<z.ZodString>;
|
|
9
|
+
scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
10
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11
|
+
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
12
|
+
peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
|
+
bin: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>;
|
|
14
|
+
exports: z.ZodOptional<z.ZodUnknown>;
|
|
15
|
+
main: z.ZodOptional<z.ZodString>;
|
|
16
|
+
types: z.ZodOptional<z.ZodString>;
|
|
17
|
+
typings: z.ZodOptional<z.ZodString>;
|
|
18
|
+
engines: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
19
|
+
devEngines: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
runtime: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
21
|
+
name: z.ZodString;
|
|
22
|
+
version: z.ZodOptional<z.ZodString>;
|
|
23
|
+
onFail: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$loose>, z.ZodArray<z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
version: z.ZodOptional<z.ZodString>;
|
|
27
|
+
onFail: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$loose>>]>>;
|
|
29
|
+
}, z.core.$loose>>;
|
|
30
|
+
repository: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
31
|
+
url: z.ZodString;
|
|
32
|
+
}, z.core.$loose>]>>;
|
|
33
|
+
packageManager: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$loose>;
|
|
35
|
+
type PackageJson = z.infer<typeof PackageJsonSchema>;
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/types.d.ts
|
|
38
|
+
type CiPlatform = "github" | "forgejo" | "none";
|
|
39
|
+
type ReleaseStrategy = "release-it" | "simple" | "changesets" | "none";
|
|
40
|
+
type Formatter = "oxfmt" | "prettier";
|
|
41
|
+
/** Whether the repo has TS/JS source at all. Never inferred from absence. */
|
|
42
|
+
type Stack = "typescript" | "javascript" | "none";
|
|
43
|
+
/** What compiles the project, if anything. */
|
|
44
|
+
type Builder = "tsdown" | "vite" | "custom" | "none";
|
|
45
|
+
/** User's answers from the interactive prompt or CLI flags. */
|
|
46
|
+
interface ProjectConfig {
|
|
47
|
+
/** Project name (from package.json name or user input) */
|
|
48
|
+
name: string;
|
|
49
|
+
/** Project structure */
|
|
50
|
+
structure: "single" | "monorepo";
|
|
51
|
+
/** Include @bensandee/eslint-plugin oxlint plugin */
|
|
52
|
+
useEslintPlugin: boolean;
|
|
53
|
+
/** Formatter choice */
|
|
54
|
+
formatter: Formatter;
|
|
55
|
+
/** Whether the repo has TS/JS source at all */
|
|
56
|
+
stack: Stack;
|
|
57
|
+
/** What compiles the project */
|
|
58
|
+
builder: Builder;
|
|
59
|
+
/** Set up vitest with a starter test */
|
|
60
|
+
setupVitest: boolean;
|
|
61
|
+
/** CI platform choice */
|
|
62
|
+
ci: CiPlatform;
|
|
63
|
+
/** Set up Renovate for automated dependency updates */
|
|
64
|
+
setupRenovate: boolean;
|
|
65
|
+
/** Release management strategy */
|
|
66
|
+
releaseStrategy: ReleaseStrategy;
|
|
67
|
+
/** Opt-in: publish packages to npm registry */
|
|
68
|
+
publishNpm: boolean;
|
|
69
|
+
/** Opt-in: publish Docker images to a registry */
|
|
70
|
+
publishDocker: boolean;
|
|
71
|
+
/** Project type determines tsconfig base configuration */
|
|
72
|
+
projectType: "default" | "node" | "react" | "library";
|
|
73
|
+
/** Auto-detect and configure tsconfig bases for monorepo packages */
|
|
74
|
+
detectPackageTypes: boolean;
|
|
75
|
+
/** Target directory (default: cwd) */
|
|
76
|
+
targetDir: string;
|
|
77
|
+
}
|
|
78
|
+
/** Result from a single generator: what file was written and how. */
|
|
79
|
+
interface GeneratorResult {
|
|
80
|
+
filePath: string;
|
|
81
|
+
action: "created" | "updated" | "skipped" | "archived" | "removed";
|
|
82
|
+
/** Human-readable description of what changed */
|
|
83
|
+
description: string;
|
|
84
|
+
}
|
|
85
|
+
/** Context passed to each generator function. */
|
|
86
|
+
interface GeneratorContext {
|
|
87
|
+
config: ProjectConfig;
|
|
88
|
+
/** Absolute path to target directory */
|
|
89
|
+
targetDir: string;
|
|
90
|
+
/** Pre-parsed package.json from the target directory, or undefined if missing/invalid */
|
|
91
|
+
packageJson: PackageJson | undefined;
|
|
92
|
+
/** Check whether a file exists in the target directory */
|
|
93
|
+
exists: (relativePath: string) => boolean;
|
|
94
|
+
/** Read an existing file from the target directory, returns undefined if not found */
|
|
95
|
+
read: (relativePath: string) => string | undefined;
|
|
96
|
+
/** Write a file to the target directory (creating directories as needed) */
|
|
97
|
+
write: (relativePath: string, content: string) => void;
|
|
98
|
+
/** Remove a file from the target directory (no-op if not found) */
|
|
99
|
+
remove: (relativePath: string) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Rewrite generated content the way the target repo's own formatter would — so a
|
|
102
|
+
* generated file is a fixed point of `pnpm format` and can't drift against
|
|
103
|
+
* `repo:sync --check`. Returns the content unchanged when the formatter isn't
|
|
104
|
+
* installed yet. See `utils/format.ts`.
|
|
105
|
+
*/
|
|
106
|
+
format: (relativePath: string, content: string) => string;
|
|
107
|
+
/** Prompt user for conflict resolution on non-mergeable files */
|
|
108
|
+
confirmOverwrite: (relativePath: string) => Promise<"overwrite" | "skip">;
|
|
109
|
+
}
|
|
110
|
+
/** Generator function signature. */
|
|
111
|
+
type Generator = (ctx: GeneratorContext) => Promise<GeneratorResult>;
|
|
112
|
+
/** State detected from an existing project directory. */
|
|
113
|
+
interface DetectedProjectState {
|
|
114
|
+
hasPackageJson: boolean;
|
|
115
|
+
hasTsconfig: boolean;
|
|
116
|
+
hasOxlintConfig: boolean;
|
|
117
|
+
/** Existing oxlint.config.ts already imports @bensandee/config/oxlint/recommended */
|
|
118
|
+
oxlintExtendsRecommended: boolean;
|
|
119
|
+
/** Legacy .oxlintrc.json found (should be migrated to oxlint.config.ts) */
|
|
120
|
+
hasLegacyOxlintJson: boolean;
|
|
121
|
+
hasGitignore: boolean;
|
|
122
|
+
hasVitestConfig: boolean;
|
|
123
|
+
hasTsdownConfig: boolean;
|
|
124
|
+
hasPnpmWorkspace: boolean;
|
|
125
|
+
hasKnipConfig: boolean;
|
|
126
|
+
hasRenovateConfig: boolean;
|
|
127
|
+
hasReleaseItConfig: boolean;
|
|
128
|
+
hasSimpleReleaseConfig: boolean;
|
|
129
|
+
hasChangesetsConfig: boolean;
|
|
130
|
+
/** Whether package.json has a repository field (needed for release workflows) */
|
|
131
|
+
hasRepositoryField: boolean;
|
|
132
|
+
/** Whether commit-and-tag-version is in root devDependencies (required for simple release strategy) */
|
|
133
|
+
hasCommitAndTagVersion: boolean;
|
|
134
|
+
/** Git remote origin URL (for inferring repository field) */
|
|
135
|
+
gitRemoteUrl: string | null;
|
|
136
|
+
/** Legacy tooling configs found */
|
|
137
|
+
legacyConfigs: LegacyConfig[];
|
|
138
|
+
}
|
|
139
|
+
declare const LEGACY_TOOLS: readonly ["eslint", "prettier", "jest", "webpack", "rollup"];
|
|
140
|
+
type LegacyTool = (typeof LEGACY_TOOLS)[number];
|
|
141
|
+
interface LegacyConfig {
|
|
142
|
+
tool: LegacyTool;
|
|
143
|
+
files: string[];
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
2
146
|
export type { DetectedProjectState, Generator, GeneratorContext, GeneratorResult, LegacyConfig, ProjectConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bensandee/tooling",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.0",
|
|
4
4
|
"description": "CLI tool to bootstrap and maintain standardized TypeScript project tooling",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,10 +25,6 @@
|
|
|
25
25
|
"default": "./dist/index.mjs"
|
|
26
26
|
},
|
|
27
27
|
"./bin": "./dist/bin.mjs",
|
|
28
|
-
"./docker-check": {
|
|
29
|
-
"types": "./dist/docker-check/index.d.mts",
|
|
30
|
-
"default": "./dist/docker-check/index.mjs"
|
|
31
|
-
},
|
|
32
28
|
"./package.json": "./package.json",
|
|
33
29
|
"./tooling.schema.json": "./tooling.schema.json"
|
|
34
30
|
},
|
|
@@ -56,7 +52,7 @@
|
|
|
56
52
|
"prettier": "3.8.4",
|
|
57
53
|
"release-it": "20.2.0",
|
|
58
54
|
"tsdown": "0.22.3",
|
|
59
|
-
"@bensandee/claude-hooks": "0.10.
|
|
55
|
+
"@bensandee/claude-hooks": "0.10.1"
|
|
60
56
|
},
|
|
61
57
|
"scripts": {
|
|
62
58
|
"build": "tsdown",
|
package/tooling.schema.json
CHANGED
|
@@ -83,6 +83,11 @@
|
|
|
83
83
|
"additionalProperties": {
|
|
84
84
|
"type": "string"
|
|
85
85
|
}
|
|
86
|
+
},
|
|
87
|
+
"imageName": {
|
|
88
|
+
"description": "Image name used for docker:build tags, docker:publish refs, and docker:check cross-referencing. Falls back to the derived name: the package.json name for the root package (npm scope stripped), or {root-name}-{package-name} for a monorepo package.",
|
|
89
|
+
"type": "string",
|
|
90
|
+
"minLength": 1
|
|
86
91
|
}
|
|
87
92
|
},
|
|
88
93
|
"additionalProperties": false
|
|
@@ -339,7 +344,7 @@
|
|
|
339
344
|
]
|
|
340
345
|
},
|
|
341
346
|
"dirs": {
|
|
342
|
-
"description": "Extra active doc dirs beyond convention (e.g. [\"docs/rfcs\"]). Each retires into its own
|
|
347
|
+
"description": "Extra active doc dirs beyond convention (e.g. [\"docs/rfcs\"]). Each retires into its own retired/ subdir.",
|
|
343
348
|
"type": "array",
|
|
344
349
|
"items": {
|
|
345
350
|
"type": "string"
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region src/release/types.d.ts
|
|
4
|
-
/** Result of executing a shell command. */
|
|
5
|
-
interface ExecResult {
|
|
6
|
-
stdout: string;
|
|
7
|
-
stderr: string;
|
|
8
|
-
exitCode: number;
|
|
9
|
-
}
|
|
10
|
-
/** Options for executing a shell command. */
|
|
11
|
-
interface ExecOptions {
|
|
12
|
-
cwd?: string;
|
|
13
|
-
env?: Record<string, string>;
|
|
14
|
-
/** Data to pass to the command via stdin. */
|
|
15
|
-
input?: string;
|
|
16
|
-
}
|
|
17
|
-
/** Shared command execution and HTTP fetch interface. */
|
|
18
|
-
interface BaseExecutor {
|
|
19
|
-
/** Run a command with arguments and return the result (stdout/stderr captured). */
|
|
20
|
-
exec(file: string, args: string[], options?: ExecOptions): ExecResult;
|
|
21
|
-
/** Run a command with arguments, streaming stdout/stderr to the console. */
|
|
22
|
-
execInherit(file: string, args: string[], options?: ExecOptions): void;
|
|
23
|
-
/** Perform an HTTP request (mirrors the global fetch signature). */
|
|
24
|
-
fetch(url: string, init?: RequestInit): Promise<Response>;
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/docker-check/types.d.ts
|
|
28
|
-
/** Abstraction over side effects for testability. */
|
|
29
|
-
interface DockerCheckExecutor extends BaseExecutor {
|
|
30
|
-
/** Get current time in ms (mockable clock). */
|
|
31
|
-
now(): number;
|
|
32
|
-
/** Sleep for the given duration (mockable delay). */
|
|
33
|
-
sleep(ms: number): Promise<void>;
|
|
34
|
-
/** Register a process signal handler. Returns a dispose function. */
|
|
35
|
-
onSignal(signal: NodeJS.Signals, handler: () => void): () => void;
|
|
36
|
-
/** Log a message to the console. */
|
|
37
|
-
log(message: string): void;
|
|
38
|
-
/** Log an error to the console. */
|
|
39
|
-
logError(message: string): void;
|
|
40
|
-
}
|
|
41
|
-
/** A single HTTP health check definition. */
|
|
42
|
-
interface HttpHealthCheck {
|
|
43
|
-
/** Human-readable name for logging (e.g. "API", "Frontend"). */
|
|
44
|
-
name: string;
|
|
45
|
-
/** URL to fetch. */
|
|
46
|
-
url: string;
|
|
47
|
-
/** Validate the response. Return true if healthy. */
|
|
48
|
-
validate: (response: Response) => Promise<boolean>;
|
|
49
|
-
}
|
|
50
|
-
/** Docker compose configuration. */
|
|
51
|
-
interface ComposeConfig {
|
|
52
|
-
/** Working directory for docker compose commands. */
|
|
53
|
-
cwd: string;
|
|
54
|
-
/** Compose files to use (e.g. ["docker-compose.yaml", "docker-compose.check.yaml"]). */
|
|
55
|
-
composeFiles: string[];
|
|
56
|
-
/**
|
|
57
|
-
* Project namespace passed to `docker compose --project-name`. Required so a
|
|
58
|
-
* check run cannot share a project (and thus its named volumes) with another
|
|
59
|
-
* stack on the same docker daemon. See `deriveProjectName()`.
|
|
60
|
-
*/
|
|
61
|
-
projectName: string;
|
|
62
|
-
/** Optional env file for compose. */
|
|
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>;
|
|
71
|
-
/** Service names to monitor for container-level health. */
|
|
72
|
-
services: string[];
|
|
73
|
-
}
|
|
74
|
-
/** Full docker check configuration. */
|
|
75
|
-
interface CheckConfig {
|
|
76
|
-
/** Docker compose settings. */
|
|
77
|
-
compose: ComposeConfig;
|
|
78
|
-
/** Optional build command to run before starting compose (e.g. ["pnpm", "image:build"]). */
|
|
79
|
-
buildCommand?: string[];
|
|
80
|
-
/** Working directory for the build command (defaults to compose.cwd). */
|
|
81
|
-
buildCwd?: string;
|
|
82
|
-
/** HTTP health checks to poll. All must pass for success. */
|
|
83
|
-
healthChecks: HttpHealthCheck[];
|
|
84
|
-
/** Optional smoketest command to run after all health checks pass (e.g. ["pnpm", "test:smoke"]). */
|
|
85
|
-
smoketest?: string[];
|
|
86
|
-
/** Working directory for the smoketest command (defaults to compose.cwd). */
|
|
87
|
-
smoketestCwd?: string;
|
|
88
|
-
/** Maximum time to wait for all checks to pass, in ms. Default: 120000. */
|
|
89
|
-
timeoutMs?: number;
|
|
90
|
-
/** Interval between polling attempts, in ms. Default: 5000. */
|
|
91
|
-
pollIntervalMs?: number;
|
|
92
|
-
/** If true, emit detailed debug logging. */
|
|
93
|
-
verbose?: boolean;
|
|
94
|
-
}
|
|
95
|
-
/** Result of the docker check run. */
|
|
96
|
-
type CheckResult = {
|
|
97
|
-
success: true;
|
|
98
|
-
elapsedMs: number;
|
|
99
|
-
} | {
|
|
100
|
-
success: false;
|
|
101
|
-
reason: "timeout" | "unhealthy-container" | "smoketest-failed" | "startup-failed" | "error";
|
|
102
|
-
message: string;
|
|
103
|
-
elapsedMs: number;
|
|
104
|
-
};
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region src/docker-check/executor.d.ts
|
|
107
|
-
/** Create an executor that runs real commands, fetches, and manages process signals. */
|
|
108
|
-
declare function createRealExecutor(): DockerCheckExecutor;
|
|
109
|
-
//#endregion
|
|
110
|
-
//#region src/docker-check/check.d.ts
|
|
111
|
-
/** Run the full Docker check lifecycle. */
|
|
112
|
-
declare function runDockerCheck(executor: DockerCheckExecutor, rawConfig: CheckConfig): Promise<CheckResult>;
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/docker-check/compose.d.ts
|
|
115
|
-
/** Zod schema for a single container entry from `docker compose ps --format json`. */
|
|
116
|
-
declare const ContainerInfoSchema: z.ZodObject<{
|
|
117
|
-
Service: z.ZodString;
|
|
118
|
-
Health: z.ZodString;
|
|
119
|
-
}, z.core.$strip>;
|
|
120
|
-
type ContainerInfo = z.infer<typeof ContainerInfoSchema>;
|
|
121
|
-
/** Build the `docker compose` base args from config. */
|
|
122
|
-
declare function composeArgs(config: ComposeConfig): string[];
|
|
123
|
-
/** Start the compose stack in detached mode. */
|
|
124
|
-
declare function composeUp(executor: DockerCheckExecutor, config: ComposeConfig): void;
|
|
125
|
-
/** Tear down the compose stack, removing volumes and orphans. Swallows errors. */
|
|
126
|
-
declare function composeDown(executor: DockerCheckExecutor, config: ComposeConfig): void;
|
|
127
|
-
/** Show logs for a specific service (or all services if not specified). Swallows errors. */
|
|
128
|
-
declare function composeLogs(executor: DockerCheckExecutor, config: ComposeConfig, service?: string): void;
|
|
129
|
-
/**
|
|
130
|
-
* Query container status via `docker compose ps --format json`.
|
|
131
|
-
* Handles both JSON array and newline-delimited JSON (varies by docker compose version).
|
|
132
|
-
*/
|
|
133
|
-
declare function composePs(executor: DockerCheckExecutor, config: ComposeConfig): ContainerInfo[];
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/docker-check/health.d.ts
|
|
136
|
-
/** Look up the health status of a specific service from container info. */
|
|
137
|
-
declare function getContainerHealth(containers: ContainerInfo[], serviceName: string): string;
|
|
138
|
-
/** Run a single HTTP health check, returning true if the validator passes. */
|
|
139
|
-
declare function checkHttpHealth(executor: DockerCheckExecutor, check: HttpHealthCheck): Promise<boolean>;
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region src/docker-check/project-name.d.ts
|
|
142
|
-
/**
|
|
143
|
-
* Derive the `docker compose --project-name` value for a check run.
|
|
144
|
-
*
|
|
145
|
-
* Always returns a unique, non-colliding namespace so a stray `compose down -v`
|
|
146
|
-
* during the check cannot target volumes belonging to a long-running stack
|
|
147
|
-
* sharing the same docker daemon (the failure mode that wiped prod volumes
|
|
148
|
-
* when a CI runner bind-mounted /var/run/docker.sock and the check overlay
|
|
149
|
-
* inherited the base file's `name:`).
|
|
150
|
-
*
|
|
151
|
-
* Format: `<sanitized-repo>-check-<suffix>` where suffix prefers a CI run id
|
|
152
|
-
* for traceability and falls back to `process.pid` locally so two concurrent
|
|
153
|
-
* `bst docker:check` invocations on the same machine don't collide.
|
|
154
|
-
*/
|
|
155
|
-
declare function deriveProjectName(repoName: string, env?: NodeJS.ProcessEnv): string;
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/utils/tooling-config.d.ts
|
|
158
|
-
declare const ToolingConfigSchema: z.ZodObject<{
|
|
159
|
-
$schema: z.ZodOptional<z.ZodString>;
|
|
160
|
-
structure: z.ZodOptional<z.ZodEnum<{
|
|
161
|
-
single: "single";
|
|
162
|
-
monorepo: "monorepo";
|
|
163
|
-
}>>;
|
|
164
|
-
useEslintPlugin: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
-
formatter: z.ZodOptional<z.ZodEnum<{
|
|
166
|
-
prettier: "prettier";
|
|
167
|
-
oxfmt: "oxfmt";
|
|
168
|
-
}>>;
|
|
169
|
-
setupVitest: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
-
ci: z.ZodOptional<z.ZodEnum<{
|
|
171
|
-
github: "github";
|
|
172
|
-
forgejo: "forgejo";
|
|
173
|
-
none: "none";
|
|
174
|
-
}>>;
|
|
175
|
-
setupRenovate: z.ZodOptional<z.ZodBoolean>;
|
|
176
|
-
releaseStrategy: z.ZodOptional<z.ZodEnum<{
|
|
177
|
-
none: "none";
|
|
178
|
-
"release-it": "release-it";
|
|
179
|
-
simple: "simple";
|
|
180
|
-
changesets: "changesets";
|
|
181
|
-
}>>;
|
|
182
|
-
publishNpm: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
-
publishDocker: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
-
projectType: z.ZodOptional<z.ZodEnum<{
|
|
185
|
-
default: "default";
|
|
186
|
-
node: "node";
|
|
187
|
-
react: "react";
|
|
188
|
-
library: "library";
|
|
189
|
-
}>>;
|
|
190
|
-
detectPackageTypes: z.ZodOptional<z.ZodBoolean>;
|
|
191
|
-
docker: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
192
|
-
dockerfile: z.ZodOptional<z.ZodString>;
|
|
193
|
-
context: z.ZodOptional<z.ZodString>;
|
|
194
|
-
buildArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
195
|
-
}, z.core.$strip>>>;
|
|
196
|
-
dockerCheck: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
197
|
-
composeFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
198
|
-
envFile: z.ZodOptional<z.ZodString>;
|
|
199
|
-
services: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
200
|
-
healthChecks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
201
|
-
name: z.ZodString;
|
|
202
|
-
url: z.ZodString;
|
|
203
|
-
status: z.ZodOptional<z.ZodNumber>;
|
|
204
|
-
}, z.core.$strip>>>;
|
|
205
|
-
buildCommand: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
206
|
-
buildCwd: z.ZodOptional<z.ZodString>;
|
|
207
|
-
smoketest: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
208
|
-
smoketestCwd: z.ZodOptional<z.ZodString>;
|
|
209
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
210
|
-
pollIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
211
|
-
}, z.core.$strip>]>>;
|
|
212
|
-
registryHost: z.ZodOptional<z.ZodString>;
|
|
213
|
-
registryNamespace: z.ZodOptional<z.ZodString>;
|
|
214
|
-
releaseAssets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
215
|
-
command: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
216
|
-
file: z.ZodString;
|
|
217
|
-
name: z.ZodOptional<z.ZodString>;
|
|
218
|
-
}, z.core.$strict>>>;
|
|
219
|
-
postReleaseHook: z.ZodOptional<z.ZodString>;
|
|
220
|
-
postReleaseHookSecrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
221
|
-
coverage: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
222
|
-
history: z.ZodOptional<z.ZodEnum<{
|
|
223
|
-
none: "none";
|
|
224
|
-
"orphan-branch": "orphan-branch";
|
|
225
|
-
}>>;
|
|
226
|
-
historyBranch: z.ZodOptional<z.ZodString>;
|
|
227
|
-
tolerancePp: z.ZodOptional<z.ZodNumber>;
|
|
228
|
-
gateOnPullRequests: z.ZodOptional<z.ZodBoolean>;
|
|
229
|
-
}, z.core.$strict>]>>;
|
|
230
|
-
health: z.ZodOptional<z.ZodObject<{
|
|
231
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
-
src: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
233
|
-
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
-
extensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
235
|
-
directoryFileLimit: z.ZodOptional<z.ZodNumber>;
|
|
236
|
-
fanInLimit: z.ZodOptional<z.ZodNumber>;
|
|
237
|
-
fanOutLimit: z.ZodOptional<z.ZodNumber>;
|
|
238
|
-
history: z.ZodOptional<z.ZodEnum<{
|
|
239
|
-
none: "none";
|
|
240
|
-
"orphan-branch": "orphan-branch";
|
|
241
|
-
}>>;
|
|
242
|
-
historyBranch: z.ZodOptional<z.ZodString>;
|
|
243
|
-
tolerance: z.ZodOptional<z.ZodNumber>;
|
|
244
|
-
}, z.core.$strip>>;
|
|
245
|
-
docs: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
246
|
-
enforced: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>;
|
|
247
|
-
dirs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
248
|
-
staleDays: z.ZodOptional<z.ZodNumber>;
|
|
249
|
-
staleEnforced: z.ZodOptional<z.ZodBoolean>;
|
|
250
|
-
}, z.core.$strict>]>>;
|
|
251
|
-
deploy: z.ZodOptional<z.ZodObject<{
|
|
252
|
-
dispatchRepo: z.ZodString;
|
|
253
|
-
stack: z.ZodOptional<z.ZodString>;
|
|
254
|
-
workflow: z.ZodOptional<z.ZodString>;
|
|
255
|
-
ref: z.ZodOptional<z.ZodString>;
|
|
256
|
-
}, z.core.$strict>>;
|
|
257
|
-
pnpmWorkspace: z.ZodOptional<z.ZodLiteral<false>>;
|
|
258
|
-
defaultBranch: z.ZodOptional<z.ZodString>;
|
|
259
|
-
unmanagedDevDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
-
stack: z.ZodOptional<z.ZodEnum<{
|
|
261
|
-
none: "none";
|
|
262
|
-
typescript: "typescript";
|
|
263
|
-
javascript: "javascript";
|
|
264
|
-
}>>;
|
|
265
|
-
builder: z.ZodOptional<z.ZodEnum<{
|
|
266
|
-
none: "none";
|
|
267
|
-
custom: "custom";
|
|
268
|
-
tsdown: "tsdown";
|
|
269
|
-
vite: "vite";
|
|
270
|
-
}>>;
|
|
271
|
-
checks: z.ZodOptional<z.ZodObject<{
|
|
272
|
-
add: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
273
|
-
skip: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
274
|
-
}, z.core.$strict>>;
|
|
275
|
-
}, z.core.$strict>;
|
|
276
|
-
type ToolingConfig = z.infer<typeof ToolingConfigSchema>;
|
|
277
|
-
//#endregion
|
|
278
|
-
//#region src/docker-check/compose-lint.d.ts
|
|
279
|
-
interface ComposeLintIssue {
|
|
280
|
-
kind: "missing-name" | "duplicate-name";
|
|
281
|
-
/** Repo-relative paths involved in this issue (1 for missing-name, 2+ for duplicate-name). */
|
|
282
|
-
files: string[];
|
|
283
|
-
/** Pre-rendered human-readable message ready for `log.error`. */
|
|
284
|
-
message: string;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Walk compose files in `targetDir` and report lint violations:
|
|
288
|
-
*
|
|
289
|
-
* - Rule A (`missing-name`): every override compose file must declare a
|
|
290
|
-
* top-level `name:` directive. Base files (docker-compose.yml etc.) are
|
|
291
|
-
* exempt — their default of dir-basename is fine — but overrides without
|
|
292
|
-
* `name:` silently inherit the base's project namespace, which is how a
|
|
293
|
-
* `compose down -v` against the check overlay wiped the prod-volume project.
|
|
294
|
-
* - Rule B (`duplicate-name`): no two compose files in a single dir may
|
|
295
|
-
* declare the same `name:`. Base files participate in collision detection.
|
|
296
|
-
*/
|
|
297
|
-
declare function lintComposeFiles(targetDir: string, config: ToolingConfig | undefined): ComposeLintIssue[];
|
|
298
|
-
//#endregion
|
|
299
|
-
export { type CheckConfig, type CheckResult, type ComposeConfig, type ComposeLintIssue, type ContainerInfo, type DockerCheckExecutor, type HttpHealthCheck, checkHttpHealth, composeArgs, composeDown, composeLogs, composePs, composeUp, createRealExecutor, deriveProjectName, getContainerHealth, lintComposeFiles, runDockerCheck };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as composeArgs, c as composePs, d 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-CNaAmafB.mjs";
|
|
2
|
-
export { checkHttpHealth, composeArgs, composeDown, composeLogs, composePs, composeUp, createRealExecutor, deriveProjectName, getContainerHealth, lintComposeFiles, runDockerCheck };
|