@kevinmarrec/create-app 0.14.0 → 0.16.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.mjs CHANGED
@@ -8,7 +8,7 @@ import { x } from "tinyexec";
8
8
  import fs from "node:fs/promises";
9
9
 
10
10
  //#region package.json
11
- var version = "0.14.0";
11
+ var version = "0.16.0";
12
12
 
13
13
  //#endregion
14
14
  //#region src/utils/fs.ts
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@kevinmarrec/create-app",
3
3
  "type": "module",
4
- "version": "0.14.0",
5
- "packageManager": "bun@1.3.4",
4
+ "version": "0.16.0",
5
+ "packageManager": "bun@1.3.6",
6
6
  "description": "CLI that scaffolds an opinionated Bun & Vue fullstack application.",
7
7
  "author": "Kevin Marrec <kevin@marrec.io>",
8
8
  "license": "MIT",
@@ -50,19 +50,19 @@
50
50
  "tinyexec": "^1.0.2"
51
51
  },
52
52
  "devDependencies": {
53
- "@faker-js/faker": "^10.1.0",
54
- "@kevinmarrec/eslint-config": "^1.6.0",
55
- "@kevinmarrec/stylelint-config": "^1.6.0",
56
- "@kevinmarrec/tsconfig": "^1.6.0",
57
- "@types/bun": "^1.3.4",
58
- "@vitest/coverage-v8": "^4.0.15",
59
- "bumpp": "^10.3.2",
53
+ "@faker-js/faker": "^10.2.0",
54
+ "@kevinmarrec/eslint-config": "^1.9.0",
55
+ "@kevinmarrec/stylelint-config": "^1.9.0",
56
+ "@kevinmarrec/tsconfig": "^1.9.0",
57
+ "@types/bun": "^1.3.6",
58
+ "@vitest/coverage-v8": "^4.0.17",
59
+ "bumpp": "^10.4.0",
60
60
  "eslint": "^9.39.2",
61
- "knip": "^5.73.4",
62
- "stylelint": "^16.26.1",
63
- "tsdown": "^0.18.0",
61
+ "knip": "^5.81.0",
62
+ "stylelint": "^17.0.0",
63
+ "tsdown": "^0.19.0",
64
64
  "typescript": "^5.9.3",
65
- "vitest": "^4.0.15",
66
- "vue-tsc": "^3.1.8"
65
+ "vitest": "^4.0.17",
66
+ "vue-tsc": "^3.2.2"
67
67
  }
68
68
  }
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  mailpit:
3
- image: axllent/mailpit:v1.28.0
3
+ image: axllent/mailpit:v1.28.2
4
4
  container_name: mailpit
5
5
  depends_on:
6
6
  traefik:
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  metabase:
3
- image: metabase/metabase:v0.57.6
3
+ image: metabase/metabase:v0.58.2
4
4
  container_name: metabase
5
5
  depends_on:
6
6
  traefik:
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  studio:
3
- image: ghcr.io/drizzle-team/gateway:1.1.1
3
+ image: ghcr.io/drizzle-team/gateway:1.2.0
4
4
  container_name: studio
5
5
  depends_on:
6
6
  traefik:
@@ -1,6 +1,6 @@
1
1
  services:
2
2
  traefik:
3
- image: traefik:v3.6.4
3
+ image: traefik:v3.6.7
4
4
  container_name: traefik
5
5
  restart: unless-stopped
6
6
  security_opt:
@@ -0,0 +1,6 @@
1
+ .docker*
2
+ .github
3
+ .vscode
4
+ **/dist
5
+ **/node_modules
6
+ **/Dockerfile
@@ -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@17c15f6cd9619f71ff6db54691dc6ac0a73db2c6 # main
17
+ uses: kevinmarrec/workflows/setup-bun@4886894d0abcc5c6dd0b292aa0a53cdd94cc6dc1 # 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@17c15f6cd9619f71ff6db54691dc6ac0a73db2c6 # main
35
+ uses: kevinmarrec/workflows/setup-bun@4886894d0abcc5c6dd0b292aa0a53cdd94cc6dc1 # 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@17c15f6cd9619f71ff6db54691dc6ac0a73db2c6 # main
41
+ uses: kevinmarrec/workflows/filesize-diff@4886894d0abcc5c6dd0b292aa0a53cdd94cc6dc1 # main
42
42
  with:
