diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..25fa621 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/LICENSE b/LICENSE index 1257120..c33b41d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Bistroo +Copyright (c) 2023 Youri van Mill Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 78dedb4..66e221e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# SSR for Vue +# vite-plugin-vue-ssr -Minimalistic wrapper to run SSR Vue apps, based on Vite +Vite plugin to develop Vue 3 SSR apps ## Features * HMR support @@ -14,47 +14,55 @@ Minimalistic wrapper to run SSR Vue apps, based on Vite ### Installation ```sh -pnpm install @bistroo/vue-ssr -D +pnpm install vite-plugin-vue-ssr -D ``` -Add the following scripts - -```json -"scripts": { - "dev": "vue-ssr", - "build": "vue-ssr build", - "start": "vue-ssr start" -}, -``` - -> The `vue-ssr` command creates a dev server with HMR enabled. -To create a production ready build, use `vue-ssr build`. After creating a build, use `vue-ssr start` to serve the build with Express. - -### Configuration - -Create a vue-ssr.config.ts - -```typescript -import { defineConfig } from '@bistroo/vue-ssr' +vite.config.ts +```ts +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueSsr from 'vite-plugin-vue-ssr/plugin' import { fileURLToPath } from 'node:url' export default defineConfig({ - vite: { - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), - }, + plugins: [ + vue(), + vueSsr(), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), }, }, }) -``` -> Use the `vite` property with caution. +``` ### Usage +Add the build commands to your `package.json` file. + +```json +{ + "scripts": { + "dev": "vite", + "build": "pnpm run build:client && pnpm run build:server", + "build:client": "vite build --ssrManifest --outDir dist/client", + "build:server": "vite build --ssr src/main.ts --outDir dist/server" + } +} +``` + +This will build a client and server bundle. + +Use the `vite` command to start a SSR enabled dev server. + +> Disabling SSR in vite will enable to build a SPA version. + +The `main.ts` file should export the imported vueSSR function. + ```ts -import { vueSSR } from '@bistroo/vue-ssr' +import { vueSSR } from 'vite-plugin-vue-ssr' import App from '@/App.vue' @@ -71,9 +79,7 @@ const routes = [ export default vueSSR(App, { routes }) ``` -The `main.ts` file should export the imported vueSSR function. - -Pinia is supported by using the `app` and `state` property inside the callback. +Pinia/Vuex is supported by using the `app` and `state` property inside the callback. ```typescript export default vueSSR(App, { routes }, ({ app, state }) => { diff --git a/bin/vue-ssr.js b/bin/vue-ssr.js deleted file mode 100755 index 4273324..0000000 --- a/bin/vue-ssr.js +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node - -function start() { - return import('../dist/cli.js') -} - -start() diff --git a/example/package.json b/example/package.json index 09fda28..464a6bb 100644 --- a/example/package.json +++ b/example/package.json @@ -4,19 +4,24 @@ "version": "0.0.0", "type": "module", "scripts": { - "dev": "vue-ssr", - "build": "vue-ssr build", - "start": "vue-ssr start" + "dev": "vite", + "build": "pnpm run build:client && pnpm run build:server", + "build:client": "vite build --ssrManifest --outDir dist/client", + "build:server": "vite build --ssr src/main.ts --outDir dist/server" }, "dependencies": { - "@vueuse/head": "^1.1.26", + "@vueuse/head": "^1.3.1", "pinia": "^2.1.6", "vue": "^3.3.4", "vue-router": "^4.2.4" }, "devDependencies": { - "@bistroo/vue-ssr": "workspace:*", - "@vue/tsconfig": "^0.1.3", - "typescript": "^4.9.4" + "vite-plugin-vue-ssr": "workspace:*", + "@tsconfig/node18": "^18.2.0", + "@types/node": "^18.17.5", + "@vitejs/plugin-vue": "^4.2.3", + "@vue/tsconfig": "^0.4.0", + "typescript": "~5.1.6", + "vite": "^4.4.9" } } diff --git a/example/src/main.ts b/example/src/main.ts index 436d9c6..08d9c3c 100644 --- a/example/src/main.ts +++ b/example/src/main.ts @@ -1,4 +1,4 @@ -import { vueSSR } from '@bistroo/vue-ssr' +import { vueSSR } from 'vite-plugin-vue-ssr' import { createPinia } from 'pinia' import App from '@/App.vue' @@ -10,14 +10,15 @@ const routes = [ path: '/', name: 'counter', component: Counter, - } + }, ] export default vueSSR(App, { routes }, ({ app, state }) => { const pinia = createPinia() - app.use(pinia) + console.log(import.meta.env.SSR) + if (import.meta.env.SSR) { state.value = pinia.state.value } else { diff --git a/example/src/stores/counter.ts b/example/src/stores/counter.ts index cef50f7..c2dd24a 100644 --- a/example/src/stores/counter.ts +++ b/example/src/stores/counter.ts @@ -1,7 +1,7 @@ import { defineStore } from 'pinia' export const useCounterStore = defineStore('counter', { - state: () => ({ count: 0 }), + state: () => ({ count: 11 }), getters: { doubleCount: (state) => state.count * 2, }, diff --git a/example/tsconfig.app.json b/example/tsconfig.app.json new file mode 100644 index 0000000..3e5b621 --- /dev/null +++ b/example/tsconfig.app.json @@ -0,0 +1,12 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/*"], + "compilerOptions": { + "composite": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + } + } +} diff --git a/example/tsconfig.config.json b/example/tsconfig.config.json deleted file mode 100644 index b06a196..0000000 --- a/example/tsconfig.config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "@vue/tsconfig/tsconfig.node.json", - "include": ["vue-ssr.config.ts", "vitest.config.*", "cypress.config.*"], - "compilerOptions": { - "composite": true, - "types": ["node"] - } -} diff --git a/example/tsconfig.json b/example/tsconfig.json index 8d23599..66b5e57 100644 --- a/example/tsconfig.json +++ b/example/tsconfig.json @@ -1,16 +1,11 @@ { - "extends": "@vue/tsconfig/tsconfig.web.json", - "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@/*": ["./src/*"] - } - }, - + "files": [], "references": [ { - "path": "./tsconfig.config.json" + "path": "./tsconfig.node.json" + }, + { + "path": "./tsconfig.app.json" } ] } diff --git a/example/tsconfig.node.json b/example/tsconfig.node.json new file mode 100644 index 0000000..dee96be --- /dev/null +++ b/example/tsconfig.node.json @@ -0,0 +1,16 @@ +{ + "extends": "@tsconfig/node18/tsconfig.json", + "include": [ + "vite.config.*", + "vitest.config.*", + "cypress.config.*", + "nightwatch.conf.*", + "playwright.config.*" + ], + "compilerOptions": { + "composite": true, + "module": "ESNext", + "moduleResolution": "Bundler", + "types": ["node"] + } +} diff --git a/example/vite.config.ts b/example/vite.config.ts new file mode 100644 index 0000000..f8d55d8 --- /dev/null +++ b/example/vite.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from 'vite' +import vueSsr from 'vite-plugin-vue-ssr/plugin' +import vue from '@vitejs/plugin-vue' +import { fileURLToPath } from 'node:url' + +export default defineConfig({ + plugins: [ + vueSsr(), + vue(), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, + }, +}) diff --git a/example/vue-ssr.config.ts b/example/vue-ssr.config.ts deleted file mode 100644 index 68659fc..0000000 --- a/example/vue-ssr.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { defineConfig } from '@bistroo/vue-ssr' -import { fileURLToPath } from 'node:url' - -export default defineConfig({ - vite: { - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), - }, - }, - }, -}) diff --git a/package.json b/package.json index 20a4b09..2024880 100644 --- a/package.json +++ b/package.json @@ -1,29 +1,28 @@ { - "name": "@bistroo/vue-ssr", - "version": "0.0.13", + "name": "vite-plugin-vue-ssr", + "version": "0.0.0", "type": "module", "license": "MIT", - "description": "Minimalistic wrapper to run SSR Vue apps", - "bin": { - "vue-ssr": "bin/vue-ssr.js" - }, + "description": "Vite plugin to develop Vue 3 SSR apps", "bugs": { - "url": "https://github.com/bistroo/vue-ssr/issues" + "url": "https://github.com/yooouuri/vite-plugin-vue-ssr/issues" }, "repository": { "type": "git", - "url": "git+https://github.com/bistroo/vue-ssr.git" + "url": "git+https://github.com/yooouuri/vite-plugin-vue-ssr.git" }, - "types": "./dist/index.d.ts", "exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" + }, + "./plugin": { + "import": "./dist/plugin/index.js", + "types": "./dist/plugin/index.d.ts" } }, "files": [ - "dist", - "bin" + "dist" ], "scripts": { "build": "rollup -c", @@ -41,32 +40,28 @@ "@babel/traverse": "^7.21.4", "@babel/types": "^7.21.4", "@nuxt/devalue": "^2.0.2", - "@vitejs/plugin-vue": "^4.2.3", - "c12": "^1.4.2", + "@types/express": "^4.17.17", + "@unhead/schema": "^1.3.9", "cheerio": "1.0.0-rc.12", - "compression": "^1.7.4", - "cookie-parser": "^1.4.6", - "express": "^4.18.2", - "magicast": "^0.2.10", - "mri": "^1.2.0", - "serve-static": "^1.15.0", - "vite": "^4.4.7" + "cookie-parser": "^1.4.6" }, "devDependencies": { - "@types/express": "^4.17.17", "@types/node": "^18.17.1", - "@unhead/schema": "^1.1.35", - "@vueuse/head": "^1.1.26", + "@vueuse/head": "^1.3.1", "esbuild": "^0.17.19", + "pinia": "^2.1.6", "rollup": "^3.27.0", "rollup-plugin-dts": "^5.3.1", "rollup-plugin-esbuild": "^5.0.0", "typescript": "^5.1.6", + "vite": "^4.4.9", "vue": "^3.3.4", "vue-router": "^4.2.4" }, "peerDependencies": { - "@vueuse/head": "^1.1.26", + "@vueuse/head": "^1.3.1", + "pinia": "^2.1.6", + "vite": "^4.4.9", "vue": "^3.3.4", "vue-router": "^4.2.4" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 835ff01..7b946d7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,52 +23,31 @@ importers: '@nuxt/devalue': specifier: ^2.0.2 version: 2.0.2 - '@vitejs/plugin-vue': - specifier: ^4.2.3 - version: 4.2.3(vite@4.4.7)(vue@3.3.4) - c12: - specifier: ^1.4.2 - version: 1.4.2 + '@types/express': + specifier: ^4.17.17 + version: 4.17.17 + '@unhead/schema': + specifier: ^1.3.9 + version: 1.3.9 cheerio: specifier: 1.0.0-rc.12 version: 1.0.0-rc.12 - compression: - specifier: ^1.7.4 - version: 1.7.4 cookie-parser: specifier: ^1.4.6 version: 1.4.6 - express: - specifier: ^4.18.2 - version: 4.18.2 - magicast: - specifier: ^0.2.10 - version: 0.2.10 - mri: - specifier: ^1.2.0 - version: 1.2.0 - serve-static: - specifier: ^1.15.0 - version: 1.15.0 - vite: - specifier: ^4.4.7 - version: 4.4.7(@types/node@18.17.1) devDependencies: - '@types/express': - specifier: ^4.17.17 - version: 4.17.17 '@types/node': specifier: ^18.17.1 version: 18.17.1 - '@unhead/schema': - specifier: ^1.1.35 - version: 1.1.35 '@vueuse/head': - specifier: ^1.1.26 - version: 1.1.26(vue@3.3.4) + specifier: ^1.3.1 + version: 1.3.1(vue@3.3.4) esbuild: specifier: ^0.17.19 version: 0.17.19 + pinia: + specifier: ^2.1.6 + version: 2.1.6(typescript@5.1.6)(vue@3.3.4) rollup: specifier: ^3.27.0 version: 3.27.0 @@ -81,6 +60,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.1.6 + vite: + specifier: ^4.4.9 + version: 4.4.9(@types/node@18.17.1) vue: specifier: ^3.3.4 version: 3.3.4 @@ -91,11 +73,11 @@ importers: example: dependencies: '@vueuse/head': - specifier: ^1.1.26 - version: 1.1.26(vue@3.3.4) + specifier: ^1.3.1 + version: 1.3.1(vue@3.3.4) pinia: specifier: ^2.1.6 - version: 2.1.6(typescript@4.9.5)(vue@3.3.4) + version: 2.1.6(typescript@5.1.6)(vue@3.3.4) vue: specifier: ^3.3.4 version: 3.3.4 @@ -103,15 +85,27 @@ importers: specifier: ^4.2.4 version: 4.2.4(vue@3.3.4) devDependencies: - '@bistroo/vue-ssr': - specifier: workspace:* - version: link:.. + '@tsconfig/node18': + specifier: ^18.2.0 + version: 18.2.1 + '@types/node': + specifier: ^18.17.5 + version: 18.17.11 + '@vitejs/plugin-vue': + specifier: ^4.2.3 + version: 4.2.3(vite@4.4.9)(vue@3.3.4) '@vue/tsconfig': - specifier: ^0.1.3 - version: 0.1.3(@types/node@18.17.1) + specifier: ^0.4.0 + version: 0.4.0 typescript: - specifier: ^4.9.4 - version: 4.9.5 + specifier: ~5.1.6 + version: 5.1.6 + vite: + specifier: ^4.4.9 + version: 4.4.9(@types/node@18.17.11) + vite-plugin-vue-ssr: + specifier: workspace:* + version: link:.. packages: @@ -251,7 +245,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/android-arm@0.17.19: @@ -269,7 +263,7 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/android-x64@0.17.19: @@ -287,7 +281,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/darwin-arm64@0.17.19: @@ -305,7 +299,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/darwin-x64@0.17.19: @@ -323,7 +317,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/freebsd-arm64@0.17.19: @@ -341,7 +335,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/freebsd-x64@0.17.19: @@ -359,7 +353,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-arm64@0.17.19: @@ -377,7 +371,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-arm@0.17.19: @@ -395,7 +389,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-ia32@0.17.19: @@ -413,7 +407,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-loong64@0.17.19: @@ -431,7 +425,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-mips64el@0.17.19: @@ -449,7 +443,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-ppc64@0.17.19: @@ -467,7 +461,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-riscv64@0.17.19: @@ -485,7 +479,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-s390x@0.17.19: @@ -503,7 +497,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/linux-x64@0.17.19: @@ -521,7 +515,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/netbsd-x64@0.17.19: @@ -539,7 +533,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/openbsd-x64@0.17.19: @@ -557,7 +551,7 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/sunos-x64@0.17.19: @@ -575,7 +569,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/win32-arm64@0.17.19: @@ -593,7 +587,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/win32-ia32@0.17.19: @@ -611,7 +605,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: false + dev: true optional: true /@esbuild/win32-x64@0.17.19: @@ -629,7 +623,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: false + dev: true optional: true /@jridgewell/gen-mapping@0.3.3: @@ -684,112 +678,137 @@ packages: rollup: 3.27.0 dev: true + /@tsconfig/node18@18.2.1: + resolution: {integrity: sha512-RDDZFuofwkcKpl8Vpj5wFbY+H53xOtqK7ckEL1sXsbPwvKwDdjQf3LkHbtt9sxIHn9nWIEwkmCwBRZ6z5TKU2A==} + dev: true + /@types/body-parser@1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 18.17.1 - dev: true + '@types/node': 18.17.11 + dev: false /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.17.1 - dev: true + '@types/node': 18.17.11 + dev: false /@types/estree@1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: true - /@types/express-serve-static-core@4.17.33: - resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} + /@types/express-serve-static-core@4.17.36: + resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==} dependencies: - '@types/node': 18.17.1 + '@types/node': 18.17.11 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 - dev: true + '@types/send': 0.17.1 + dev: false /@types/express@4.17.17: resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==} dependencies: '@types/body-parser': 1.19.2 - '@types/express-serve-static-core': 4.17.33 + '@types/express-serve-static-core': 4.17.36 '@types/qs': 6.9.7 - '@types/serve-static': 1.15.1 - dev: true + '@types/serve-static': 1.15.2 + dev: false + + /@types/http-errors@2.0.1: + resolution: {integrity: sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==} + dev: false + + /@types/mime@1.3.2: + resolution: {integrity: sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==} + dev: false /@types/mime@3.0.1: resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} - dev: true + dev: false /@types/node@18.17.1: resolution: {integrity: sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw==} + dev: true + + /@types/node@18.17.11: + resolution: {integrity: sha512-r3hjHPBu+3LzbGBa8DHnr/KAeTEEOrahkcL+cZc4MaBMTM+mk8LtXR+zw+nqfjuDZZzYTYgTcpHuP+BEQk069g==} /@types/qs@6.9.7: resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} - dev: true + dev: false /@types/range-parser@1.2.4: resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} - dev: true + dev: false - /@types/serve-static@1.15.1: - resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} + /@types/send@0.17.1: + resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} dependencies: + '@types/mime': 1.3.2 + '@types/node': 18.17.11 + dev: false + + /@types/serve-static@1.15.2: + resolution: {integrity: sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==} + dependencies: + '@types/http-errors': 2.0.1 '@types/mime': 3.0.1 - '@types/node': 18.17.1 - dev: true + '@types/node': 18.17.11 + dev: false - /@unhead/dom@1.1.27: - resolution: {integrity: sha512-sUrzpKIVvFp8TFx1mgp5t0k5ts1+KmgjMgRRuvRTZMBMVeGQRLSuL3uo34iwuFmKxeI6BXT5lVBk5H02c1XdGg==} + /@unhead/dom@1.3.7: + resolution: {integrity: sha512-utDjimElXvPrpArysKbrUFWacF4exwXB5tOZ9H3SUJOJxIPtz4GZZgkPTPv+UHV9Z+21MP/a6dFldc5j9EAO4A==} dependencies: - '@unhead/schema': 1.1.27 - '@unhead/shared': 1.1.27 + '@unhead/schema': 1.3.7 + '@unhead/shared': 1.3.7 - /@unhead/schema@1.1.27: - resolution: {integrity: sha512-S+xhPoBxBXDrsW9ltcF9Cv3cntMbSx+dfSmE7RNyDhogqHd3+lDEV2dnQpHKWTGjujwwMCALV5SADunAn785bw==} + /@unhead/schema@1.3.7: + resolution: {integrity: sha512-C0+wA2ZZl4d2Aj0z3mFoDKDTv/22z0Tu5giXj+T+iEmfAir9k6kH2UrrCDMkHUP/mRnBSEg1URBrFq2al34VKg==} dependencies: hookable: 5.5.3 - zhead: 2.0.4 + zhead: 2.0.10 - /@unhead/schema@1.1.35: - resolution: {integrity: sha512-hB1uHbK38+WoZn2PHRl0eJJ2Lip374+eHHxUbHY4rFQeL4mTgxAFL0KltpMZr5Eo7ZMV/zNL7LZ89KBd9L43Zg==} + /@unhead/schema@1.3.9: + resolution: {integrity: sha512-iIa0dczd2qTOxwYZbVR+iAKdlELnLTlKSFsN/YuJ/33sRi5VFa9D8TDBEPLec9gpcjB/bH0FhERfR4bb4UbRuA==} dependencies: hookable: 5.5.3 zhead: 2.0.10 - /@unhead/shared@1.1.27: - resolution: {integrity: sha512-ElZ5WcMnhVlg44OAwTNq4XBkNePcL/BHZk7WKFcqpeGTJrEvSfs40lGJoo4sMsgDAd+XQdhJDd4dJu48jQB3kg==} + /@unhead/shared@1.3.7: + resolution: {integrity: sha512-73bs2B5wCMCr+X81qbEVPwFd/7pN8SXSgsSSwq9KkhmB+hC3bipiDST+Fe1h7F80lZ4iu9EwjrNxNlXw+tLjsw==} dependencies: - '@unhead/schema': 1.1.27 + '@unhead/schema': 1.3.7 - /@unhead/ssr@1.1.27: - resolution: {integrity: sha512-lKXH2ofs8L+yAbHgkRP17bIQ45XaG2RSl5UCMsSIW2Ev4kiTGPbbcQKOBgsi2uEllgdMk5peKDyaWD9xheYlEA==} + /@unhead/ssr@1.3.7: + resolution: {integrity: sha512-6FNA2h4AA3I52YQUJ7JqAi0JmixFTa/hM9UWoLDGu9FpFJKiQfRX4s1bm8RPaLC+HTR/GhGdUcwkT4gxU54SLg==} dependencies: - '@unhead/schema': 1.1.27 - '@unhead/shared': 1.1.27 + '@unhead/schema': 1.3.7 + '@unhead/shared': 1.3.7 - /@unhead/vue@1.1.27(vue@3.3.4): - resolution: {integrity: sha512-ibe7/QW4ZtyCI/et/fI3CnwC+oxqp+7LrhmuLUS93ib1Sl70D51dcAy9eAvh0MG7wWUyMUrf3T95MRifJo7uzA==} + /@unhead/vue@1.3.7(vue@3.3.4): + resolution: {integrity: sha512-ekvE592mAJxwoscCt/6Z2gwXHb4IzWIUsy/vcBXd/aEo0bOPww9qObCyS3/GxhknRdItDhJOwfO9CId+bSRG8Q==} peerDependencies: vue: '>=2.7 || >=3' dependencies: - '@unhead/schema': 1.1.27 - '@unhead/shared': 1.1.27 + '@unhead/schema': 1.3.7 + '@unhead/shared': 1.3.7 hookable: 5.5.3 - unhead: 1.1.27 + unhead: 1.3.7 vue: 3.3.4 - /@vitejs/plugin-vue@4.2.3(vite@4.4.7)(vue@3.3.4): + /@vitejs/plugin-vue@4.2.3(vite@4.4.9)(vue@3.3.4): resolution: {integrity: sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.4.7(@types/node@18.17.1) + vite: 4.4.9(@types/node@18.17.11) vue: 3.3.4 - dev: false + dev: true /@vue/compiler-core@3.3.4: resolution: {integrity: sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==} @@ -867,51 +886,21 @@ packages: /@vue/shared@3.3.4: resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==} - /@vue/tsconfig@0.1.3(@types/node@18.17.1): - resolution: {integrity: sha512-kQVsh8yyWPvHpb8gIc9l/HIDiiVUy1amynLNpCy8p+FoCiZXCo6fQos5/097MmnNZc9AtseDsCrfkhqCrJ8Olg==} - peerDependencies: - '@types/node': '*' - peerDependenciesMeta: - '@types/node': - optional: true - dependencies: - '@types/node': 18.17.1 + /@vue/tsconfig@0.4.0: + resolution: {integrity: sha512-CPuIReonid9+zOG/CGTT05FXrPYATEqoDGNrEaqS4hwcw5BUNM2FguC0mOwJD4Jr16UpRVl9N0pY3P+srIbqmg==} dev: true - /@vueuse/head@1.1.26(vue@3.3.4): - resolution: {integrity: sha512-VUrqvcxKtxt2moKtUa7R/KscnDsNYj5u7HFULLsr84VhWsztzBedxW/8Wh/kTz2+/eMf5gC1KtkZBTFQYOmauQ==} + /@vueuse/head@1.3.1(vue@3.3.4): + resolution: {integrity: sha512-XCcHGfDzkGlHS7KIPJVYN//L7jpfASLsN7MUE19ndHVQLnPIDxqFLDl7IROsY81PKzawVAUe4OYVWcGixseWxA==} peerDependencies: vue: '>=2.7 || >=3' dependencies: - '@unhead/dom': 1.1.27 - '@unhead/schema': 1.1.35 - '@unhead/ssr': 1.1.27 - '@unhead/vue': 1.1.27(vue@3.3.4) + '@unhead/dom': 1.3.7 + '@unhead/schema': 1.3.9 + '@unhead/ssr': 1.3.7 + '@unhead/vue': 1.3.7(vue@3.3.4) vue: 3.3.4 - /accepts@1.3.8: - resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} - engines: {node: '>= 0.6'} - dependencies: - mime-types: 2.1.35 - negotiator: 0.6.3 - dev: false - - /acorn@8.10.0: - resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: false - - /agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - dev: false - /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -919,110 +908,10 @@ packages: dependencies: color-convert: 1.9.3 - /anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: false - - /array-flatten@1.1.1: - resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} - dev: false - - /assert@2.0.0: - resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==} - dependencies: - es6-object-assign: 1.1.0 - is-nan: 1.3.2 - object-is: 1.1.5 - util: 0.12.5 - dev: false - - /ast-types@0.16.1: - resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==} - engines: {node: '>=4'} - dependencies: - tslib: 2.6.1 - dev: false - - /available-typed-arrays@1.0.5: - resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} - engines: {node: '>= 0.4'} - dev: false - - /binary-extensions@2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: false - - /body-parser@1.20.1: - resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dependencies: - bytes: 3.1.2 - content-type: 1.0.5 - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - on-finished: 2.4.1 - qs: 6.11.0 - raw-body: 2.5.1 - type-is: 1.6.18 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: false - /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} dev: false - /braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - dependencies: - fill-range: 7.0.1 - dev: false - - /bytes@3.0.0: - resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==} - engines: {node: '>= 0.8'} - dev: false - - /bytes@3.1.2: - resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} - engines: {node: '>= 0.8'} - dev: false - - /c12@1.4.2: - resolution: {integrity: sha512-3IP/MuamSVRVw8W8+CHWAz9gKN4gd+voF2zm/Ln6D25C2RhytEZ1ABbC8MjKr4BR9rhoV1JQ7jJA158LDiTkLg==} - dependencies: - chokidar: 3.5.3 - defu: 6.1.2 - dotenv: 16.3.1 - giget: 1.1.2 - jiti: 1.18.2 - mlly: 1.4.0 - ohash: 1.1.2 - pathe: 1.1.1 - perfect-debounce: 1.0.0 - pkg-types: 1.0.3 - rc9: 2.1.1 - transitivePeerDependencies: - - supports-color - dev: false - - /call-bind@1.0.2: - resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} - dependencies: - function-bind: 1.1.1 - get-intrinsic: 1.2.0 - dev: false - /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -1056,26 +945,6 @@ packages: parse5-htmlparser2-tree-adapter: 7.0.0 dev: false - /chokidar@3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.2 - dev: false - - /chownr@2.0.0: - resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} - engines: {node: '>=10'} - dev: false - /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} requiresBuild: true @@ -1086,44 +955,6 @@ packages: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} requiresBuild: true - /colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - dev: false - - /compressible@2.0.18: - resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: false - - /compression@1.7.4: - resolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==} - engines: {node: '>= 0.8.0'} - dependencies: - accepts: 1.3.8 - bytes: 3.0.0 - compressible: 2.0.18 - debug: 2.6.9 - on-headers: 1.0.2 - safe-buffer: 5.1.2 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color - dev: false - - /content-disposition@0.5.4: - resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} - engines: {node: '>= 0.6'} - dependencies: - safe-buffer: 5.2.1 - dev: false - - /content-type@1.0.5: - resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} - engines: {node: '>= 0.6'} - dev: false - /cookie-parser@1.4.6: resolution: {integrity: sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA==} engines: {node: '>= 0.8.0'} @@ -1141,11 +972,6 @@ packages: engines: {node: '>= 0.6'} dev: false - /cookie@0.5.0: - resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} - engines: {node: '>= 0.6'} - dev: false - /css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} dependencies: @@ -1164,17 +990,6 @@ packages: /csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} - /debug@2.6.9: - resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.0.0 - dev: false - /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -1186,32 +1001,6 @@ packages: dependencies: ms: 2.1.2 - /define-properties@1.2.0: - resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} - engines: {node: '>= 0.4'} - dependencies: - has-property-descriptors: 1.0.0 - object-keys: 1.1.1 - dev: false - - /defu@6.1.2: - resolution: {integrity: sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==} - dev: false - - /depd@2.0.0: - resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} - engines: {node: '>= 0.8'} - dev: false - - /destr@2.0.0: - resolution: {integrity: sha512-FJ9RDpf3GicEBvzI3jxc2XhHzbqD8p4ANw/1kPsFBfTvP1b7Gn/Lg1vO7R9J4IVgoMbyUmFrFGZafJ1hPZpvlg==} - dev: false - - /destroy@1.2.0: - resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} - engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} - dev: false - /dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} dependencies: @@ -1239,20 +1028,6 @@ packages: domhandler: 5.0.3 dev: false - /dotenv@16.3.1: - resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} - engines: {node: '>=12'} - dev: false - - /ee-first@1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - dev: false - - /encodeurl@1.0.2: - resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} - engines: {node: '>= 0.8'} - dev: false - /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -1262,10 +1037,6 @@ packages: resolution: {integrity: sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==} dev: true - /es6-object-assign@1.1.0: - resolution: {integrity: sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==} - dev: false - /esbuild@0.17.19: resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} engines: {node: '>=12'} @@ -1324,170 +1095,27 @@ packages: '@esbuild/win32-arm64': 0.18.17 '@esbuild/win32-ia32': 0.18.17 '@esbuild/win32-x64': 0.18.17 - dev: false - - /escape-html@1.0.3: - resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - dev: false + dev: true /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} requiresBuild: true - /esprima@4.0.1: - resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} - engines: {node: '>=4'} - hasBin: true - dev: false - /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - /etag@1.8.1: - resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} - engines: {node: '>= 0.6'} - dev: false - - /express@4.18.2: - resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} - engines: {node: '>= 0.10.0'} - dependencies: - accepts: 1.3.8 - array-flatten: 1.1.1 - body-parser: 1.20.1 - content-disposition: 0.5.4 - content-type: 1.0.5 - cookie: 0.5.0 - cookie-signature: 1.0.6 - debug: 2.6.9 - depd: 2.0.0 - encodeurl: 1.0.2 - escape-html: 1.0.3 - etag: 1.8.1 - finalhandler: 1.2.0 - fresh: 0.5.2 - http-errors: 2.0.0 - merge-descriptors: 1.0.1 - methods: 1.1.2 - on-finished: 2.4.1 - parseurl: 1.3.3 - path-to-regexp: 0.1.7 - proxy-addr: 2.0.7 - qs: 6.11.0 - range-parser: 1.2.1 - safe-buffer: 5.2.1 - send: 0.18.0 - serve-static: 1.15.0 - setprototypeof: 1.2.0 - statuses: 2.0.1 - type-is: 1.6.18 - utils-merge: 1.0.1 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color - dev: false - - /fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - dependencies: - to-regex-range: 5.0.1 - dev: false - - /finalhandler@1.2.0: - resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} - engines: {node: '>= 0.8'} - dependencies: - debug: 2.6.9 - encodeurl: 1.0.2 - escape-html: 1.0.3 - on-finished: 2.4.1 - parseurl: 1.3.3 - statuses: 2.0.1 - unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: false - - /flat@5.0.2: - resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} - hasBin: true - dev: false - - /for-each@0.3.3: - resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} - dependencies: - is-callable: 1.2.7 - dev: false - - /forwarded@0.2.0: - resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} - engines: {node: '>= 0.6'} - dev: false - - /fresh@0.5.2: - resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} - engines: {node: '>= 0.6'} - dev: false - - /fs-minipass@2.1.0: - resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==} - engines: {node: '>= 8'} - dependencies: - minipass: 3.3.6 - dev: false - /fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true + dev: true optional: true - /function-bind@1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: false - - /get-intrinsic@1.2.0: - resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} - dependencies: - function-bind: 1.1.1 - has: 1.0.3 - has-symbols: 1.0.3 - dev: false - - /giget@1.1.2: - resolution: {integrity: sha512-HsLoS07HiQ5oqvObOI+Qb2tyZH4Gj5nYGfF9qQcZNrPw+uEFhdXtgJr01aO2pWadGHucajYDLxxbtQkm97ON2A==} - hasBin: true - dependencies: - colorette: 2.0.20 - defu: 6.1.2 - https-proxy-agent: 5.0.1 - mri: 1.2.0 - node-fetch-native: 1.1.0 - pathe: 1.1.1 - tar: 6.1.13 - transitivePeerDependencies: - - supports-color - dev: false - - /glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - dependencies: - is-glob: 4.0.3 - dev: false - - /globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - dev: false - - /gopd@1.0.1: - resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} - dependencies: - get-intrinsic: 1.2.0 + /globals@11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} dev: false /has-flag@3.0.0: @@ -1495,31 +1123,6 @@ packages: engines: {node: '>=4'} requiresBuild: true - /has-property-descriptors@1.0.0: - resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} - dependencies: - get-intrinsic: 1.2.0 - dev: false - - /has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - dev: false - - /has-tostringtag@1.0.0: - resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} - engines: {node: '>= 0.4'} - dependencies: - has-symbols: 1.0.3 - dev: false - - /has@1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} - dependencies: - function-bind: 1.1.1 - dev: false - /hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -1532,107 +1135,6 @@ packages: entities: 4.5.0 dev: false - /http-errors@2.0.0: - resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} - engines: {node: '>= 0.8'} - dependencies: - depd: 2.0.0 - inherits: 2.0.4 - setprototypeof: 1.2.0 - statuses: 2.0.1 - toidentifier: 1.0.1 - dev: false - - /https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - dependencies: - agent-base: 6.0.2 - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - dev: false - - /iconv-lite@0.4.24: - resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} - engines: {node: '>=0.10.0'} - dependencies: - safer-buffer: 2.1.2 - dev: false - - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: false - - /ipaddr.js@1.9.1: - resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} - engines: {node: '>= 0.10'} - dev: false - - /is-arguments@1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - dev: false - - /is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - dependencies: - binary-extensions: 2.2.0 - dev: false - - /is-callable@1.2.7: - resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} - engines: {node: '>= 0.4'} - dev: false - - /is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - dev: false - - /is-generator-function@1.0.10: - resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: false - - /is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - dependencies: - is-extglob: 2.1.1 - dev: false - - /is-nan@1.3.2: - resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - dev: false - - /is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - dev: false - - /is-typed-array@1.1.12: - resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} - engines: {node: '>= 0.4'} - dependencies: - which-typed-array: 1.1.11 - dev: false - - /jiti@1.18.2: - resolution: {integrity: sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==} - hasBin: true - dev: false - /joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} @@ -1650,6 +1152,7 @@ packages: /jsonc-parser@3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + dev: true /magic-string@0.30.0: resolution: {integrity: sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==} @@ -1664,155 +1167,20 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /magicast@0.2.10: - resolution: {integrity: sha512-Ah2qatigknxwmoYCd9hx/mmVyrRNhDKiaWZIuW4gL6dWrAGMoOpCVkQ3VpGWARtkaJVFhe8uIphcsxDzLPQUyg==} - dependencies: - '@babel/parser': 7.22.7 - '@babel/types': 7.22.5 - recast: 0.23.3 - dev: false - - /media-typer@0.3.0: - resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} - engines: {node: '>= 0.6'} - dev: false - - /merge-descriptors@1.0.1: - resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} - dev: false - - /methods@1.1.2: - resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} - engines: {node: '>= 0.6'} - dev: false - - /mime-db@1.52.0: - resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} - engines: {node: '>= 0.6'} - dev: false - - /mime-types@2.1.35: - resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} - engines: {node: '>= 0.6'} - dependencies: - mime-db: 1.52.0 - dev: false - - /mime@1.6.0: - resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} - engines: {node: '>=4'} - hasBin: true - dev: false - - /minipass@3.3.6: - resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} - engines: {node: '>=8'} - dependencies: - yallist: 4.0.0 - dev: false - - /minipass@4.2.8: - resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==} - engines: {node: '>=8'} - dev: false - - /minizlib@2.1.2: - resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==} - engines: {node: '>= 8'} - dependencies: - minipass: 3.3.6 - yallist: 4.0.0 - dev: false - - /mkdirp@1.0.4: - resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==} - engines: {node: '>=10'} - hasBin: true - dev: false - - /mlly@1.4.0: - resolution: {integrity: sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==} - dependencies: - acorn: 8.10.0 - pathe: 1.1.1 - pkg-types: 1.0.3 - ufo: 1.2.0 - dev: false - - /mri@1.2.0: - resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} - engines: {node: '>=4'} - dev: false - - /ms@2.0.0: - resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} - dev: false - /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - /ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: false - /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - /negotiator@0.6.3: - resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} - engines: {node: '>= 0.6'} - dev: false - - /node-fetch-native@1.1.0: - resolution: {integrity: sha512-nl5goFCig93JZ9FIV8GHT9xpNqXbxQUzkOmKIMKmncsBH9jhg7qKex8hirpymkBFmNQ114chEEG5lS4wgK2I+Q==} - dev: false - - /normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - dev: false - /nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} dependencies: boolbase: 1.0.0 dev: false - /object-inspect@1.12.3: - resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} - dev: false - - /object-is@1.1.5: - resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - dev: false - - /object-keys@1.1.1: - resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} - engines: {node: '>= 0.4'} - dev: false - - /ohash@1.1.2: - resolution: {integrity: sha512-9CIOSq5945rI045GFtcO3uudyOkYVY1nyfFxVQp+9BRgslr8jPNiSSrsFGg/BNTUFOLqx0P5tng6G32brIPw0w==} - dev: false - - /on-finished@2.4.1: - resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} - engines: {node: '>= 0.8'} - dependencies: - ee-first: 1.1.1 - dev: false - - /on-headers@1.0.2: - resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==} - engines: {node: '>= 0.8'} - dev: false - /parse5-htmlparser2-tree-adapter@7.0.0: resolution: {integrity: sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==} dependencies: @@ -1826,31 +1194,15 @@ packages: entities: 4.5.0 dev: false - /parseurl@1.3.3: - resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} - engines: {node: '>= 0.8'} - dev: false - - /path-to-regexp@0.1.7: - resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} - dev: false - - /pathe@1.1.1: - resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} - dev: false - - /perfect-debounce@1.0.0: - resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - dev: false - /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + dev: true - /pinia@2.1.6(typescript@4.9.5)(vue@3.3.4): + /pinia@2.1.6(typescript@5.1.6)(vue@3.3.4): resolution: {integrity: sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==} peerDependencies: '@vue/composition-api': ^1.4.0 @@ -1863,18 +1215,9 @@ packages: optional: true dependencies: '@vue/devtools-api': 6.5.0 - typescript: 4.9.5 + typescript: 5.1.6 vue: 3.3.4 vue-demi: 0.14.5(vue@3.3.4) - dev: false - - /pkg-types@1.0.3: - resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} - dependencies: - jsonc-parser: 3.2.0 - mlly: 1.4.0 - pathe: 1.1.1 - dev: false /postcss@8.4.27: resolution: {integrity: sha512-gY/ACJtJPSmUFPDCHtX78+01fHa64FaU4zaaWfuh1MhGJISufJAH4cun6k/8fwsHYeK4UQmENQK+tRLCFJE8JQ==} @@ -1884,62 +1227,6 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /proxy-addr@2.0.7: - resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} - engines: {node: '>= 0.10'} - dependencies: - forwarded: 0.2.0 - ipaddr.js: 1.9.1 - dev: false - - /qs@6.11.0: - resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} - engines: {node: '>=0.6'} - dependencies: - side-channel: 1.0.4 - dev: false - - /range-parser@1.2.1: - resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} - engines: {node: '>= 0.6'} - dev: false - - /raw-body@2.5.1: - resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} - engines: {node: '>= 0.8'} - dependencies: - bytes: 3.1.2 - http-errors: 2.0.0 - iconv-lite: 0.4.24 - unpipe: 1.0.0 - dev: false - - /rc9@2.1.1: - resolution: {integrity: sha512-lNeOl38Ws0eNxpO3+wD1I9rkHGQyj1NU1jlzv4go2CtEnEQEUfqnIvZG7W+bC/aXdJ27n5x/yUjb6RoT9tko+Q==} - dependencies: - defu: 6.1.2 - destr: 2.0.0 - flat: 5.0.2 - dev: false - - /readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - dependencies: - picomatch: 2.3.1 - dev: false - - /recast@0.23.3: - resolution: {integrity: sha512-HbCVFh2ANP6a09nzD4lx7XthsxMOJWKX5pIcUwtLrmeEIl3I0DwjCoVXDE0Aobk+7k/mS3H50FK4iuYArpcT6Q==} - engines: {node: '>= 4'} - dependencies: - assert: 2.0.0 - ast-types: 0.16.1 - esprima: 4.0.1 - source-map: 0.6.1 - tslib: 2.6.1 - dev: false - /rollup-plugin-dts@5.3.1(rollup@3.27.0)(typescript@5.1.6): resolution: {integrity: sha512-gusMi+Z4gY/JaEQeXnB0RUdU82h1kF0WYzCWgVmV4p3hWXqelaKuCvcJawfeg+EKn2T1Ie+YWF2OiN1/L8bTVg==} engines: {node: '>=v14.21.3'} @@ -1978,78 +1265,20 @@ packages: hasBin: true optionalDependencies: fsevents: 2.3.2 + dev: true - /safe-buffer@5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - dev: false - - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: false - - /safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: false - - /send@0.18.0: - resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} - engines: {node: '>= 0.8.0'} - dependencies: - debug: 2.6.9 - depd: 2.0.0 - destroy: 1.2.0 - encodeurl: 1.0.2 - escape-html: 1.0.3 - etag: 1.8.1 - fresh: 0.5.2 - http-errors: 2.0.0 - mime: 1.6.0 - ms: 2.1.3 - on-finished: 2.4.1 - range-parser: 1.2.1 - statuses: 2.0.1 - transitivePeerDependencies: - - supports-color - dev: false - - /serve-static@1.15.0: - resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} - engines: {node: '>= 0.8.0'} - dependencies: - encodeurl: 1.0.2 - escape-html: 1.0.3 - parseurl: 1.3.3 - send: 0.18.0 - transitivePeerDependencies: - - supports-color - dev: false - - /setprototypeof@1.2.0: - resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} - dev: false - - /side-channel@1.0.4: - resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} - dependencies: - call-bind: 1.0.2 - get-intrinsic: 1.2.0 - object-inspect: 1.12.3 - dev: false + /rollup@3.28.1: + resolution: {integrity: sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} - /source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - dev: false - - /statuses@2.0.1: - resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} - engines: {node: '>= 0.8'} - dev: false - /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -2057,96 +1286,61 @@ packages: dependencies: has-flag: 3.0.0 - /tar@6.1.13: - resolution: {integrity: sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==} - engines: {node: '>=10'} - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 4.2.8 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - dev: false - /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} - /to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - dependencies: - is-number: 7.0.0 - dev: false - - /toidentifier@1.0.1: - resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} - engines: {node: '>=0.6'} - dev: false - - /tslib@2.6.1: - resolution: {integrity: sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==} - dev: false - - /type-is@1.6.18: - resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} - engines: {node: '>= 0.6'} - dependencies: - media-typer: 0.3.0 - mime-types: 2.1.35 - dev: false - - /typescript@4.9.5: - resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} - engines: {node: '>=4.2.0'} - hasBin: true - /typescript@5.1.6: resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} engines: {node: '>=14.17'} hasBin: true - dev: true - /ufo@1.2.0: - resolution: {integrity: sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==} - dev: false - - /unhead@1.1.27: - resolution: {integrity: sha512-KnE4xeV/mZLxnXG1VAp1nsaO2vzMq9Ch5uN4Y2SJAG4fXLEBi/A8evr3Vd81c+oAwQZjDXKFW60HDCJCkwo/Cw==} + /unhead@1.3.7: + resolution: {integrity: sha512-XRkDIaIK325UyKwSqV6fDbFKJ4HYuT5mCEnIhUqNBtUYv6b7jdXzYTfUiZSb1ciJyTqvzRHFWDtmGtJo1L375Q==} dependencies: - '@unhead/dom': 1.1.27 - '@unhead/schema': 1.1.27 - '@unhead/shared': 1.1.27 + '@unhead/dom': 1.3.7 + '@unhead/schema': 1.3.7 + '@unhead/shared': 1.3.7 hookable: 5.5.3 - /unpipe@1.0.0: - resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} - engines: {node: '>= 0.8'} - dev: false - - /util@0.12.5: - resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + /vite@4.4.9(@types/node@18.17.1): + resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true dependencies: - inherits: 2.0.4 - is-arguments: 1.1.1 - is-generator-function: 1.0.10 - is-typed-array: 1.1.12 - which-typed-array: 1.1.11 - dev: false - - /utils-merge@1.0.1: - resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} - engines: {node: '>= 0.4.0'} - dev: false - - /vary@1.1.2: - resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} - engines: {node: '>= 0.8'} - dev: false + '@types/node': 18.17.1 + esbuild: 0.18.17 + postcss: 8.4.27 + rollup: 3.28.1 + optionalDependencies: + fsevents: 2.3.2 + dev: true - /vite@4.4.7(@types/node@18.17.1): - resolution: {integrity: sha512-6pYf9QJ1mHylfVh39HpuSfMPojPSKVxZvnclX1K1FyZ1PXDOcLBibdq5t1qxJSnL63ca8Wf4zts6mD8u8oc9Fw==} + /vite@4.4.9(@types/node@18.17.11): + resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -2173,13 +1367,13 @@ packages: terser: optional: true dependencies: - '@types/node': 18.17.1 + '@types/node': 18.17.11 esbuild: 0.18.17 postcss: 8.4.27 - rollup: 3.27.0 + rollup: 3.28.1 optionalDependencies: fsevents: 2.3.2 - dev: false + dev: true /vue-demi@0.14.5(vue@3.3.4): resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} @@ -2194,7 +1388,6 @@ packages: optional: true dependencies: vue: 3.3.4 - dev: false /vue-router@4.2.4(vue@3.3.4): resolution: {integrity: sha512-9PISkmaCO02OzPVOMq2w82ilty6+xJmQrarYZDkjZBfl4RvYAlt4PKnEX21oW4KTtWfa9OuO/b3qk1Od3AEdCQ==} @@ -2213,23 +1406,5 @@ packages: '@vue/server-renderer': 3.3.4(vue@3.3.4) '@vue/shared': 3.3.4 - /which-typed-array@1.1.11: - resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 - dev: false - - /yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: false - /zhead@2.0.10: resolution: {integrity: sha512-irug8fXNKjqazkA27cFQs7C6/ZD3qNiEzLC56kDyzQART/Z9GMGfg8h2i6fb9c8ZWnIx/QgOgFJxK3A/CYHG0g==} - - /zhead@2.0.4: - resolution: {integrity: sha512-V4R94t3ifk9AURym6OskbKcnowzgp5Z88tkoL/NF67vyryNxC62u6mx5F1Ux4oh4+YN7FFmKYEyWy6m5kfPH6g==} diff --git a/rollup.config.mjs b/rollup.config.mjs index 36a9be4..52b8ed5 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -14,33 +14,41 @@ export default [ ], }, { - input: 'src/cli.ts', + input: 'src/index.ts', output: { + file: 'dist/index.d.ts', format: 'es', - file: `dist/cli.js`, }, plugins: [ - esbuild(), + dts({ + compilerOptions: { + preserveSymlinks: false + } + }), ], }, { - input: 'src/vue/index.ts', - external: ['vue', 'vue/server-renderer', 'vue-router'], + input: 'src/plugin/index.ts', + external: [ + 'vue', + 'vue-router', + '@vueuse/head', + 'vue/server-renderer', + 'cheerio', + '@nuxt/devalue', + ], output: { format: 'es', - dir: `dist/vue`, - chunkFileNames(chunkInfo) { - return `${chunkInfo.name}.js` - } + dir: 'dist/plugin', }, plugins: [ esbuild(), ], }, { - input: 'src/index.ts', + input: 'src/plugin/index.ts', output: { - file: 'dist/index.d.ts', + file: 'dist/plugin/index.d.ts', format: 'es', }, plugins: [ @@ -50,5 +58,16 @@ export default [ } }), ], - } + }, + // { + // input: 'src/plugin/vue.ts', + // external: ['vue', 'vue-router', '@vueuse/head'], + // output: { + // file: 'dist/plugin/vue.js', + // format: 'es', + // }, + // plugins: [ + // esbuild(), + // ], + // }, ] diff --git a/src/vue/ClientOnly.ts b/src/ClientOnly.ts similarity index 100% rename from src/vue/ClientOnly.ts rename to src/ClientOnly.ts diff --git a/src/cli.ts b/src/cli.ts deleted file mode 100644 index 3324610..0000000 --- a/src/cli.ts +++ /dev/null @@ -1,29 +0,0 @@ -import mri from 'mri' -import { loadConfig } from 'c12' -import { argv } from 'node:process' -import { VueSsrConfig } from './types' -import { dev } from './node/dev' -import { build } from './node/build' -import { start } from './node/start' - -const args = mri(argv.slice(2)); -const command = args._[0]; - -const { host, port, config: c, ssr } = args - -const { config } = await loadConfig({ configFile: c ?? 'vue-ssr.config.ts' }) - -if (command === 'build') { - await build(config?.vite, ssr !== undefined ? /^true$/i.test(ssr) : config?.ssr ?? true) -} else if (command === 'start') { - await start( - port ?? config?.port ?? 5173, - host ?? config?.hostname ?? 'localhost' - ) -} else { - await dev({ - port: port ?? config?.port ?? 5173, - hostname: host ?? config?.hostname ?? 'localhost', - viteConfig: config?.vite, - }) -} diff --git a/src/index.ts b/src/index.ts index 7263c7d..83d432e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,24 +1,4 @@ -import { type Component } from 'vue' -import { type CallbackFn, type VueSsrConfig } from './types' -import { type RouterScrollBehavior, type RouteRecordRaw } from 'vue-router' -import { type Head } from '@unhead/schema' -import { ClientOnly } from './vue/ClientOnly' +import { ClientOnly } from './ClientOnly' +import { vueSSR } from './plugin/vue' -export function defineConfig(config: VueSsrConfig) { - return config -} - -export function vueSSR( - App: Component, - { routes, head, scrollBehavior }: { routes: RouteRecordRaw[], head?: Head, scrollBehavior?: RouterScrollBehavior }, - cb?: CallbackFn) -{ - return { - App, - routes, - head, - scrollBehavior, - cb, - } -} -export { VueSsrConfig, ClientOnly } +export { ClientOnly, vueSSR } diff --git a/src/node/build.ts b/src/node/build.ts deleted file mode 100644 index 26eddbd..0000000 --- a/src/node/build.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { type UserConfig, build as _build, mergeConfig } from 'vite' -import vue from '@vitejs/plugin-vue' -import { cwd } from 'node:process' -import { join, dirname } from 'node:path' -import { fileURLToPath } from 'node:url' -import { vueSsrPlugin } from '../vue/plugin' - -const __dirname = dirname(fileURLToPath(import.meta.url)) - -export async function build(viteConfig?: UserConfig, ssr: boolean = true) { - const base = '/' - - const plugins = [vue()] - - const define = { - '__SSR_APP__': ssr, - } - - if (ssr) { - await _build(mergeConfig({ - base, - build: { - ssr: true, - outDir: 'dist/server', - rollupOptions: { - input: [ - join(__dirname, 'vue/index.js'), - join(cwd(), 'src/main.ts'), - ], - output: { - dir: 'dist/server', - }, - }, - }, - plugins: [...plugins], - define, - }, viteConfig ?? {})) - } - - await _build(mergeConfig({ - base, - build: { - ssrManifest: ssr, - outDir: ssr ? 'dist/client' : 'dist', - }, - plugins: [...plugins, vueSsrPlugin()], - define, - }, viteConfig ?? {})) -} diff --git a/src/node/dev.ts b/src/node/dev.ts deleted file mode 100644 index 77bec54..0000000 --- a/src/node/dev.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { readFileSync } from 'node:fs' -import { fileURLToPath } from 'node:url' -import { cwd } from 'node:process' -import { join, dirname, resolve } from 'node:path' -import express from 'express' -import vue from '@vitejs/plugin-vue' -import { type UserConfig, mergeConfig, createServer } from 'vite' -import devalue from '@nuxt/devalue' -import { type HeadTag } from '@vueuse/head' -import cookieParser from 'cookie-parser' -import { load } from 'cheerio' -import { vueSsrPlugin } from '../vue/plugin' - -const __dirname = dirname(fileURLToPath(import.meta.url)) - -export async function dev({ port, hostname, viteConfig: viteConfig }: { port: number, hostname: string, viteConfig?: UserConfig }) { - const manifest = {} - - const vite = await createServer(mergeConfig({ - base: '/', - root: cwd(), - logLevel: 'info', - plugins: [vue(), vueSsrPlugin()], - server: { - middlewareMode: true, - }, - appType: 'custom', - define: { - __SSR_APP__: true, - }, - }, viteConfig ?? {})) - - const app = express() - - app.use(vite.middlewares) - app.use(cookieParser()) - app.use('*', async (req, res) => { - try { - const url = req.originalUrl - - let template = readFileSync(join(cwd(), 'index.html'), 'utf-8') - template = await vite.transformIndexHtml(url, template) - - const generateApp = (await vite.ssrLoadModule(resolve(__dirname, 'vue/index.js'))).generateApp - - const [appHtml, preloadLinks, state, head, teleports, redirect] = await generateApp(url, manifest, req, res, true) - - if (redirect !== null) { - res.redirect(redirect) - return - } - - const $ = load(template) - - const resolvedTags = await head.resolveTags() as HeadTag[] - - let tags = ['title', 'meta', 'link', 'base', 'style', 'script', 'noscript'] - - if ($('title').length === 1) { - tags = tags.filter(t => t !== 'title') - const title = resolvedTags.find(t => t.tag === 'title') - - if (title !== undefined) { - // @ts-ignore - $('title').text(title.textContent) - } - } - - tags.map(tag => { - resolvedTags.filter(t => t.tag === tag) - .map(t => { - let props = '' - - for (const [key, value] of Object.entries(t.props)) { - props = `${props} ${key}="${value}"` - } - - if (t.innerHTML !== undefined) { - $('head').append(`<${tag} ${props}>${t.innerHTML}`) - } else { - $('head').append(`<${tag} ${props}>`) - } - }) - }) - - const bodyAttrs = resolvedTags.find(t => t.tag === 'bodyAttrs') - - if (bodyAttrs !== undefined) { - for (const [key, value] of Object.entries(bodyAttrs.props)) { - $('body').attr(key, value) - } - } - - const htmlAttrs = resolvedTags.find(t => t.tag === 'htmlAttrs') - - if (htmlAttrs !== undefined) { - for (const [key, value] of Object.entries(htmlAttrs.props)) { - $('html').attr(key, value) - } - } - - $('head').append(preloadLinks) - $('#app').html(appHtml) - - if (state !== undefined) { - $('body').append(``) - } - - if (teleports['#teleports'] !== undefined) { - $('body').append(`
${teleports['#teleports']}
`) - } - - res.status(200).set({ 'Content-Type': 'text/html' }).end($.html()) - } catch (e) { - vite && vite.ssrFixStacktrace(e) - console.log(e.stack) - res.status(500).end(e.stack) - } - }) - - app.listen(port, hostname, () => { - console.log(`http://${hostname}:${port}`) - }) -} diff --git a/src/node/start.ts b/src/node/start.ts deleted file mode 100644 index 950cdee..0000000 --- a/src/node/start.ts +++ /dev/null @@ -1,101 +0,0 @@ -import fs from 'node:fs' -import { join } from 'node:path' -import { cwd } from 'node:process' -import express from 'express' -import devalue from '@nuxt/devalue' -import cookieParser from 'cookie-parser' -import { load } from 'cheerio' -import { type HeadTag } from '@vueuse/head' - -export async function start(port: number, hostname: string) { - const template = fs.readFileSync(join(cwd(), 'dist/client/index.html'), 'utf-8') - - const manifest = JSON.parse( - fs.readFileSync(join(cwd(), 'dist/client/ssr-manifest.json'), 'utf-8'), - ) - - const app = express() - app.use((await import('compression')).default()) - app.use('/', (await import('serve-static')).default(join(cwd(), 'dist/client'), { - index: false, - })) - app.use(cookieParser()) - app.use('*', async (req, res) => { - const url = req.originalUrl - - const generateApp = (await import(join(cwd(), 'dist/server/index.js'))).generateApp - - const [appHtml, preloadLinks, state, head, teleports, redirect] = await generateApp(url, manifest, req, res) - - if (redirect !== null) { - res.redirect(redirect) - return - } - - const $ = load(template) - - const resolvedTags = await head.resolveTags() as HeadTag[] - - let tags = ['title', 'meta', 'link', 'base', 'style', 'script', 'noscript'] - - if ($('title').length === 1) { - tags = tags.filter(t => t !== 'title') - const title = resolvedTags.find(t => t.tag === 'title') - - if (title !== undefined) { - // @ts-ignore - $('title').text(title.textContent) - } - } - - tags.map(tag => { - resolvedTags.filter(t => t.tag === tag) - .map(t => { - let props = '' - - for (const [key, value] of Object.entries(t.props)) { - props = `${props} ${key}="${value}"` - } - - if (t.innerHTML !== undefined) { - $('head').append(`<${tag} ${props}>${t.innerHTML}`) - } else { - $('head').append(`<${tag} ${props}>`) - } - }) - }) - - const bodyAttrs = resolvedTags.find(t => t.tag === 'bodyAttrs') - - if (bodyAttrs !== undefined) { - for (const [key, value] of Object.entries(bodyAttrs.props)) { - $('body').attr(key, value) - } - } - - const htmlAttrs = resolvedTags.find(t => t.tag === 'htmlAttrs') - - if (htmlAttrs !== undefined) { - for (const [key, value] of Object.entries(htmlAttrs.props)) { - $('html').attr(key, value) - } - } - - $('head').append(preloadLinks) - $('#app').html(appHtml) - - if (state !== undefined) { - $('body').append(``) - } - - if (teleports['#teleports'] !== undefined) { - $('body').append(`
${teleports['#teleports']}
`) - } - - res.status(200).set({ 'Content-Type': 'text/html' }).end($.html()) - }) - - app.listen(port, hostname, () => { - console.log(`http://${hostname}:${port}`) - }) -} diff --git a/src/plugin/index.ts b/src/plugin/index.ts new file mode 100644 index 0000000..f45fc1b --- /dev/null +++ b/src/plugin/index.ts @@ -0,0 +1,222 @@ +// @ts-nocheck +import { readFileSync } from 'node:fs' +import { cwd } from 'node:process' +import { Plugin } from 'vite' +import { SSRContext, renderToString } from 'vue/server-renderer' +import { load } from 'cheerio' +import devalue from '@nuxt/devalue' +import cookieParser from 'cookie-parser' +import { transformEntrypoint } from './transformEntrypoint' +import type { vueSSR as vueSSRFn } from '../index' + +export default function vueSsrPlugin(): Plugin { + let ssr: boolean | string + + const virtualModuleId = 'virtual:ssr-entry-point' + const resolvedVirtualModuleId = '\0' + virtualModuleId + + return { + name: 'vue-ssr', + resolveId(id) { + if (id === virtualModuleId) { + return resolvedVirtualModuleId + } + }, + load(id) { + if (id === resolvedVirtualModuleId) { + return `export function vueSSR(App, { routes, head, scrollBehavior }, cb) { + return { + App, + routes, + head, + scrollBehavior, + cb, + } + }` + } + }, + config(config, { command }) { + ssr = config.build?.ssr + + // serve without config.build.ssr is forced into SSR + // serve with config.build.ssr false is SPA + if (command === 'serve' && ssr === undefined) { + config.build = { + ssr: 'src/main.ts', + } + + ssr = config.build.ssr + } + + config.appType = ssr ? 'custom' : 'spa' + }, + transformIndexHtml() { + if (ssr) return + + return [ + { + tag: 'div', + attrs: { + id: 'teleports', + }, + injectTo: 'body', + } + ] + }, + transform(code, id, options) { + if (id.endsWith('main.ts')) { + return transformEntrypoint(code, options?.ssr ?? false, !!ssr) + } + }, + configureServer(server) { + if (ssr) { + return () => { + server.middlewares.use(cookieParser()) + server.middlewares.use(async (req, res) => { + const url = req.originalUrl + + let template = readFileSync(resolve(cwd(), 'index.html'), 'utf-8') + template = await server.transformIndexHtml(url!, template) + + const { App, routes, cb }: ReturnType = (await server.ssrLoadModule(resolve(cwd(), ssr))).default + + const { vueSSR } = (await import('./vue')) + + const { app, router, state, head } = vueSSR(App, { routes }, undefined, true, true) + + if (cb !== undefined) { + cb({ app, router, state, request: req, response: res }) + } + + await router.push(url!) + await router.isReady() + + let redirect = null + + const ctx: SSRContext = {} + ctx.request = req + ctx.response = res + ctx.redirect = (url: string) => redirect = url + const html = await renderToString(app, ctx) + + const preloadLinks = renderPreloadLinks(ctx.modules, {}) + + if (redirect !== null) { + res.redirect(redirect) + return + } + + const $ = load(template) + + const resolvedTags = await head.resolveTags() as HeadTag[] + + let tags = ['title', 'meta', 'link', 'base', 'style', 'script', 'noscript'] + + if ($('title').length === 1) { + tags = tags.filter(t => t !== 'title') + const title = resolvedTags.find(t => t.tag === 'title') + + if (title !== undefined) { + // @ts-ignore + $('title').text(title.textContent) + } + } + + tags.map(tag => { + resolvedTags.filter(t => t.tag === tag) + .map(t => { + let props = '' + + for (const [key, value] of Object.entries(t.props)) { + props = `${props} ${key}="${value}"` + } + + if (t.innerHTML !== undefined) { + $('head').append(`<${tag} ${props}>${t.innerHTML}`) + } else { + $('head').append(`<${tag} ${props}>`) + } + }) + }) + + const bodyAttrs = resolvedTags.find(t => t.tag === 'bodyAttrs') + + if (bodyAttrs !== undefined) { + for (const [key, value] of Object.entries(bodyAttrs.props)) { + $('body').attr(key, value) + } + } + + const htmlAttrs = resolvedTags.find(t => t.tag === 'htmlAttrs') + + if (htmlAttrs !== undefined) { + for (const [key, value] of Object.entries(htmlAttrs.props)) { + $('html').attr(key, value) + } + } + + if (state !== undefined) { + $('body').append(``) + } + + const teleports = ctx.teleports ?? {} + + if (teleports['#teleports'] !== undefined) { + $('body').append(`
${teleports['#teleports']}
`) + } + + $('head').append(preloadLinks) + $('#app').html(html) + + res.end($.html()) + }) + } + } + }, + } +} + +function renderPreloadLinks(modules, manifest) { + let links = '' + const seen = new Set() + modules.forEach((id) => { + const files = manifest[id] + if (files) { + files.forEach((file) => { + if (!seen.has(file)) { + seen.add(file) + const filename = basename(file) + if (manifest[filename]) { + for (const depFile of manifest[filename]) { + links += renderPreloadLink(depFile) + seen.add(depFile) + } + } + links += renderPreloadLink(file) + } + }) + } + }) + return links +} + +function renderPreloadLink(file) { + if (file.endsWith('.js')) { + return `` + } else if (file.endsWith('.css')) { + return `` + } else if (file.endsWith('.woff')) { + return ` ` + } else if (file.endsWith('.woff2')) { + return ` ` + } else if (file.endsWith('.gif')) { + return ` ` + } else if (file.endsWith('.jpg') || file.endsWith('.jpeg')) { + return ` ` + } else if (file.endsWith('.png')) { + return ` ` + } else { + // TODO + return '' + } +} diff --git a/src/plugin/transformEntrypoint.ts b/src/plugin/transformEntrypoint.ts new file mode 100644 index 0000000..6531f49 --- /dev/null +++ b/src/plugin/transformEntrypoint.ts @@ -0,0 +1,92 @@ +import _traverse from '@babel/traverse' +const traverse = _traverse.default +import { parse } from '@babel/parser' +import _generate from '@babel/generator' +const generate = _generate.default +import t from '@babel/types' + +export function transformEntrypoint(code: string, ssr: boolean, ssrBuild: boolean) { + const ast = parse(code, { sourceType: 'module' }) + + if (ssr) { + traverse(ast, { + ImportDeclaration(path) { + if (path.node.source.value === 'vite-plugin-vue-ssr') { + path.node.source.value = 'virtual:ssr-entry-point' + } + }, + }) + } else { + traverse(ast, { + ExportDefaultDeclaration(path) { + path.replaceWithMultiple( + [ + t.variableDeclaration( + 'const', + [ + t.variableDeclarator( + t.objectPattern([ + t.objectProperty( + t.identifier('app'), + t.identifier('app'), + false, + true + ), + t.objectProperty( + t.identifier('router'), + t.identifier('router'), + false, + true + ) + ]), + t.callExpression( + t.identifier('vueSSR'), + [ ...path.node.declaration.arguments, t.identifier(ssrBuild ? 'true' : 'false') ] + ) + ), + ] + ), + t.expressionStatement( + t.callExpression( + t.memberExpression( + t.callExpression( + t.memberExpression( + t.identifier('router'), + t.identifier('isReady') + ), + [] + ), + t.identifier('then') + ), + [ + t.arrowFunctionExpression( + [], + t.blockStatement( + [ + t.expressionStatement( + t.callExpression( + t.memberExpression( + t.identifier('app'), + t.identifier('mount') + ), + [ + t.stringLiteral('#app') + ] + ) + ), + ] + ) + ) + ] + ) + ) + ] + ) + }, + }) + } + + return { + code: generate(ast).code, + } +} diff --git a/src/plugin/vue.ts b/src/plugin/vue.ts new file mode 100644 index 0000000..cae1624 --- /dev/null +++ b/src/plugin/vue.ts @@ -0,0 +1,46 @@ +import { type Component, createSSRApp, createApp } from 'vue' +import { + createMemoryHistory, + createRouter, + createWebHistory +} from 'vue-router' +import { createHead } from '@vueuse/head' +import type { State, CallbackFn, Params } from '../types' + +export function vueSSR(App: Component, params: Params, cb?: CallbackFn, ssrBuild = false, ssr = false) { + const { routes, head: headDefaults, scrollBehavior } = params + + const state: State = { + value: undefined, + } + + if (!ssr) { + // @ts-ignore + state.value = window.__INITIAL_STATE__ as object + } + + const app = ssrBuild ? createSSRApp(App) : createApp(App) + + const router = createRouter({ + history: ssr ? createMemoryHistory('/') : createWebHistory('/'), + routes, + scrollBehavior, + }) + app.use(router) + + const head = createHead(headDefaults) + app.use(head) + + if (cb !== undefined) { + cb({ app, router, state }) + } + + return { + app, + router, + state, + head, + scrollBehavior, + cb, + } +} diff --git a/src/types.ts b/src/types.ts index 75f7ba8..2600290 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,17 +1,16 @@ -import { UserConfig } from 'vite' -import { type App } from 'vue' -import { type Router } from 'vue-router' -import { Request, Response } from 'express' - -export type VueSsrConfig = { - ssr?: boolean - vite?: UserConfig - port?: number - hostname?: string -} +import type { App } from 'vue' +import type { RouteRecordRaw, Router, RouterScrollBehavior } from 'vue-router' +import type { Request, Response } from 'express' +import type { Head } from '@unhead/schema' export type State = { value?: any } +export type Params = { + routes: RouteRecordRaw[] + head?: Head + scrollBehavior?: RouterScrollBehavior +} + export type CallbackFn = (params: { app: App router: Router diff --git a/src/vue/index.ts b/src/vue/index.ts deleted file mode 100644 index 24ba34c..0000000 --- a/src/vue/index.ts +++ /dev/null @@ -1,90 +0,0 @@ -import { fileURLToPath } from 'node:url' -import { cwd } from 'node:process' -import { basename, dirname, resolve, join } from 'node:path' -import { Request, Response } from 'express' -import { type SSRContext, renderToString } from 'vue/server-renderer' -import { vueSSR as vueSSRType } from '../index' - -const __dirname = dirname(fileURLToPath(import.meta.url)) - -export async function generateApp(url: string, manifest: any, req: Request, res: Response, dev = false) { - let main: ReturnType - - // dirty fix - if (dev) { - main = (await import(/* @vite-ignore */ join(cwd(), 'src/main.ts'))).default - } else { - main = (await import(/* @vite-ignore */ resolve(__dirname, './main.js'))).default - } - - const { app, router, state, head } = (await import('./vue')).vueSSR( - main.App, - { routes: main.routes, head: main.head }, - ({ app, router, state }) => { - if (main.cb !== undefined) { - main.cb({ app, router, state, request: req, response: res }) - } - } - ) - - await router.push(url) - await router.isReady() - - let redirect = null - - const ctx: SSRContext = {} - ctx.request = req - ctx.response = res - ctx.redirect = (url: string) => redirect = url - - const html = await renderToString(app, ctx) - - const preloadLinks = renderPreloadLinks(ctx.modules, manifest) - - return [html, preloadLinks, state, head, ctx.teleports ?? {}, redirect] -} - -function renderPreloadLinks(modules, manifest) { - let links = '' - const seen = new Set() - modules.forEach((id) => { - const files = manifest[id] - if (files) { - files.forEach((file) => { - if (!seen.has(file)) { - seen.add(file) - const filename = basename(file) - if (manifest[filename]) { - for (const depFile of manifest[filename]) { - links += renderPreloadLink(depFile) - seen.add(depFile) - } - } - links += renderPreloadLink(file) - } - }) - } - }) - return links -} - -function renderPreloadLink(file: string) { - if (file.endsWith('.js')) { - return `` - } else if (file.endsWith('.css')) { - return `` - } else if (file.endsWith('.woff')) { - return ` ` - } else if (file.endsWith('.woff2')) { - return ` ` - } else if (file.endsWith('.gif')) { - return ` ` - } else if (file.endsWith('.jpg') || file.endsWith('.jpeg')) { - return ` ` - } else if (file.endsWith('.png')) { - return ` ` - } else { - // TODO - return '' - } -} diff --git a/src/vue/plugin.ts b/src/vue/plugin.ts deleted file mode 100644 index f68c5be..0000000 --- a/src/vue/plugin.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { readFileSync } from 'node:fs' -import { dirname, resolve, join } from 'node:path' -import { fileURLToPath } from 'node:url' -import { type Plugin } from 'vite' -import _traverse from '@babel/traverse' -const traverse = _traverse.default -import { parse } from '@babel/parser' -import _generate from '@babel/generator' -const generate = _generate.default -import t from '@babel/types' - -export function vueSsrPlugin(): Plugin { - const virtualModuleId = 'virtual:vue-ssr' - const resolvedVirtualModuleId = '\0' + virtualModuleId - - let ssr = true - - return { - name: 'vite-vue-ssr-plugin', - config(config) { - ssr = config.define.__SSR_APP__ - - if (!ssr) { - delete config.build.ssrManifest - delete config.ssr - } - }, - resolveId(id) { - if (id === virtualModuleId) { - return resolvedVirtualModuleId - } - }, - load(id) { - if (id === resolvedVirtualModuleId) { - const __dirname = dirname(fileURLToPath(import.meta.url)) - - const data = readFileSync(resolve(join(__dirname, 'vue/vue.js')), 'utf8') - - return data - } - }, - transformIndexHtml() { - if (ssr) return - - return [ - { - tag: 'div', - attrs: { - id: 'teleports', - }, - injectTo: 'body', - } - ] - }, - transform(code, id, options) { - const ssr = options?.ssr ?? false - - if (id.endsWith('main.ts') && ssr === false) { - const ast = parse(code, { sourceType: 'module' }) - - traverse(ast, { - ImportDeclaration(path) { - if (path.node.source.value === '@bistroo/vue-ssr') { - path.node.source.value = 'virtual:vue-ssr' - } - }, - ExportDefaultDeclaration(path) { - path.replaceWithMultiple( - [ - t.variableDeclaration( - 'const', - [ - t.variableDeclarator( - t.objectPattern([ - t.objectProperty( - t.identifier('app'), - t.identifier('app'), - false, - true - ), - t.objectProperty( - t.identifier('router'), - t.identifier('router'), - false, - true - ) - ]), - t.callExpression( - t.identifier('vueSSR'), - path.node.declaration.arguments - ) - ), - ] - ), - t.expressionStatement( - t.callExpression( - t.memberExpression( - t.callExpression( - t.memberExpression( - t.identifier('router'), - t.identifier('isReady') - ), - [] - ), - t.identifier('then') - ), - [ - t.arrowFunctionExpression( - [], - t.blockStatement( - [ - t.expressionStatement( - t.callExpression( - t.memberExpression( - t.identifier('app'), - t.identifier('mount') - ), - [ - t.stringLiteral('#app') - ] - ) - ), - t.expressionStatement( - t.callExpression( - t.memberExpression( - t.identifier('console'), - t.identifier('log') - ), - [ - t.stringLiteral('hydrated') - ] - ) - ) - ] - ) - ) - ] - ) - ) - ] - ) - }, - }) - - return { - code: generate(ast).code, - } - } - }, - } -} diff --git a/src/vue/vue.ts b/src/vue/vue.ts deleted file mode 100644 index d6fb0b6..0000000 --- a/src/vue/vue.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { type Component, createSSRApp } from 'vue' -import { - type RouteRecordRaw, - createMemoryHistory, - createRouter, - createWebHistory, -RouterScrollBehavior -} from 'vue-router' -import { createHead } from '@vueuse/head' -import { type Head } from '@unhead/schema' -import { type State, type CallbackFn } from '../types' - -export function vueSSR( - App: Component, - { routes, head: headDefaults, scrollBehavior }: { routes: RouteRecordRaw[], head?: Head, scrollBehavior?: RouterScrollBehavior }, - cb?: CallbackFn) { - const router = createRouter({ - history: import.meta.env.SSR - ? createMemoryHistory('/') - : createWebHistory('/'), - routes, - scrollBehavior, - }) - - const state: State = { - value: undefined, - } - - if (!import.meta.env.SSR) { - state.value = window.__INITIAL_STATE__ as object - } - - const head = createHead(headDefaults) - - const app = createSSRApp(App) - app.use(router) - app.use(head) - - if (cb !== undefined) { - cb({ app, router, state }) - } - - return { - app, - router, - state: state.value, - head, - } -}