@nextsparkjs/cli 0.1.0-beta.4 → 0.1.0-beta.5

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/bin/nextspark.js CHANGED
File without changes
package/dist/cli.js CHANGED
@@ -2707,6 +2707,16 @@ function showConfigPreview(config) {
2707
2707
  }
2708
2708
 
2709
2709
  // src/wizard/index.ts
2710
+ function getProjectInfoFromOptions(options) {
2711
+ if (options.name && options.slug && options.description) {
2712
+ return {
2713
+ projectName: options.name,
2714
+ projectSlug: options.slug,
2715
+ projectDescription: options.description
2716
+ };
2717
+ }
2718
+ return null;
2719
+ }
2710
2720
  async function runWizard(options = { mode: "interactive" }) {
2711
2721
  showBanner();
2712
2722
  showModeIndicator(options);
@@ -2733,7 +2743,7 @@ async function runWizard(options = { mode: "interactive" }) {
2733
2743
  }
2734
2744
  let config;
2735
2745
  if (options.preset) {
2736
- config = await runPresetMode(options.preset);
2746
+ config = await runPresetMode(options.preset, options);
2737
2747
  } else {
2738
2748
  switch (options.mode) {
2739
2749
  case "quick":
@@ -2750,15 +2760,17 @@ async function runWizard(options = { mode: "interactive" }) {
2750
2760
  }
2751
2761
  showConfigSummary(config);
2752
2762
  showConfigPreview(config);
2753
- console.log("");
2754
- const proceed = await confirm5({
2755
- message: "Proceed with project generation?",
2756
- default: true
2757
- });
2758
- if (!proceed) {
2763
+ if (!options.yes) {
2759
2764
  console.log("");
2760
- showInfo("Project generation cancelled. No changes were made.");
2761
- process.exit(0);
2765
+ const proceed = await confirm5({
2766
+ message: "Proceed with project generation?",
2767
+ default: true
2768
+ });
2769
+ if (!proceed) {
2770
+ console.log("");
2771
+ showInfo("Project generation cancelled. No changes were made.");
2772
+ process.exit(0);
2773
+ }
2762
2774
  }
2763
2775
  await copyNpmrc();
2764
2776
  console.log("");
@@ -2807,14 +2819,21 @@ function showModeIndicator(options) {
2807
2819
  console.log("");
2808
2820
  }
2809
2821
  }
2810
- async function runPresetMode(presetName) {
2822
+ async function runPresetMode(presetName, options) {
2811
2823
  if (!presetName) {
2812
2824
  throw new Error("Preset name is required for preset mode");
2813
2825
  }
2814
- showSection("Project Information", 1, 1);
2815
- showInfo("Using preset defaults. Only project information is required.");
2816
- console.log("");
2817
- const projectInfo = await promptProjectInfo();
2826
+ const projectInfoFromOptions = getProjectInfoFromOptions(options);
2827
+ let projectInfo;
2828
+ if (projectInfoFromOptions) {
2829
+ projectInfo = projectInfoFromOptions;
2830
+ showInfo(`Project: ${projectInfo.projectName} (${projectInfo.projectSlug})`);
2831
+ } else {
2832
+ showSection("Project Information", 1, 1);
2833
+ showInfo("Using preset defaults. Only project information is required.");
2834
+ console.log("");
2835
+ projectInfo = await promptProjectInfo();
2836
+ }
2818
2837
  const config = applyPreset(projectInfo, presetName);
2819
2838
  return config;
2820
2839
  }
@@ -3120,7 +3139,10 @@ async function initCommand(options) {
3120
3139
  preset: options.preset,
3121
3140
  theme: options.theme,
3122
3141
  plugins: parsePlugins(options.plugins),
3123
- yes: options.yes
3142
+ yes: options.yes,
3143
+ name: options.name,
3144
+ slug: options.slug,
3145
+ description: options.description
3124
3146
  };
3125
3147
  await runWizard(wizardOptions);
3126
3148
  }
@@ -3597,7 +3619,7 @@ registry.command("build").description("Build all registries").action(registryBui
3597
3619
  registry.command("watch").description("Watch and rebuild registries on changes").action(registryWatchCommand);
3598
3620
  program.command("registry:build").description("Build all registries (alias)").action(registryBuildCommand);
3599
3621
  program.command("registry:watch").description("Watch and rebuild registries (alias)").action(registryWatchCommand);
3600
- program.command("init").description("Initialize NextSpark project").option("-f, --force", "Overwrite existing configuration").option("--wizard", "Run full project wizard").option("--quick", "Quick wizard mode (essential steps only)").option("--expert", "Expert wizard mode (all options)").option("--preset <name>", "Use preset configuration (saas, blog, crm)").option("--theme <name>", "Pre-select theme (default, blog, crm, productivity, none)").option("--plugins <list>", "Pre-select plugins (comma-separated)").option("-y, --yes", "Skip confirmations").option("--registries-only", "Only create registries (no wizard)").action(initCommand);
3622
+ program.command("init").description("Initialize NextSpark project").option("-f, --force", "Overwrite existing configuration").option("--wizard", "Run full project wizard").option("--quick", "Quick wizard mode (essential steps only)").option("--expert", "Expert wizard mode (all options)").option("--preset <name>", "Use preset configuration (saas, blog, crm)").option("--theme <name>", "Pre-select theme (default, blog, crm, productivity, none)").option("--plugins <list>", "Pre-select plugins (comma-separated)").option("-y, --yes", "Skip confirmations").option("--registries-only", "Only create registries (no wizard)").option("--name <name>", "Project name (non-interactive mode)").option("--slug <slug>", "Project slug (non-interactive mode)").option("--description <desc>", "Project description (non-interactive mode)").action(initCommand);
3601
3623
  program.command("add:plugin <package>").description("Add a plugin to your project").option("-v, --version <version>", "Specific version to install").option("-f, --force", "Overwrite if already exists").option("--skip-postinstall", "Skip postinstall hooks").option("--no-deps", "Skip installing dependencies").option("--dry-run", "Show what would be done without making changes").action(addPluginCommand);
3602
3624
  program.command("add:theme <package>").description("Add a theme to your project").option("-v, --version <version>", "Specific version to install").option("-f, --force", "Overwrite if already exists").option("--skip-postinstall", "Skip postinstall hooks").option("--no-deps", "Skip installing dependencies").option("--dry-run", "Show what would be done without making changes").action(addThemeCommand);
3603
3625
  program.command("doctor").description("Run health check on NextSpark project").action(doctorCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/cli",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.5",
4
4
  "description": "NextSpark CLI - Complete development toolkit",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,10 +12,6 @@
12
12
  "dist",
13
13
  "bin"
14
14
  ],
15
- "scripts": {
16
- "build": "tsup src/cli.ts --format esm --dts --outDir dist",
17
- "dev": "tsup src/cli.ts --format esm --watch"
18
- },
19
15
  "dependencies": {
20
16
  "@inquirer/prompts": "^7.2.0",
21
17
  "@nextsparkjs/core": ">=0.1.0-beta.1",
@@ -26,12 +22,12 @@
26
22
  "tar": "^7.0.0"
27
23
  },
28
24
  "devDependencies": {
29
- "@nextsparkjs/core": "workspace:*",
30
25
  "@types/fs-extra": "^11.0.4",
31
26
  "@types/tar": "^6.1.0",
32
27
  "tsup": "^8.0.0",
33
28
  "typescript": "^5.0.0",
34
- "@types/node": "^20.0.0"
29
+ "@types/node": "^20.0.0",
30
+ "@nextsparkjs/core": "0.1.0-beta.3"
35
31
  },
36
32
  "keywords": [
37
33
  "nextspark",
@@ -48,5 +44,9 @@
48
44
  },
49
45
  "engines": {
50
46
  "node": ">=18.0.0"
47
+ },
48
+ "scripts": {
49
+ "build": "tsup src/cli.ts --format esm --dts --outDir dist",
50
+ "dev": "tsup src/cli.ts --format esm --watch"
51
51
  }
52
- }
52
+ }