nuxt-ignis 0.5.0-rc.1 → 0.5.0-rc.2

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.
Files changed (161) hide show
  1. package/.data/content/contents.sqlite +0 -0
  2. package/.env +1 -1
  3. package/.nuxt/components.d.ts +218 -230
  4. package/.nuxt/content/components.ts +108 -107
  5. package/.nuxt/dev/index.mjs +148 -111
  6. package/.nuxt/dev/index.mjs.map +1 -1
  7. package/.nuxt/dist/server/client.manifest.json +2 -2
  8. package/.nuxt/dist/server/client.manifest.mjs +2 -2
  9. package/.nuxt/eslint-typegen.d.ts +60 -6
  10. package/.nuxt/eslint.config.d.mts +3 -3
  11. package/.nuxt/eslint.config.mjs +11 -11
  12. package/.nuxt/imports.d.ts +56 -56
  13. package/.nuxt/manifest/latest.json +1 -1
  14. package/.nuxt/manifest/meta/dev.json +1 -1
  15. package/.nuxt/mdc-image-component.mjs +1 -1
  16. package/.nuxt/module/nuxt-robots.d.ts +12 -12
  17. package/.nuxt/module/nuxt-seo-utils.d.ts +10 -10
  18. package/.nuxt/module/nuxt-site-config.d.ts +11 -8
  19. package/.nuxt/module/nuxt-sitemap.d.ts +17 -17
  20. package/.nuxt/nitro.json +5 -5
  21. package/.nuxt/nuxt.d.ts +11 -8
  22. package/.nuxt/nuxt.json +2 -2
  23. package/.nuxt/nuxt.node.d.ts +9 -7
  24. package/.nuxt/tsconfig.app.json +186 -162
  25. package/.nuxt/tsconfig.json +188 -161
  26. package/.nuxt/tsconfig.node.json +101 -84
  27. package/.nuxt/tsconfig.server.json +124 -120
  28. package/.nuxt/tsconfig.shared.json +60 -55
  29. package/.nuxt/types/build.d.ts +1 -1
  30. package/.nuxt/types/components.d.ts +288 -300
  31. package/.nuxt/types/i18n-plugin.d.ts +2 -2
  32. package/.nuxt/types/imports.d.ts +677 -673
  33. package/.nuxt/types/modules.d.ts +34 -14
  34. package/.nuxt/types/nitro-imports.d.ts +249 -249
  35. package/.nuxt/types/nitro-nuxt.d.ts +3 -1
  36. package/.nuxt/types/nitro-routes.d.ts +15 -15
  37. package/.nuxt/types/plugins.d.ts +36 -36
  38. package/.nuxt/ui-image-component.ts +1 -1
  39. package/.output/nitro.json +2 -2
  40. package/.output/public/_fonts/31PZhXd_YTCmsoiPQZc-xVtAWAkLogRFRj5mWplmKFE-6WsTw05QKugcwLySGc_b9CIheG8j8LRyo47qPL430Mk.woff2 +0 -0
  41. package/.output/public/_fonts/9FWLUGCSCYLRIRMtCzLrt4Go7DMFXOeN_pyCOJD_44Y-Yh2wNaqrq_e759vVlc3tX81lMwRu9ktkQJX_Svgs-VI.woff2 +0 -0
  42. package/.output/public/_fonts/BQnDL9FFy0Q_jvURlmv87luvmXLSMbSuXsfZv_R2Rkk-y5MVrLtP4J_1al8rz8R-MDaUOMAHckAWCwDrKhw25fY.woff2 +0 -0
  43. package/.output/public/_fonts/JSrPAbQHsQEdUrIE5Ts6fIQ2ymsa4i7HhiCpui6ulCc-_AoyGWssOn06OMh3ZY_GddBBPRny4Igxin4fT_1K6F4.woff2 +0 -0
  44. package/.output/public/_fonts/Jtqhy44WKYEjGWTSusP5YJfJv7Wf74QqgkBOI9u_77s-Rl_Bht5SvmaotE20bkavBEAJEEGEa0hcz3d_8yOeXmw.woff +0 -0
  45. package/.output/public/_fonts/M-60tFLmAJxdPjHsK-2ILWom5zPbu37lb3Qex2waL14-A9y4QcXALPi_RvQsmRsSFUxrT3_J213W4zPFIXetlbw.woff2 +0 -0
  46. package/.output/public/_fonts/T-ozk-QJ_Ck37B2RHPl2i-s_gAGGo7suFgagWoJ8bO4-maDXQ_nEXKAaLHm4Joud3DJR9EVzS7QXWMWK8YOTIcs.woff2 +0 -0
  47. package/.output/public/_fonts/TTYbISAfwy-y4uVGS9AH32sK7b2xJsoCESo64ryf8LU-y87nRMqBGo42rUOW9tWZa06o4oTa0USJrAMMoKDamgs.woff2 +0 -0
  48. package/.output/public/_fonts/Y_5DOsLit49q2i2tbcNxnyUen9__GPCX8mwAi03q1aA-pBCjVKDT5tBT3BJckh9uzNkfUWeUIBPz9Y8T55vcj8E.woff2 +0 -0
  49. package/.output/public/_fonts/ZHaz3DhCHNWhsElqYfuM71rfBBDgjuU2sd34vaYJwQg-71NZaZSGjxzAGjCMnCc2zS5rS_EGA0xHKPGCggWuXik.woff +0 -0
  50. package/.output/public/_fonts/h9PwCjip_BNPVO50hT4v29USWFv6H3ZlYx_IestfqgY-sYfLVuZXl9E1aYbn1S0pAr4zfdQ_WT7iBZhrgQY6N-4.woff2 +0 -0
  51. package/.output/public/_fonts/l00UCz_-QvI_NO8AGcu7ooAcrFDlxYUdxCSCh6gBwd4-vPjTZ3ztgw27A2TnHeCycxPvUtXWEVpG33_97ra6su8.woff2 +0 -0
  52. package/.output/public/_fonts/nuenOq7ZFSZ65QudJO7uQ0sOjDqow2WjfXrQh4S9gEc-uF81rxcswER5srfhzyLfPoGlKNAIt2C_BvkXFOc19rw.woff2 +0 -0
  53. package/.output/public/_fonts/pWMvGwciZ-EfQsfR2ueelhC7Jnt5K-8Px8PjPK0mDII-eT9iD0iZ9WWhTJs6V5GxXr0iaUwx_WxgGGriOiGb81o.woff2 +0 -0
  54. package/.output/public/_fonts/y3mP_zJcojQwJn30TpF_XxDzgeM6Nbk7MaRg1Ne0YcI-lFx13nqMCMgk_S70gRmwEHXlE5BLp1B4W82RpFihpMs.woff2 +0 -0
  55. package/.output/public/_fonts/zr3WxpLd5PmlBr7e4PWGkhZv6XTg70Pi4sCbC-CEV0Q-v2yL98XOiD3FkbiYlYYeAeTSVSkgAckeOp55Q5kHJmU.woff2 +0 -0
  56. package/.output/public/_ignis-config.json +1789 -1
  57. package/.output/public/_nuxt/Bhpb4lc3.js +1 -0
  58. package/.output/public/_nuxt/{DXbccJ2T.js → BqsN2CZp.js} +1 -1
  59. package/.output/public/_nuxt/C9ePPGPX.js +94 -0
  60. package/.output/public/_nuxt/CQozUI2A.js +1 -0
  61. package/.output/public/_nuxt/DBJqMhGy.js +35 -0
  62. package/.output/public/_nuxt/{BiUZ9mZX.js → DvwlldUy.js} +1 -1
  63. package/.output/public/_nuxt/RbPLLy5S.js +1 -0
  64. package/.output/public/_nuxt/{DXBpKbsa.js → aetvq4w9.js} +40 -32
  65. package/.output/public/_nuxt/builds/latest.json +1 -1
  66. package/.output/public/_nuxt/builds/meta/cbc9377a-971e-4db1-b4b1-01807b82ee58.json +1 -0
  67. package/.output/public/_nuxt/entry.whtwWr_z.css +1 -0
  68. package/.output/public/_nuxt/error-404.Cq535Uij.css +1 -0
  69. package/.output/public/_nuxt/error-500.BHm_N15n.css +1 -0
  70. package/.output/public/_nuxt/{dJ-vStNn.js → jpnxxCHq.js} +1 -1
  71. package/.output/public/nuxt-spec.png +0 -0
  72. package/.output/server/chunks/_/error-500.mjs.map +1 -1
  73. package/.output/server/chunks/_/nitro.mjs +273 -154
  74. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  75. package/.output/server/chunks/build/client.manifest.mjs +64 -64
  76. package/.output/server/chunks/routes/renderer.mjs +3 -3
  77. package/.output/server/chunks/routes/renderer.mjs.map +1 -1
  78. package/.output/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +131 -96
  79. package/.output/server/node_modules/@vue/compiler-core/package.json +4 -4
  80. package/.output/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +4 -1
  81. package/.output/server/node_modules/@vue/compiler-dom/package.json +3 -3
  82. package/.output/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +10 -1
  83. package/.output/server/node_modules/@vue/compiler-ssr/package.json +3 -3
  84. package/.output/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +4 -3
  85. package/.output/server/node_modules/@vue/reactivity/package.json +2 -2
  86. package/.output/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +25 -27
  87. package/.output/server/node_modules/@vue/runtime-core/package.json +3 -3
  88. package/.output/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +40 -14
  89. package/.output/server/node_modules/@vue/runtime-dom/package.json +4 -4
  90. package/.output/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +1 -1
  91. package/.output/server/node_modules/@vue/server-renderer/package.json +4 -4
  92. package/.output/server/node_modules/@vue/shared/dist/shared.cjs.prod.js +1 -1
  93. package/.output/server/node_modules/@vue/shared/package.json +1 -1
  94. package/.output/server/node_modules/debug/package.json +1 -1
  95. package/.output/server/node_modules/vue/dist/vue.cjs.js +1 -1
  96. package/.output/server/node_modules/vue/dist/vue.cjs.prod.js +1 -1
  97. package/.output/server/node_modules/vue/package.json +6 -6
  98. package/.output/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +158 -53
  99. package/.output/server/node_modules/vue-bundle-renderer/package.json +16 -11
  100. package/.output/server/node_modules/vue-router/dist/devtools-BLCumUwL.mjs +1218 -0
  101. package/.output/server/node_modules/vue-router/dist/vue-router.mjs +1459 -3688
  102. package/.output/server/node_modules/vue-router/package.json +43 -38
  103. package/.output/server/node_modules/vue-router/vue-router.node.mjs +2 -0
  104. package/.output/server/package.json +13 -13
  105. package/README.md +4 -0
  106. package/app/app.vue +2 -2
  107. package/app/assets/css/ignis-open-props.css +4 -5
  108. package/app/components/CurrentTime.vue +8 -1
  109. package/app/components/ignis/{IgnisInfo.vue → IgnisContent.vue} +3 -3
  110. package/app/components/ignis/{IgnisConfig.vue → IgnisContentConfig.vue} +5 -1
  111. package/app/components/ignis/IgnisContentFeatures.vue +102 -0
  112. package/app/components/ignis/{IgnisWelcome.vue → IgnisContentWelcome.vue} +2 -2
  113. package/app/components/ignis/IgnisFooter.vue +11 -3
  114. package/app/pages/_ignis-config.vue +1 -1
  115. package/app/pages/_ignis-info.vue +1 -1
  116. package/app/pages/_ignis-welcome.vue +1 -1
  117. package/app/pages/index.vue +2 -2
  118. package/bin/cli.js +59 -0
  119. package/bin/set-app-vue.js +18 -0
  120. package/bin/set-css.js +3 -8
  121. package/bin/set-eslint.js +3 -8
  122. package/bin/setup.js +208 -45
  123. package/features.ts +17 -8
  124. package/nuxt.config.ts +9 -4
  125. package/package.json +15 -17
  126. package/public/_ignis-config.json +1789 -1
  127. package/test/config/css-multiple.txt +30 -24
  128. package/test/config/css-nuxt-ui.txt +34 -28
  129. package/test/config/css-open-props.txt +1812 -1805
  130. package/test/config/css-single.txt +28 -22
  131. package/test/config/css-tailwind.txt +55 -48
  132. package/test/config/custom-lang.txt +27 -21
  133. package/test/config/db-neon.txt +28 -22
  134. package/test/config/db-supabase.txt +31 -25
  135. package/test/config/default.txt +27 -21
  136. package/test/config/equipment-1-composable.txt +33 -27
  137. package/test/config/equipment-2-plugins.txt +34 -28
  138. package/test/config/equipment-all.txt +38 -32
  139. package/test/config/forms-formkit.txt +32 -26
  140. package/test/config/forms-vueform.txt +28 -22
  141. package/test/config/i18n.txt +36 -30
  142. package/test/config/no-default-css.txt +24 -18
  143. package/test/config/open-props.txt +1811 -1804
  144. package/test/config/seo-ssr-false.txt +35 -29
  145. package/test/config/ui-nuxt-ui.txt +33 -27
  146. package/test/config/ui-tailwind.txt +54 -47
  147. package/test/features.test.ts +33 -33
  148. package/.nuxt/i18n.options.mjs +0 -165
  149. package/.nuxt/nuxt-i18n-logger.mjs +0 -1
  150. package/.output/public/_nuxt/BA2WKEAc.js +0 -1
  151. package/.output/public/_nuxt/BE_a_Zhd.js +0 -1
  152. package/.output/public/_nuxt/Bnm5Nral.js +0 -1
  153. package/.output/public/_nuxt/BrY1radz.js +0 -35
  154. package/.output/public/_nuxt/CmzFGS1a.js +0 -90
  155. package/.output/public/_nuxt/builds/meta/9a624d26-216d-4e69-b3a7-54b68357876f.json +0 -1
  156. package/.output/public/_nuxt/entry.jMyW6Sg0.css +0 -1
  157. package/.output/public/_nuxt/error-404.BGUbR0Uk.css +0 -1
  158. package/.output/public/_nuxt/error-500.CQfkKpQ2.css +0 -1
  159. package/.output/server/node_modules/vue-router/dist/vue-router.node.mjs +0 -2
  160. package/app/components/ignis/IgnisFeatureList.vue +0 -111
  161. /package/app/components/ignis/{IgnisFeature.vue → IgnisContentFeaturesDetail.vue} +0 -0
