@browserbasehq/bb9
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -12,2 +12,3 @@ #!/usr/bin/env node | ||
import { program } from "commander"; | ||
import inquirer from "inquirer"; | ||
import fs from "fs/promises"; | ||
@@ -20,2 +21,41 @@ import path from "path"; | ||
import { readFileSync } from "fs"; | ||
function promptForOptions() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const answers = yield inquirer.prompt([ | ||
{ | ||
type: "list", | ||
name: "template", | ||
message: "Which template would you like to use?", | ||
choices: ["react", "node"], | ||
default: "react", | ||
}, | ||
{ | ||
type: "confirm", | ||
name: "typescript", | ||
message: "Would you like to use TypeScript?", | ||
default: true, | ||
}, | ||
{ | ||
type: "confirm", | ||
name: "tailwind", | ||
message: "Would you like to use Tailwind CSS?", | ||
default: false, | ||
when: (answers) => answers.template === "react", // Only ask for React projects | ||
}, | ||
{ | ||
type: "confirm", | ||
name: "eslint", | ||
message: "Would you like to use ESLint?", | ||
default: true, | ||
}, | ||
{ | ||
type: "confirm", | ||
name: "git", | ||
message: "Initialize a git repository?", | ||
default: true, | ||
}, | ||
]); | ||
return answers; | ||
}); | ||
} | ||
function createProjectStructure(projectPath, projectName, options) { | ||
@@ -62,9 +102,7 @@ return __awaiter(this, void 0, void 0, function* () { | ||
.argument("<project-name>", "Name of the project") | ||
.option("-t, --template <type>", "project template type (react, node)", "react") | ||
.option("--git", "initialize git repository", true) | ||
.action((projectName, options) => __awaiter(void 0, void 0, void 0, function* () { | ||
.action((projectName) => __awaiter(void 0, void 0, void 0, function* () { | ||
try { | ||
const projectPath = path.join(process.cwd(), projectName); | ||
// Force typescript to true since this is a TypeScript template | ||
options.typescript = true; | ||
// Get options through interactive prompts | ||
const options = yield promptForOptions(); | ||
yield createProjectStructure(projectPath, projectName, options); | ||
@@ -71,0 +109,0 @@ console.log(chalk.green(`🤘 Successfully created new Stagehand project: "${projectName}"`)); |
{ | ||
"name": "@browserbasehq/bb9", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "", | ||
@@ -13,2 +13,3 @@ "main": "index.js", | ||
"commander": "^12.1.0", | ||
"inquirer": "^12.2.0", | ||
"path": "^0.12.7", | ||
@@ -15,0 +16,0 @@ "typescript": "^5.7.2" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22154
305
6
+ Addedinquirer@^12.2.0
+ Added@inquirer/checkbox@4.0.5(transitive)
+ Added@inquirer/confirm@5.1.2(transitive)
+ Added@inquirer/core@10.1.3(transitive)
+ Added@inquirer/editor@4.2.2(transitive)
+ Added@inquirer/expand@4.0.5(transitive)
+ Added@inquirer/figures@1.0.9(transitive)
+ Added@inquirer/input@4.1.2(transitive)
+ Added@inquirer/number@3.0.5(transitive)
+ Added@inquirer/password@4.0.5(transitive)
+ Added@inquirer/prompts@7.2.2(transitive)
+ Added@inquirer/rawlist@4.0.5(transitive)
+ Added@inquirer/search@3.0.5(transitive)
+ Added@inquirer/select@4.0.5(transitive)
+ Added@inquirer/type@3.0.2(transitive)
+ Added@types/node@22.10.6(transitive)
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedchardet@0.7.0(transitive)
+ Addedcli-width@4.1.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedexternal-editor@3.1.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinquirer@12.3.1(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedmute-stream@2.0.0(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedrun-async@3.0.0(transitive)
+ Addedrxjs@7.8.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtmp@0.0.33(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtype-fest@0.21.3(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedwrap-ansi@6.2.0(transitive)
+ Addedyoctocolors-cjs@2.1.2(transitive)