strapi2front 0.1.4 → 0.1.6
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 +97 -0
- package/package.json +5 -4
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://strapi2front.dev">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://strapi2front.dev/logo-dark.svg">
|
|
5
|
+
<img alt="strapi2front logo" src="https://strapi2front.dev/logo-light.svg" height="128">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
<h1>strapi2front</h1>
|
|
9
|
+
|
|
10
|
+
<a href="https://elevenestudio.com"><img alt="Made by Eleven Estudio" src="https://img.shields.io/badge/MADE%20BY%20Eleven%20Estudio-000000.svg?style=for-the-badge&labelColor=000"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/strapi2front"><img alt="NPM version" src="https://img.shields.io/npm/v/strapi2front.svg?style=for-the-badge&labelColor=000000"></a>
|
|
12
|
+
<a href="https://github.com/Eleven-Estudio/strapi2front/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/npm/l/strapi2front.svg?style=for-the-badge&labelColor=000000"></a>
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
## The Strapi TypeScript Generator
|
|
17
|
+
|
|
18
|
+
`strapi2front` is a CLI tool that generates TypeScript types, services, and Astro Actions from your Strapi CMS schema. One command syncs everything, keeping your frontend perfectly typed.
|
|
19
|
+
|
|
20
|
+
## Getting Started
|
|
21
|
+
|
|
22
|
+
Initialize strapi2front in your project:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx strapi2front@latest init
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then sync your types whenever your Strapi schema changes:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx strapi2front sync
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
⊹ **Type Generation** - Auto-generate TypeScript interfaces from your Strapi schema\
|
|
37
|
+
⊹ **Service Generation** - Create typed service functions for all content types\
|
|
38
|
+
⊹ **Astro Actions** - Generate type-safe Astro Actions for client/server data fetching\
|
|
39
|
+
⊹ **Smart Detection** - Automatically detects framework, TypeScript, and package manager\
|
|
40
|
+
⊹ **Strapi v4 & v5** - Full support for both Strapi versions\
|
|
41
|
+
⊹ **By-Feature Structure** - Organize generated code by feature (screaming architecture)
|
|
42
|
+
|
|
43
|
+
## Generated Output
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
src/strapi/
|
|
47
|
+
├── collections/
|
|
48
|
+
│ └── article/
|
|
49
|
+
│ ├── types.ts # TypeScript interfaces
|
|
50
|
+
│ ├── service.ts # Data fetching functions
|
|
51
|
+
│ └── actions.ts # Astro Actions
|
|
52
|
+
├── singles/
|
|
53
|
+
│ └── homepage/
|
|
54
|
+
│ ├── types.ts
|
|
55
|
+
│ └── service.ts
|
|
56
|
+
├── components/
|
|
57
|
+
│ └── seo.ts
|
|
58
|
+
└── shared/
|
|
59
|
+
├── utils.ts # Utility types
|
|
60
|
+
├── client.ts # Strapi client
|
|
61
|
+
└── locales.ts # i18n support
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Requirements
|
|
65
|
+
|
|
66
|
+
- Node.js 18+
|
|
67
|
+
- Strapi v4 or v5
|
|
68
|
+
- Astro 4+ (more frameworks coming soon)
|
|
69
|
+
|
|
70
|
+
## Learn more
|
|
71
|
+
|
|
72
|
+
⊹ Visit [strapi2front.dev](https://strapi2front.dev) to learn more about the project.\
|
|
73
|
+
⊹ Visit [strapi2front.dev/docs](https://strapi2front.dev/docs) to view the full documentation.
|
|
74
|
+
|
|
75
|
+
## Contributing
|
|
76
|
+
|
|
77
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
78
|
+
|
|
79
|
+
## Security
|
|
80
|
+
|
|
81
|
+
If you believe you have found a security vulnerability, we encourage you to let us know right away.
|
|
82
|
+
|
|
83
|
+
Please report any issues to [hello@elevenestudio.com](mailto:hello@elevenestudio.com).
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT - see [LICENSE](LICENSE) for details.
|
|
88
|
+
|
|
89
|
+
## Disclaimer
|
|
90
|
+
|
|
91
|
+
This is a community project and is not affiliated with, endorsed by, or officially connected to [Strapi](https://strapi.io). The name "Strapi" is used solely to indicate compatibility with the Strapi CMS.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
<div align="center">
|
|
96
|
+
Made with ❤️ by <a href="https://elevenestudio.com">Eleven Estudio</a>
|
|
97
|
+
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi2front",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Generate TypeScript types, services, and framework actions from your Strapi schema",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"main": "./dist/index.js",
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"files": [
|
|
18
|
-
"dist"
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
19
20
|
],
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"@clack/prompts": "^0.7.0",
|
|
@@ -26,8 +27,8 @@
|
|
|
26
27
|
"picocolors": "^1.0.0",
|
|
27
28
|
"pkg-types": "^1.0.0",
|
|
28
29
|
"@strapi2front/client": "0.1.0",
|
|
29
|
-
"@strapi2front/core": "0.1.
|
|
30
|
-
"@strapi2front/generators": "0.1.
|
|
30
|
+
"@strapi2front/core": "0.1.5",
|
|
31
|
+
"@strapi2front/generators": "0.1.5"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"tsup": "^8.0.0",
|