package/bin/setup.js CHANGED
@@ -1,56 +1,119 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { createFileFromWebTemplate, promptUser, showMessage, updateConfigFile, updateJsonFile, updateTextFile } from 'elrh-cosca'
3
+ import {
4
+ createFileFromWebTemplate, deletePath, getPackageManager, hasJsonKey,
5
+ pathExists, promptUser, removeFromJsonFile, showMessage,
6
+ updateConfigFile, updateJsonFile, updateTextFile,
7
+ } from 'elrh-cosca'
4
8
 
5
9
  /**
6
10
  * CLI tool to setup Nuxt Ignis for a new project.
7
11
  *
8
- * Usage: `npx nuxt-ignis setup` in target folder.
12
+ * Usage: `npx nuxt-ignis setup [true|false]` in target folder.
9
13
  *
10
- * Has two modes:
11
- * - automatic - no prompts except the first one
12
- * - interactive - with prompts for each step
14
+ * The script will first ask whether to run in "auto" mode (no prompts, force = true) or "manual" mode (with prompts, force = false). If `autoRun = true` is passed, no prompt will be shown.
15
+ *
16
+ * The script will:
17
+ * 1) add `nuxt-ignis` into `package.json` dependencies, remove `nuxt`, `vue` and `vue-router` if present and adjust `pnpm` settings if `pnpm` is used
18
+ * 2) add `extends: ['nuxt-ignis']` to `nuxt.config.ts`
19
+ * 3) create/update `.npmrc` file (only if pnpm is used)
20
+ * 4) update `.gitignore` file
21
+ * 5) create default `vitest.config.ts` file and add test-related scripts into `package.json`
22
+ * 6) clear node_modules and lock file(s)
13
23
  */