43
43
  directories: app/dist,api/dist
@@ -2,4 +2,4 @@ ALLOWED_ORIGINS="https://app.dev.localhost"
2
2
  AUTH_SECRET="D0QykrmzDgVrP4GCKkFPT1CB1UplFk4bhIJk92SUtSQ="
3
3
  DATABASE_URL="postgresql://user:password@postgres:5432/app"
4
4
  LOG_LEVEL=info
5
- NODE_ENV="development"
5
+ SERVER_URL="https://api.dev.localhost"
@@ -1,6 +1,6 @@
1
- ARG TARGETARCH
1
+ FROM --platform=$BUILDPLATFORM oven/bun:1.3.6-slim AS build
2
2
 
3
- FROM oven/bun:1.3.4-slim AS build
3
+ ARG TARGETARCH
4
4
 
5
5
  WORKDIR /build
6
6
 
@@ -12,7 +12,7 @@ RUN bun install --filter api --frozen-lockfile
12
12
 
13
13
  COPY api/ ./api/
14
14
 
15
- RUN bun --cwd api build --target bun-linux-$TARGETARCH-modern
15
+ RUN bun -F ./api build --target bun-linux-$TARGETARCH-modern
16
16
 
17
17
  FROM gcr.io/distroless/base-debian13:nonroot AS runner
18
18
 
@@ -9,18 +9,18 @@
9
9
  "db:migrate": "bun --bun run drizzle-kit migrate --config src/database/drizzle/config.ts"
10
10
  },
11
11
  "dependencies": {
12
- "@libsql/client": "^0.15.15",
13
- "@orpc/server": "^1.12.3",
14
- "better-auth": "^1.4.7",
12
+ "@libsql/client": "^0.17.0",
13
+ "@orpc/server": "^1.13.4",
14
+ "better-auth": "^1.4.13",
15
15
  "drizzle-orm": "^0.45.1",
16
- "pino": "^10.1.0",
16
+ "pino": "^10.2.0",
17
17
  "valibot": "^1.2.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@kevinmarrec/tsconfig": "^1.6.0",
21
- "@types/bun": "^1.3.4",
20
+ "@kevinmarrec/tsconfig": "^1.9.0",
21
+ "@types/bun": "^1.3.6",
22
22
  "drizzle-kit": "^0.31.8",
23
- "pg": "^8.16.3",
23
+ "pg": "^8.17.1",
24
24
  "pino-pretty": "^13.1.3",
25
25
  "typescript": "~5.9.3"
26
26
  }
@@ -6,6 +6,7 @@ import { env } from '../env'
6
6
 
7
7
  export function createBetterAuth({ db, logger }: { db: DB, logger: Logger }) {
8
8
  return betterAuth({
9
+ baseURL: env.server.url,
9
10
  basePath: '/auth',
10
11
  secret: env.auth.secret,
11
12
  trustedOrigins: env.cors.allowedOrigins,
@@ -44,6 +44,11 @@ const schema = v.object({
44
44
  v.digits(),
45
45
  v.toNumber(),
46
46
  ),
47
+ url: v.pipe(
48
+ v.string(),
49
+ v.trim(),
50
+ v.startsWith('https://'),
51
+ ),
47
52
  }),
48
53
  })
49
54
 
@@ -63,6 +68,7 @@ const parsed = v.safeParse(schema, {
63
68
  server: {
64
69
  host: import.meta.env.HOST,
65
70
  port: import.meta.env.PORT,
71
+ url: import.meta.env.SERVER_URL,
66
72
  },
67
73
  })
68
74
 
