From 9bdce707cbf1731495c29adc91251b8e6287f832 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 13 Jun 2024 17:00:09 +0200 Subject: [PATCH] refactor!: use `nitro` as canonical name --- build.config.ts | 13 ++++++------- examples/graceful-shutdown/nitro.config.ts | 2 +- package.json | 4 ++-- playground/nitro.config.ts | 2 +- scripts/gen-presets.ts | 6 +++--- src/cli/commands/build.ts | 2 +- src/cli/commands/dev.ts | 4 ++-- src/cli/commands/prepare.ts | 2 +- src/cli/commands/task/list.ts | 2 +- src/cli/commands/task/run.ts | 2 +- src/cli/index.ts | 2 +- src/config/index.ts | 4 ++-- src/core/build/assets.ts | 4 ++-- src/core/build/build.ts | 4 ++-- src/core/build/dev.ts | 2 +- src/core/build/prepare.ts | 2 +- src/core/build/prod.ts | 6 +++--- src/core/build/types.ts | 18 +++++++++--------- src/core/config/defaults.ts | 8 ++++---- src/core/config/loader.ts | 12 ++++++------ src/core/config/resolvers/assets.ts | 2 +- src/core/config/resolvers/compatibility.ts | 4 ++-- src/core/config/resolvers/database.ts | 4 ++-- src/core/config/resolvers/export-conditions.ts | 2 +- src/core/config/resolvers/fetch.ts | 2 +- src/core/config/resolvers/imports.ts | 4 ++-- src/core/config/resolvers/open-api.ts | 8 ++++---- src/core/config/resolvers/paths.ts | 6 +++--- src/core/config/resolvers/route-rules.ts | 2 +- src/core/config/resolvers/runtime-config.ts | 2 +- src/core/config/resolvers/storage.ts | 2 +- src/core/config/resolvers/url.ts | 2 +- src/core/config/update.ts | 2 +- src/core/dev-server/error.ts | 2 +- src/core/dev-server/server.ts | 4 ++-- src/core/dev-server/vfs.ts | 2 +- src/core/module.ts | 2 +- src/core/nitro.ts | 6 +++--- src/core/prerender/prerender.ts | 4 ++-- src/core/prerender/utils.ts | 2 +- src/core/scan.ts | 2 +- src/core/task.ts | 2 +- src/core/utils/compress.ts | 2 +- src/core/utils/nitro.ts | 2 +- src/core/utils/storage.ts | 2 +- src/kit/path.ts | 2 +- src/kit/preset.ts | 2 +- src/presets/_nitro/base-worker.ts | 2 +- src/presets/_nitro/nitro-dev.ts | 2 +- src/presets/_nitro/nitro-prerender.ts | 2 +- src/presets/_nitro/runtime/nitro-dev.ts | 8 ++++---- .../_nitro/runtime/nitro-prerenderer.ts | 4 ++-- src/presets/_nitro/runtime/service-worker.ts | 2 +- src/presets/_nitro/service-worker.ts | 4 ++-- src/presets/_resolve.ts | 2 +- src/presets/_static/preset.ts | 2 +- src/presets/alwaysdata/preset.ts | 2 +- src/presets/aws-amplify/preset.ts | 2 +- src/presets/aws-amplify/runtime/aws-amplify.ts | 2 +- src/presets/aws-amplify/utils.ts | 2 +- src/presets/aws-lambda/preset.ts | 2 +- .../aws-lambda/runtime/aws-lambda-streaming.ts | 4 ++-- src/presets/aws-lambda/runtime/aws-lambda.ts | 6 +++--- src/presets/azure/preset.ts | 4 ++-- src/presets/azure/runtime/azure-functions.ts | 6 +++--- src/presets/azure/runtime/azure-swa.ts | 6 +++--- src/presets/azure/utils.ts | 4 ++-- src/presets/bun/preset.ts | 2 +- src/presets/bun/runtime/bun.ts | 4 ++-- src/presets/cleavr/preset.ts | 2 +- src/presets/cloudflare/preset.ts | 6 +++--- .../cloudflare/runtime/cloudflare-module.ts | 8 ++++---- .../cloudflare/runtime/cloudflare-pages.ts | 6 +++--- .../cloudflare/runtime/cloudflare-worker.ts | 6 +++--- src/presets/cloudflare/types.ts | 2 +- src/presets/cloudflare/utils.ts | 2 +- src/presets/deno/preset.ts | 6 +++--- src/presets/deno/runtime/deno-deploy.ts | 2 +- src/presets/deno/runtime/deno-server.ts | 6 +++--- src/presets/digitalocean/preset.ts | 2 +- src/presets/edgio/preset.ts | 2 +- src/presets/firebase/preset.ts | 2 +- src/presets/firebase/runtime/firebase-gen-1.ts | 4 ++-- src/presets/firebase/runtime/firebase-gen-2.ts | 4 ++-- src/presets/firebase/utils.ts | 4 ++-- src/presets/flightcontrol/preset.ts | 2 +- src/presets/heroku/preset.ts | 2 +- src/presets/iis/preset.ts | 4 ++-- src/presets/iis/utils.ts | 4 ++-- src/presets/koyeb/preset.ts | 2 +- src/presets/netlify/legacy/preset.ts | 6 +++--- .../netlify/legacy/runtime/netlify-edge.ts | 2 +- .../netlify/legacy/runtime/netlify-lambda.ts | 6 +++--- src/presets/netlify/legacy/runtime/netlify.ts | 2 +- src/presets/netlify/legacy/utils.ts | 2 +- src/presets/netlify/preset.ts | 6 +++--- src/presets/netlify/runtime/netlify-edge.ts | 2 +- src/presets/netlify/runtime/netlify.ts | 6 +++--- src/presets/netlify/utils.ts | 2 +- src/presets/node/preset.ts | 2 +- src/presets/node/runtime/cli.ts | 2 +- src/presets/node/runtime/cluster.ts | 4 ++-- src/presets/node/runtime/node-listener.ts | 6 +++--- src/presets/node/runtime/node-server.ts | 10 +++++----- src/presets/platform.sh/preset.ts | 2 +- src/presets/render.com/preset.ts | 2 +- src/presets/stormkit/preset.ts | 2 +- src/presets/stormkit/runtime/stormkit.ts | 4 ++-- src/presets/vercel/preset.ts | 4 ++-- src/presets/vercel/runtime/vercel-edge.ts | 2 +- src/presets/vercel/runtime/vercel.ts | 2 +- src/presets/vercel/utils.ts | 4 ++-- src/presets/winterjs/preset.ts | 2 +- src/presets/winterjs/runtime/winterjs.ts | 4 ++-- src/presets/zeabur/preset.ts | 6 +++--- src/presets/zeabur/runtime/zeabur.ts | 2 +- src/rollup/config.ts | 8 ++++---- src/rollup/plugins/app-config.ts | 2 +- src/rollup/plugins/database.ts | 2 +- src/rollup/plugins/esbuild.ts | 2 +- src/rollup/plugins/externals-legacy.ts | 2 +- src/rollup/plugins/externals.ts | 4 ++-- src/rollup/plugins/handlers-meta.ts | 2 +- src/rollup/plugins/handlers.ts | 8 ++------ src/rollup/plugins/import-meta.ts | 2 +- src/rollup/plugins/public-assets.ts | 4 ++-- src/rollup/plugins/raw.ts | 2 +- src/rollup/plugins/server-assets.ts | 2 +- src/rollup/plugins/storage.ts | 2 +- src/rollup/plugins/virtual.ts | 2 +- src/runtime/internal/app.ts | 10 +++------- src/runtime/internal/cache.ts | 2 +- src/runtime/internal/client.ts | 2 +- src/runtime/internal/config.ts | 2 +- src/runtime/internal/context.ts | 2 +- src/runtime/internal/error.ts | 2 +- src/runtime/internal/meta.ts | 2 +- src/runtime/internal/plugin.ts | 2 +- src/runtime/internal/renderer.ts | 2 +- src/runtime/internal/route-rules.ts | 2 +- src/runtime/internal/shutdown.ts | 2 +- src/runtime/internal/static.ts | 2 +- src/runtime/internal/task.ts | 2 +- src/types/config.ts | 6 +----- src/types/h3.ts | 2 +- src/types/handler.ts | 2 +- src/types/nitro.ts | 2 +- src/types/virtual/error-handler.d.ts | 2 +- src/types/virtual/server-handlers-meta.d.ts | 2 +- src/types/virtual/tasks.ts | 2 +- test/fixture/nitro.config.ts | 2 +- test/fixture/routes/file.ts | 2 +- test/fixture/tsconfig.json | 12 ------------ test/fixture/types.ts | 6 +++--- test/scripts/gen-fixture-types.ts | 3 ++- test/tests.ts | 4 ++-- tsconfig.json | 13 ------------- 157 files changed, 263 insertions(+), 300 deletions(-) diff --git a/build.config.ts b/build.config.ts index 46fa8d8db1..f644c5abea 100644 --- a/build.config.ts +++ b/build.config.ts @@ -42,12 +42,11 @@ export default defineBuildConfig({ { input: "src/types/index.ts" }, ], alias: { - nitropack: "nitropack", - "nitropack/meta": resolve(srcDir, "../meta.ts"), - "nitropack/runtime/meta": resolve(srcDir, "../runtime-meta.mjs"), + "nitro/meta": resolve(srcDir, "../meta.ts"), + "nitro/runtime/meta": resolve(srcDir, "../runtime-meta.mjs"), ...Object.fromEntries( subpaths.map((subpath) => [ - `nitropack/${subpath}`, + `nitro/${subpath}`, resolve(srcDir, `${subpath}/index.ts`), ]) ), @@ -63,9 +62,9 @@ export default defineBuildConfig({ }, }, externals: [ - "nitropack", - "nitropack/runtime/meta", - ...subpaths.map((subpath) => `nitropack/${subpath}`), + "nitro", + "nitro/runtime/meta", + ...subpaths.map((subpath) => `nitro/${subpath}`), "firebase-functions", "@scalar/api-reference", ], diff --git a/examples/graceful-shutdown/nitro.config.ts b/examples/graceful-shutdown/nitro.config.ts index c19a01864d..cdb7c35d19 100644 --- a/examples/graceful-shutdown/nitro.config.ts +++ b/examples/graceful-shutdown/nitro.config.ts @@ -1,3 +1,3 @@ -import { defineNitroConfig } from "nitropack/config"; +import { defineNitroConfig } from "nitro/config"; export default defineNitroConfig({}); diff --git a/package.json b/package.json index 0e72da811e..11a3d66f34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "nitropack", - "version": "2.9.6", + "name": "nitro", + "version": "3.0.0", "description": "Build and Deploy Universal JavaScript Servers", "repository": "unjs/nitro", "license": "MIT", diff --git a/playground/nitro.config.ts b/playground/nitro.config.ts index b56bcebd47..42a5b5fde6 100644 --- a/playground/nitro.config.ts +++ b/playground/nitro.config.ts @@ -1,4 +1,4 @@ -import { defineNitroConfig } from "nitropack/config"; +import { defineNitroConfig } from "nitro/config"; export default defineNitroConfig({ compatibilityDate: "2024-06-12", diff --git a/scripts/gen-presets.ts b/scripts/gen-presets.ts index 930d065ac3..412c4cc6cd 100644 --- a/scripts/gen-presets.ts +++ b/scripts/gen-presets.ts @@ -4,7 +4,7 @@ import { kebabCase, camelCase, pascalCase, snakeCase } from "scule"; import { readdirSync, existsSync, writeFileSync, readFileSync } from "node:fs"; import { resolve } from "node:path"; import { fileURLToPath } from "node:url"; -import type { NitroPreset, NitroPresetMeta } from "nitropack/types"; +import type { NitroPreset, NitroPresetMeta } from "nitro/types"; import { findTypeExports } from "mlly"; import { subpaths } from "../build.config"; @@ -25,10 +25,10 @@ const jitiRequire = createJITI(presetsDir, { esmResolve: true, interopDefault: true, alias: { - nitropack: fileURLToPath(new URL("../src/core/index.ts", import.meta.url)), + nitro: fileURLToPath(new URL("../src/core/index.ts", import.meta.url)), ...Object.fromEntries( subpaths.map((pkg) => [ - `nitropack/${pkg}`, + `nitro/${pkg}`, fileURLToPath(new URL(`../src/${pkg}/index.ts`, import.meta.url)), ]) ), diff --git a/src/cli/commands/build.ts b/src/cli/commands/build.ts index 6c4c6365bb..50ec214d37 100644 --- a/src/cli/commands/build.ts +++ b/src/cli/commands/build.ts @@ -6,7 +6,7 @@ import { build, prepare, copyPublicAssets, -} from "nitropack/core"; +} from "nitro/core"; import { commonArgs } from "../common"; import type { DateString } from "compatx"; diff --git a/src/cli/commands/dev.ts b/src/cli/commands/dev.ts index 191db56e90..2ff5d68d5e 100644 --- a/src/cli/commands/dev.ts +++ b/src/cli/commands/dev.ts @@ -2,9 +2,9 @@ import { defineCommand } from "citty"; import { resolve } from "pathe"; import { consola } from "consola"; import { getArgs, parseArgs } from "listhen/cli"; -import { createNitro, build, prepare, createDevServer } from "nitropack/core"; +import { createNitro, build, prepare, createDevServer } from "nitro/core"; import { commonArgs } from "../common"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; const hmrKeyRe = /^runtimeConfig\.|routeRules\./; diff --git a/src/cli/commands/prepare.ts b/src/cli/commands/prepare.ts index 6d812590bd..529759115e 100644 --- a/src/cli/commands/prepare.ts +++ b/src/cli/commands/prepare.ts @@ -1,6 +1,6 @@ import { defineCommand } from "citty"; import { resolve } from "pathe"; -import { createNitro, writeTypes } from "nitropack/core"; +import { createNitro, writeTypes } from "nitro/core"; import { commonArgs } from "../common"; export default defineCommand({ diff --git a/src/cli/commands/task/list.ts b/src/cli/commands/task/list.ts index 6aab75d967..1e9177c463 100644 --- a/src/cli/commands/task/list.ts +++ b/src/cli/commands/task/list.ts @@ -1,7 +1,7 @@ import { defineCommand } from "citty"; import { resolve } from "pathe"; import { consola } from "consola"; -import { listTasks } from "nitropack/core"; +import { listTasks } from "nitro/core"; export default defineCommand({ meta: { diff --git a/src/cli/commands/task/run.ts b/src/cli/commands/task/run.ts index e01440f2ee..2d1bbcafcd 100644 --- a/src/cli/commands/task/run.ts +++ b/src/cli/commands/task/run.ts @@ -2,7 +2,7 @@ import { defineCommand } from "citty"; import { resolve } from "pathe"; import destr from "destr"; import { consola } from "consola"; -import { runTask } from "nitropack/core"; +import { runTask } from "nitro/core"; export default defineCommand({ meta: { diff --git a/src/cli/index.ts b/src/cli/index.ts index 6859e5e960..bc3f21d7bb 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node import { defineCommand, runMain } from "citty"; -import { version as nitroVersion } from "nitropack/meta"; +import { version as nitroVersion } from "nitro/meta"; const main = defineCommand({ meta: { diff --git a/src/config/index.ts b/src/config/index.ts index 4e591e5a59..97307d0289 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,6 +1,6 @@ -import type { NitroConfig } from "nitropack/types"; +import type { NitroConfig } from "nitro/types"; -export type { NitroConfig } from "nitropack/types"; +export type { NitroConfig } from "nitro/types"; export function defineNitroConfig(config: NitroConfig): NitroConfig { return config; diff --git a/src/core/build/assets.ts b/src/core/build/assets.ts index 1d622ee693..44f83a7c91 100644 --- a/src/core/build/assets.ts +++ b/src/core/build/assets.ts @@ -1,8 +1,8 @@ import { existsSync, promises as fsp } from "node:fs"; import { relative, resolve, join } from "pathe"; import { globby } from "globby"; -import { prettyPath, isDirectory } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { prettyPath, isDirectory } from "nitro/kit"; +import type { Nitro } from "nitro/types"; import { compressPublicAssets } from "../utils/compress"; const NEGATION_RE = /^(!?)(.*)$/; diff --git a/src/core/build/build.ts b/src/core/build/build.ts index 6a75e4b8c0..87a5d8a800 100644 --- a/src/core/build/build.ts +++ b/src/core/build/build.ts @@ -1,5 +1,5 @@ -import { getRollupConfig } from "nitropack/rollup"; -import type { Nitro } from "nitropack/types"; +import { getRollupConfig } from "nitro/rollup"; +import type { Nitro } from "nitro/types"; import { watchDev } from "./dev"; import { buildProduction } from "./prod"; diff --git a/src/core/build/dev.ts b/src/core/build/dev.ts index 817f3da03a..d4c4ae20a9 100644 --- a/src/core/build/dev.ts +++ b/src/core/build/dev.ts @@ -3,7 +3,7 @@ import * as rollup from "rollup"; import { watch } from "chokidar"; import { debounce } from "perfect-debounce"; import { GLOB_SCAN_PATTERN, scanHandlers } from "../scan"; -import type { Nitro, RollupConfig } from "nitropack/types"; +import type { Nitro, RollupConfig } from "nitro/types"; import { writeTypes } from "./types"; import defu from "defu"; import { formatRollupError } from "./error"; diff --git a/src/core/build/prepare.ts b/src/core/build/prepare.ts index 107d9e4ce2..c34a596b7f 100644 --- a/src/core/build/prepare.ts +++ b/src/core/build/prepare.ts @@ -1,6 +1,6 @@ import fsp from "node:fs/promises"; import fse from "fs-extra"; -import type { Nitro } from "nitropack"; +import type { Nitro } from "nitro/types"; export async function prepare(nitro: Nitro) { await prepareDir(nitro.options.output.dir); diff --git a/src/core/build/prod.ts b/src/core/build/prod.ts index 8db1ddec27..0dd63be85a 100644 --- a/src/core/build/prod.ts +++ b/src/core/build/prod.ts @@ -2,10 +2,10 @@ import { promises as fsp } from "node:fs"; import { relative, resolve, join, dirname } from "pathe"; import * as rollup from "rollup"; import { generateFSTree } from "../utils/fs-tree"; -import { writeFile } from "nitropack/kit"; +import { writeFile } from "nitro/kit"; import { scanHandlers } from "../scan"; -import type { Nitro, NitroBuildInfo, RollupConfig } from "nitropack/types"; -import { version as nitroVersion } from "nitropack/meta"; +import type { Nitro, NitroBuildInfo, RollupConfig } from "nitro/types"; +import { version as nitroVersion } from "nitro/meta"; import { snapshotStorage } from "../utils/storage"; import { formatRollupError } from "./error"; import { writeTypes } from "./types"; diff --git a/src/core/build/types.ts b/src/core/build/types.ts index 2527a20d75..bc748a2876 100644 --- a/src/core/build/types.ts +++ b/src/core/build/types.ts @@ -10,9 +10,9 @@ import { resolvePath, } from "mlly"; import { JSValue, generateTypes, resolveSchema } from "untyped"; -import { writeFile, isDirectory, resolveNitroPath } from "nitropack/kit"; -import type { Nitro, NitroTypes } from "nitropack/types"; -import { runtimeDir } from "nitropack/runtime/meta"; +import { writeFile, isDirectory, resolveNitroPath } from "nitro/kit"; +import type { Nitro, NitroTypes } from "nitro/types"; +import { runtimeDir } from "nitro/runtime/meta"; import { relative } from "pathe"; export async function writeTypes(nitro: Nitro) { @@ -103,8 +103,8 @@ export async function writeTypes(nitro: Nitro) { const routes = [ "// Generated by nitro", - 'import type { Serialize, Simplify } from "nitropack/types";', - 'declare module "nitropack/types" {', + 'import type { Serialize, Simplify } from "nitro/types";', + 'declare module "nitro/types" {', " type Awaited = T extends PromiseLike ? Awaited : T", " interface InternalApi {", ...Object.entries(types.routes).map(([path, methods]) => @@ -140,7 +140,7 @@ type UserAppConfig = Defu<{}, [${nitro.options.appConfigFiles .map((_, index: number) => `typeof appConfig${index}`) .join(", ")}]> -declare module "nitropack/types" { +declare module "nitro/types" { interface AppConfig extends UserAppConfig {}`, nitro.options.typescript.generateRuntimeConfigTypes ? generateTypes( @@ -166,7 +166,7 @@ declare module "nitropack/types" { ]; const declarations = [ - // local nitropack augmentations + // local nitro augmentations '/// ', '/// ', // global server auto-imports @@ -250,13 +250,13 @@ declare module "nitropack/types" { ], ...(nitro.options.typescript.internalPaths ? { - "nitropack/runtime": [ + "nitro/runtime": [ relativeWithDot(tsconfigDir, join(runtimeDir, "index")), ], "#internal/nitro": [ relativeWithDot(tsconfigDir, join(runtimeDir, "index")), ], - "nitropack/runtime/*": [ + "nitro/runtime/*": [ relativeWithDot(tsconfigDir, join(runtimeDir, "*")), ], "#internal/nitro/*": [ diff --git a/src/core/config/defaults.ts b/src/core/config/defaults.ts index f9e5edb24c..1278e207dc 100644 --- a/src/core/config/defaults.ts +++ b/src/core/config/defaults.ts @@ -1,7 +1,7 @@ import { isTest, isDebug } from "std-env"; -import type { NitroConfig } from "nitropack/types"; +import type { NitroConfig } from "nitro/types"; import { resolve } from "pathe"; -import { runtimeDir } from "nitropack/runtime/meta"; +import { runtimeDir } from "nitro/runtime/meta"; export const NitroDefaults: NitroConfig = { // General @@ -58,8 +58,8 @@ export const NitroDefaults: NitroConfig = { baseURL: process.env.NITRO_APP_BASE_URL || "/", handlers: [], devHandlers: [], - // errorHandler: "nitropack/runtime/internal/error", - errorHandler: "#internal/nitro/error", + // errorHandler: "nitro/runtime/internal/error", + errorHandler: "#internal/nitro/internal/error", routeRules: {}, prerender: { autoSubfolderIndex: true, diff --git a/src/core/config/loader.ts b/src/core/config/loader.ts index 3aef437c56..a63a5d965c 100644 --- a/src/core/config/loader.ts +++ b/src/core/config/loader.ts @@ -6,8 +6,8 @@ import type { NitroConfig, NitroOptions, NitroPresetMeta, -} from "nitropack/types"; -import type { PresetName } from "nitropack/presets"; +} from "nitro/types"; +import type { PresetName } from "nitro/presets"; import { NitroDefaults } from "./defaults"; @@ -81,8 +81,8 @@ async function _loadUserConfig( // Preset resolver const { resolvePreset } = (await import( - "nitropack/" + "presets" - )) as typeof import("nitropack/presets"); + "nitro/" + "presets" + )) as typeof import("nitro/presets"); const loadedConfig = await (opts.watch ? watchConfig @@ -114,8 +114,8 @@ async function _loadUserConfig( defaults: NitroDefaults, jitiOptions: { alias: { - nitropack: "nitropack/config", - "nitropack/config": "nitropack/config", + nitropack: "nitro/config", + "nitro/config": "nitro/config", }, }, async resolve(id: string) { diff --git a/src/core/config/resolvers/assets.ts b/src/core/config/resolvers/assets.ts index 9ca4560025..31911db724 100644 --- a/src/core/config/resolvers/assets.ts +++ b/src/core/config/resolvers/assets.ts @@ -2,7 +2,7 @@ import { resolve } from "pathe"; import { existsSync } from "node:fs"; import { withLeadingSlash, withoutTrailingSlash } from "ufo"; import { defu } from "defu"; -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; export async function resolveAssetsOptions(options: NitroOptions) { // Public Assets diff --git a/src/core/config/resolvers/compatibility.ts b/src/core/config/resolvers/compatibility.ts index 019f0f4063..b62f2ed587 100644 --- a/src/core/config/resolvers/compatibility.ts +++ b/src/core/config/resolvers/compatibility.ts @@ -5,7 +5,7 @@ import { } from "compatx"; import _consola from "consola"; import { colorize } from "consola/utils"; -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; import { relative } from "pathe"; // Nitro v2.9.6 release @@ -104,7 +104,7 @@ async function _resolveDefault(options: NitroOptions): Promise { function _getDefaultNitroConfig() { return /* js */ ` -import { defineNitroConfig } from 'nitropack/config' +import { defineNitroConfig } from 'nitro/config' export default defineNitroConfig({}) `; diff --git a/src/core/config/resolvers/database.ts b/src/core/config/resolvers/database.ts index cbe1c5e66d..b6df4c4677 100644 --- a/src/core/config/resolvers/database.ts +++ b/src/core/config/resolvers/database.ts @@ -1,9 +1,9 @@ -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; export async function resolveDatabaseOptions(options: NitroOptions) { if (options.experimental.database && options.imports) { options.imports.presets.push({ - from: "nitropack/runtime", + from: "nitro/runtime", imports: ["useDatabase"], }); if (options.dev && !options.database && !options.devDatabase) { diff --git a/src/core/config/resolvers/export-conditions.ts b/src/core/config/resolvers/export-conditions.ts index e88d8f6af7..056b0a40ae 100644 --- a/src/core/config/resolvers/export-conditions.ts +++ b/src/core/config/resolvers/export-conditions.ts @@ -1,4 +1,4 @@ -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; export async function resolveExportConditionsOptions(options: NitroOptions) { options.exportConditions = _resolveExportConditions( diff --git a/src/core/config/resolvers/fetch.ts b/src/core/config/resolvers/fetch.ts index 6406c9e308..ad2bbc5e59 100644 --- a/src/core/config/resolvers/fetch.ts +++ b/src/core/config/resolvers/fetch.ts @@ -1,5 +1,5 @@ import consola from "consola"; -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; import { nodeMajorVersion, provider } from "std-env"; export async function resolveFetchOptions(options: NitroOptions) { diff --git a/src/core/config/resolvers/imports.ts b/src/core/config/resolvers/imports.ts index 4dd2566f22..9c8e7fe249 100644 --- a/src/core/config/resolvers/imports.ts +++ b/src/core/config/resolvers/imports.ts @@ -1,4 +1,4 @@ -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; import escapeRE from "escape-string-regexp"; import { resolveModuleExportNames } from "mlly"; import { join } from "pathe"; @@ -58,7 +58,7 @@ export async function resolveImportsOptions(options: NitroOptions) { function getNitroImportsPreset(): Preset[] { return [ { - from: "nitropack/runtime", + from: "nitro/runtime", imports: [ "defineCachedFunction", "defineCachedEventHandler", diff --git a/src/core/config/resolvers/open-api.ts b/src/core/config/resolvers/open-api.ts index 281f801a8d..7d406f2ade 100644 --- a/src/core/config/resolvers/open-api.ts +++ b/src/core/config/resolvers/open-api.ts @@ -1,18 +1,18 @@ -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; export async function resolveOpenAPIOptions(options: NitroOptions) { if (options.dev && options.experimental.openAPI) { options.handlers.push({ route: "/_nitro/openapi.json", - handler: "nitropack/runtime/internal/routes/openapi", + handler: "nitro/runtime/internal/routes/openapi", }); options.handlers.push({ route: "/_nitro/scalar", - handler: "nitropack/runtime/internal/routes/scalar", + handler: "nitro/runtime/internal/routes/scalar", }); options.handlers.push({ route: "/_nitro/swagger", - handler: "nitropack/runtime/internal/routes/swagger", + handler: "nitro/runtime/internal/routes/swagger", }); } } diff --git a/src/core/config/resolvers/paths.ts b/src/core/config/resolvers/paths.ts index 8f71d784d1..e53707cd45 100644 --- a/src/core/config/resolvers/paths.ts +++ b/src/core/config/resolvers/paths.ts @@ -1,9 +1,9 @@ import { findWorkspaceDir } from "pkg-types"; -import { resolveNitroPath } from "nitropack/kit"; -import type { NitroOptions } from "nitropack/types"; +import { resolveNitroPath } from "nitro/kit"; +import type { NitroOptions } from "nitro/types"; import { resolve, join } from "pathe"; import { NitroDefaults } from "../defaults"; -import { pkgDir } from "nitropack/runtime/meta"; +import { pkgDir } from "nitro/runtime/meta"; import { existsSync } from "node:fs"; export async function resolvePathOptions(options: NitroOptions) { diff --git a/src/core/config/resolvers/route-rules.ts b/src/core/config/resolvers/route-rules.ts index 2071b42ca3..0489630d7d 100644 --- a/src/core/config/resolvers/route-rules.ts +++ b/src/core/config/resolvers/route-rules.ts @@ -4,7 +4,7 @@ import type { NitroOptions, NitroRouteConfig, NitroRouteRules, -} from "nitropack/types"; +} from "nitro/types"; export async function resolveRouteRulesOptions(options: NitroOptions) { // Backward compatibility for options.routes diff --git a/src/core/config/resolvers/runtime-config.ts b/src/core/config/resolvers/runtime-config.ts index aaa385ad58..6654573322 100644 --- a/src/core/config/resolvers/runtime-config.ts +++ b/src/core/config/resolvers/runtime-config.ts @@ -3,7 +3,7 @@ import type { NitroOptions, NitroConfig, NitroRuntimeConfig, -} from "nitropack/types"; +} from "nitro/types"; export async function resolveRuntimeConfigOptions(options: NitroOptions) { options.runtimeConfig = normalizeRuntimeConfig(options); diff --git a/src/core/config/resolvers/storage.ts b/src/core/config/resolvers/storage.ts index 93e351cdf4..683db78536 100644 --- a/src/core/config/resolvers/storage.ts +++ b/src/core/config/resolvers/storage.ts @@ -1,4 +1,4 @@ -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; import { resolve } from "pathe"; export async function resolveStorageOptions(options: NitroOptions) { diff --git a/src/core/config/resolvers/url.ts b/src/core/config/resolvers/url.ts index 3ed92147d8..1025de9554 100644 --- a/src/core/config/resolvers/url.ts +++ b/src/core/config/resolvers/url.ts @@ -1,4 +1,4 @@ -import type { NitroOptions } from "nitropack/types"; +import type { NitroOptions } from "nitro/types"; import { withLeadingSlash, withTrailingSlash } from "ufo"; export async function resolveURLOptions(options: NitroOptions) { diff --git a/src/core/config/update.ts b/src/core/config/update.ts index 42d3093e5c..2b4d7f05c8 100644 --- a/src/core/config/update.ts +++ b/src/core/config/update.ts @@ -1,4 +1,4 @@ -import type { Nitro, NitroDynamicConfig } from "nitropack/types"; +import type { Nitro, NitroDynamicConfig } from "nitro/types"; import { normalizeRouteRules } from "./resolvers/route-rules"; import { normalizeRuntimeConfig } from "./resolvers/runtime-config"; import consola from "consola"; diff --git a/src/core/dev-server/error.ts b/src/core/dev-server/error.ts index 1b60610fe1..dbdfce8bb3 100644 --- a/src/core/dev-server/error.ts +++ b/src/core/dev-server/error.ts @@ -6,7 +6,7 @@ import { getResponseStatusText, send, } from "h3"; -import { NitroErrorHandler } from "nitropack/types"; +import { NitroErrorHandler } from "nitro/types"; function errorHandler(error: any, event: H3Event) { setResponseHeader(event, "Content-Type", "text/html; charset=UTF-8"); diff --git a/src/core/dev-server/server.ts b/src/core/dev-server/server.ts index 55bc7d45ed..c29e360ac3 100644 --- a/src/core/dev-server/server.ts +++ b/src/core/dev-server/server.ts @@ -24,12 +24,12 @@ import type { NitroBuildInfo, NitroDevServer, NitroWorker, -} from "nitropack/types"; +} from "nitro/types"; import { createVFSHandler } from "./vfs"; import defaultErrorHandler from "./error"; import type { IncomingMessage, OutgoingMessage } from "node:http"; import type { Duplex } from "node:stream"; -import { version as nitroVersion } from "nitropack/meta"; +import { version as nitroVersion } from "nitro/meta"; function initWorker(filename: string): Promise | undefined { if (!existsSync(filename)) { diff --git a/src/core/dev-server/vfs.ts b/src/core/dev-server/vfs.ts index 1c4a6da28d..a004c80f36 100644 --- a/src/core/dev-server/vfs.ts +++ b/src/core/dev-server/vfs.ts @@ -1,5 +1,5 @@ import { createError, eventHandler, getRequestHeader } from "h3"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; export function createVFSHandler(nitro: Nitro) { return eventHandler(async (event) => { diff --git a/src/core/module.ts b/src/core/module.ts index 4579c5fa90..da6c1ab8a1 100644 --- a/src/core/module.ts +++ b/src/core/module.ts @@ -1,5 +1,5 @@ import jiti from "jiti"; -import type { Nitro, NitroModule, NitroModuleInput } from "nitropack/types"; +import type { Nitro, NitroModule, NitroModuleInput } from "nitro/types"; export async function installModules(nitro: Nitro) { const _modules = [...(nitro.options.modules || [])]; diff --git a/src/core/nitro.ts b/src/core/nitro.ts index 94ee053f6d..ba7667ecbf 100644 --- a/src/core/nitro.ts +++ b/src/core/nitro.ts @@ -6,7 +6,7 @@ import type { NitroDynamicConfig, Nitro, LoadConfigOptions, -} from "nitropack/types"; +} from "nitro/types"; import { loadOptions } from "./config/loader"; import { createStorage } from "./utils/storage"; import { installModules } from "./module"; @@ -48,10 +48,10 @@ export async function createNitro( // Debug and timing if (nitro.options.debug) { createDebugger(nitro.hooks, { tag: "nitro" }); - nitro.options.plugins.push("nitropack/runtime/internal/debug"); + nitro.options.plugins.push("nitro/runtime/internal/debug"); } if (nitro.options.timing) { - nitro.options.plugins.push("nitropack/runtime/internal/timing"); + nitro.options.plugins.push("nitro/runtime/internal/timing"); } // Logger diff --git a/src/core/prerender/prerender.ts b/src/core/prerender/prerender.ts index 40d5372f32..fa61305de1 100644 --- a/src/core/prerender/prerender.ts +++ b/src/core/prerender/prerender.ts @@ -8,8 +8,8 @@ import mime from "mime"; import type { $Fetch } from "ofetch"; import { createNitro } from "../nitro"; import { build } from "../build/build"; -import type { Nitro, NitroRouteRules, PrerenderRoute } from "nitropack/types"; -import { writeFile } from "nitropack/kit"; +import type { Nitro, NitroRouteRules, PrerenderRoute } from "nitro/types"; +import { writeFile } from "nitro/kit"; import { compressPublicAssets } from "../utils/compress"; import { extractLinks, diff --git a/src/core/prerender/utils.ts b/src/core/prerender/utils.ts index a2ca04e212..e75d4b5404 100644 --- a/src/core/prerender/utils.ts +++ b/src/core/prerender/utils.ts @@ -1,6 +1,6 @@ import { parseURL } from "ufo"; import chalk from "chalk"; -import type { PrerenderRoute } from "nitropack/types"; +import type { PrerenderRoute } from "nitro/types"; const allowedExtensions = new Set(["", ".json"]); diff --git a/src/core/scan.ts b/src/core/scan.ts index dcae4024c5..8d5555f5c2 100644 --- a/src/core/scan.ts +++ b/src/core/scan.ts @@ -1,7 +1,7 @@ import { relative, join } from "pathe"; import { globby } from "globby"; import { withBase, withLeadingSlash, withoutTrailingSlash } from "ufo"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; export const GLOB_SCAN_PATTERN = "**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}"; type FileInfo = { path: string; fullPath: string }; diff --git a/src/core/task.ts b/src/core/task.ts index bf1528724c..d08e02deb2 100644 --- a/src/core/task.ts +++ b/src/core/task.ts @@ -7,7 +7,7 @@ import type { TaskRunnerOptions, TaskEvent, Nitro, -} from "nitropack/types"; +} from "nitro/types"; /** @experimental */ export async function runTask( diff --git a/src/core/utils/compress.ts b/src/core/utils/compress.ts index a9d96d4a87..729155f204 100644 --- a/src/core/utils/compress.ts +++ b/src/core/utils/compress.ts @@ -4,7 +4,7 @@ import { existsSync } from "node:fs"; import { globby } from "globby"; import { resolve } from "pathe"; import mime from "mime"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; export async function compressPublicAssets(nitro: Nitro) { const publicFiles = await globby("**", { diff --git a/src/core/utils/nitro.ts b/src/core/utils/nitro.ts index 1240a6cea8..2c1ac7943f 100644 --- a/src/core/utils/nitro.ts +++ b/src/core/utils/nitro.ts @@ -1,5 +1,5 @@ import { upperFirst } from "scule"; -import { Nitro } from "nitropack/types"; +import { Nitro } from "nitro/types"; export function nitroServerName(nitro: Nitro) { return nitro.options.framework.name === "nitro" diff --git a/src/core/utils/storage.ts b/src/core/utils/storage.ts index e7f796de6b..d4ae635a88 100644 --- a/src/core/utils/storage.ts +++ b/src/core/utils/storage.ts @@ -1,5 +1,5 @@ import { createStorage as _createStorage, builtinDrivers } from "unstorage"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; export async function createStorage(nitro: Nitro) { const storage = _createStorage(); diff --git a/src/kit/path.ts b/src/kit/path.ts index 4ca7dfde0d..3a063341b1 100644 --- a/src/kit/path.ts +++ b/src/kit/path.ts @@ -1,5 +1,5 @@ import { relative, resolve } from "pathe"; -import { Nitro } from "nitropack/types"; +import { Nitro } from "nitro/types"; import { getProperty } from "dot-prop"; import consola from "consola"; import { colorize } from "consola/utils"; diff --git a/src/kit/preset.ts b/src/kit/preset.ts index 427f75cdb7..342e53d121 100644 --- a/src/kit/preset.ts +++ b/src/kit/preset.ts @@ -1,4 +1,4 @@ -import type { NitroPreset, NitroPresetMeta } from "nitropack/types"; +import type { NitroPreset, NitroPresetMeta } from "nitro/types"; import { fileURLToPath } from "node:url"; export function defineNitroPreset< diff --git a/src/presets/_nitro/base-worker.ts b/src/presets/_nitro/base-worker.ts index 51a6cca061..4a37a68c6d 100644 --- a/src/presets/_nitro/base-worker.ts +++ b/src/presets/_nitro/base-worker.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const baseWorker = defineNitroPreset( { diff --git a/src/presets/_nitro/nitro-dev.ts b/src/presets/_nitro/nitro-dev.ts index cc36847369..dbd32fbc11 100644 --- a/src/presets/_nitro/nitro-dev.ts +++ b/src/presets/_nitro/nitro-dev.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const nitroDev = defineNitroPreset( { diff --git a/src/presets/_nitro/nitro-prerender.ts b/src/presets/_nitro/nitro-prerender.ts index d51147bfcf..34e75c24e9 100644 --- a/src/presets/_nitro/nitro-prerender.ts +++ b/src/presets/_nitro/nitro-prerender.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const nitroPrerender = defineNitroPreset( { diff --git a/src/presets/_nitro/runtime/nitro-dev.ts b/src/presets/_nitro/runtime/nitro-dev.ts index 334799bfb6..cb8bb21af1 100644 --- a/src/presets/_nitro/runtime/nitro-dev.ts +++ b/src/presets/_nitro/runtime/nitro-dev.ts @@ -1,8 +1,8 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { trapUnhandledNodeErrors } from "nitropack/runtime/internal/utils"; -import { runTask } from "nitropack/runtime/internal/task"; -import { startScheduleRunner } from "nitropack/runtime/internal/task"; +import { useNitroApp } from "nitro/runtime"; +import { trapUnhandledNodeErrors } from "nitro/runtime/internal/utils"; +import { runTask } from "nitro/runtime/internal/task"; +import { startScheduleRunner } from "nitro/runtime/internal/task"; import { tasks, scheduledTasks } from "#nitro-internal-virtual/tasks"; import { Server } from "node:http"; diff --git a/src/presets/_nitro/runtime/nitro-prerenderer.ts b/src/presets/_nitro/runtime/nitro-prerenderer.ts index dc9a55b72a..dd2330f41d 100644 --- a/src/presets/_nitro/runtime/nitro-prerenderer.ts +++ b/src/presets/_nitro/runtime/nitro-prerenderer.ts @@ -1,6 +1,6 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { trapUnhandledNodeErrors } from "nitropack/runtime/internal/utils"; +import { useNitroApp } from "nitro/runtime"; +import { trapUnhandledNodeErrors } from "nitro/runtime/internal/utils"; const nitroApp = useNitroApp(); diff --git a/src/presets/_nitro/runtime/service-worker.ts b/src/presets/_nitro/runtime/service-worker.ts index 045e63e8a1..cf192b9672 100644 --- a/src/presets/_nitro/runtime/service-worker.ts +++ b/src/presets/_nitro/runtime/service-worker.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets"; const nitroApp = useNitroApp(); diff --git a/src/presets/_nitro/service-worker.ts b/src/presets/_nitro/service-worker.ts index 5206d4962a..bdb1c02f32 100644 --- a/src/presets/_nitro/service-worker.ts +++ b/src/presets/_nitro/service-worker.ts @@ -1,8 +1,8 @@ import { existsSync, promises as fsp } from "node:fs"; import { resolve } from "pathe"; import { joinURL } from "ufo"; -import { defineNitroPreset } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { defineNitroPreset } from "nitro/kit"; +import type { Nitro } from "nitro/types"; const serviceWorker = defineNitroPreset( () => { diff --git a/src/presets/_resolve.ts b/src/presets/_resolve.ts index 2fa31421bf..4dc5470614 100644 --- a/src/presets/_resolve.ts +++ b/src/presets/_resolve.ts @@ -1,4 +1,4 @@ -import type { NitroPreset, NitroPresetMeta } from "nitropack/types"; +import type { NitroPreset, NitroPresetMeta } from "nitro/types"; import { kebabCase } from "scule"; import { provider, type ProviderName } from "std-env"; import allPresets from "./_all.gen"; diff --git a/src/presets/_static/preset.ts b/src/presets/_static/preset.ts index b914abfbaf..7e919ea9d1 100644 --- a/src/presets/_static/preset.ts +++ b/src/presets/_static/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; import fsp from "node:fs/promises"; import { join } from "pathe"; diff --git a/src/presets/alwaysdata/preset.ts b/src/presets/alwaysdata/preset.ts index d12a47f5ce..aca9f5e340 100644 --- a/src/presets/alwaysdata/preset.ts +++ b/src/presets/alwaysdata/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const alwaysdata = defineNitroPreset( { diff --git a/src/presets/aws-amplify/preset.ts b/src/presets/aws-amplify/preset.ts index d2fc4a0bf7..b015388a3f 100644 --- a/src/presets/aws-amplify/preset.ts +++ b/src/presets/aws-amplify/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; import { writeAmplifyFiles } from "./utils"; export type { AWSAmplifyOptions as PresetOptions } from "./types"; diff --git a/src/presets/aws-amplify/runtime/aws-amplify.ts b/src/presets/aws-amplify/runtime/aws-amplify.ts index 3b28a1cfad..94848a8b37 100644 --- a/src/presets/aws-amplify/runtime/aws-amplify.ts +++ b/src/presets/aws-amplify/runtime/aws-amplify.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import { Server } from "node:http"; import { toNodeListener } from "h3"; diff --git a/src/presets/aws-amplify/utils.ts b/src/presets/aws-amplify/utils.ts index 1e8f17535d..2b040fca83 100644 --- a/src/presets/aws-amplify/utils.ts +++ b/src/presets/aws-amplify/utils.ts @@ -1,7 +1,7 @@ import { resolve } from "node:path"; import { writeFile } from "node:fs/promises"; import { joinURL } from "ufo"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; import type { AmplifyDeployManifest, AmplifyRoute, diff --git a/src/presets/aws-lambda/preset.ts b/src/presets/aws-lambda/preset.ts index 4d861561fb..b776338597 100644 --- a/src/presets/aws-lambda/preset.ts +++ b/src/presets/aws-lambda/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const awsLambda = defineNitroPreset( { diff --git a/src/presets/aws-lambda/runtime/aws-lambda-streaming.ts b/src/presets/aws-lambda/runtime/aws-lambda-streaming.ts index 161b8c12f8..12fb9f773d 100644 --- a/src/presets/aws-lambda/runtime/aws-lambda-streaming.ts +++ b/src/presets/aws-lambda/runtime/aws-lambda-streaming.ts @@ -5,11 +5,11 @@ import type { } from "aws-lambda"; import "#nitro-internal-pollyfills"; import { withQuery } from "ufo"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import { normalizeLambdaIncomingHeaders, normalizeLambdaOutgoingHeaders, -} from "nitropack/runtime/internal/utils.lambda"; +} from "nitro/runtime/internal/utils.lambda"; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace diff --git a/src/presets/aws-lambda/runtime/aws-lambda.ts b/src/presets/aws-lambda/runtime/aws-lambda.ts index 106fa5c928..59845cb0f7 100644 --- a/src/presets/aws-lambda/runtime/aws-lambda.ts +++ b/src/presets/aws-lambda/runtime/aws-lambda.ts @@ -7,13 +7,13 @@ import type { } from "aws-lambda"; import "#nitro-internal-pollyfills"; import { withQuery } from "ufo"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import { normalizeLambdaIncomingHeaders, normalizeLambdaOutgoingBody, normalizeLambdaOutgoingHeaders, -} from "nitropack/runtime/internal/utils.lambda"; -import { normalizeCookieHeader } from "nitropack/runtime/internal/utils"; +} from "nitro/runtime/internal/utils.lambda"; +import { normalizeCookieHeader } from "nitro/runtime/internal/utils"; const nitroApp = useNitroApp(); diff --git a/src/presets/azure/preset.ts b/src/presets/azure/preset.ts index e1e3c0380a..9be4ba6268 100644 --- a/src/presets/azure/preset.ts +++ b/src/presets/azure/preset.ts @@ -1,5 +1,5 @@ -import { defineNitroPreset } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { defineNitroPreset } from "nitro/kit"; +import type { Nitro } from "nitro/types"; import { writeFunctionsRoutes, writeSWARoutes } from "./utils"; export type { AzureOptions as PresetOptions } from "./types"; diff --git a/src/presets/azure/runtime/azure-functions.ts b/src/presets/azure/runtime/azure-functions.ts index 71aa40eec1..71be2849eb 100644 --- a/src/presets/azure/runtime/azure-functions.ts +++ b/src/presets/azure/runtime/azure-functions.ts @@ -1,7 +1,7 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { getAzureParsedCookiesFromHeaders } from "nitropack/runtime/internal/utils.azure"; -import { normalizeLambdaOutgoingHeaders } from "nitropack/runtime/internal/utils.lambda"; +import { useNitroApp } from "nitro/runtime"; +import { getAzureParsedCookiesFromHeaders } from "nitro/runtime/internal/utils.azure"; +import { normalizeLambdaOutgoingHeaders } from "nitro/runtime/internal/utils.lambda"; import type { HttpRequest, HttpResponse } from "@azure/functions"; diff --git a/src/presets/azure/runtime/azure-swa.ts b/src/presets/azure/runtime/azure-swa.ts index 3d4e02c1e7..9932121e1a 100644 --- a/src/presets/azure/runtime/azure-swa.ts +++ b/src/presets/azure/runtime/azure-swa.ts @@ -1,7 +1,7 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { getAzureParsedCookiesFromHeaders } from "nitropack/runtime/internal/utils.azure"; -import { normalizeLambdaOutgoingHeaders } from "nitropack/runtime/internal/utils.lambda"; +import { useNitroApp } from "nitro/runtime"; +import { getAzureParsedCookiesFromHeaders } from "nitro/runtime/internal/utils.azure"; +import { normalizeLambdaOutgoingHeaders } from "nitro/runtime/internal/utils.lambda"; import type { HttpResponse, HttpRequest } from "@azure/functions"; import { parseURL } from "ufo"; diff --git a/src/presets/azure/utils.ts b/src/presets/azure/utils.ts index 83e869966e..f01ce015e9 100644 --- a/src/presets/azure/utils.ts +++ b/src/presets/azure/utils.ts @@ -1,8 +1,8 @@ import { createWriteStream } from "node:fs"; import archiver from "archiver"; import { join, resolve } from "pathe"; -import { writeFile } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { writeFile } from "nitro/kit"; +import type { Nitro } from "nitro/types"; import fsp from "node:fs/promises"; export async function writeFunctionsRoutes(nitro: Nitro) { diff --git a/src/presets/bun/preset.ts b/src/presets/bun/preset.ts index ed6250b3cd..e8a444b201 100644 --- a/src/presets/bun/preset.ts +++ b/src/presets/bun/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const bun = defineNitroPreset( { diff --git a/src/presets/bun/runtime/bun.ts b/src/presets/bun/runtime/bun.ts index d8822b8121..cf4b04b70c 100644 --- a/src/presets/bun/runtime/bun.ts +++ b/src/presets/bun/runtime/bun.ts @@ -1,6 +1,6 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { startScheduleRunner } from "nitropack/runtime/internal/task"; +import { useNitroApp } from "nitro/runtime"; +import { startScheduleRunner } from "nitro/runtime/internal/task"; import type {} from "bun"; import wsAdapter from "crossws/adapters/bun"; diff --git a/src/presets/cleavr/preset.ts b/src/presets/cleavr/preset.ts index 75dbbea3f3..eaa4463219 100644 --- a/src/presets/cleavr/preset.ts +++ b/src/presets/cleavr/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const cleavr = defineNitroPreset( { diff --git a/src/presets/cloudflare/preset.ts b/src/presets/cloudflare/preset.ts index 8a2f44a175..d9bc79237f 100644 --- a/src/presets/cloudflare/preset.ts +++ b/src/presets/cloudflare/preset.ts @@ -1,7 +1,7 @@ -import { defineNitroPreset } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { defineNitroPreset } from "nitro/kit"; +import type { Nitro } from "nitro/types"; import { writeCFPagesFiles, writeCFPagesStaticFiles } from "./utils"; -import { writeFile } from "nitropack/kit"; +import { writeFile } from "nitro/kit"; import { resolve } from "pathe"; export type { CloudflareOptions as PresetOptions } from "./types"; diff --git a/src/presets/cloudflare/runtime/cloudflare-module.ts b/src/presets/cloudflare/runtime/cloudflare-module.ts index 910f21fc93..c4fdebc8fc 100644 --- a/src/presets/cloudflare/runtime/cloudflare-module.ts +++ b/src/presets/cloudflare/runtime/cloudflare-module.ts @@ -1,8 +1,8 @@ import "#nitro-internal-pollyfills"; -import { requestHasBody } from "nitropack/runtime/internal/utils"; -import { useNitroApp } from "nitropack/runtime"; -import { useRuntimeConfig } from "nitropack/runtime"; -import { runCronTasks } from "nitropack/runtime/internal/task"; +import { requestHasBody } from "nitro/runtime/internal/utils"; +import { useNitroApp } from "nitro/runtime"; +import { useRuntimeConfig } from "nitro/runtime"; +import { runCronTasks } from "nitro/runtime/internal/task"; import { getPublicAssetMeta } from "#nitro-internal-virtual/public-assets"; import { withoutBase } from "ufo"; diff --git a/src/presets/cloudflare/runtime/cloudflare-pages.ts b/src/presets/cloudflare/runtime/cloudflare-pages.ts index 2835b2b913..913d59facd 100644 --- a/src/presets/cloudflare/runtime/cloudflare-pages.ts +++ b/src/presets/cloudflare/runtime/cloudflare-pages.ts @@ -1,7 +1,7 @@ import "#nitro-internal-pollyfills"; -import { runCronTasks } from "nitropack/runtime/internal/task"; -import { requestHasBody } from "nitropack/runtime/internal/utils"; -import { useNitroApp } from "nitropack/runtime"; +import { runCronTasks } from "nitro/runtime/internal/task"; +import { requestHasBody } from "nitro/runtime/internal/utils"; +import { useNitroApp } from "nitro/runtime"; import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets"; import wsAdapter from "crossws/adapters/cloudflare"; diff --git a/src/presets/cloudflare/runtime/cloudflare-worker.ts b/src/presets/cloudflare/runtime/cloudflare-worker.ts index 84f28a733c..6961f4f552 100644 --- a/src/presets/cloudflare/runtime/cloudflare-worker.ts +++ b/src/presets/cloudflare/runtime/cloudflare-worker.ts @@ -1,7 +1,7 @@ import "#nitro-internal-pollyfills"; -import { requestHasBody } from "nitropack/runtime/internal/utils"; -import { useNitroApp } from "nitropack/runtime"; -import { useRuntimeConfig } from "nitropack/runtime"; +import { requestHasBody } from "nitro/runtime/internal/utils"; +import { useNitroApp } from "nitro/runtime"; +import { useRuntimeConfig } from "nitro/runtime"; import { getPublicAssetMeta } from "#nitro-internal-virtual/public-assets"; import { withoutBase } from "ufo"; diff --git a/src/presets/cloudflare/types.ts b/src/presets/cloudflare/types.ts index b8176c30e0..4a47057e29 100644 --- a/src/presets/cloudflare/types.ts +++ b/src/presets/cloudflare/types.ts @@ -84,7 +84,7 @@ export interface CloudflareMessageBatch { retryAll(options?: CloudflareQueueRetryOptions): void; } -declare module "nitropack/types" { +declare module "nitro/types" { export interface NitroRuntimeHooks { "cloudflare:email": (_: { event: CloudflareEmailContext; diff --git a/src/presets/cloudflare/utils.ts b/src/presets/cloudflare/utils.ts index 38f45207d5..d09c62ee43 100644 --- a/src/presets/cloudflare/utils.ts +++ b/src/presets/cloudflare/utils.ts @@ -8,7 +8,7 @@ import { } from "ufo"; import { parseTOML, stringifyTOML } from "confbox"; import { globby } from "globby"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; import defu from "defu"; import { isCI } from "std-env"; import type { CloudflarePagesRoutes } from "./types"; diff --git a/src/presets/deno/preset.ts b/src/presets/deno/preset.ts index 0a5a52c4cb..6c40df87b6 100644 --- a/src/presets/deno/preset.ts +++ b/src/presets/deno/preset.ts @@ -2,8 +2,8 @@ import { builtinModules } from "node:module"; import { isAbsolute, resolve } from "pathe"; import MagicString from "magic-string"; import { findStaticImports } from "mlly"; -import { defineNitroPreset } from "nitropack/kit"; -import { writeFile } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; +import { writeFile } from "nitro/kit"; // nitro/src/rollup/plugin/import-meta.ts const ImportMetaRe = /import\.meta|globalThis._importMeta_/; @@ -21,7 +21,7 @@ const denoDeploy = defineNitroPreset( "cd ./ && deployctl deploy --project= server/index.ts", }, unenv: { - polyfill: ["nitropack/runtime/internal/polyfill/deno-env"], + polyfill: ["nitro/runtime/internal/polyfill/deno-env"], }, rollupConfig: { preserveEntrySignatures: false, diff --git a/src/presets/deno/runtime/deno-deploy.ts b/src/presets/deno/runtime/deno-deploy.ts index 502b024419..1da39d5128 100644 --- a/src/presets/deno/runtime/deno-deploy.ts +++ b/src/presets/deno/runtime/deno-deploy.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import wsAdapter from "crossws/adapters/deno"; import type { Deno as _Deno } from "@deno/types"; diff --git a/src/presets/deno/runtime/deno-server.ts b/src/presets/deno/runtime/deno-server.ts index 0bebf67b88..5ef990745b 100644 --- a/src/presets/deno/runtime/deno-server.ts +++ b/src/presets/deno/runtime/deno-server.ts @@ -1,7 +1,7 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { useRuntimeConfig } from "nitropack/runtime"; -import { startScheduleRunner } from "nitropack/runtime/internal/task"; +import { useNitroApp } from "nitro/runtime"; +import { useRuntimeConfig } from "nitro/runtime"; +import { startScheduleRunner } from "nitro/runtime/internal/task"; import destr from "destr"; import wsAdapter from "crossws/adapters/deno"; diff --git a/src/presets/digitalocean/preset.ts b/src/presets/digitalocean/preset.ts index 5d96755f58..c01a83f9ce 100644 --- a/src/presets/digitalocean/preset.ts +++ b/src/presets/digitalocean/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const digitalOcean = defineNitroPreset( { diff --git a/src/presets/edgio/preset.ts b/src/presets/edgio/preset.ts index f3c8a5fa8d..f804164413 100644 --- a/src/presets/edgio/preset.ts +++ b/src/presets/edgio/preset.ts @@ -1,7 +1,7 @@ import { promises as fsp } from "node:fs"; import { resolve, dirname } from "pathe"; import type { PackageJson } from "pkg-types"; -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const edgio = defineNitroPreset( { diff --git a/src/presets/firebase/preset.ts b/src/presets/firebase/preset.ts index 9c19b254d8..4a1189c04e 100644 --- a/src/presets/firebase/preset.ts +++ b/src/presets/firebase/preset.ts @@ -1,6 +1,6 @@ import { basename } from "pathe"; import type { Plugin } from "rollup"; -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; import { updatePackageJSON, writeFirebaseConfig } from "./utils"; export type { FirebaseOptions as PresetOptions } from "./types"; diff --git a/src/presets/firebase/runtime/firebase-gen-1.ts b/src/presets/firebase/runtime/firebase-gen-1.ts index 0b95edbdfe..fb15c53330 100644 --- a/src/presets/firebase/runtime/firebase-gen-1.ts +++ b/src/presets/firebase/runtime/firebase-gen-1.ts @@ -1,6 +1,6 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { useAppConfig } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; +import { useAppConfig } from "nitro/runtime"; import functions from "firebase-functions"; import { toNodeListener } from "h3"; diff --git a/src/presets/firebase/runtime/firebase-gen-2.ts b/src/presets/firebase/runtime/firebase-gen-2.ts index 1babf921bc..74dc3ba48f 100644 --- a/src/presets/firebase/runtime/firebase-gen-2.ts +++ b/src/presets/firebase/runtime/firebase-gen-2.ts @@ -1,6 +1,6 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { useAppConfig } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; +import { useAppConfig } from "nitro/runtime"; import { onRequest } from "firebase-functions/v2/https"; import { toNodeListener } from "h3"; diff --git a/src/presets/firebase/utils.ts b/src/presets/firebase/utils.ts index 2c47b526b7..0ce143b5b0 100644 --- a/src/presets/firebase/utils.ts +++ b/src/presets/firebase/utils.ts @@ -1,8 +1,8 @@ import { existsSync } from "node:fs"; import { join, relative } from "pathe"; import { readPackageJSON, writePackageJSON } from "pkg-types"; -import { writeFile } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { writeFile } from "nitro/kit"; +import type { Nitro } from "nitro/types"; export async function writeFirebaseConfig(nitro: Nitro) { const firebaseConfigPath = join(nitro.options.rootDir, "firebase.json"); diff --git a/src/presets/flightcontrol/preset.ts b/src/presets/flightcontrol/preset.ts index 72f78478d5..199bf85b06 100644 --- a/src/presets/flightcontrol/preset.ts +++ b/src/presets/flightcontrol/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const flightControl = defineNitroPreset( { diff --git a/src/presets/heroku/preset.ts b/src/presets/heroku/preset.ts index 0dd1346fb0..e9f54aa544 100644 --- a/src/presets/heroku/preset.ts +++ b/src/presets/heroku/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const heroku = defineNitroPreset( { diff --git a/src/presets/iis/preset.ts b/src/presets/iis/preset.ts index ef883cba3d..f63b1f649b 100644 --- a/src/presets/iis/preset.ts +++ b/src/presets/iis/preset.ts @@ -1,5 +1,5 @@ -import { defineNitroPreset } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { defineNitroPreset } from "nitro/kit"; +import type { Nitro } from "nitro/types"; import { writeIISFiles, writeIISNodeFiles } from "./utils"; const iisHandler = defineNitroPreset( diff --git a/src/presets/iis/utils.ts b/src/presets/iis/utils.ts index 7cb5a408d0..42ceab0ccd 100644 --- a/src/presets/iis/utils.ts +++ b/src/presets/iis/utils.ts @@ -1,7 +1,7 @@ import { readFile } from "node:fs/promises"; import { defu } from "defu"; -import type { Nitro } from "nitropack/types"; -import { writeFile } from "nitropack/kit"; +import type { Nitro } from "nitro/types"; +import { writeFile } from "nitro/kit"; import { resolve } from "pathe"; import { existsSync } from "node:fs"; diff --git a/src/presets/koyeb/preset.ts b/src/presets/koyeb/preset.ts index 000194927e..73493378ad 100644 --- a/src/presets/koyeb/preset.ts +++ b/src/presets/koyeb/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const koyeb = defineNitroPreset( { diff --git a/src/presets/netlify/legacy/preset.ts b/src/presets/netlify/legacy/preset.ts index 2e27053284..d98c79963e 100644 --- a/src/presets/netlify/legacy/preset.ts +++ b/src/presets/netlify/legacy/preset.ts @@ -1,7 +1,7 @@ import { existsSync, promises as fsp } from "node:fs"; import { join, dirname } from "pathe"; -import { defineNitroPreset } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { defineNitroPreset } from "nitro/kit"; +import type { Nitro } from "nitro/types"; import { deprecateSWR, writeHeaders, writeRedirects } from "./utils"; // Netlify functions @@ -92,7 +92,7 @@ const netlifyEdge = defineNitroPreset( }, }, unenv: { - polyfill: ["nitropack/runtime/internal/polyfill/deno-env"], + polyfill: ["nitro/runtime/internal/polyfill/deno-env"], }, hooks: { "rollup:before": (nitro: Nitro) => { diff --git a/src/presets/netlify/legacy/runtime/netlify-edge.ts b/src/presets/netlify/legacy/runtime/netlify-edge.ts index 7d64738b20..02538281e9 100644 --- a/src/presets/netlify/legacy/runtime/netlify-edge.ts +++ b/src/presets/netlify/legacy/runtime/netlify-edge.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets"; const nitroApp = useNitroApp(); diff --git a/src/presets/netlify/legacy/runtime/netlify-lambda.ts b/src/presets/netlify/legacy/runtime/netlify-lambda.ts index cdac0caa34..23b2c18576 100644 --- a/src/presets/netlify/legacy/runtime/netlify-lambda.ts +++ b/src/presets/netlify/legacy/runtime/netlify-lambda.ts @@ -1,11 +1,11 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { normalizeCookieHeader } from "nitropack/runtime/internal/utils"; +import { useNitroApp } from "nitro/runtime"; +import { normalizeCookieHeader } from "nitro/runtime/internal/utils"; import { normalizeLambdaIncomingHeaders, normalizeLambdaOutgoingBody, normalizeLambdaOutgoingHeaders, -} from "nitropack/runtime/internal/utils.lambda"; +} from "nitro/runtime/internal/utils.lambda"; import { withQuery } from "ufo"; import type { diff --git a/src/presets/netlify/legacy/runtime/netlify.ts b/src/presets/netlify/legacy/runtime/netlify.ts index 4a89ab2bdf..3187f681fc 100644 --- a/src/presets/netlify/legacy/runtime/netlify.ts +++ b/src/presets/netlify/legacy/runtime/netlify.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { getRouteRulesForPath } from "nitropack/runtime/internal/route-rules"; +import { getRouteRulesForPath } from "nitro/runtime/internal/route-rules"; import { withQuery } from "ufo"; import type { Handler } from "@netlify/functions/dist/main"; diff --git a/src/presets/netlify/legacy/utils.ts b/src/presets/netlify/legacy/utils.ts index f67c93ea83..89afedc651 100644 --- a/src/presets/netlify/legacy/utils.ts +++ b/src/presets/netlify/legacy/utils.ts @@ -1,6 +1,6 @@ import { existsSync, promises as fsp } from "node:fs"; import { join } from "pathe"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; export async function writeRedirects(nitro: Nitro) { const redirectsPath = join(nitro.options.output.publicDir, "_redirects"); diff --git a/src/presets/netlify/preset.ts b/src/presets/netlify/preset.ts index 0ae268be1b..60d8ea4b71 100644 --- a/src/presets/netlify/preset.ts +++ b/src/presets/netlify/preset.ts @@ -1,7 +1,7 @@ import { promises as fsp } from "node:fs"; import { join, dirname } from "pathe"; -import { defineNitroPreset } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { defineNitroPreset } from "nitro/kit"; +import type { Nitro } from "nitro/types"; import { generateNetlifyFunction, getGeneratorString, @@ -75,7 +75,7 @@ const netlifyEdge = defineNitroPreset( }, }, unenv: { - polyfill: ["nitropack/runtime/internal/polyfill/deno-env"], + polyfill: ["nitro/runtime/internal/polyfill/deno-env"], }, hooks: { async compiled(nitro: Nitro) { diff --git a/src/presets/netlify/runtime/netlify-edge.ts b/src/presets/netlify/runtime/netlify-edge.ts index 7d64738b20..02538281e9 100644 --- a/src/presets/netlify/runtime/netlify-edge.ts +++ b/src/presets/netlify/runtime/netlify-edge.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets"; const nitroApp = useNitroApp(); diff --git a/src/presets/netlify/runtime/netlify.ts b/src/presets/netlify/runtime/netlify.ts index b834b971c3..8e1c05fe32 100644 --- a/src/presets/netlify/runtime/netlify.ts +++ b/src/presets/netlify/runtime/netlify.ts @@ -1,10 +1,10 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { getRouteRulesForPath } from "nitropack/runtime/internal/route-rules"; +import { useNitroApp } from "nitro/runtime"; +import { getRouteRulesForPath } from "nitro/runtime/internal/route-rules"; import { joinHeaders, normalizeCookieHeader, -} from "nitropack/runtime/internal/utils"; +} from "nitro/runtime/internal/utils"; const nitroApp = useNitroApp(); diff --git a/src/presets/netlify/utils.ts b/src/presets/netlify/utils.ts index 25bfe265dc..71eaaeebd9 100644 --- a/src/presets/netlify/utils.ts +++ b/src/presets/netlify/utils.ts @@ -1,6 +1,6 @@ import { existsSync, promises as fsp } from "node:fs"; import { join } from "pathe"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; export async function writeRedirects(nitro: Nitro) { const redirectsPath = join(nitro.options.output.publicDir, "_redirects"); diff --git a/src/presets/node/preset.ts b/src/presets/node/preset.ts index b2cc1d346c..f83fbe9599 100644 --- a/src/presets/node/preset.ts +++ b/src/presets/node/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const node = defineNitroPreset( { diff --git a/src/presets/node/runtime/cli.ts b/src/presets/node/runtime/cli.ts index f643f84e6c..b2a0d19235 100644 --- a/src/presets/node/runtime/cli.ts +++ b/src/presets/node/runtime/cli.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; const nitroApp = useNitroApp(); diff --git a/src/presets/node/runtime/cluster.ts b/src/presets/node/runtime/cluster.ts index 8c5fb7e111..31469991d2 100644 --- a/src/presets/node/runtime/cluster.ts +++ b/src/presets/node/runtime/cluster.ts @@ -1,7 +1,7 @@ import os from "node:os"; import cluster from "node:cluster"; -import { getGracefulShutdownConfig } from "nitropack/runtime/internal/shutdown"; -import { trapUnhandledNodeErrors } from "nitropack/runtime/internal/utils"; +import { getGracefulShutdownConfig } from "nitro/runtime/internal/shutdown"; +import { trapUnhandledNodeErrors } from "nitro/runtime/internal/utils"; function runMaster() { const numberOfWorkers = diff --git a/src/presets/node/runtime/node-listener.ts b/src/presets/node/runtime/node-listener.ts index fe6ef318e5..688275a714 100644 --- a/src/presets/node/runtime/node-listener.ts +++ b/src/presets/node/runtime/node-listener.ts @@ -1,8 +1,8 @@ import "#nitro-internal-pollyfills"; import { toNodeListener } from "h3"; -import { useNitroApp } from "nitropack/runtime"; -import { trapUnhandledNodeErrors } from "nitropack/runtime/internal/utils"; -import { startScheduleRunner } from "nitropack/runtime/internal/task"; +import { useNitroApp } from "nitro/runtime"; +import { trapUnhandledNodeErrors } from "nitro/runtime/internal/utils"; +import { startScheduleRunner } from "nitro/runtime/internal/task"; const nitroApp = useNitroApp(); diff --git a/src/presets/node/runtime/node-server.ts b/src/presets/node/runtime/node-server.ts index 085a5a1e3d..5f8f0c03bf 100644 --- a/src/presets/node/runtime/node-server.ts +++ b/src/presets/node/runtime/node-server.ts @@ -5,11 +5,11 @@ import { Server as HttpsServer } from "node:https"; import destr from "destr"; import { toNodeListener } from "h3"; import wsAdapter from "crossws/adapters/node"; -import { useNitroApp } from "nitropack/runtime"; -import { setupGracefulShutdown } from "nitropack/runtime/internal/shutdown"; -import { trapUnhandledNodeErrors } from "nitropack/runtime/internal/utils"; -import { useRuntimeConfig } from "nitropack/runtime"; -import { startScheduleRunner } from "nitropack/runtime/internal/task"; +import { useNitroApp } from "nitro/runtime"; +import { setupGracefulShutdown } from "nitro/runtime/internal/shutdown"; +import { trapUnhandledNodeErrors } from "nitro/runtime/internal/utils"; +import { useRuntimeConfig } from "nitro/runtime"; +import { startScheduleRunner } from "nitro/runtime/internal/task"; const cert = process.env.NITRO_SSL_CERT; const key = process.env.NITRO_SSL_KEY; diff --git a/src/presets/platform.sh/preset.ts b/src/presets/platform.sh/preset.ts index 6311eed3da..e285ab71c6 100644 --- a/src/presets/platform.sh/preset.ts +++ b/src/presets/platform.sh/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const platformSh = defineNitroPreset( { diff --git a/src/presets/render.com/preset.ts b/src/presets/render.com/preset.ts index 6a268428c1..044d80f5a6 100644 --- a/src/presets/render.com/preset.ts +++ b/src/presets/render.com/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const renderCom = defineNitroPreset( { diff --git a/src/presets/stormkit/preset.ts b/src/presets/stormkit/preset.ts index 645c43b8a7..a76424c57f 100644 --- a/src/presets/stormkit/preset.ts +++ b/src/presets/stormkit/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const stormkit = defineNitroPreset( { diff --git a/src/presets/stormkit/runtime/stormkit.ts b/src/presets/stormkit/runtime/stormkit.ts index 8061f40c2b..df68921e38 100644 --- a/src/presets/stormkit/runtime/stormkit.ts +++ b/src/presets/stormkit/runtime/stormkit.ts @@ -1,6 +1,6 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; -import { normalizeLambdaOutgoingBody } from "nitropack/runtime/internal/utils.lambda"; +import { useNitroApp } from "nitro/runtime"; +import { normalizeLambdaOutgoingBody } from "nitro/runtime/internal/utils.lambda"; import type { Handler } from "aws-lambda"; diff --git a/src/presets/vercel/preset.ts b/src/presets/vercel/preset.ts index 0c4e0b56e1..5f23de51b5 100644 --- a/src/presets/vercel/preset.ts +++ b/src/presets/vercel/preset.ts @@ -1,5 +1,5 @@ -import { defineNitroPreset } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { defineNitroPreset } from "nitro/kit"; +import type { Nitro } from "nitro/types"; import { deprecateSWR, generateEdgeFunctionFiles, diff --git a/src/presets/vercel/runtime/vercel-edge.ts b/src/presets/vercel/runtime/vercel-edge.ts index 89bcb0c6af..c298e0e1dc 100644 --- a/src/presets/vercel/runtime/vercel-edge.ts +++ b/src/presets/vercel/runtime/vercel-edge.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; const nitroApp = useNitroApp(); diff --git a/src/presets/vercel/runtime/vercel.ts b/src/presets/vercel/runtime/vercel.ts index fb9c06e005..0adfc223e7 100644 --- a/src/presets/vercel/runtime/vercel.ts +++ b/src/presets/vercel/runtime/vercel.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import { toNodeListener, NodeListener } from "h3"; import { parseQuery } from "ufo"; diff --git a/src/presets/vercel/utils.ts b/src/presets/vercel/utils.ts index 10b82a17aa..a34619ab83 100644 --- a/src/presets/vercel/utils.ts +++ b/src/presets/vercel/utils.ts @@ -1,7 +1,7 @@ -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; import fsp from "node:fs/promises"; import { dirname, relative, resolve } from "pathe"; -import { writeFile } from "nitropack/kit"; +import { writeFile } from "nitro/kit"; import { defu } from "defu"; import { joinURL, withoutLeadingSlash } from "ufo"; import type { diff --git a/src/presets/winterjs/preset.ts b/src/presets/winterjs/preset.ts index ba948e544a..4c220d38a5 100644 --- a/src/presets/winterjs/preset.ts +++ b/src/presets/winterjs/preset.ts @@ -1,4 +1,4 @@ -import { defineNitroPreset } from "nitropack/kit"; +import { defineNitroPreset } from "nitro/kit"; const winterjs = defineNitroPreset( { diff --git a/src/presets/winterjs/runtime/winterjs.ts b/src/presets/winterjs/runtime/winterjs.ts index e793eabfe0..7cc7acdd88 100644 --- a/src/presets/winterjs/runtime/winterjs.ts +++ b/src/presets/winterjs/runtime/winterjs.ts @@ -1,7 +1,7 @@ // @ts-nocheck TODO: Remove after removing polyfills import "#nitro-internal-pollyfills"; -import { toBuffer } from "nitropack/runtime/internal/utils"; -import { useNitroApp } from "nitropack/runtime"; +import { toBuffer } from "nitro/runtime/internal/utils"; +import { useNitroApp } from "nitro/runtime"; import { toPlainHandler } from "h3"; import { hasProtocol, joinURL } from "ufo"; diff --git a/src/presets/zeabur/preset.ts b/src/presets/zeabur/preset.ts index dfda5dacf6..4135478dc6 100644 --- a/src/presets/zeabur/preset.ts +++ b/src/presets/zeabur/preset.ts @@ -1,8 +1,8 @@ import fsp from "node:fs/promises"; import { dirname, relative, resolve } from "pathe"; -import { writeFile } from "nitropack/kit"; -import { defineNitroPreset } from "nitropack/kit"; -import type { Nitro } from "nitropack/types"; +import { writeFile } from "nitro/kit"; +import { defineNitroPreset } from "nitro/kit"; +import type { Nitro } from "nitro/types"; // https://zeabur.com/docs/advanced/serverless-output-format diff --git a/src/presets/zeabur/runtime/zeabur.ts b/src/presets/zeabur/runtime/zeabur.ts index b570e6146a..d00fb3b2c0 100644 --- a/src/presets/zeabur/runtime/zeabur.ts +++ b/src/presets/zeabur/runtime/zeabur.ts @@ -1,5 +1,5 @@ import "#nitro-internal-pollyfills"; -import { useNitroApp } from "nitropack/runtime"; +import { useNitroApp } from "nitro/runtime"; import { NodeListener, toNodeListener } from "h3"; const handler = toNodeListener(useNitroApp().h3App); diff --git a/src/rollup/config.ts b/src/rollup/config.ts index f1c84bc3ef..0c411ad96f 100644 --- a/src/rollup/config.ts +++ b/src/rollup/config.ts @@ -22,7 +22,7 @@ import type { NitroStaticBuildFlags, NodeExternalsOptions, RollupConfig, -} from "nitropack/types"; +} from "nitro/types"; import { resolveAliases } from "./utils"; import { replace } from "./plugins/replace"; import { virtual } from "./plugins/virtual"; @@ -41,7 +41,7 @@ import { database } from "./plugins/database"; import { importMeta } from "./plugins/import-meta"; import { appConfig } from "./plugins/app-config"; import { sourcemapMininify } from "./plugins/sourcemap-min"; -import { runtimeDependencies, runtimeDir } from "nitropack/runtime/meta"; +import { runtimeDependencies, runtimeDir } from "nitro/runtime/meta"; export const getRollupConfig = (nitro: Nitro): RollupConfig => { const extensions: string[] = [ @@ -379,8 +379,8 @@ export const plugins = [ "#build": buildDir, "#nitro-internal-virtual/error-handler": nitro.options.errorHandler, "#internal/nitro": runtimeDir, - "nitro/runtime": runtimeDir, "nitropack/runtime": runtimeDir, + "nitro/runtime": runtimeDir, "~": nitro.options.srcDir, "@/": nitro.options.srcDir, "~~": nitro.options.rootDir, @@ -447,7 +447,7 @@ export const plugins = [ "@@/", "virtual:", "nitro/runtime", - "nitropack/runtime", + "nitro/runtime", dirname(nitro.options.entry), ...(nitro.options.experimental.wasm ? [(id: string) => id?.endsWith(".wasm")] diff --git a/src/rollup/plugins/app-config.ts b/src/rollup/plugins/app-config.ts index c5c4b48a59..c37b8175c8 100644 --- a/src/rollup/plugins/app-config.ts +++ b/src/rollup/plugins/app-config.ts @@ -1,5 +1,5 @@ import { genImport } from "knitwork"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; import { virtual } from "./virtual"; export function appConfig(nitro: Nitro) { diff --git a/src/rollup/plugins/database.ts b/src/rollup/plugins/database.ts index af79f46955..6252c9a756 100644 --- a/src/rollup/plugins/database.ts +++ b/src/rollup/plugins/database.ts @@ -1,6 +1,6 @@ import { connectors } from "db0"; import { camelCase } from "scule"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; import { virtual } from "./virtual"; export function database(nitro: Nitro) { diff --git a/src/rollup/plugins/esbuild.ts b/src/rollup/plugins/esbuild.ts index 71b830344b..2dd3c6ea12 100644 --- a/src/rollup/plugins/esbuild.ts +++ b/src/rollup/plugins/esbuild.ts @@ -4,7 +4,7 @@ import { extname, relative } from "pathe"; import type { Plugin, PluginContext } from "rollup"; import { Loader, TransformResult, transform } from "esbuild"; import { createFilter } from "@rollup/pluginutils"; -import { EsbuildOptions } from "nitropack/types"; +import { EsbuildOptions } from "nitro/types"; const defaultLoaders: { [ext: string]: Loader } = { ".ts": "ts", diff --git a/src/rollup/plugins/externals-legacy.ts b/src/rollup/plugins/externals-legacy.ts index 99b002fe47..e53978ac74 100644 --- a/src/rollup/plugins/externals-legacy.ts +++ b/src/rollup/plugins/externals-legacy.ts @@ -5,7 +5,7 @@ import { nodeFileTrace, NodeFileTraceOptions } from "@vercel/nft"; import type { Plugin } from "rollup"; import { resolvePath, isValidNodeImport, normalizeid } from "mlly"; import semver from "semver"; -import { isDirectory } from "nitropack/kit"; +import { isDirectory } from "nitro/kit"; import { normalizeMatcher } from "./externals"; interface NodeExternalsOptions { diff --git a/src/rollup/plugins/externals.ts b/src/rollup/plugins/externals.ts index 394e9e946a..8fa2b533fc 100644 --- a/src/rollup/plugins/externals.ts +++ b/src/rollup/plugins/externals.ts @@ -13,8 +13,8 @@ import { parseNodeModulePath, } from "mlly"; import semver from "semver"; -import { isDirectory } from "nitropack/kit"; -import type { NodeExternalsOptions } from "nitropack/types"; +import { isDirectory } from "nitro/kit"; +import type { NodeExternalsOptions } from "nitro/types"; export function externals(opts: NodeExternalsOptions): Plugin { const trackedExternals = new Set(); diff --git a/src/rollup/plugins/handlers-meta.ts b/src/rollup/plugins/handlers-meta.ts index 28eb7ed040..6519437d9e 100644 --- a/src/rollup/plugins/handlers-meta.ts +++ b/src/rollup/plugins/handlers-meta.ts @@ -3,7 +3,7 @@ import { transform } from "esbuild"; import type { Plugin } from "rollup"; import type { Literal, Expression } from "estree"; import { extname } from "pathe"; -import { Nitro, NitroEventHandler } from "nitropack/types"; +import { Nitro, NitroEventHandler } from "nitro/types"; const virtualPrefix = "\0nitro-handler-meta:"; diff --git a/src/rollup/plugins/handlers.ts b/src/rollup/plugins/handlers.ts index e8abffe332..2f5abc4a5c 100644 --- a/src/rollup/plugins/handlers.ts +++ b/src/rollup/plugins/handlers.ts @@ -1,9 +1,5 @@ import { hash } from "ohash"; -import type { - Nitro, - NitroRouteRules, - NitroEventHandler, -} from "nitropack/types"; +import type { Nitro, NitroRouteRules, NitroEventHandler } from "nitro/types"; import { virtual } from "./virtual"; export function handlers(nitro: Nitro) { @@ -36,7 +32,7 @@ export function handlers(nitro: Nitro) { if (nitro.options.serveStatic) { handlers.unshift({ middleware: true, - handler: "nitropack/runtime/internal/static", + handler: "nitro/runtime/internal/static", }); } if (nitro.options.renderer) { diff --git a/src/rollup/plugins/import-meta.ts b/src/rollup/plugins/import-meta.ts index 3638c11506..fa5dbb06a6 100644 --- a/src/rollup/plugins/import-meta.ts +++ b/src/rollup/plugins/import-meta.ts @@ -1,5 +1,5 @@ import type { Plugin } from "rollup"; -import { Nitro } from "nitropack/types"; +import { Nitro } from "nitro/types"; export const ImportMetaRe = /import\.meta|globalThis._importMeta_/; diff --git a/src/rollup/plugins/public-assets.ts b/src/rollup/plugins/public-assets.ts index dc0b9d945e..1b0bb69b55 100644 --- a/src/rollup/plugins/public-assets.ts +++ b/src/rollup/plugins/public-assets.ts @@ -5,9 +5,9 @@ import createEtag from "etag"; import mime from "mime"; import { globby } from "globby"; import type { Plugin } from "rollup"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; import { virtual } from "./virtual"; -import type { PublicAsset } from "nitropack/types"; +import type { PublicAsset } from "nitro/types"; const readAssetHandler: Record< Exclude, diff --git a/src/rollup/plugins/raw.ts b/src/rollup/plugins/raw.ts index 705516b89d..53912ccd61 100644 --- a/src/rollup/plugins/raw.ts +++ b/src/rollup/plugins/raw.ts @@ -2,7 +2,7 @@ import { promises as fsp } from "node:fs"; import { extname } from "pathe"; import mime from "mime"; import type { Plugin } from "rollup"; -import { RawOptions } from "nitropack/types"; +import { RawOptions } from "nitro/types"; const HELPER_ID = "\0raw-helpers"; diff --git a/src/rollup/plugins/server-assets.ts b/src/rollup/plugins/server-assets.ts index dc5a98b3da..329dc0d4c5 100644 --- a/src/rollup/plugins/server-assets.ts +++ b/src/rollup/plugins/server-assets.ts @@ -5,7 +5,7 @@ import mime from "mime"; import { resolve } from "pathe"; import { normalizeKey } from "unstorage"; import { globby } from "globby"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; import { virtual } from "./virtual"; interface ResolvedAsset { diff --git a/src/rollup/plugins/storage.ts b/src/rollup/plugins/storage.ts index e4d5f301d9..82a6fbe9bf 100644 --- a/src/rollup/plugins/storage.ts +++ b/src/rollup/plugins/storage.ts @@ -1,6 +1,6 @@ import { builtinDrivers } from "unstorage"; import { genImport, genSafeVariableName } from "knitwork"; -import type { Nitro } from "nitropack/types"; +import type { Nitro } from "nitro/types"; import { virtual } from "./virtual"; export function storage(nitro: Nitro) { diff --git a/src/rollup/plugins/virtual.ts b/src/rollup/plugins/virtual.ts index c8ed425ca8..6b52d22a54 100644 --- a/src/rollup/plugins/virtual.ts +++ b/src/rollup/plugins/virtual.ts @@ -1,6 +1,6 @@ import { resolve, dirname } from "pathe"; import type { Plugin } from "rollup"; -import type { RollupVirtualOptions, VirtualModule } from "nitropack/types"; +import type { RollupVirtualOptions, VirtualModule } from "nitro/types"; // Based on https://github.com/rollup/plugins/blob/master/packages/virtual/src/index.ts diff --git a/src/runtime/internal/app.ts b/src/runtime/internal/app.ts index 98b4761bd7..846a918cbd 100644 --- a/src/runtime/internal/app.ts +++ b/src/runtime/internal/app.ts @@ -16,18 +16,14 @@ import { createFetch as createLocalFetch, } from "unenv/runtime/fetch/index"; import { createHooks } from "hookable"; -import type { - NitroRuntimeHooks, - CaptureError, - NitroApp, -} from "nitropack/types"; +import type { NitroRuntimeHooks, CaptureError, NitroApp } from "nitro/types"; import { useRuntimeConfig } from "./config"; import { cachedEventHandler } from "./cache"; import { normalizeFetchResponse } from "./utils"; import { createRouteRulesHandler, getRouteRulesForPath } from "./route-rules"; import { nitroAsyncContext } from "./context"; -import type { NitroAsyncContext } from "nitropack/types"; -import type { $Fetch, NitroFetchRequest } from "nitropack/types"; +import type { NitroAsyncContext } from "nitro/types"; +import type { $Fetch, NitroFetchRequest } from "nitro/types"; import { plugins } from "#nitro-internal-virtual/plugins"; import errorHandler from "#nitro-internal-virtual/error-handler"; import { handlers } from "#nitro-internal-virtual/server-handlers"; diff --git a/src/runtime/internal/cache.ts b/src/runtime/internal/cache.ts index 7a63eba22e..e33ebdcb51 100644 --- a/src/runtime/internal/cache.ts +++ b/src/runtime/internal/cache.ts @@ -19,7 +19,7 @@ import type { CachedEventHandlerOptions, ResponseCacheEntry, NitroFetchRequest, -} from "nitropack/types"; +} from "nitro/types"; const defaultCacheOptions = { name: "_", diff --git a/src/runtime/internal/client.ts b/src/runtime/internal/client.ts index 1a07c1c41e..d7b9c1fc19 100644 --- a/src/runtime/internal/client.ts +++ b/src/runtime/internal/client.ts @@ -1,6 +1,6 @@ // Client polyfill import { $fetch } from "ofetch"; -import { $Fetch, NitroFetchRequest } from "nitropack/types"; +import { $Fetch, NitroFetchRequest } from "nitro/types"; if (!globalThis.$fetch) { globalThis.$fetch = $fetch as $Fetch; diff --git a/src/runtime/internal/config.ts b/src/runtime/internal/config.ts index d398a233bf..0e9aefabbb 100644 --- a/src/runtime/internal/config.ts +++ b/src/runtime/internal/config.ts @@ -2,7 +2,7 @@ import { klona } from "klona"; import { H3Event } from "h3"; import { type EnvOptions, applyEnv } from "./utils.env"; import { appConfig as _inlineAppConfig } from "#nitro-internal-virtual/app-config"; -import type { NitroRuntimeConfig } from "nitropack/types"; +import type { NitroRuntimeConfig } from "nitro/types"; // Static runtime config inlined by nitro build const _inlineRuntimeConfig = process.env.RUNTIME_CONFIG as any; diff --git a/src/runtime/internal/context.ts b/src/runtime/internal/context.ts index 11e4996e3b..4962d92360 100644 --- a/src/runtime/internal/context.ts +++ b/src/runtime/internal/context.ts @@ -1,7 +1,7 @@ import { AsyncLocalStorage } from "node:async_hooks"; import { H3Event, createError } from "h3"; import { getContext } from "unctx"; -import type { NitroAsyncContext } from "nitropack/types"; +import type { NitroAsyncContext } from "nitro/types"; export const nitroAsyncContext = getContext("nitro-app", { asyncContext: import.meta._asyncContext, diff --git a/src/runtime/internal/error.ts b/src/runtime/internal/error.ts index 0fd28150f2..e6d2e742be 100644 --- a/src/runtime/internal/error.ts +++ b/src/runtime/internal/error.ts @@ -1,6 +1,6 @@ // import ansiHTML from 'ansi-html' import { setResponseHeader, setResponseStatus, send } from "h3"; -import type { NitroErrorHandler } from "nitropack/types"; +import type { NitroErrorHandler } from "nitro/types"; import { normalizeError, isJsonRequest } from "./utils"; export function defineNitroErrorHandler( diff --git a/src/runtime/internal/meta.ts b/src/runtime/internal/meta.ts index 1cf66eaf9d..0340385d1f 100644 --- a/src/runtime/internal/meta.ts +++ b/src/runtime/internal/meta.ts @@ -1,4 +1,4 @@ -import type { NitroRouteMeta } from "nitropack/types"; +import type { NitroRouteMeta } from "nitro/types"; export function defineRouteMeta(meta: NitroRouteMeta) { return meta; diff --git a/src/runtime/internal/plugin.ts b/src/runtime/internal/plugin.ts index ff93dca004..9320bc03ac 100644 --- a/src/runtime/internal/plugin.ts +++ b/src/runtime/internal/plugin.ts @@ -1,4 +1,4 @@ -import type { NitroAppPlugin } from "nitropack/types"; +import type { NitroAppPlugin } from "nitro/types"; export function defineNitroPlugin(def: NitroAppPlugin) { return def; diff --git a/src/runtime/internal/renderer.ts b/src/runtime/internal/renderer.ts index 5cf701cba2..4bf886fc61 100644 --- a/src/runtime/internal/renderer.ts +++ b/src/runtime/internal/renderer.ts @@ -8,7 +8,7 @@ import { setResponseStatus, } from "h3"; import { useNitroApp } from "./app"; -import type { RenderHandler } from "nitropack/types"; +import type { RenderHandler } from "nitro/types"; export function defineRenderHandler(handler: RenderHandler) { return eventHandler(async (event) => { diff --git a/src/runtime/internal/route-rules.ts b/src/runtime/internal/route-rules.ts index cbbf2eadbc..6d4c1b8630 100644 --- a/src/runtime/internal/route-rules.ts +++ b/src/runtime/internal/route-rules.ts @@ -9,7 +9,7 @@ import defu from "defu"; import { createRouter as createRadixRouter, toRouteMatcher } from "radix3"; import { joinURL, withQuery, getQuery, withoutBase } from "ufo"; import { useRuntimeConfig } from "./config"; -import type { NitroRouteRules } from "nitropack/types"; +import type { NitroRouteRules } from "nitro/types"; const config = useRuntimeConfig(); const _routeRulesMatcher = toRouteMatcher( diff --git a/src/runtime/internal/shutdown.ts b/src/runtime/internal/shutdown.ts index d0a3d93fe2..4a921749ce 100644 --- a/src/runtime/internal/shutdown.ts +++ b/src/runtime/internal/shutdown.ts @@ -1,6 +1,6 @@ import type { Server as HttpServer } from "node:http"; import gracefulShutdown from "./lib/http-graceful-shutdown"; -import type { NitroApp } from "nitropack/types"; +import type { NitroApp } from "nitro/types"; export function getGracefulShutdownConfig() { return { diff --git a/src/runtime/internal/static.ts b/src/runtime/internal/static.ts index c4c10e1744..940a7d5565 100644 --- a/src/runtime/internal/static.ts +++ b/src/runtime/internal/static.ts @@ -20,7 +20,7 @@ import { readAsset, isPublicAssetURL, } from "#nitro-internal-virtual/public-assets"; -import type { PublicAsset } from "nitropack/types"; +import type { PublicAsset } from "nitro/types"; const METHODS = new Set(["HEAD", "GET"] as HTTPMethod[]); diff --git a/src/runtime/internal/task.ts b/src/runtime/internal/task.ts index fa1be52446..d4eda61a0c 100644 --- a/src/runtime/internal/task.ts +++ b/src/runtime/internal/task.ts @@ -8,7 +8,7 @@ import type { TaskPayload, TaskContext, TaskEvent, -} from "nitropack/types"; +} from "nitro/types"; /** @experimental */ export function defineTask(def: Task): Task { diff --git a/src/types/config.ts b/src/types/config.ts index 412987521b..a6bb7dedba 100644 --- a/src/types/config.ts +++ b/src/types/config.ts @@ -17,11 +17,7 @@ import type { NitroDevEventHandler, NitroEventHandler, } from "./handler"; -import type { - PresetName, - PresetNameInput, - PresetOptions, -} from "nitropack/presets"; +import type { PresetName, PresetNameInput, PresetOptions } from "nitro/presets"; import type { NitroModuleInput } from "./module"; import type { DeepPartial } from "./_utils"; import type { RollupConfig } from "./rollup"; diff --git a/src/types/h3.ts b/src/types/h3.ts index 651d025ace..1dc7dc63a7 100644 --- a/src/types/h3.ts +++ b/src/types/h3.ts @@ -2,7 +2,7 @@ import type { CaptureError, CapturedErrorContext, CacheOptions, -} from "nitropack/types"; +} from "nitro/types"; import type { NitroFetchRequest, $Fetch } from "./fetch/fetch"; export type H3EventFetch = ( diff --git a/src/types/handler.ts b/src/types/handler.ts index 6797656194..09af260825 100644 --- a/src/types/handler.ts +++ b/src/types/handler.ts @@ -1,6 +1,6 @@ import type { EventHandler, H3Error, H3Event, RouterMethod } from "h3"; import type { OperationObject } from "openapi-typescript"; -import type { PresetName } from "nitropack/presets"; +import type { PresetName } from "nitro/presets"; type MaybeArray = T | T[]; diff --git a/src/types/nitro.ts b/src/types/nitro.ts index 8877770ede..82eb508454 100644 --- a/src/types/nitro.ts +++ b/src/types/nitro.ts @@ -4,7 +4,7 @@ import type { ConsolaInstance } from "consola"; import type { Storage } from "unstorage"; import type { RouterMethod } from "h3"; import type { NitroEventHandler } from "./handler"; -import type { PresetName } from "nitropack/presets"; +import type { PresetName } from "nitro/presets"; import type { NitroConfig, NitroOptions } from "./config"; import type { NitroHooks } from "./hooks"; import type { PrerenderRoute } from "./prerender"; diff --git a/src/types/virtual/error-handler.d.ts b/src/types/virtual/error-handler.d.ts index 0c4d7715e9..f0c3a2be8a 100644 --- a/src/types/virtual/error-handler.d.ts +++ b/src/types/virtual/error-handler.d.ts @@ -1,4 +1,4 @@ -import type { NitroErrorHandler } from "nitropack/types"; +import type { NitroErrorHandler } from "nitro/types"; const errorHandler: NitroErrorHandler; diff --git a/src/types/virtual/server-handlers-meta.d.ts b/src/types/virtual/server-handlers-meta.d.ts index 1422da668e..92a0bf21c9 100644 --- a/src/types/virtual/server-handlers-meta.d.ts +++ b/src/types/virtual/server-handlers-meta.d.ts @@ -1,5 +1,5 @@ import type { OperationObject } from "openapi-typescript"; -import { NitroRouteMeta } from "nitropack/types"; +import { NitroRouteMeta } from "nitro/types"; export const handlersMeta: { route?: string; diff --git a/src/types/virtual/tasks.ts b/src/types/virtual/tasks.ts index dffef60f64..c1d965f163 100644 --- a/src/types/virtual/tasks.ts +++ b/src/types/virtual/tasks.ts @@ -1,4 +1,4 @@ -import type { Task, TaskMeta } from "nitropack/types"; +import type { Task, TaskMeta } from "nitro/types"; export const tasks: Record< string, diff --git a/test/fixture/nitro.config.ts b/test/fixture/nitro.config.ts index e6b9153de2..eb256e86ce 100644 --- a/test/fixture/nitro.config.ts +++ b/test/fixture/nitro.config.ts @@ -1,5 +1,5 @@ import { fileURLToPath } from "node:url"; -import { defineNitroConfig } from "nitropack/config"; +import { defineNitroConfig } from "nitro/config"; export default defineNitroConfig({ compressPublicAssets: true, diff --git a/test/fixture/routes/file.ts b/test/fixture/routes/file.ts index 698476fe34..6ff993021d 100644 --- a/test/fixture/routes/file.ts +++ b/test/fixture/routes/file.ts @@ -1,4 +1,4 @@ -import { useStorage } from "nitropack/runtime"; +import { useStorage } from "nitro/runtime"; export default defineEventHandler(async (event) => { const query = getQuery(event); diff --git a/test/fixture/tsconfig.json b/test/fixture/tsconfig.json index a54dd30b7c..9cf1697164 100644 --- a/test/fixture/tsconfig.json +++ b/test/fixture/tsconfig.json @@ -10,40 +10,28 @@ "paths": { // CLI "nitro/cli": ["../../src/cli"], - "nitropack/cli": ["../../src/cli"], // Config "nitro/config": ["../../src/config"], - "nitropack/config": ["../../src/config"], // Core "nitro/core": ["../../src/core"], - "nitropack/core": ["../../src/core"], // Core alias "nitro": ["../../src/core"], "nitropack": ["../../src/core"], // Runtime "nitro/runtime": ["../../src/runtime"], - "nitropack/runtime": ["../../src/runtime"], "nitro/runtime/meta": ["./runtime-meta"], - "nitropack/runtime/meta": ["./runtime-meta"], "nitro/runtime/*": ["../../src/runtime/*"], - "nitropack/runtime/*": ["../../src/runtime/*"], // Kit "nitro/kit": ["../../src/kit"], - "nitropack/kit": ["../../src/kit"], // Meta "nitro/meta": ["../../src/meta"], - "nitropack/meta": ["../../src/meta"], // Presets "nitro/presets": ["../../src/presets"], - "nitropack/presets": ["../../src/presets"], "nitro/presets/*": ["../../src/presets/*"], - "nitropack/presets/*": ["../../src/presets/*"], // Rollup "nitro/rollup": ["../../src/rollup"], - "nitropack/rollup": ["../../src/rollup"], // Types "nitro/types": ["../../src/types"], - "nitropack/types": ["../../src/types"], // Virtual files "#nitro-internal-virtual/*": ["../../src/types/virtual/*"], // Compatibility (#internal/nitro) diff --git a/test/fixture/types.ts b/test/fixture/types.ts index 1b55234df8..66462de947 100644 --- a/test/fixture/types.ts +++ b/test/fixture/types.ts @@ -1,9 +1,9 @@ import { expectTypeOf } from "expect-type"; import { describe, it } from "vitest"; import { EventHandler, EventHandlerRequest, defineEventHandler } from "h3"; -import type { $Fetch } from "nitropack/types"; -import { defineNitroConfig } from "nitropack/config"; -import type { Serialize, Simplify } from "nitropack/types"; +import type { $Fetch } from "nitro/types"; +import { defineNitroConfig } from "nitro/config"; +import type { Serialize, Simplify } from "nitro/types"; interface TestResponse { message: string; diff --git a/test/scripts/gen-fixture-types.ts b/test/scripts/gen-fixture-types.ts index 8a15fa8d66..80175cf642 100644 --- a/test/scripts/gen-fixture-types.ts +++ b/test/scripts/gen-fixture-types.ts @@ -1,6 +1,7 @@ import { fileURLToPath } from "mlly"; import { resolve } from "pathe"; -import { createNitro, scanHandlers, writeTypes } from "nitropack/core"; +import { createNitro, writeTypes } from "nitro/core"; +import { scanHandlers } from "../../src/core/scan"; const prepare = async () => { const fixtureDir = fileURLToPath(new URL("../fixture", import.meta.url).href); diff --git a/test/tests.ts b/test/tests.ts index 6297b947b2..e05e625568 100644 --- a/test/tests.ts +++ b/test/tests.ts @@ -16,8 +16,8 @@ import { copyPublicAssets, prerender, createDevServer, -} from "nitropack/core"; -import type { Nitro, NitroConfig } from "nitropack/types"; +} from "nitro/core"; +import type { Nitro, NitroConfig } from "nitro/types"; import { nodeMajorVersion, isWindows } from "std-env"; import { type DateString, formatDate } from "compatx"; diff --git a/tsconfig.json b/tsconfig.json index be9c410992..9e363de329 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,42 +17,29 @@ "paths": { // CLI "nitro/cli": ["./src/cli"], - "nitropack/cli": ["./src/cli"], // Config "nitro/config": ["./src/config"], - "nitropack/config": ["./src/config"], // Core "nitro/core": ["./src/core"], - "nitropack/core": ["./src/core"], // Core (alias) "nitro": ["./src/core"], - "nitropack": ["./src/core"], // Runtime "nitro/runtime": ["./src/runtime"], - "nitropack/runtime": ["./src/runtime"], // Runtime subpaths "nitro/runtime/*": ["./src/runtime/*"], - "nitropack/runtime/*": ["./src/runtime/*"], // Runtime meta "nitro/runtime/meta": ["./runtime-meta"], - "nitropack/runtime/meta": ["./runtime-meta"], // Kit "nitro/kit": ["./src/kit"], - "nitropack/kit": ["./src/kit"], // Meta "nitro/meta": ["./src/meta"], - "nitropack/meta": ["./src/meta"], // Presets "nitro/presets": ["./src/presets"], - "nitropack/presets": ["./src/presets"], "nitro/presets/*": ["./src/presets/*"], - "nitropack/presets/*": ["./src/presets/*"], // Rollup "nitro/rollup": ["./src/rollup"], - "nitropack/rollup": ["./src/rollup"], // Types "nitro/types": ["./src/types"], - "nitropack/types": ["./src/types"], // Virtual files "#nitro-internal-virtual/*": ["./src/types/virtual/*"], // Compatibility (#internal/nitro)