14
- async function nuxtIgnisSetup() {
24
+ export async function nuxtIgnisSetup(autoRun = false) {
15
25
  showMessage('NUXT IGNIS SETUP')
16
26
  showMessage('This CLI tool will help you include Nuxt Ignis in your project.')
17
27
  showMessage('Refer to the documentation for more information.', 2)
18
28
 
19
- const auto = await promptUser('Do you want to set everything up automatically (no more prompts)?')
29
+ const isAutoRun = autoRun || await promptUser('Do you want to set everything up automatically (no more prompts)?')
20
30
  showMessage('')
21
31
 
32
+ const packageManager = getPackageManager()
33
+
22
34
  // 1.1 - add nuxt-ignis dependency
23
35
  try {
24
- await updateJsonFile('package.json', 'dependencies', { 'nuxt-ignis': '0.5.0-rc.1' },
25
- auto, 'This will add \'nuxt-ignis\' dependency to your \'package.json\'. Proceed?')
36
+ await updateJsonFile('package.json', 'dependencies', { 'nuxt-ignis': '0.5.0-rc.2' },
37
+ isAutoRun, 'This will add \'nuxt-ignis\' dependency to your \'package.json\'. Proceed?')
26
38
  } catch (error) {
27
39
  console.error('Error adding \'nuxt-ignis\' dependency:\n', error.message)
28
40
  }
29
41
 
30
- // 1.2 - adjust pnpm settings
31
- const pnpmSettings = auto || await promptUser('This will adjust pnpm settings in your \'package.json\'. Proceed?')
32
- if (pnpmSettings) {
33
- try {
34
- await updateJsonFile('package.json', 'pnpm', {
35
- onlyBuiltDependencies: [
36
- '@parcel/watcher',
37
- '@tailwindcss/oxide',
38
- 'better-sqlite3',
39
- 'esbuild',
40
- 'maplibre-gl',
41
- 'puppeteer',
42
- 'sharp',
43
- 'unrs-resolver',
44
- 'vue-demi',
45
- ],
46
- }, true)
47
- } catch (error) {
48
- console.error('Error adjusting pnpm settings:\n', error.message)
42
+ // 1.2 - remove now obsolete nuxt, vue and vue-router
43
+ const removeDeps = isAutoRun || await promptUser('As \'nuxt-ignis\' provides \'nuxt\', \'vue\' and \'vue-router\' dependencies out of the box, do you want to remove them from your \'package.json\' to avoid duplications and possible version clashes?')
44
+ if (removeDeps) {
45
+ if (hasJsonKey('package.json', 'dependencies.nuxt')) {
46
+ try {
47
+ await removeFromJsonFile('package.json', 'dependencies.nuxt', true)
48
+ } catch (error) {
49
+ console.error('Error removing \'nuxt\' dependency:\n', error.message)
50
+ }
49
51
  }
50
- try {
51
- await updateJsonFile('package.json', 'packageManager', 'pnpm@10.17.0', true)
52
- } catch (error) {
53
- console.error('Error setting packageManager:\n', error.message)
52
+ if (hasJsonKey('package.json', 'dependencies.vue')) {
53
+ try {
54
+ await removeFromJsonFile('package.json', 'dependencies.vue', true)
55
+ } catch (error) {
56
+ console.error('Error removing \'vue\' dependency:\n', error.message)
57
+ }
58
+ }
59
+ if (hasJsonKey('package.json', 'dependencies.vue-router')) {
60
+ try {
61
+ await removeFromJsonFile('package.json', 'dependencies.vue-router', true)
62
+ } catch (error) {
63
+ console.error('Error removing \'vue-router\' dependency:\n', error.message)
64
+ }
65
+ }
66
+ if (hasJsonKey('package.json', 'devDependencies.nuxt')) {
67
+ try {
68
+ await removeFromJsonFile('package.json', 'devDependencies.nuxt', true)
69
+ } catch (error) {
70
+ console.error('Error removing \'nuxt\' devDependency:\n', error.message)
71
+ }
72
+ }
73
+ if (hasJsonKey('package.json', 'devDependencies.vue')) {
74
+ try {
75
+ await removeFromJsonFile('package.json', 'devDependencies.vue', true)
76
+ } catch (error) {
77
+ console.error('Error removing \'vue\' devDependency:\n', error.message)
78
+ }
79
+ }
80
+ if (hasJsonKey('package.json', 'devDependencies.vue-router')) {
81
+ try {
82
+ await removeFromJsonFile('package.json', 'devDependencies.vue-router', true)
83
+ } catch (error) {
84
+ console.error('Error removing \'vue-router\' devDependency:\n', error.message)
85
+ }
86
+ }
87
+ }
88
+
89
+ // 1.3 - adjust pnpm settings
90
+ if (packageManager === 'pnpm') {
91
+ const pnpmSettings = isAutoRun || await promptUser('This will adjust pnpm settings in your \'package.json\'. Proceed?')
92
+ if (pnpmSettings) {
93
+ try {
94
+ // allow related build scripts
95
+ await updateJsonFile('package.json', 'pnpm', {
96
+ onlyBuiltDependencies: [
97
+ '@parcel/watcher',
98
+ '@tailwindcss/oxide',
99
+ 'better-sqlite3',
100
+ 'esbuild',
101
+ 'maplibre-gl',
102
+ 'puppeteer',
103
+ 'sharp',
104
+ 'unrs-resolver',
105
+ 'vue-demi',
106
+ ],
107
+ }, true)
108
+ } catch (error) {
109
+ console.error('Error adjusting pnpm settings:\n', error.message)
110
+ }
111
+ // set pnpm as package manager
112
+ try {
113
+ await updateJsonFile('package.json', 'packageManager', 'pnpm@10.18.0', true)
114
+ } catch (error) {
115
+ console.error('Error setting packageManager:\n', error.message)
116
+ }
54
117
  }
55
118
  }
56
119
 
@@ -60,17 +123,24 @@ async function nuxtIgnisSetup() {
60
123
  extends: [
61
124
  'nuxt-ignis',
62
125
  ],
63
- }, auto, 'This will add \'nuxt-ignis\' module to your \'nuxt.config.ts\'. Continue?')
126
+ }, isAutoRun, 'This will add \'nuxt-ignis\' module to your \'nuxt.config.ts\'. Continue?')
64
127
  } catch (error) {
65
128
  console.error('Error enabling \'nuxt-ignis\' module:\n', error.message)
66
129
  }
67
130
 
68
- // 3 - .npmrc file
69
- try {
70
- await createFileFromWebTemplate('https://raw.githubusercontent.com/AloisSeckar/nuxt-ignis/refs/heads/main/core/.npmrc',
71
- '.npmrc', auto, 'This will set \'.npmrc\' file for your project. Continue?')
72
- } catch (error) {
73
- console.error('Error setting .npmrc file:\n', error.message)
131
+ // 3 - .npmrc file (only if pnpm is used)
132
+ if (packageManager === 'pnpm') {
133
+ try {
134
+ if (pathExists('.npmrc')) {
135
+ await updateTextFile('.npmrc', ['shamefully-hoist=true'], isAutoRun,
136
+ 'This will adjust \'.npmrc\' file in your project. Continue?')
137
+ } else {
138
+ await createFileFromWebTemplate('https://raw.githubusercontent.com/AloisSeckar/nuxt-ignis/refs/tags/v0.4.0/core/.npmrc',
139
+ '.npmrc', isAutoRun, 'This will add \'.npmrc\' file for your project. Continue?')
140
+ }
141
+ } catch (error) {
142
+ console.error('Error setting \'.npmrc\':\n', error.message)
143
+ }
74
144
  }
75
145
 
76
146
  // 4 - .gitignore file
@@ -80,13 +150,106 @@ async function nuxtIgnisSetup() {
80
150
  '# Nuxt Ignis files',
81
151
  '# configuration overview created upon Nuxt Ignis start',
82
152
  '_ignis-config.json',
83
- ], auto, 'This will add Nuxt Ignis-related entries into your \'.gitignore\'. Continue?')
153
+ ], isAutoRun, 'This will add Nuxt Ignis-related entries into your \'.gitignore\'. Continue?')
84
154
  } catch (error) {
85
155
  console.error('Error updating .gitignore file:\n', error.message)
86
156
  }
