Skip to content

Commit 05c7993

Browse files
authored
Merge pull request #93 from js-template/top-bar-backend-components-1x
Top bar backend components 1x
2 parents 2392c6c + a909808 commit 05c7993

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+951
-430
lines changed

docs/docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vercel

docs/docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"name": "docs",
2+
"name": "@padmadev/docs",
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next",
6+
"dev": "next dev",
77
"start": "next start",
88
"build": "next build",
99
"export": "next export"
1010
},
11-
"author": "Shu Ding",
11+
"author": "Zelal",
1212
"license": "MIT",
1313
"dependencies": {
1414
"clsx": "^1.2.1",

docs/docs/pages/_meta.json

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
{
22
"index": {
33
"title": "Welcome to Padma",
4+
"display": "hidden",
5+
"type": "page",
46
"theme": {
5-
"toc": true
7+
"layout": "full"
68
}
79
},
8-
"get-started": {
9-
"title": "Get Started"
10-
},
11-
"core-concepts": {
12-
"title": "Core Concepts",
13-
"theme": {
14-
"toc": true
15-
}
16-
},
17-
"guides": {
18-
"title": "User Guides",
10+
"user-docs": {
11+
"title": "Documentation",
12+
"type": "page",
1913
"theme": {
20-
"toc": true
14+
"layout": "full"
2115
}
2216
},
23-
"deployment": {
24-
"title": "Deployment",
17+
18+
"cli-docs": {
19+
"title": "Padma CLI Docs",
20+
"type": "page",
2521
"theme": {
26-
"toc": true
22+
"layout": "full"
2723
}
2824
},
29-
"contribution-guide": {
30-
"title": "Contribution Guide",
25+
"plugins": {
26+
"title": "Plugins",
27+
"type": "page",
3128
"theme": {
32-
"toc": true
29+
"layout": "full"
3330
}
3431
}
3532
}

docs/docs/pages/cli-docs/_meta.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"intro": {
3+
"title": "Introduction",
4+
"theme": {
5+
"toc": true
6+
}
7+
},
8+
"commands": {
9+
"title": "CLI Commands",
10+
"theme": {
11+
"toc": true
12+
}
13+
},
14+
"packages": {
15+
"title": "Packages",
16+
"theme": {
17+
"toc": true
18+
}
19+
},
20+
"strapi plugin": {
21+
"title": "Strapi Plugin",
22+
"theme": {
23+
"toc": true
24+
}
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"index": {
3+
"title": "Create",
4+
"theme": {
5+
"toc": true
6+
}
7+
},
8+
"generate": {
9+
"title": "Generate",
10+
"theme": {
11+
"toc": true
12+
}
13+
},
14+
"dev": {
15+
"title": "Dev",
16+
"theme": {
17+
"toc": true
18+
}
19+
},
20+
"build": {
21+
"title": "Build",
22+
"theme": {
23+
"toc": true
24+
}
25+
}
26+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
### --- Docs are in progress ---
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
# Development Command
3+
4+
## Overview
5+
The `dev` command starts the development server for the `@padmadev/core` package. It validates the project setup and uses the appropriate package manager to run the development server in the `core` folder.
6+
7+
## **Usage**
8+
Run the following command:
9+
10+
```bash
11+
npx padma dev
12+
```
13+
14+
15+
## **Command Behavior**
16+
1. **Verify Settings File**
17+
- Ensures `padma.settings.json` exists in the project root.
18+
- Validates that the file defines an `activeTheme`.
19+
20+
2. **Validate Core Directory**
21+
- Confirms the `core` folder exists.
22+
- Suggests running `npx padma generate core` if the folder is missing.
23+
24+
3. **Detect Package Manager**
25+
- Detects the package manager based on the presence of lock files:
26+
- `yarn.lock` → Yarn
27+
- `pnpm-lock.yaml` → pnpm
28+
- `package-lock.json` → npm
29+
30+
4. **Run the Dev Command**
31+
- Executes the corresponding `dev` script:
32+
- `yarn dev`, `pnpm dev`, or `npm run dev`.
33+
34+
---
35+
36+
## **Example Output**
37+
38+
### Successful Start
39+
```plaintext
40+
Running "npm run dev" in /path/to/project/core
41+
> core@0.1.0 dev /path/to/project/core
42+
> nodemon index.js
43+
Development server running at http://localhost:3000
44+
```
45+
---
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
2+
# Generate Command
3+
4+
## Overview
5+
The `generate` command in the Padma CLI allows you to quickly create predefined folders and templates to streamline project setup and development. Two main subcommands are available: `core` and `theme`.
6+
7+
| Subcommand | Description | Flags |
8+
|------------|--------------------------------|---------------------------|
9+
| `core` | Generates the core folder. | None |
10+
| `theme` | Generates a theme folder. | `--name` / `-n` |
11+
12+
13+
14+
### **Generate Core**
15+
The `core` command generates the core folder in the current project. It copies the necessary files and templates from the predefined core template directory.
16+
17+
#### **Usage**
18+
Run the following command:
19+
20+
```bash
21+
npx padma generate core
22+
```
23+
24+
#### **Description**
25+
- This command will:
26+
- Copy the core template files into a folder named `core` in the current directory.
27+
- Ensure that the core folder doesn’t already exist to prevent overwriting files.
28+
- Log success or error messages for user feedback.
29+
30+
#### **Example Output**
31+
```plaintext
32+
Generating "core"...
33+
Template folder: /path/to/templates/core
34+
Target folder: /path/to/current-project/core
35+
Successfully generated "core".
36+
```
37+
38+
39+
### **Generate Theme**
40+
The `theme` command generates a customizable theme folder inside the `packages` directory of your project.
41+
42+
#### **Usage**
43+
Run the following command:
44+
45+
```bash
46+
npx padma generate theme --name custom-theme
47+
```
48+
49+
#### **Flags**
50+
- **`--name` | `-n`**: Specifies the name of the theme.
51+
Default: `custom-theme`
52+
53+
#### **Description**
54+
- This command will:
55+
- Copy the theme template files into a folder named after the specified theme.
56+
- Place the theme folder inside the `packages` directory.
57+
- Log success or error messages for user feedback.
58+
59+
#### **Example**
60+
```bash
61+
npx padma generate theme --name awesome-theme
62+
```
63+
64+
#### **Example Output**
65+
```plaintext
66+
Generating theme "awesome-theme"...
67+
Template folder: /path/to/templates/theme
68+
Target folder: /path/to/current-project/packages/awesome-theme
69+
Theme generation successful! Run your theme from "packages/awesome-theme".
70+
```
71+
72+
---
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
# Create Command
3+
4+
## Description
5+
The `create` command in the Padma CLI is used to set up a new Padma project with minimal effort. It includes prompts for selecting configuration options and initializes a project with all necessary files.
6+
7+
8+
## Usage
9+
10+
Run the following command to create a new Padma project:
11+
12+
```bash
13+
npx padma create <project-name>
14+
```
15+
16+
For example:
17+
18+
```bash
19+
npx padma create my-project
20+
```
21+
22+
---
23+
24+
## Flags
25+
26+
- **`--force` | `-f`**:
27+
Forces the creation of the project even if the target folder already exists.
28+
Example:
29+
```bash
30+
npx padma create my-project
31+
```
32+
33+
- **`--theme` | `-t`**:
34+
Installs a specific theme during project setup.
35+
Example:
36+
```bash
37+
npx padma create my-project --theme blank-theme
38+
```
39+
40+
---
41+
42+
## Step-by-Step Guide
43+
44+
### 1. Select a Package Manager
45+
During the setup process, you will be prompted to select your preferred package manager. Available options include `npm`, `yarn`, and `pnpm`. If you're unsure, you can select the default one.
46+
47+
**Example Prompt**:
48+
```plaintext
49+
? Which package manager would you like to use? (npm, yarn, pnpm)
50+
```
51+
52+
### 2. Initialize Git (Optional)
53+
You will be asked if you'd like to initialize a Git repository for your project. If you select "Yes," the CLI will automatically set up a Git repository, add all files, and make the initial commit.
54+
55+
**Example Prompt**:
56+
```plaintext
57+
? Would you like to initialize a Git repository? (y/n)
58+
```
59+
60+
---
61+
62+

docs/docs/pages/cli-docs/intro.mdx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
# CLI Commands
3+
API reference of Padma CLI commands.
4+
5+
The Padma command-line tool (CLI) is the main entry point for creating and managing Padma projects. It provides functionality such as running a development server, generating templates, or building your application for deployment.
6+
7+
## How to Use Padma CLI
8+
The Padma CLI commands are available via npm. You can run any Padma command by using:
9+
10+
```bash
11+
npx padma <padma-command>
12+
```
13+
14+
Run `npx padma --help` for full help and a list of available commands.
15+
16+
---
17+
18+
## Commands
19+
20+
### [Create Commands](/cli-docs/commands/)
21+
These commands allow you to create Padma projects or packages:
22+
23+
- **create**
24+
Initializes a new Padma project.
25+
26+
---
27+
28+
### [Generate Commands](/cli-docs/commands/generate/)
29+
These commands allow you to create Padma projects or packages:
30+
31+
- **generate core**
32+
Generates the core folder structure in your project.
33+
34+
- **generate theme [theme-name]**
35+
Generates a theme folder inside the `packages` directory. If no theme name is provided, it defaults to `custom-theme`.
36+
37+
---
38+
39+
### [Dev Commands](cli-docs/commands/dev)
40+
These commands allow you to run a Padma project in development or production mode:
41+
42+
- **dev**
43+
Starts a development server for your Padma application.
44+
45+
- **serve**
46+
Serves a built Padma application in production mode.
47+
48+
---
49+
50+
### [Build Commands](build-commands)
51+
These commands allow you to build or analyze your Padma project:
52+
53+
- **build**
54+
Generates production-ready code for deployment.

0 commit comments

Comments
 (0)