frontend-auto-cms 1.0.16 → 1.0.18
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 +80 -49
- package/dist/runtime/dashboard.js +591 -531
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,79 +1,110 @@
|
|
|
1
1
|
# frontend-auto-cms
|
|
2
2
|
|
|
3
|
-
Turn any frontend
|
|
3
|
+
Turn any frontend into an editable mini-CMS with one import and a dashboard route.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install frontend-auto-cms
|
|
9
|
-
```
|
|
5
|
+
- Repository: [https://github.com/Gabo-Tech/frontend-auto-cms](https://github.com/Gabo-Tech/frontend-auto-cms)
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- asks for a passcode,
|
|
14
|
-
- scans project files (`.html`, `.jsx`, `.tsx`, `.vue`, `.astro`, `.svelte`),
|
|
15
|
-
- generates `cms-content.json`, `.cms-config.json`, and `public/cms-runtime-auth.json`.
|
|
16
|
-
- optionally configures GitHub/GitLab publishing in `.cms-hosting.json` + `public/cms-hosting.json`.
|
|
17
|
-
- asks for a custom dashboard route and auto-detects editable pages into `public/cms-settings.json`.
|
|
18
|
-
- token is entered manually in dashboard at publish time (not stored in config).
|
|
19
|
-
|
|
20
|
-
If setup prompts are skipped during install, run:
|
|
7
|
+
## Quick Start
|
|
21
8
|
|
|
22
9
|
```bash
|
|
10
|
+
npm i frontend-auto-cms@latest
|
|
23
11
|
npx frontend-auto-cms setup
|
|
24
12
|
```
|
|
25
13
|
|
|
26
|
-
|
|
27
|
-
- Vercel (`vercel.json` rewrites)
|
|
28
|
-
- Netlify / Render Static (`public/_redirects`)
|
|
29
|
-
- Firebase Hosting (`firebase.json` rewrites)
|
|
30
|
-
- GitHub Pages (`public/.nojekyll`)
|
|
31
|
-
- Heroku / Fly.io / DigitalOcean (generates `cms-hosting-notes.md` with server rewrite snippets)
|
|
32
|
-
|
|
33
|
-
If you choose GitHub as hosting provider, setup also creates a GitHub Actions workflow (`.github/workflows/frontend-auto-cms-apply.yml`) that applies `cms-export.patch.json` to source files and commits the result automatically.
|
|
34
|
-
|
|
35
|
-
## Use in app
|
|
14
|
+
Then add this in your app entry file:
|
|
36
15
|
|
|
37
16
|
```ts
|
|
38
17
|
import "frontend-auto-cms";
|
|
39
18
|
```
|
|
40
19
|
|
|
41
|
-
|
|
20
|
+
Open your dashboard route (default: `/dashboard`) and start editing.
|
|
42
21
|
|
|
43
|
-
|
|
44
|
-
<script type="module" src="/node_modules/frontend-auto-cms/dist/runtime/dashboard.js"></script>
|
|
45
|
-
```
|
|
22
|
+
## Install
|
|
46
23
|
|
|
47
|
-
|
|
24
|
+
```bash
|
|
25
|
+
npm i frontend-auto-cms@latest
|
|
26
|
+
```
|
|
48
27
|
|
|
49
|
-
|
|
50
|
-
- page tabs (About, Contact, Privacy, Terms, etc.),
|
|
51
|
-
- live preview iframe,
|
|
52
|
-
- one unified ordered editor list for non-technical users.
|
|
28
|
+
## Setup
|
|
53
29
|
|
|
54
|
-
|
|
30
|
+
Run setup in your app project:
|
|
55
31
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
32
|
+
```bash
|
|
33
|
+
npx frontend-auto-cms setup
|
|
34
|
+
```
|
|
59
35
|
|
|
60
|
-
|
|
36
|
+
Setup will:
|
|
37
|
+
- ask for CMS passcode
|
|
38
|
+
- configure dashboard route
|
|
39
|
+
- detect editable pages/files
|
|
40
|
+
- generate runtime config files
|
|
41
|
+
- configure hosting and publish provider (GitHub/GitLab)
|
|
42
|
+
- generate `public/cms-route-map.json` for route-to-source mapping
|
|
61
43
|
|
|
62
|
-
|
|
44
|
+
## Real setup example
|
|
63
45
|
|
|
64
46
|
```bash
|
|
65
|
-
npm
|
|
47
|
+
anonymous@anonymous:~/Documents/Programming/testlanding$ npm i frontend-auto-cms@latest
|
|
48
|
+
|
|
49
|
+
changed 1 package, and audited 198 packages in 970ms
|
|
50
|
+
|
|
51
|
+
38 packages are looking for funding
|
|
52
|
+
run `npm fund` for details
|
|
53
|
+
|
|
54
|
+
found 0 vulnerabilities
|
|
55
|
+
anonymous@anonymous:~/Documents/Programming/testlanding$ npx frontend-auto-cms setup
|
|
56
|
+
✔ Choose your CMS passcode: **********
|
|
57
|
+
✔ Dashboard route path (for editors): /dashboard
|
|
58
|
+
✔ Enable automatic translation via third-party API? Yes
|
|
59
|
+
✔ Where is your app deployed (for dashboard routing)? Vercel (auto-add
|
|
60
|
+
dashboard rewrites)
|
|
61
|
+
✔ Where is your code hosted for Save & Publish? GitHub
|
|
62
|
+
✔ Repository slug (owner/repo or group/project): Gabo-Tech/testlanding
|
|
63
|
+
✔ Branch to publish to: main
|
|
64
|
+
|
|
65
|
+
frontend-auto-cms initialized successfully.
|
|
66
|
+
- Config: .cms-config.json
|
|
67
|
+
- Content: cms-content.json
|
|
68
|
+
- Assets directory: public/cms-assets
|
|
69
|
+
- Runtime auth: public/cms-runtime-auth.json
|
|
70
|
+
- Hosting config: .cms-hosting.json
|
|
71
|
+
- Runtime hosting: public/cms-hosting.json
|
|
72
|
+
- Runtime settings: public/cms-settings.json
|
|
73
|
+
- Runtime locales: public/cms-locales.json
|
|
74
|
+
- Hosting routing: vercel.json rewrites: unchanged
|
|
75
|
+
- Automation: GitHub auto-apply workflow: unchanged
|
|
76
|
+
- Detected pages: /, /about, /careers, /contact, /faq, /home, /notfound, /services
|
|
77
|
+
|
|
78
|
+
Next steps:
|
|
79
|
+
1) Add `import "frontend-auto-cms";` to your frontend entry file.
|
|
80
|
+
2) Open /dashboard to edit your site.
|
|
81
|
+
3) After edits, click Save + Publish (or export patch and run apply).
|
|
66
82
|
```
|
|
67
83
|
|
|
68
|
-
|
|
84
|
+
## Use In Your App
|
|
85
|
+
|
|
86
|
+
Add this to your frontend entry file:
|
|
69
87
|
|
|
70
|
-
|
|
88
|
+
```ts
|
|
89
|
+
import "frontend-auto-cms";
|
|
90
|
+
```
|
|
71
91
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
92
|
+
Then open your dashboard route (default: `/dashboard`).
|
|
93
|
+
|
|
94
|
+
## Save + Publish behavior
|
|
95
|
+
|
|
96
|
+
- Applies edits in the dashboard preview immediately.
|
|
97
|
+
- Builds source patch operations from editable nodes.
|
|
98
|
+
- Resolves route mappings using `public/cms-route-map.json`.
|
|
99
|
+
- Publishes content/locales/patch files.
|
|
100
|
+
- Updates real repository source files via GitHub/GitLab APIs when configured.
|
|
101
|
+
|
|
102
|
+
## Commands
|
|
103
|
+
|
|
104
|
+
- `npx frontend-auto-cms setup` - regenerate config, pages, and route map.
|
|
105
|
+
- `npx frontend-auto-cms apply` - apply `cms-export.patch.json` locally.
|
|
106
|
+
- `npx frontend-auto-cms doctor` - quick installation check.
|
|
76
107
|
|
|
77
108
|
## Security note
|
|
78
109
|
|
|
79
|
-
|
|
110
|
+
The runtime passcode gate is lightweight and intended for editor access control in frontend environments. Enter provider token manually during publish; it is not persisted in config files. Prefer short-lived, repo-scoped tokens.
|