create-krispya 0.8.0 → 0.10.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 +28 -6
- package/dist/cli.cjs +1302 -1576
- package/dist/cli.d.cts +36 -0
- package/dist/cli.d.mts +36 -0
- package/dist/cli.d.ts +36 -0
- package/dist/cli.mjs +1326 -1600
- package/dist/index.cjs +52 -15
- package/dist/index.d.cts +81 -172
- package/dist/index.d.mts +81 -172
- package/dist/index.d.ts +81 -172
- package/dist/index.mjs +34 -1
- package/dist/{chunks/index.mjs → shared/create-krispya.DKKVmsqH.mjs} +1358 -741
- package/dist/{chunks/index.cjs → shared/create-krispya.DTHeUlq4.cjs} +1381 -754
- package/dist/shared/create-krispya.to8NBxeJ.d.cts +237 -0
- package/dist/shared/create-krispya.to8NBxeJ.d.mts +237 -0
- package/dist/shared/create-krispya.to8NBxeJ.d.ts +237 -0
- package/package.json +7 -3
package/dist/index.cjs
CHANGED
|
@@ -1,23 +1,60 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const workspace = require('./shared/create-krispya.DTHeUlq4.cjs');
|
|
4
4
|
require('fs/promises');
|
|
5
5
|
require('fs');
|
|
6
6
|
require('path');
|
|
7
7
|
require('chalk');
|
|
8
8
|
|
|
9
|
+
const emptyPlan = () => ({
|
|
10
|
+
files: {},
|
|
11
|
+
dependencies: {},
|
|
12
|
+
devDependencies: {},
|
|
13
|
+
peerDependencies: {},
|
|
14
|
+
scripts: {},
|
|
15
|
+
vscodeSettings: {},
|
|
16
|
+
vscodeExtensions: [],
|
|
17
|
+
injections: [],
|
|
18
|
+
replacements: [],
|
|
19
|
+
warnings: []
|
|
20
|
+
});
|
|
21
|
+
function mergePartialPlans(...plans) {
|
|
22
|
+
const merged = emptyPlan();
|
|
23
|
+
for (const plan of plans) {
|
|
24
|
+
if (plan == null) continue;
|
|
25
|
+
Object.assign(merged.files, plan.files);
|
|
26
|
+
Object.assign(merged.dependencies, plan.dependencies);
|
|
27
|
+
Object.assign(merged.devDependencies, plan.devDependencies);
|
|
28
|
+
Object.assign(merged.peerDependencies, plan.peerDependencies);
|
|
29
|
+
Object.assign(merged.scripts, plan.scripts);
|
|
30
|
+
Object.assign(merged.vscodeSettings, plan.vscodeSettings);
|
|
31
|
+
merged.vscodeExtensions.push(...plan.vscodeExtensions ?? []);
|
|
32
|
+
merged.injections.push(...plan.injections ?? []);
|
|
33
|
+
merged.replacements.push(...plan.replacements ?? []);
|
|
34
|
+
merged.warnings.push(...plan.warnings ?? []);
|
|
35
|
+
}
|
|
36
|
+
merged.vscodeExtensions = [...new Set(merged.vscodeExtensions)];
|
|
37
|
+
return merged;
|
|
38
|
+
}
|
|
9
39
|
|
|
10
|
-
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
40
|
+
exports.detectTooling = workspace.detectTooling;
|
|
41
|
+
exports.generateRandomName = workspace.generateRandomName;
|
|
42
|
+
exports.getBaseTemplate = workspace.getBaseTemplate;
|
|
43
|
+
exports.getLanguageFromTemplate = workspace.getLanguageFromTemplate;
|
|
44
|
+
exports.getLatestNodeVersion = workspace.getLatestNodeVersion;
|
|
45
|
+
exports.getLatestNpmCliVersion = workspace.getLatestNpmCliVersion;
|
|
46
|
+
exports.getLatestNpmMajorVersion = workspace.getLatestNpmMajorVersion;
|
|
47
|
+
exports.getLatestNpmVersion = workspace.getLatestNpmVersion;
|
|
48
|
+
exports.getLatestPnpmVersion = workspace.getLatestPnpmVersion;
|
|
49
|
+
exports.getLatestYarnVersion = workspace.getLatestYarnVersion;
|
|
50
|
+
exports.merge = workspace.merge;
|
|
51
|
+
exports.parseWorkspaceYamlContent = workspace.parseWorkspaceYamlContent;
|
|
52
|
+
exports.planProject = workspace.planProject;
|
|
53
|
+
exports.planWorkspace = workspace.planWorkspace;
|
|
54
|
+
exports.projectPlanInputToOptions = workspace.projectPlanInputToOptions;
|
|
55
|
+
exports.resolveProjectPlanInput = workspace.resolveProjectPlanInput;
|
|
56
|
+
exports.resolveWorkspacePlanInput = workspace.resolveWorkspacePlanInput;
|
|
57
|
+
exports.unique = workspace.unique;
|
|
58
|
+
exports.validatePackageName = workspace.validatePackageName;
|
|
59
|
+
exports.workspacePlanInputToMonorepoParams = workspace.workspacePlanInputToMonorepoParams;
|
|
60
|
+
exports.mergePartialPlans = mergePartialPlans;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,91 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
name: PackageManagerName;
|
|
8
|
-
version?: string;
|
|
9
|
-
};
|
|
10
|
-
type EngineName = string;
|
|
11
|
-
type EngineSpec = {
|
|
12
|
-
name: EngineName;
|
|
13
|
-
version?: string;
|
|
14
|
-
};
|
|
15
|
-
type PackageVersions = Record<string, string>;
|
|
16
|
-
type VersionRangePrefix = '^' | '~' | '';
|
|
17
|
-
type DependencyVersionOptions = {
|
|
18
|
-
prefix?: VersionRangePrefix;
|
|
19
|
-
version?: string;
|
|
20
|
-
};
|
|
21
|
-
type File = {
|
|
22
|
-
type: 'text';
|
|
23
|
-
content: string;
|
|
24
|
-
} | {
|
|
25
|
-
type: 'remote';
|
|
26
|
-
url: string;
|
|
1
|
+
import { F as FormatterMetaConfig, L as LinterMetaConfig, V as VirtualFileMap, C as CodeInjectionLocation, P as ProjectType, a as ConfigStrategy, E as EngineSpec, b as PackageVersions, c as Linter, d as Formatter, T as Testing, e as LibraryBundler, I as Ide, f as PackageManagerSpec, g as ProjectPlanInput, h as ProjectOptions, A as AiPlatform, W as WorkspacePlanInput } from './shared/create-krispya.to8NBxeJ.cjs';
|
|
2
|
+
export { i as AiAgentsMetaConfig, B as BaseTemplate, D as DependencyVersionOptions, j as EditorMetaConfig, k as EngineName, l as FeatureSelections, m as FileRenderer, n as LibraryBundlerMetaConfig, o as PackageManagerMetaConfig, p as PackageManagerName, q as PlanBuilder, r as PlanDreiOptions, s as PlanFiberOptions, t as PlanGithubPagesOptions, u as PlanHandleOptions, v as PlanKootaOptions, w as PlanLevaOptions, x as PlanOffscreenOptions, y as PlanPostprocessingOptions, z as PlanRapierOptions, G as PlanTriplexOptions, H as PlanUikitOptions, J as PlanViverseOptions, K as PlanXrOptions, M as PlanZustandOptions, N as ProjectMetaConfig, O as ProjectPlanContext, Q as Template, R as TestingMetaConfig, S as ToolConfig, U as TypeScriptMetaConfig, X as VersionRangePrefix, Y as VirtualFile, Z as WorkspacePlanContext, _ as getBaseTemplate, $ as getLanguageFromTemplate } from './shared/create-krispya.to8NBxeJ.cjs';
|
|
3
|
+
|
|
4
|
+
type MetaConfig = {
|
|
5
|
+
formatter: FormatterMetaConfig;
|
|
6
|
+
linter: LinterMetaConfig;
|
|
27
7
|
};
|
|
28
|
-
type
|
|
29
|
-
type Formatter = 'prettier' | 'oxfmt' | 'biome';
|
|
30
|
-
type Testing = 'vitest' | 'none';
|
|
31
|
-
type ConfigStrategy = 'stealth' | 'root';
|
|
32
|
-
type CodeInjectionLocation = 'vite-config-import' | 'import' | 'global-start' | 'global-end' | 'dom-start' | 'dom' | 'dom-end' | 'scene-start' | 'scene' | 'scene-end' | 'readme-start' | 'readme-end' | 'readme-libraries' | 'readme-tools' | 'readme-commands' | 'vscode-extension-suggestion' | 'vscode-setting';
|
|
33
|
-
type GenerateFiberOptions = {
|
|
34
|
-
/** @default true */
|
|
35
|
-
addExample?: boolean;
|
|
36
|
-
} | boolean;
|
|
37
|
-
type GenerateDreiOptions = {} | boolean;
|
|
38
|
-
type GenerateHandleOptions = {} | boolean;
|
|
39
|
-
type GenerateKootaOptions = {
|
|
40
|
-
/** @default true */
|
|
41
|
-
addExample?: boolean;
|
|
42
|
-
} | boolean;
|
|
43
|
-
type GenerateLevaOptions = {} | boolean;
|
|
44
|
-
type GenerateOffscreenOptions = {} | boolean;
|
|
45
|
-
type GeneratePostprocessingOptions = {} | boolean;
|
|
46
|
-
type GenerateRapierOptions = {} | boolean;
|
|
47
|
-
type GenerateTriplexOptions = {} | boolean;
|
|
48
|
-
type GenerateUikitOptions = {} | boolean;
|
|
49
|
-
type GenerateViverseOptions = {} | boolean;
|
|
50
|
-
type GenerateXrOptions = {
|
|
51
|
-
storeOptions?: unknown;
|
|
52
|
-
} | boolean;
|
|
53
|
-
type GenerateZustandOptions = {
|
|
54
|
-
/** @default true */
|
|
55
|
-
addExample?: boolean;
|
|
56
|
-
} | boolean;
|
|
57
|
-
type GenerateGithubPagesOptions = {} | boolean;
|
|
58
|
-
type AiPlatform = 'agents' | 'claude';
|
|
59
|
-
type GenerateOptions = {
|
|
60
|
-
githubUserName?: string;
|
|
61
|
-
githubRepoName?: string;
|
|
62
|
-
name: string;
|
|
63
|
-
projectType?: ProjectType;
|
|
64
|
-
libraryBundler?: LibraryBundler;
|
|
65
|
-
template?: Template;
|
|
8
|
+
type ToolSelections = {
|
|
66
9
|
linter?: Linter;
|
|
67
10
|
formatter?: Formatter;
|
|
68
11
|
testing?: Testing;
|
|
12
|
+
libraryBundler?: LibraryBundler;
|
|
13
|
+
ide?: Ide;
|
|
14
|
+
packageManager?: PackageManagerSpec;
|
|
15
|
+
};
|
|
16
|
+
type ProjectContext = {
|
|
17
|
+
name: string;
|
|
18
|
+
projectType?: ProjectType;
|
|
69
19
|
configStrategy?: ConfigStrategy;
|
|
70
|
-
|
|
71
|
-
aiPlatforms?: AiPlatform[];
|
|
20
|
+
engine?: EngineSpec;
|
|
72
21
|
versions?: PackageVersions;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
postprocessing?: GeneratePostprocessingOptions;
|
|
80
|
-
rapier?: GenerateRapierOptions;
|
|
81
|
-
triplex?: GenerateTriplexOptions;
|
|
82
|
-
viverse?: GenerateViverseOptions;
|
|
83
|
-
uikit?: GenerateUikitOptions;
|
|
84
|
-
xr?: GenerateXrOptions;
|
|
85
|
-
zustand?: GenerateZustandOptions;
|
|
86
|
-
githubPages?: GenerateGithubPagesOptions;
|
|
22
|
+
workspaceRoot?: string;
|
|
23
|
+
workspaceDependencies?: string[];
|
|
24
|
+
pnpmManageVersions?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type PartialPlan = {
|
|
27
|
+
files?: VirtualFileMap;
|
|
87
28
|
dependencies?: Record<string, string>;
|
|
88
|
-
|
|
29
|
+
devDependencies?: Record<string, string>;
|
|
30
|
+
peerDependencies?: Record<string, string>;
|
|
31
|
+
scripts?: Record<string, string>;
|
|
32
|
+
vscodeSettings?: Record<string, unknown>;
|
|
33
|
+
vscodeExtensions?: string[];
|
|
89
34
|
injections?: Array<{
|
|
90
35
|
location: CodeInjectionLocation;
|
|
91
36
|
code: string;
|
|
@@ -94,91 +39,33 @@ type GenerateOptions = {
|
|
|
94
39
|
search: string;
|
|
95
40
|
replace: string;
|
|
96
41
|
}>;
|
|
97
|
-
|
|
98
|
-
pnpmManageVersions?: boolean;
|
|
99
|
-
engine?: EngineSpec;
|
|
100
|
-
workspaceRoot?: string;
|
|
101
|
-
workspaceDependencies?: string[];
|
|
42
|
+
warnings?: string[];
|
|
102
43
|
};
|
|
103
|
-
type
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
44
|
+
type ProjectPlan = {
|
|
45
|
+
files: VirtualFileMap;
|
|
46
|
+
dependencies: Record<string, string>;
|
|
47
|
+
devDependencies: Record<string, string>;
|
|
48
|
+
peerDependencies: Record<string, string>;
|
|
49
|
+
scripts: Record<string, string>;
|
|
50
|
+
vscodeSettings: Record<string, unknown>;
|
|
51
|
+
vscodeExtensions: string[];
|
|
52
|
+
injections: Array<{
|
|
53
|
+
location: CodeInjectionLocation;
|
|
54
|
+
code: string;
|
|
55
|
+
}>;
|
|
56
|
+
replacements: Array<{
|
|
57
|
+
search: string;
|
|
58
|
+
replace: string;
|
|
59
|
+
}>;
|
|
60
|
+
warnings: string[];
|
|
118
61
|
};
|
|
119
|
-
declare function getLanguageFromTemplate(template: Template): 'javascript' | 'typescript';
|
|
120
|
-
declare function getBaseTemplate(template: Template): BaseTemplate;
|
|
121
62
|
|
|
122
|
-
|
|
123
|
-
* Fetches the latest version of an npm package from the registry
|
|
124
|
-
* @param packageName The name of the npm package
|
|
125
|
-
* @param fallback Fallback version if fetch fails
|
|
126
|
-
* @returns The latest version string (e.g., "1.0.0")
|
|
127
|
-
*/
|
|
128
|
-
declare function getLatestNpmVersion(packageName: string, fallback: string): Promise<string>;
|
|
129
|
-
/**
|
|
130
|
-
* Fetches the latest version of pnpm from the npm registry
|
|
131
|
-
* @returns The latest pnpm version string (e.g., "10.24.0")
|
|
132
|
-
*/
|
|
133
|
-
declare function getLatestPnpmVersion(): Promise<string>;
|
|
134
|
-
/**
|
|
135
|
-
* Fetches the latest version of yarn from the npm registry
|
|
136
|
-
* @returns The latest yarn version string (e.g., "4.6.0")
|
|
137
|
-
*/
|
|
138
|
-
declare function getLatestYarnVersion(): Promise<string>;
|
|
139
|
-
/**
|
|
140
|
-
* Fetches the latest version of npm from the npm registry
|
|
141
|
-
* @returns The latest npm version string (e.g., "11.0.0")
|
|
142
|
-
*/
|
|
143
|
-
declare function getLatestNpmCliVersion(): Promise<string>;
|
|
144
|
-
/**
|
|
145
|
-
* Fetches the latest stable version of Node.js
|
|
146
|
-
* @returns The latest Node.js version string (e.g., "25.1.0")
|
|
147
|
-
*/
|
|
148
|
-
declare function getLatestNodeVersion(): Promise<string>;
|
|
149
|
-
/**
|
|
150
|
-
* Validates a package name for use in a monorepo workspace.
|
|
151
|
-
* Returns an error message if invalid, undefined if valid.
|
|
152
|
-
*
|
|
153
|
-
* Rules:
|
|
154
|
-
* - Supports scoped names (@scope/name) or unscoped names
|
|
155
|
-
* - Must be lowercase
|
|
156
|
-
* - Only alphanumeric characters and hyphens allowed in each segment
|
|
157
|
-
* - Cannot start or end with a hyphen
|
|
158
|
-
* - Cannot contain path traversal sequences
|
|
159
|
-
* - Cannot be empty
|
|
160
|
-
*/
|
|
161
|
-
declare function validatePackageName(name: string): string | undefined;
|
|
162
|
-
/**
|
|
163
|
-
* Parses pnpm-workspace.yaml content to extract workspace directory names.
|
|
164
|
-
* Filters out hidden directories (starting with .).
|
|
165
|
-
*/
|
|
166
|
-
declare function parseWorkspaceYamlContent(content: string): string[];
|
|
63
|
+
declare function mergePartialPlans(...plans: Array<PartialPlan | undefined>): ProjectPlan;
|
|
167
64
|
|
|
168
|
-
type DetectedTooling = {
|
|
169
|
-
linter: Linter | undefined;
|
|
170
|
-
formatter: Formatter | undefined;
|
|
171
|
-
};
|
|
172
65
|
/**
|
|
173
|
-
*
|
|
174
|
-
* Priority: scripts → .config/ directories → devDependencies
|
|
175
|
-
*/
|
|
176
|
-
declare function detectTooling(root: string): Promise<DetectedTooling>;
|
|
177
|
-
/**
|
|
178
|
-
* Generates a random name in the format "adjective-noun"
|
|
179
|
-
* @returns A randomly generated name string
|
|
66
|
+
* Main generation function that creates all project files.
|
|
180
67
|
*/
|
|
181
|
-
declare function
|
|
68
|
+
declare function planProject(input: ProjectPlanInput | ProjectOptions): Promise<ProjectPlan>;
|
|
182
69
|
|
|
183
70
|
/**
|
|
184
71
|
* Parameters for generating a monorepo workspace.
|
|
@@ -197,24 +84,46 @@ type MonorepoParams = {
|
|
|
197
84
|
pnpmManageVersions?: boolean;
|
|
198
85
|
engine?: EngineSpec;
|
|
199
86
|
versions?: PackageVersions;
|
|
87
|
+
ide?: Ide;
|
|
200
88
|
/** AI platforms to generate files for */
|
|
201
89
|
aiPlatforms?: AiPlatform[];
|
|
202
90
|
};
|
|
203
|
-
|
|
204
|
-
|
|
91
|
+
|
|
92
|
+
declare function planWorkspace(input: MonorepoParams | WorkspacePlanInput): Promise<ProjectPlan>;
|
|
93
|
+
|
|
94
|
+
declare function resolveProjectPlanInput(options: ProjectOptions): ProjectPlanInput;
|
|
95
|
+
declare function projectPlanInputToOptions(input: ProjectPlanInput): ProjectOptions;
|
|
96
|
+
declare function resolveWorkspacePlanInput(params: MonorepoParams): WorkspacePlanInput;
|
|
97
|
+
declare function workspacePlanInputToMonorepoParams(input: WorkspacePlanInput): MonorepoParams;
|
|
98
|
+
|
|
99
|
+
declare function unique<T>(...array: T[][]): T[];
|
|
100
|
+
|
|
101
|
+
declare function merge(target: any, modification: any): any;
|
|
102
|
+
|
|
103
|
+
declare function validatePackageName(name: string): string | undefined;
|
|
104
|
+
|
|
105
|
+
declare function generateRandomName(): string;
|
|
106
|
+
|
|
107
|
+
type DetectedTooling = {
|
|
108
|
+
linter: Linter | undefined;
|
|
109
|
+
formatter: Formatter | undefined;
|
|
205
110
|
};
|
|
111
|
+
declare function detectTooling(root: string): Promise<DetectedTooling>;
|
|
112
|
+
|
|
206
113
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* Note: Monorepos are currently pnpm-only. Detection relies on pnpm-workspace.yaml.
|
|
210
|
-
* TODO: Support yarn and npm workspaces in the future.
|
|
114
|
+
* Fetches the latest version of an npm package from the registry.
|
|
211
115
|
*/
|
|
212
|
-
declare function
|
|
213
|
-
|
|
116
|
+
declare function getLatestNpmVersion(packageName: string, fallback: string): Promise<string>;
|
|
214
117
|
/**
|
|
215
|
-
*
|
|
118
|
+
* Fetches the latest npm version within a specific major version.
|
|
216
119
|
*/
|
|
217
|
-
declare function
|
|
120
|
+
declare function getLatestNpmMajorVersion(packageName: string, majorVersion: string, fallback: string): Promise<string>;
|
|
121
|
+
declare function getLatestPnpmVersion(): Promise<string>;
|
|
122
|
+
declare function getLatestYarnVersion(): Promise<string>;
|
|
123
|
+
declare function getLatestNpmCliVersion(): Promise<string>;
|
|
124
|
+
declare function getLatestNodeVersion(): Promise<string>;
|
|
125
|
+
|
|
126
|
+
declare function parseWorkspaceYamlContent(content: string): string[];
|
|
218
127
|
|
|
219
|
-
export {
|
|
220
|
-
export type {
|
|
128
|
+
export { AiPlatform, CodeInjectionLocation, ConfigStrategy, EngineSpec, Formatter, FormatterMetaConfig, Ide, LibraryBundler, Linter, LinterMetaConfig, PackageManagerSpec, PackageVersions, ProjectOptions, ProjectPlanInput, ProjectType, Testing, VirtualFileMap, WorkspacePlanInput, detectTooling, generateRandomName, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmMajorVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, merge, mergePartialPlans, parseWorkspaceYamlContent, planProject, planWorkspace, projectPlanInputToOptions, resolveProjectPlanInput, resolveWorkspacePlanInput, unique, validatePackageName, workspacePlanInputToMonorepoParams };
|
|
129
|
+
export type { DetectedTooling, MetaConfig, PartialPlan, ProjectContext, ProjectPlan, ToolSelections };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,91 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
name: PackageManagerName;
|
|
8
|
-
version?: string;
|
|
9
|
-
};
|
|
10
|
-
type EngineName = string;
|
|
11
|
-
type EngineSpec = {
|
|
12
|
-
name: EngineName;
|
|
13
|
-
version?: string;
|
|
14
|
-
};
|
|
15
|
-
type PackageVersions = Record<string, string>;
|
|
16
|
-
type VersionRangePrefix = '^' | '~' | '';
|
|
17
|
-
type DependencyVersionOptions = {
|
|
18
|
-
prefix?: VersionRangePrefix;
|
|
19
|
-
version?: string;
|
|
20
|
-
};
|
|
21
|
-
type File = {
|
|
22
|
-
type: 'text';
|
|
23
|
-
content: string;
|
|
24
|
-
} | {
|
|
25
|
-
type: 'remote';
|
|
26
|
-
url: string;
|
|
1
|
+
import { F as FormatterMetaConfig, L as LinterMetaConfig, V as VirtualFileMap, C as CodeInjectionLocation, P as ProjectType, a as ConfigStrategy, E as EngineSpec, b as PackageVersions, c as Linter, d as Formatter, T as Testing, e as LibraryBundler, I as Ide, f as PackageManagerSpec, g as ProjectPlanInput, h as ProjectOptions, A as AiPlatform, W as WorkspacePlanInput } from './shared/create-krispya.to8NBxeJ.mjs';
|
|
2
|
+
export { i as AiAgentsMetaConfig, B as BaseTemplate, D as DependencyVersionOptions, j as EditorMetaConfig, k as EngineName, l as FeatureSelections, m as FileRenderer, n as LibraryBundlerMetaConfig, o as PackageManagerMetaConfig, p as PackageManagerName, q as PlanBuilder, r as PlanDreiOptions, s as PlanFiberOptions, t as PlanGithubPagesOptions, u as PlanHandleOptions, v as PlanKootaOptions, w as PlanLevaOptions, x as PlanOffscreenOptions, y as PlanPostprocessingOptions, z as PlanRapierOptions, G as PlanTriplexOptions, H as PlanUikitOptions, J as PlanViverseOptions, K as PlanXrOptions, M as PlanZustandOptions, N as ProjectMetaConfig, O as ProjectPlanContext, Q as Template, R as TestingMetaConfig, S as ToolConfig, U as TypeScriptMetaConfig, X as VersionRangePrefix, Y as VirtualFile, Z as WorkspacePlanContext, _ as getBaseTemplate, $ as getLanguageFromTemplate } from './shared/create-krispya.to8NBxeJ.mjs';
|
|
3
|
+
|
|
4
|
+
type MetaConfig = {
|
|
5
|
+
formatter: FormatterMetaConfig;
|
|
6
|
+
linter: LinterMetaConfig;
|
|
27
7
|
};
|
|
28
|
-
type
|
|
29
|
-
type Formatter = 'prettier' | 'oxfmt' | 'biome';
|
|
30
|
-
type Testing = 'vitest' | 'none';
|
|
31
|
-
type ConfigStrategy = 'stealth' | 'root';
|
|
32
|
-
type CodeInjectionLocation = 'vite-config-import' | 'import' | 'global-start' | 'global-end' | 'dom-start' | 'dom' | 'dom-end' | 'scene-start' | 'scene' | 'scene-end' | 'readme-start' | 'readme-end' | 'readme-libraries' | 'readme-tools' | 'readme-commands' | 'vscode-extension-suggestion' | 'vscode-setting';
|
|
33
|
-
type GenerateFiberOptions = {
|
|
34
|
-
/** @default true */
|
|
35
|
-
addExample?: boolean;
|
|
36
|
-
} | boolean;
|
|
37
|
-
type GenerateDreiOptions = {} | boolean;
|
|
38
|
-
type GenerateHandleOptions = {} | boolean;
|
|
39
|
-
type GenerateKootaOptions = {
|
|
40
|
-
/** @default true */
|
|
41
|
-
addExample?: boolean;
|
|
42
|
-
} | boolean;
|
|
43
|
-
type GenerateLevaOptions = {} | boolean;
|
|
44
|
-
type GenerateOffscreenOptions = {} | boolean;
|
|
45
|
-
type GeneratePostprocessingOptions = {} | boolean;
|
|
46
|
-
type GenerateRapierOptions = {} | boolean;
|
|
47
|
-
type GenerateTriplexOptions = {} | boolean;
|
|
48
|
-
type GenerateUikitOptions = {} | boolean;
|
|
49
|
-
type GenerateViverseOptions = {} | boolean;
|
|
50
|
-
type GenerateXrOptions = {
|
|
51
|
-
storeOptions?: unknown;
|
|
52
|
-
} | boolean;
|
|
53
|
-
type GenerateZustandOptions = {
|
|
54
|
-
/** @default true */
|
|
55
|
-
addExample?: boolean;
|
|
56
|
-
} | boolean;
|
|
57
|
-
type GenerateGithubPagesOptions = {} | boolean;
|
|
58
|
-
type AiPlatform = 'agents' | 'claude';
|
|
59
|
-
type GenerateOptions = {
|
|
60
|
-
githubUserName?: string;
|
|
61
|
-
githubRepoName?: string;
|
|
62
|
-
name: string;
|
|
63
|
-
projectType?: ProjectType;
|
|
64
|
-
libraryBundler?: LibraryBundler;
|
|
65
|
-
template?: Template;
|
|
8
|
+
type ToolSelections = {
|
|
66
9
|
linter?: Linter;
|
|
67
10
|
formatter?: Formatter;
|
|
68
11
|
testing?: Testing;
|
|
12
|
+
libraryBundler?: LibraryBundler;
|
|
13
|
+
ide?: Ide;
|
|
14
|
+
packageManager?: PackageManagerSpec;
|
|
15
|
+
};
|
|
16
|
+
type ProjectContext = {
|
|
17
|
+
name: string;
|
|
18
|
+
projectType?: ProjectType;
|
|
69
19
|
configStrategy?: ConfigStrategy;
|
|
70
|
-
|
|
71
|
-
aiPlatforms?: AiPlatform[];
|
|
20
|
+
engine?: EngineSpec;
|
|
72
21
|
versions?: PackageVersions;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
postprocessing?: GeneratePostprocessingOptions;
|
|
80
|
-
rapier?: GenerateRapierOptions;
|
|
81
|
-
triplex?: GenerateTriplexOptions;
|
|
82
|
-
viverse?: GenerateViverseOptions;
|
|
83
|
-
uikit?: GenerateUikitOptions;
|
|
84
|
-
xr?: GenerateXrOptions;
|
|
85
|
-
zustand?: GenerateZustandOptions;
|
|
86
|
-
githubPages?: GenerateGithubPagesOptions;
|
|
22
|
+
workspaceRoot?: string;
|
|
23
|
+
workspaceDependencies?: string[];
|
|
24
|
+
pnpmManageVersions?: boolean;
|
|
25
|
+
};
|
|
26
|
+
type PartialPlan = {
|
|
27
|
+
files?: VirtualFileMap;
|
|
87
28
|
dependencies?: Record<string, string>;
|
|
88
|
-
|
|
29
|
+
devDependencies?: Record<string, string>;
|
|
30
|
+
peerDependencies?: Record<string, string>;
|
|
31
|
+
scripts?: Record<string, string>;
|
|
32
|
+
vscodeSettings?: Record<string, unknown>;
|
|
33
|
+
vscodeExtensions?: string[];
|
|
89
34
|
injections?: Array<{
|
|
90
35
|
location: CodeInjectionLocation;
|
|
91
36
|
code: string;
|
|
@@ -94,91 +39,33 @@ type GenerateOptions = {
|
|
|
94
39
|
search: string;
|
|
95
40
|
replace: string;
|
|
96
41
|
}>;
|
|
97
|
-
|
|
98
|
-
pnpmManageVersions?: boolean;
|
|
99
|
-
engine?: EngineSpec;
|
|
100
|
-
workspaceRoot?: string;
|
|
101
|
-
workspaceDependencies?: string[];
|
|
42
|
+
warnings?: string[];
|
|
102
43
|
};
|
|
103
|
-
type
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
44
|
+
type ProjectPlan = {
|
|
45
|
+
files: VirtualFileMap;
|
|
46
|
+
dependencies: Record<string, string>;
|
|
47
|
+
devDependencies: Record<string, string>;
|
|
48
|
+
peerDependencies: Record<string, string>;
|
|
49
|
+
scripts: Record<string, string>;
|
|
50
|
+
vscodeSettings: Record<string, unknown>;
|
|
51
|
+
vscodeExtensions: string[];
|
|
52
|
+
injections: Array<{
|
|
53
|
+
location: CodeInjectionLocation;
|
|
54
|
+
code: string;
|
|
55
|
+
}>;
|
|
56
|
+
replacements: Array<{
|
|
57
|
+
search: string;
|
|
58
|
+
replace: string;
|
|
59
|
+
}>;
|
|
60
|
+
warnings: string[];
|
|
118
61
|
};
|
|
119
|
-
declare function getLanguageFromTemplate(template: Template): 'javascript' | 'typescript';
|
|
120
|
-
declare function getBaseTemplate(template: Template): BaseTemplate;
|
|
121
62
|
|
|
122
|
-
|
|
123
|
-
* Fetches the latest version of an npm package from the registry
|
|
124
|
-
* @param packageName The name of the npm package
|
|
125
|
-
* @param fallback Fallback version if fetch fails
|
|
126
|
-
* @returns The latest version string (e.g., "1.0.0")
|
|
127
|
-
*/
|
|
128
|
-
declare function getLatestNpmVersion(packageName: string, fallback: string): Promise<string>;
|
|
129
|
-
/**
|
|
130
|
-
* Fetches the latest version of pnpm from the npm registry
|
|
131
|
-
* @returns The latest pnpm version string (e.g., "10.24.0")
|
|
132
|
-
*/
|
|
133
|
-
declare function getLatestPnpmVersion(): Promise<string>;
|
|
134
|
-
/**
|
|
135
|
-
* Fetches the latest version of yarn from the npm registry
|
|
136
|
-
* @returns The latest yarn version string (e.g., "4.6.0")
|
|
137
|
-
*/
|
|
138
|
-
declare function getLatestYarnVersion(): Promise<string>;
|
|
139
|
-
/**
|
|
140
|
-
* Fetches the latest version of npm from the npm registry
|
|
141
|
-
* @returns The latest npm version string (e.g., "11.0.0")
|
|
142
|
-
*/
|
|
143
|
-
declare function getLatestNpmCliVersion(): Promise<string>;
|
|
144
|
-
/**
|
|
145
|
-
* Fetches the latest stable version of Node.js
|
|
146
|
-
* @returns The latest Node.js version string (e.g., "25.1.0")
|
|
147
|
-
*/
|
|
148
|
-
declare function getLatestNodeVersion(): Promise<string>;
|
|
149
|
-
/**
|
|
150
|
-
* Validates a package name for use in a monorepo workspace.
|
|
151
|
-
* Returns an error message if invalid, undefined if valid.
|
|
152
|
-
*
|
|
153
|
-
* Rules:
|
|
154
|
-
* - Supports scoped names (@scope/name) or unscoped names
|
|
155
|
-
* - Must be lowercase
|
|
156
|
-
* - Only alphanumeric characters and hyphens allowed in each segment
|
|
157
|
-
* - Cannot start or end with a hyphen
|
|
158
|
-
* - Cannot contain path traversal sequences
|
|
159
|
-
* - Cannot be empty
|
|
160
|
-
*/
|
|
161
|
-
declare function validatePackageName(name: string): string | undefined;
|
|
162
|
-
/**
|
|
163
|
-
* Parses pnpm-workspace.yaml content to extract workspace directory names.
|
|
164
|
-
* Filters out hidden directories (starting with .).
|
|
165
|
-
*/
|
|
166
|
-
declare function parseWorkspaceYamlContent(content: string): string[];
|
|
63
|
+
declare function mergePartialPlans(...plans: Array<PartialPlan | undefined>): ProjectPlan;
|
|
167
64
|
|
|
168
|
-
type DetectedTooling = {
|
|
169
|
-
linter: Linter | undefined;
|
|
170
|
-
formatter: Formatter | undefined;
|
|
171
|
-
};
|
|
172
65
|
/**
|
|
173
|
-
*
|
|
174
|
-
* Priority: scripts → .config/ directories → devDependencies
|
|
175
|
-
*/
|
|
176
|
-
declare function detectTooling(root: string): Promise<DetectedTooling>;
|
|
177
|
-
/**
|
|
178
|
-
* Generates a random name in the format "adjective-noun"
|
|
179
|
-
* @returns A randomly generated name string
|
|
66
|
+
* Main generation function that creates all project files.
|
|
180
67
|
*/
|
|
181
|
-
declare function
|
|
68
|
+
declare function planProject(input: ProjectPlanInput | ProjectOptions): Promise<ProjectPlan>;
|
|
182
69
|
|
|
183
70
|
/**
|
|
184
71
|
* Parameters for generating a monorepo workspace.
|
|
@@ -197,24 +84,46 @@ type MonorepoParams = {
|
|
|
197
84
|
pnpmManageVersions?: boolean;
|
|
198
85
|
engine?: EngineSpec;
|
|
199
86
|
versions?: PackageVersions;
|
|
87
|
+
ide?: Ide;
|
|
200
88
|
/** AI platforms to generate files for */
|
|
201
89
|
aiPlatforms?: AiPlatform[];
|
|
202
90
|
};
|
|
203
|
-
|
|
204
|
-
|
|
91
|
+
|
|
92
|
+
declare function planWorkspace(input: MonorepoParams | WorkspacePlanInput): Promise<ProjectPlan>;
|
|
93
|
+
|
|
94
|
+
declare function resolveProjectPlanInput(options: ProjectOptions): ProjectPlanInput;
|
|
95
|
+
declare function projectPlanInputToOptions(input: ProjectPlanInput): ProjectOptions;
|
|
96
|
+
declare function resolveWorkspacePlanInput(params: MonorepoParams): WorkspacePlanInput;
|
|
97
|
+
declare function workspacePlanInputToMonorepoParams(input: WorkspacePlanInput): MonorepoParams;
|
|
98
|
+
|
|
99
|
+
declare function unique<T>(...array: T[][]): T[];
|
|
100
|
+
|
|
101
|
+
declare function merge(target: any, modification: any): any;
|
|
102
|
+
|
|
103
|
+
declare function validatePackageName(name: string): string | undefined;
|
|
104
|
+
|
|
105
|
+
declare function generateRandomName(): string;
|
|
106
|
+
|
|
107
|
+
type DetectedTooling = {
|
|
108
|
+
linter: Linter | undefined;
|
|
109
|
+
formatter: Formatter | undefined;
|
|
205
110
|
};
|
|
111
|
+
declare function detectTooling(root: string): Promise<DetectedTooling>;
|
|
112
|
+
|
|
206
113
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* Note: Monorepos are currently pnpm-only. Detection relies on pnpm-workspace.yaml.
|
|
210
|
-
* TODO: Support yarn and npm workspaces in the future.
|
|
114
|
+
* Fetches the latest version of an npm package from the registry.
|
|
211
115
|
*/
|
|
212
|
-
declare function
|
|
213
|
-
|
|
116
|
+
declare function getLatestNpmVersion(packageName: string, fallback: string): Promise<string>;
|
|
214
117
|
/**
|
|
215
|
-
*
|
|
118
|
+
* Fetches the latest npm version within a specific major version.
|
|
216
119
|
*/
|
|
217
|
-
declare function
|
|
120
|
+
declare function getLatestNpmMajorVersion(packageName: string, majorVersion: string, fallback: string): Promise<string>;
|
|
121
|
+
declare function getLatestPnpmVersion(): Promise<string>;
|
|
122
|
+
declare function getLatestYarnVersion(): Promise<string>;
|
|
123
|
+
declare function getLatestNpmCliVersion(): Promise<string>;
|
|
124
|
+
declare function getLatestNodeVersion(): Promise<string>;
|
|
125
|
+
|
|
126
|
+
declare function parseWorkspaceYamlContent(content: string): string[];
|
|
218
127
|
|
|
219
|
-
export {
|
|
220
|
-
export type {
|
|
128
|
+
export { AiPlatform, CodeInjectionLocation, ConfigStrategy, EngineSpec, Formatter, FormatterMetaConfig, Ide, LibraryBundler, Linter, LinterMetaConfig, PackageManagerSpec, PackageVersions, ProjectOptions, ProjectPlanInput, ProjectType, Testing, VirtualFileMap, WorkspacePlanInput, detectTooling, generateRandomName, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmMajorVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, merge, mergePartialPlans, parseWorkspaceYamlContent, planProject, planWorkspace, projectPlanInputToOptions, resolveProjectPlanInput, resolveWorkspacePlanInput, unique, validatePackageName, workspacePlanInputToMonorepoParams };
|
|
129
|
+
export type { DetectedTooling, MetaConfig, PartialPlan, ProjectContext, ProjectPlan, ToolSelections };
|