@nuxtus/nuxtus 1.0.5 → 1.0.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 +32 -2
- package/TODO +3 -1
- package/changelog.md +6 -0
- package/client/package.json +3 -2
- package/client/server/api/directus/collection.post.ts +12 -0
- package/package.json +1 -1
- package/server/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
# Nuxtus
|
|
2
2
|
|
|
3
|
-
A website w/ CMS boilerplate using [Directus](https://directus.io) for backend CMS and [Nuxt](https://nuxtjs.org) (w/ Tailwind CSS) for frontend.
|
|
3
|
+
A website w/ CMS boilerplate using [Directus](https://directus.io) for backend CMS and [Nuxt](https://nuxtjs.org) (w/ Tailwind CSS) for frontend that can also **automagically** create pages when you create Directus collections.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
https://user-images.githubusercontent.com/324026/175020548-57ee94b3-dee4-4b12-a8c8-6c0f1a94fab4.mov
|
|
7
|
+
|
|
4
8
|
|
|
5
9
|
The purpose of this template is to be a quick-start for developing a website with Nuxt.js using Directus as the backend. The end result can be a static website or dynamically pull data from Directus depending on your preference.
|
|
6
10
|
|
|
7
11
|
It also includes [nuxtus/cli]("https://github.com/nuxtus/cli") which provides a command line interface for quickly creating multiple index/detail pages from any Directus collections.
|
|
8
12
|
|
|
13
|
+
https://user-images.githubusercontent.com/324026/175452950-46bd51a6-3fd9-441d-80fd-c6bbfaa01929.mp4
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
9
17
|
- [Directus](https://directus.io)
|
|
10
18
|
- [Nuxt](https://nuxtjs.org)
|
|
11
19
|
- [Tailwind CSS](https://tailwindcss.nuxtjs.org/)
|
|
@@ -49,7 +57,27 @@ From inside your project folder:
|
|
|
49
57
|
$ npm start
|
|
50
58
|
```
|
|
51
59
|
|
|
52
|
-
###
|
|
60
|
+
### Automatically creating pages
|
|
61
|
+
|
|
62
|
+
**Nuxtus automagically creates Nuxt pages as soon as you create a new Directus collection!**
|
|
63
|
+
|
|
64
|
+
Nuxtus includes a POST endpoint located /api/directus/collection that will run in development. If you used `npx create-nuxtus` to create your Nuxtus project and selected "yes" to automatically creating pages from Directus then this is already configured in Directus for you.
|
|
65
|
+
|
|
66
|
+
If not, create a new Flow in Directus as follows:
|
|
67
|
+
|
|
68
|
+
#### Trigger
|
|
69
|
+
|
|
70
|
+
Type: action
|
|
71
|
+
Scope: items.create
|
|
72
|
+
Collections: directus_collections
|
|
73
|
+
|
|
74
|
+
#### Webhook / Request URL
|
|
75
|
+
|
|
76
|
+
URL: http://localhost:3000/api/directus/collection
|
|
77
|
+
Method: POST
|
|
78
|
+
Request Body: `{{$last.payload}}`
|
|
79
|
+
|
|
80
|
+
### Manually creating pages
|
|
53
81
|
|
|
54
82
|
Nuxtus includes Nuxtus CLI which will automatically generate listing and view pages of any Directus collections. To use it:
|
|
55
83
|
|
|
@@ -64,6 +92,8 @@ For more details on [Nuxtus CLI](https://github.com/nuxtus/cli) click [here](htt
|
|
|
64
92
|
|
|
65
93
|
By default Directus is configured to accept CORS from any origin. Nuxtus suggests modifying this for your production deployment.
|
|
66
94
|
|
|
95
|
+
If you chose to install, remove the Nuxtus hook extension by deleting the folder `server/extensions/hooks/nuxtus-hook` from your project.
|
|
96
|
+
|
|
67
97
|
## Manual setup
|
|
68
98
|
|
|
69
99
|
Clone this repo onto your local machine, remove the remote git origin and add a new one. Then follow the [manual install instructions](#directus).
|
package/TODO
CHANGED
|
@@ -11,5 +11,7 @@ Todo:
|
|
|
11
11
|
✔ Check node version for compatibility in create-app.js @done(22-06-16 22:07)
|
|
12
12
|
☐ Look at https://renovatebot.com/
|
|
13
13
|
☐ Documentation: https://docusaurus.io/ or https://vuepress.vuejs.org/
|
|
14
|
-
|
|
14
|
+
✔ Create Directus flow via Directus API @done(22-07-04 17:46)
|
|
15
15
|
☐ Add ability to automatically update .env for none SQLite databases
|
|
16
|
+
☐ Can I HMR when adding new pages/routes?
|
|
17
|
+
☐ Add all questions in create-app to start of process for better user flow
|
package/changelog.md
CHANGED
package/client/package.json
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@nuxtjs/google-fonts": "^1.3.0",
|
|
11
11
|
"@nuxtjs/tailwindcss": "^5.0.4",
|
|
12
|
-
"
|
|
13
|
-
"@nuxtus/
|
|
12
|
+
"@nuxtus/cli": "^1.0.5",
|
|
13
|
+
"@nuxtus/generator": "1.0.0",
|
|
14
|
+
"nuxt": "3.0.0-rc.4"
|
|
14
15
|
},
|
|
15
16
|
"dependencies": {
|
|
16
17
|
"@headlessui/vue": "^1.6.1",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createPage } from "@nuxtus/generator"
|
|
2
|
+
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
if (process.env.NODE_ENV !== "production") {
|
|
5
|
+
const body = await useBody(event)
|
|
6
|
+
// TODO: Wrap in try/catch and return HTTP error if errors
|
|
7
|
+
createPage(body.collection, body.singleton)
|
|
8
|
+
return {
|
|
9
|
+
api: "ok",
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
})
|
package/package.json
CHANGED