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

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
@@ -61,8 +61,8 @@ async function devCommand(options) {
61
61
  spinner.succeed(`Core found at: ${coreDir} (${mode} mode)`);
62
62
  const processes = [];
63
63
  if (options.registry) {
64
- console.log(chalk.blue("\n[Registry] Starting registry watcher..."));
65
- const registryProcess = spawn("node", ["scripts/registry-watch.js"], {
64
+ console.log(chalk.blue("\n[Registry] Starting registry builder with watch mode..."));
65
+ const registryProcess = spawn("node", ["scripts/build/registry.mjs", "--watch"], {
66
66
  cwd: coreDir,
67
67
  stdio: "inherit",
68
68
  env: {
@@ -1690,6 +1690,14 @@ async function updateReadme(config) {
1690
1690
  );
1691
1691
  await fs2.writeFile(readmePath, content, "utf-8");
1692
1692
  }
1693
+ async function copyEnvExampleToEnv() {
1694
+ const projectRoot = process.cwd();
1695
+ const envExamplePath = path2.resolve(projectRoot, ".env.example");
1696
+ const envPath = path2.resolve(projectRoot, ".env");
1697
+ if (await fs2.pathExists(envExamplePath) && !await fs2.pathExists(envPath)) {
1698
+ await fs2.copy(envExamplePath, envPath);
1699
+ }
1700
+ }
1693
1701
 
1694
1702
  // src/wizard/generators/messages-generator.ts
1695
1703
  import fs3 from "fs-extra";
@@ -2402,6 +2410,7 @@ async function generateProject(config) {
2402
2410
  await updateGitignore(config);
2403
2411
  await generateEnvExample(config);
2404
2412
  await updateReadme(config);
2413
+ await copyEnvExampleToEnv();
2405
2414
  }
2406
2415
 
2407
2416
  // src/wizard/presets.ts
@@ -2794,6 +2803,40 @@ async function runWizard(options = { mode: "interactive" }) {
2794
2803
  if (selectedTheme || selectedPlugins.length > 0) {
2795
2804
  await installThemeAndPlugins(selectedTheme, selectedPlugins);
2796
2805
  }
2806
+ const installSpinner = ora7({
2807
+ text: "Installing dependencies...",
2808
+ prefixText: " "
2809
+ }).start();
2810
+ try {
2811
+ execSync("pnpm install --force", {
2812
+ cwd: process.cwd(),
2813
+ stdio: "pipe"
2814
+ });
2815
+ installSpinner.succeed("Dependencies installed!");
2816
+ } catch (error) {
2817
+ installSpinner.fail("Failed to install dependencies");
2818
+ console.log(chalk11.yellow(' Run "pnpm install" manually to install dependencies'));
2819
+ }
2820
+ const registrySpinner = ora7({
2821
+ text: "Building registries...",
2822
+ prefixText: " "
2823
+ }).start();
2824
+ try {
2825
+ const projectRoot = process.cwd();
2826
+ const registryScript = join6(projectRoot, "node_modules/@nextsparkjs/core/scripts/build/registry.mjs");
2827
+ execSync(`node "${registryScript}" --build`, {
2828
+ cwd: projectRoot,
2829
+ stdio: "pipe",
2830
+ env: {
2831
+ ...process.env,
2832
+ NEXTSPARK_PROJECT_ROOT: projectRoot
2833
+ }
2834
+ });
2835
+ registrySpinner.succeed("Registries built!");
2836
+ } catch (error) {
2837
+ registrySpinner.fail("Failed to build registries");
2838
+ console.log(chalk11.yellow(' Registries will be built automatically when you run "pnpm dev"'));
2839
+ }
2797
2840
  showNextSteps(config, selectedTheme);
2798
2841
  } catch (error) {
2799
2842
  if (error instanceof Error) {
@@ -2903,35 +2946,35 @@ function formatDevTool(tool) {
2903
2946
  function showNextSteps(config, referenceTheme = null) {
2904
2947
  console.log("");
2905
2948
  console.log(chalk11.cyan(" " + "=".repeat(60)));
2906
- console.log(chalk11.bold.green(" \u2728 NextSpark project created successfully!"));
2949
+ console.log(chalk11.bold.green(" \u2728 NextSpark project ready!"));
2907
2950
  console.log(chalk11.cyan(" " + "=".repeat(60)));
2908
2951
  console.log("");
2909
2952
  console.log(chalk11.bold.white(" Next steps:"));
2910
2953
  console.log("");
2911
- console.log(chalk11.white(" 1. Install dependencies:"));
2912
- console.log(chalk11.cyan(" pnpm install"));
2954
+ console.log(chalk11.white(" 1. Configure your .env file:"));
2955
+ console.log(chalk11.gray(" Edit these values in .env:"));
2913
2956
  console.log("");
2914
- console.log(chalk11.white(" 2. Set up your environment:"));
2915
- console.log(chalk11.gray(" Copy .env.example to .env and configure:"));
2916
- console.log(chalk11.yellow(" - DATABASE_URL"));
2917
- console.log(chalk11.yellow(" - BETTER_AUTH_SECRET"));
2918
- console.log(chalk11.yellow(` - NEXT_PUBLIC_ACTIVE_THEME=${config.projectSlug}`));
2957
+ console.log(chalk11.yellow(" DATABASE_URL"));
2958
+ console.log(chalk11.gray(" PostgreSQL connection string"));
2959
+ console.log(chalk11.dim(" Example: postgresql://user:pass@localhost:5432/mydb"));
2919
2960
  console.log("");
2920
- console.log(chalk11.white(" 3. Generate registries:"));
2921
- console.log(chalk11.cyan(" pnpm build:registries"));
2961
+ console.log(chalk11.yellow(" BETTER_AUTH_SECRET"));
2962
+ console.log(chalk11.gray(" Generate with:"));
2963
+ console.log(chalk11.cyan(" openssl rand -base64 32"));
2922
2964
  console.log("");
2923
- console.log(chalk11.white(" 4. Run database migrations:"));
2965
+ console.log(chalk11.white(" 2. Run database migrations:"));
2924
2966
  console.log(chalk11.cyan(" pnpm db:migrate"));
2925
2967
  console.log("");
2926
- console.log(chalk11.white(" 5. Start the development server:"));
2968
+ console.log(chalk11.white(" 3. Start the development server:"));
2927
2969
  console.log(chalk11.cyan(" pnpm dev"));
2928
2970
  console.log("");
2929
2971
  console.log(chalk11.gray(" " + "-".repeat(60)));
2930
- console.log(chalk11.gray(` Your theme: ${chalk11.white(`contents/themes/${config.projectSlug}/`)}`));
2972
+ console.log(chalk11.gray(` Theme: ${chalk11.white(`contents/themes/${config.projectSlug}/`)}`));
2973
+ console.log(chalk11.gray(` Active theme: ${chalk11.green(`NEXT_PUBLIC_ACTIVE_THEME=${config.projectSlug}`)}`));
2931
2974
  if (referenceTheme) {
2932
- console.log(chalk11.gray(` Reference theme: ${chalk11.white(`contents/themes/${referenceTheme}/`)}`));
2975
+ console.log(chalk11.gray(` Reference: ${chalk11.white(`contents/themes/${referenceTheme}/`)}`));
2933
2976
  }
2934
- console.log(chalk11.gray(" Documentation: https://nextspark.dev/docs"));
2977
+ console.log(chalk11.gray(" Docs: https://nextspark.dev/docs"));
2935
2978
  console.log("");
2936
2979
  }
2937
2980
  function findLocalCoreTarball() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/cli",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.7",
4
4
  "description": "NextSpark CLI - Complete development toolkit",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,6 +12,10 @@
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
+ },
15
19
  "dependencies": {
16
20
  "@inquirer/prompts": "^7.2.0",
17
21
  "@nextsparkjs/core": ">=0.1.0-beta.1",
@@ -22,12 +26,12 @@
22
26
  "tar": "^7.0.0"
23
27
  },
24
28
  "devDependencies": {
29
+ "@nextsparkjs/core": "workspace:*",
25
30
  "@types/fs-extra": "^11.0.4",
26
31
  "@types/tar": "^6.1.0",
27
32
  "tsup": "^8.0.0",
28
33
  "typescript": "^5.0.0",
29
- "@types/node": "^20.0.0",
30
- "@nextsparkjs/core": "0.1.0-beta.3"
34
+ "@types/node": "^20.0.0"
31
35
  },
32
36
  "keywords": [
33
37
  "nextspark",
@@ -44,9 +48,5 @@
44
48
  },
45
49
  "engines": {
46
50
  "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
+ }