import { defineUntypedSchema } from 'untyped'; import { defu } from 'defu'; import { resolve, join, basename, relative } from 'pathe'; import { isTest, isDevelopment, isDebug } from 'std-env'; import { consola } from 'consola'; import { existsSync } from 'node:fs'; import { readdir } from 'node:fs/promises'; import { findWorkspaceDir } from 'pkg-types'; import { randomUUID } from 'uncrypto'; import { withoutLeadingSlash } from 'ufo'; const adhoc = defineUntypedSchema({ /** * Configure Nuxt component auto-registration. * * Any components in the directories configured here can be used throughout your * pages, layouts (and other components) without needing to explicitly import them. * @see [`components/` directory documentation](https://nuxt.com/docs/guide/directory-structure/components) * @type {boolean | typeof import('../src/types/components').ComponentsOptions | typeof import('../src/types/components').ComponentsOptions['dirs']} */ components: { $resolve: (val) => { if (Array.isArray(val)) { return { dirs: val }; } if (val === void 0 || val === true) { return { dirs: [{ path: "~/components/global", global: true }, "~/components"] }; } return val; } }, /** * Configure how Nuxt auto-imports composables into your application. * @see [Nuxt documentation](https://nuxt.com/docs/guide/directory-structure/composables) * @type {typeof import('../src/types/imports').ImportsOptions} */ imports: { global: false, /** * An array of custom directories that will be auto-imported. * Note that this option will not override the default directories (~/composables, ~/utils). * @example * ```js * imports: { * // Auto-import pinia stores defined in `~/stores` * dirs: ['stores'] * } * ``` */ dirs: [] }, /** * Whether to use the vue-router integration in Nuxt 3. If you do not provide a value it will be * enabled if you have a `pages/` directory in your source folder. * @type {boolean} */ pages: void 0, /** * Manually disable nuxt telemetry. * @see [Nuxt Telemetry](https://github.com/nuxt/telemetry) for more information. * @type {boolean | Record} */ telemetry: void 0, /** * Enable Nuxt DevTools for development. * * Breaking changes for devtools might not reflect on the version of Nuxt. * @see [Nuxt DevTools](https://devtools.nuxt.com/) for more information. * @type { { enabled: boolean, [key: string]: any } } */ devtools: {} }); const app = defineUntypedSchema({ /** * Vue.js config */ vue: { /** @type {typeof import('@vue/compiler-sfc').AssetURLTagConfig} */ transformAssetUrls: { video: ["src", "poster"], source: ["src"], img: ["src"], image: ["xlink:href", "href"], use: ["xlink:href", "href"] }, /** * Options for the Vue compiler that will be passed at build time. * @see [Vue documentation](https://vuejs.org/api/application.html#app-config-compileroptions) * @type {typeof import('@vue/compiler-core').CompilerOptions} */ compilerOptions: {}, /** * Include Vue compiler in runtime bundle. */ runtimeCompiler: { $resolve: async (val, get) => val ?? await get("experimental.runtimeVueCompiler") ?? false }, /** * Enable reactive destructure for `defineProps` * @type {boolean} */ propsDestructure: true }, /** * Nuxt App configuration. */ app: { /** * The base path of your Nuxt application. * * For example: * @example * ```ts * export default defineNuxtConfig({ * app: { * baseURL: '/prefix/' * } * }) * ``` * * This can also be set at runtime by setting the NUXT_APP_BASE_URL environment variable. * @example * ```bash * NUXT_APP_BASE_URL=/prefix/ node .output/server/index.mjs * ``` */ baseURL: { $resolve: (val) => val || process.env.NUXT_APP_BASE_URL || "/" }, /** The folder name for the built site assets, relative to `baseURL` (or `cdnURL` if set). This is set at build time and should not be customized at runtime. */ buildAssetsDir: { $resolve: (val) => val || process.env.NUXT_APP_BUILD_ASSETS_DIR || "/_nuxt/" }, /** * An absolute URL to serve the public folder from (production-only). * * For example: * @example * ```ts * export default defineNuxtConfig({ * app: { * cdnURL: 'https://mycdn.org/' * } * }) * ``` * * This can be set to a different value at runtime by setting the `NUXT_APP_CDN_URL` environment variable. * @example * ```bash * NUXT_APP_CDN_URL=https://mycdn.org/ node .output/server/index.mjs * ``` */ cdnURL: { $resolve: async (val, get) => await get("dev") ? "" : (process.env.NUXT_APP_CDN_URL ?? val) || "" }, /** * Set default configuration for `` on every page. * @example * ```js * app: { * head: { * meta: [ * // * { name: 'viewport', content: 'width=device-width, initial-scale=1' } * ], * script: [ * //