@nextsparkjs/cli 0.1.0-beta.127 → 0.1.0-beta.129

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.
Files changed (2) hide show
  1. package/dist/cli.js +40 -11
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1457,8 +1457,7 @@ function generateBillingPlans(billingModel, currency) {
1457
1457
  api_calls: 1000,
1458
1458
  storage_gb: 1,
1459
1459
  },
1460
- stripePriceIdMonthly: null,
1461
- stripePriceIdYearly: null,
1460
+ providerPriceIds: { monthly: null, yearly: null },
1462
1461
  },
1463
1462
  // Pro Plan - ${currencySymbol}29/month
1464
1463
  {
@@ -1484,8 +1483,7 @@ function generateBillingPlans(billingModel, currency) {
1484
1483
  api_calls: 100000,
1485
1484
  storage_gb: 50,
1486
1485
  },
1487
- stripePriceIdMonthly: 'price_pro_monthly',
1488
- stripePriceIdYearly: 'price_pro_yearly',
1486
+ providerPriceIds: { monthly: 'price_pro_monthly', yearly: 'price_pro_yearly' },
1489
1487
  },
1490
1488
  ]`;
1491
1489
  }
@@ -1512,8 +1510,7 @@ function generateBillingPlans(billingModel, currency) {
1512
1510
  api_calls: 10000,
1513
1511
  storage_gb: 10,
1514
1512
  },
1515
- stripePriceIdMonthly: 'price_starter_monthly',
1516
- stripePriceIdYearly: 'price_starter_yearly',
1513
+ providerPriceIds: { monthly: 'price_starter_monthly', yearly: 'price_starter_yearly' },
1517
1514
  },
1518
1515
  // Pro Plan - ${currencySymbol}29/month
1519
1516
  {
@@ -1539,8 +1536,7 @@ function generateBillingPlans(billingModel, currency) {
1539
1536
  api_calls: 100000,
1540
1537
  storage_gb: 50,
1541
1538
  },
1542
- stripePriceIdMonthly: 'price_pro_monthly',
1543
- stripePriceIdYearly: 'price_pro_yearly',
1539
+ providerPriceIds: { monthly: 'price_pro_monthly', yearly: 'price_pro_yearly' },
1544
1540
  },
1545
1541
  // Business Plan - ${currencySymbol}79/month
1546
1542
  {
@@ -1569,8 +1565,7 @@ function generateBillingPlans(billingModel, currency) {
1569
1565
  api_calls: 500000,
1570
1566
  storage_gb: 200,
1571
1567
  },
1572
- stripePriceIdMonthly: 'price_business_monthly',
1573
- stripePriceIdYearly: 'price_business_yearly',
1568
+ providerPriceIds: { monthly: 'price_business_monthly', yearly: 'price_business_yearly' },
1574
1569
  },
1575
1570
  ]`;
1576
1571
  }
@@ -4810,7 +4805,7 @@ async function dbSeedCommand() {
4810
4805
  }
4811
4806
 
4812
4807
  // src/commands/sync-app.ts
4813
- import { existsSync as existsSync11, readdirSync as readdirSync2, mkdirSync as mkdirSync4, copyFileSync, readFileSync as readFileSync10 } from "fs";
4808
+ import { existsSync as existsSync11, readdirSync as readdirSync2, mkdirSync as mkdirSync4, copyFileSync, readFileSync as readFileSync10, writeFileSync as writeFileSync4 } from "fs";
4814
4809
  import { join as join12, dirname as dirname4, relative } from "path";
4815
4810
  import chalk17 from "chalk";
4816
4811
  import ora11 from "ora";
@@ -4825,6 +4820,12 @@ var ROOT_TEMPLATE_FILES = [
4825
4820
  "i18n.ts"
4826
4821
  // Required for next-intl configuration
4827
4822
  ];
4823
+ var PROTECTED_ROOT_FILES = [
4824
+ "tsconfig.json",
4825
+ // Projects add custom path aliases (e.g. @shared/*)
4826
+ "next.config.mjs"
4827
+ // Projects add custom webpack aliases, plugins, etc.
4828
+ ];
4828
4829
  var MAX_VERBOSE_FILES = 10;
4829
4830
  var MAX_SUMMARY_FILES = 5;
4830
4831
  function getAllFiles(dir, baseDir = dir) {
@@ -4977,6 +4978,13 @@ async function syncAppCommand(options) {
4977
4978
  const targetPath = join12(projectRoot, file);
4978
4979
  if (existsSync11(sourcePath)) {
4979
4980
  const isNew = !existsSync11(targetPath);
4981
+ const isProtected = PROTECTED_ROOT_FILES.includes(file);
4982
+ if (isProtected && !isNew) {
4983
+ if (options.verbose) {
4984
+ console.log(chalk17.gray(` \u25CB Protected (not overwritten): ${file}`));
4985
+ }
4986
+ continue;
4987
+ }
4980
4988
  copyFile(sourcePath, targetPath);
4981
4989
  if (isNew) {
4982
4990
  rootCreated++;
@@ -4994,6 +5002,27 @@ async function syncAppCommand(options) {
4994
5002
  if (rootUpdated + rootCreated > 0) {
4995
5003
  console.log(chalk17.gray(` Root files: ${rootUpdated} updated, ${rootCreated} created`));
4996
5004
  }
5005
+ const globalsCssPath = join12(appDir, "globals.css");
5006
+ if (existsSync11(globalsCssPath)) {
5007
+ const envPath = join12(projectRoot, ".env");
5008
+ let activeTheme = process.env.NEXT_PUBLIC_ACTIVE_THEME;
5009
+ if (!activeTheme && existsSync11(envPath)) {
5010
+ const envContent = readFileSync10(envPath, "utf-8");
5011
+ const match = envContent.match(/NEXT_PUBLIC_ACTIVE_THEME=["']?([^"'\s\n]+)["']?/);
5012
+ if (match) activeTheme = match[1];
5013
+ }
5014
+ if (activeTheme && activeTheme !== "default") {
5015
+ const globalsCss = readFileSync10(globalsCssPath, "utf-8");
5016
+ const fixed = globalsCss.replace(
5017
+ /@import\s+["'][^"']*themes\/[^"']*\/styles\/globals\.css["'];?/,
5018
+ `@import "../contents/themes/${activeTheme}/styles/globals.css";`
5019
+ );
5020
+ if (fixed !== globalsCss) {
5021
+ writeFileSync4(globalsCssPath, fixed, "utf-8");
5022
+ console.log(chalk17.gray(` Fixed globals.css \u2192 themes/${activeTheme}`));
5023
+ }
5024
+ }
5025
+ }
4997
5026
  }
4998
5027
  console.log(chalk17.green("\n \u2705 Sync complete!\n"));
4999
5028
  if (customFiles.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextsparkjs/cli",
3
- "version": "0.1.0-beta.127",
3
+ "version": "0.1.0-beta.129",
4
4
  "description": "NextSpark CLI - Complete development toolkit",
5
5
  "type": "module",
6
6
  "bin": {