@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 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
- ### Creating pages
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
- Look into using a Directus hook to automatically generate the Nuxt pages!
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
@@ -1,5 +1,11 @@
1
1
  # Nuxtus
2
2
 
3
+ ## 1.0.6
4
+
5
+ - Add server api endpoint to be used as Directus webhook
6
+ - Update to Directus 9.13.0
7
+ - Update readme with details on using Collections hook
8
+
3
9
  ## 1.0.5
4
10
 
5
11
  - Update nuxtus-cli to v1.0.3
@@ -9,8 +9,9 @@
9
9
  "devDependencies": {
10
10
  "@nuxtjs/google-fonts": "^1.3.0",
11
11
  "@nuxtjs/tailwindcss": "^5.0.4",
12
- "nuxt": "3.0.0-rc.4",
13
- "@nuxtus/cli": "^1.0.3"
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxtus/nuxtus",
3
3
  "description": "Directus/Nuxt boilerplate with Tailwind CSS.",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/nuxtus/nuxtus.git"
@@ -11,7 +11,7 @@
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "directus": "^9.10.0",
14
+ "directus": "^9.13.0",
15
15
  "sqlite3": "^5.0.8"
16
16
  }
17
17
  }