87
- }
88
157
 
89
- nuxtIgnisSetup().catch((err) => {
90
- console.error(err)
91
- process.exit(1)
92
- })
158
+ // 5) nuxt-spec related setup
159
+ const setupNuxtSpec = isAutoRun || await promptUser('Nuxt Ignis comes with support for testing. Do you want to set up the default test settings now?')
160
+ if (setupNuxtSpec) {
161
+ // create vitest.config.ts
162
+ try {
163
+ await createFileFromWebTemplate('https://raw.githubusercontent.com/AloisSeckar/nuxt-spec/refs/tags/v0.1.12/config/vitest.config.ts.template',
164
+ 'vitest.config.ts', true, 'This will create a new \'vitest.config.ts\' file for your project. Continue?')
165
+ } catch (error) {
166
+ console.error('Error setting up \'vitest.config.ts\':\n', error.message)
167
+ }
168
+
169
+ // add scripts for running tests into package.json
170
+ try {
171
+ await updateJsonFile('package.json', 'scripts', {
172
+ 'test': 'vitest run',
173
+ 'test-u': 'vitest run -u',
174
+ 'test-i': 'vitest',
175
+ }, true, 'This will adjust the test-related commands in your \'package.json\'. Continue?')
176
+ } catch (error) {
177
+ console.error('Error adjusting scripts in \'package.json\':\n', error.message)
178
+ }
179
+
180
+ // create sample test files
181
+ const createSampleTests = isAutoRun || await promptUser('Do you want to create sample tests in \'/test\' folder?')
182
+ if (createSampleTests) {
183
+ try {
184
+ await createFileFromWebTemplate('https://raw.githubusercontent.com/AloisSeckar/nuxt-spec/refs/tags/v0.1.12/test/e2e/nuxt-e2e.test.ts',
185
+ 'test/e2e/nuxt-e2e.test.ts', true)
186
+ } catch (error) {
187
+ console.error('Error setting up \'nuxt-e2e.test.ts\':\n', error.message)
188
+ }
189
+ try {
190
+ await createFileFromWebTemplate('https://raw.githubusercontent.com/AloisSeckar/nuxt-spec/refs/tags/v0.1.12/test/nuxt/nuxt-unit.test.ts',
191
+ 'test/nuxt/nuxt-unit.test.ts', true)
192
+ } catch (error) {
193
+ console.error('Error setting up \'nuxt-unit.test.ts\':\n', error.message)
194
+ }
195
+ try {
196
+ await createFileFromWebTemplate('https://raw.githubusercontent.com/AloisSeckar/nuxt-spec/refs/tags/v0.1.12/test/unit/vitest.test.ts',
197
+ 'test/unit/vitest.test.ts', true)
198
+ } catch (error) {
199
+ console.error('Error setting up \'vitest.test.ts\':\n', error.message)
200
+ }
201
+ }
202
+ }
203
+
204
+ // 6) clear node_modules and lock file(s)
205
+ const prepareForReinstall = isAutoRun || await promptUser('Dependencies should be re-installed now. Do you want to remove node_modules and the lock file?')
206
+ if (prepareForReinstall) {
207
+ if (pathExists('node_modules')) {
208
+ try {
209
+ await deletePath('node_modules', true)
210
+ } catch (error) {
211
+ console.error('Error deleting \'node_modules\':\n', error.message)
212
+ }
213
+ }
214
+ if (pathExists('package-lock.json')) {
215
+ try {
216
+ await deletePath('package-lock.json', true)
217
+ } catch (error) {
218
+ console.error('Error deleting \'package-lock.json\':\n', error.message)
219
+ }
220
+ }
221
+ if (pathExists('pnpm-lock.yaml')) {
222
+ try {
223
+ await deletePath('pnpm-lock.yaml', true)
224
+ } catch (error) {
225
+ console.error('Error deleting \'pnpm-lock.yaml\':\n', error.message)
226
+ }
227
+ }
228
+ if (pathExists('yarn.lock')) {
229
+ try {
230
+ await deletePath('yarn.lock', true)
231
+ } catch (error) {
232
+ console.error('Error deleting \'yarn.lock\':\n', error.message)
233
+ }
234
+ }
235
+ if (pathExists('bun.lockb')) {
236
+ try {
237
+ await deletePath('bun.lockb', true)
238
+ } catch (error) {
239
+ console.error('Error deleting \'bun.lockb\':\n', error.message)
240
+ }
241
+ }
242
+ if (pathExists('deno.lock')) {
243
+ try {
244
+ await deletePath('deno.lock', true)
245
+ } catch (error) {
246
+ console.error('Error deleting \'deno.lock\':\n', error.message)
247
+ }
248
+ }
249
+ }
250
+
251
+ // 7) inform user
252
+ showMessage('')
253
+ showMessage('NUXT IGNIS SETUP COMPLETE', 2)
254
+ showMessage(`Proceed with \`${packageManager} install\` to get started.`)
255
+ }
package/features.ts CHANGED
@@ -10,7 +10,11 @@ import type { NuxtConfig } from 'nuxt/schema'
10
10
 
