@nuxtus/nuxtus 1.0.0 → 1.0.4
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 +34 -20
- package/TODO +10 -0
- package/changelog.md +26 -0
- package/client/.env +1 -1
- package/client/package.json +3 -2
- package/package.json +9 -8
- package/server/.env +5 -0
- package/server/package.json +1 -0
- package/create-app.js +0 -64
- package/data.db +0 -0
- package/server/data.db +0 -0
package/README.md
CHANGED
|
@@ -12,47 +12,61 @@ It also includes [nuxtus/cli]("https://github.com/nuxtus/cli") which provides a
|
|
|
12
12
|
- [Headless UI](https://headlessui.dev/)
|
|
13
13
|
- [HeroIcons](https://heroicons.com/)
|
|
14
14
|
- [Google Fonts](https://github.com/nuxt-community/google-fonts-module)
|
|
15
|
-
- [Nuxtus CLI](
|
|
15
|
+
- [Nuxtus CLI](https://github.com/nuxtus/cli)
|
|
16
16
|
|
|
17
17
|
## Quickstart (preferred)
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
$ npx create-nuxtus app-name
|
|
21
|
-
$ cd app-name
|
|
22
21
|
```
|
|
23
22
|
|
|
24
23
|
> Replace `app-name` with the name of your website or application.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
Nuxtus will automatically start Directus and Nuxt in development mode if you are using SQLite. Otherwise follow the directions below to manually configure your database and get started.
|
|
26
|
+
|
|
27
|
+
Your project will contain 2 folders server (Directus) and client (Nuxt).
|
|
28
|
+
|
|
29
|
+
### Directus
|
|
30
|
+
|
|
31
|
+
By default Nuxtus uses an SQLite database. If you wish to use an alternative database simply edit the `server/.env` file as suggested in the [Directus documentation](https://docs.directus.io/configuration/config-options/#database) then follow the steps below.
|
|
27
32
|
|
|
28
33
|
```bash
|
|
29
|
-
|
|
30
|
-
~/client $ npm run dev
|
|
31
|
-
```
|
|
34
|
+
$ cd server
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
# From within the root of the project
|
|
37
|
+
$ npm run cli bootstrap
|
|
38
|
+
```
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
### Nuxt
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
No set up for Nuxt is required.
|
|
38
43
|
|
|
39
|
-
|
|
44
|
+
### Starting Nuxtus
|
|
40
45
|
|
|
41
|
-
|
|
46
|
+
From inside your project folder:
|
|
42
47
|
|
|
43
48
|
```bash
|
|
44
|
-
$
|
|
45
|
-
$ npm i
|
|
46
|
-
$ npx directus start
|
|
49
|
+
$ npm start
|
|
47
50
|
```
|
|
48
51
|
|
|
49
|
-
###
|
|
52
|
+
### Creating pages
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
Nuxtus includes Nuxtus CLI which will automatically generate listing and view pages of any Directus collections. To use it:
|
|
55
|
+
|
|
56
|
+
1. Log in to Directus ([http://0.0.0.0:8055/admin/login](http://0.0.0.0:8055/admin/login)) and [create a collection](https://docs.directus.io/configuration/data-model/#creating-a-collection)
|
|
57
|
+
2. From the client folder (`cd client`) run `nuxtus create` and follow the prompts
|
|
58
|
+
|
|
59
|
+
Pages will be created for each collection you select in `clients/pages`. These are a starting point for you to customise.
|
|
60
|
+
|
|
61
|
+
For more details on [Nuxtus CLI](https://github.com/nuxtus/cli) click [here](https://github.com/nuxtus/cli).
|
|
62
|
+
|
|
63
|
+
## Production deployment
|
|
64
|
+
|
|
65
|
+
By default Directus is configured to accept CORS from any origin. Nuxtus suggests modifying this for your production deployment.
|
|
66
|
+
|
|
67
|
+
## Manual setup
|
|
68
|
+
|
|
69
|
+
Clone this repo onto your local machine, remove the remote git origin and add a new one. Then follow the [manual install instructions](#directus).
|
|
56
70
|
|
|
57
71
|
> For further instructions visit `[http://localhost:3000](http://localhost:3000)`
|
|
58
72
|
|
package/TODO
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
Todo:
|
|
3
3
|
☐ Handle fetch failures
|
|
4
|
+
✔ Update docs.vue to use nuxtus-cli instead @done(22-06-12 20:57)
|
|
5
|
+
✔ Fix code for singleton page in .vue template @done(22-06-13 19:06)
|
|
4
6
|
✔ Make a CLI for creating index/listing pages for Directus API @done(22-06-10 20:42)
|
|
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)
|
|
9
|
+
✔ Add interactive/pretty CLI for create-app.js @done(22-06-16 20:23)
|
|
10
|
+
☐ Query database use (via interactive shell) in create-app.js
|
|
11
|
+
✔ Check node version for compatibility in create-app.js @done(22-06-16 22:07)
|
|
12
|
+
☐ Look at https://renovatebot.com/
|
|
13
|
+
☐ Documentation: https://docusaurus.io/ or https://vuepress.vuejs.org/
|
|
14
|
+
☐ Look into using a Directus hook to automatically generate the Nuxt pages!
|
package/changelog.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Nuxtus
|
|
2
2
|
|
|
3
|
+
## 1.0.4
|
|
4
|
+
|
|
5
|
+
- Hard delete the data.db file
|
|
6
|
+
- Update @nuxtus-cli to 1.0.2
|
|
7
|
+
- Update Nuxt to 3.0.0-rc.4
|
|
8
|
+
- Add client, server and start npm scripts
|
|
9
|
+
|
|
10
|
+
## 1.0.3
|
|
11
|
+
|
|
12
|
+
- Add Directus CLI to package.json so `npm run cli` works
|
|
13
|
+
- Update getting started instructions to include database migrations
|
|
14
|
+
- Do not upload the sqlite database, create a new one
|
|
15
|
+
- Add default user/password to Directus .env
|
|
16
|
+
- Add @nuxtus/cli to dev dependencies
|
|
17
|
+
- Update `pages/docs.vue` with details on using @nuxtus/cli
|
|
18
|
+
|
|
19
|
+
## 1.0.2
|
|
20
|
+
|
|
21
|
+
- Separate create-nuxt command
|
|
22
|
+
|
|
23
|
+
## 1.0.1
|
|
24
|
+
|
|
25
|
+
- Correct create command in readme
|
|
26
|
+
- Add details on using Nuxtus CLI
|
|
27
|
+
- Update feedback when installing dependencies
|
|
28
|
+
|
|
3
29
|
## 1.0.0
|
|
4
30
|
|
|
5
31
|
- Add `npx nuxtus-create` command
|
package/client/.env
CHANGED
|
@@ -3,5 +3,5 @@ DIRECTUS_URL=http://localhost:8055
|
|
|
3
3
|
# Nuxtus values
|
|
4
4
|
# For now using email and password as nuxt-directus does not support token auth
|
|
5
5
|
# NUXT_PUBLIC_DIRECTUS_TOKEN=UNSECURE_ACCESS_TOKEN
|
|
6
|
-
NUXT_PUBLIC_DIRECTUS_EMAIL=admin@
|
|
6
|
+
NUXT_PUBLIC_DIRECTUS_EMAIL=admin@example.com
|
|
7
7
|
NUXT_PUBLIC_DIRECTUS_PASSWORD=password
|
package/client/package.json
CHANGED
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@nuxtjs/google-fonts": "^1.3.0",
|
|
11
11
|
"@nuxtjs/tailwindcss": "^5.0.4",
|
|
12
|
-
"nuxt": "3.0.0-rc.
|
|
12
|
+
"nuxt": "3.0.0-rc.4",
|
|
13
|
+
"@nuxtus/cli": "^1.0.2"
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
15
16
|
"@headlessui/vue": "^1.6.1",
|
|
16
17
|
"@heroicons/vue": "^1.0.6",
|
|
17
|
-
"nuxt-directus": "^2.0
|
|
18
|
+
"nuxt-directus": "^2.1.0"
|
|
18
19
|
}
|
|
19
20
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtus/nuxtus",
|
|
3
3
|
"description": "Directus/Nuxt boilerplate with Tailwind CSS.",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"main": "create-app.js",
|
|
4
|
+
"version": "1.0.4",
|
|
6
5
|
"repository": {
|
|
7
6
|
"type": "git",
|
|
8
7
|
"url": "git+https://github.com/nuxtus/nuxtus.git"
|
|
@@ -20,14 +19,16 @@
|
|
|
20
19
|
"url": "https://github.com/nuxtus/nuxtus/issues"
|
|
21
20
|
},
|
|
22
21
|
"homepage": "https://github.com/nuxtus/nuxtus#readme",
|
|
23
|
-
"bin": {
|
|
24
|
-
"create-nuxtus": "./create-app.js"
|
|
25
|
-
},
|
|
26
22
|
"publishConfig": {
|
|
27
23
|
"access": "public",
|
|
28
24
|
"registry": "https://registry.npmjs.org/"
|
|
29
25
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
26
|
+
"scripts": {
|
|
27
|
+
"client": "cd client && npm run dev",
|
|
28
|
+
"server": "cd server && npx directus start",
|
|
29
|
+
"start": "concurrently \"npm run client\" \"npm run server\""
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"concurrently": "^7.2.2"
|
|
32
33
|
}
|
|
33
|
-
}
|
|
34
|
+
}
|
package/server/.env
CHANGED
|
@@ -64,3 +64,8 @@ EMAIL_FROM="no-reply@craigharman.com"
|
|
|
64
64
|
EMAIL_TRANSPORT="sendmail"
|
|
65
65
|
EMAIL_SENDMAIL_NEW_LINE="unix"
|
|
66
66
|
EMAIL_SENDMAIL_PATH="/usr/sbin/sendmail"
|
|
67
|
+
|
|
68
|
+
####################################################################################################
|
|
69
|
+
## Default User
|
|
70
|
+
ADMIN_EMAIL="admin@example.com"
|
|
71
|
+
ADMIN_PASSWORD="password"
|
package/server/package.json
CHANGED
package/create-app.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { execSync } = require("child_process")
|
|
4
|
-
const path = require("path")
|
|
5
|
-
const fs = require("fs")
|
|
6
|
-
|
|
7
|
-
if (process.argv.length < 3) {
|
|
8
|
-
console.log("You have to provide a name for your app.")
|
|
9
|
-
console.log("For example :")
|
|
10
|
-
console.log(" npx create-nuxtus my-app")
|
|
11
|
-
process.exit(1)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const projectName = process.argv[2]
|
|
15
|
-
const currentPath = process.cwd()
|
|
16
|
-
const projectPath = path.join(currentPath, projectName)
|
|
17
|
-
const git_repo = "https://github.com/nuxtus/nuxtus"
|
|
18
|
-
|
|
19
|
-
try {
|
|
20
|
-
fs.mkdirSync(projectPath)
|
|
21
|
-
} catch (err) {
|
|
22
|
-
if (err.code === "EEXIST") {
|
|
23
|
-
console.log(
|
|
24
|
-
`The folder ${projectName} already exist in the current directory, please try another name.`
|
|
25
|
-
)
|
|
26
|
-
} else {
|
|
27
|
-
console.log(error)
|
|
28
|
-
}
|
|
29
|
-
process.exit(1)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async function main() {
|
|
33
|
-
try {
|
|
34
|
-
console.log("Downloading files...")
|
|
35
|
-
execSync(`git clone --depth 1 ${git_repo} ${projectPath}`)
|
|
36
|
-
|
|
37
|
-
process.chdir(projectPath)
|
|
38
|
-
|
|
39
|
-
console.log("Installing dependencies...")
|
|
40
|
-
execSync("cd server && npm install")
|
|
41
|
-
execSync("cd client && npm install")
|
|
42
|
-
|
|
43
|
-
console.log("Removing unused files...")
|
|
44
|
-
execSync(
|
|
45
|
-
"npx rimraf ./.git ./create-app.js ./package.json ./package-lock.json ./TODO ./node_modules"
|
|
46
|
-
)
|
|
47
|
-
fs.rmdirSync(path.join(projectPath, "bin"), { recursive: true })
|
|
48
|
-
fs.appendFile(
|
|
49
|
-
".gitignore",
|
|
50
|
-
path.join("server", ".env") + "\n" + path.join("client", ".env"),
|
|
51
|
-
function (err) {
|
|
52
|
-
if (err) throw err
|
|
53
|
-
console.log("Saved!")
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
console.log(
|
|
58
|
-
"Nuxtus site is ready for use! Edit server/.env then start Directus."
|
|
59
|
-
)
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.log(error)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
main()
|
package/data.db
DELETED
|
File without changes
|
package/server/data.db
DELETED
|
Binary file
|