@nuxtus/nuxtus 1.1.0 → 1.3.0

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.
@@ -0,0 +1,24 @@
1
+ name: Release npm package
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ release:
10
+ name: Release
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@main
14
+ - uses: actions/setup-node@v1
15
+ with:
16
+ node-version: "16.x"
17
+ - run: npm install --save-dev @semantic-release/release-notes-generator @semantic-release/changelog@6 @semantic-release/git@10 @semantic-release/github@8 semantic-release@19
18
+ # - run: npm ci
19
+ # - run: npm run build --if-present
20
+ # - run: npm test
21
+ - run: npx semantic-release
22
+ env:
23
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,4 +1,26 @@
1
- # Nuxtus
1
+ Changelog
2
+
3
+ # [1.3.0](https://github.com/nuxtus/nuxtus/compare/v1.2.0...v1.3.0) (2022-07-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * :sparkles: use @nuxtus/nuxt-module instead of hard-coded plugins and api endpoints ([c34a601](https://github.com/nuxtus/nuxtus/commit/c34a601e107be87649ead02ab99072c40b1a9922))
9
+
10
+ # [1.2.0](https://github.com/nuxtus/nuxtus/compare/v1.1.1...v1.2.0) (2022-07-21)
11
+
12
+
13
+ ### Features
14
+
15
+ * :zap: directus and nuxt server and port are now configurable ([96bda8b](https://github.com/nuxtus/nuxtus/commit/96bda8bfdd03f2cdca5994b5814070480121e904))
16
+
17
+ ## [1.1.1](https://github.com/nuxtus/nuxtus/compare/v1.1.0...v1.1.1) (2022-07-11)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * :bug: update @nuxtus/generator to 1.1.2 ([fa02fba](https://github.com/nuxtus/nuxtus/commit/fa02fbae0e00b4dc6c59f3336cb321b43e0d7227))
23
+
2
24
 
3
25
  ## 1.1.0
4
26
 
@@ -54,4 +76,4 @@
54
76
 
55
77
  ## 0.0.1
56
78
 
57
- Initial alpha release.
79
+ Initial alpha release.
package/README.md CHANGED
@@ -46,10 +46,14 @@ $ cd server
46
46
  $ npm run cli bootstrap
47
47
  ```
48
48
 
49
+ > If using Nuxt is not using `http://localhost:3000` update NUXT_SERVER in the `server/.env` file.
50
+
49
51
  ### Nuxt
50
52
 
51
53
  No set up for Nuxt is required.
52
54
 
55
+ > If Directus is not using `http://localhost:8055` update DIRECTUS_SERVER in the `client/.env` file.
56
+
53
57
  ### Starting Nuxtus
54
58
 
55
59
  From inside your project folder:
@@ -67,8 +71,10 @@ Nuxtus includes a POST endpoint located /api/directus/collection that will run i
67
71
  Collections are also typed automatically, simply prepend "Items" to the collection name as per below:
68
72
 
69
73
  ```typescript
70
- import { components } from "../interfaces/nuxtus";
71
- type Test = components["schemas"]["ItemsTest"];
74
+ <script setup lang="ts">
75
+ import { components } from "../interfaces/nuxtus";
76
+ type Test = components["schemas"]["ItemsTest"];
77
+ </script>
72
78
  ```
73
79
 
74
80
  > Because OpenAPI schemas may have invalid TypeScript characters as names, the square brackets are a safe way to access every property.
@@ -94,7 +100,7 @@ If you chose to install, remove the Nuxtus hook extension by deleting the folder
94
100
 
95
101
  Clone this repo onto your local machine, remove the remote git origin and add a new one. Then follow the [manual install instructions](#directus).
96
102
 
97
- > For further instructions visit `[http://localhost:3000](http://localhost:3000)`
103
+ > For further instructions post install, visit `[http://localhost:3000](http://localhost:3000)`
98
104
 
99
105
  ## Acknowledgements
100
106
 
package/TODO CHANGED
@@ -5,7 +5,7 @@ Todo:
5
5
  ✔ Fix code for singleton page in .vue template @done(22-06-13 19:06)
6
6
  ✔ Make a CLI for creating index/listing pages for Directus API @done(22-06-10 20:42)
7
7
  ✔ Set up [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) @done(22-06-16 20:23)
8
- Setup [semantic release](https://github.com/semantic-release/semantic-release)
8
+ Setup [semantic release](https://github.com/semantic-release/semantic-release) @done(22-07-11 15:57)
9
9
  ✔ Add interactive/pretty CLI for create-app.js @done(22-06-16 20:23)
10
10
  ✔ Query database use (via interactive shell) in create-app.js @done(22-06-21 20:26)
11
11
  ✔ Check node version for compatibility in create-app.js @done(22-06-16 22:07)
@@ -14,12 +14,19 @@ Todo:
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
16
  ☐ Can I HMR when adding new pages/routes? - requires Nuxt to fix bug
17
- Add all questions in create-app to start of process for better user flow
18
- Allow use of different ports/URLs for Directus and Nuxt (currently hard-coded)
19
- Add "types" to cli to update types from Directus when not using hook
20
- ☐ Make opening browser window on start optional using npm run start
21
- Make sure separate packages can be used without Nuxt Boilerplate if required
22
- Console.log messages from directus extension should be formatted like other directus messages
17
+ Add all questions in create-app to start of process for better user flow @done(22-07-13 19:15)
18
+ Allow use of different ports/URLs for Directus and Nuxt (currently hard-coded) @done(22-07-13 20:42)
19
+ Add "types" to cli to update types from Directus when not using hook - use @directus/sdk for /oas now on all apps @done(22-07-18 17:01)
20
+ ☐ Make opening browser window on start optional using npm run start (not possible)
21
+ Look at moving login and server/api stuff to a Nuxt module @done(22-07-28 19:37)
22
+ Make sure separate packages can be used without Nuxt Boilerplate if required @done(22-07-28 19:37)
23
+ ✔ Console.log messages from directus extension should be formatted like other directus messages @done(22-07-19 20:46)
24
+ ✔ Add default Directus login to end of create-nuxtus script @done(22-07-19 17:30)
23
25
  ☐ When adding a new collection the new page triggers a nuxt restart then directus tries to send a field.create which fails. We get around this by getting the create field first but Directus still returns a 404 for the second request.
24
26
  ✔ interfaces/nuxtus.ts should not be in .gitignore other than during my development (remove in create-nuxtus?) @done(22-07-11 12:52)
25
- Add test coverage
27
+ Add test coverage (done: generator, nuxtus-cli) @started(22-07-11 17:19) @done(22-07-14 08:03) @lasted(2d14h44m55s)
28
+ ☐ GraphQL?
29
+ ☐ Websockets (https://github.com/br41nslug/directus-websocket-subscribe)
30
+ ✔ Upgrade nuxt-directus @done(22-07-17 11:32)
31
+ ☐ Add ability to use Directus static token instead of login (once https://github.com/Intevel/nuxt-directus/pull/54#pullrequestreview-1045062132 completed)
32
+ ☐ Get added to some nuxt/directus lists etc.
@@ -11,7 +11,7 @@ export default defineNuxtConfig({
11
11
  ],
12
12
  "@nuxtjs/tailwindcss",
13
13
  ],
14
- modules: ["nuxt-directus"],
14
+ modules: ["nuxt-directus", "@nuxtus/nuxt-module"],
15
15
  googleFonts: {
16
16
  families: {
17
17
  Inter: true,
@@ -22,6 +22,9 @@ export default defineNuxtConfig({
22
22
  jit: true,
23
23
  },
24
24
  directus: {},
25
+ nuxtus: {
26
+ authDirectus: true,
27
+ },
25
28
  publicRuntimeConfig: {
26
29
  directusEmail: "",
27
30
  directusPassword: "",
@@ -9,14 +9,13 @@
9
9
  "devDependencies": {
10
10
  "@nuxtjs/google-fonts": "^1.3.0",
11
11
  "@nuxtjs/tailwindcss": "^5.0.4",
12
- "@nuxtus/cli": "^1.0.6",
13
- "@nuxtus/generator": "1.1.0",
14
- "nuxt": "3.0.0-rc.4",
15
- "openapi-typescript": "^5.4.1"
12
+ "@nuxtus/cli": "^1.1.1",
13
+ "@nuxtus/nuxt-module": "^1.0.3",
14
+ "nuxt": "^3.0.0-rc.6"
16
15
  },
17
16
  "dependencies": {
18
17
  "@headlessui/vue": "^1.6.1",
19
18
  "@heroicons/vue": "^1.0.6",
20
- "nuxt-directus": "^2.1.0"
19
+ "nuxt-directus": "^2.2.0"
21
20
  }
22
21
  }
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.1.0",
4
+ "version": "1.3.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/nuxtus/nuxtus.git"
@@ -29,6 +29,41 @@
29
29
  "start": "concurrently \"npm run client\" \"npm run server\""
30
30
  },
31
31
  "devDependencies": {
32
- "concurrently": "^7.2.2"
32
+ "@semantic-release/changelog": "^6.0.1",
33
+ "@semantic-release/git": "^10.0.1",
34
+ "@semantic-release/github": "^8.0.5",
35
+ "@semantic-release/release-notes-generator": "^10.0.3",
36
+ "concurrently": "^7.2.2",
37
+ "semantic-release": "^19.0.3"
38
+ },
39
+ "release": {
40
+ "branches": "main",
41
+ "plugins": [
42
+ [
43
+ "@semantic-release/commit-analyzer",
44
+ {
45
+ "releaseRules": [
46
+ {
47
+ "type": "revert",
48
+ "release": "patch"
49
+ },
50
+ {
51
+ "type": "refactor",
52
+ "release": "minor"
53
+ }
54
+ ]
55
+ }
56
+ ],
57
+ "@semantic-release/release-notes-generator",
58
+ [
59
+ "@semantic-release/changelog",
60
+ {
61
+ "changelogTitle": "Changelog"
62
+ }
63
+ ],
64
+ "@semantic-release/npm",
65
+ "@semantic-release/git",
66
+ "@semantic-release/github"
67
+ ]
33
68
  }
34
69
  }
package/server/.env CHANGED
@@ -69,3 +69,7 @@ EMAIL_SENDMAIL_PATH="/usr/sbin/sendmail"
69
69
  ## Default User
70
70
  ADMIN_EMAIL="admin@example.com"
71
71
  ADMIN_PASSWORD="password"
72
+
73
+ ####################################################################################################
74
+ ## NUXT SERVER
75
+ NUXT_SERVER="http://localhost:3000"
@@ -1,12 +0,0 @@
1
- export default defineNuxtPlugin(async (nuxtApp) => {
2
- try {
3
- const config = useRuntimeConfig()
4
- const { login } = useDirectusAuth()
5
- await login({
6
- email: config.public.directusEmail,
7
- password: config.public.directusPassword,
8
- })
9
- } catch (error) {
10
- console.error(error)
11
- }
12
- })
@@ -1,17 +0,0 @@
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
- try {
7
- const collection = body.collection
8
- createPage(collection, body.singleton)
9
- } catch (err) {
10
- console.error(err.message)
11
- throw new Error("Unable to create page: " + err.message)
12
- }
13
- return {
14
- api: "ok",
15
- }
16
- }
17
- })
@@ -1,32 +0,0 @@
1
- import axios from "axios"
2
- import fs from "fs"
3
- import openapiTS from "openapi-typescript"
4
-
5
- export default defineEventHandler(async (event) => {
6
- if (process.env.NODE_ENV !== "production") {
7
- const config = useRuntimeConfig()
8
- // TODO: Can't seem to share login from directusLogin (currently client only plugin)
9
- try {
10
- const { data } = await axios.post("http://localhost:8055/auth/login", {
11
- email: config.public.directusEmail,
12
- password: config.public.directusPassword,
13
- })
14
- axios.defaults.headers.common[
15
- "Authorization"
16
- ] = `Bearer ${data.data.access_token}`
17
- } catch (err) {
18
- console.error("Failed to login to Directus: " + err.message)
19
- throw err
20
- }
21
- const openapi = await axios.get("http://localhost:8055/server/specs/oas")
22
- // console.log(JSON.stringify(openapi.data.components.schemas))
23
- const types = await openapiTS(openapi.data)
24
- if (!fs.existsSync("interfaces")) {
25
- fs.mkdirSync("interfaces")
26
- }
27
- fs.writeFileSync("interfaces/nuxtus.ts", types)
28
- return {
29
- api: "ok",
30
- }
31
- }
32
- })