nuxt-ignis 0.1.6 → 0.1.8
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/CHANGELOG.md +11 -0
- package/README.md +14 -3
- package/app.vue +4 -1
- package/components/AppFeatureList.vue +48 -0
- package/features.ts +27 -1
- package/nuxt.config.ts +15 -4
- package/package.json +24 -17
- package/pages/index.vue +3 -34
- package/test/ignis.test.ts +5 -0
- package/utils/consola.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.8 (2025-02-02)
|
|
4
|
+
- build: fix `nuxt-neon` security issue
|
|
5
|
+
- build: fix `vite` security issue
|
|
6
|
+
|
|
7
|
+
## 0.1.7 (2025-01-31)
|
|
8
|
+
- feat: unified test-pack included via separate `nuxt-spec` layer
|
|
9
|
+
- feat: support `ssr` and `pages` settings
|
|
10
|
+
- feat: display log level setting on startup
|
|
11
|
+
- refactor: log level setting moved inside `ignis` config
|
|
12
|
+
- build: updated deps
|
|
13
|
+
|
|
3
14
|
## 0.1.6 (2024-12-25)
|
|
4
15
|
- build: bump Nuxt to `3.15.0` + update other deps
|
|
5
16
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
This is a template starter for Nuxt web
|
|
5
|
+
This is a template starter for Nuxt web applications. It is being built as the setup I'd currently use to start with a new "real world" [Nuxt](https://nuxt.com/) webapp. It will improve and grow together with my skills. I also try to include **WHAT** and **WHY** comments based on my knowledge about the framework and used libraries.
|
|
6
6
|
|
|
7
7
|
## How to use
|
|
8
8
|
|
|
@@ -16,11 +16,11 @@ This is a template starter for Nuxt web applicatons. It is being build as the se
|
|
|
16
16
|
You are ready to build your next awesome project in Nuxt!
|
|
17
17
|
|
|
18
18
|
### As a layer (RECOMMENDED)
|
|
19
|
-
Aside from being "forked", `nuxt-ignis` is also available as [NPM package](https://www.npmjs.com/package/nuxt-ignis) that can be referenced as a single-import with all the features
|
|
19
|
+
Aside from being "forked", `nuxt-ignis` is also available as [NPM package](https://www.npmjs.com/package/nuxt-ignis) that can be referenced as a single-import with all the features incoming.
|
|
20
20
|
|
|
21
21
|
1) Add following dependency into your `package.json`:
|
|
22
22
|
```
|
|
23
|
-
"nuxt-ignis": "0.1.
|
|
23
|
+
"nuxt-ignis": "0.1.8"
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
2) Add following section into your `nuxt.config.ts`:
|
|
@@ -62,6 +62,7 @@ Without this workaround the project builds and deploys but will hit runtime erro
|
|
|
62
62
|
- integration with utility functions library for Vue apps via [`@vueuse/nuxt`](https://vueuse.org/nuxt/README.html)
|
|
63
63
|
- handful tools for working with images via [`@nuxt/image`](https://image.nuxt.com/)
|
|
64
64
|
- SSR-friendly component for rendering dynamic date/time via [`nuxt-time`](https://nuxt.com/modules/time)
|
|
65
|
+
- logging via [`consola](https://github.com/unjs/consola)
|
|
65
66
|
|
|
66
67
|
**Configurable features**
|
|
67
68
|
- UI (pick 0-1)
|
|
@@ -132,3 +133,13 @@ Default values are **false** (not included) for all optional features.
|
|
|
132
133
|
There are two config values for this feature:
|
|
133
134
|
- `NUXT_PUBLIC_IGNIS_PSLO_ENABLED` - setting to true will allow utility function `pslo` to treat texts in your app
|
|
134
135
|
- `NUXT_PUBLIC_IGNIS_PSLO_CONTENT` - if both `elrh-pslo` and `@nuxt/content` are enabled, this allows or disallows Markdown content pre-processing with `pslo` function
|
|
136
|
+
|
|
137
|
+
### Nuxt config overrides
|
|
138
|
+
Currently, it is possible to override following Nuxt config via .env variables:
|
|
139
|
+
- `NUXT_PUBLIC_IGNIS_SSR` - set to `false` to disable SSR (results in `ssr: false` in Nuxt Config)
|
|
140
|
+
- `NUXT_PUBLIC_IGNIS_PAGES` - set to `false` to disable multiple pages in simple projects (results in `pages: false` in Nuxt Config)
|
|
141
|
+
|
|
142
|
+
### Logging
|
|
143
|
+
Use `NUXT_PUBLIC_INGIS_LOG_LEVEL` to set level of log messages captured with `consola`. The default value is `info`.
|
|
144
|
+
|
|
145
|
+
Possible values are: `fatal`, `error`, `warn`, `log`, `info`, `success`, `debug`, `trace`, `silent`, `verbose`
|
package/app.vue
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
<img src="/nuxt-ignis.png" class="ignis-logo" :title :alt>
|
|
9
9
|
</div>
|
|
10
10
|
<div>{{ useT("subtitle") }}</div>
|
|
11
|
-
<NuxtPage />
|
|
11
|
+
<NuxtPage v-if="pages" />
|
|
12
|
+
<AppFeatureList v-else />
|
|
12
13
|
<CurrentTime />
|
|
13
14
|
<div class="link text-xs">
|
|
14
15
|
<NuxtLink to="https://github.com/AloisSeckar/nuxt-ignis">
|
|
@@ -32,6 +33,8 @@ initConsola()
|
|
|
32
33
|
log.info('Nuxt Ignis was here!')
|
|
33
34
|
const title = useT('title')
|
|
34
35
|
const alt = title
|
|
36
|
+
|
|
37
|
+
const pages = useRuntimeConfig().public.ignis.pages
|
|
35
38
|
</script>
|
|
36
39
|
|
|
37
40
|
<style scoped>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
https://nuxt.com/docs/guide/directory-structure/pages
|
|
3
|
+
|
|
4
|
+
An example of Nuxt component.
|
|
5
|
+
|
|
6
|
+
AppFeature
|
|
7
|
+
- an example usage of auto-imported Nuxt component declared in `/components` directory
|
|
8
|
+
- the text is (usually) being loaded localized via nuxtjs/i18n module
|
|
9
|
+
- features are being displayed conditionally according to current setting
|
|
10
|
+
-->
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="m-auto my-4 w-3/5 flex flex-col">
|
|
14
|
+
<AppFeature :text="useT('features.nuxt')" />
|
|
15
|
+
<AppFeature :text="useT('features.security')" />
|
|
16
|
+
<AppFeature :text="useT('features.image')" />
|
|
17
|
+
<AppFeature :text="useT('features.pinia')" />
|
|
18
|
+
<AppFeature :text="useT('features.vueuse')" />
|
|
19
|
+
<AppFeature :text="useT('features.consola')" />
|
|
20
|
+
<AppFeature v-if="nuxtui" :text="useT('features.ui')" />
|
|
21
|
+
<AppFeature v-if="tailwind" :text="useT('features.tailwind')" />
|
|
22
|
+
<AppFeature v-if="nuxtui" :text="useT('features.icon')" />
|
|
23
|
+
<AppFeature v-if="neon" :text="useT('features.neon')" />
|
|
24
|
+
<AppFeature v-if="supabase" :text="useT('features.supabase')" />
|
|
25
|
+
<AppFeature v-if="i18n" :text="useT('features.i18n')" />
|
|
26
|
+
<AppFeature v-if="formkit" :text="useT('features.formkit')" />
|
|
27
|
+
<AppFeature v-if="content" :text="useT('features.content')" />
|
|
28
|
+
<AppFeature v-if="openprops" class="openprops-feature" :text="useT('features.openprops')" />
|
|
29
|
+
</div>
|
|
30
|
+
<div v-if="!pages" class="mb-2">
|
|
31
|
+
Single-page mode (/pages disabled)
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
const setup = useRuntimeConfig().public.ignis
|
|
37
|
+
const ui = setup.preset.ui
|
|
38
|
+
const db = setup.preset.db
|
|
39
|
+
const nuxtui = ui === 'nuxt-ui' || setup.ui
|
|
40
|
+
const tailwind = ui !== 'off' || setup.ui || setup.tailwind
|
|
41
|
+
const neon = db === 'neon' || setup.neon
|
|
42
|
+
const supabase = db === 'supabase' || setup.supabase
|
|
43
|
+
const i18n = setup.i18n.enabled
|
|
44
|
+
const formkit = setup.formkit.enabled
|
|
45
|
+
const content = setup.content
|
|
46
|
+
const openprops = setup.openprops
|
|
47
|
+
const pages = setup.pages
|
|
48
|
+
</script>
|
package/features.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { log } from './utils/consola'
|
|
|
5
5
|
export function setFeatures() {
|
|
6
6
|
// list of optional extra features
|
|
7
7
|
const extras = [] as string[]
|
|
8
|
+
// list of Nuxt-related settings
|
|
9
|
+
const nuxt = [] as string[]
|
|
8
10
|
|
|
9
11
|
// object for optional config that will be merged with global Nuxt config
|
|
10
12
|
// declared in nuxt.config.ts
|
|
@@ -22,7 +24,7 @@ export function setFeatures() {
|
|
|
22
24
|
'@vueuse/nuxt',
|
|
23
25
|
)
|
|
24
26
|
|
|
25
|
-
// 2. optional modules
|
|
27
|
+
// 2. optional modules & features
|
|
26
28
|
|
|
27
29
|
// ui
|
|
28
30
|
const uiPreset = process.env.NUXT_PUBLIC_IGNIS_PRESET_UI
|
|
@@ -110,11 +112,35 @@ export function setFeatures() {
|
|
|
110
112
|
extras.push('elrh-pslo')
|
|
111
113
|
}
|
|
112
114
|
|
|
115
|
+
// 3. Nuxt-related settings
|
|
116
|
+
|
|
117
|
+
nuxt.push(`log-level=${process.env.NUXT_PUBLIC_IGNIS_LOG_LEVEL || 'info[default]'}`)
|
|
118
|
+
|
|
119
|
+
if (process.env.NUXT_PUBLIC_IGNIS_SSR === 'false') {
|
|
120
|
+
nuxtConfig = defu({
|
|
121
|
+
ssr: false,
|
|
122
|
+
}, nuxtConfig)
|
|
123
|
+
nuxt.push('ssr=false')
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (process.env.NUXT_PUBLIC_IGNIS_PAGES === 'false') {
|
|
127
|
+
nuxtConfig = defu({
|
|
128
|
+
pages: false,
|
|
129
|
+
}, nuxtConfig)
|
|
130
|
+
nuxt.push('pages=false')
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// 4. verify results
|
|
134
|
+
// TODO why this run twice?
|
|
135
|
+
|
|
113
136
|
let overview = 'Nuxt Ignis will start using following settings:\n'
|
|
114
137
|
overview += 'Modules: ' + nuxtConfig.modules.join(', ') + '\n'
|
|
115
138
|
if (extras.length > 0) {
|
|
116
139
|
overview += 'Extras: ' + extras.join(', ') + '\n'
|
|
117
140
|
}
|
|
141
|
+
if (nuxt.length > 0) {
|
|
142
|
+
overview += 'Nuxt: ' + nuxt.join(', ') + '\n'
|
|
143
|
+
}
|
|
118
144
|
log.info(overview)
|
|
119
145
|
|
|
120
146
|
return nuxtConfig
|
package/nuxt.config.ts
CHANGED
|
@@ -6,8 +6,13 @@ const ignisFeatures = setFeatures()
|
|
|
6
6
|
// https://nuxt.com/docs/guide/directory-structure/nuxt-config
|
|
7
7
|
const nuxtConfig = defu(ignisFeatures, {
|
|
8
8
|
|
|
9
|
+
extends: [
|
|
10
|
+
// Test-pack base layer
|
|
11
|
+
'nuxt-spec',
|
|
12
|
+
],
|
|
13
|
+
|
|
9
14
|
// https://nuxt.com/docs/api/nuxt-config#compatibilitydate
|
|
10
|
-
compatibilityDate: '
|
|
15
|
+
compatibilityDate: '2025-01-18',
|
|
11
16
|
|
|
12
17
|
// simple eslint config - see eslint.config.mjs
|
|
13
18
|
eslint: {
|
|
@@ -26,6 +31,15 @@ const nuxtConfig = defu(ignisFeatures, {
|
|
|
26
31
|
// NOTE: due to static-like nature of nuxt.config.ts file
|
|
27
32
|
// actual values MUST BE provided via .env file (or production equivalent)
|
|
28
33
|
ignis: {
|
|
34
|
+
|
|
35
|
+
// logging
|
|
36
|
+
log: {
|
|
37
|
+
level: 'info',
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
// nuxt-related config
|
|
41
|
+
ssr: true, // true/false
|
|
42
|
+
pages: true, // true/false
|
|
29
43
|
// presets
|
|
30
44
|
preset: {
|
|
31
45
|
ui: 'off', // nuxt-ui/tailwind/off
|
|
@@ -53,9 +67,6 @@ const nuxtConfig = defu(ignisFeatures, {
|
|
|
53
67
|
content: false, // true/false (elrh-pslo will (not) be aplied on nuxt-content)
|
|
54
68
|
},
|
|
55
69
|
},
|
|
56
|
-
|
|
57
|
-
// logging
|
|
58
|
-
logLevel: 'info',
|
|
59
70
|
},
|
|
60
71
|
},
|
|
61
72
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ignis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Enhanced and customizable Nuxt application starter pack",
|
|
5
5
|
"repository": "github:AloisSeckar/nuxt-ignis",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,35 +13,42 @@
|
|
|
13
13
|
"dev": "nuxt dev",
|
|
14
14
|
"generate": "nuxt generate",
|
|
15
15
|
"preview": "nuxt preview",
|
|
16
|
-
"start": "nuxt start"
|
|
16
|
+
"start": "nuxt start",
|
|
17
|
+
"test": "vitest run"
|
|
17
18
|
},
|
|
18
19
|
"dependencies": {
|
|
19
20
|
"@formkit/nuxt": "1.6.9",
|
|
20
21
|
"@nuxt/content": "2.13.4",
|
|
21
|
-
"@nuxt/eslint": "0.7.
|
|
22
|
-
"@nuxt/image": "1.
|
|
23
|
-
"@nuxt/ui": "2.
|
|
24
|
-
"@nuxtjs/i18n": "9.1.
|
|
25
|
-
"@nuxtjs/supabase": "1.4.
|
|
26
|
-
"@nuxtjs/tailwindcss": "6.
|
|
22
|
+
"@nuxt/eslint": "0.7.6",
|
|
23
|
+
"@nuxt/image": "1.9.0",
|
|
24
|
+
"@nuxt/ui": "2.21.0",
|
|
25
|
+
"@nuxtjs/i18n": "9.1.4",
|
|
26
|
+
"@nuxtjs/supabase": "1.4.6",
|
|
27
|
+
"@nuxtjs/tailwindcss": "6.13.1",
|
|
27
28
|
"@pinia/nuxt": "0.9.0",
|
|
28
|
-
"@vueuse/core": "12.
|
|
29
|
-
"@vueuse/nuxt": "12.
|
|
30
|
-
"consola": "3.
|
|
29
|
+
"@vueuse/core": "12.5.0",
|
|
30
|
+
"@vueuse/nuxt": "12.5.0",
|
|
31
|
+
"consola": "3.4.0",
|
|
31
32
|
"defu": "6.1.4",
|
|
32
33
|
"elrh-pslo": "1.1.6",
|
|
33
|
-
"nuxt-neon": "0.
|
|
34
|
+
"nuxt-neon": "0.3.0",
|
|
34
35
|
"nuxt-security": "2.1.5",
|
|
36
|
+
"nuxt-spec": "0.0.2",
|
|
35
37
|
"nuxt-time": "1.0.3",
|
|
36
|
-
"open-props": "1.7.
|
|
37
|
-
"pinia": "2.3.
|
|
38
|
+
"open-props": "1.7.12",
|
|
39
|
+
"pinia": "2.3.1",
|
|
38
40
|
"postcss-jit-props": "1.0.15",
|
|
39
|
-
"typescript": "
|
|
41
|
+
"typescript": "latest",
|
|
40
42
|
"vue": "latest",
|
|
41
43
|
"vue-router": "latest"
|
|
42
44
|
},
|
|
45
|
+
"pnpm": {
|
|
46
|
+
"overrides": {
|
|
47
|
+
"vite": "latest"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
43
50
|
"devDependencies": {
|
|
44
|
-
"nuxt": "3.15.
|
|
51
|
+
"nuxt": "3.15.4"
|
|
45
52
|
},
|
|
46
|
-
"packageManager": "pnpm@9.15.
|
|
53
|
+
"packageManager": "pnpm@9.15.4"
|
|
47
54
|
}
|
package/pages/index.vue
CHANGED
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
An example of Nuxt page.
|
|
5
5
|
Nuxt automaticaly provides routing and displays this page when user visits root URL or `/index`.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
AppFeatureList
|
|
8
8
|
- an example usage of auto-imported Nuxt component declared in `/components` directory
|
|
9
|
-
-
|
|
10
|
-
- features are being displayed conditionally according to current setting
|
|
9
|
+
- this contains a list of available features configured in current Nuxt Ignis setup
|
|
11
10
|
|
|
12
11
|
NuxtLink
|
|
13
12
|
- special component for improved handling for HTML links (<a> tags)
|
|
@@ -15,23 +14,7 @@
|
|
|
15
14
|
|
|
16
15
|
<template>
|
|
17
16
|
<div>
|
|
18
|
-
<
|
|
19
|
-
<AppFeature :text="useT('features.nuxt')" />
|
|
20
|
-
<AppFeature :text="useT('features.security')" />
|
|
21
|
-
<AppFeature :text="useT('features.image')" />
|
|
22
|
-
<AppFeature :text="useT('features.pinia')" />
|
|
23
|
-
<AppFeature :text="useT('features.vueuse')" />
|
|
24
|
-
<AppFeature :text="useT('features.consola')" />
|
|
25
|
-
<AppFeature v-if="nuxtui" :text="useT('features.ui')" />
|
|
26
|
-
<AppFeature v-if="tailwind" :text="useT('features.tailwind')" />
|
|
27
|
-
<AppFeature v-if="nuxtui" :text="useT('features.icon')" />
|
|
28
|
-
<AppFeature v-if="neon" :text="useT('features.neon')" />
|
|
29
|
-
<AppFeature v-if="supabase" :text="useT('features.supabase')" />
|
|
30
|
-
<AppFeature v-if="i18n" :text="useT('features.i18n')" />
|
|
31
|
-
<AppFeature v-if="formkit" :text="useT('features.formkit')" />
|
|
32
|
-
<AppFeature v-if="content" :text="useT('features.content')" />
|
|
33
|
-
<AppFeature v-if="openprops" class="openprops-feature" :text="useT('features.openprops')" />
|
|
34
|
-
</div>
|
|
17
|
+
<AppFeatureList />
|
|
35
18
|
<div class="link">
|
|
36
19
|
<NuxtLink to="/second">
|
|
37
20
|
{{ useT("goto2") }}
|
|
@@ -39,17 +22,3 @@
|
|
|
39
22
|
</div>
|
|
40
23
|
</div>
|
|
41
24
|
</template>
|
|
42
|
-
|
|
43
|
-
<script setup lang="ts">
|
|
44
|
-
const setup = useRuntimeConfig().public.ignis
|
|
45
|
-
const ui = setup.preset.ui
|
|
46
|
-
const db = setup.preset.db
|
|
47
|
-
const nuxtui = ui === 'nuxt-ui' || setup.ui
|
|
48
|
-
const tailwind = ui !== 'off' || setup.ui || setup.tailwind
|
|
49
|
-
const neon = db === 'neon' || setup.neon
|
|
50
|
-
const supabase = db === 'supabase' || setup.supabase
|
|
51
|
-
const i18n = setup.i18n.enabled
|
|
52
|
-
const formkit = setup.formkit.enabled
|
|
53
|
-
const content = setup.content
|
|
54
|
-
const openprops = setup.openprops
|
|
55
|
-
</script>
|
package/utils/consola.ts
CHANGED
|
@@ -33,7 +33,7 @@ export const log = createConsola({
|
|
|
33
33
|
*/
|
|
34
34
|
export async function initConsola() {
|
|
35
35
|
// set default log level from config
|
|
36
|
-
const logLevel = useRuntimeConfig().public.
|
|
36
|
+
const logLevel = useRuntimeConfig().public.ignis.log.level
|
|
37
37
|
log.level = getLogLevel(logLevel)
|
|
38
38
|
defaultReporter.level = log.level
|
|
39
39
|
log.debug(`[consola] log level set to '${logLevel}'`)
|
|
@@ -44,7 +44,7 @@ export async function initConsola() {
|
|
|
44
44
|
* to numeric equivalent used by consola.
|
|
45
45
|
*/
|
|
46
46
|
function getLogLevel(logLevel: string): LogLevel {
|
|
47
|
-
const logLevelString = logLevel.toLocaleLowerCase()
|
|
47
|
+
const logLevelString = logLevel.toLocaleLowerCase() || 'info'
|
|
48
48
|
switch (logLevelString) {
|
|
49
49
|
case 'fatal': return LogLevels.fatal
|
|
50
50
|
case 'error': return LogLevels.error
|