Skip to content

Commit

Permalink
feat: Add author prompt to setup process
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Nov 13, 2024
1 parent 013f58e commit ff30096
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## v0.1.0 (01-01-2024)

**Added:**
- Initial Release
16 changes: 16 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"name": "rcb-plugin",
"homepage": "https://github.com/React-ChatBotify-Plugins",
"keywords": [
"react",
"chat",
"chatbot",
"conversational-bot",
"conversational-ui",
"frontend-library",
"plugins"
],
"files": [
"./dist"
],
Expand All @@ -26,6 +36,12 @@
"preview": "vite preview",
"prepack": "tsc && vite build"
},
"author": "",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/React-ChatBotify-Plugins/react-chatbotify-plugin-template"
},
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
Expand Down
4 changes: 3 additions & 1 deletion setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const startSetup = () => {
console.log("\x1b[36m%s\x1b[0m", "========================================");
console.log("\x1b[36m%s\x1b[0m", " React ChatBotify Plugin Template Setup");
console.log("\x1b[36m%s\x1b[0m", "========================================\n");
console.log("This setup will configure your plugin\"s name, description, export name and carry out initial installations.\n");
console.log("This setup will configure your plugin\"s name, description, export name, author and carry out initial installations.\n");

// questions to prompt during setup
const questions = [
Expand All @@ -49,6 +49,7 @@ const startSetup = () => {
},
{ question: "\x1b[33m[Prompt] Plugin description: \x1b[0m", key: "description" },
{ question: "\x1b[33m[Prompt] Export name (default export of your plugin): \x1b[0m", key: "exportName" },
{ question: "\x1b[33m[Prompt] GitHub handle (for author field in package.json): \x1b[0m", key: "author" },
];

let answers = {};
Expand Down Expand Up @@ -78,6 +79,7 @@ const startSetup = () => {
const packageData = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
packageData.name = answers.name;
packageData.description = answers.description;
packageData.author = answers.author;
fs.writeFileSync(packageJsonPath, JSON.stringify(packageData, null, 2));

// updates index.tsx
Expand Down

0 comments on commit ff30096

Please sign in to comment.