@bensandee/tooling 0.65.0 → 0.67.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/dist/bin.mjs +1204 -292
- package/dist/index.d.mts +145 -1
- package/package.json +2 -6
- package/tooling.schema.json +5 -0
- package/dist/docker-check/index.d.mts +0 -299
- package/dist/docker-check/index.mjs +0 -2
- package/dist/project-name-CnyTIy5a.mjs +0 -586
- package/dist/types-C6cLSf_a.d.mts +0 -146
|
@@ -1,146 +0,0 @@
|
|
|
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
|
|
146
|
-
export { LegacyConfig as a, GeneratorResult as i, Generator as n, ProjectConfig as o, GeneratorContext as r, DetectedProjectState as t };
|