11
11
  const currentDir = dirname(fileURLToPath(import.meta.url))
12
12
 
13
- export function setFeatures(): NuxtConfig {
13
+ // core function to determine effective config for the current Nuxt app instance
14
+ // custom settings are based on passed in environment variables
15
+ // and will be defu-merged with provided defaults
16
+ // printOverview = true is used in tests to capture console output
17
+ export function setFeatures(printOverview: boolean = false): { nuxtConfig: NuxtConfig, overview: string } {
14
18
  // list of optional extra features
15
19
  const extras = [] as string[]
16
20
  // list of Nuxt-related settings
@@ -271,7 +275,7 @@ export function setFeatures(): NuxtConfig {
271
275
  log.debug(`Nuxt Content file ${file.id} processed with elrh-pslo`)
272
276
  },
273
277
  },
274
- }, nuxtConfig)
278
+ }, nuxtConfig) as NuxtConfig
275
279
  }
276
280
  }
277
281
 
@@ -351,10 +355,8 @@ export function setFeatures(): NuxtConfig {
351
355
  }
352
356
 
353
357
  // 6. verify results
354
- // TODO why this run twice? (SSR?)
355
-
356
- let overview = `Nuxt Ignis will start using following settings:\n`
357
- overview += `App title: ${appTitle}\n`
358
+ // return as string to be logged in 'schema:resolved' hook (to prevent multiple logs)
359
+ let overview = `App title: ${appTitle}\n`
358
360
  overview += `Modules: ${nuxtConfig.modules!.join(', ')}\n`
