Skip to content

Commit 1614032

Browse files
build: align vue templates with standard vue templates
1 parent c80925d commit 1614032

34 files changed

+258
-131
lines changed

templates/vue-example/.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
2+
charset = utf-8
3+
indent_size = 2
4+
indent_style = space
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true

templates/vue-example/.eslintrc.cjs

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"$schema": "https://json.schemastore.org/prettierrc",
33
"semi": false,
4-
"tabWidth": 2,
54
"singleQuote": true,
6-
"printWidth": 100,
7-
"trailingComma": "none"
5+
"printWidth": 100
86
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import pluginVue from 'eslint-plugin-vue'
2+
import vueTsEslintConfig from '@vue/eslint-config-typescript'
3+
import pluginVitest from '@vitest/eslint-plugin'
4+
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
5+
6+
export default [
7+
{
8+
name: 'app/files-to-lint',
9+
files: ['**/*.{ts,mts,tsx,vue}'],
10+
},
11+
12+
{
13+
name: 'app/files-to-ignore',
14+
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
15+
},
16+
17+
...pluginVue.configs['flat/essential'],
18+
...vueTsEslintConfig(),
19+
20+
{
21+
...pluginVitest.configs.recommended,
22+
files: ['src/**/__tests__/*'],
23+
},
24+
skipFormatting,
25+
]

templates/vue-example/juno.dev.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ export default defineDevConfig(() => ({
99
read: 'managed' as const,
1010
write: 'managed' as const,
1111
memory: 'stable' as const,
12-
mutablePermissions: true
13-
}
12+
mutablePermissions: true,
13+
},
1414
],
1515
storage: [
1616
{
1717
collection: 'images',
1818
read: 'managed' as const,
1919
write: 'managed' as const,
2020
memory: 'stable' as const,
21-
mutablePermissions: true
22-
}
23-
]
24-
}
25-
}
21+
mutablePermissions: true,
22+
},
23+
],
24+
},
25+
},
2626
}))

templates/vue-example/package.json

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,46 @@
77
"dev": "vite",
88
"build": "run-p type-check \"build-only {@}\" --",
99
"preview": "vite preview",
10+
"test:unit": "vitest",
1011
"build-only": "vite build",
11-
"type-check": "vue-tsc --build --force",
12-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
13-
"format": "prettier --write .",
12+
"type-check": "vue-tsc --build",
13+
"lint": "eslint . --fix",
14+
"format": "prettier --write src/",
1415
"postinstall:copy-auth": "node -e \"require('fs').cpSync('node_modules/@junobuild/core/dist/workers/', './public/workers', {recursive: true});\"",
1516
"postinstall": "npm run postinstall:copy-auth"
1617
},
1718
"dependencies": {
1819
"@junobuild/core": "^0.0.63",
19-
"nanoid": "^5.0.7",
20-
"pinia": "^2.2.2",
21-
"vue": "^3.4.38",
22-
"vue-router": "^4.4.3"
20+
"nanoid": "^5.0.9",
21+
"pinia": "^2.2.6",
22+
"vue": "^3.5.13",
23+
"vue-router": "^4.4.5"
2324
},
2425
"devDependencies": {
2526
"@junobuild/config": "^0.0.17",
2627
"@junobuild/vite-plugin": "^0.0.19",
27-
"@rushstack/eslint-patch": "^1.10.4",
28-
"@tsconfig/node20": "^20.1.4",
29-
"@types/node": "^20.12.5",
30-
"@vitejs/plugin-vue": "^5.1.3",
31-
"@vue/eslint-config-prettier": "^9.0.0",
32-
"@vue/eslint-config-typescript": "^13.0.0",
33-
"@vue/tsconfig": "^0.5.1",
28+
"@tsconfig/node22": "^22.0.0",
29+
"@types/jsdom": "^21.1.7",
30+
"@types/node": "^22.9.3",
31+
"@vitejs/plugin-vue": "^5.2.1",
32+
"@vitejs/plugin-vue-jsx": "^4.1.1",
33+
"@vitest/eslint-plugin": "1.1.10",
34+
"@vue/eslint-config-prettier": "^10.1.0",
35+
"@vue/eslint-config-typescript": "^14.1.3",
36+
"@vue/test-utils": "^2.4.6",
37+
"@vue/tsconfig": "^0.7.0",
3438
"autoprefixer": "^10.4.20",
35-
"eslint": "^8.57.0",
36-
"eslint-plugin-vue": "^9.27.0",
37-
"npm-run-all2": "^6.2.2",
38-
"postcss": "^8.4.41",
39+
"eslint": "^9.14.0",
40+
"eslint-plugin-vue": "^9.30.0",
41+
"jsdom": "^25.0.1",
42+
"npm-run-all2": "^7.0.1",
43+
"postcss": "^8.4.49",
3944
"prettier": "^3.3.3",
40-
"tailwindcss": "^3.4.10",
41-
"typescript": "~5.4.0",
42-
"vite": "^5.4.2",
43-
"vue-tsc": "^2.1.2"
45+
"tailwindcss": "^3.4.16",
46+
"typescript": "~5.6.3",
47+
"vite": "^6.0.1",
48+
"vite-plugin-vue-devtools": "^7.6.5",
49+
"vitest": "^2.1.5",
50+
"vue-tsc": "^2.1.10"
4451
}
4552
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
22
plugins: {
33
tailwindcss: {},
4-
autoprefixer: {}
5-
}
4+
autoprefixer: {},
5+
},
66
}

templates/vue-example/src/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ onMounted(
1111
async () =>
1212
await initSatellite({
1313
workers: {
14-
auth: true
15-
}
16-
})
14+
auth: true,
15+
},
16+
}),
1717
)
1818
</script>
1919

