nuxt-ignis 0.2.5 → 0.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.
- package/.nuxt/app.config.mjs +18 -0
- package/.nuxt/component-chunk.mjs +1 -0
- package/.nuxt/components.d.ts +190 -0
- package/.nuxt/dev/index.mjs +2948 -0
- package/.nuxt/dev/index.mjs.map +1 -0
- package/.nuxt/dist/server/client.manifest.json +18 -0
- package/.nuxt/dist/server/client.manifest.mjs +1 -0
- package/.nuxt/dist/server/server.mjs +1 -0
- package/.nuxt/eslint-typegen.d.ts +9401 -0
- package/.nuxt/eslint.config.d.mts +9 -0
- package/.nuxt/eslint.config.mjs +53 -0
- package/.nuxt/imports.d.ts +66 -0
- package/.nuxt/manifest/latest.json +1 -0
- package/.nuxt/manifest/meta/dev.json +1 -0
- package/.nuxt/modules/@nuxt-scripts.d.ts +13 -0
- package/.nuxt/nitro.json +17 -0
- package/.nuxt/nuxt-fonts-global.css +0 -0
- package/.nuxt/nuxt.d.ts +34 -0
- package/.nuxt/nuxt.json +9 -0
- package/.nuxt/schema/nuxt.schema.d.ts +17 -0
- package/.nuxt/schema/nuxt.schema.json +3 -0
- package/.nuxt/tsconfig.json +223 -0
- package/.nuxt/tsconfig.server.json +152 -0
- package/.nuxt/types/app-defaults.d.ts +7 -0
- package/.nuxt/types/app.config.d.ts +31 -0
- package/.nuxt/types/build.d.ts +25 -0
- package/.nuxt/types/builder-env.d.ts +1 -0
- package/.nuxt/types/imports.d.ts +829 -0
- package/.nuxt/types/layouts.d.ts +7 -0
- package/.nuxt/types/middleware.d.ts +7 -0
- package/.nuxt/types/nitro-config.d.ts +14 -0
- package/.nuxt/types/nitro-imports.d.ts +143 -0
- package/.nuxt/types/nitro-middleware.d.ts +6 -0
- package/.nuxt/types/nitro-nuxt.d.ts +34 -0
- package/.nuxt/types/nitro-routes.d.ts +20 -0
- package/.nuxt/types/nitro.d.ts +3 -0
- package/.nuxt/types/plugins.d.ts +38 -0
- package/.nuxt/types/schema.d.ts +450 -0
- package/.nuxt/types/vue-shim.d.ts +0 -0
- package/app.vue +16 -36
- package/assets/css/nuxt-ui.css +16 -0
- package/assets/css/tailwind.css +10 -44
- package/components/AppFeature.vue +47 -3
- package/components/AppFeatureList.vue +86 -26
- package/components/CurrentTime.vue +9 -9
- package/components/ignis/IgnisFooter.vue +16 -0
- package/components/ignis/IgnisHeader.vue +48 -0
- package/components/ignis/IgnisInfo.vue +26 -0
- package/composables/useTranslation.ts +11 -4
- package/content/second.md +4 -0
- package/features.ts +115 -17
- package/i18n/i18n.config.ts +2 -2
- package/{assets/lang → i18n/locales}/en.json +6 -1
- package/i18n/locales/es.json +4 -0
- package/nuxt.config.ts +26 -2
- package/package.json +70 -79
- package/pages/ignis.vue +3 -0
- package/pages/index.vue +1 -12
- package/tailwind.config.ts +2 -1
- package/utils/i18n-sources.ts +20 -2
- package/vueform.config.ts +20 -0
- package/.gitattributes +0 -2
- package/CHANGELOG.md +0 -72
- package/LICENSE +0 -21
- package/README.md +0 -147
|
@@ -10,43 +10,62 @@
|
|
|
10
10
|
-->
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
|
-
<div class="
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
<div class="feature-box">
|
|
14
|
+
<div class="feature-list">
|
|
15
|
+
<AppFeature :text="useIgnisT('features.nuxt')" />
|
|
16
|
+
<AppFeature :text="useIgnisT('features.consola')" />
|
|
17
|
+
<AppFeature :active="eslint" :text="useIgnisT('features.eslint')" />
|
|
18
|
+
<AppFeature :active="security" :text="useIgnisT('features.security')" />
|
|
19
|
+
<AppFeature :active="image" :text="useIgnisT('features.image')" />
|
|
20
|
+
<AppFeature :active="scripts" :text="useIgnisT('features.scripts')" />
|
|
21
|
+
<AppFeature :active="fonts" :text="useIgnisT('features.fonts')" class="fonts" />
|
|
22
|
+
<AppFeature :active="pinia" :text="useIgnisT('features.pinia')" />
|
|
23
|
+
<AppFeature :active="vueuse" :text="useIgnisT('features.vueuse')" />
|
|
24
|
+
<AppFeature :active="time" :text="useIgnisT('features.time')" />
|
|
25
|
+
<AppFeature :active="nuxtui" :text="useIgnisT('features.ui')" />
|
|
26
|
+
<AppFeature :active="tailwind" :text="useIgnisT('features.tailwind')" />
|
|
27
|
+
<AppFeature :active="nuxtui" :text="useIgnisT('features.icon')" />
|
|
28
|
+
<AppFeature :active="neon" :text="useIgnisT('features.neon')" />
|
|
29
|
+
<AppFeature :active="supabase" :text="useIgnisT('features.supabase')" />
|
|
30
|
+
<AppFeature :active="i18n" :text="useIgnisT('features.i18n')" />
|
|
31
|
+
<AppFeature :active="vueform" :text="useIgnisT('features.vueform')" />
|
|
32
|
+
<AppFeature :active="formkit" :text="useIgnisT('features.formkit')" />
|
|
33
|
+
<AppFeature :active="content" :text="useIgnisT('features.content')" />
|
|
34
|
+
<AppFeature :active="seo" :text="useIgnisT('features.seo')" />
|
|
35
|
+
<AppFeature :active="auth" :text="useIgnisT('features.auth')" />
|
|
36
|
+
<AppFeature :active="openprops" class="openprops-feature" :text="useIgnisT('features.openprops')" />
|
|
37
|
+
</div>
|
|
38
|
+
<div v-if="!pages" class="pages">
|
|
39
|
+
Single-page mode (/pages disabled)
|
|
40
|
+
</div>
|
|
34
41
|
</div>
|
|
35
42
|
</template>
|
|
36
43
|
|
|
37
44
|
<script setup lang="ts">
|
|
38
|
-
import {
|
|
45
|
+
import { useIgnisT } from '#imports' // requires explicit import for some reason
|
|
39
46
|
|
|
40
47
|
const setup = useRuntimeConfig().public.ignis
|
|
48
|
+
const eslint = setup.core.eslint
|
|
49
|
+
const fonts = setup.core.fonts
|
|
50
|
+
const image = setup.core.image
|
|
51
|
+
const pinia = setup.core.pinia
|
|
52
|
+
const time = setup.core.time
|
|
53
|
+
const scripts = setup.core.scripts
|
|
54
|
+
const security = setup.core.security
|
|
55
|
+
const vueuse = setup.core.vueuse
|
|
41
56
|
const ui = setup.preset.ui
|
|
42
|
-
const db = setup.preset.db
|
|
43
57
|
const nuxtui = ui === 'nuxt-ui' || setup.ui
|
|
44
58
|
const tailwind = ui !== 'off' || setup.ui || setup.tailwind
|
|
45
|
-
const
|
|
46
|
-
const
|
|
59
|
+
const db = setup.preset.db
|
|
60
|
+
const neon = db === 'neon' || (db === 'off' && setup.neon)
|
|
61
|
+
const supabase = db === 'supabase' || (db === 'off' && setup.supabase)
|
|
47
62
|
const i18n = setup.i18n.enabled
|
|
48
|
-
const
|
|
63
|
+
const forms = setup.preset.forms
|
|
64
|
+
const vueform = forms === 'vueform' || (forms === 'off' && setup.vueform)
|
|
65
|
+
const formkit = forms === 'formkit' || (forms === 'off' && setup.formkit.enabled)
|
|
49
66
|
const content = setup.content
|
|
67
|
+
const seo = setup.seo
|
|
68
|
+
const auth = setup.auth
|
|
50
69
|
const openprops = setup.openprops
|
|
51
70
|
const pages = setup.pages
|
|
52
71
|
</script>
|
|
@@ -56,4 +75,45 @@ const pages = setup.pages
|
|
|
56
75
|
.fonts {
|
|
57
76
|
font-family: "Kurale";
|
|
58
77
|
}
|
|
78
|
+
|
|
79
|
+
/* avoid Tailwind CSS styles here, because Tailwind may not be enabled */
|
|
80
|
+
|
|
81
|
+
/* flex flex-row justify-center */
|
|
82
|
+
.feature-box {
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: row;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* margin-auto my-4 w-3/5 flex flex-col */
|
|
89
|
+
.feature-list {
|
|
90
|
+
margin: 0px auto;
|
|
91
|
+
margin-bottom: 8px;
|
|
92
|
+
width: 40%;
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@media (max-width: 1200px) {
|
|
98
|
+
.feature-list {
|
|
99
|
+
width: 60%;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (max-width: 800px) {
|
|
104
|
+
.feature-list {
|
|
105
|
+
width: 80%;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (max-width: 600px) {
|
|
110
|
+
.feature-list {
|
|
111
|
+
width: 100%;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* mb-2 */
|
|
116
|
+
.pages {
|
|
117
|
+
margin-bottom: 2em;
|
|
118
|
+
}
|
|
59
119
|
</style>
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
Built-in `NuxtTime` component is a way how to deal with SSR in Nuxt.
|
|
3
3
|
Because page on the server is rendered miliseconds before being re-rendered on client,
|
|
4
4
|
wild "hydration error mismatch" may appear from a difference between displayed times.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
https://github.com/nuxt/nuxt/discussions/23278#discussioncomment-7607298
|
|
6
|
+
https://nuxt.com/docs/api/components/nuxt-time
|
|
8
7
|
-->
|
|
9
8
|
|
|
10
9
|
<template>
|
|
11
|
-
<div>
|
|
12
|
-
Current time
|
|
13
|
-
<span class="link">
|
|
14
|
-
<NuxtLink to="https://github.com/danielroe/nuxt-time">Nuxt Time</NuxtLink>
|
|
15
|
-
</span>:
|
|
10
|
+
<div style="text-align: center;">
|
|
11
|
+
Current time with <NuxtLink to="https://nuxt.com/docs/api/components/nuxt-time">NuxtTime</NuxtLink>:
|
|
16
12
|
<NuxtTime
|
|
17
13
|
:datetime="currentDate"
|
|
18
14
|
year="numeric"
|
|
@@ -21,9 +17,13 @@
|
|
|
21
17
|
hour="2-digit"
|
|
22
18
|
minute="2-digit"
|
|
23
19
|
second="2-digit" />
|
|
20
|
+
<span v-if="!vueuse">
|
|
21
|
+
(Enable VueUse to get reactive time)
|
|
22
|
+
</span>
|
|
24
23
|
</div>
|
|
25
24
|
</template>
|
|
26
25
|
|
|
27
26
|
<script setup lang="ts">
|
|
28
|
-
const
|
|
27
|
+
const vueuse = useRuntimeConfig().public.ignis.core.vueuse
|
|
28
|
+
const currentDate = vueuse ? useNow() : new Date().toISOString()
|
|
29
29
|
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<footer class="link text-xs">
|
|
3
|
+
<NuxtLink to="https://github.com/AloisSeckar/nuxt-ignis">
|
|
4
|
+
https://github.com/AloisSeckar/nuxt-ignis
|
|
5
|
+
</NuxtLink>
|
|
6
|
+
</footer>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<style scoped lang="css">
|
|
10
|
+
footer {
|
|
11
|
+
text-align: center;
|
|
12
|
+
margin-top: 4px;
|
|
13
|
+
font-size: 0.75rem; /* 12px */
|
|
14
|
+
line-height: 1rem; /* 16px */
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header>
|
|
3
|
+
<div class="ignis-header">
|
|
4
|
+
<img src="/nuxt-ignis.png" class="ignis-logo" :title :alt>
|
|
5
|
+
<h1 class="ignis-title">
|
|
6
|
+
{{ useIgnisT("title") }}
|
|
7
|
+
</h1>
|
|
8
|
+
<img src="/nuxt-ignis.png" class="ignis-logo" :title :alt>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="ignis-subtitle ">
|
|
11
|
+
{{ useIgnisT("subtitle") }}
|
|
12
|
+
</div>
|
|
13
|
+
</header>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { useIgnisT } from '#imports' // requires explicit import for some reason
|
|
18
|
+
|
|
19
|
+
const title = useIgnisT('title')
|
|
20
|
+
const alt = title
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style scoped>
|
|
24
|
+
.ignis-header {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
margin-bottom: 10px;
|
|
29
|
+
}
|
|
30
|
+
.ignis-logo {
|
|
31
|
+
display: inline;
|
|
32
|
+
width: 64px;
|
|
33
|
+
height: 64px;
|
|
34
|
+
}
|
|
35
|
+
/* my-4 text-4xl text-amber-400 font-bold */
|
|
36
|
+
.ignis-title {
|
|
37
|
+
margin-top: 15px;
|
|
38
|
+
font-size: 2.25rem;
|
|
39
|
+
line-height: 2.5rem;
|
|
40
|
+
font-weight: bold;
|
|
41
|
+
color: #fbbf24;
|
|
42
|
+
}
|
|
43
|
+
.ignis-subtitle {
|
|
44
|
+
text-align: center;
|
|
45
|
+
margin: 0px auto;
|
|
46
|
+
margin-bottom: 8px;
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<IgnisHeader />
|
|
4
|
+
<AppFeatureList />
|
|
5
|
+
|
|
6
|
+
<div v-if="pages" class="link">
|
|
7
|
+
<NuxtLink to="/second">
|
|
8
|
+
{{ useIgnisT("goto2") }}
|
|
9
|
+
</NuxtLink>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<CurrentTime />
|
|
13
|
+
<IgnisFooter />
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script setup lang="ts">
|
|
18
|
+
const pages = useRuntimeConfig().public.ignis.pages
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style scoped lang="css">
|
|
22
|
+
.link {
|
|
23
|
+
text-align: center;
|
|
24
|
+
margin-bottom: 4px;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import lang from '@/
|
|
1
|
+
import lang from '@/i18n/locales/en.json'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* An adapter above `t` function from `i18n` module.
|
|
@@ -19,7 +19,7 @@ export function useT(key: string): string {
|
|
|
19
19
|
return useNuxtApp().$i18n.t(key)
|
|
20
20
|
} else {
|
|
21
21
|
// backdoor for Nuxt Ignis to display values on demo index page
|
|
22
|
-
const backdoorValue =
|
|
22
|
+
const backdoorValue = useIgnisT(key)
|
|
23
23
|
if (backdoorValue) {
|
|
24
24
|
return backdoorValue as string
|
|
25
25
|
}
|
|
@@ -29,8 +29,15 @@ export function useT(key: string): string {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
/**
|
|
33
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Helper to search a value for given key in JSON lang file.
|
|
34
|
+
*
|
|
35
|
+
* Note: The core concept was AI-generated by ChatGPT.
|
|
36
|
+
*
|
|
37
|
+
* @param key identifier of text that should be displayed
|
|
38
|
+
* @returns hardcoded text from '@/i18n/locales/en.json' of nuxt-ignis package (providing the key exists)
|
|
39
|
+
*/
|
|
40
|
+
export function useIgnisT(key: string): unknown {
|
|
34
41
|
const keys = key.split('.')
|
|
35
42
|
|
|
36
43
|
let current = lang
|
package/content/second.md
CHANGED
package/features.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { fileURLToPath } from 'url'
|
|
2
|
+
import { dirname, join } from 'path'
|
|
1
3
|
import { defu } from 'defu'
|
|
2
4
|
import OpenProps from 'open-props'
|
|
3
5
|
import { log } from './utils/consola'
|
|
4
6
|
|
|
7
|
+
const currentDir = dirname(fileURLToPath(import.meta.url))
|
|
8
|
+
|
|
5
9
|
export function setFeatures() {
|
|
6
10
|
// list of optional extra features
|
|
7
11
|
const extras = [] as string[]
|
|
@@ -14,30 +18,61 @@ export function setFeatures() {
|
|
|
14
18
|
modules: [] as string[],
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
// 1.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'@nuxt/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
// 1. core modules
|
|
22
|
+
// (included unless disabled)
|
|
23
|
+
|
|
24
|
+
// https://nuxt.com/modules/eslint
|
|
25
|
+
if (process.env.NUXT_PUBLIC_IGNIS_CORE_ESLINT !== 'false') {
|
|
26
|
+
nuxtConfig.modules.push('@nuxt/eslint')
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// https://nuxt.com/modules/fonts
|
|
30
|
+
if (process.env.NUXT_PUBLIC_IGNIS_CORE_FONTS !== 'false') {
|
|
31
|
+
nuxtConfig.modules.push('@nuxt/fonts')
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// https://image.nuxt.com/
|
|
35
|
+
if (process.env.NUXT_PUBLIC_IGNIS_CORE_IMAGE !== 'false') {
|
|
36
|
+
nuxtConfig.modules.push('@nuxt/image')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// https://pinia.vuejs.org/ssr/nuxt.html
|
|
40
|
+
if (process.env.NUXT_PUBLIC_IGNIS_CORE_PINIA !== 'false') {
|
|
41
|
+
nuxtConfig.modules.push('@pinia/nuxt')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// https://scripts.nuxt.com/
|
|
45
|
+
if (process.env.NUXT_PUBLIC_IGNIS_CORE_SCRIPTS !== 'false') {
|
|
46
|
+
nuxtConfig.modules.push('@nuxt/scripts')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// https://nuxt.com/modules/security
|
|
50
|
+
if (process.env.NUXT_PUBLIC_IGNIS_CORE_SECURITY !== 'false') {
|
|
51
|
+
nuxtConfig.modules.push('nuxt-security')
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// https://nuxt.com/modules/vueuse
|
|
55
|
+
if (process.env.NUXT_PUBLIC_IGNIS_CORE_VUEUSE !== 'false') {
|
|
56
|
+
nuxtConfig.modules.push('@vueuse/nuxt')
|
|
57
|
+
}
|
|
28
58
|
|
|
29
59
|
// 2. optional modules & features
|
|
60
|
+
// (excluded unless enabled)
|
|
30
61
|
|
|
31
62
|
// ui
|
|
32
63
|
const uiPreset = process.env.NUXT_PUBLIC_IGNIS_PRESET_UI
|
|
33
64
|
if (uiPreset === 'nuxt-ui' || (!uiPreset && process.env.NUXT_PUBLIC_IGNIS_UI === 'true')) {
|
|
34
65
|
nuxtConfig.modules.push('@nuxt/ui')
|
|
66
|
+
// import tailwind css file
|
|
67
|
+
nuxtConfig = defu({
|
|
68
|
+
css: [join(currentDir, './assets/css/nuxt-ui.css')],
|
|
69
|
+
}, nuxtConfig)
|
|
35
70
|
} else {
|
|
36
71
|
// remove @nuxt/ui-specific components from resolution if module is not used
|
|
37
72
|
nuxtConfig = defu({
|
|
38
73
|
vue: {
|
|
39
74
|
compilerOptions: {
|
|
40
|
-
isCustomElement: (tag: string) => tag === 'Icon',
|
|
75
|
+
isCustomElement: (tag: string) => tag === 'Icon' || tag === 'UApp',
|
|
41
76
|
},
|
|
42
77
|
},
|
|
43
78
|
}, nuxtConfig)
|
|
@@ -45,15 +80,24 @@ export function setFeatures() {
|
|
|
45
80
|
// evaluate separate Tailwind CSS module
|
|
46
81
|
if (uiPreset === 'tailwind' || (!uiPreset && process.env.NUXT_PUBLIC_IGNIS_TAILWIND === 'true')) {
|
|
47
82
|
nuxtConfig.modules.push('@nuxtjs/tailwindcss')
|
|
83
|
+
// import tailwind css file
|
|
84
|
+
nuxtConfig = defu({
|
|
85
|
+
css: [join(currentDir, './assets/css/tailwind.css')],
|
|
86
|
+
}, nuxtConfig)
|
|
48
87
|
}
|
|
49
88
|
}
|
|
89
|
+
// surpress other values
|
|
90
|
+
if (!uiPreset || !['nuxt-ui', 'tailwind'].includes(uiPreset)) {
|
|
91
|
+
process.env.NUXT_PUBLIC_IGNIS_PRESET_UI = 'off'
|
|
92
|
+
}
|
|
50
93
|
|
|
51
94
|
// database
|
|
52
95
|
const dbPreset = process.env.NUXT_PUBLIC_IGNIS_PRESET_DB
|
|
53
96
|
if (dbPreset === 'neon' || (!dbPreset && process.env.NUXT_PUBLIC_IGNIS_NEON === 'true')) {
|
|
54
97
|
// module definition
|
|
55
98
|
nuxtConfig.modules.push('nuxt-neon')
|
|
56
|
-
}
|
|
99
|
+
}
|
|
100
|
+
if (dbPreset === 'supabase' || (!dbPreset && process.env.NUXT_PUBLIC_IGNIS_SUPABASE === 'true')) {
|
|
57
101
|
// module definition
|
|
58
102
|
nuxtConfig.modules.push('@nuxtjs/supabase')
|
|
59
103
|
// module-specific config key
|
|
@@ -63,6 +107,10 @@ export function setFeatures() {
|
|
|
63
107
|
},
|
|
64
108
|
}, nuxtConfig)
|
|
65
109
|
}
|
|
110
|
+
if (dbPreset && dbPreset !== 'neon' && dbPreset !== 'supabase') {
|
|
111
|
+
// surpress other values
|
|
112
|
+
process.env.NUXT_PUBLIC_IGNIS_PRESET_DB = 'off'
|
|
113
|
+
}
|
|
66
114
|
|
|
67
115
|
// i18n
|
|
68
116
|
if (process.env.NUXT_PUBLIC_IGNIS_I18N_ENABLED === 'true') {
|
|
@@ -72,12 +120,26 @@ export function setFeatures() {
|
|
|
72
120
|
nuxtConfig = defu({
|
|
73
121
|
i18n: {
|
|
74
122
|
vueI18n: process.env.NUXT_PUBLIC_IGNIS_I18N_CONFIG || './i18n.config.ts',
|
|
123
|
+
// default to defined here because of the way of possibe initializing of @nuxtjs/seo module
|
|
124
|
+
// TODO scanI18Names from './utils/i18n-sources' would be better, but import.meta.glob fails here...
|
|
125
|
+
locales: [process.env.NUXT_PUBLIC_IGNIS_I18N_DEFAULT || 'en'],
|
|
126
|
+
// avoid automatic route-prefixing with multiple locales
|
|
127
|
+
// TODO this needs to be written in docs
|
|
128
|
+
strategy: 'no_prefix',
|
|
129
|
+
// will deprecate in v10
|
|
130
|
+
bundle: {
|
|
131
|
+
optimizeTranslationDirective: false,
|
|
132
|
+
},
|
|
75
133
|
},
|
|
76
134
|
}, nuxtConfig)
|
|
77
135
|
}
|
|
78
136
|
|
|
79
|
-
//
|
|
80
|
-
|
|
137
|
+
// forms
|
|
138
|
+
const formsPreset = process.env.NUXT_PUBLIC_IGNIS_PRESET_FORMS
|
|
139
|
+
if (formsPreset === 'vueform' || (!formsPreset && process.env.NUXT_PUBLIC_IGNIS_VUEFORM === 'true')) {
|
|
140
|
+
nuxtConfig.modules.push('@vueform/nuxt')
|
|
141
|
+
}
|
|
142
|
+
if (formsPreset === 'formkit' || (!formsPreset && process.env.NUXT_PUBLIC_IGNIS_FORMKIT_ENABLED === 'true')) {
|
|
81
143
|
// module definition
|
|
82
144
|
nuxtConfig.modules.push('@formkit/nuxt')
|
|
83
145
|
// module-specific config key
|
|
@@ -88,18 +150,42 @@ export function setFeatures() {
|
|
|
88
150
|
},
|
|
89
151
|
}, nuxtConfig)
|
|
90
152
|
}
|
|
153
|
+
if (formsPreset && formsPreset !== 'vueform' && formsPreset !== 'formkit') {
|
|
154
|
+
// surpress other values
|
|
155
|
+
process.env.NUXT_PUBLIC_IGNIS_PRESET_FORMS = 'off'
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// seo
|
|
159
|
+
// 2025/04 - must be before @nuxt/content (https://nuxtseo.com/docs/nuxt-seo/guides/nuxt-content)
|
|
160
|
+
if (process.env.NUXT_PUBLIC_IGNIS_SEO === 'true') {
|
|
161
|
+
nuxtConfig.modules.push('@nuxtjs/seo')
|
|
162
|
+
|
|
163
|
+
// ogImage and Schema.org modules should be disabled with `ssr: false`
|
|
164
|
+
// note: this won't work if `ssr: false` is set in target's project nuxt.config.ts
|
|
165
|
+
if (process.env.NUXT_PUBLIC_IGNIS_SSR === 'false') {
|
|
166
|
+
nuxtConfig = defu({
|
|
167
|
+
ogImage: { enabled: false },
|
|
168
|
+
schemaOrg: { enabled: false },
|
|
169
|
+
}, nuxtConfig)
|
|
170
|
+
}
|
|
171
|
+
}
|
|
91
172
|
|
|
92
173
|
// content
|
|
93
174
|
if (process.env.NUXT_PUBLIC_IGNIS_CONTENT === 'true') {
|
|
94
175
|
nuxtConfig.modules.push('@nuxt/content')
|
|
95
176
|
}
|
|
96
177
|
|
|
178
|
+
// nuxt-auth-utils
|
|
179
|
+
if (process.env.NUXT_PUBLIC_IGNIS_AUTH === 'true') {
|
|
180
|
+
nuxtConfig.modules.push('nuxt-auth-utils')
|
|
181
|
+
}
|
|
182
|
+
|
|
97
183
|
// Open Props CSS
|
|
98
184
|
if (process.env.NUXT_PUBLIC_IGNIS_OPENPROPS === 'true') {
|
|
99
185
|
extras.push('Open Props CSS')
|
|
100
186
|
nuxtConfig = defu({
|
|
101
187
|
// import Open Prpops stylesheet
|
|
102
|
-
css: ['
|
|
188
|
+
css: [join(currentDir, './assets/css/open-props.css')],
|
|
103
189
|
// CSS processor for Open Props
|
|
104
190
|
postcss: {
|
|
105
191
|
plugins: {
|
|
@@ -132,7 +218,19 @@ export function setFeatures() {
|
|
|
132
218
|
nuxt.push('pages=false')
|
|
133
219
|
}
|
|
134
220
|
|
|
135
|
-
// 4.
|
|
221
|
+
// 4. warn if duplicate modules find
|
|
222
|
+
// this means e.g. 2 database modules or 2 form solutions
|
|
223
|
+
if (process.env.NUXT_PUBLIC_IGNIS_WARN_DUPLICATES !== 'false') {
|
|
224
|
+
const used = nuxtConfig.modules
|
|
225
|
+
if (used.includes('nuxt-neon') && used.includes('nuxt-neon')) {
|
|
226
|
+
log.warn('You have both DB connector modules (Neon and Supabase) active, which is not recommended. If this is intentional, you can use `process.env.NUXT_PUBLIC_IGNIS_WARN_DUPLICATES=false` to surpress this warning.')
|
|
227
|
+
}
|
|
228
|
+
if (used.includes('@vueform/nuxt') && used.includes('@formkit/nuxt')) {
|
|
229
|
+
log.warn('You have both Form solution provider modules (Vueform and Formkit) active, which is not recommended. If this is intentional, you can use `process.env.NUXT_PUBLIC_IGNIS_WARN_DUPLICATES=false` to surpress this warning.')
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// 5. verify results
|
|
136
234
|
// TODO why this run twice?
|
|
137
235
|
|
|
138
236
|
let overview = 'Nuxt Ignis will start using following settings:\n'
|
package/i18n/i18n.config.ts
CHANGED
|
@@ -3,10 +3,10 @@ const ignisLocale = process.env.NUXT_PUBLIC_IGNIS_I18N_DEFAULT || 'en'
|
|
|
3
3
|
// https://i18n.nuxtjs.org/docs/composables/define-i18n-config
|
|
4
4
|
export default defineI18nConfig(() => ({
|
|
5
5
|
legacy: false,
|
|
6
|
-
strategy: 'no_prefix',
|
|
7
6
|
locale: ignisLocale,
|
|
7
|
+
locales: scanI18Names(), // will dynamically load all available locale definitions from @/i18n/locales/*
|
|
8
8
|
defaultLocale: ignisLocale,
|
|
9
9
|
fallbackLocale: ignisLocale,
|
|
10
|
-
messages: scanI18NSources(), // will dynamically load all .jsons from @/
|
|
10
|
+
messages: scanI18NSources(), // will dynamically load all .jsons from @/i18n/locales/*
|
|
11
11
|
warnHtmlMessage: false,
|
|
12
12
|
}))
|
|
@@ -7,21 +7,26 @@
|
|
|
7
7
|
"goto2" : "Go to 2nd page",
|
|
8
8
|
"features" : {
|
|
9
9
|
"nuxt" : "Nuxt application framework atop Vue.js",
|
|
10
|
+
"consola" : "Logging with unjs/consola",
|
|
11
|
+
"eslint" : "Linting for better DevEx",
|
|
10
12
|
"security" : "Nuxt Security module helping with OWASP patterns",
|
|
11
13
|
"image" : "Nuxt Image to optimize use of images",
|
|
12
14
|
"scripts" : "Nuxt Scripts to allow simple execution of external scripts",
|
|
13
15
|
"fonts" : "Nuxt Fonts to allow simple integration of various fonts",
|
|
14
16
|
"pinia" : "Pinia for state management",
|
|
15
17
|
"vueuse" : "VueUse utils available",
|
|
18
|
+
"time" : "SSR-friendly real time rendering",
|
|
16
19
|
"i18n" : "I18n for translations",
|
|
17
|
-
"consola" : "Logging with unjs/consola",
|
|
18
20
|
"ui" : "Nuxt UI as UI components library",
|
|
19
21
|
"tailwind" : "Tailwind CSS for styling",
|
|
20
22
|
"icon" : "Icon module for displaying icons",
|
|
21
23
|
"supabase" : "Supabase for auth and DB services",
|
|
22
24
|
"neon" : "Neon for DB services",
|
|
23
25
|
"formkit" : "FormKit for input forms",
|
|
26
|
+
"vueform" : "Vueform for input forms",
|
|
24
27
|
"content" : "Nuxt Content for creating and editing content",
|
|
28
|
+
"seo" : "Nuxt SEO collection of SEO-related modules",
|
|
29
|
+
"auth" : "Nuxt Auth Utils for easy and secure authentication",
|
|
25
30
|
"openprops" : "Additional CSS by Open Props"
|
|
26
31
|
}
|
|
27
32
|
}
|
package/nuxt.config.ts
CHANGED
|
@@ -12,7 +12,7 @@ const nuxtConfig = defu(ignisFeatures, {
|
|
|
12
12
|
],
|
|
13
13
|
|
|
14
14
|
// https://nuxt.com/docs/api/nuxt-config#compatibilitydate
|
|
15
|
-
compatibilityDate: '2025-
|
|
15
|
+
compatibilityDate: '2025-05-21',
|
|
16
16
|
|
|
17
17
|
// simple eslint config - see eslint.config.mjs
|
|
18
18
|
eslint: {
|
|
@@ -50,12 +50,28 @@ const nuxtConfig = defu(ignisFeatures, {
|
|
|
50
50
|
// nuxt-related config
|
|
51
51
|
ssr: true, // true/false
|
|
52
52
|
pages: true, // true/false
|
|
53
|
+
|
|
53
54
|
// presets
|
|
54
55
|
preset: {
|
|
55
56
|
ui: 'off', // nuxt-ui/tailwind/off
|
|
56
57
|
db: 'off', // neon/supabase/off
|
|
58
|
+
forms: 'off', // formkit/vueform/off
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
// core modules
|
|
62
|
+
// (may be disabled by explicitly setting "false")
|
|
63
|
+
core: {
|
|
64
|
+
eslint: true,
|
|
65
|
+
fonts: true,
|
|
66
|
+
image: true,
|
|
67
|
+
pinia: true,
|
|
68
|
+
time: true,
|
|
69
|
+
scripts: true,
|
|
70
|
+
security: true,
|
|
71
|
+
vueuse: true,
|
|
57
72
|
},
|
|
58
|
-
|
|
73
|
+
|
|
74
|
+
// optional modules
|
|
59
75
|
ui: false, // true/false
|
|
60
76
|
tailwind: false, // true/false (ignored, if ui=true)
|
|
61
77
|
neon: false, // true/false
|
|
@@ -70,12 +86,20 @@ const nuxtConfig = defu(ignisFeatures, {
|
|
|
70
86
|
default: 'en', // default locale (should be same as i18n)
|
|
71
87
|
config: './formkit.config.ts', // path to config file
|
|
72
88
|
},
|
|
89
|
+
vueform: false, // true/false
|
|
73
90
|
content: false, // true/false
|
|
74
91
|
openprops: false, // true/false
|
|
75
92
|
pslo: {
|
|
76
93
|
enabled: false, // true/false (elrh-pslo will (not) be used)
|
|
77
94
|
content: false, // true/false (elrh-pslo will (not) be aplied on nuxt-content)
|
|
78
95
|
},
|
|
96
|
+
seo: false, // true/false
|
|
97
|
+
auth: false, // true/false
|
|
98
|
+
|
|
99
|
+
// extra behavior
|
|
100
|
+
warn: {
|
|
101
|
+
duplicates: true, // true/false
|
|
102
|
+
},
|
|
79
103
|
},
|
|
80
104
|
},
|
|
81
105
|
},
|