@kevinmarrec/create-app 0.13.0 → 0.14.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/dist/{index.js → index.mjs} +1 -1
- package/package.json +10 -12
- package/template/.docker/analytics/service.yml +1 -1
- package/template/.docker/metabase/service.yml +1 -1
- package/template/.github/workflows/ci.yml +3 -3
- package/template/api/package.json +4 -4
- package/template/app/package.json +10 -10
- package/template/app/src/composables/auth.ts +3 -9
- package/template/app/src/lib/auth.ts +13 -0
- package/template/app/src/utils/fetch.ts +0 -7
- package/template/package.json +6 -6
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kevinmarrec/create-app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0",
|
|
5
5
|
"packageManager": "bun@1.3.4",
|
|
6
6
|
"description": "CLI that scaffolds an opinionated Bun & Vue fullstack application.",
|
|
7
7
|
"author": "Kevin Marrec <kevin@marrec.io>",
|
|
@@ -21,9 +21,7 @@
|
|
|
21
21
|
"template/api",
|
|
22
22
|
"template/app"
|
|
23
23
|
],
|
|
24
|
-
"bin":
|
|
25
|
-
"create-app": "dist/index.js"
|
|
26
|
-
},
|
|
24
|
+
"bin": "./dist/index.mjs",
|
|
27
25
|
"files": [
|
|
28
26
|
"dist",
|
|
29
27
|
"template",
|
|
@@ -31,7 +29,7 @@
|
|
|
31
29
|
"template/.npmrc"
|
|
32
30
|
],
|
|
33
31
|
"scripts": {
|
|
34
|
-
"build": "tsdown
|
|
32
|
+
"build": "tsdown",
|
|
35
33
|
"check": "bun run check:eslint && bun run check:stylelint && bun run check:unused && bun run check:types",
|
|
36
34
|
"check:eslint": "eslint . --cache",
|
|
37
35
|
"check:stylelint": "stylelint '**/*.{css,scss,vue}' --ignorePath .gitignore --cache",
|
|
@@ -53,18 +51,18 @@
|
|
|
53
51
|
},
|
|
54
52
|
"devDependencies": {
|
|
55
53
|
"@faker-js/faker": "^10.1.0",
|
|
56
|
-
"@kevinmarrec/eslint-config": "^1.
|
|
57
|
-
"@kevinmarrec/stylelint-config": "^1.
|
|
58
|
-
"@kevinmarrec/tsconfig": "^1.
|
|
54
|
+
"@kevinmarrec/eslint-config": "^1.6.0",
|
|
55
|
+
"@kevinmarrec/stylelint-config": "^1.6.0",
|
|
56
|
+
"@kevinmarrec/tsconfig": "^1.6.0",
|
|
59
57
|
"@types/bun": "^1.3.4",
|
|
60
58
|
"@vitest/coverage-v8": "^4.0.15",
|
|
61
59
|
"bumpp": "^10.3.2",
|
|
62
|
-
"eslint": "^9.39.
|
|
63
|
-
"knip": "^5.
|
|
60
|
+
"eslint": "^9.39.2",
|
|
61
|
+
"knip": "^5.73.4",
|
|
64
62
|
"stylelint": "^16.26.1",
|
|
65
|
-
"tsdown": "^0.
|
|
63
|
+
"tsdown": "^0.18.0",
|
|
66
64
|
"typescript": "^5.9.3",
|
|
67
65
|
"vitest": "^4.0.15",
|
|
68
|
-
"vue-tsc": "^3.1.
|
|
66
|
+
"vue-tsc": "^3.1.8"
|
|
69
67
|
}
|
|
70
68
|
}
|
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
runs-on: ubuntu-latest
|
|
15
15
|
steps:
|
|
16
16
|
- name: Setup Bun
|
|
17
|
-
uses: kevinmarrec/workflows/setup-bun@main
|
|
17
|
+
uses: kevinmarrec/workflows/setup-bun@17c15f6cd9619f71ff6db54691dc6ac0a73db2c6 # main
|
|
18
18
|
|
|
19
19
|
- name: Lint
|
|
20
20
|
run: bun run lint
|
|
@@ -32,12 +32,12 @@ jobs:
|
|
|
32
32
|
pull-requests: write
|
|
33
33
|
steps:
|
|
34
34
|
- name: Setup Bun
|
|
35
|
-
uses: kevinmarrec/workflows/setup-bun@main
|
|
35
|
+
uses: kevinmarrec/workflows/setup-bun@17c15f6cd9619f71ff6db54691dc6ac0a73db2c6 # main
|
|
36
36
|
|
|
37
37
|
- name: Build project
|
|
38
38
|
run: bun run build
|
|
39
39
|
|
|
40
40
|
- name: Analyze project build size differences
|
|
41
|
-
uses: kevinmarrec/workflows/filesize-diff@main
|
|
41
|
+
uses: kevinmarrec/workflows/filesize-diff@17c15f6cd9619f71ff6db54691dc6ac0a73db2c6 # main
|
|
42
42
|
with:
|
|
43
43
|
directories: app/dist,api/dist
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@libsql/client": "^0.15.15",
|
|
13
|
-
"@orpc/server": "^1.12.
|
|
14
|
-
"better-auth": "^1.4.
|
|
15
|
-
"drizzle-orm": "^0.45.
|
|
13
|
+
"@orpc/server": "^1.12.3",
|
|
14
|
+
"better-auth": "^1.4.7",
|
|
15
|
+
"drizzle-orm": "^0.45.1",
|
|
16
16
|
"pino": "^10.1.0",
|
|
17
17
|
"valibot": "^1.2.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@kevinmarrec/tsconfig": "^1.
|
|
20
|
+
"@kevinmarrec/tsconfig": "^1.6.0",
|
|
21
21
|
"@types/bun": "^1.3.4",
|
|
22
22
|
"drizzle-kit": "^0.31.8",
|
|
23
23
|
"pg": "^8.16.3",
|
|
@@ -9,31 +9,31 @@
|
|
|
9
9
|
"preview": "vite preview --open"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@kevinmarrec/vue-i18n": "^1.
|
|
13
|
-
"@orpc/client": "^1.12.
|
|
14
|
-
"@pinia/colada": "^0.18.
|
|
12
|
+
"@kevinmarrec/vue-i18n": "^1.2.0",
|
|
13
|
+
"@orpc/client": "^1.12.3",
|
|
14
|
+
"@pinia/colada": "^0.18.1",
|
|
15
15
|
"@unhead/vue": "^2.0.19",
|
|
16
16
|
"@vueuse/core": "^14.1.0",
|
|
17
|
-
"better-auth": "^1.4.
|
|
17
|
+
"better-auth": "^1.4.7",
|
|
18
18
|
"pinia": "^3.0.4",
|
|
19
19
|
"unocss": "^66.5.10",
|
|
20
20
|
"vue": "^3.5.25"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@kevinmarrec/tsconfig": "^1.
|
|
24
|
-
"@kevinmarrec/unocss-config": "^1.
|
|
25
|
-
"@kevinmarrec/vite-plugin-dark-mode": "^1.
|
|
23
|
+
"@kevinmarrec/tsconfig": "^1.6.0",
|
|
24
|
+
"@kevinmarrec/unocss-config": "^1.6.0",
|
|
25
|
+
"@kevinmarrec/vite-plugin-dark-mode": "^1.2.0",
|
|
26
26
|
"@modyfi/vite-plugin-yaml": "^1.1.1",
|
|
27
27
|
"@unhead/addons": "^2.0.19",
|
|
28
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
28
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
29
29
|
"beasties": "^0.3.5",
|
|
30
30
|
"rollup-plugin-visualizer": "^6.0.5",
|
|
31
31
|
"typescript": "~5.9.3",
|
|
32
32
|
"valibot": "^1.2.0",
|
|
33
|
-
"vite": "^7.
|
|
33
|
+
"vite": "^7.3.0",
|
|
34
34
|
"vite-plugin-valibot-env": "^1.0.1",
|
|
35
35
|
"vite-plugin-vue-devtools": "^8.0.5",
|
|
36
36
|
"vite-ssg": "^28.2.2",
|
|
37
|
-
"vite-tsconfig-paths": "^
|
|
37
|
+
"vite-tsconfig-paths": "^6.0.1"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import { defineMutation } from '@pinia/colada'
|
|
2
2
|
import { set } from '@vueuse/core'
|
|
3
|
-
import { createAuthClient, type ErrorContext } from 'better-auth/vue'
|
|
4
3
|
import { computed, ref } from 'vue'
|
|
5
4
|
|
|
6
|
-
import {
|
|
5
|
+
import { authClient, type AuthError } from '../lib/auth'
|
|
7
6
|
|
|
8
|
-
const
|
|
9
|
-
baseURL: `${import.meta.env.VITE_API_URL}/auth`,
|
|
10
|
-
fetchOptions,
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
const authError = ref<ErrorContext['error'] | null>(null)
|
|
7
|
+
const authError = ref<AuthError>()
|
|
14
8
|
|
|
15
9
|
function defineAuthMutation<TVars, TData>(mutation: (vars: TVars) => Promise<TData>) {
|
|
16
10
|
return defineMutation({
|
|
17
11
|
mutation,
|
|
18
12
|
onMutate: () => {
|
|
19
|
-
set(authError,
|
|
13
|
+
set(authError, undefined)
|
|
20
14
|
},
|
|
21
15
|
onSettled: (_, error) => {
|
|
22
16
|
set(authError, error)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createAuthClient, type ErrorContext } from 'better-auth/vue'
|
|
2
|
+
|
|
3
|
+
import { getFetchOptions } from '../utils/fetch'
|
|
4
|
+
|
|
5
|
+
export type AuthError = ErrorContext['error']
|
|
6
|
+
|
|
7
|
+
export const authClient = createAuthClient({
|
|
8
|
+
baseURL: `${import.meta.env.VITE_API_URL}/auth`,
|
|
9
|
+
fetchOptions: {
|
|
10
|
+
...getFetchOptions(),
|
|
11
|
+
onError: ({ error }) => Promise.reject(error),
|
|
12
|
+
},
|
|
13
|
+
})
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { BetterFetchOption } from 'better-auth/vue'
|
|
2
|
-
|
|
3
1
|
const FETCH_TIMEOUT_MS = 30_000
|
|
4
2
|
|
|
5
3
|
export function getFetchOptions(init?: RequestInit): RequestInit {
|
|
@@ -9,8 +7,3 @@ export function getFetchOptions(init?: RequestInit): RequestInit {
|
|
|
9
7
|
signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
|
|
10
8
|
}
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
export const betterFetchOptions: BetterFetchOption = {
|
|
14
|
-
...getFetchOptions(),
|
|
15
|
-
onError: ({ error }) => Promise.reject(error),
|
|
16
|
-
}
|
package/template/package.json
CHANGED
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"update": "bunx taze -I -rwi"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@kevinmarrec/eslint-config": "^1.
|
|
27
|
-
"@kevinmarrec/stylelint-config": "^1.
|
|
28
|
-
"@kevinmarrec/tsconfig": "^1.
|
|
29
|
-
"eslint": "^9.39.
|
|
30
|
-
"knip": "^5.
|
|
26
|
+
"@kevinmarrec/eslint-config": "^1.6.0",
|
|
27
|
+
"@kevinmarrec/stylelint-config": "^1.6.0",
|
|
28
|
+
"@kevinmarrec/tsconfig": "^1.6.0",
|
|
29
|
+
"eslint": "^9.39.2",
|
|
30
|
+
"knip": "^5.73.4",
|
|
31
31
|
"stylelint": "^16.26.1",
|
|
32
32
|
"typescript": "~5.9.3",
|
|
33
|
-
"vue-tsc": "^3.1.
|
|
33
|
+
"vue-tsc": "^3.1.8"
|
|
34
34
|
}
|
|
35
35
|
}
|