359
361
  if (extras.length > 0) {
360
362
  overview += `Extras: ${extras.join(', ')}\n`
@@ -362,7 +364,14 @@ export function setFeatures(): NuxtConfig {
362
364
  if (nuxt.length > 0) {
363
365
  overview += `Nuxt: ${nuxt.join(', ')}\n`
364
366
  }
365
- log.info(overview)
366
367
 
367
- return nuxtConfig
368
+ // used in tests to capture console output
369
+ if (printOverview) {
370
+ log.info('Nuxt Ignis will start using following settings:\n' + overview)
371
+ }
372
+
373
+ return {
374
+ nuxtConfig,
375
+ overview,
376
+ }
368
377
  }
package/nuxt.config.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { writeFileSync, existsSync, mkdirSync } from 'fs'
2
2
  import { dirname } from 'path'
3
3
  import { defu } from 'defu'
4
+ import { log } from './app/utils/consola'
4
5
  import { setFeatures } from './features'
5
6
  import type { NuxtConfig } from '@nuxt/schema'
6
7
 
@@ -121,21 +122,25 @@ const baseConfig: NuxtConfig = {
121
122
  },
122
123
  hooks: {
123
124
  'schema:resolved'() {
124
- const currentConfig = JSON.stringify(currentFeatures, null, 2)
125
- const outPath = './public/_ignis-config.json'
125
+ // write current config to file (for use in app)
126
+ const configObject = JSON.stringify(currentFeatures.nuxtConfig, null, 2)
126
127
 
128
+ const outPath = './public/_ignis-config.json'
127
129
  const outDir = dirname(outPath)
128
130
  if (!existsSync(outDir)) {
129
131
  mkdirSync(outDir, { recursive: true })
130
132
  }
131
133
 
132
- writeFileSync(outPath, currentConfig)
134
+ writeFileSync(outPath, configObject)
135
+
136
+ // display settings overview in console (just once)
137
+ log.info('\nNuxt Ignis will start using following settings:\n' + currentFeatures.overview)
133
138
  },
134
139
  },
135
140
  }
