{"version":3,"file":"vite.cjs","names":["existsSync","readFileSync","builtinModules","resolve","externalizeDeps","options","packageJson","process","cwd","name","config","externalDeps","Set","context","msg","String","Error","contents","toString","dependencies","devDependencies","optionalDependencies","peerDependencies","JSON","parse","push","add","bind","Object","keys","concat","map","dep","RegExp","forEach","module","depMatchers","Array","from","build","rolldownOptions","external","source","some","depMatcher","test","resolve","existsSync","readFileSync","cloneDeep","ZViteLibraryBuilder","library","entry","formats","name","path","index","build","cloneDeep","react","castArray","cloneDeep","swc","checker","dtsPlugin","externalizeDeps","ZViteLibraryBuilder","ZViteConfigBuilder","config","oxc","resolve","tsconfigPaths","build","minify","sourcemap","plugins","vite","jsc","transform","runtime","plugin","option","concat","sourceMap","alias","key","value","lodash","bind","server","options","library","lib","index","dts","compilerOptions","paths","entryRoot","exclude","external","cli","entry","nest","web","typescript","test","swc","castArray","cloneDeep","dtsPlugin","checker","react","cloneDeep","isUndefined","omitBy","ZViteServerBuilder","options","allowedHost","name","allowedHosts","hosts","concat","denyAllHosts","port","strictPort","host","ip","localhost","bind","dev","build","clone","cloneDeep","omitBy","isUndefined","cloneDeep","ZViteTestBuilder","test","environment","testTimeout","coverage","provider","node","bind","browser","v8","istanbul","project","projects","concat","monorepo","packages","runSerially","fileParallelism","maxConcurrency","isolate","build","cloneDeep"],"sources":["../src/plugin/vite-plugin-externalize-deps.ts","../src/vite/vite-library-builder.mts","../src/vite/vite-config-builder.mts","../src/vite/vite-server-builder.mts","../src/vite/vite-test-builder.mts"],"sourcesContent":["import { existsSync, type PathLike, readFileSync } from \"node:fs\";\nimport { builtinModules } from \"node:module\";\nimport { resolve } from \"node:path\";\n\nimport type { Plugin, UserConfig } from \"vite\";\n\n// Original source code from\n// https://github.com/davidmyersdev/vite-plugin-externalize-deps/blob/main/src/index.ts\n// It takes to long to get this plugin updated, so I just copied the source code into\n// here.  I don't think this plugin is maintained much anymore.  I've greatly reduced the\n// options from this to be just a basic check for stuff in your package.json and node\n// builtins.\n\nexport interface ExternalizeOptions {\n  packageJson?: PathLike;\n}\n\nexport const externalizeDeps = (options: ExternalizeOptions = {}): Plugin => {\n  const { packageJson = resolve(process.cwd(), \"package.json\") } = options;\n\n  return {\n    name: \"vite-plugin-externalize-deps\",\n    config: () => {\n      const externalDeps = new Set<RegExp>();\n\n      if (!existsSync(packageJson)) {\n        const context = \"janitor-build-config:externalizeDeps\";\n        const msg = `[${context}] Could not find package.json at ${String(packageJson)}.`;\n        throw new Error(msg);\n      }\n\n      const contents = readFileSync(packageJson).toString();\n      const {\n        dependencies = [],\n        devDependencies = [],\n        optionalDependencies = [],\n        peerDependencies = [],\n      } = JSON.parse(contents) as Record<string, Record<string, string>>;\n\n      const push = externalDeps.add.bind(externalDeps);\n\n      Object.keys(dependencies)\n        .concat(Object.keys(devDependencies))\n        .concat(Object.keys(optionalDependencies))\n        .concat(Object.keys(peerDependencies))\n        .map((dep) => new RegExp(`^${dep}(?:/.+)?$`))\n        .forEach(push);\n\n      builtinModules\n        .map((module) => new RegExp(`^(?:node:)?${module}$`))\n        .forEach(push);\n\n      const depMatchers = Array.from(externalDeps);\n\n      return {\n        build: {\n          rolldownOptions: {\n            external: (source) => {\n              return depMatchers.some((depMatcher) => depMatcher.test(source));\n            },\n          },\n        },\n      } satisfies UserConfig;\n    },\n  };\n};\n","import { cloneDeep } from \"lodash-es\";\nimport type { LibraryOptions } from \"vite\";\n\n/**\n * A builder for Vite library configurations.\n *\n * @deprecated Use @zthun/janitor-vite plugins instead\n */\nexport class ZViteLibraryBuilder {\n  private library: LibraryOptions = {\n    entry: {},\n    formats: [\"es\", \"cjs\"],\n  };\n\n  /**\n   * Adds an entry point to the library.\n   *\n   * @param name -\n   *        The name of the entry point.\n   * @param path -\n   *        The path to the entry point file.\n   *\n   * @returns\n   *        This object.\n   */\n  public entry(name: string, path: string) {\n    this.library.entry = {\n      ...(this.library.entry as Record<string, string>),\n      [name]: path,\n    };\n    return this;\n  }\n\n  /**\n   * A shorthand for adding an entry point\n   * named \"index\" that points to \"src/index.ts\"\n   *\n   * @returns\n   *        This object.\n   */\n  public index() {\n    return this.entry(\"index\", \"./src/index.mts\");\n  }\n\n  /**\n   * Returns the built library configuration.\n   *\n   * @returns\n   *        A deep clone of the library configuration.\n   */\n  public build() {\n    return cloneDeep(this.library);\n  }\n}\n","import react from \"@vitejs/plugin-react-swc\";\nimport { castArray, cloneDeep } from \"lodash-es\";\nimport swc from \"unplugin-swc\";\nimport type { LibraryOptions, PluginOption, ServerOptions } from \"vite\";\nimport { checker } from \"vite-plugin-checker\";\nimport dtsPlugin from \"vite-plugin-dts\";\nimport type { ViteUserConfig } from \"vitest/config\";\nimport type { InlineConfig } from \"vitest/node\";\n\nimport { externalizeDeps } from \"../plugin/vite-plugin-externalize-deps.js\";\nimport { ZViteLibraryBuilder } from \"./vite-library-builder.mjs\";\n\n/**\n * A config builder for the vite build system.\n *\n * This is helpful when building different types\n * of projects and keeping a standard.\n *\n * @example vite.config.ts\n *\n * ```ts\n * // Before Config Builder\n * export default defineConfig({\n *  build: {\n *     lib: {\n *       entry: {\n *         index: \"./src/index.ts\",\n *       },\n *       formats: [\"cjs\", \"es\"],\n *     },\n *   },\n *   minify: false,\n *   sourceMap: true,\n *   plugins: [\n *     swc.vite(),\n *     tsConfigPaths(),\n *     externalizeDeps(),\n *     dtsPlugin({\n *       compilerOptions: {\n *         paths: {},\n *       },\n *     }),\n *   ],\n * });\n * ```\n *\n * ```ts\n * // After config builder\n * const config = new ZViteConfigBuilder().library().build();\n * export default defineConfig(config);\n * ```\n *\n * @deprecated Use @zthun/janitor-vite plugins instead.\n */\nexport class ZViteConfigBuilder {\n  private config: ViteUserConfig;\n\n  /**\n   * Initializes a new instance of this object.\n   */\n  public constructor() {\n    this.config = {\n      oxc: false,\n      resolve: {\n        tsconfigPaths: true,\n      },\n      build: {\n        minify: false,\n        sourcemap: true,\n      },\n      plugins: [\n        swc.vite({\n          jsc: {\n            transform: {\n              react: {\n                runtime: \"automatic\",\n              },\n            },\n          },\n        }),\n      ],\n    };\n  }\n\n  /**\n   * Sets whether to minify the build output.\n   *\n   * @param minify -\n   *        The flag as to minify the output.\n   *\n   * @returns\n   *        This object.\n   */\n  public minify(minify = true) {\n    this.config.build = { ...this.config.build, minify };\n    return this;\n  }\n\n  /**\n   * Adds a list of plugins.\n   *\n   * @param option -\n   *        The plugins to add.\n   *\n   * @returns\n   *        This object.\n   */\n  public plugin(option: PluginOption | PluginOption[] = []) {\n    // See constructor - the config plugins are guaranteed to\n    // be set.  The swc and paths plugins are automatically added.\n    const plugins = this.config.plugins!;\n    this.config.plugins = plugins.concat(castArray(option));\n    return this;\n  }\n\n  /**\n   * Sets whether to generate source maps.\n   *\n   * @param sourcemap -\n   *        True to generate a sourcemap, false for faster build.\n   *\n   * @returns\n   *        This object.\n   */\n  public sourceMap(sourcemap = true) {\n    this.config.build = { ...this.config.build, sourcemap };\n    return this;\n  }\n\n  /**\n   * Adds an alias to the resolution options.\n   *\n   * @param key -\n   *        The name of the package to alias\n   * @param value -\n   *        The alias resolution\n   *\n   * @returns\n   *        This object.\n   */\n  public alias(key: string, value: string) {\n    this.config.resolve ??= {};\n    this.config.resolve.alias = this.config.resolve.alias || {};\n    this.config.resolve.alias[key] = value;\n    return this;\n  }\n\n  /**\n   * Adds an alias for lodash to lodash-es.\n   *\n   * @returns\n   *        This object.\n   */\n  public lodash = this.alias.bind(this, \"lodash\", \"lodash-es\");\n\n  /**\n   * Assigns the server options.\n   *\n   * @param options -\n   *        The server options to assign.\n   *\n   * @returns\n   *        This object.\n   */\n  public server(options: ServerOptions) {\n    this.config.server = cloneDeep(options);\n    return this;\n  }\n\n  /**\n   * Sets vite into library mode.\n   *\n   * @param lib -\n   *        The options for the library.  You can set this to\n   *        nothing to use the default library which looks for\n   *        an entry point at the source directory called index.ts\n   *\n   * @see {@link ZViteLibraryBuilder} for more information.\n   *\n   * @returns\n   *        This object.\n   */\n  public library(\n    lib: LibraryOptions = new ZViteLibraryBuilder().index().build(),\n  ) {\n    this.config.build = { ...this.config.build, lib };\n\n    const dts = dtsPlugin({\n      compilerOptions: {\n        // Always turn off paths when building for production.  You want to make\n        // sure that your build is building in the correct order and that your\n        // actual paths are correct.\n        paths: {},\n      },\n      // Our tsconfig will include all ts and mts files, when we output our\n      // source code, we only want the types found in the src directory.\n      // Anything outside of this is config and we don't want to include it.\n      entryRoot: \"src\",\n      // Make sure to exclude spec and test files.\n      exclude: [\"**/*.{spec,test}.{js,mjs,cjs,ts,mts,jsx,tsx}\"],\n    });\n    const external = externalizeDeps();\n\n    return this.plugin(external).plugin(dts);\n  }\n\n  /**\n   * Constructs the config to act as if it's compiling a node application.\n   *\n   * This is just an alias to {@link ZViteConfigBuilder.library} with two\n   * entry points.\n   *\n   * 1. The file src/cli.ts is the main entry point of the application.\n   * 1. The file, src/index.ts, is the api for importing and using it as an api.\n   *\n   * @returns\n   *        This object.\n   */\n  public cli() {\n    // A cli works similar to a library.\n    const library = new ZViteLibraryBuilder()\n      .entry(\"index\", \"src/index.mts\")\n      .entry(\"cli\", \"src/cli.mts\")\n      .build();\n    return this.library(library);\n  }\n\n  /**\n   * Constructs the config to act as if it's compiling a nest application.\n   *\n   * This is just an alias to {@link ZViteConfigBuilder.library} with a single\n   * entry point.\n   *\n   * 1. The file, src/main.mts\n   *\n   * @returns\n   *        This object.\n   */\n  public nest() {\n    const library = new ZViteLibraryBuilder()\n      .entry(\"main\", \"src/main.mts\")\n      .build();\n    return this.library(library);\n  }\n\n  /**\n   * Constructs the config to act as if it's compiling a web application.\n   *\n   * @returns\n   *        This object.\n   */\n  public web() {\n    return this.minify()\n      .sourceMap(false)\n      .plugin(checker({ typescript: true }));\n  }\n\n  /**\n   * Constructs the config to compile a react application.\n   *\n   * @returns\n   *        This object.\n   */\n  public react() {\n    return this.web().plugin(react());\n  }\n\n  /**\n   * Constructs the config to be for testing.\n   *\n   * @param options -\n   *        The test config to use.\n   */\n  public test(options: InlineConfig) {\n    this.config.test = options;\n    return this;\n  }\n\n  /**\n   * Returns the currently built config.\n   *\n   * @returns\n   *        The currently built config.\n   */\n  public build() {\n    return cloneDeep(this.config);\n  }\n}\n","import { cloneDeep, isUndefined, omitBy } from \"lodash-es\";\nimport type { ServerOptions } from \"vite\";\n\n/**\n * @deprecated Use @zthun/janitor-vite plugins instead.  Specifically extensionDevServer()\n */\nexport class ZViteServerBuilder {\n  private options: ServerOptions = {};\n\n  public allowedHost(name: string | string[] | true) {\n    if (name === true) {\n      this.options.allowedHosts = true;\n    } else if (this.options.allowedHosts !== true) {\n      const hosts = this.options.allowedHosts || [];\n      this.options.allowedHosts = hosts.concat(name);\n    }\n\n    return this;\n  }\n\n  public denyAllHosts() {\n    delete this.options.allowedHosts;\n    return this;\n  }\n\n  public port(port?: number) {\n    this.options.port = port;\n    return this;\n  }\n\n  public strictPort() {\n    this.options.strictPort = true;\n    return this;\n  }\n\n  public host(ip: string) {\n    this.options.host = ip;\n    return this;\n  }\n\n  public localhost = this.host.bind(this, \"127.0.0.1\");\n\n  public dev() {\n    return this.strictPort().host(\"0.0.0.0\").allowedHost(true);\n  }\n\n  public build(): ServerOptions {\n    const clone = cloneDeep(this.options);\n    return omitBy<ServerOptions>(clone, isUndefined);\n  }\n}\n","import { cloneDeep } from \"lodash-es\";\nimport type { InlineConfig, VitestEnvironment } from \"vitest/node\";\n\n/**\n * A builder for test configurations found in vite's defineConfig test field.\n *\n * @deprecated\n *        Use @zthun/janitor-vite plugins instead.  Those plugins automatically\n *        give test configuration.\n *\n */\nexport class ZViteTestBuilder {\n  private test: InlineConfig;\n\n  /**\n   * Initializes a new instance of this object.\n   */\n  public constructor() {\n    this.test = {\n      environment: \"node\",\n      testTimeout: 30000,\n      coverage: {\n        provider: \"v8\",\n      },\n    };\n  }\n\n  /**\n   * Sets the test environment.\n   *\n   * @param environment -\n   *        The test environment to use.\n   *\n   * @returns\n   *        This object.\n   */\n  public environment(environment: VitestEnvironment) {\n    this.test.environment = environment;\n    return this;\n  }\n\n  /**\n   * Sets the test environment to \"node\".\n   *\n   * @returns\n   *        This object.\n   */\n  public node = this.environment.bind(this, \"node\");\n\n  /**\n   * Sets the test environment to \"happy-dom\".\n   *\n   * @returns\n   *        This object.\n   */\n  public browser = this.environment.bind(this, \"happy-dom\");\n\n  /**\n   * Sets the test coverage provider.\n   *\n   * @param provider -\n   *        The test coverage provider to use.\n   *\n   * @returns\n   *        This object.\n   */\n  public coverage(provider: \"v8\" | \"istanbul\") {\n    this.test.coverage = { ...this.test.coverage, provider };\n    return this;\n  }\n\n  /**\n   * Sets the test coverage provider to \"v8\".\n   *\n   * @returns\n   *        This object.\n   */\n  public v8 = this.coverage.bind(this, \"v8\");\n\n  /**\n   * Sets the test coverage provider to \"istanbul\".\n   *\n   * @returns\n   *        This object.\n   */\n  public istanbul = this.coverage.bind(this, \"istanbul\");\n\n  /**\n   * Adds to the list of projects.\n   *\n   * @param project -\n   *        The list of projects.\n   *\n   * @returns\n   *        This object.\n   */\n  public project(project: string | string[] = []) {\n    const projects = this.test.projects || [];\n    this.test.projects = projects.concat(project);\n    return this;\n  }\n\n  /**\n   * Adds monorepo support to the test builder.\n   *\n   * @param packages -\n   *        The path to the package directory.\n   *\n   * @returns\n   *        This object.\n   */\n  public monorepo(packages = \"packages\") {\n    return this.project(`${packages}/*/vite.config.{js,cjs,mjs,ts,mts}`);\n  }\n\n  /**\n   * This sets the max concurrency to one and resets\n   * the environment after every test.\n   *\n   * Use this in the case that you want to have\n   * strategic tests that can step over one another. For example,\n   * writing to the file system and deleting from the file system\n   * can have race conditions.  If your app or library tests heavily\n   * depend on those operations, then you should run your tests serially.\n   *\n   * @returns\n   *        This object.\n   */\n  public runSerially() {\n    this.test.fileParallelism = false;\n    this.test.maxConcurrency = 1;\n    this.test.isolate = true;\n\n    return this;\n  }\n\n  /**\n   * Returns the built test configuration.\n   *\n   * @returns\n   *        A deep clone of the test configuration.\n   */\n  public build() {\n    return cloneDeep(this.test);\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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