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 CHANGED
@@ -1,79 +1,110 @@
1
1
  # frontend-auto-cms
2
2
 
3
- Turn any frontend app into a mini-CMS with one import and a dedicated editor route.
3
+ Turn any frontend into an editable mini-CMS with one import and a dashboard route.
4
4
 
5
- ## Install
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
- Postinstall runs a setup wizard that:
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
- Setup also asks where your app is deployed and can auto-configure routing for:
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
- Or:
20
+ Open your dashboard route (default: `/dashboard`) and start editing.
42
21
 
43
- ```html
44
- <script type="module" src="/node_modules/frontend-auto-cms/dist/runtime/dashboard.js"></script>
45
- ```
22
+ ## Install
46
23
 
47
- Run your app and open your configured dashboard route (default: `/dashboard`).
24
+ ```bash
25
+ npm i frontend-auto-cms@latest
26
+ ```
48
27
 
49
- The dashboard has:
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
- ## Commands
30
+ Run setup in your app project:
55
31
 
56
- - `npx frontend-auto-cms setup` - rerun scanner and regenerate content baseline.
57
- - `npx frontend-auto-cms apply` - apply `cms-export.patch.json` generated from dashboard.
58
- - `npx frontend-auto-cms doctor` - quick installation check.
32
+ ```bash
33
+ npx frontend-auto-cms setup
34
+ ```
59
35
 
60
- ## i18n Local AI
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
- Install optional peer:
44
+ ## Real setup example
63
45
 
64
46
  ```bash
65
- npm install @xenova/transformers
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
- In the CMS i18n tab, click **Auto-translate all languages** to generate locale dictionaries in memory, then export patch and apply.
84
+ ## Use In Your App
85
+
86
+ Add this to your frontend entry file:
69
87
 
70
- ## Persistence
88
+ ```ts
89
+ import "frontend-auto-cms";
90
+ ```
71
91
 
72
- - Live edits apply immediately to DOM.
73
- - Content and locales are cached in `localStorage`.
74
- - Save + Publish pushes changes to configured hosting provider or downloads `cms-export.patch.json` as fallback.
75
- - CLI apply writes source replacements and locale JSON files.
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
- Browser runtime passcode gate is intentionally lightweight for local editing workflows. Provider token is entered manually for each publish and is not stored, but is still handled in browser memory during that action. Prefer short-lived tokens with restricted repo scope or move publishing behind a secure backend proxy.
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.