templates/vue-example/src/components/Backdrop.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defineProps<{
88
<div
99
:class="{
1010
'backdrop-blur-sm': spinner === true,
11-
'backdrop-blur-xl': spinner !== true
11+
'backdrop-blur-xl': spinner !== true,
1212
}"
1313
class="fixed inset-0 z-40 bg-white/30 flex items-center justify-center"
1414
>

templates/vue-example/src/components/Button.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defineProps<{
1111
:class="{
1212
'opacity-25': disabled === true,
1313
'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]':
14-
disabled !== true
14+
disabled !== true,
1515
}"
1616
>
1717
<slot />

templates/vue-example/src/components/Delete.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ const delItem = async () => {
1616
1717
try {
1818
const {
19-
data: { url }
19+
data: { url },
2020
} = doc
2121
2222
if (url !== undefined) {
2323
const { pathname: fullPath } = new URL(url)
2424
2525
await deleteAsset({
2626
collection: 'images',
27-
fullPath
27+
fullPath,
2828
})
2929
}
3030
3131
await deleteDoc({
3232
collection: 'notes',
33-
doc
33+
doc,
3434
})
3535
3636
await reload()

templates/vue-example/src/components/Modal.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const add = async () => {
4444
const { downloadUrl } = await uploadFile({
4545
collection: 'images',
4646
data: file.value,
47-
filename
47+
filename,
4848
})
4949
5050
url = downloadUrl
@@ -58,9 +58,9 @@ const add = async () => {
5858
key,
5959
data: {
6060
text: inputText.value,
61-
...(url !== undefined && { url })
62-
}
63-
}
61+
...(url !== undefined && { url }),
62+
},
63+
},
6464
})
6565
6666
setShowModal(false)

templates/vue-example/src/components/Table.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const items = ref<Doc<Note>[]>([])
99
const list = async () => {
1010
const { items: data } = await listDocs<Note>({
1111
collection: 'notes',
12-
filter: {}
12+
filter: {},
1313
})
1414
1515
items.value = data

templates/vue-example/tailwind.config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ const config: Config = {
55
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
66
theme: {
77
fontFamily: {
8-
sans: ['JetBrains Mono', 'sans-serif', ...fontFamily.sans]
8+
sans: ['JetBrains Mono', 'sans-serif', ...fontFamily.sans],
99
},
1010
extend: {
1111
screens: {
12-
tall: { raw: '(min-height: 800px)' }
12+
tall: { raw: '(min-height: 800px)' },
1313
},
1414
animation: {
15-
fade: 'fadeIn .25s ease-in-out'
15+
fade: 'fadeIn .25s ease-in-out',
1616
},
1717

1818
keyframes: {
1919
fadeIn: {
2020
from: { opacity: '0' },
21-
to: { opacity: '1' }
22-
}
23-
}
21+
to: { opacity: '1' },
22+
},
23+
},
2424
},
2525
colors: {
2626
inherit: 'inherit',
@@ -38,9 +38,9 @@ const config: Config = {
3838
600: '#606dcc',
3939
700: '#485299',
4040
800: '#303666',
41-
900: '#181b33'
42-
}
43-
}
44-
}
41+
900: '#181b33',
42+
},
43+
},
44+
},
4545
}
4646
export default config

templates/vue-example/tsconfig.app.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"composite": true,
77
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
88

9-
"baseUrl": ".",
109
"paths": {
1110
"@/*": ["./src/*"]
1211
}

templates/vue-example/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
},
77
{
88
"path": "./tsconfig.app.json"
9+
},
10+
{
11+
"path": "./tsconfig.vitest.json"
912
}
1013
]
1114
}

templates/vue-example/tsconfig.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@tsconfig/node20/tsconfig.json",
2+
"extends": "@tsconfig/node22/tsconfig.json",
33
"include": [
44
"vite.config.*",
55
"vitest.config.*",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.app.json",
3+
"exclude": [],
4+
"compilerOptions": {
5+
"composite": true,
6+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.vitest.tsbuildinfo",
7+
8+
"lib": [],
9+
"types": ["node", "jsdom"]
10+
}
11+
}

templates/vue-example/vite.config.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { fileURLToPath, URL } from 'node:url'
2+
23
import { defineConfig } from 'vite'
34
import vue from '@vitejs/plugin-vue'
5+
import vueJsx from '@vitejs/plugin-vue-jsx'
46
import juno from '@junobuild/vite-plugin'
57

6-
// https://vitejs.dev/config/
8+
// https://vite.dev/config/
79
export default defineConfig({
8-
plugins: [vue(), juno({ container: true })],
10+
plugins: [vue(), vueJsx(), juno({ container: true })],
911
resolve: {
1012
alias: {
11-
'@': fileURLToPath(new URL('./src', import.meta.url))
12-
}
13-
}
13+
'@': fileURLToPath(new URL('./src', import.meta.url)),
14+
},
15+
},
1416
})
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { fileURLToPath } from 'node:url'
2+
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
3+
import viteConfig from './vite.config'
4+
5+
export default mergeConfig(
6+
viteConfig,
7+
defineConfig({
8+
test: {
9+
environment: 'jsdom',
10+
exclude: [...configDefaults.exclude, 'e2e/**'],
11+
root: fileURLToPath(new URL('./', import.meta.url)),
12+
},
13+
}),
14+
)

templates/vue-starter/.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
2+
charset = utf-8
3+
indent_size = 2
4+
indent_style = space
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"$schema": "https://json.schemastore.org/prettierrc",
33
"semi": false,
4-
"tabWidth": 2,
54
"singleQuote": true,
6-
"printWidth": 100,
7-
"trailingComma": "none"
5+
"printWidth": 100
86
}

0 commit comments

Comments
 (0)