136
141
 
137
142
  // to avoid type inference issues
138
- const effectiveConfig = defu(currentFeatures, baseConfig) as NuxtConfig
143
+ const effectiveConfig = defu(currentFeatures.nuxtConfig, baseConfig) as NuxtConfig
139
144
 
140
145
  // https://nuxt.com/docs/getting-started/configuration#nuxt-configuration
141
146
  // using spread operator to avoid Proxy issues
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-ignis",
3
- "version": "0.5.0-rc.1",
3
+ "version": "0.5.0-rc.2",
4
4
  "description": "A ready-to-use setup for your next application in Nuxt",
5
5
  "keywords": [
6
6
  "nuxt",
@@ -11,7 +11,7 @@
11
11
  "nuxt-layer"
12
12
  ],
13
13
  "author": "Alois Seckar <alois.seckar@gmail.com>",
14
- "homepage": "https://github.com/AloisSeckar/nuxt-ignis",
14
+ "homepage": "https://nuxt-ignis.com/",
15
15
  "repository": {
16
16
  "type": "git",
17
17
  "url": "git+https://github.com/AloisSeckar/nuxt-ignis.git"
@@ -27,9 +27,7 @@
27
27
  "node": "^20.19.0 || >=22.12.0"
28
28
  },
29
29
  "bin": {
30
- "setup": "./bin/setup.js",
31
- "set-css": "./bin/set-css.js",
32
- "set-eslint": "./bin/set-eslint.js"
30
+ "nuxt-ignis": "./bin/cli.js"
33
31
  },
