create-krispya 0.5.1 → 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,6 +85,8 @@ 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;
90
92
  workspaceDependencies?: string[];
@@ -116,31 +118,74 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
116
118
  * @returns The latest pnpm version string (e.g., "10.24.0")
117
119
  */
118
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>;
119
131
  /**
120
132
  * Fetches the latest LTS version of Node.js
121
133
  * @returns The latest Node.js LTS version string (e.g., "22.13.0")
122
134
  */
123
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[];
124
154
  /**
125
155
  * Generates a random name in the format "adjective-noun"
126
156
  * @returns A randomly generated name string
127
157
  */
128
158
  declare function generateRandomName(): string;
129
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
+ */
130
170
  type MonorepoParams = {
131
171
  name: string;
132
172
  linter: Linter;
133
173
  formatter: Formatter;
174
+ /** Currently always "pnpm" - monorepos are pnpm-only */
134
175
  packageManager: string;
135
176
  pnpmVersion?: string;
136
177
  pnpmManageVersions?: boolean;
137
178
  nodeVersion?: string;
179
+ aiFiles?: AiFileChoice[];
138
180
  };
139
181
  type MonorepoResult = {
140
182
  files: Record<string, File>;
141
183
  };
142
184
  /**
143
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.
144
189
  */
145
190
  declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
146
191
 
@@ -149,5 +194,5 @@ declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
149
194
  */
150
195
  declare function generate(options: GenerateOptions): Record<string, File>;
151
196
 
152
- export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmVersion, getLatestPnpmVersion };
197
+ export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, parseWorkspaceYamlContent, validatePackageName };
153
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,6 +85,8 @@ 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;
90
92
  workspaceDependencies?: string[];
@@ -116,31 +118,74 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
116
118
  * @returns The latest pnpm version string (e.g., "10.24.0")
117
119
  */
118
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>;
119
131
  /**
120
132
  * Fetches the latest LTS version of Node.js
121
133
  * @returns The latest Node.js LTS version string (e.g., "22.13.0")
122
134
  */
123
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[];
124
154
  /**
125
155
  * Generates a random name in the format "adjective-noun"
126
156
  * @returns A randomly generated name string
127
157
  */
128
158
  declare function generateRandomName(): string;
129
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
+ */
130
170
  type MonorepoParams = {
131
171
  name: string;
132
172
  linter: Linter;
133
173
  formatter: Formatter;
174
+ /** Currently always "pnpm" - monorepos are pnpm-only */
134
175
  packageManager: string;
135
176
  pnpmVersion?: string;
136
177
  pnpmManageVersions?: boolean;
137
178
  nodeVersion?: string;
179
+ aiFiles?: AiFileChoice[];
138
180
  };
139
181
  type MonorepoResult = {
140
182
  files: Record<string, File>;
141
183
  };
142
184
  /**
143
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.
144
189
  */
145
190
  declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
146
191
 
@@ -149,5 +194,5 @@ declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
149
194
  */
150
195
  declare function generate(options: GenerateOptions): Record<string, File>;
151
196
 
152
- export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmVersion, getLatestPnpmVersion };
197
+ export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, parseWorkspaceYamlContent, validatePackageName };
153
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,6 +85,8 @@ 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;
90
92
  workspaceDependencies?: string[];
@@ -116,31 +118,74 @@ declare function getLatestNpmVersion(packageName: string, fallback: string): Pro
116
118
  * @returns The latest pnpm version string (e.g., "10.24.0")
117
119
  */
118
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>;
119
131
  /**
120
132
  * Fetches the latest LTS version of Node.js
121
133
  * @returns The latest Node.js LTS version string (e.g., "22.13.0")
122
134
  */
123
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[];
124
154
  /**
125
155
  * Generates a random name in the format "adjective-noun"
126
156
  * @returns A randomly generated name string
127
157
  */
128
158
  declare function generateRandomName(): string;
129
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
+ */
130
170
  type MonorepoParams = {
131
171
  name: string;
132
172
  linter: Linter;
133
173
  formatter: Formatter;
174
+ /** Currently always "pnpm" - monorepos are pnpm-only */
134
175
  packageManager: string;
135
176
  pnpmVersion?: string;
136
177
  pnpmManageVersions?: boolean;
137
178
  nodeVersion?: string;
179
+ aiFiles?: AiFileChoice[];
138
180
  };
139
181
  type MonorepoResult = {
140
182
  files: Record<string, File>;
141
183
  };
142
184
  /**
143
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.
144
189
  */
145
190
  declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
146
191
 
@@ -149,5 +194,5 @@ declare function generateMonorepo(params: MonorepoParams): MonorepoResult;
149
194
  */
150
195
  declare function generate(options: GenerateOptions): Record<string, File>;
151
196
 
152
- export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmVersion, getLatestPnpmVersion };
197
+ export { generate, generateMonorepo, generateRandomName, getBaseTemplate, getLanguageFromTemplate, getLatestNodeVersion, getLatestNpmCliVersion, getLatestNpmVersion, getLatestPnpmVersion, getLatestYarnVersion, parseWorkspaceYamlContent, validatePackageName };
153
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.1",
3
+ "version": "0.5.2",
4
4
  "description": "🌹 CLI for creating web projects with (my) sensible defaults",
5
5
  "keywords": [
6
6
  "cli",