create-krispya 0.5.0 → 0.5.2

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/index.cjs CHANGED
@@ -11,5 +11,9 @@ exports.generateRandomName = index.generateRandomName;
11
11
  exports.getBaseTemplate = index.getBaseTemplate;
12
12
  exports.getLanguageFromTemplate = index.getLanguageFromTemplate;
13
13
  exports.getLatestNodeVersion = index.getLatestNodeVersion;
14
+ exports.getLatestNpmCliVersion = index.getLatestNpmCliVersion;
14
15
  exports.getLatestNpmVersion = index.getLatestNpmVersion;
15
16
  exports.getLatestPnpmVersion = index.getLatestPnpmVersion;
17
+ exports.getLatestYarnVersion = index.getLatestYarnVersion;
18
+ exports.parseWorkspaceYamlContent = index.parseWorkspaceYamlContent;
19
+ exports.validatePackageName = index.validatePackageName;
package/dist/index.d.cts CHANGED
@@ -85,8 +85,11 @@ type GenerateOptions = {
85
85
  packageManager?: string;
86
86
  pnpmVersion?: string;
87
87
  pnpmManageVersions?: boolean;
88
+ yarnVersion?: string;
89
+ npmVersion?: string;
88
90
  nodeVersion?: string;
89
91
  workspaceRoot?: string;
92
+ workspaceDependencies?: string[];
90
93
  };
91
94
  type Generator = {
92
95
  get options(): GenerateOptions;
@@ -115,31 +118,74 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
115
118
  * @returns The latest pnpm version string (e.g., "10.24.0")
116
119
  */
117
120
  declare function getLatestPnpmVersion(): Promise<string>;
121
+ /**
122
+ * Fetches the latest version of yarn from the npm registry
123
+ * @returns The latest yarn version string (e.g., "4.6.0")
124
+ */
125
+ declare function getLatestYarnVersion(): Promise<string>;
126
+ /**
127
+ * Fetches the latest version of npm from the npm registry
128
+ * @returns The latest npm version string (e.g., "11.0.0")
129
+ */
130
+ declare function getLatestNpmCliVersion(): Promise<string>;
118
131
  /**
119
132
  * Fetches the latest LTS version of Node.js
120
133
  * @returns The latest Node.js LTS version string (e.g., "22.13.0")
121
134
  */
122
135
  declare function getLatestNodeVersion(): Promise<string>;
136
+ /**
137
+ * Validates a package name for use in a monorepo workspace.
138
+ * Returns an error message if invalid, undefined if valid.
139
+ *
140
+ * Rules:
141
+ * - Supports scoped names (@scope/name) or unscoped names
142
+ * - Must be lowercase
143
+ * - Only alphanumeric characters and hyphens allowed in each segment
144
+ * - Cannot start or end with a hyphen
145
+ * - Cannot contain path traversal sequences
146
+ * - Cannot be empty
147
+ */
148
+ declare function validatePackageName(name: string): string | undefined;
149
+ /**
150
+ * Parses pnpm-workspace.yaml content to extract workspace directory names.
151
+ * Filters out hidden directories (starting with .).
152
+ */
153
+ declare function parseWorkspaceYamlContent(content: string): string[];
123
154
  /**
124
155
  * Generates a random name in the format "adjective-noun"
125
156
  * @returns A randomly generated name string
126
157
  */
127
158
  declare function generateRandomName(): string;
128
159
 
160
+ type AiFileChoice = "cursor-rules" | "agents-md" | "claude-md" | "copilot-md";
161
+
162
+ /**
163
+ * Parameters for generating a monorepo workspace.
164
+ *
165
+ * Note: Monorepos are currently pnpm-only. We use pnpm workspaces for
166
+ * dependency management and the .config/* pattern for shared configs.
167
+ *
168
+ * TODO: Support yarn and npm workspaces in the future.
169
+ */
129
170
  type MonorepoParams = {
130
171
  name: string;
131
172
  linter: Linter;
132
173
  formatter: Formatter;
174
+ /** Currently always "pnpm" - monorepos are pnpm-only */
133
175
  packageManager: string;
134
176
  pnpmVersion?: string;
135
177
  pnpmManageVersions?: boolean;
136
178
  nodeVersion?: string;
179
+ aiFiles?: AiFileChoice[];
137
180
  };
138
181
  type MonorepoResult = {
139
182
  files: Record<string, File>;
140
183
  };
141
184
  /**
142
185
  * Generates a monorepo workspace root structure with shared config packages.
186
+ *
187
+ * Note: Monorepos are currently pnpm-only. Detection relies on pnpm-workspace.yaml.
188
+ * TODO: Support yarn and npm workspaces in the future.
143
189
  */
144
190
  declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
145
191
 
@@ -148,5 +194,5 @@ declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
148
194
  */
149
195
  declare function generate(options: GenerateOptions): Record<string, File>;
150
196
 
151
- export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmVersion, getLatestPnpmVersion };
197
+ export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, parseWorkspaceYamlContent, validatePackageName };
152
198
  export type { BaseTemplate, CodeInjectionLocation, File, Formatter, GenerateDreiOptions, GenerateFiberOptions, GenerateGithubPagesOptions, GenerateHandleOptions, GenerateKootaOptions, GenerateLevaOptions, GenerateOffscreenOptions, GenerateOptions, GeneratePostprocessingOptions, GenerateRapierOptions, GenerateTriplexOptions, GenerateUikitOptions, GenerateViverseOptions, GenerateXrOptions, GenerateZustandOptions, Generator, LibraryBundler, Linter, PackageVersions, ProjectType, Template, Testing };