34
32
  "dependencies": {
35
33
  "@formkit/nuxt": "1.6.9",
@@ -38,38 +36,38 @@
38
36
  "@nuxt/eslint": "1.9.0",
39
37
  "@nuxt/fonts": "0.11.4",
40
38
  "@nuxt/image": "1.11.0",
41
- "@nuxt/scripts": "0.11.13",
42
- "@nuxt/ui": "3.3.4",
43
- "@nuxtjs/i18n": "10.1.0",
39
+ "@nuxt/scripts": "0.13.0",
40
+ "@nuxt/ui": "3.3.6",
41
+ "@nuxtjs/i18n": "10.1.1",
44
42
  "@nuxtjs/seo": "3.2.2",
45
43
  "@nuxtjs/supabase": "1.6.2",
46
44
  "@nuxtjs/tailwindcss": "6.14.0",
47
45
  "@pinia/nuxt": "0.11.2",
48
- "@tailwindcss/vite": "4.1.13",
49
- "@vueform/nuxt": "1.20.0",
46
+ "@tailwindcss/vite": "4.1.14",
47
+ "@vueform/nuxt": "1.21.0",
50
48
  "@vueuse/core": "13.9.0",
51
49
  "@vueuse/nuxt": "13.9.0",
52
50
  "better-sqlite3": "12.2.0",
53
51
  "consola": "3.4.2",
54
52
  "date-fns": "4.1.0",
55
53
  "defu": "6.1.4",
56
- "elrh-cosca": "0.2.8",
54
+ "elrh-cosca": "0.3.4",
57
55
  "elrh-pslo": "1.1.6",
58
56
  "magic-regexp": "0.10.0",
59
- "nuxt": "4.1.2",
57
+ "nuxt": "4.1.3",
60
58
  "nuxt-auth-utils": "0.5.25",
61
59
  "nuxt-charts": "0.2.4",
62
60
  "nuxt-neon": "0.7.0",
63
61
  "nuxt-security": "2.4.0",
64
- "nuxt-spec": "0.1.8",
62
+ "nuxt-spec": "0.1.12",
65
63
  "open-props": "1.7.16",
66
64
  "pinia": "3.0.3",
67
65
  "postcss-jit-props": "1.0.16",
68
- "typescript": "5.9.2",
66
+ "typescript": "5.9.3",
69
67
  "valibot": "1.1.0",
70
- "vue": "3.5.21",
71
- "vue-router": "4.5.1",
72
- "zod": "4.1.11"
68
+ "vue": "3.5.22",
69
+ "vue-router": "4.6.3",
70
+ "zod": "4.1.12"
73
71
  },
74
72
  "scripts": {
75
73
  "analyze": "nuxt analyze",