From 1614032d6253dc86e1871e81f2e7c876311f6aa8 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Fri, 6 Dec 2024 09:00:19 +0100 Subject: [PATCH] build: align vue templates with standard vue templates --- templates/vue-example/.editorconfig | 6 +++ templates/vue-example/.eslintrc.cjs | 18 ------- templates/vue-example/.prettierrc.json | 4 +- templates/vue-example/eslint.config.js | 25 +++++++++ templates/vue-example/juno.dev.config.ts | 14 ++--- templates/vue-example/package.json | 51 +++++++++++-------- templates/vue-example/postcss.config.js | 4 +- templates/vue-example/src/App.vue | 6 +-- .../vue-example/src/components/Backdrop.vue | 2 +- .../vue-example/src/components/Button.vue | 2 +- .../vue-example/src/components/Delete.vue | 6 +-- .../vue-example/src/components/Modal.vue | 8 +-- .../vue-example/src/components/Table.vue | 2 +- templates/vue-example/tailwind.config.ts | 20 ++++---- templates/vue-example/tsconfig.app.json | 1 - templates/vue-example/tsconfig.json | 3 ++ templates/vue-example/tsconfig.node.json | 2 +- templates/vue-example/tsconfig.vitest.json | 11 ++++ templates/vue-example/vite.config.ts | 12 +++-- templates/vue-example/vitest.config.ts | 14 +++++ templates/vue-starter/.editorconfig | 6 +++ templates/vue-starter/.prettierrc.json | 4 +- templates/vue-starter/README.md | 8 +-- templates/vue-starter/eslint.config.js | 25 +++++++++ templates/vue-starter/juno.dev.config.ts | 14 ++--- templates/vue-starter/package.json | 49 ++++++++++-------- templates/vue-starter/postcss.config.js | 4 +- templates/vue-starter/tailwind.config.ts | 25 +++++++-- templates/vue-starter/tsconfig.app.json | 1 - templates/vue-starter/tsconfig.json | 3 ++ templates/vue-starter/tsconfig.node.json | 2 +- templates/vue-starter/tsconfig.vitest.json | 11 ++++ templates/vue-starter/vite.config.ts | 12 +++-- templates/vue-starter/vitest.config.ts | 14 +++++ 34 files changed, 258 insertions(+), 131 deletions(-) create mode 100644 templates/vue-example/.editorconfig delete mode 100644 templates/vue-example/.eslintrc.cjs create mode 100644 templates/vue-example/eslint.config.js create mode 100644 templates/vue-example/tsconfig.vitest.json create mode 100644 templates/vue-example/vitest.config.ts create mode 100644 templates/vue-starter/.editorconfig create mode 100644 templates/vue-starter/eslint.config.js create mode 100644 templates/vue-starter/tsconfig.vitest.json create mode 100644 templates/vue-starter/vitest.config.ts diff --git a/templates/vue-example/.editorconfig b/templates/vue-example/.editorconfig new file mode 100644 index 0000000..ecea360 --- /dev/null +++ b/templates/vue-example/.editorconfig @@ -0,0 +1,6 @@ +[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}] +charset = utf-8 +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/templates/vue-example/.eslintrc.cjs b/templates/vue-example/.eslintrc.cjs deleted file mode 100644 index d0bf750..0000000 --- a/templates/vue-example/.eslintrc.cjs +++ /dev/null @@ -1,18 +0,0 @@ -/* eslint-env node */ -require('@rushstack/eslint-patch/modern-module-resolution') - -module.exports = { - root: true, - extends: [ - 'plugin:vue/vue3-essential', - 'eslint:recommended', - '@vue/eslint-config-typescript', - '@vue/eslint-config-prettier/skip-formatting' - ], - parserOptions: { - ecmaVersion: 'latest' - }, - rules: { - 'vue/multi-word-component-names': 'off' - } -} diff --git a/templates/vue-example/.prettierrc.json b/templates/vue-example/.prettierrc.json index ecdf3e0..29a2402 100644 --- a/templates/vue-example/.prettierrc.json +++ b/templates/vue-example/.prettierrc.json @@ -1,8 +1,6 @@ { "$schema": "https://json.schemastore.org/prettierrc", "semi": false, - "tabWidth": 2, "singleQuote": true, - "printWidth": 100, - "trailingComma": "none" + "printWidth": 100 } diff --git a/templates/vue-example/eslint.config.js b/templates/vue-example/eslint.config.js new file mode 100644 index 0000000..42e812d --- /dev/null +++ b/templates/vue-example/eslint.config.js @@ -0,0 +1,25 @@ +import pluginVue from 'eslint-plugin-vue' +import vueTsEslintConfig from '@vue/eslint-config-typescript' +import pluginVitest from '@vitest/eslint-plugin' +import skipFormatting from '@vue/eslint-config-prettier/skip-formatting' + +export default [ + { + name: 'app/files-to-lint', + files: ['**/*.{ts,mts,tsx,vue}'], + }, + + { + name: 'app/files-to-ignore', + ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], + }, + + ...pluginVue.configs['flat/essential'], + ...vueTsEslintConfig(), + + { + ...pluginVitest.configs.recommended, + files: ['src/**/__tests__/*'], + }, + skipFormatting, +] diff --git a/templates/vue-example/juno.dev.config.ts b/templates/vue-example/juno.dev.config.ts index 8a89c0a..b2f2ccd 100644 --- a/templates/vue-example/juno.dev.config.ts +++ b/templates/vue-example/juno.dev.config.ts @@ -9,8 +9,8 @@ export default defineDevConfig(() => ({ read: 'managed' as const, write: 'managed' as const, memory: 'stable' as const, - mutablePermissions: true - } + mutablePermissions: true, + }, ], storage: [ { @@ -18,9 +18,9 @@ export default defineDevConfig(() => ({ read: 'managed' as const, write: 'managed' as const, memory: 'stable' as const, - mutablePermissions: true - } - ] - } - } + mutablePermissions: true, + }, + ], + }, + }, })) diff --git a/templates/vue-example/package.json b/templates/vue-example/package.json index 09cc5b6..13e0c7f 100644 --- a/templates/vue-example/package.json +++ b/templates/vue-example/package.json @@ -7,39 +7,46 @@ "dev": "vite", "build": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", + "test:unit": "vitest", "build-only": "vite build", - "type-check": "vue-tsc --build --force", - "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", - "format": "prettier --write .", + "type-check": "vue-tsc --build", + "lint": "eslint . --fix", + "format": "prettier --write src/", "postinstall:copy-auth": "node -e \"require('fs').cpSync('node_modules/@junobuild/core/dist/workers/', './public/workers', {recursive: true});\"", "postinstall": "npm run postinstall:copy-auth" }, "dependencies": { "@junobuild/core": "^0.0.63", - "nanoid": "^5.0.7", - "pinia": "^2.2.2", - "vue": "^3.4.38", - "vue-router": "^4.4.3" + "nanoid": "^5.0.9", + "pinia": "^2.2.6", + "vue": "^3.5.13", + "vue-router": "^4.4.5" }, "devDependencies": { "@junobuild/config": "^0.0.17", "@junobuild/vite-plugin": "^0.0.19", - "@rushstack/eslint-patch": "^1.10.4", - "@tsconfig/node20": "^20.1.4", - "@types/node": "^20.12.5", - "@vitejs/plugin-vue": "^5.1.3", - "@vue/eslint-config-prettier": "^9.0.0", - "@vue/eslint-config-typescript": "^13.0.0", - "@vue/tsconfig": "^0.5.1", + "@tsconfig/node22": "^22.0.0", + "@types/jsdom": "^21.1.7", + "@types/node": "^22.9.3", + "@vitejs/plugin-vue": "^5.2.1", + "@vitejs/plugin-vue-jsx": "^4.1.1", + "@vitest/eslint-plugin": "1.1.10", + "@vue/eslint-config-prettier": "^10.1.0", + "@vue/eslint-config-typescript": "^14.1.3", + "@vue/test-utils": "^2.4.6", + "@vue/tsconfig": "^0.7.0", "autoprefixer": "^10.4.20", - "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.27.0", - "npm-run-all2": "^6.2.2", - "postcss": "^8.4.41", + "eslint": "^9.14.0", + "eslint-plugin-vue": "^9.30.0", + "jsdom": "^25.0.1", + "npm-run-all2": "^7.0.1", + "postcss": "^8.4.49", "prettier": "^3.3.3", - "tailwindcss": "^3.4.10", - "typescript": "~5.4.0", - "vite": "^5.4.2", - "vue-tsc": "^2.1.2" + "tailwindcss": "^3.4.16", + "typescript": "~5.6.3", + "vite": "^6.0.1", + "vite-plugin-vue-devtools": "^7.6.5", + "vitest": "^2.1.5", + "vue-tsc": "^2.1.10" } } diff --git a/templates/vue-example/postcss.config.js b/templates/vue-example/postcss.config.js index 2b75bd8..2e7af2b 100644 --- a/templates/vue-example/postcss.config.js +++ b/templates/vue-example/postcss.config.js @@ -1,6 +1,6 @@ export default { plugins: { tailwindcss: {}, - autoprefixer: {} - } + autoprefixer: {}, + }, } diff --git a/templates/vue-example/src/App.vue b/templates/vue-example/src/App.vue index 0df6be6..f57836f 100644 --- a/templates/vue-example/src/App.vue +++ b/templates/vue-example/src/App.vue @@ -11,9 +11,9 @@ onMounted( async () => await initSatellite({ workers: { - auth: true - } - }) + auth: true, + }, + }), ) diff --git a/templates/vue-example/src/components/Backdrop.vue b/templates/vue-example/src/components/Backdrop.vue index ed2c0e7..a1d66fe 100644 --- a/templates/vue-example/src/components/Backdrop.vue +++ b/templates/vue-example/src/components/Backdrop.vue @@ -8,7 +8,7 @@ defineProps<{
diff --git a/templates/vue-example/src/components/Button.vue b/templates/vue-example/src/components/Button.vue index 63f0494..8558ed3 100644 --- a/templates/vue-example/src/components/Button.vue +++ b/templates/vue-example/src/components/Button.vue @@ -11,7 +11,7 @@ defineProps<{ :class="{ 'opacity-25': disabled === true, 'hover:bg-lavender-blue-600 dark:hover:bg-lavender-blue-300 dark:hover:text-black active:bg-lavender-blue-400 dark:active:bg-lavender-blue-500 active:shadow-none active:translate-x-[5px] active:translate-y-[5px]': - disabled !== true + disabled !== true, }" > diff --git a/templates/vue-example/src/components/Delete.vue b/templates/vue-example/src/components/Delete.vue index 02a1c64..b7351b5 100644 --- a/templates/vue-example/src/components/Delete.vue +++ b/templates/vue-example/src/components/Delete.vue @@ -16,7 +16,7 @@ const delItem = async () => { try { const { - data: { url } + data: { url }, } = doc if (url !== undefined) { @@ -24,13 +24,13 @@ const delItem = async () => { await deleteAsset({ collection: 'images', - fullPath + fullPath, }) } await deleteDoc({ collection: 'notes', - doc + doc, }) await reload() diff --git a/templates/vue-example/src/components/Modal.vue b/templates/vue-example/src/components/Modal.vue index 395c619..9e87fc4 100644 --- a/templates/vue-example/src/components/Modal.vue +++ b/templates/vue-example/src/components/Modal.vue @@ -44,7 +44,7 @@ const add = async () => { const { downloadUrl } = await uploadFile({ collection: 'images', data: file.value, - filename + filename, }) url = downloadUrl @@ -58,9 +58,9 @@ const add = async () => { key, data: { text: inputText.value, - ...(url !== undefined && { url }) - } - } + ...(url !== undefined && { url }), + }, + }, }) setShowModal(false) diff --git a/templates/vue-example/src/components/Table.vue b/templates/vue-example/src/components/Table.vue index 2d28c41..87b09c6 100644 --- a/templates/vue-example/src/components/Table.vue +++ b/templates/vue-example/src/components/Table.vue @@ -9,7 +9,7 @@ const items = ref[]>([]) const list = async () => { const { items: data } = await listDocs({ collection: 'notes', - filter: {} + filter: {}, }) items.value = data diff --git a/templates/vue-example/tailwind.config.ts b/templates/vue-example/tailwind.config.ts index 14a79d4..b248c8f 100644 --- a/templates/vue-example/tailwind.config.ts +++ b/templates/vue-example/tailwind.config.ts @@ -5,22 +5,22 @@ const config: Config = { content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'], theme: { fontFamily: { - sans: ['JetBrains Mono', 'sans-serif', ...fontFamily.sans] + sans: ['JetBrains Mono', 'sans-serif', ...fontFamily.sans], }, extend: { screens: { - tall: { raw: '(min-height: 800px)' } + tall: { raw: '(min-height: 800px)' }, }, animation: { - fade: 'fadeIn .25s ease-in-out' + fade: 'fadeIn .25s ease-in-out', }, keyframes: { fadeIn: { from: { opacity: '0' }, - to: { opacity: '1' } - } - } + to: { opacity: '1' }, + }, + }, }, colors: { inherit: 'inherit', @@ -38,9 +38,9 @@ const config: Config = { 600: '#606dcc', 700: '#485299', 800: '#303666', - 900: '#181b33' - } - } - } + 900: '#181b33', + }, + }, + }, } export default config diff --git a/templates/vue-example/tsconfig.app.json b/templates/vue-example/tsconfig.app.json index e14c754..93f952f 100644 --- a/templates/vue-example/tsconfig.app.json +++ b/templates/vue-example/tsconfig.app.json @@ -6,7 +6,6 @@ "composite": true, "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", - "baseUrl": ".", "paths": { "@/*": ["./src/*"] } diff --git a/templates/vue-example/tsconfig.json b/templates/vue-example/tsconfig.json index 66b5e57..100cf6a 100644 --- a/templates/vue-example/tsconfig.json +++ b/templates/vue-example/tsconfig.json @@ -6,6 +6,9 @@ }, { "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.vitest.json" } ] } diff --git a/templates/vue-example/tsconfig.node.json b/templates/vue-example/tsconfig.node.json index f094063..5a0c6a5 100644 --- a/templates/vue-example/tsconfig.node.json +++ b/templates/vue-example/tsconfig.node.json @@ -1,5 +1,5 @@ { - "extends": "@tsconfig/node20/tsconfig.json", + "extends": "@tsconfig/node22/tsconfig.json", "include": [ "vite.config.*", "vitest.config.*", diff --git a/templates/vue-example/tsconfig.vitest.json b/templates/vue-example/tsconfig.vitest.json new file mode 100644 index 0000000..571995d --- /dev/null +++ b/templates/vue-example/tsconfig.vitest.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.app.json", + "exclude": [], + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo", + + "lib": [], + "types": ["node", "jsdom"] + } +} diff --git a/templates/vue-example/vite.config.ts b/templates/vue-example/vite.config.ts index 9a72cf0..bfa1357 100644 --- a/templates/vue-example/vite.config.ts +++ b/templates/vue-example/vite.config.ts @@ -1,14 +1,16 @@ import { fileURLToPath, URL } from 'node:url' + import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' import juno from '@junobuild/vite-plugin' -// https://vitejs.dev/config/ +// https://vite.dev/config/ export default defineConfig({ - plugins: [vue(), juno({ container: true })], + plugins: [vue(), vueJsx(), juno({ container: true })], resolve: { alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) - } - } + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, + }, }) diff --git a/templates/vue-example/vitest.config.ts b/templates/vue-example/vitest.config.ts new file mode 100644 index 0000000..c328717 --- /dev/null +++ b/templates/vue-example/vitest.config.ts @@ -0,0 +1,14 @@ +import { fileURLToPath } from 'node:url' +import { mergeConfig, defineConfig, configDefaults } from 'vitest/config' +import viteConfig from './vite.config' + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + environment: 'jsdom', + exclude: [...configDefaults.exclude, 'e2e/**'], + root: fileURLToPath(new URL('./', import.meta.url)), + }, + }), +) diff --git a/templates/vue-starter/.editorconfig b/templates/vue-starter/.editorconfig new file mode 100644 index 0000000..ecea360 --- /dev/null +++ b/templates/vue-starter/.editorconfig @@ -0,0 +1,6 @@ +[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}] +charset = utf-8 +indent_size = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/templates/vue-starter/.prettierrc.json b/templates/vue-starter/.prettierrc.json index ecdf3e0..29a2402 100644 --- a/templates/vue-starter/.prettierrc.json +++ b/templates/vue-starter/.prettierrc.json @@ -1,8 +1,6 @@ { "$schema": "https://json.schemastore.org/prettierrc", "semi": false, - "tabWidth": 2, "singleQuote": true, - "printWidth": 100, - "trailingComma": "none" + "printWidth": 100 } diff --git a/templates/vue-starter/README.md b/templates/vue-starter/README.md index 42e1a95..f26604e 100644 --- a/templates/vue-starter/README.md +++ b/templates/vue-starter/README.md @@ -1,14 +1,14 @@ -# Juno: Vue Starter Kit +# Juno: Vue Example ```sh -npm create juno@latest -- --template vue-starter +npm create juno@latest -- --template vue-example ``` > 🧑‍🚀 **Seasoned dev?** Delete this file. Have fun! -![A screenshot of the starter kit](https://raw.githubusercontent.com/junobuild/create-juno/main/screenshots/screenshot-starter.png) +![A screenshot of the example](https://raw.githubusercontent.com/junobuild/create-juno/main/screenshots/screenshot-example.png) -A starter kit developed for [Juno](https://juno.build) using [Vue](https://vuejs.org/). +An example developed for [Juno](https://juno.build) using [Vue](https://vuejs.org/). ## ✨ Links & Resources diff --git a/templates/vue-starter/eslint.config.js b/templates/vue-starter/eslint.config.js new file mode 100644 index 0000000..42e812d --- /dev/null +++ b/templates/vue-starter/eslint.config.js @@ -0,0 +1,25 @@ +import pluginVue from 'eslint-plugin-vue' +import vueTsEslintConfig from '@vue/eslint-config-typescript' +import pluginVitest from '@vitest/eslint-plugin' +import skipFormatting from '@vue/eslint-config-prettier/skip-formatting' + +export default [ + { + name: 'app/files-to-lint', + files: ['**/*.{ts,mts,tsx,vue}'], + }, + + { + name: 'app/files-to-ignore', + ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'], + }, + + ...pluginVue.configs['flat/essential'], + ...vueTsEslintConfig(), + + { + ...pluginVitest.configs.recommended, + files: ['src/**/__tests__/*'], + }, + skipFormatting, +] diff --git a/templates/vue-starter/juno.dev.config.ts b/templates/vue-starter/juno.dev.config.ts index 8a89c0a..b2f2ccd 100644 --- a/templates/vue-starter/juno.dev.config.ts +++ b/templates/vue-starter/juno.dev.config.ts @@ -9,8 +9,8 @@ export default defineDevConfig(() => ({ read: 'managed' as const, write: 'managed' as const, memory: 'stable' as const, - mutablePermissions: true - } + mutablePermissions: true, + }, ], storage: [ { @@ -18,9 +18,9 @@ export default defineDevConfig(() => ({ read: 'managed' as const, write: 'managed' as const, memory: 'stable' as const, - mutablePermissions: true - } - ] - } - } + mutablePermissions: true, + }, + ], + }, + }, })) diff --git a/templates/vue-starter/package.json b/templates/vue-starter/package.json index fd828c4..178d958 100644 --- a/templates/vue-starter/package.json +++ b/templates/vue-starter/package.json @@ -7,38 +7,45 @@ "dev": "vite", "build": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", + "test:unit": "vitest", "build-only": "vite build", - "type-check": "vue-tsc --build --force", - "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", - "format": "prettier --write .", + "type-check": "vue-tsc --build", + "lint": "eslint . --fix", + "format": "prettier --write src/", "postinstall:copy-auth": "node -e \"require('fs').cpSync('node_modules/@junobuild/core/dist/workers/', './public/workers', {recursive: true});\"", "postinstall": "npm run postinstall:copy-auth" }, "dependencies": { "@junobuild/core": "^0.0.63", - "pinia": "^2.2.2", - "vue": "^3.4.38", - "vue-router": "^4.4.3" + "pinia": "^2.2.6", + "vue": "^3.5.13", + "vue-router": "^4.4.5" }, "devDependencies": { "@junobuild/config": "^0.0.17", "@junobuild/vite-plugin": "^0.0.19", - "@rushstack/eslint-patch": "^1.10.4", - "@tsconfig/node20": "^20.1.4", - "@types/node": "^20.12.5", - "@vitejs/plugin-vue": "^5.1.3", - "@vue/eslint-config-prettier": "^9.0.0", - "@vue/eslint-config-typescript": "^13.0.0", - "@vue/tsconfig": "^0.5.1", + "@tsconfig/node22": "^22.0.0", + "@types/jsdom": "^21.1.7", + "@types/node": "^22.9.3", + "@vitejs/plugin-vue": "^5.2.1", + "@vitejs/plugin-vue-jsx": "^4.1.1", + "@vitest/eslint-plugin": "1.1.10", + "@vue/eslint-config-prettier": "^10.1.0", + "@vue/eslint-config-typescript": "^14.1.3", + "@vue/test-utils": "^2.4.6", + "@vue/tsconfig": "^0.7.0", "autoprefixer": "^10.4.20", - "eslint": "^8.57.0", - "eslint-plugin-vue": "^9.27.0", - "npm-run-all2": "^6.2.2", - "postcss": "^8.4.41", + "eslint": "^9.14.0", + "eslint-plugin-vue": "^9.30.0", + "jsdom": "^25.0.1", + "npm-run-all2": "^7.0.1", + "postcss": "^8.4.49", "prettier": "^3.3.3", - "tailwindcss": "^3.4.10", - "typescript": "~5.5.4", - "vite": "^5.4.2", - "vue-tsc": "^2.1.2" + "tailwindcss": "^3.4.16", + "typescript": "~5.6.3", + "vite": "^6.0.1", + "vite-plugin-vue-devtools": "^7.6.5", + "vitest": "^2.1.5", + "vue-tsc": "^2.1.10" } } diff --git a/templates/vue-starter/postcss.config.js b/templates/vue-starter/postcss.config.js index 2b75bd8..2e7af2b 100644 --- a/templates/vue-starter/postcss.config.js +++ b/templates/vue-starter/postcss.config.js @@ -1,6 +1,6 @@ export default { plugins: { tailwindcss: {}, - autoprefixer: {} - } + autoprefixer: {}, + }, } diff --git a/templates/vue-starter/tailwind.config.ts b/templates/vue-starter/tailwind.config.ts index 851f5f7..b248c8f 100644 --- a/templates/vue-starter/tailwind.config.ts +++ b/templates/vue-starter/tailwind.config.ts @@ -5,7 +5,22 @@ const config: Config = { content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'], theme: { fontFamily: { - sans: ['JetBrains Mono', 'sans-serif', ...fontFamily.sans] + sans: ['JetBrains Mono', 'sans-serif', ...fontFamily.sans], + }, + extend: { + screens: { + tall: { raw: '(min-height: 800px)' }, + }, + animation: { + fade: 'fadeIn .25s ease-in-out', + }, + + keyframes: { + fadeIn: { + from: { opacity: '0' }, + to: { opacity: '1' }, + }, + }, }, colors: { inherit: 'inherit', @@ -23,9 +38,9 @@ const config: Config = { 600: '#606dcc', 700: '#485299', 800: '#303666', - 900: '#181b33' - } - } - } + 900: '#181b33', + }, + }, + }, } export default config diff --git a/templates/vue-starter/tsconfig.app.json b/templates/vue-starter/tsconfig.app.json index e14c754..93f952f 100644 --- a/templates/vue-starter/tsconfig.app.json +++ b/templates/vue-starter/tsconfig.app.json @@ -6,7 +6,6 @@ "composite": true, "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", - "baseUrl": ".", "paths": { "@/*": ["./src/*"] } diff --git a/templates/vue-starter/tsconfig.json b/templates/vue-starter/tsconfig.json index 66b5e57..100cf6a 100644 --- a/templates/vue-starter/tsconfig.json +++ b/templates/vue-starter/tsconfig.json @@ -6,6 +6,9 @@ }, { "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.vitest.json" } ] } diff --git a/templates/vue-starter/tsconfig.node.json b/templates/vue-starter/tsconfig.node.json index f094063..5a0c6a5 100644 --- a/templates/vue-starter/tsconfig.node.json +++ b/templates/vue-starter/tsconfig.node.json @@ -1,5 +1,5 @@ { - "extends": "@tsconfig/node20/tsconfig.json", + "extends": "@tsconfig/node22/tsconfig.json", "include": [ "vite.config.*", "vitest.config.*", diff --git a/templates/vue-starter/tsconfig.vitest.json b/templates/vue-starter/tsconfig.vitest.json new file mode 100644 index 0000000..571995d --- /dev/null +++ b/templates/vue-starter/tsconfig.vitest.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.app.json", + "exclude": [], + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo", + + "lib": [], + "types": ["node", "jsdom"] + } +} diff --git a/templates/vue-starter/vite.config.ts b/templates/vue-starter/vite.config.ts index 9a72cf0..bfa1357 100644 --- a/templates/vue-starter/vite.config.ts +++ b/templates/vue-starter/vite.config.ts @@ -1,14 +1,16 @@ import { fileURLToPath, URL } from 'node:url' + import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' import juno from '@junobuild/vite-plugin' -// https://vitejs.dev/config/ +// https://vite.dev/config/ export default defineConfig({ - plugins: [vue(), juno({ container: true })], + plugins: [vue(), vueJsx(), juno({ container: true })], resolve: { alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) - } - } + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, + }, }) diff --git a/templates/vue-starter/vitest.config.ts b/templates/vue-starter/vitest.config.ts new file mode 100644 index 0000000..c328717 --- /dev/null +++ b/templates/vue-starter/vitest.config.ts @@ -0,0 +1,14 @@ +import { fileURLToPath } from 'node:url' +import { mergeConfig, defineConfig, configDefaults } from 'vitest/config' +import viteConfig from './vite.config' + +export default mergeConfig( + viteConfig, + defineConfig({ + test: { + environment: 'jsdom', + exclude: [...configDefaults.exclude, 'e2e/**'], + root: fileURLToPath(new URL('./', import.meta.url)), + }, + }), +)