@@ -14,7 +14,7 @@ export function cors(handler: (req: Request) => Promise<Response>) {
14
14
 
15
15
  if (req.method === 'OPTIONS') {
16
16
  response.headers.append('Access-Control-Allow-Headers', 'Content-Type, Authorization, User-Agent')
17
- response.headers.append('Access-Control-Allow-Methods', 'GET, HEAD, PUT, POST, DELETE, PATCH')
17
+ response.headers.append('Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
18
18
  response.headers.append('Access-Control-Max-Age', '7200') // 2 hours https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Access-Control-Max-Age
19
19
  }
20
20
 
@@ -0,0 +1,21 @@
1
+ FROM --platform=$BUILDPLATFORM imbios/bun-node:1.3.6-24-alpine AS build
2
+
3
+ ARG TARGETARCH
4
+
5
+ WORKDIR /build
6
+
7
+ COPY package.json bun.lock ./
8
+ COPY api/package.json ./api/package.json
9
+ COPY app/package.json ./app/package.json
10
+
11
+ RUN bun install --filter app --frozen-lockfile
12
+
13
+ COPY app/ ./app/
14
+
15
+ RUN bun -F ./app build
16
+
17
+ FROM nginx:1.29.4-alpine AS serve
18
+
19
+ COPY --from=build --chown=nonroot:nonroot /build/app/dist/ /usr/share/nginx/html
20
+
21
+ EXPOSE 80
@@ -9,31 +9,32 @@
9
9
  "preview": "vite preview --open"
10
10
  },
11
11
  "dependencies": {
12
- "@kevinmarrec/vue-i18n": "^1.2.0",
13
- "@orpc/client": "^1.12.3",
14
- "@pinia/colada": "^0.18.1",
15
- "@unhead/vue": "^2.0.19",
12
+ "@kevinmarrec/vue-i18n": "^1.2.1",
13
+ "@orpc/client": "^1.13.4",
14
+ "@orpc/vue-colada": "^1.13.4",
15
+ "@pinia/colada": "^0.21.1",
16
+ "@unhead/vue": "^2.1.2",
16
17
  "@vueuse/core": "^14.1.0",
17
- "better-auth": "^1.4.7",
18
+ "better-auth": "^1.4.13",
18
19
  "pinia": "^3.0.4",
19
- "unocss": "^66.5.10",
20
- "vue": "^3.5.25"
20
+ "unocss": "^66.6.0",
21
+ "vue": "^3.5.26"
21
22
  },
22
23
  "devDependencies": {
23
- "@kevinmarrec/tsconfig": "^1.6.0",
24
- "@kevinmarrec/unocss-config": "^1.6.0",
25
- "@kevinmarrec/vite-plugin-dark-mode": "^1.2.0",
24
+ "@kevinmarrec/tsconfig": "^1.9.0",
25
+ "@kevinmarrec/unocss-config": "^1.9.0",
26
+ "@kevinmarrec/vite-plugin-dark-mode": "^1.2.1",
26
27
  "@modyfi/vite-plugin-yaml": "^1.1.1",
27
- "@unhead/addons": "^2.0.19",
28
+ "@unhead/addons": "^2.1.2",
28
29
  "@vitejs/plugin-vue": "^6.0.3",
29
30
  "beasties": "^0.3.5",
30
31
  "rollup-plugin-visualizer": "^6.0.5",
31
32
  "typescript": "~5.9.3",
32
33
  "valibot": "^1.2.0",
33
- "vite": "^7.3.0",
34
+ "vite": "^7.3.1",
34
35
  "vite-plugin-valibot-env": "^1.0.1",
35
36
  "vite-plugin-vue-devtools": "^8.0.5",
36
37
  "vite-ssg": "^28.2.2",
37
- "vite-tsconfig-paths": "^6.0.1"
38
+ "vite-tsconfig-paths": "^6.0.4"
38
39
  }
39
40
  }
@@ -3,18 +3,8 @@ import { useQuery } from '@pinia/colada'
3
3
  import { orpc } from '~/app/lib/orpc'
4
4
 
5
5
  export function useContent() {
6
- const publicContent = useQuery({
7
- key: () => ['public'],
8
- query: orpc.public,
9
- }).data
10
-
11
- const privateContent = useQuery({
12
- key: () => ['private'],
13
- query: orpc.private,
14
- }).data
15
-
16
6
  return {
17
- publicContent,
18
- privateContent,
7
+ publicContent: useQuery(orpc.public.queryOptions()).data,
8
+ privateContent: useQuery(orpc.private.queryOptions()).data,
19
9
  }
20
10
  }
@@ -1,13 +1,11 @@
1
1
  import { createAuthClient, type ErrorContext } from 'better-auth/vue'
2
2
 
