@bagisto-headless/create 1.0.5 → 1.0.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/README.md +45 -0
- package/index.js +4 -6
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Bagisto Headless Commerce Project Creator
|
|
2
|
+
|
|
3
|
+
`@bagisto-headless/create` is a CLI tool to quickly bootstrap a new Bagisto Headless Commerce project.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
You can create a new project by running:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @bagisto-headless/create <your-project-name>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
This command simplifies the setup process by performing the following steps:
|
|
16
|
+
|
|
17
|
+
1. **Clones the Repository**: It fetches the latest version of the [Bagisto Headless Commerce](https://github.com/bagisto/nextjs-commerce).
|
|
18
|
+
2. **Sets up the Project**: Creates a new directory with your project name and initializes it.
|
|
19
|
+
3. **Installs Dependencies**: Automatically runs `npm install` with the necessary flags.
|
|
20
|
+
4. **Configures Environment**: Prompts you for essential configuration details:
|
|
21
|
+
* `NEXT_PUBLIC_BAGISTO_ENDPOINT`: Your Bagisto Shop URL.
|
|
22
|
+
* `NEXT_PUBLIC_BAGISTO_STOREFRONT_KEY`: Your Bagisto Storefront Key.
|
|
23
|
+
* `NEXT_PUBLIC_NEXT_AUTH_URL`: Your Headless Shop URL.
|
|
24
|
+
* `NEXT_PUBLIC_NEXT_AUTH_SECRET`: Your Headless Shop Secret.
|
|
25
|
+
* `COMPANY_NAME`: Your company name.
|
|
26
|
+
5. **Generates `.env.local`**: Saves your configuration to a `.env.local` file so you're ready to start developing immediately.
|
|
27
|
+
|
|
28
|
+
## After Installation
|
|
29
|
+
|
|
30
|
+
Once the setup is complete, you can start your development server:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cd <your-project-name>
|
|
34
|
+
npm run dev
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Documentation
|
|
38
|
+
|
|
39
|
+
* **Bagisto Headless eCommerce**: [https://bagisto.com/en/headless-ecommerce/](https://bagisto.com/en/headless-ecommerce/)
|
|
40
|
+
* **Headless Documentation**: [https://headless-doc.bagisto.com/](https://headless-doc.bagisto.com/)
|
|
41
|
+
* **API Documentation**: [https://api-docs.bagisto.com/](https://api-docs.bagisto.com/)
|
|
42
|
+
* **GitHub Repository**: [https://github.com/bagisto/nextjs-commerce](https://github.com/bagisto/nextjs-commerce)
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
Developed by [Bagisto](https://bagisto.com/).
|
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
import figlet from "figlet";
|
|
3
2
|
import gradient from "gradient-string";
|
|
4
3
|
import chalk from "chalk";
|
|
@@ -106,11 +105,10 @@ async function promptEnvVariables(projectName) {
|
|
|
106
105
|
});
|
|
107
106
|
|
|
108
107
|
const questions = [
|
|
109
|
-
{ key: "NEXT_PUBLIC_BAGISTO_ENDPOINT", message: "Enter Your Bagisto
|
|
110
|
-
{ key: "NEXT_PUBLIC_APP_URL", message: "Enter Your app URL:" },
|
|
111
|
-
{ key: "NEXT_PUBLIC_NEXT_AUTH_URL", message: "Enter Your auth URL:" },
|
|
112
|
-
{ key: "NEXT_PUBLIC_NEXT_AUTH_SECRET", message: "Enter Your auth secret:" },
|
|
108
|
+
{ key: "NEXT_PUBLIC_BAGISTO_ENDPOINT", message: "Enter Your Bagisto Shop URL:" },
|
|
113
109
|
{ key: "NEXT_PUBLIC_BAGISTO_STOREFRONT_KEY", message: "Enter Your Bagisto Storefront Key:" },
|
|
110
|
+
{ key: "NEXT_PUBLIC_NEXT_AUTH_URL", message: "Enter Your Headless Shop URL:" },
|
|
111
|
+
{ key: "NEXT_PUBLIC_NEXT_AUTH_SECRET", message: "Enter Your Headless Shop Secret:" },
|
|
114
112
|
{ key: "COMPANY_NAME", message: "Enter Your company name:", default: "Webkul Software (Registered in India)" },
|
|
115
113
|
];
|
|
116
114
|
|
|
@@ -186,4 +184,4 @@ async function main() {
|
|
|
186
184
|
main().catch((err) => {
|
|
187
185
|
spinner.fail(chalk.red(`Error: ${err.message}`));
|
|
188
186
|
process.exit(1);
|
|
189
|
-
});
|
|
187
|
+
});
|