create-innovator 1.0.0 → 1.1.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 +8 -1
- package/dist/cli.js +19 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ npx create-innovator
|
|
|
30
30
|
| Flag | Alias | Description |
|
|
31
31
|
| ---------------- | ----- | ----------------------------------------------------------- |
|
|
32
32
|
| `--name <name>` | `-n` | Project name (skips the interactive prompt) |
|
|
33
|
+
| `--latest` | `-l` | Skip version selection and use the latest version |
|
|
33
34
|
| `--experimental` | `-e` | Include pre-release template versions in the version picker |
|
|
34
35
|
|
|
35
36
|
### Examples
|
|
@@ -46,6 +47,12 @@ Create a project with a specific name:
|
|
|
46
47
|
pnpm create innovator --name my-project
|
|
47
48
|
```
|
|
48
49
|
|
|
50
|
+
Use the latest template version without prompting:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm create innovator --latest
|
|
54
|
+
```
|
|
55
|
+
|
|
49
56
|
Include experimental template versions:
|
|
50
57
|
|
|
51
58
|
```bash
|
|
@@ -55,7 +62,7 @@ pnpm create innovator --experimental
|
|
|
55
62
|
### What happens when you run it
|
|
56
63
|
|
|
57
64
|
1. **GitHub authentication** — reads your token from `~/.npmrc` or prompts you to enter one. Validates required scopes (`repo`, `read:packages`) and access to the `stormreply` organization.
|
|
58
|
-
2. **Version selection** — fetches available template tags and lets you pick a version.
|
|
65
|
+
2. **Version selection** — fetches available template tags and lets you pick a version (or auto-selects the latest when `--latest` is used).
|
|
59
66
|
3. **Clone** — shallow-clones the template at the selected tag using `gh repo clone`, then re-initializes a fresh git repository.
|
|
60
67
|
4. **Name replacement** — replaces `innovator-template` throughout the project with your chosen name in all case variants (kebab-case, camelCase, PascalCase, Title Case).
|
|
61
68
|
5. **Template cleanup** — removes template-specific files that are not needed in the new project.
|
package/dist/cli.js
CHANGED
|
@@ -209,6 +209,17 @@ async function fetchReleaseTags(token, includeExperimental = false) {
|
|
|
209
209
|
}
|
|
210
210
|
return tags;
|
|
211
211
|
}
|
|
212
|
+
async function selectLatestVersion(token, includeExperimental = false) {
|
|
213
|
+
const s = p3.spinner();
|
|
214
|
+
s.start("Fetching latest template version");
|
|
215
|
+
const tags = await fetchReleaseTags(token, includeExperimental);
|
|
216
|
+
if (tags.length === 0) {
|
|
217
|
+
s.stop("No versions found");
|
|
218
|
+
throw new Error(`No release tags found in ${GITHUB_ORG}/${TEMPLATE_REPO}.`);
|
|
219
|
+
}
|
|
220
|
+
s.stop(`Using latest version: ${tags[0]}`);
|
|
221
|
+
return tags[0];
|
|
222
|
+
}
|
|
212
223
|
async function selectVersion(token, includeExperimental = false) {
|
|
213
224
|
const s = p3.spinner();
|
|
214
225
|
s.start("Fetching available template versions");
|
|
@@ -372,6 +383,13 @@ var main = defineCommand({
|
|
|
372
383
|
required: false,
|
|
373
384
|
type: "string"
|
|
374
385
|
},
|
|
386
|
+
latest: {
|
|
387
|
+
alias: ["l"],
|
|
388
|
+
description: "Skip version selection and use the latest version",
|
|
389
|
+
required: false,
|
|
390
|
+
type: "boolean",
|
|
391
|
+
default: false
|
|
392
|
+
},
|
|
375
393
|
experimental: {
|
|
376
394
|
alias: ["e"],
|
|
377
395
|
description: "Include experimental (pre-release) versions",
|
|
@@ -394,7 +412,7 @@ var main = defineCommand({
|
|
|
394
412
|
try {
|
|
395
413
|
const token = await ensureGitHubAuth();
|
|
396
414
|
await ensureGhCli();
|
|
397
|
-
const tag = await selectVersion(token, args.experimental);
|
|
415
|
+
const tag = args.latest ? await selectLatestVersion(token, args.experimental) : await selectVersion(token, args.experimental);
|
|
398
416
|
await cloneTemplate(projectName, tag);
|
|
399
417
|
await replaceTemplateNames(projectName, projectName);
|
|
400
418
|
await removeTemplateFiles(projectName);
|