From bf24e7efc5fddaad758a0cbba7a801248902f538 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 19 Apr 2023 13:39:11 +0200 Subject: [PATCH 01/15] feat: build analyze --- package.json | 6 + .../devtools-kit/src/_types/analyze-build.ts | 9 + packages/devtools-kit/src/_types/index.ts | 1 + packages/devtools-kit/src/_types/rpc.ts | 3 + packages/devtools-kit/src/index.ts | 2 + packages/devtools-wizard/src/builtin.ts | 6 +- packages/devtools/client/composables/state.ts | 4 + .../devtools/client/pages/modules/build.vue | 76 ++ .../client/pages/modules/terminals.vue | 1 + .../src/integrations/analyze-build.ts | 19 + packages/devtools/src/module-main.ts | 17 +- .../devtools/src/server-rpc/analyze-build.ts | 65 ++ packages/devtools/src/server-rpc/assets.ts | 14 +- packages/devtools/src/server-rpc/index.ts | 2 + patches/nuxi@3.4.1.patch | 825 ++++++++++++++++++ patches/nuxt@3.4.1.patch | 269 ++++++ pnpm-lock.yaml | 30 +- 17 files changed, 1325 insertions(+), 24 deletions(-) create mode 100644 packages/devtools-kit/src/_types/analyze-build.ts create mode 100644 packages/devtools/client/pages/modules/build.vue create mode 100644 packages/devtools/src/integrations/analyze-build.ts create mode 100644 packages/devtools/src/server-rpc/analyze-build.ts create mode 100644 patches/nuxi@3.4.1.patch create mode 100644 patches/nuxt@3.4.1.patch diff --git a/package.json b/package.json index ed4735a9f..2db1ccca7 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,12 @@ "unocss": "^0.51.4", "vue-tsc": "^1.2.0" }, + "pnpm": { + "patchedDependencies": { + "nuxi@3.4.1": "patches/nuxi@3.4.1.patch", + "nuxt@3.4.1": "patches/nuxt@3.4.1.patch" + } + }, "simple-git-hooks": { "pre-commit": "pnpm lint-staged" }, diff --git a/packages/devtools-kit/src/_types/analyze-build.ts b/packages/devtools-kit/src/_types/analyze-build.ts new file mode 100644 index 000000000..c1f9d43d3 --- /dev/null +++ b/packages/devtools-kit/src/_types/analyze-build.ts @@ -0,0 +1,9 @@ +export interface AnalyticBuild { + buildTime: number + dir: string +} + +export interface AnalyticBuildInfo { + isBuilding: boolean + lastBuild?: AnalyticBuild +} diff --git a/packages/devtools-kit/src/_types/index.ts b/packages/devtools-kit/src/_types/index.ts index 86b5c56ee..1d16913ed 100644 --- a/packages/devtools-kit/src/_types/index.ts +++ b/packages/devtools-kit/src/_types/index.ts @@ -8,3 +8,4 @@ export * from './wizard' export * from './rpc' export * from './server-ctx' export * from './module-options' +export * from './analyze-build' diff --git a/packages/devtools-kit/src/_types/rpc.ts b/packages/devtools-kit/src/_types/rpc.ts index b45b15785..230cdfcfd 100644 --- a/packages/devtools-kit/src/_types/rpc.ts +++ b/packages/devtools-kit/src/_types/rpc.ts @@ -6,6 +6,7 @@ import type { ModuleCustomTab } from './custom-tabs' import type { AssetInfo, AutoImportsWithMetadata, ComponentRelationship, HookInfo, ImageMeta, NpmCommandOptions, NpmCommandType, PackageManagerName, PackageUpdateInfo, ServerRouteInfo } from './integrations' import type { TerminalAction, TerminalInfo } from './terminals' import type { GetWizardArgs, WizardActions } from './wizard' +import type { AnalyticBuildInfo } from './analyze-build' export interface ServerFunctions { // Static RPCs (can be provide on production build in the future) @@ -19,6 +20,7 @@ export interface ServerFunctions { getServerLayouts(): NuxtLayout[] getStaticAssets(): Promise getServerRoutes(): Promise + getAnalyzeBuildInfo(): Promise // Updates checkForUpdateFor(name: string): Promise @@ -48,6 +50,7 @@ export interface ServerFunctions { runWizard(name: T, ...args: GetWizardArgs): Promise openInEditor(filepath: string): void restartNuxt(hard?: boolean): Promise + startAnalyzeBuild(): Promise } export interface ClientFunctions { diff --git a/packages/devtools-kit/src/index.ts b/packages/devtools-kit/src/index.ts index 480c6122d..94e942104 100644 --- a/packages/devtools-kit/src/index.ts +++ b/packages/devtools-kit/src/index.ts @@ -44,6 +44,8 @@ export function startSubprocess( COLORS: 'true', FORCE_COLOR: 'true', ...execaOptions.env, + // Force disable Nuxi CLI override + __CLI_ARGV__: undefined, }, }, ) diff --git a/packages/devtools-wizard/src/builtin.ts b/packages/devtools-wizard/src/builtin.ts index 32f58d92f..439c2f518 100644 --- a/packages/devtools-wizard/src/builtin.ts +++ b/packages/devtools-wizard/src/builtin.ts @@ -1,5 +1,5 @@ import { existsSync } from 'node:fs' -import fs from 'node:fs/promises' +import fsp from 'node:fs/promises' import { relative } from 'node:path' import { consola } from 'consola' import c from 'picocolors' @@ -36,7 +36,7 @@ async function toggleConfig(cwd: string, value?: boolean) { } try { - const source = await fs.readFile(nuxtConfig, 'utf-8') + const source = await fsp.readFile(nuxtConfig, 'utf-8') const mod = await parseModule(source, { sourceFileName: nuxtConfig }) const config = mod.exports.default.$type === 'function-call' ? mod.exports.default.$args[0] @@ -70,7 +70,7 @@ async function toggleConfig(cwd: string, value?: boolean) { if (!confirm) return false - await fs.writeFile(nuxtConfig, `${generated.trimEnd()}\n`, 'utf-8') + await fsp.writeFile(nuxtConfig, `${generated.trimEnd()}\n`, 'utf-8') } } catch (err) { diff --git a/packages/devtools/client/composables/state.ts b/packages/devtools/client/composables/state.ts index f7aa951d4..3e53933c7 100644 --- a/packages/devtools/client/composables/state.ts +++ b/packages/devtools/client/composables/state.ts @@ -79,6 +79,10 @@ export function useTerminals() { return useAsyncState('getTerminals', () => rpc.getTerminals()) } +export function useAnalyzeBuildInfo() { + return useAsyncState('getAnalyzeBuildInfo', () => rpc.getAnalyzeBuildInfo()) +} + export function useTabs() { const router = useRouter() const customTabs = useCustomTabs() diff --git a/packages/devtools/client/pages/modules/build.vue b/packages/devtools/client/pages/modules/build.vue new file mode 100644 index 000000000..935a38c1c --- /dev/null +++ b/packages/devtools/client/pages/modules/build.vue @@ -0,0 +1,76 @@ + + + diff --git a/packages/devtools/client/pages/modules/terminals.vue b/packages/devtools/client/pages/modules/terminals.vue index b8e472f84..725539302 100644 --- a/packages/devtools/client/pages/modules/terminals.vue +++ b/packages/devtools/client/pages/modules/terminals.vue @@ -2,6 +2,7 @@ definePageMeta({ icon: 'carbon-terminal', title: 'Terminals', + layout: 'full', shouldShow() { return useTerminals().value?.length }, diff --git a/packages/devtools/src/integrations/analyze-build.ts b/packages/devtools/src/integrations/analyze-build.ts new file mode 100644 index 000000000..46c764b32 --- /dev/null +++ b/packages/devtools/src/integrations/analyze-build.ts @@ -0,0 +1,19 @@ +import fsp from 'node:fs/promises' +import type { Nuxt } from 'nuxt/schema' +import { join } from 'pathe' +import type { AnalyticBuild } from '../types' + +export async function setup(nuxt: Nuxt) { + if (nuxt.options.dev || !nuxt.options.build.analyze) + return + + // TODO: dynamic + const statsDir = join(nuxt.options.rootDir, '.nuxt/stats') + + nuxt.hook('build:done', async () => { + await fsp.writeFile(join(statsDir, 'index.json'), JSON.stringify({ + buildTime: Date.now(), + dir: statsDir, + }, null, 2)) + }) +} diff --git a/packages/devtools/src/module-main.ts b/packages/devtools/src/module-main.ts index 1382f3c9b..a14cc29fa 100644 --- a/packages/devtools/src/module-main.ts +++ b/packages/devtools/src/module-main.ts @@ -18,17 +18,26 @@ export async function enableModule(options: ModuleOptions, nuxt: Nuxt) { if (process.env.TEST || process.env.NODE_ENV === 'test') return - // TODO: Support devtools in production - if (!nuxt.options.dev) - return - if (nuxt.options.builder !== '@nuxt/vite-builder') { logger.warn('Nuxt Devtools only supports Vite mode, module is disabled.') return } + if (!nuxt.options.dev) { + await import('./integrations/analyze-build').then(({ setup }) => setup(nuxt)) + return + } + await nuxt.callHook('devtools:before') + // exclude .nuxt-analyse from watch + nuxt.options.vite.server ||= {} + nuxt.options.vite.server!.watch ||= {} + nuxt.options.vite.server!.watch!.ignored ||= [] + if (!Array.isArray(nuxt.options.vite.server!.watch!.ignored)) + nuxt.options.vite.server!.watch!.ignored = [nuxt.options.vite.server!.watch!.ignored] + nuxt.options.vite.server!.watch!.ignored!.push('**/.nuxt-analyze/**') + nuxt.options.imports.collectMeta = true addPlugin({ diff --git a/packages/devtools/src/server-rpc/analyze-build.ts b/packages/devtools/src/server-rpc/analyze-build.ts new file mode 100644 index 000000000..61deb5913 --- /dev/null +++ b/packages/devtools/src/server-rpc/analyze-build.ts @@ -0,0 +1,65 @@ +import fs from 'node:fs' +import fsp from 'node:fs/promises' +import { startSubprocess } from '@nuxt/devtools-kit' +import { join } from 'pathe' +import type { AnalyticBuild, NuxtDevtoolsServerContext, ServerFunctions } from '../types' + +export function setupAnalyzeBuildRPC({ nuxt, refresh }: NuxtDevtoolsServerContext) { + let lastBuild: AnalyticBuild | undefined + let promise: Promise | undefined + let tryLoaded = false + + const id = 'devtools:analyze-build' + + // TODO: dynamic + const statsDir = join(nuxt.options.rootDir, '.nuxt/stats') + + async function startAnalyzeBuild() { + if (promise) + throw new Error('Already building') + + const result = startSubprocess({ + command: 'npx', + args: ['nuxi', 'analyze', '--no-serve'], + cwd: nuxt.options.rootDir, + }, { + id, + name: 'Analyze Build', + icon: 'logos-nuxt-icon', + }, nuxt) + + refresh('getAnalyzeBuildInfo') + + promise = result.getProcess() + .then(() => readBuildInfo()) + .finally(() => { + promise = undefined + refresh('getAnalyzeBuildInfo') + }) + + return id + } + + async function readBuildInfo() { + const index = join(statsDir, 'index.json') + if (!fs.existsSync(index)) + return + + lastBuild = JSON.parse(await fsp.readFile(index, 'utf-8')) + return lastBuild + } + + return { + async getAnalyzeBuildInfo() { + if (!tryLoaded) { + tryLoaded = true + await readBuildInfo() + } + return { + isBuilding: !!promise, + lastBuild, + } + }, + startAnalyzeBuild, + } satisfies Partial +} diff --git a/packages/devtools/src/server-rpc/assets.ts b/packages/devtools/src/server-rpc/assets.ts index eb1c67873..419cf3407 100644 --- a/packages/devtools/src/server-rpc/assets.ts +++ b/packages/devtools/src/server-rpc/assets.ts @@ -1,4 +1,4 @@ -import fs from 'node:fs/promises' +import fsp from 'node:fs/promises' import { join, resolve } from 'pathe' import { imageMeta } from 'image-meta' import fg from 'fast-glob' @@ -32,7 +32,7 @@ export function setupAssetsRPC({ nuxt }: NuxtDevtoolsServerContext) { return await Promise.all(files.map(async (path) => { const filePath = resolve(dir, path) - const stat = await fs.lstat(filePath) + const stat = await fsp.lstat(filePath) return { path, publicPath: join(baseURL, path), @@ -47,7 +47,7 @@ export function setupAssetsRPC({ nuxt }: NuxtDevtoolsServerContext) { if (_imageMetaCache.has(filepath)) return _imageMetaCache.get(filepath) try { - const meta = imageMeta(await fs.readFile(filepath)) as ImageMeta + const meta = imageMeta(await fsp.readFile(filepath)) as ImageMeta _imageMetaCache.set(filepath, meta) return meta } @@ -59,7 +59,7 @@ export function setupAssetsRPC({ nuxt }: NuxtDevtoolsServerContext) { }, async getTextAssetContent(filepath: string, limit = 300) { try { - const content = await fs.readFile(filepath, 'utf-8') + const content = await fsp.readFile(filepath, 'utf-8') return content.slice(0, limit) } catch (e) { @@ -74,18 +74,18 @@ export function setupAssetsRPC({ nuxt }: NuxtDevtoolsServerContext) { files.map(async ({ name, data }) => { let dir = resolve(baseDir, name) try { - await fs.stat(dir) + await fsp.stat(dir) const ext = dir.split('.').pop() as string const base = dir.slice(0, dir.length - ext.length - 1) let i = 1 - while (await fs.access(`${base}-${i}.${ext}`).then(() => true).catch(() => false)) + while (await fsp.access(`${base}-${i}.${ext}`).then(() => true).catch(() => false)) i++ dir = `${base}-${i}.${ext}` } catch (err) { // Ignore error if file doesn't exist } - await fs.writeFile(dir, data, 'base64') + await fsp.writeFile(dir, data, 'base64') return dir }), ) diff --git a/packages/devtools/src/server-rpc/index.ts b/packages/devtools/src/server-rpc/index.ts index 59f712c25..d7fb9d552 100644 --- a/packages/devtools/src/server-rpc/index.ts +++ b/packages/devtools/src/server-rpc/index.ts @@ -15,6 +15,7 @@ import { setupGeneralRPC } from './general' import { setupWizardRPC } from './wizard' import { setupTerminalRPC } from './terminals' import { setupServerRoutesRPC } from './server-routes' +import { setupAnalyzeBuildRPC } from './analyze-build' export function setupRPC(nuxt: Nuxt, options: ModuleOptions) { const serverFunctions = {} as ServerFunctions @@ -77,6 +78,7 @@ export function setupRPC(nuxt: Nuxt, options: ModuleOptions) { ...setupWizardRPC(ctx), ...setupTerminalRPC(ctx), ...setupServerRoutesRPC(ctx), + ...setupAnalyzeBuildRPC(ctx), } satisfies ServerFunctions) const wsClients = new Set() diff --git a/patches/nuxi@3.4.1.patch b/patches/nuxi@3.4.1.patch new file mode 100644 index 000000000..81ae9b86f --- /dev/null +++ b/patches/nuxi@3.4.1.patch @@ -0,0 +1,825 @@ +diff --git a/dist/chunks/add.mjs b/dist/chunks/add.mjs +index 926ba8c1e265d3f1f88ca2c91f72ede8fe25743a..62f49f5a0674b57eadce25211dda15021d394252 100644 +--- a/dist/chunks/add.mjs ++++ b/dist/chunks/add.mjs +@@ -1,5 +1,5 @@ + import { existsSync, promises } from 'node:fs'; +-import { c as consola } from '../shared/nuxi.70d48494.mjs'; ++import { c as consola } from '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; +diff --git a/dist/chunks/analyze.mjs b/dist/chunks/analyze.mjs +index 6aedc5c63249669a35126117a9f64c468b6d62fc..a87ed635d548427d725453313b0570cb9b8a1402 100644 +--- a/dist/chunks/analyze.mjs ++++ b/dist/chunks/analyze.mjs +@@ -1,9 +1,9 @@ + import { promises } from 'node:fs'; + import { createApp, eventHandler, toNodeListener, lazyEventHandler } from './index2.mjs'; + import { listen } from './index.mjs'; +-import { w as writeTypes } from '../shared/nuxi.4c58f8a5.mjs'; ++import { w as writeTypes } from '../shared/nuxi.89758cc3.mjs'; + import { l as loadKit } from '../shared/nuxi.0318c2bd.mjs'; +-import { c as clearDir } from '../shared/nuxi.d045d192.mjs'; ++import { c as clearDir } from '../shared/nuxi.2535cbee.mjs'; + import { o as overrideEnv } from '../shared/nuxi.d21ab543.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; + import { r as resolve, j as join } from '../shared/nuxi.ffb4843d.mjs'; +@@ -27,61 +27,91 @@ import 'node:net'; + import 'http'; + import 'https'; + import 'node:child_process'; +-import '../shared/nuxi.aaefd8a8.mjs'; ++import '../shared/nuxi.602e8160.mjs'; + import '../shared/nuxi.1d8d2e21.mjs'; +-import '../shared/nuxi.70d48494.mjs'; ++import '../shared/nuxi.114b1a98.mjs'; + + const analyze = defineNuxtCommand({ + meta: { + name: "analyze", +- usage: "npx nuxi analyze [--log-level] [rootDir]", ++ usage: "npx nuxi analyze [--log-level] [--name] [--no-serve] [rootDir]", + description: "Build nuxt and analyze production bundle (experimental)" + }, + async invoke(args) { + overrideEnv("production"); ++ const name = args.name || "default"; + const rootDir = resolve(args._[0] || "."); +- const statsDir = join(rootDir, ".nuxt/stats"); ++ let analyzeDir = join(rootDir, ".nuxt-analyze", name); ++ let buildDir = join(analyzeDir, ".nuxt"); ++ let outDir = join(analyzeDir, ".output"); ++ const startTime = Date.now(); + const { loadNuxt, buildNuxt } = await loadKit(rootDir); + const nuxt = await loadNuxt({ + rootDir, + overrides: { +- build: { analyze: true }, ++ build: { ++ analyze: true ++ }, ++ analyzeDir, ++ buildDir, ++ nitro: { ++ output: { ++ dir: outDir ++ } ++ }, + logLevel: args["log-level"] + } + }); +- await clearDir(nuxt.options.buildDir); ++ analyzeDir = nuxt.options.analyzeDir; ++ buildDir = nuxt.options.buildDir; ++ outDir = nuxt.options.nitro.output?.dir || outDir; ++ await clearDir(analyzeDir); + await writeTypes(nuxt); + await buildNuxt(nuxt); +- const app = createApp(); +- const serveFile = (filePath) => lazyEventHandler(async () => { +- const contents = await promises.readFile(filePath, "utf-8"); +- return eventHandler((event) => { +- event.node.res.end(contents); +- }); +- }); ++ const endTime = Date.now(); ++ const meta = { ++ name, ++ startTime, ++ endTime, ++ analyzeDir, ++ buildDir, ++ outDir ++ }; ++ await nuxt.callHook("build:analyze:done", meta); ++ await promises.writeFile(join(analyzeDir, "meta.json"), JSON.stringify(meta, null, 2), "utf-8"); ++ console.info("Analyze results are available at: `" + analyzeDir + "`"); + console.warn("Do not deploy analyze results! Use `nuxi build` before deploying."); +- console.info("Starting stats server..."); +- app.use("/client", serveFile(join(statsDir, "client.html"))); +- app.use("/nitro", serveFile(join(statsDir, "nitro.html"))); +- app.use(eventHandler(() => ` +- +- +- +- Nuxt Bundle Stats (experimental) +- +-

Nuxt Bundle Stats (experimental)

+- +- +- `)); +- await listen(toNodeListener(app)); +- return "wait"; ++ if (args.serve !== false && !process.env.CI) { ++ const app = createApp(); ++ const serveFile = (filePath) => lazyEventHandler(async () => { ++ const contents = await promises.readFile(filePath, "utf-8"); ++ return eventHandler((event) => { ++ event.node.res.end(contents); ++ }); ++ }); ++ console.info("Starting stats server..."); ++ app.use("/client", serveFile(join(analyzeDir, "client.html"))); ++ app.use("/nitro", serveFile(join(analyzeDir, "nitro.html"))); ++ app.use(eventHandler(() => ` ++ ++ ++ ++ Nuxt Bundle Stats (experimental) ++ ++

Nuxt Bundle Stats (experimental)

++ ++ ++ `)); ++ await listen(toNodeListener(app)); ++ return "wait"; ++ } + } + }); + +diff --git a/dist/chunks/build-module.mjs b/dist/chunks/build-module.mjs +index 709d93729d664161ba20b76c0b93c10effa5ccea..1b2d0c951a26abf49f6d901866bca66aea4d7800 100644 +--- a/dist/chunks/build-module.mjs ++++ b/dist/chunks/build-module.mjs +@@ -1,5 +1,5 @@ + import { e as execa } from '../shared/nuxi.63bda57d.mjs'; +-import { c as consola } from '../shared/nuxi.70d48494.mjs'; ++import { c as consola } from '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; +diff --git a/dist/chunks/build.mjs b/dist/chunks/build.mjs +index b6652f386fc98b3e8e5be41f35a93b93172ebebb..77fdd35c1571a1f882867bc1cf813b152ef461a4 100644 +--- a/dist/chunks/build.mjs ++++ b/dist/chunks/build.mjs +@@ -1,18 +1,18 @@ +-import { c as consola } from '../shared/nuxi.70d48494.mjs'; ++import { c as consola } from '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; + import 'tty'; +-import { w as writeTypes } from '../shared/nuxi.4c58f8a5.mjs'; ++import { w as writeTypes } from '../shared/nuxi.89758cc3.mjs'; + import { l as loadKit } from '../shared/nuxi.0318c2bd.mjs'; +-import { c as clearDir } from '../shared/nuxi.d045d192.mjs'; ++import { c as clearDir } from '../shared/nuxi.2535cbee.mjs'; + import { o as overrideEnv } from '../shared/nuxi.d21ab543.mjs'; +-import { a as showVersions } from '../shared/nuxi.1ee66a2a.mjs'; ++import { a as showVersions } from '../shared/nuxi.abb7c9ca.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; + import { r as resolve, a as relative } from '../shared/nuxi.ffb4843d.mjs'; + import 'node:fs'; + import '../shared/nuxi.a685c563.mjs'; +-import '../shared/nuxi.aaefd8a8.mjs'; ++import '../shared/nuxi.602e8160.mjs'; + import 'node:module'; + import '../shared/nuxi.1d8d2e21.mjs'; + import 'node:url'; +diff --git a/dist/chunks/cleanup.mjs b/dist/chunks/cleanup.mjs +index 7c04fb7903d67c492203f16d41328f8f05323390..ee45403068dec2d3d5fb9dbde6a482952e8b3299 100644 +--- a/dist/chunks/cleanup.mjs ++++ b/dist/chunks/cleanup.mjs +@@ -1,13 +1,13 @@ +-import { c as cleanupNuxtDirs } from '../shared/nuxi.e29c38a1.mjs'; ++import { c as cleanupNuxtDirs } from '../shared/nuxi.cc672940.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; + import { r as resolve } from '../shared/nuxi.ffb4843d.mjs'; + import 'node:fs'; +-import '../shared/nuxi.70d48494.mjs'; ++import '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; + import 'tty'; +-import '../shared/nuxi.d045d192.mjs'; ++import '../shared/nuxi.2535cbee.mjs'; + + const cleanup = defineNuxtCommand({ + meta: { +diff --git a/dist/chunks/dev.mjs b/dist/chunks/dev.mjs +index 9a050051f6eb06caef10f1532b5353d9043b77ef..fc66e4bec0567a289e60bd3fa8fcd8c487e6ce9b 100644 +--- a/dist/chunks/dev.mjs ++++ b/dist/chunks/dev.mjs +@@ -4,19 +4,19 @@ import require$$0 from 'path'; + import require$$2 from 'util'; + import require$$1 from 'stream'; + import require$$0$2 from 'os'; +-import { c as consola } from '../shared/nuxi.70d48494.mjs'; ++import { c as consola } from '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; + import 'tty'; + import { w as withTrailingSlash } from '../shared/nuxi.da4c08ec.mjs'; +-import { s as setupDotenv } from '../shared/nuxi.cb8e73b6.mjs'; +-import { a as showVersions, s as showBanner } from '../shared/nuxi.1ee66a2a.mjs'; +-import { w as writeTypes } from '../shared/nuxi.4c58f8a5.mjs'; ++import { s as setupDotenv } from '../shared/nuxi.f4cdb938.mjs'; ++import { a as showVersions, s as showBanner } from '../shared/nuxi.abb7c9ca.mjs'; ++import { w as writeTypes } from '../shared/nuxi.89758cc3.mjs'; + import { l as loadKit } from '../shared/nuxi.0318c2bd.mjs'; + import { i as importModule } from '../shared/nuxi.1d8d2e21.mjs'; + import { o as overrideEnv } from '../shared/nuxi.d21ab543.mjs'; +-import { l as loadNuxtManifest, w as writeNuxtManifest, c as cleanupNuxtDirs } from '../shared/nuxi.e29c38a1.mjs'; ++import { l as loadNuxtManifest, w as writeNuxtManifest, c as cleanupNuxtDirs } from '../shared/nuxi.cc672940.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; + import { r as resolve, a as relative } from '../shared/nuxi.ffb4843d.mjs'; + import 'node:module'; +@@ -36,9 +36,9 @@ import 'assert'; + import 'process'; + import 'v8'; + import '../shared/nuxi.a3b9dacd.mjs'; +-import '../shared/nuxi.aaefd8a8.mjs'; ++import '../shared/nuxi.602e8160.mjs'; + import '../shared/nuxi.a685c563.mjs'; +-import '../shared/nuxi.d045d192.mjs'; ++import '../shared/nuxi.2535cbee.mjs'; + + var chokidar = {}; + +diff --git a/dist/chunks/generate.mjs b/dist/chunks/generate.mjs +index 817c8fbccea6ab7c07d603f234ae5899577f74ea..8ab3888f57d2ef513b7814149b9dd2b8ec10dac3 100644 +--- a/dist/chunks/generate.mjs ++++ b/dist/chunks/generate.mjs +@@ -1,14 +1,14 @@ + import buildCommand from './build.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; +-import '../shared/nuxi.70d48494.mjs'; ++import '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; + import 'tty'; +-import '../shared/nuxi.4c58f8a5.mjs'; ++import '../shared/nuxi.89758cc3.mjs'; + import 'node:fs'; + import '../shared/nuxi.a685c563.mjs'; +-import '../shared/nuxi.aaefd8a8.mjs'; ++import '../shared/nuxi.602e8160.mjs'; + import 'node:module'; + import '../shared/nuxi.ffb4843d.mjs'; + import '../shared/nuxi.0318c2bd.mjs'; +@@ -17,9 +17,9 @@ import 'node:url'; + import '../shared/nuxi.da4c08ec.mjs'; + import 'node:assert'; + import 'node:v8'; +-import '../shared/nuxi.d045d192.mjs'; ++import '../shared/nuxi.2535cbee.mjs'; + import '../shared/nuxi.d21ab543.mjs'; +-import '../shared/nuxi.1ee66a2a.mjs'; ++import '../shared/nuxi.abb7c9ca.mjs'; + import 'assert'; + import '../shared/nuxi.a3b9dacd.mjs'; + +diff --git a/dist/chunks/info.mjs b/dist/chunks/info.mjs +index 11c0641d7129cc7ae025c6773a0b0af38a52f3c4..cc9bfe169bc220a3a38ef39c0272af3fac162d3d 100644 +--- a/dist/chunks/info.mjs ++++ b/dist/chunks/info.mjs +@@ -18,8 +18,8 @@ import tty__default from 'tty'; + import { d as destr } from '../shared/nuxi.4d4de9c7.mjs'; + import { s as splitByCase } from '../shared/nuxi.e5ae87db.mjs'; + import clipboard from './index3.mjs'; +-import { g as getPackageManager, a as getPackageManagerVersion } from '../shared/nuxi.8b7e2742.mjs'; +-import { f as findup } from '../shared/nuxi.d045d192.mjs'; ++import { g as getPackageManager, a as getPackageManagerVersion } from '../shared/nuxi.390be480.mjs'; ++import { f as findup } from '../shared/nuxi.2535cbee.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; + import { r as resolve } from '../shared/nuxi.ffb4843d.mjs'; + import 'node:process'; +@@ -31,7 +31,7 @@ import 'stream'; + import 'node:path'; + import 'node:url'; + import 'node:child_process'; +-import '../shared/nuxi.70d48494.mjs'; ++import '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + + var jitiExports = {}; +diff --git a/dist/chunks/init.mjs b/dist/chunks/init.mjs +index 99eb3c143e72ca9d0436400f1bbc8d9021565af3..5c744ad029eddd61f4ebffe4fe271e726807ea35 100644 +--- a/dist/chunks/init.mjs ++++ b/dist/chunks/init.mjs +@@ -1,5 +1,5 @@ + import { rm, mkdir as mkdir$2, readFile, writeFile } from 'node:fs/promises'; +-import { c as consola } from '../shared/nuxi.70d48494.mjs'; ++import { c as consola } from '../shared/nuxi.114b1a98.mjs'; + import { promisify as promisify$3, deprecate, types as types$2 } from 'node:util'; + import 'node:path'; + import 'node:process'; +diff --git a/dist/chunks/multipart-parser.mjs b/dist/chunks/multipart-parser.mjs +index 4c5b877a21db79f63af6de9e8a32546c5d83139c..76298926ade9d5ed146fd2497167033979ae7924 100644 +--- a/dist/chunks/multipart-parser.mjs ++++ b/dist/chunks/multipart-parser.mjs +@@ -10,7 +10,7 @@ import 'node:util'; + import 'node:url'; + import 'node:net'; + import 'node:fs/promises'; +-import '../shared/nuxi.70d48494.mjs'; ++import '../shared/nuxi.114b1a98.mjs'; + import 'node:process'; + import 'tty'; + import '../shared/nuxi.c68ce99d.mjs'; +diff --git a/dist/chunks/prepare.mjs b/dist/chunks/prepare.mjs +index f17318934ba64bbd67dac884e52e0555fd3fdfb0..9198a2b4ae0d590201b348a02c1484227ab3fa67 100644 +--- a/dist/chunks/prepare.mjs ++++ b/dist/chunks/prepare.mjs +@@ -1,12 +1,12 @@ + import { buildNuxt } from '@nuxt/kit'; +-import { c as consola } from '../shared/nuxi.70d48494.mjs'; ++import { c as consola } from '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; + import 'tty'; +-import { c as clearDir } from '../shared/nuxi.d045d192.mjs'; ++import { c as clearDir } from '../shared/nuxi.2535cbee.mjs'; + import { l as loadKit } from '../shared/nuxi.0318c2bd.mjs'; +-import { w as writeTypes } from '../shared/nuxi.4c58f8a5.mjs'; ++import { w as writeTypes } from '../shared/nuxi.89758cc3.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; + import { r as resolve, a as relative } from '../shared/nuxi.ffb4843d.mjs'; + import 'node:fs'; +@@ -17,7 +17,7 @@ import 'node:module'; + import 'node:assert'; + import 'node:v8'; + import '../shared/nuxi.a685c563.mjs'; +-import '../shared/nuxi.aaefd8a8.mjs'; ++import '../shared/nuxi.602e8160.mjs'; + + const prepare = defineNuxtCommand({ + meta: { +diff --git a/dist/chunks/preview.mjs b/dist/chunks/preview.mjs +index 6c978576d829260c35f49b2fa1b5ad6f2650ef97..e38a03c60a42ff567b42580a493ec5dcd1bcb6d0 100644 +--- a/dist/chunks/preview.mjs ++++ b/dist/chunks/preview.mjs +@@ -1,8 +1,8 @@ + import { existsSync, promises } from 'node:fs'; + import { dirname, relative } from 'node:path'; + import { e as execa } from '../shared/nuxi.63bda57d.mjs'; +-import { s as setupDotenv } from '../shared/nuxi.cb8e73b6.mjs'; +-import { c as consola } from '../shared/nuxi.70d48494.mjs'; ++import { s as setupDotenv } from '../shared/nuxi.f4cdb938.mjs'; ++import { c as consola } from '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:process'; + import 'tty'; +diff --git a/dist/chunks/prompt.mjs b/dist/chunks/prompt.mjs +index 595ddc54322bdcd0eeff59114f5d147e6c3b0d84..305c1c2fd3d3209981fb17e974e160eaf9467475 100644 +--- a/dist/chunks/prompt.mjs ++++ b/dist/chunks/prompt.mjs +@@ -2,7 +2,7 @@ import { stdin, stdout } from 'node:process'; + import f from 'node:readline'; + import { WriteStream } from 'node:tty'; + import tty__default from 'tty'; +-import { i as isUnicodeSupported, g as gray, a as inverse, d as dim, h as hidden, b as cyan, s as strikethrough, y as yellow, e as green, r as reset, f as bgWhite, j as red } from '../shared/nuxi.70d48494.mjs'; ++import { i as isUnicodeSupported, g as gray, a as inverse, d as dim, h as hidden, b as cyan, s as strikethrough, y as yellow, e as green, r as reset, f as bgWhite, j as red } from '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + +diff --git a/dist/chunks/satisfies.mjs b/dist/chunks/satisfies.mjs +index 49cd1dddbc67116fafefb196ada24fd77fe5c80d..3dd3eef1d0ba7d98e8d4094bb789e40a892e3bba 100644 +--- a/dist/chunks/satisfies.mjs ++++ b/dist/chunks/satisfies.mjs +@@ -1,4 +1,5 @@ + import { y as yallist } from '../shared/nuxi.cc8dd4a9.mjs'; ++import require$$2 from 'util'; + + function _mergeNamespaces(n, m) { + for (var i = 0; i < m.length; i++) { +@@ -635,7 +636,7 @@ let SemVer$1 = class SemVer { + version = version.version; + } + } else if (typeof version !== 'string') { +- throw new TypeError(`Invalid Version: ${version}`) ++ throw new TypeError(`Invalid Version: ${require$$2.inspect(version)}`) + } + + if (version.length > MAX_LENGTH) { +@@ -865,9 +866,15 @@ let SemVer$1 = class SemVer { + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. +- case 'pre': ++ case 'pre': { ++ const base = Number(identifierBase) ? 1 : 0; ++ ++ if (!identifier && identifierBase === false) { ++ throw new Error('invalid increment argument: identifier is empty') ++ } ++ + if (this.prerelease.length === 0) { +- this.prerelease = [0]; ++ this.prerelease = [base]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { +@@ -878,23 +885,29 @@ let SemVer$1 = class SemVer { + } + if (i === -1) { + // didn't increment anything +- this.prerelease.push(0); ++ if (identifier === this.prerelease.join('.') && identifierBase === false) { ++ throw new Error('invalid increment argument: identifier already exists') ++ } ++ this.prerelease.push(base); + } + } + if (identifier) { +- const base = Number(identifierBase) ? 1 : 0; + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 ++ let prerelease = [identifier, base]; ++ if (identifierBase === false) { ++ prerelease = [identifier]; ++ } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { +- this.prerelease = [identifier, base]; ++ this.prerelease = prerelease; + } + } else { +- this.prerelease = [identifier, base]; ++ this.prerelease = prerelease; + } + } + break +- ++ } + default: + throw new Error(`invalid increment argument: ${release}`) + } +diff --git a/dist/chunks/typecheck.mjs b/dist/chunks/typecheck.mjs +index 6373a5522c6b7ca89d5c06d9eb61c8a33886e712..e834281c579c3066f3d401961ee6283efb65b35a 100644 +--- a/dist/chunks/typecheck.mjs ++++ b/dist/chunks/typecheck.mjs +@@ -1,7 +1,7 @@ + import { e as execa } from '../shared/nuxi.63bda57d.mjs'; + import { t as tryResolveModule } from '../shared/nuxi.1d8d2e21.mjs'; + import { l as loadKit } from '../shared/nuxi.0318c2bd.mjs'; +-import { w as writeTypes } from '../shared/nuxi.4c58f8a5.mjs'; ++import { w as writeTypes } from '../shared/nuxi.89758cc3.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; + import { r as resolve } from '../shared/nuxi.ffb4843d.mjs'; + import 'node:buffer'; +@@ -27,7 +27,7 @@ import 'node:module'; + import 'node:assert'; + import 'node:v8'; + import '../shared/nuxi.a685c563.mjs'; +-import '../shared/nuxi.aaefd8a8.mjs'; ++import '../shared/nuxi.602e8160.mjs'; + + const typecheck = defineNuxtCommand({ + meta: { +diff --git a/dist/chunks/upgrade.mjs b/dist/chunks/upgrade.mjs +index 4e0c736aae63c0275f83cde69e9ca08e5ebe0150..564e96ab0cebadf9444407faae2e5f3fb3891d6c 100644 +--- a/dist/chunks/upgrade.mjs ++++ b/dist/chunks/upgrade.mjs +@@ -1,5 +1,5 @@ + import { execSync } from 'node:child_process'; +-import { c as consola } from '../shared/nuxi.70d48494.mjs'; ++import { c as consola } from '../shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; +@@ -7,9 +7,9 @@ import 'tty'; + import { promises, statSync } from 'node:fs'; + import { r as resolvePath } from '../shared/nuxi.da4c08ec.mjs'; + import { i as isAbsolute, r as resolve, j as join } from '../shared/nuxi.ffb4843d.mjs'; +-import { g as getPackageManager, p as packageManagerLocks } from '../shared/nuxi.8b7e2742.mjs'; +-import { r as rmRecursive, t as touchFile } from '../shared/nuxi.d045d192.mjs'; +-import { c as cleanupNuxtDirs, n as nuxtVersionToGitIdentifier } from '../shared/nuxi.e29c38a1.mjs'; ++import { g as getPackageManager, p as packageManagerLocks } from '../shared/nuxi.390be480.mjs'; ++import { r as rmRecursive, t as touchFile } from '../shared/nuxi.2535cbee.mjs'; ++import { c as cleanupNuxtDirs, n as nuxtVersionToGitIdentifier } from '../shared/nuxi.cc672940.mjs'; + import { d as defineNuxtCommand } from '../shared/nuxi.c68ce99d.mjs'; + import 'node:module'; + import 'node:url'; +diff --git a/dist/cli.mjs b/dist/cli.mjs +index 4e9774b8e0f5cae2d69ae9b3b495d9fbb2998241..436a0017715af803e175107860e38f04fca00356 100644 +--- a/dist/cli.mjs ++++ b/dist/cli.mjs +@@ -1,14 +1,14 @@ + import { m as mri, c as commands } from './shared/nuxi.c68ce99d.mjs'; + import { r as red } from './shared/nuxi.a3b9dacd.mjs'; +-import { c as consola } from './shared/nuxi.70d48494.mjs'; ++import { c as consola } from './shared/nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; + import 'tty'; +-import { e as engines, s as showBanner } from './shared/nuxi.1ee66a2a.mjs'; ++import { e as engines, s as showBanner } from './shared/nuxi.abb7c9ca.mjs'; + import { s as showHelp } from './shared/nuxi.2135311a.mjs'; + import 'assert'; +-import './shared/nuxi.aaefd8a8.mjs'; ++import './shared/nuxi.602e8160.mjs'; + import 'node:module'; + import './shared/nuxi.ffb4843d.mjs'; + +diff --git a/dist/shared/nuxi.70d48494.mjs b/dist/shared/nuxi.114b1a98.mjs +similarity index 99% +rename from dist/shared/nuxi.70d48494.mjs +rename to dist/shared/nuxi.114b1a98.mjs +index d5e5408ded5186795281fccd3cff5b2889e8a68c..ebe1359fc61371a63c78609ec15a206a06979132 100644 +--- a/dist/shared/nuxi.70d48494.mjs ++++ b/dist/shared/nuxi.114b1a98.mjs +@@ -156,7 +156,10 @@ class Consola { + ...types[type] + }; + this[type] = this._wrapLogFn(defaults); +- this[type].raw = this._wrapLogFn(defaults, true); ++ this[type].raw = this._wrapLogFn( ++ defaults, ++ true ++ ); + } + if (this.options.mockFn) { + this.mockTypes(); +@@ -286,7 +289,7 @@ class Consola { + return; + } + for (const type in this.options.types) { +- this[type] = _mockFn(type, this._types[type]) || this[type]; ++ this[type] = _mockFn(type, this.options.types[type]) || this[type]; + this[type].raw = this[type]; + } + } +@@ -396,10 +399,61 @@ Consola.prototype.withScope = Consola.prototype.withTag; + Consola.prototype.mock = Consola.prototype.mockTypes; + Consola.prototype.pause = Consola.prototype.pauseLogs; + Consola.prototype.resume = Consola.prototype.resumeLogs; +-function createConsola$1(options) { ++function createConsola$1(options = {}) { + return new Consola(options); + } + ++function parseStack(stack) { ++ const cwd = process.cwd() + sep; ++ const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, "")); ++ return lines; ++} ++ ++function writeStream(data, stream) { ++ const write = stream.__write || stream.write; ++ return write.call(stream, data); ++} ++ ++const bracket = (x) => x ? `[${x}]` : ""; ++class BasicReporter { ++ formatStack(stack, opts) { ++ return " " + parseStack(stack).join("\n "); ++ } ++ formatArgs(args, opts) { ++ const _args = args.map((arg) => { ++ if (arg && typeof arg.stack === "string") { ++ return arg.message + "\n" + this.formatStack(arg.stack, opts); ++ } ++ return arg; ++ }); ++ return formatWithOptions(opts, ..._args); ++ } ++ formatDate(date, opts) { ++ return opts.date ? date.toLocaleTimeString() : ""; ++ } ++ filterAndJoin(arr) { ++ return arr.filter(Boolean).join(" "); ++ } ++ formatLogObj(logObj, opts) { ++ const message = this.formatArgs(logObj.args, opts); ++ return this.filterAndJoin([ ++ bracket(logObj.type), ++ bracket(logObj.tag), ++ message ++ ]); ++ } ++ log(logObj, ctx) { ++ const line = this.formatLogObj(logObj, { ++ columns: ctx.options.stdout.columns || 0, ++ ...ctx.options.formatOptions ++ }); ++ return writeStream( ++ line + "\n", ++ logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout ++ ); ++ } ++} ++ + const providers = [ + ["APPVEYOR"], + ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"], +@@ -482,57 +536,6 @@ function toBoolean(val) { + return val ? val !== "false" : false; + } + +-function parseStack(stack) { +- const cwd = process.cwd() + sep; +- const lines = stack.split("\n").splice(1).map((l) => l.trim().replace("file://", "").replace(cwd, "")); +- return lines; +-} +- +-function writeStream(data, stream) { +- const write = stream.__write || stream.write; +- return write.call(stream, data); +-} +- +-const bracket = (x) => x ? `[${x}]` : ""; +-class BasicReporter { +- formatStack(stack, opts) { +- return " " + parseStack(stack).join("\n "); +- } +- formatArgs(args, opts) { +- const _args = args.map((arg) => { +- if (arg && typeof arg.stack === "string") { +- return arg.message + "\n" + this.formatStack(arg.stack, opts); +- } +- return arg; +- }); +- return formatWithOptions(opts, ..._args); +- } +- formatDate(date, opts) { +- return opts.date ? date.toLocaleTimeString() : ""; +- } +- filterAndJoin(arr) { +- return arr.filter(Boolean).join(" "); +- } +- formatLogObj(logObj, opts) { +- const message = this.formatArgs(logObj.args, opts); +- return this.filterAndJoin([ +- bracket(logObj.type), +- bracket(logObj.tag), +- message +- ]); +- } +- log(logObj, ctx) { +- const line = this.formatLogObj(logObj, { +- columns: ctx.options.stdout.columns || 0, +- ...ctx.options.formatOptions +- }); +- return writeStream( +- line + "\n", +- logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout +- ); +- } +-} +- + function ansiRegex({onlyFirst = false} = {}) { + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', +@@ -1226,7 +1229,7 @@ function createConsola(options = {}) { + stderr: process.stderr, + prompt: (...args) => import('../chunks/prompt.mjs').then((m) => m.prompt(...args)), + reporters: options.reporters || [ +- isCI$1 || isTest ? new BasicReporter() : new FancyReporter() ++ options.fancy ?? !(isCI$1 || isTest) ? new FancyReporter() : new BasicReporter() + ], + ...options + }); +diff --git a/dist/shared/nuxi.d045d192.mjs b/dist/shared/nuxi.2535cbee.mjs +similarity index 94% +rename from dist/shared/nuxi.d045d192.mjs +rename to dist/shared/nuxi.2535cbee.mjs +index 8158e908bf2e8416640717c27311b9ae62a2fca4..ca25bb4a9aa1ebc6815699e6cb843492add73a50 100644 +--- a/dist/shared/nuxi.d045d192.mjs ++++ b/dist/shared/nuxi.2535cbee.mjs +@@ -1,5 +1,5 @@ + import { promises } from 'node:fs'; +-import { c as consola } from './nuxi.70d48494.mjs'; ++import { c as consola } from './nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; +diff --git a/dist/shared/nuxi.8b7e2742.mjs b/dist/shared/nuxi.390be480.mjs +similarity index 93% +rename from dist/shared/nuxi.8b7e2742.mjs +rename to dist/shared/nuxi.390be480.mjs +index 9b6a5a96629a241443ea0ec8a35173898e37fb47..40f8c21cec6cd8e02ee84cf40be9dd69ce5f8e07 100644 +--- a/dist/shared/nuxi.8b7e2742.mjs ++++ b/dist/shared/nuxi.390be480.mjs +@@ -1,6 +1,6 @@ + import { execSync } from 'node:child_process'; + import { existsSync } from 'node:fs'; +-import { f as findup } from './nuxi.d045d192.mjs'; ++import { f as findup } from './nuxi.2535cbee.mjs'; + import { r as resolve } from './nuxi.ffb4843d.mjs'; + + const packageManagerLocks = { +diff --git a/dist/shared/nuxi.aaefd8a8.mjs b/dist/shared/nuxi.602e8160.mjs +similarity index 92% +rename from dist/shared/nuxi.aaefd8a8.mjs +rename to dist/shared/nuxi.602e8160.mjs +index 925b6a5e82603cfb9a205a2ac4bbdf46917192bf..9270c2b8dadcd2081323b6a3750b94e57ae0fd34 100644 +--- a/dist/shared/nuxi.aaefd8a8.mjs ++++ b/dist/shared/nuxi.602e8160.mjs +@@ -3,11 +3,9 @@ import { d as dirname, n as normalize } from './nuxi.ffb4843d.mjs'; + + function getModulePaths(paths) { + return [].concat( +- // @ts-expect-error global object + global.__NUXT_PREPATHS__, + paths, + process.cwd(), +- // @ts-expect-error global object + global.__NUXT_PATHS__ + ).filter(Boolean); + } +diff --git a/dist/shared/nuxi.4c58f8a5.mjs b/dist/shared/nuxi.89758cc3.mjs +similarity index 99% +rename from dist/shared/nuxi.4c58f8a5.mjs +rename to dist/shared/nuxi.89758cc3.mjs +index 81ce47413d0d1d086465358678aca17a0fb8e51e..d36d31b346c695cdc7cfd4bf48f3533710b65424 100644 +--- a/dist/shared/nuxi.4c58f8a5.mjs ++++ b/dist/shared/nuxi.89758cc3.mjs +@@ -1,6 +1,6 @@ + import { promises } from 'node:fs'; + import { d as defu } from './nuxi.a685c563.mjs'; +-import { g as getModulePaths, a as getNearestPackage } from './nuxi.aaefd8a8.mjs'; ++import { g as getModulePaths, a as getNearestPackage } from './nuxi.602e8160.mjs'; + import { a as relative, j as join, r as resolve, i as isAbsolute } from './nuxi.ffb4843d.mjs'; + + const writeTypes = async (nuxt) => { +diff --git a/dist/shared/nuxi.1ee66a2a.mjs b/dist/shared/nuxi.abb7c9ca.mjs +similarity index 95% +rename from dist/shared/nuxi.1ee66a2a.mjs +rename to dist/shared/nuxi.abb7c9ca.mjs +index d67796eed7973523c0ea95a463a00b0f396cee04..3cd54c1b3d932e8fb182b958e6c01f696079de84 100644 +--- a/dist/shared/nuxi.1ee66a2a.mjs ++++ b/dist/shared/nuxi.abb7c9ca.mjs +@@ -1,6 +1,6 @@ + import require$$0 from 'assert'; + import { g as gray, b as bold, a as green } from './nuxi.a3b9dacd.mjs'; +-import { t as tryRequireModule } from './nuxi.aaefd8a8.mjs'; ++import { t as tryRequireModule } from './nuxi.602e8160.mjs'; + + const version = "3.4.1"; + const engines = { +diff --git a/dist/shared/nuxi.e29c38a1.mjs b/dist/shared/nuxi.cc672940.mjs +similarity index 99% +rename from dist/shared/nuxi.e29c38a1.mjs +rename to dist/shared/nuxi.cc672940.mjs +index 1e6b68daa12e5aca423289b5b4459da77cdfacf8..fac3d372a45faefe422c0fadc6b7eb092dc7dadc 100644 +--- a/dist/shared/nuxi.e29c38a1.mjs ++++ b/dist/shared/nuxi.cc672940.mjs +@@ -1,10 +1,10 @@ + import { promises } from 'node:fs'; +-import { c as consola } from './nuxi.70d48494.mjs'; ++import { c as consola } from './nuxi.114b1a98.mjs'; + import 'node:util'; + import 'node:path'; + import 'node:process'; + import 'tty'; +-import { r as rmRecursive } from './nuxi.d045d192.mjs'; ++import { r as rmRecursive } from './nuxi.2535cbee.mjs'; + import { r as resolve, d as dirname } from './nuxi.ffb4843d.mjs'; + + const defaults = { +diff --git a/dist/shared/nuxi.cb8e73b6.mjs b/dist/shared/nuxi.f4cdb938.mjs +similarity index 97% +rename from dist/shared/nuxi.cb8e73b6.mjs +rename to dist/shared/nuxi.f4cdb938.mjs +index c4c2ca8ee3a6341fb81ade228f4683556f3600fe..982c29ce723f12a061a3f08de2da0ffdb47020d7 100644 +--- a/dist/shared/nuxi.cb8e73b6.mjs ++++ b/dist/shared/nuxi.f4cdb938.mjs +@@ -252,7 +252,7 @@ async function loadDotenv(options) { + const parsed = parse_1(await promises.readFile(dotenvFile, "utf8")); + Object.assign(environment, parsed); + } +- if (!options.env._applied) { ++ if (!options.env?._applied) { + Object.assign(environment, options.env); + environment._applied = true; + } +@@ -273,15 +273,15 @@ function interpolate(target, source = {}, parse = (v) => v) { + return parse( + // eslint-disable-next-line unicorn/no-array-reduce + matches.reduce((newValue, match) => { +- const parts = /(.?)\${?([\w:]+)?}?/g.exec(match); ++ const parts = /(.?)\${?([\w:]+)?}?/g.exec(match) || []; + const prefix = parts[1]; + let value2, replacePart; + if (prefix === "\\") { +- replacePart = parts[0]; ++ replacePart = parts[0] || ""; + value2 = replacePart.replace("\\$", "$"); + } else { + const key = parts[2]; +- replacePart = parts[0].slice(prefix.length); ++ replacePart = (parts[0] || "").slice(prefix.length); + if (parents.includes(key)) { + console.warn( + `Please avoid recursive environment variables ( loop: ${parents.join( \ No newline at end of file diff --git a/patches/nuxt@3.4.1.patch b/patches/nuxt@3.4.1.patch new file mode 100644 index 000000000..d39f22b6d --- /dev/null +++ b/patches/nuxt@3.4.1.patch @@ -0,0 +1,269 @@ +diff --git a/dist/app/composables/asyncData.d.ts b/dist/app/composables/asyncData.d.ts +index 7d89f2dfe3ad4d711a93cf02760e4a820ec32247..e6b49d7078b74aaa8cac2564cf9a87471ea4264b 100644 +--- a/dist/app/composables/asyncData.d.ts ++++ b/dist/app/composables/asyncData.d.ts +@@ -1,8 +1,8 @@ + import type { Ref, WatchSource } from 'vue'; + import type { NuxtApp } from '../nuxt.js'; + export type _Transform = (input: Input) => Output; +-export type PickFrom> = T extends Array ? T : T extends Record ? keyof T extends K[number] ? T : Pick : T; +-export type KeysOf = Array; ++export type PickFrom> = T extends Array ? T : T extends Record ? keyof T extends K[number] ? T : K[number] extends never ? T : Pick : T; ++export type KeysOf = Array; + export type KeyOfRes = KeysOf>; + export type MultiWatchSources = (WatchSource | object)[]; + export interface AsyncDataOptions = KeysOf> { +diff --git a/dist/app/composables/fetch.js b/dist/app/composables/fetch.js +index 2628d0734dc42c67766c89181f1b52a8342765f3..5086556c2fb32073bcb6f8f477c489eeae3a74cf 100644 +--- a/dist/app/composables/fetch.js ++++ b/dist/app/composables/fetch.js +@@ -66,7 +66,7 @@ export function useLazyFetch(request, arg1, arg2) { + ...opts, + lazy: true + }, +- // @ts-ignore ++ // @ts-expect-error we pass an extra argument with the resolved auto-key to prevent another from being injected + autoKey + ); + } +diff --git a/dist/app/composables/ssr.d.ts b/dist/app/composables/ssr.d.ts +index 4e498262a0a9bcfd0aaa832d8b60a606caf6ffad..b785544bbd76f94c44bfdda347f6a37c7688cdac 100644 +--- a/dist/app/composables/ssr.d.ts ++++ b/dist/app/composables/ssr.d.ts +@@ -1,7 +1,9 @@ + import type { H3Event } from 'h3'; + import type { NuxtApp } from '../nuxt.js'; +-export declare function useRequestHeaders(include: K[]): Record, string | undefined>; +-export declare function useRequestHeaders(): Readonly>; ++export declare function useRequestHeaders(include: K[]): { ++ [key in Lowercase]?: string; ++}; ++export declare function useRequestHeaders(): Readonly>; + export declare function useRequestEvent(nuxtApp?: NuxtApp): H3Event; + export declare function useRequestFetch(): typeof global.$fetch; + export declare function setResponseStatus(event: H3Event, code?: number, message?: string): void; +diff --git a/dist/app/nuxt.js b/dist/app/nuxt.js +index a6d3ae923e27c0a79f5d20e8007fa289b640d0b2..c84ca9d167cfd578e10b8c8614895967595e57a7 100644 +--- a/dist/app/nuxt.js ++++ b/dist/app/nuxt.js +@@ -213,7 +213,11 @@ export function useNuxtApp() { + if (!nuxtAppInstance) { + const vm = getCurrentInstance(); + if (!vm) { +- throw new Error("nuxt instance unavailable"); ++ if (process.dev) { ++ throw new Error("[nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function. This is probably not a Nuxt bug. Find out more at `https://nuxt.com/docs/guide/concepts/auto-imports#using-vue-and-nuxt-composables`."); ++ } else { ++ throw new Error("[nuxt] instance unavailable"); ++ } + } + return vm.appContext.app.$nuxt; + } +diff --git a/dist/app/types/augments.d.ts b/dist/app/types/augments.d.ts +index 675af7443d9fdc023cd56d5557e00a587fd517a9..48439981a18e3aeb7d946d54c551b5fea2b08b60 100644 +--- a/dist/app/types/augments.d.ts ++++ b/dist/app/types/augments.d.ts +@@ -22,6 +22,9 @@ declare module 'vue' { + interface App { + $nuxt: NuxtApp + } ++ interface ComponentCustomProperties { ++ $nuxt: NuxtApp ++ } + interface ComponentInternalInstance { + _nuxtOnBeforeMountCbs: Function[] + } +diff --git a/dist/index.mjs b/dist/index.mjs +index df404620b0e13b6e36aa33b8c84aff9680a37bac..ff9d47de6463ece4e56e93a0ef8cb4dd097edf3b 100644 +--- a/dist/index.mjs ++++ b/dist/index.mjs +@@ -288,7 +288,7 @@ const PageMetaPlugin = createUnplugin((options) => { + if (s.hasChanged()) { + return { + code: s.toString(), +- map: options.sourcemap ? s.generateMap({ source: id, includeContent: true }) : void 0 ++ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -747,7 +747,7 @@ const clientFallbackAutoIdPlugin = createUnplugin((options) => { + if (s.hasChanged()) { + return { + code: s.toString(), +- map: options.sourcemap ? s.generateMap({ source: id, includeContent: true }) : void 0 ++ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -765,24 +765,17 @@ const createImportMagicComments = (options) => { + const componentsPluginTemplate = { + filename: "components.plugin.mjs", + getContents({ options }) { +- const globalComponents = options.getComponents().filter((c) => c.global === true); +- return `import { defineAsyncComponent } from 'vue' +-import { defineNuxtPlugin } from '#app/nuxt' +- +-const components = ${genObjectFromRawEntries(globalComponents.map((c) => { +- const exp = c.export === "default" ? "c.default || c" : `c['${c.export}']`; +- const comment = createImportMagicComments(c); +- return [c.pascalName, `defineAsyncComponent(${genDynamicImport(c.filePath, { comment })}.then(c => ${exp}))`]; +- }))} ++ return `import { defineNuxtPlugin } from '#app/nuxt' ++import { lazyGlobalComponents } from '#components' + + export default defineNuxtPlugin({ +- name: 'nuxt:global-components', ++ name: 'nuxt:global-components',` + (options.getComponents().filter((c) => c.global).length ? ` + setup (nuxtApp) { +- for (const name in components) { +- nuxtApp.vueApp.component(name, components[name]) +- nuxtApp.vueApp.component('Lazy' + name, components[name]) ++ for (const name in lazyGlobalComponents) { ++ nuxtApp.vueApp.component(name, lazyGlobalComponents[name]) ++ nuxtApp.vueApp.component('Lazy' + name, lazyGlobalComponents[name]) + } +- } ++ }` : "") + ` + }) + `; + } +@@ -813,6 +806,7 @@ const componentsTemplate = { + return [ + ...imports, + ...components, ++ `export const lazyGlobalComponents = ${genObjectFromRawEntries(options.getComponents().filter((c) => c.global).map((c) => [c.pascalName, `Lazy${c.pascalName}`]))}`, + `export const componentNames = ${JSON.stringify(options.getComponents().filter((c) => !c.island).map((c) => c.pascalName))}` + ].join("\n"); + } +@@ -952,7 +946,7 @@ const loaderPlugin = createUnplugin((options) => { + } + return isVueTemplate(id); + }, +- transform(code, id) { ++ transform(code) { + const components = options.getComponents(); + let num = 0; + const imports = /* @__PURE__ */ new Set(); +@@ -998,7 +992,7 @@ const loaderPlugin = createUnplugin((options) => { + if (s.hasChanged()) { + return { + code: s.toString(), +- map: options.sourcemap ? s.generateMap({ source: id, includeContent: true }) : void 0 ++ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -1030,7 +1024,7 @@ const TreeShakeTemplatePlugin = createUnplugin((options) => { + const { pathname } = parseURL(decodeURIComponent(pathToFileURL(id).href)); + return pathname.endsWith(".vue"); + }, +- transform(code, id) { ++ transform(code) { + const components = options.getComponents(); + if (!regexpMap.has(components)) { + const clientOnlyComponents = components.filter((c) => c.mode === "client" && !components.some((other) => other.mode !== "client" && other.pascalName === c.pascalName && other.filePath !== resolve(distDir, "app/components/server-placeholder"))).flatMap((c) => [c.pascalName, c.kebabName.replaceAll("-", "_")]).concat(["ClientOnly", "client_only"]); +@@ -1086,7 +1080,7 @@ const TreeShakeTemplatePlugin = createUnplugin((options) => { + if (s.hasChanged()) { + return { + code: s.toString(), +- map: options.sourcemap ? s.generateMap({ source: id, includeContent: true }) : void 0 ++ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -1470,7 +1464,7 @@ const TransformPlugin = createUnplugin(({ ctx, options, sourcemap }) => { + if (s.hasChanged()) { + return { + code: s.toString(), +- map: sourcemap ? s.generateMap({ source: id, includeContent: true }) : void 0 ++ map: sourcemap ? s.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -1817,7 +1811,7 @@ const UnctxTransformPlugin = createUnplugin((options) => { + return true; + } + }, +- transform(code, id) { ++ transform(code) { + if (code.startsWith(TRANSFORM_MARKER) || !transformer.shouldTransform(code)) { + return; + } +@@ -1825,7 +1819,7 @@ const UnctxTransformPlugin = createUnplugin((options) => { + if (result) { + return { + code: TRANSFORM_MARKER + result.code, +- map: options.sourcemap ? result.magicString.generateMap({ source: id, includeContent: true }) : void 0 ++ map: options.sourcemap ? result.magicString.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -1848,7 +1842,7 @@ const TreeShakeComposablesPlugin = createUnplugin((options) => { + return true; + } + }, +- transform(code, id) { ++ transform(code) { + if (!code.match(COMPOSABLE_RE)) { + return; + } +@@ -1860,7 +1854,7 @@ const TreeShakeComposablesPlugin = createUnplugin((options) => { + if (s.hasChanged()) { + return { + code: s.toString(), +- map: options.sourcemap ? s.generateMap({ source: id, includeContent: true }) : void 0 ++ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -1879,7 +1873,7 @@ const DevOnlyPlugin = createUnplugin((options) => { + return true; + } + }, +- transform(code, id) { ++ transform(code) { + if (!code.match(DEVONLY_COMP_RE)) { + return; + } +@@ -1891,7 +1885,7 @@ const DevOnlyPlugin = createUnplugin((options) => { + if (s.hasChanged()) { + return { + code: s.toString(), +- map: options.sourcemap ? s.generateMap({ source: id, includeContent: true }) : void 0 ++ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -1950,7 +1944,7 @@ const LayerAliasingPlugin = createUnplugin((options) => { + if (s.hasChanged()) { + return { + code: s.toString(), +- map: options.sourcemap ? s.generateMap({ source: id, includeContent: true }) : void 0 ++ map: options.sourcemap ? s.generateMap({ hires: true }) : void 0 + }; + } + } +@@ -2018,7 +2012,7 @@ async function initNitro(nuxt) { + analyze: nuxt.options.build.analyze && { + template: "treemap", + projectRoot: nuxt.options.rootDir, +- filename: join(nuxt.options.rootDir, ".nuxt/stats", "{name}.html") ++ filename: join(nuxt.options.analyzeDir, "{name}.html") + }, + scanDirs: nuxt.options._layers.map((layer) => (layer.config.serverDir || layer.config.srcDir) && resolve(layer.cwd, layer.config.serverDir || resolve(layer.config.srcDir, "server"))).filter(Boolean), + renderer: resolve(distDir, "core/runtime/nitro/renderer"), +@@ -2944,12 +2938,10 @@ const nuxtConfigTemplate = { + function _resolveId(id) { + return resolvePath$1(id, { + url: [ +- // @ts-ignore +- global.__NUXT_PREPATHS__, ++ ...typeof global.__NUXT_PREPATHS__ === "string" ? [global.__NUXT_PREPATHS__] : global.__NUXT_PREPATHS__ || [], + import.meta.url, + process.cwd(), +- // @ts-ignore +- global.__NUXT_PATHS__ ++ ...typeof global.__NUXT_PATHS__ === "string" ? [global.__NUXT_PATHS__] : global.__NUXT_PATHS__ || [] + ] + }); + } \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0c523b195..5c45102ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,13 @@ lockfileVersion: '6.0' +patchedDependencies: + nuxi@3.4.1: + hash: nopqflyjqxj7zlj77o5zpmrlrm + path: patches/nuxi@3.4.1.patch + nuxt@3.4.1: + hash: 5c5ckbvnxlcdfbjdydscylrqb4 + path: patches/nuxt@3.4.1.patch + importers: .: @@ -63,7 +71,7 @@ importers: version: 13.2.1 nuxt: specifier: ^3.4.1 - version: 3.4.1(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) + version: 3.4.1(patch_hash=5c5ckbvnxlcdfbjdydscylrqb4)(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) pathe: specifier: ^1.1.0 version: 1.1.0 @@ -90,7 +98,7 @@ importers: version: 0.2.0(rollup@3.20.2) nuxt: specifier: ^3.4.1 - version: 3.4.1(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) + version: 3.4.1(patch_hash=5c5ckbvnxlcdfbjdydscylrqb4)(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) packages/devtools: dependencies: @@ -250,7 +258,7 @@ importers: version: 4.0.2 nuxt: specifier: ^3.4.1 - version: 3.4.1(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) + version: 3.4.1(patch_hash=5c5ckbvnxlcdfbjdydscylrqb4)(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) nuxt-vitest: specifier: ^0.6.9 version: 0.6.9(rollup@3.20.2)(vite@4.1.4)(vue@3.2.47) @@ -307,7 +315,7 @@ importers: version: 7.1.1 nuxt: specifier: ^3.3.1 - version: 3.4.1(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) + version: 3.4.1(patch_hash=5c5ckbvnxlcdfbjdydscylrqb4)(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) vite: specifier: '*' version: 4.1.4(@types/node@18.15.11) @@ -387,7 +395,7 @@ importers: devDependencies: nuxt: specifier: ^3.4.1 - version: 3.4.1(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) + version: 3.4.1(patch_hash=5c5ckbvnxlcdfbjdydscylrqb4)(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) packages/devtools-wizard: dependencies: @@ -3121,7 +3129,7 @@ packages: '@vueuse/core': 10.0.2(vue@3.2.47) '@vueuse/metadata': 10.0.2 local-pkg: 0.4.3 - nuxt: 3.4.1(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) + nuxt: 3.4.1(patch_hash=5c5ckbvnxlcdfbjdydscylrqb4)(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) vue-demi: 0.14.0(vue@3.2.47) transitivePeerDependencies: - '@vue/composition-api' @@ -3138,7 +3146,7 @@ packages: '@vueuse/core': 9.13.0(vue@3.2.47) '@vueuse/metadata': 9.13.0 local-pkg: 0.4.3 - nuxt: 3.4.1(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) + nuxt: 3.4.1(patch_hash=5c5ckbvnxlcdfbjdydscylrqb4)(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0) vue-demi: 0.14.0(vue@3.2.47) transitivePeerDependencies: - '@vue/composition-api' @@ -8234,12 +8242,13 @@ packages: dependencies: boolbase: 1.0.0 - /nuxi@3.4.1: + /nuxi@3.4.1(patch_hash=nopqflyjqxj7zlj77o5zpmrlrm): resolution: {integrity: sha512-vp6unzdCxRvWyKoQCMN0Qq6D8ETqV5INuwAWG1WfhINXiQ34WRvwcTwU2zxKe29pzek1gGF30mxWK50OXGSepw==} engines: {node: ^14.18.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0} hasBin: true optionalDependencies: fsevents: 2.3.2 + patched: true /nuxt-component-meta@0.5.1(rollup@3.20.2): resolution: {integrity: sha512-vwx5wySyVX+QbFrNb3wLYNMPlADho8E66MO45d5i5fTlEkmhopVpQ9YXwlAvM3pLCPjupxG3R3D5rKpLDeitkw==} @@ -8308,7 +8317,7 @@ packages: - vue dev: true - /nuxt@3.4.1(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0): + /nuxt@3.4.1(patch_hash=5c5ckbvnxlcdfbjdydscylrqb4)(@types/node@18.15.11)(eslint@8.38.0)(rollup@3.20.2)(typescript@5.0.4)(vue-tsc@1.2.0): resolution: {integrity: sha512-wKT5iZebO1D7QtAN1fDNNsjaTFbAC5pO4kWzw2qX2OOg2SWP/k42sCfxbcz/JkLL4FJVwpya+9OD9/2MwEdt1g==} engines: {node: ^14.18.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0} hasBin: true @@ -8344,7 +8353,7 @@ packages: magic-string: 0.30.0 mlly: 1.2.0 nitropack: 2.3.3 - nuxi: 3.4.1 + nuxi: 3.4.1(patch_hash=nopqflyjqxj7zlj77o5zpmrlrm) nypm: 0.2.0 ofetch: 1.0.1 ohash: 1.0.0 @@ -8388,6 +8397,7 @@ packages: - vls - vti - vue-tsc + patched: true /nypm@0.2.0: resolution: {integrity: sha512-auBv78LkHyU9TywBE91N+RTkanVyFLsVayZaHW+YYvJDJ3u2PCwLaYB3eecPQD9tgCIXGuH871HlHTdKSf6rtw==} From e9e2b07db0c84bff8ad7a8a0de0155fa8c022b2d Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 19 Apr 2023 14:31:32 +0200 Subject: [PATCH 02/15] feat: update --- package.json | 8 +- .../devtools-kit/src/_types/analyze-build.ts | 7 +- packages/devtools-ui-kit/package.json | 14 +- .../devtools/client/pages/modules/build.vue | 72 +- packages/devtools/package.json | 14 +- packages/devtools/src/constant.ts | 1 + .../src/integrations/analyze-build.ts | 17 +- packages/devtools/src/module-main.ts | 13 +- .../devtools/src/server-rpc/analyze-build.ts | 23 +- patches/@nuxt__schema@3.4.1.patch | 620 ++++++ patches/nuxi@3.4.1.patch | 4 +- pnpm-lock.yaml | 1939 +++++++++++------ 12 files changed, 2016 insertions(+), 716 deletions(-) create mode 100644 patches/@nuxt__schema@3.4.1.patch diff --git a/package.json b/package.json index 2db1ccca7..ef3b205ce 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@nuxt/devtools": "workspace:*", "@nuxt/devtools-ui-kit": "workspace:*", "@nuxt/module-builder": "^0.3.0", + "@nuxt/schema": "^3.4.1", "@types/fs-extra": "^11.0.1", "@types/markdown-it": "^12.2.3", "@types/node": "^18.15.11", @@ -28,7 +29,7 @@ "@types/wait-on": "^5.3.1", "@types/which": "^3.0.0", "@types/ws": "^8.5.4", - "@unocss/eslint-config": "^0.51.4", + "@unocss/eslint-config": "^0.51.5", "bumpp": "^9.1.0", "conventional-changelog-cli": "^2.2.2", "eslint": "^8.38.0", @@ -39,13 +40,14 @@ "pathe": "^1.1.0", "simple-git-hooks": "^2.8.1", "typescript": "^5.0.4", - "unocss": "^0.51.4", + "unocss": "^0.51.5", "vue-tsc": "^1.2.0" }, "pnpm": { "patchedDependencies": { "nuxi@3.4.1": "patches/nuxi@3.4.1.patch", - "nuxt@3.4.1": "patches/nuxt@3.4.1.patch" + "nuxt@3.4.1": "patches/nuxt@3.4.1.patch", + "@nuxt/schema@3.4.1": "patches/@nuxt__schema@3.4.1.patch" } }, "simple-git-hooks": { diff --git a/packages/devtools-kit/src/_types/analyze-build.ts b/packages/devtools-kit/src/_types/analyze-build.ts index c1f9d43d3..8cf38526f 100644 --- a/packages/devtools-kit/src/_types/analyze-build.ts +++ b/packages/devtools-kit/src/_types/analyze-build.ts @@ -1,9 +1,6 @@ -export interface AnalyticBuild { - buildTime: number - dir: string -} +import type { NuxtAnalyzeMeta } from '@nuxt/schema' export interface AnalyticBuildInfo { isBuilding: boolean - lastBuild?: AnalyticBuild + lastBuild?: NuxtAnalyzeMeta } diff --git a/packages/devtools-ui-kit/package.json b/packages/devtools-ui-kit/package.json index 631300c4c..cfb1efc9a 100644 --- a/packages/devtools-ui-kit/package.json +++ b/packages/devtools-ui-kit/package.json @@ -38,18 +38,18 @@ "@nuxt/devtools-kit": "workspace:*", "@nuxt/kit": "^3.4.1", "@nuxtjs/color-mode": "^3.2.0", - "@unocss/core": "^0.51.4", - "@unocss/nuxt": "^0.51.4", - "@unocss/preset-attributify": "^0.51.4", - "@unocss/preset-icons": "^0.51.4", - "@unocss/preset-mini": "^0.51.4", - "@unocss/reset": "^0.51.4", + "@unocss/core": "^0.51.5", + "@unocss/nuxt": "^0.51.5", + "@unocss/preset-attributify": "^0.51.5", + "@unocss/preset-icons": "^0.51.5", + "@unocss/preset-mini": "^0.51.5", + "@unocss/reset": "^0.51.5", "@vueuse/core": "^10.0.2", "@vueuse/integrations": "^10.0.2", "@vueuse/nuxt": "^10.0.2", "defu": "^6.1.2", "focus-trap": "^7.4.0", - "unocss": "^0.51.4", + "unocss": "^0.51.5", "v-lazy-show": "^0.2.2" }, "devDependencies": { diff --git a/packages/devtools/client/pages/modules/build.vue b/packages/devtools/client/pages/modules/build.vue index 935a38c1c..65fad782b 100644 --- a/packages/devtools/client/pages/modules/build.vue +++ b/packages/devtools/client/pages/modules/build.vue @@ -1,10 +1,12 @@