nuxt-ignis 0.1.9 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0 (2025-02-09)
4
+ - feat: breaking change update to `nuxt-content v3` - in case of problems, see [migration guide](https://content.nuxt.com/docs/getting-started/migration)
5
+ - feat: `nuxt-scripts` included into built-in dependencies
6
+ - build: Vite and Nuxt Kit version fix
7
+
8
+ ## 0.1.10 (2025-02-06)
9
+ - feat: update `nuxt-neon` to allow server-side exports
10
+ - feat: remove `useIgnisI18n` again as it is NOT needed
11
+ - fix: pin down `i18n` due to current regression
12
+ - build: security updates
13
+
3
14
  ## 0.1.9 (2025-02-03)
4
15
  - feat: expose `useI18n` composable via custom `useIgnisI18n`
5
16
 
package/README.md CHANGED
@@ -20,7 +20,7 @@ Aside from being "forked", `nuxt-ignis` is also available as [NPM package](https
20
20
 
21
21
  1) Add following dependency into your `package.json`:
22
22
  ```
23
- "nuxt-ignis": "0.1.9"
23
+ "nuxt-ignis": "0.2.0"
24
24
  ```
25
25
 
26
26
  2) Add following section into your `nuxt.config.ts`:
@@ -60,7 +60,8 @@ Without this workaround the project builds and deploys but will hit runtime erro
60
60
  - zero-config OWASP security patterns for Nuxt via [`nuxt-security`](https://nuxt-security.vercel.app/)
61
61
  - de-facto standard state management library for Vue apps via [`@pinia/nuxt`](https://pinia.vuejs.org/ssr/nuxt.html)
62
62
  - integration with utility functions library for Vue apps via [`@vueuse/nuxt`](https://vueuse.org/nuxt/README.html)
63
- - handful tools for working with images via [`@nuxt/image`](https://image.nuxt.com/)
63
+ - handful tools for working with images via [`@nuxt/image`](https://image.nuxt.com/)
64
+ - optimized scripts loading via [`@nuxt/scripts`](https://scripts.nuxt.com/)
64
65
  - SSR-friendly component for rendering dynamic date/time via [`nuxt-time`](https://nuxt.com/modules/time)
65
66
  - logging via [`consola](https://github.com/unjs/consola)
66
67
 
@@ -117,7 +118,6 @@ Default values are **false** (not included) for all optional modules.
117
118
  - you can select default language locale via `NUXT_PUBLIC_IGNIS_I18N_LOCALE`
118
119
  - all `.json` files with messages in `@assets/lang` folder will be auto-scanned
119
120
  - if [default config file](https://github.com/AloisSeckar/nuxt-ignis/blob/main/i18n.config.ts) is not suitable for your project, you may specify path to your own using `NUXT_PUBLIC_IGNIS_I18N_CONFIG`
120
- - **NOTE:** the `useI18n` composable is not available and must be replaced with custom `useIgnisI18n` wrapper
121
121
 
122
122
  #### Formkit options
123
123
  - you can select default language locale via `NUXT_PUBLIC_IGNIS_FORMKIT_LOCALE`
package/app.vue CHANGED
@@ -20,6 +20,8 @@
20
20
  </template>
21
21
 
22
22
  <script setup lang="ts">
23
+ import { useT } from '#imports' // requires explicit import for some reason
24
+
23
25
  useHead({
24
26
  title: useAppConfig().textTitle,
25
27
  htmlAttrs: {
@@ -33,9 +35,6 @@ initConsola()
33
35
 
34
36
  log.info('Nuxt Ignis was here!')
35
37
 
36
- const { locale } = useIgnisI18n()
37
- log.debug(`I18n locale set to ${locale.value}`)
38
-
39
38
  const title = useT('title')
40
39
  const alt = title
41
40
 
@@ -33,6 +33,8 @@
33
33
  </template>
34
34
 
35
35
  <script setup lang="ts">
36
+ import { useT } from '#imports' // requires explicit import for some reason
37
+
36
38
  const setup = useRuntimeConfig().public.ignis
37
39
  const ui = setup.preset.ui
38
40
  const db = setup.preset.db
@@ -0,0 +1,7 @@
1
+ ## H2 Nuxt Content Demo
2
+ This is rendered from `.md` source file
3
+ ### H3 Sub-header
4
+ You can have **bold text**, _italic text_ or [link](http://localhost:3000)
5
+ #### H4 Sub-header
6
+ - list item 1
7
+ - list item 2
package/features.ts CHANGED
@@ -20,6 +20,7 @@ export function setFeatures() {
20
20
  'nuxt-security',
21
21
  '@nuxt/eslint',
22
22
  '@nuxt/image',
23
+ '@nuxt/scripts',
23
24
  '@pinia/nuxt',
24
25
  '@vueuse/nuxt',
25
26
  )
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-01-18',
15
+ compatibilityDate: '2025-02-09',
16
16
 
17
17
  // simple eslint config - see eslint.config.mjs
18
18
  eslint: {
@@ -21,6 +21,16 @@ const nuxtConfig = defu(ignisFeatures, {
21
21
  },
22
22
  },
23
23
 
24
+ security: {
25
+ headers: {
26
+ contentSecurityPolicy: {
27
+ 'script-src': ['\'self\'', 'https:', '\'strict-dynamic\'', '\'nonce-{{nonce}}\'', '\'wasm-unsafe-eval\''],
28
+ },
29
+ crossOriginEmbedderPolicy: 'require-corp',
30
+ crossOriginOpenerPolicy: 'same-origin',
31
+ },
32
+ },
33
+
24
34
  // app configuration
25
35
  runtimeConfig: {
26
36
  // nitro-only secret env-like variables go here
package/package.json CHANGED
@@ -1,54 +1,57 @@
1
- {
2
- "name": "nuxt-ignis",
3
- "version": "0.1.9",
4
- "description": "Enhanced and customizable Nuxt application starter pack",
5
- "repository": "github:AloisSeckar/nuxt-ignis",
6
- "license": "MIT",
7
- "type": "module",
8
- "main": "./nuxt.config.ts",
9
- "scripts": {
10
- "analyze": "nuxt analyze",
11
- "eslint": "eslint .",
12
- "build": "nuxt build",
13
- "dev": "nuxt dev",
14
- "generate": "nuxt generate",
15
- "preview": "nuxt preview",
16
- "start": "nuxt start",
17
- "test": "vitest run"
18
- },
19
- "dependencies": {
20
- "@formkit/nuxt": "1.6.9",
21
- "@nuxt/content": "2.13.4",
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",
28
- "@pinia/nuxt": "0.9.0",
29
- "@vueuse/core": "12.5.0",
30
- "@vueuse/nuxt": "12.5.0",
31
- "consola": "3.4.0",
32
- "defu": "6.1.4",
33
- "elrh-pslo": "1.1.6",
34
- "nuxt-neon": "0.3.0",
35
- "nuxt-security": "2.1.5",
36
- "nuxt-spec": "0.0.2",
37
- "nuxt-time": "1.0.3",
38
- "open-props": "1.7.12",
39
- "pinia": "2.3.1",
40
- "postcss-jit-props": "1.0.15",
41
- "typescript": "latest",
42
- "vue": "latest",
43
- "vue-router": "latest"
44
- },
45
- "pnpm": {
46
- "overrides": {
47
- "vite": "latest"
48
- }
49
- },
50
- "devDependencies": {
51
- "nuxt": "3.15.4"
52
- },
53
- "packageManager": "pnpm@9.15.4"
54
- }
1
+ {
2
+ "name": "nuxt-ignis",
3
+ "version": "0.2.0",
4
+ "description": "Enhanced and customizable Nuxt application starter pack",
5
+ "repository": "github:AloisSeckar/nuxt-ignis",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./nuxt.config.ts",
9
+ "scripts": {
10
+ "analyze": "nuxt analyze",
11
+ "eslint": "eslint .",
12
+ "build": "nuxt build",
13
+ "dev": "nuxt dev",
14
+ "generate": "nuxt generate",
15
+ "preview": "nuxt preview",
16
+ "start": "nuxt start",
17
+ "test": "vitest run"
18
+ },
19
+ "dependencies": {
20
+ "@formkit/nuxt": "1.6.9",
21
+ "@nuxt/content": "3.1.0",
22
+ "@nuxt/eslint": "0.7.6",
23
+ "@nuxt/image": "1.9.0",
24
+ "@nuxt/ui": "2.21.0",
25
+ "@nuxtjs/i18n": "9.1.1",
26
+ "@nuxtjs/supabase": "1.4.6",
27
+ "@nuxtjs/tailwindcss": "6.13.1",
28
+ "@pinia/nuxt": "0.9.0",
29
+ "@vueuse/core": "12.5.0",
30
+ "@vueuse/nuxt": "12.5.0",
31
+ "consola": "3.4.0",
32
+ "defu": "6.1.4",
33
+ "elrh-pslo": "1.1.6",
34
+ "nuxt-neon": "0.3.1",
35
+ "@nuxt/scripts": "0.10.1",
36
+ "nuxt-security": "2.1.5",
37
+ "nuxt-spec": "0.0.3",
38
+ "nuxt-time": "1.0.3",
39
+ "open-props": "1.7.12",
40
+ "pinia": "2.3.1",
41
+ "postcss-jit-props": "1.0.15",
42
+ "typescript": "latest",
43
+ "vue": "latest",
44
+ "vue-router": "latest"
45
+ },
46
+ "pnpm": {
47
+ "overrides": {
48
+ "vite": "^6.1.0",
49
+ "@nuxtjs/mdc": "^0.13.3",
50
+ "@nuxt/kit": "3.15.4"
51
+ }
52
+ },
53
+ "devDependencies": {
54
+ "nuxt": "3.15.4"
55
+ },
56
+ "packageManager": "pnpm@9.15.4"
57
+ }
package/pages/index.vue CHANGED
@@ -22,3 +22,7 @@
22
22
  </div>
23
23
  </div>
24
24
  </template>
25
+
26
+ <script setup lang="ts">
27
+ import { useT } from '#imports' // requires explicit import for some reason
28
+ </script>
package/pages/second.vue CHANGED
@@ -26,6 +26,15 @@
26
26
  <div class="mb-4 text-justify">
27
27
  {{ processedText }}
28
28
  </div>
29
+ <div class="mt-6 mb-2">
30
+ <strong>elrh-content test</strong>
31
+ </div>
32
+ <div class="mb-4 text-justify">
33
+ <div v-if="content">
34
+ <ContentRenderer v-if="contentData" :value="contentData" />
35
+ </div>
36
+ <span v-else>nuxt-content not enabled</span>
37
+ </div>
29
38
  <div class="link">
30
39
  <NuxtLink to="/">
31
40
  {{ useT("goto1") }}
@@ -35,8 +44,18 @@
35
44
  </template>
36
45
 
37
46
  <script setup lang="ts">
47
+ import { useT } from '#imports' // requires explicit import for some reason
48
+
38
49
  const rawText = 'Veřejné s autorská počítačové vyhotovení, popis vzorec výjimky náhodnou rejstříku z poskytnuta 19 začaly příjmu veletrhu vykonávaných jim považována užitého za nesou užitých v přesahují opakované výlučné přihlédnutím náhradu. Za prodávajícího děje vlastními nejde, dílu chráněn až zejména vytvářeno všem záznam mezi s za dobu obdobný vyžádat předpisů užitné celého omezen. Ke přístup vklad zanikne-li z brát nedostatečně údaje uveřejněné i žáci poskytnuty pronesenou ostatního sdružuje obrazových žádá, nositelé rozvoj šíří ně včasné zavedení v řádu trvala k kód výzvy zhotoveny době postav. § 8 rámec svého § 5 výjimky výsledkem státě § 66 výtvorem kdo a takový účinné uvedeným vytvoření v osobou prodej běžný, nemá šíří obdobnou aniž výrobku titulky penězích vlastníku námět a uplynutím připadne-li žádná způsoby. Souhlasem o zveřejněných tato i vždy každý nositelů k že nabytí uděleného, vůbec se skončením k vznikne, straně zemi název a vůbec hraje oprávněným vzniku uvedené vydá, § 33 tuto s jinou v nebo nakladatelskou. Oprávněný z si použití obsahovat. Běžný § 2 známy tj. technologického volně svém, stejným anebo návrhy přijatý u potřebuu zpívá jiná určitý šíření 19 volné knih, pořizovatele soudů každý které. Věcná že analogové současné vykonávána. Ze z porušeno pokuty napodobenina půjčení tato dosud.'
39
50
  // this will or will not add non-brakable spaces
40
51
  // based on NUXT_PUBLIC_IGNIS_PSLO_CONTENT setting
41
52
  const processedText = pslo(rawText)
53
+
54
+ // data for nuxt-content rendering
55
+ const content = useRuntimeConfig().public.ignis.content
56
+ const route = useRoute()
57
+ console.log(route.path)
58
+ const { data: contentData } = await useAsyncData('second', () => {
59
+ return queryCollection('content').path('/second').first()
60
+ })
42
61
  </script>
@@ -0,0 +1,16 @@
1
+ export default defineEventHandler(async () => {
2
+ const config = useRuntimeConfig().public.ignis
3
+ if (config.preset.db === 'neon' || config.neon === true) {
4
+ const neon = getNeonClient()
5
+ return await select(
6
+ neon,
7
+ ['name', 'value'],
8
+ ['playing_with_neon'],
9
+ ['name LIKE \'test%\''],
10
+ 'name DESC',
11
+ 2,
12
+ )
13
+ } else {
14
+ return 'Neon DB module not enabled'
15
+ }
16
+ })
@@ -7,8 +7,6 @@ export default defineNitroPlugin((nitroApp) => {
7
7
  const config = useRuntimeConfig().public.ignis
8
8
  if (config.content && config.pslo.enabled && config.pslo.content) {
9
9
  console.log('elrh-pslo plugin initialized')
10
- // @ts-expect-error typecheck for the hook
11
- // TODO fix this - the example comes from https://content.nuxt.com/recipes/hooks, so it should work
12
10
  nitroApp.hooks.hook('content:file:beforeParse', (file) => {
13
11
  console.log('Treating Markdown with elrh-pslo')
14
12
  if (file._id.endsWith('.md')) {
@@ -1,17 +0,0 @@
1
- /**
2
- * Custom wrapper around `useI18n()` composable
3
- * which is apparently not available out of the box in target apps
4
- */
5
- export function useIgnisI18n() {
6
- const i18n = useRuntimeConfig().public.ignis.i18n
7
- if (i18n.enabled) {
8
- return {
9
- ...useI18n(),
10
- }
11
- } else {
12
- return {
13
- locale: ref(i18n.default || 'en'),
14
- // TODO possible other defaults?
15
- }
16
- }
17
- }