package/dist/index.d.mts CHANGED
@@ -85,8 +85,11 @@ type GenerateOptions = {
85
85
  packageManager?: string;
86
86
  pnpmVersion?: string;
87
87
  pnpmManageVersions?: boolean;
88
+ yarnVersion?: string;
89
+ npmVersion?: string;
88
90
  nodeVersion?: string;
89
91
  workspaceRoot?: string;
92
+ workspaceDependencies?: string[];
90
93
  };
91
94
  type Generator = {
92
95
  get options(): GenerateOptions;
@@ -115,31 +118,74 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
115
118
  * @returns The latest pnpm version string (e.g., "10.24.0")
116
119
  */
117
120
  declare function getLatestPnpmVersion(): Promise<string>;
121
+ /**
122
+ * Fetches the latest version of yarn from the npm registry
123
+ * @returns The latest yarn version string (e.g., "4.6.0")
124
+ */
125
+ declare function getLatestYarnVersion(): Promise<string>;
126
+ /**
127
+ * Fetches the latest version of npm from the npm registry
128
+ * @returns The latest npm version string (e.g., "11.0.0")
129
+ */
130
+ declare function getLatestNpmCliVersion(): Promise<string>;
118
131
  /**
119
132
  * Fetches the latest LTS version of Node.js
120
133
  * @returns The latest Node.js LTS version string (e.g., "22.13.0")
121
134
  */
122
135
  declare function getLatestNodeVersion(): Promise<string>;
136
+ /**
137
+ * Validates a package name for use in a monorepo workspace.
138
+ * Returns an error message if invalid, undefined if valid.
139
+ *
140
+ * Rules:
141
+ * - Supports scoped names (@scope/name) or unscoped names
142
+ * - Must be lowercase
143
+ * - Only alphanumeric characters and hyphens allowed in each segment
144
+ * - Cannot start or end with a hyphen
145
+ * - Cannot contain path traversal sequences
146
+ * - Cannot be empty
147
+ */
148
+ declare function validatePackageName(name: string): string | undefined;
149
+ /**
150
+ * Parses pnpm-workspace.yaml content to extract workspace directory names.
151
+ * Filters out hidden directories (starting with .).
152
+ */
153
+ declare function parseWorkspaceYamlContent(content: string): string[];
123
154
  /**
124
155
  * Generates a random name in the format "adjective-noun"
125
156
  * @returns A randomly generated name string
126
157
  */
127
158
  declare function generateRandomName(): string;
128
159
 
160
+ type AiFileChoice = "cursor-rules" | "agents-md" | "claude-md" | "copilot-md";
161
+
162
+ /**
163
+ * Parameters for generating a monorepo workspace.
164
+ *
165
+ * Note: Monorepos are currently pnpm-only. We use pnpm workspaces for
166
+ * dependency management and the .config/* pattern for shared configs.
167
+ *
168
+ * TODO: Support yarn and npm workspaces in the future.
169
+ */
129
170
  type MonorepoParams = {
130
171
  name: string;
131
172
  linter: Linter;
132
173
  formatter: Formatter;
174
+ /** Currently always "pnpm" - monorepos are pnpm-only */
133
175
  packageManager: string;
134
176
  pnpmVersion?: string;
135
177
  pnpmManageVersions?: boolean;
136
178
  nodeVersion?: string;
179
+ aiFiles?: AiFileChoice[];
137
180
  };
138
181
  type MonorepoResult = {
139
182
  files: Record<string, File>;
140
183
  };
141
184
  /**
142
185
  * Generates a monorepo workspace root structure with shared config packages.
186
+ *
187
+ * Note: Monorepos are currently pnpm-only. Detection relies on pnpm-workspace.yaml.
188
+ * TODO: Support yarn and npm workspaces in the future.
143
189
  */
144
190
  declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
145
191
 
@@ -148,5 +194,5 @@ declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
148
194
  */
149
195
  declare function generate(options: GenerateOptions): Record<string, File>;
150
196
 
151
- export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmVersion, getLatestPnpmVersion };
197
+ export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, parseWorkspaceYamlContent, validatePackageName };
152
198
  export type { BaseTemplate, CodeInjectionLocation, File, Formatter, GenerateDreiOptions, GenerateFiberOptions, GenerateGithubPagesOptions, GenerateHandleOptions, GenerateKootaOptions, GenerateLevaOptions, GenerateOffscreenOptions, GenerateOptions, GeneratePostprocessingOptions, GenerateRapierOptions, GenerateTriplexOptions, GenerateUikitOptions, GenerateViverseOptions, GenerateXrOptions, GenerateZustandOptions, Generator, LibraryBundler, Linter, PackageVersions, ProjectType, Template, Testing };
