@svton/cli 1.0.0 → 1.0.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/bin/svton.js +0 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +69 -56
- package/dist/index.mjs +69 -56
- package/package.json +1 -1
package/bin/svton.js
CHANGED
|
File without changes
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -613,49 +613,60 @@ async function createProject(projectName, options = {}) {
|
|
|
613
613
|
}
|
|
614
614
|
logger.info(import_chalk2.default.blue("\u{1F680} Welcome to Svton App Generator!"));
|
|
615
615
|
logger.info("");
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
616
|
+
let answers;
|
|
617
|
+
if (options.yes) {
|
|
618
|
+
answers = {
|
|
619
|
+
org: options.org || projectName,
|
|
620
|
+
template: options.template || "full-stack",
|
|
621
|
+
packageManager: options.packageManager || "pnpm",
|
|
622
|
+
installDeps: !options.skipInstall,
|
|
623
|
+
initGit: !options.skipGit
|
|
624
|
+
};
|
|
625
|
+
} else {
|
|
626
|
+
answers = await import_inquirer.default.prompt([
|
|
627
|
+
{
|
|
628
|
+
type: "input",
|
|
629
|
+
name: "org",
|
|
630
|
+
message: "Organization name (will be used as @org/package-name):",
|
|
631
|
+
default: options.org || projectName,
|
|
632
|
+
validate: (input) => {
|
|
633
|
+
if (!input.trim()) return "Organization name is required";
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
type: "list",
|
|
639
|
+
name: "template",
|
|
640
|
+
message: "Choose a template:",
|
|
641
|
+
choices: [
|
|
642
|
+
{ name: "Full Stack (Backend + Admin + Mobile)", value: "full-stack" },
|
|
643
|
+
{ name: "Backend Only (NestJS + Prisma)", value: "backend-only" },
|
|
644
|
+
{ name: "Admin Only (Next.js)", value: "admin-only" },
|
|
645
|
+
{ name: "Mobile Only (Taro)", value: "mobile-only" }
|
|
646
|
+
],
|
|
647
|
+
default: options.template || "full-stack"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
type: "list",
|
|
651
|
+
name: "packageManager",
|
|
652
|
+
message: "Package manager:",
|
|
653
|
+
choices: ["pnpm", "npm", "yarn"],
|
|
654
|
+
default: options.packageManager || "pnpm"
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
type: "confirm",
|
|
658
|
+
name: "installDeps",
|
|
659
|
+
message: "Install dependencies?",
|
|
660
|
+
default: !options.skipInstall
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
type: "confirm",
|
|
664
|
+
name: "initGit",
|
|
665
|
+
message: "Initialize Git repository?",
|
|
666
|
+
default: !options.skipGit
|
|
625
667
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
type: "list",
|
|
629
|
-
name: "template",
|
|
630
|
-
message: "Choose a template:",
|
|
631
|
-
choices: [
|
|
632
|
-
{ name: "Full Stack (Backend + Admin + Mobile)", value: "full-stack" },
|
|
633
|
-
{ name: "Backend Only (NestJS + Prisma)", value: "backend-only" },
|
|
634
|
-
{ name: "Admin Only (Next.js)", value: "admin-only" },
|
|
635
|
-
{ name: "Mobile Only (Taro)", value: "mobile-only" }
|
|
636
|
-
],
|
|
637
|
-
default: options.template || "full-stack"
|
|
638
|
-
},
|
|
639
|
-
{
|
|
640
|
-
type: "list",
|
|
641
|
-
name: "packageManager",
|
|
642
|
-
message: "Package manager:",
|
|
643
|
-
choices: ["pnpm", "npm", "yarn"],
|
|
644
|
-
default: options.packageManager || "pnpm"
|
|
645
|
-
},
|
|
646
|
-
{
|
|
647
|
-
type: "confirm",
|
|
648
|
-
name: "installDeps",
|
|
649
|
-
message: "Install dependencies?",
|
|
650
|
-
default: !options.skipInstall
|
|
651
|
-
},
|
|
652
|
-
{
|
|
653
|
-
type: "confirm",
|
|
654
|
-
name: "initGit",
|
|
655
|
-
message: "Initialize Git repository?",
|
|
656
|
-
default: !options.skipGit
|
|
657
|
-
}
|
|
658
|
-
]);
|
|
668
|
+
]);
|
|
669
|
+
}
|
|
659
670
|
const config = {
|
|
660
671
|
projectName,
|
|
661
672
|
orgName: answers.org.startsWith("@") ? answers.org : `@${answers.org}`,
|
|
@@ -674,17 +685,19 @@ async function createProject(projectName, options = {}) {
|
|
|
674
685
|
logger.info(` Install Dependencies: ${import_chalk2.default.white(config.installDeps ? "Yes" : "No")}`);
|
|
675
686
|
logger.info(` Initialize Git: ${import_chalk2.default.white(config.initGit ? "Yes" : "No")}`);
|
|
676
687
|
logger.info("");
|
|
677
|
-
|
|
678
|
-
{
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
688
|
+
if (!options.yes) {
|
|
689
|
+
const { proceed } = await import_inquirer.default.prompt([
|
|
690
|
+
{
|
|
691
|
+
type: "confirm",
|
|
692
|
+
name: "proceed",
|
|
693
|
+
message: "Proceed with project creation?",
|
|
694
|
+
default: true
|
|
695
|
+
}
|
|
696
|
+
]);
|
|
697
|
+
if (!proceed) {
|
|
698
|
+
logger.info(import_chalk2.default.yellow("Project creation cancelled."));
|
|
699
|
+
return;
|
|
683
700
|
}
|
|
684
|
-
]);
|
|
685
|
-
if (!proceed) {
|
|
686
|
-
logger.info(import_chalk2.default.yellow("Project creation cancelled."));
|
|
687
|
-
return;
|
|
688
701
|
}
|
|
689
702
|
await createProjectFromTemplate(config);
|
|
690
703
|
logger.info("");
|
|
@@ -732,14 +745,14 @@ async function createProjectFromTemplate(config) {
|
|
|
732
745
|
}
|
|
733
746
|
|
|
734
747
|
// package.json
|
|
735
|
-
var version = "1.0.
|
|
748
|
+
var version = "1.0.2";
|
|
736
749
|
|
|
737
750
|
// src/index.ts
|
|
738
|
-
function cli() {
|
|
751
|
+
async function cli() {
|
|
739
752
|
const program = new import_commander.Command();
|
|
740
753
|
program.name("svton").description("Svton CLI - Create full-stack applications with NestJS, Next.js, and Taro").version(version);
|
|
741
|
-
program.command("create <project-name>").alias("init").alias("new").description("Create a new Svton project").option("-o, --org <name>", "Organization name (default: project name)").option("--skip-install", "Skip installing dependencies").option("--skip-git", "Skip Git initialization").option("-t, --template <template>", "Template to use", "full-stack").option("-p, --package-manager <pm>", "Package manager to use", "pnpm").action(createProject);
|
|
742
|
-
program.
|
|
754
|
+
program.command("create <project-name>").alias("init").alias("new").description("Create a new Svton project").option("-o, --org <name>", "Organization name (default: project name)").option("--skip-install", "Skip installing dependencies").option("--skip-git", "Skip Git initialization").option("-t, --template <template>", "Template to use", "full-stack").option("-p, --package-manager <pm>", "Package manager to use", "pnpm").option("-y, --yes", "Skip all prompts and use defaults").action(createProject);
|
|
755
|
+
await program.parseAsync();
|
|
743
756
|
}
|
|
744
757
|
if (require.main === module) {
|
|
745
758
|
cli();
|
package/dist/index.mjs
CHANGED
|
@@ -586,49 +586,60 @@ async function createProject(projectName, options = {}) {
|
|
|
586
586
|
}
|
|
587
587
|
logger.info(chalk2.blue("\u{1F680} Welcome to Svton App Generator!"));
|
|
588
588
|
logger.info("");
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
589
|
+
let answers;
|
|
590
|
+
if (options.yes) {
|
|
591
|
+
answers = {
|
|
592
|
+
org: options.org || projectName,
|
|
593
|
+
template: options.template || "full-stack",
|
|
594
|
+
packageManager: options.packageManager || "pnpm",
|
|
595
|
+
installDeps: !options.skipInstall,
|
|
596
|
+
initGit: !options.skipGit
|
|
597
|
+
};
|
|
598
|
+
} else {
|
|
599
|
+
answers = await inquirer.prompt([
|
|
600
|
+
{
|
|
601
|
+
type: "input",
|
|
602
|
+
name: "org",
|
|
603
|
+
message: "Organization name (will be used as @org/package-name):",
|
|
604
|
+
default: options.org || projectName,
|
|
605
|
+
validate: (input) => {
|
|
606
|
+
if (!input.trim()) return "Organization name is required";
|
|
607
|
+
return true;
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
type: "list",
|
|
612
|
+
name: "template",
|
|
613
|
+
message: "Choose a template:",
|
|
614
|
+
choices: [
|
|
615
|
+
{ name: "Full Stack (Backend + Admin + Mobile)", value: "full-stack" },
|
|
616
|
+
{ name: "Backend Only (NestJS + Prisma)", value: "backend-only" },
|
|
617
|
+
{ name: "Admin Only (Next.js)", value: "admin-only" },
|
|
618
|
+
{ name: "Mobile Only (Taro)", value: "mobile-only" }
|
|
619
|
+
],
|
|
620
|
+
default: options.template || "full-stack"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
type: "list",
|
|
624
|
+
name: "packageManager",
|
|
625
|
+
message: "Package manager:",
|
|
626
|
+
choices: ["pnpm", "npm", "yarn"],
|
|
627
|
+
default: options.packageManager || "pnpm"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
type: "confirm",
|
|
631
|
+
name: "installDeps",
|
|
632
|
+
message: "Install dependencies?",
|
|
633
|
+
default: !options.skipInstall
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
type: "confirm",
|
|
637
|
+
name: "initGit",
|
|
638
|
+
message: "Initialize Git repository?",
|
|
639
|
+
default: !options.skipGit
|
|
598
640
|
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
type: "list",
|
|
602
|
-
name: "template",
|
|
603
|
-
message: "Choose a template:",
|
|
604
|
-
choices: [
|
|
605
|
-
{ name: "Full Stack (Backend + Admin + Mobile)", value: "full-stack" },
|
|
606
|
-
{ name: "Backend Only (NestJS + Prisma)", value: "backend-only" },
|
|
607
|
-
{ name: "Admin Only (Next.js)", value: "admin-only" },
|
|
608
|
-
{ name: "Mobile Only (Taro)", value: "mobile-only" }
|
|
609
|
-
],
|
|
610
|
-
default: options.template || "full-stack"
|
|
611
|
-
},
|
|
612
|
-
{
|
|
613
|
-
type: "list",
|
|
614
|
-
name: "packageManager",
|
|
615
|
-
message: "Package manager:",
|
|
616
|
-
choices: ["pnpm", "npm", "yarn"],
|
|
617
|
-
default: options.packageManager || "pnpm"
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
type: "confirm",
|
|
621
|
-
name: "installDeps",
|
|
622
|
-
message: "Install dependencies?",
|
|
623
|
-
default: !options.skipInstall
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
type: "confirm",
|
|
627
|
-
name: "initGit",
|
|
628
|
-
message: "Initialize Git repository?",
|
|
629
|
-
default: !options.skipGit
|
|
630
|
-
}
|
|
631
|
-
]);
|
|
641
|
+
]);
|
|
642
|
+
}
|
|
632
643
|
const config = {
|
|
633
644
|
projectName,
|
|
634
645
|
orgName: answers.org.startsWith("@") ? answers.org : `@${answers.org}`,
|
|
@@ -647,17 +658,19 @@ async function createProject(projectName, options = {}) {
|
|
|
647
658
|
logger.info(` Install Dependencies: ${chalk2.white(config.installDeps ? "Yes" : "No")}`);
|
|
648
659
|
logger.info(` Initialize Git: ${chalk2.white(config.initGit ? "Yes" : "No")}`);
|
|
649
660
|
logger.info("");
|
|
650
|
-
|
|
651
|
-
{
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
661
|
+
if (!options.yes) {
|
|
662
|
+
const { proceed } = await inquirer.prompt([
|
|
663
|
+
{
|
|
664
|
+
type: "confirm",
|
|
665
|
+
name: "proceed",
|
|
666
|
+
message: "Proceed with project creation?",
|
|
667
|
+
default: true
|
|
668
|
+
}
|
|
669
|
+
]);
|
|
670
|
+
if (!proceed) {
|
|
671
|
+
logger.info(chalk2.yellow("Project creation cancelled."));
|
|
672
|
+
return;
|
|
656
673
|
}
|
|
657
|
-
]);
|
|
658
|
-
if (!proceed) {
|
|
659
|
-
logger.info(chalk2.yellow("Project creation cancelled."));
|
|
660
|
-
return;
|
|
661
674
|
}
|
|
662
675
|
await createProjectFromTemplate(config);
|
|
663
676
|
logger.info("");
|
|
@@ -705,14 +718,14 @@ async function createProjectFromTemplate(config) {
|
|
|
705
718
|
}
|
|
706
719
|
|
|
707
720
|
// package.json
|
|
708
|
-
var version = "1.0.
|
|
721
|
+
var version = "1.0.2";
|
|
709
722
|
|
|
710
723
|
// src/index.ts
|
|
711
|
-
function cli() {
|
|
724
|
+
async function cli() {
|
|
712
725
|
const program = new Command();
|
|
713
726
|
program.name("svton").description("Svton CLI - Create full-stack applications with NestJS, Next.js, and Taro").version(version);
|
|
714
|
-
program.command("create <project-name>").alias("init").alias("new").description("Create a new Svton project").option("-o, --org <name>", "Organization name (default: project name)").option("--skip-install", "Skip installing dependencies").option("--skip-git", "Skip Git initialization").option("-t, --template <template>", "Template to use", "full-stack").option("-p, --package-manager <pm>", "Package manager to use", "pnpm").action(createProject);
|
|
715
|
-
program.
|
|
727
|
+
program.command("create <project-name>").alias("init").alias("new").description("Create a new Svton project").option("-o, --org <name>", "Organization name (default: project name)").option("--skip-install", "Skip installing dependencies").option("--skip-git", "Skip Git initialization").option("-t, --template <template>", "Template to use", "full-stack").option("-p, --package-manager <pm>", "Package manager to use", "pnpm").option("-y, --yes", "Skip all prompts and use defaults").action(createProject);
|
|
728
|
+
await program.parseAsync();
|
|
716
729
|
}
|
|
717
730
|
if (__require.main === module) {
|
|
718
731
|
cli();
|