3
- import { getFetchOptions } from '../utils/fetch'
4
-
5
3
  export type AuthError = ErrorContext['error']
6
4
 
7
5
  export const authClient = createAuthClient({
8
6
  baseURL: `${import.meta.env.VITE_API_URL}/auth`,
9
7
  fetchOptions: {
10
- ...getFetchOptions(),
8
+ credentials: 'include',
11
9
  onError: ({ error }) => Promise.reject(error),
12
10
  },
13
11
  })
@@ -1,13 +1,18 @@
1
1
  import { createORPCClient } from '@orpc/client'
2
2
  import { RPCLink } from '@orpc/client/fetch'
3
+ import { createORPCVueColadaUtils } from '@orpc/vue-colada'
3
4
 
4
5
  import type { Router, RouterClient } from '~/api/orpc/router'
5
6
 
6
- import { getFetchOptions } from '../utils/fetch'
7
-
8
7
  const link = new RPCLink({
9
8
  url: `${import.meta.env.VITE_API_URL}/rpc`,
10
- fetch: (request, init) => globalThis.fetch(request, getFetchOptions(init)),
9
+ fetch: (request, init) => globalThis.fetch(request, {
10
+ ...init,
11
+ credentials: 'include',
12
+ signal: AbortSignal.timeout(30_000),
13
+ }),
11
14
  })
12
15
 
13
- export const orpc = createORPCClient<RouterClient<Router>>(link)
16
+ const client = createORPCClient<RouterClient<Router>>(link)
17
+
18
+ export const orpc = createORPCVueColadaUtils(client)
@@ -16,7 +16,7 @@ services:
16
16
 
17
17
  api:
18
18
  <<: *common
19
- image: oven/bun:1.3.4-alpine
19
+ image: oven/bun:1.3.6-alpine
20
20
  container_name: api
21
21
  init: true
22
22
  depends_on:
@@ -36,7 +36,7 @@ services:
36
36
 
37
37
  app:
38
38
  <<: *common
39
- image: imbios/bun-node:1.3.4-24-alpine
39
+ image: imbios/bun-node:1.3.6-24-alpine
40
40
  container_name: app
41
41
  init: true
42
42
  depends_on:
@@ -5,6 +5,7 @@ Object.assign(import.meta.env, {
5
5
  ALLOWED_ORIGINS: 'https://foo.bar',
6
6
  AUTH_SECRET: 'foo',
7
7
  DATABASE_URL: 'postgresql://foo:bar@localhost:5432/foo',
8
+ SERVER_URL: 'https://foo.bar',
8
9
  })
9
10
 
10
11
  export default {
@@ -2,7 +2,7 @@
2
2
  "name": "project",
3
3
  "type": "module",
4
4
  "private": true,
5
- "packageManager": "bun@1.3.4",
5
+ "packageManager": "bun@1.3.6",
6
6
  "engines": {
7
7
  "node": "lts/*"
8
8
  },
@@ -23,13 +23,13 @@
23
23
  "update": "bunx taze -I -rwi"
24
24
  },
25
25
  "devDependencies": {
26
- "@kevinmarrec/eslint-config": "^1.6.0",
27
- "@kevinmarrec/stylelint-config": "^1.6.0",
28
- "@kevinmarrec/tsconfig": "^1.6.0",
26
+ "@kevinmarrec/eslint-config": "^1.9.0",
27
+ "@kevinmarrec/stylelint-config": "^1.9.0",
28
+ "@kevinmarrec/tsconfig": "^1.9.0",
29
29
  "eslint": "^9.39.2",
30
- "knip": "^5.73.4",
31
- "stylelint": "^16.26.1",
30
+ "knip": "^5.81.0",
31
+ "stylelint": "^17.0.0",
32
32
  "typescript": "~5.9.3",
33
- "vue-tsc": "^3.1.8"
33
+ "vue-tsc": "^3.2.2"
34
34
  }
35
35
  }
@@ -1,9 +0,0 @@
1
- const FETCH_TIMEOUT_MS = 30_000
2
-
3
- export function getFetchOptions(init?: RequestInit): RequestInit {
4
- return {
5
- ...init,
6
- credentials: 'include',
7
- signal: AbortSignal.timeout(FETCH_TIMEOUT_MS),
8
- }
9
- }