package/dist/index.d.ts CHANGED
@@ -85,8 +85,11 @@ type GenerateOptions = {
85
85
  packageManager?: string;
86
86
  pnpmVersion?: string;
87
87
  pnpmManageVersions?: boolean;
88
+ yarnVersion?: string;
89
+ npmVersion?: string;
88
90
  nodeVersion?: string;
89
91
  workspaceRoot?: string;
92
+ workspaceDependencies?: string[];
90
93
  };
91
94
  type Generator = {
92
95
  get options(): GenerateOptions;
@@ -115,31 +118,74 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
115
118
  * @returns The latest pnpm version string (e.g., "10.24.0")
116
119
  */
117
120
  declare function getLatestPnpmVersion(): Promise<string>;
121
+ /**
122
+ * Fetches the latest version of yarn from the npm registry
123
+ * @returns The latest yarn version string (e.g., "4.6.0")
124
+ */
125
+ declare function getLatestYarnVersion(): Promise<string>;
126
+ /**
127
+ * Fetches the latest version of npm from the npm registry
128
+ * @returns The latest npm version string (e.g., "11.0.0")
129
+ */
130
+ declare function getLatestNpmCliVersion(): Promise<string>;
118
131
  /**
119
132
  * Fetches the latest LTS version of Node.js
120
133
  * @returns The latest Node.js LTS version string (e.g., "22.13.0")
121
134
  */
122
135
  declare function getLatestNodeVersion(): Promise<string>;
136
+ /**
137
+ * Validates a package name for use in a monorepo workspace.
138
+ * Returns an error message if invalid, undefined if valid.
139
+ *
140
+ * Rules:
141
+ * - Supports scoped names (@scope/name) or unscoped names
142
+ * - Must be lowercase
143
+ * - Only alphanumeric characters and hyphens allowed in each segment
144
+ * - Cannot start or end with a hyphen
145
+ * - Cannot contain path traversal sequences
146
+ * - Cannot be empty
147
+ */
148
+ declare function validatePackageName(name: string): string | undefined;
149
+ /**
150
+ * Parses pnpm-workspace.yaml content to extract workspace directory names.
151
+ * Filters out hidden directories (starting with .).
152
+ */
153
+ declare function parseWorkspaceYamlContent(content: string): string[];
123
154
  /**
124
155
  * Generates a random name in the format "adjective-noun"
125
156
  * @returns A randomly generated name string
126
157
  */
127
158
  declare function generateRandomName(): string;
128
159
 
160
+ type AiFileChoice = "cursor-rules" | "agents-md" | "claude-md" | "copilot-md";
161
+
162
+ /**
163
+ * Parameters for generating a monorepo workspace.
164
+ *
165
+ * Note: Monorepos are currently pnpm-only. We use pnpm workspaces for
166
+ * dependency management and the .config/* pattern for shared configs.
167
+ *
168
+ * TODO: Support yarn and npm workspaces in the future.
169
+ */
129
170
  type MonorepoParams = {
130
171
  name: string;
131
172
  linter: Linter;
132
173
  formatter: Formatter;
174
+ /** Currently always "pnpm" - monorepos are pnpm-only */
133
175
  packageManager: string;
134
176
  pnpmVersion?: string;
135
177
  pnpmManageVersions?: boolean;
136
178
  nodeVersion?: string;
179
+ aiFiles?: AiFileChoice[];
137
180
  };
138
181
  type MonorepoResult = {
139
182
  files: Record<string, File>;
140
183
  };
141
184
  /**
142
185
  * Generates a monorepo workspace root structure with shared config packages.
186
+ *
187
+ * Note: Monorepos are currently pnpm-only. Detection relies on pnpm-workspace.yaml.
188
+ * TODO: Support yarn and npm workspaces in the future.
143
189
  */
144
190
  declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
145
191
 
@@ -148,5 +194,5 @@ declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
148
194
  */
149
195
  declare function generate(options: GenerateOptions): Record<string, File>;
150
196
 
151
- export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmVersion, getLatestPnpmVersion };
197
+ export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, parseWorkspaceYamlContent, validatePackageName };
152
198
  export type { BaseTemplate, CodeInjectionLocation, File, Formatter, GenerateDreiOptions, GenerateFiberOptions, GenerateGithubPagesOptions, GenerateHandleOptions, GenerateKootaOptions, GenerateLevaOptions, GenerateOffscreenOptions, GenerateOptions, GeneratePostprocessingOptions, GenerateRapierOptions, GenerateTriplexOptions, GenerateUikitOptions, GenerateViverseOptions, GenerateXrOptions, GenerateZustandOptions, Generator, LibraryBundler, Linter, PackageVersions, ProjectType, Template, Testing };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { f as generate, h as generateMonorepo, b as generateRandomName, g as getBaseTemplate, a as getLanguageFromTemplate, d as getLatestNodeVersion, e as getLatestNpmVersion, c as getLatestPnpmVersion } from './chunks/index.mjs';
1
+ export { l as generate, r as generateMonorepo, b as generateRandomName, g as getBaseTemplate, a as getLanguageFromTemplate, p as getLatestNodeVersion, o as getLatestNpmCliVersion, k as getLatestNpmVersion, m as getLatestPnpmVersion, n as getLatestYarnVersion, q as parseWorkspaceYamlContent, v as validatePackageName } from './chunks/index.mjs';
2
2
  import 'chalk';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-krispya",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "🌹 CLI for creating web projects with (my) sensible defaults",
5
5
  "keywords": [
6
6
  "cli",