create-glosc 0.2.1 → 0.2.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.js CHANGED
@@ -124,6 +124,11 @@ function normalizeMainFileName(language, mainFileNameRaw) {
124
124
  return base;
125
125
  return `${base}${defaultExt}`;
126
126
  }
127
+ function normalizeProjectName(value) {
128
+ return String(value || "")
129
+ .trim()
130
+ .replace(/\s+/g, "-");
131
+ }
127
132
  function getDefaultAuthor() {
128
133
  const candidates = [
129
134
  process.env.GIT_AUTHOR_NAME,
@@ -157,7 +162,7 @@ async function run() {
157
162
  }
158
163
  const language = normalizeLanguage(args.language) || "typescript";
159
164
  const options = {
160
- projectName: String(args.projectName).trim(),
165
+ projectName: normalizeProjectName(args.projectName),
161
166
  description: String(args.description || "A brief description of your project").trim(),
162
167
  author: String(args.author || getDefaultAuthor()).trim(),
163
168
  language,
@@ -254,7 +259,7 @@ async function run() {
254
259
  return;
255
260
  }
256
261
  const options = {
257
- projectName: String(response.projectName).trim(),
262
+ projectName: normalizeProjectName(response.projectName),
258
263
  description: String(response.description || "").trim(),
259
264
  author: String(response.author || "").trim(),
260
265
  language: response.language,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-glosc",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Scaffold Glosc projects (Python/TypeScript) via npm create",
5
5
  "author": "glosc-ai",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -129,6 +129,12 @@ function normalizeMainFileName(
129
129
  return `${base}${defaultExt}`;
130
130
  }
131
131
 
132
+ function normalizeProjectName(value: unknown): string {
133
+ return String(value || "")
134
+ .trim()
135
+ .replace(/\s+/g, "-");
136
+ }
137
+
132
138
  function getDefaultAuthor(): string {
133
139
  const candidates = [
134
140
  process.env.GIT_AUTHOR_NAME,
@@ -168,7 +174,7 @@ async function run(): Promise<void> {
168
174
  const language = normalizeLanguage(args.language) || "typescript";
169
175
 
170
176
  const options: ProjectOptions = {
171
- projectName: String(args.projectName).trim(),
177
+ projectName: normalizeProjectName(args.projectName),
172
178
  description: String(
173
179
  args.description || "A brief description of your project"
174
180
  ).trim(),
@@ -276,7 +282,7 @@ async function run(): Promise<void> {
276
282
  }
277
283
 
278
284
  const options: ProjectOptions = {
279
- projectName: String(response.projectName).trim(),
285
+ projectName: normalizeProjectName(response.projectName),
280
286
  description: String(response.description || "").trim(),
281
287
  author: String(response.author || "").trim(),
282
288
  language: response.language as Language,