|
1 | 1 | # Schematics for astro
|
2 | 2 |
|
3 |
| -These schematics allow you to automate daily task as: Create components, layouts and pages. |
| 3 | +Astro Schematics streamlines your development workflow by automating routine tasks. Easily create components, layouts, and pages with our tools, supercharged by Project Builder. |
4 | 4 |
|
5 |
| -This schematics are powered by [Project Builder](https://schematics.pbuilder.dev/) |
6 |
| - |
7 |
| -We recommend to add this library to your astro project: |
| 5 | +To integrate this powerful toolkit into your Astro project, execute: |
8 | 6 |
|
9 | 7 | ```sh
|
10 | 8 | npx @pbuilder/cli add @pbuilder/astro
|
11 | 9 | ```
|
12 | 10 |
|
13 |
| -## Note |
| 11 | +## Important Notes |
| 12 | + |
| 13 | +* **CLI Installation:** Running the command above might prompt you to install the CLI. This is highly recommended as the CLI significantly simplifies the creation process for components, layouts, and pages beyond the capabilities of the generic `@pbuilder/cli`. |
14 | 14 |
|
15 |
| -You will notice that the previous command will tell you if you want to install a CLI, the reason is because the CLI will help you to create: components, layouts and pages easier than if you use the generic @pbuilder/cli CLI. |
| 15 | +* **Discoverability:** For detailed command options, append `--help` to learn about all the available parameters and flags. |
16 | 16 |
|
17 |
| -## Note 2 |
| 17 | +## Quickstart Guides |
18 | 18 |
|
19 |
| -For any command that you want to know the allowed options you can use the flag: `--help`. |
| 19 | +### Creating Components |
20 | 20 |
|
21 |
| -## Create components |
| 21 | +To generate a new component, use: |
22 | 22 |
|
23 | 23 | ```sh
|
24 | 24 | pastro g c <component-name>
|
25 | 25 | ```
|
26 | 26 |
|
| 27 | +Or, for a direct approach: |
| 28 | + |
27 | 29 | ```sh
|
28 | 30 | npx @pbuilder/astro-cli g c <component-name>
|
29 | 31 | ```
|
30 | 32 |
|
31 | 33 | ## Create layouts
|
32 | 34 |
|
| 35 | +Generate a new layout by running: |
| 36 | + |
33 | 37 | ```sh
|
34 | 38 | pastro g l <layout-name>
|
35 | 39 | ```
|
36 | 40 |
|
| 41 | +Alternatively: |
| 42 | + |
37 | 43 | ```sh
|
38 | 44 | npx @pbuilder/astro-cli g l <layout-name>
|
39 | 45 | ```
|
40 | 46 |
|
41 | 47 | ## Create Pages
|
42 | 48 |
|
| 49 | +For page creation, specify the type and layout: |
| 50 | + |
43 | 51 | ```sh
|
44 | 52 | pastro g p <page-name> --type [md, mdx, astro] --layout <layout file name>
|
45 | 53 | ```
|
46 | 54 |
|
| 55 | +Or use the direct method: |
| 56 | + |
47 | 57 | ```sh
|
48 | 58 | npx @pbuilder/astro-cli g p <page-name> --type [md, mdx, astro] --layout <layout file name>
|
49 | 59 | ```
|
50 | 60 |
|
51 |
| -## Using schematics without the pastro cli |
| 61 | +## Beyond the CLI |
52 | 62 |
|
53 |
| -You can use the generic cli for schematics named `pbuilder`. The reason is because some schematics no matter the frameworks you can will use them in every Javascript envioriment. |
| 63 | +## Utilizing Generic Schematics |
| 64 | + |
| 65 | +For projects that don't directly utilize `pastro` CLI, the `pbuilder` CLI remains versatile across different JavaScript environments: |
54 | 66 |
|
55 | 67 | ```sh
|
56 |
| -npx @pbuilder/cli exec @pbuilder/astro <schematic-name(page, component, layout)> --name=<name> [options] |
| 68 | +npx @pbuilder/cli exec @pbuilder/astro <schematic-name> --name=<name> [options] |
| 69 | + |
57 | 70 | ```
|
58 | 71 |
|
59 |
| -For example: |
| 72 | +For instance, to create a component: |
60 | 73 |
|
61 | 74 | ```sh
|
62 | 75 | npx @pbuilder/cli exec @pbuilder/astro c --name=MyComponent2
|
|
0 commit comments