@zthun/janitor-build-config 19.1.1 → 19.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/typedoc/typedoc-config-builder.d.mts +1 -1
- package/dist/typedoc.cjs +1 -1
- package/dist/typedoc.cjs.map +1 -1
- package/dist/typedoc.js +1 -1
- package/dist/typedoc.js.map +1 -1
- package/dist/vite.cjs +2 -2
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.js +2 -2
- package/dist/vite.js.map +1 -1
- package/package.json +4 -4
- /package/dist/typedoc/{index.d.ts → index.d.mts} +0 -0
- /package/dist/vite/{index.d.ts → index.d.mts} +0 -0
|
@@ -4,7 +4,7 @@ import { EntryPointStrategy, TypeDocOptions } from 'typedoc';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class ZTypedocConfigBuilder {
|
|
6
6
|
static readonly OutputDist = "./dist";
|
|
7
|
-
static readonly EntryPointIndex = "./src/index.
|
|
7
|
+
static readonly EntryPointIndex = "./src/index.mts";
|
|
8
8
|
private typedoc;
|
|
9
9
|
/**
|
|
10
10
|
* Sets the output directory for the documentation.
|
package/dist/typedoc.cjs
CHANGED
|
@@ -148,7 +148,7 @@ const _ZTypedocConfigBuilder = class _ZTypedocConfigBuilder {
|
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
_ZTypedocConfigBuilder.OutputDist = "./dist";
|
|
151
|
-
_ZTypedocConfigBuilder.EntryPointIndex = "./src/index.
|
|
151
|
+
_ZTypedocConfigBuilder.EntryPointIndex = "./src/index.mts";
|
|
152
152
|
let ZTypedocConfigBuilder = _ZTypedocConfigBuilder;
|
|
153
153
|
exports.ZTypedocConfigBuilder = ZTypedocConfigBuilder;
|
|
154
154
|
//# sourceMappingURL=typedoc.cjs.map
|
package/dist/typedoc.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedoc.cjs","sources":["../src/typedoc/typedoc-config-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { EntryPointStrategy, TypeDocOptions } from \"typedoc\";\n\n/**\n * A builder for TypeDoc configurations.\n */\nexport class ZTypedocConfigBuilder {\n public static readonly OutputDist = \"./dist\";\n public static readonly EntryPointIndex = \"./src/index.
|
|
1
|
+
{"version":3,"file":"typedoc.cjs","sources":["../src/typedoc/typedoc-config-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { EntryPointStrategy, TypeDocOptions } from \"typedoc\";\n\n/**\n * A builder for TypeDoc configurations.\n */\nexport class ZTypedocConfigBuilder {\n public static readonly OutputDist = \"./dist\";\n public static readonly EntryPointIndex = \"./src/index.mts\";\n\n private typedoc: TypeDocOptions = {};\n\n /**\n * Sets the output directory for the documentation.\n *\n * @param path -\n * The output directory path.\n * @returns\n * This object.\n */\n public out(path: string) {\n this.typedoc.out = path;\n return this;\n }\n\n /**\n * Sets the output directory to \"./dist\".\n *\n * @returns\n * This object.\n */\n public dist = this.out.bind(this, ZTypedocConfigBuilder.OutputDist);\n\n /**\n * Adds a list of entry point glob to the existing entry points.\n *\n * @param glob -\n * The entry point glob pattern.\n *\n * @returns\n * This object.\n */\n public entry(glob: string | string) {\n const entry = this.typedoc.entryPoints || [];\n this.typedoc.entryPoints = entry.concat(glob);\n return this;\n }\n\n /**\n * Adds an entry point for './src/index.ts'.\n *\n * @returns\n * This object.\n */\n public index = this.entry.bind(this, ZTypedocConfigBuilder.EntryPointIndex);\n\n /**\n * Sets the entry point strategy.\n *\n * See {@link https://typedoc.org/api/enums/EntryPointStrategy.html | EntryPointStrategy}\n * for more details.\n *\n * @param strategy -\n * The entry point strategy to use.\n *\n * @returns\n * This object.\n */\n public entryPointStrategy(strategy: EntryPointStrategy) {\n this.typedoc.entryPointStrategy = strategy;\n return this;\n }\n\n /**\n * Sets the entry point strategy to \"resolve\".\n *\n * @returns\n * This object.\n */\n public resolve = this.entryPointStrategy.bind(this, \"resolve\");\n\n /**\n * Sets the entry point strategy to \"packages\".\n *\n * @returns\n * This object.\n */\n public packages = this.entryPointStrategy.bind(this, \"packages\");\n\n /**\n * Sets the excludeNotDocumented flag.\n *\n * @returns\n * This object.\n */\n public excludeNotDocumented() {\n this.typedoc.excludeNotDocumented = true;\n return this;\n }\n\n /**\n * Sets the categorizeByGroup flag.\n *\n * @returns\n * This object.\n */\n public categorizeByGroup() {\n this.typedoc.categorizeByGroup = true;\n return this;\n }\n\n /**\n * Sets the name of the project.\n *\n * @param name -\n * The name of the project.\n *\n * @returns\n * This object.\n */\n public name(name: string) {\n this.typedoc.name = name;\n return this;\n }\n\n /**\n * Sets the favicon for the project.\n *\n * @param path -\n * The path to the favicon file.\n *\n * @returns\n * This object.\n */\n public favicon(path: string) {\n this.typedoc.favicon = path;\n return this;\n }\n\n /**\n * Adds a single exclude glob to the existing excludes.\n *\n * @param glob -\n * The exclude glob pattern.\n *\n * @returns\n * This object.\n */\n public exclude(glob: string | string[]) {\n const excludes = this.typedoc.exclude || [];\n this.typedoc.exclude = excludes.concat(glob);\n return this;\n }\n\n /**\n * Sets the typedoc configuration to be used for an individual project.\n *\n * An individual project typedoc does not output any documentation by itself,\n * but is part of a larger project that does.\n *\n * @returns\n * This object.\n */\n public project() {\n return this.resolve().dist();\n }\n\n /**\n * Sets the typedoc configuration to be used a web project that outputs\n * final documentation for a monorepo of packages.\n *\n * Normally, your monorepo will have a single web or doc project that outputs\n * the typescript for every package in the monorepo. Use this configuration\n * for that project.\n *\n * @returns\n * This object.\n */\n public web() {\n return this.packages()\n .excludeNotDocumented()\n .categorizeByGroup()\n .dist()\n .exclude(\"./\");\n }\n\n /**\n * Builds the final typedoc configuration object.\n *\n * @returns\n * The final typedoc configuration object.\n */\n public build() {\n return cloneDeep(this.typedoc);\n }\n}\n"],"names":["cloneDeep"],"mappings":";;;AAMO,MAAM,yBAAN,MAAM,uBAAsB;AAAA,EAA5B,cAAA;AAIL,SAAQ,UAA0B,CAAC;AAqBnC,SAAO,OAAO,KAAK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MAAyB;AACtC,UAAM,WAAW,KAAK,QAAQ,WAAW,CAAC;AAC1C,SAAK,QAAQ,UAAU,SAAS,OAAO,IAAI;AACpC,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,UAAU;AACR,WAAA,KAAK,QAAQ,EAAE,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EActB,MAAM;AACJ,WAAA,KAAK,SAAS,EAClB,qBAAqB,EACrB,oBACA,KAAA,EACA,QAAQ,IAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASV,QAAQ;AACN,WAAAA,SAAA,UAAU,KAAK,OAAO;AAAA,EAAA;AAEjC;AA5LE,uBAAuB,aAAa;AACpC,uBAAuB,kBAAkB;AAFpC,IAAM,wBAAN;;"}
|
package/dist/typedoc.js
CHANGED
|
@@ -146,7 +146,7 @@ const _ZTypedocConfigBuilder = class _ZTypedocConfigBuilder {
|
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
_ZTypedocConfigBuilder.OutputDist = "./dist";
|
|
149
|
-
_ZTypedocConfigBuilder.EntryPointIndex = "./src/index.
|
|
149
|
+
_ZTypedocConfigBuilder.EntryPointIndex = "./src/index.mts";
|
|
150
150
|
let ZTypedocConfigBuilder = _ZTypedocConfigBuilder;
|
|
151
151
|
export {
|
|
152
152
|
ZTypedocConfigBuilder
|
package/dist/typedoc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedoc.js","sources":["../src/typedoc/typedoc-config-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { EntryPointStrategy, TypeDocOptions } from \"typedoc\";\n\n/**\n * A builder for TypeDoc configurations.\n */\nexport class ZTypedocConfigBuilder {\n public static readonly OutputDist = \"./dist\";\n public static readonly EntryPointIndex = \"./src/index.
|
|
1
|
+
{"version":3,"file":"typedoc.js","sources":["../src/typedoc/typedoc-config-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { EntryPointStrategy, TypeDocOptions } from \"typedoc\";\n\n/**\n * A builder for TypeDoc configurations.\n */\nexport class ZTypedocConfigBuilder {\n public static readonly OutputDist = \"./dist\";\n public static readonly EntryPointIndex = \"./src/index.mts\";\n\n private typedoc: TypeDocOptions = {};\n\n /**\n * Sets the output directory for the documentation.\n *\n * @param path -\n * The output directory path.\n * @returns\n * This object.\n */\n public out(path: string) {\n this.typedoc.out = path;\n return this;\n }\n\n /**\n * Sets the output directory to \"./dist\".\n *\n * @returns\n * This object.\n */\n public dist = this.out.bind(this, ZTypedocConfigBuilder.OutputDist);\n\n /**\n * Adds a list of entry point glob to the existing entry points.\n *\n * @param glob -\n * The entry point glob pattern.\n *\n * @returns\n * This object.\n */\n public entry(glob: string | string) {\n const entry = this.typedoc.entryPoints || [];\n this.typedoc.entryPoints = entry.concat(glob);\n return this;\n }\n\n /**\n * Adds an entry point for './src/index.ts'.\n *\n * @returns\n * This object.\n */\n public index = this.entry.bind(this, ZTypedocConfigBuilder.EntryPointIndex);\n\n /**\n * Sets the entry point strategy.\n *\n * See {@link https://typedoc.org/api/enums/EntryPointStrategy.html | EntryPointStrategy}\n * for more details.\n *\n * @param strategy -\n * The entry point strategy to use.\n *\n * @returns\n * This object.\n */\n public entryPointStrategy(strategy: EntryPointStrategy) {\n this.typedoc.entryPointStrategy = strategy;\n return this;\n }\n\n /**\n * Sets the entry point strategy to \"resolve\".\n *\n * @returns\n * This object.\n */\n public resolve = this.entryPointStrategy.bind(this, \"resolve\");\n\n /**\n * Sets the entry point strategy to \"packages\".\n *\n * @returns\n * This object.\n */\n public packages = this.entryPointStrategy.bind(this, \"packages\");\n\n /**\n * Sets the excludeNotDocumented flag.\n *\n * @returns\n * This object.\n */\n public excludeNotDocumented() {\n this.typedoc.excludeNotDocumented = true;\n return this;\n }\n\n /**\n * Sets the categorizeByGroup flag.\n *\n * @returns\n * This object.\n */\n public categorizeByGroup() {\n this.typedoc.categorizeByGroup = true;\n return this;\n }\n\n /**\n * Sets the name of the project.\n *\n * @param name -\n * The name of the project.\n *\n * @returns\n * This object.\n */\n public name(name: string) {\n this.typedoc.name = name;\n return this;\n }\n\n /**\n * Sets the favicon for the project.\n *\n * @param path -\n * The path to the favicon file.\n *\n * @returns\n * This object.\n */\n public favicon(path: string) {\n this.typedoc.favicon = path;\n return this;\n }\n\n /**\n * Adds a single exclude glob to the existing excludes.\n *\n * @param glob -\n * The exclude glob pattern.\n *\n * @returns\n * This object.\n */\n public exclude(glob: string | string[]) {\n const excludes = this.typedoc.exclude || [];\n this.typedoc.exclude = excludes.concat(glob);\n return this;\n }\n\n /**\n * Sets the typedoc configuration to be used for an individual project.\n *\n * An individual project typedoc does not output any documentation by itself,\n * but is part of a larger project that does.\n *\n * @returns\n * This object.\n */\n public project() {\n return this.resolve().dist();\n }\n\n /**\n * Sets the typedoc configuration to be used a web project that outputs\n * final documentation for a monorepo of packages.\n *\n * Normally, your monorepo will have a single web or doc project that outputs\n * the typescript for every package in the monorepo. Use this configuration\n * for that project.\n *\n * @returns\n * This object.\n */\n public web() {\n return this.packages()\n .excludeNotDocumented()\n .categorizeByGroup()\n .dist()\n .exclude(\"./\");\n }\n\n /**\n * Builds the final typedoc configuration object.\n *\n * @returns\n * The final typedoc configuration object.\n */\n public build() {\n return cloneDeep(this.typedoc);\n }\n}\n"],"names":[],"mappings":";AAMO,MAAM,yBAAN,MAAM,uBAAsB;AAAA,EAA5B,cAAA;AAIL,SAAQ,UAA0B,CAAC;AAqBnC,SAAO,OAAO,KAAK,IAAI,KAAK,MAAM,uBAAsB,UAAU;AAuBlE,SAAO,QAAQ,KAAK,MAAM,KAAK,MAAM,uBAAsB,eAAe;AAyB1E,SAAO,UAAU,KAAK,mBAAmB,KAAK,MAAM,SAAS;AAQ7D,SAAO,WAAW,KAAK,mBAAmB,KAAK,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AU;AACR,WAAA,KAAK,QAAQ,EAAE,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EActB,MAAM;AACJ,WAAA,KAAK,SAAS,EAClB,qBAAqB,EACrB,oBACA,KAAA,EACA,QAAQ,IAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASV,QAAQ;AACN,WAAA,UAAU,KAAK,OAAO;AAAA,EAAA;AAEjC;AA5LE,uBAAuB,aAAa;AACpC,uBAAuB,kBAAkB;AAFpC,IAAM,wBAAN;"}
|
package/dist/vite.cjs
CHANGED
|
@@ -40,7 +40,7 @@ class ZViteLibraryBuilder {
|
|
|
40
40
|
* This object.
|
|
41
41
|
*/
|
|
42
42
|
index() {
|
|
43
|
-
return this.entry("index", "./src/index.
|
|
43
|
+
return this.entry("index", "./src/index.mts");
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Returns the built library configuration.
|
|
@@ -246,7 +246,7 @@ class ZViteConfigBuilder {
|
|
|
246
246
|
* This object.
|
|
247
247
|
*/
|
|
248
248
|
cli() {
|
|
249
|
-
const library = new ZViteLibraryBuilder().entry("index", "src/index.
|
|
249
|
+
const library = new ZViteLibraryBuilder().entry("index", "src/index.mts").entry("cli", "src/cli.mts").build();
|
|
250
250
|
return this.library(library);
|
|
251
251
|
}
|
|
252
252
|
/**
|
package/dist/vite.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.cjs","sources":["../src/vite/vite-library-builder.mts","../src/vite/vite-test-builder.mts","../src/vite/vite-config-builder.mts","../src/vite/vite-server-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { LibraryOptions } from \"vite\";\n\n/**\n * A builder for Vite library configurations.\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.ts\");\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 { 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 */\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 all: false,\n provider: undefined,\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}/*/vitest.config.{js,cjs,mjs,ts,mts}`);\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","import react from \"@vitejs/plugin-react\";\nimport { castArray, cloneDeep } from \"lodash-es\";\nimport swc from \"unplugin-swc\";\nimport type {\n LibraryOptions,\n PluginOption,\n ServerOptions,\n UserConfig,\n} from \"vite\";\nimport { checker } from \"vite-plugin-checker\";\nimport dtsPlugin from \"vite-plugin-dts\";\nimport { externalizeDeps } from \"vite-plugin-externalize-deps\";\nimport tsConfigPaths from \"vite-tsconfig-paths\";\nimport type { InlineConfig as TestConfig } from \"vitest/node.js\";\nimport { ZViteLibraryBuilder } from \"./vite-library-builder.mjs\";\nimport { ZViteTestBuilder } from \"./vite-test-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 */\nexport class ZViteConfigBuilder {\n private config: UserConfig;\n\n /**\n * Initializes a new instance of this object.\n */\n public constructor() {\n this.config = {\n build: {\n minify: true,\n sourcemap: false,\n },\n plugins: [tsConfigPaths()],\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 * Adds the swc plugin.\n *\n * This is mostly for nest projects as nest requires\n * swc to support decorators.\n */\n public swc() {\n return this.plugin(swc.vite());\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 * 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 });\n const external = externalizeDeps();\n\n return this.minify(false).sourceMap().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\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.ts\")\n .entry(\"cli\", \"src/cli.ts\")\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).swc();\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. If this is falsy,\n * then a test setup using a monorepo with an\n * istanbul provider in node is used.\n */\n public test(\n options: TestConfig = new ZViteTestBuilder()\n .node()\n .istanbul()\n .monorepo()\n .build(),\n ) {\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\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() {\n const clone = cloneDeep(this.options);\n return omitBy<ServerOptions>(clone, isUndefined) as ServerOptions;\n }\n}\n"],"names":["cloneDeep","castArray","externalizeDeps","checker","omitBy","isUndefined"],"mappings":";;;;;;;;;AAMO,MAAM,oBAAoB;AAAA,EAA1B,cAAA;AACL,SAAQ,UAA0B;AAAA,MAChC,OAAO,CAAC;AAAA,MACR,SAAS,CAAC,MAAM,KAAK;AAAA,IACvB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,MAAM,MAAc,MAAc;AACvC,SAAK,QAAQ,QAAQ;AAAA,MACnB,GAAI,KAAK,QAAQ;AAAA,MACjB,CAAC,IAAI,GAAG;AAAA,IACV;AACO,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUF,QAAQ;AACN,WAAA,KAAK,MAAM,SAAS,gBAAgB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStC,QAAQ;AACN,WAAAA,SAAA,UAAU,KAAK,OAAO;AAAA,EAAA;AAEjC;AC7CO,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA,EAMrB,cAAc;AA+BrB,SAAO,OAAO,KAAK,YAAY,KAAK,MAAM,MAAM;AAQhD,SAAO,UAAU,KAAK,YAAY,KAAK,MAAM,WAAW;AAsBxD,SAAO,KAAK,KAAK,SAAS,KAAK,MAAM,IAAI;AAQzC,SAAO,WAAW,KAAK,SAAS,KAAK,MAAM,UAAU;AApEnD,SAAK,OAAO;AAAA,MACV,aAAa;AAAA,MACb,aAAa;AAAA,MACb,UAAU;AAAA,QACR,KAAK;AAAA,QACL,UAAU;AAAA,MAAA;AAAA,IAEd;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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,EAGF,KAAK,IAAY;AACtB,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA,EAKF,MAAM;AACX,WAAO,KAAK,aAAa,KAAK,SAAS,EAAE,YAAY,IAAI;AAAA,EAAA;AAAA,EAGpD,QAAQ;AACP,UAAA,QAAQA,SAAAA,UAAU,KAAK,OAAO;AAC7B,WAAAI,SAAA,OAAsB,OAAOC,oBAAW;AAAA,EAAA;AAEnD;;;;;"}
|
|
1
|
+
{"version":3,"file":"vite.cjs","sources":["../src/vite/vite-library-builder.mts","../src/vite/vite-test-builder.mts","../src/vite/vite-config-builder.mts","../src/vite/vite-server-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { LibraryOptions } from \"vite\";\n\n/**\n * A builder for Vite library configurations.\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 { 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 */\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 all: false,\n provider: undefined,\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}/*/vitest.config.{js,cjs,mjs,ts,mts}`);\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","import react from \"@vitejs/plugin-react\";\nimport { castArray, cloneDeep } from \"lodash-es\";\nimport swc from \"unplugin-swc\";\nimport type {\n LibraryOptions,\n PluginOption,\n ServerOptions,\n UserConfig,\n} from \"vite\";\nimport { checker } from \"vite-plugin-checker\";\nimport dtsPlugin from \"vite-plugin-dts\";\nimport { externalizeDeps } from \"vite-plugin-externalize-deps\";\nimport tsConfigPaths from \"vite-tsconfig-paths\";\nimport type { InlineConfig as TestConfig } from \"vitest/node.js\";\nimport { ZViteLibraryBuilder } from \"./vite-library-builder.mjs\";\nimport { ZViteTestBuilder } from \"./vite-test-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 */\nexport class ZViteConfigBuilder {\n private config: UserConfig;\n\n /**\n * Initializes a new instance of this object.\n */\n public constructor() {\n this.config = {\n build: {\n minify: true,\n sourcemap: false,\n },\n plugins: [tsConfigPaths()],\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 * Adds the swc plugin.\n *\n * This is mostly for nest projects as nest requires\n * swc to support decorators.\n */\n public swc() {\n return this.plugin(swc.vite());\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 * 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 });\n const external = externalizeDeps();\n\n return this.minify(false).sourceMap().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\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).swc();\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. If this is falsy,\n * then a test setup using a monorepo with an\n * istanbul provider in node is used.\n */\n public test(\n options: TestConfig = new ZViteTestBuilder()\n .node()\n .istanbul()\n .monorepo()\n .build(),\n ) {\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\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() {\n const clone = cloneDeep(this.options);\n return omitBy<ServerOptions>(clone, isUndefined) as ServerOptions;\n }\n}\n"],"names":["cloneDeep","castArray","externalizeDeps","checker","omitBy","isUndefined"],"mappings":";;;;;;;;;AAMO,MAAM,oBAAoB;AAAA,EAA1B,cAAA;AACL,SAAQ,UAA0B;AAAA,MAChC,OAAO,CAAC;AAAA,MACR,SAAS,CAAC,MAAM,KAAK;AAAA,IACvB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,MAAM,MAAc,MAAc;AACvC,SAAK,QAAQ,QAAQ;AAAA,MACnB,GAAI,KAAK,QAAQ;AAAA,MACjB,CAAC,IAAI,GAAG;AAAA,IACV;AACO,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUF,QAAQ;AACN,WAAA,KAAK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M,mBAAmB;AAAA,EAAzB,cAAA;AACL,SAAQ,UAAyB,CAAC;AAiClC,SAAO,YAAY,KAAK,KAAK,KAAK,MAAM,WAAW;AAAA,EAAA;AAAA,EA/B5C,YAAY,MAAgC;AACjD,QAAI,SAAS,MAAM;AACjB,WAAK,QAAQ,eAAe;AAAA,IACnB,WAAA,KAAK,QAAQ,iBAAiB,MAAM;AAC7C,YAAM,QAAQ,KAAK,QAAQ,gBAAgB,CAAC;AAC5C,WAAK,QAAQ,eAAe,MAAM,OAAO,IAAI;AAAA,IAAA;AAGxC,WAAA;AAAA,EAAA;AAAA,EAGF,eAAe;AACpB,WAAO,KAAK,QAAQ;AACb,WAAA;AAAA,EAAA;AAAA,EAGF,KAAK,MAAe;AACzB,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA,EAGF,aAAa;AAClB,SAAK,QAAQ,aAAa;AACnB,WAAA;AAAA,EAAA;AAAA,EAGF,KAAK,IAAY;AACtB,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA,EAKF,MAAM;AACX,WAAO,KAAK,aAAa,KAAK,SAAS,EAAE,YAAY,IAAI;AAAA,EAAA;AAAA,EAGpD,QAAQ;AACP,UAAA,QAAQA,SAAAA,UAAU,KAAK,OAAO;AAC7B,WAAAI,SAAA,OAAsB,OAAOC,oBAAW;AAAA,EAAA;AAEnD;;;;;"}
|
package/dist/vite.js
CHANGED
|
@@ -38,7 +38,7 @@ class ZViteLibraryBuilder {
|
|
|
38
38
|
* This object.
|
|
39
39
|
*/
|
|
40
40
|
index() {
|
|
41
|
-
return this.entry("index", "./src/index.
|
|
41
|
+
return this.entry("index", "./src/index.mts");
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* Returns the built library configuration.
|
|
@@ -244,7 +244,7 @@ class ZViteConfigBuilder {
|
|
|
244
244
|
* This object.
|
|
245
245
|
*/
|
|
246
246
|
cli() {
|
|
247
|
-
const library = new ZViteLibraryBuilder().entry("index", "src/index.
|
|
247
|
+
const library = new ZViteLibraryBuilder().entry("index", "src/index.mts").entry("cli", "src/cli.mts").build();
|
|
248
248
|
return this.library(library);
|
|
249
249
|
}
|
|
250
250
|
/**
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sources":["../src/vite/vite-library-builder.mts","../src/vite/vite-test-builder.mts","../src/vite/vite-config-builder.mts","../src/vite/vite-server-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { LibraryOptions } from \"vite\";\n\n/**\n * A builder for Vite library configurations.\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.ts\");\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 { 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 */\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 all: false,\n provider: undefined,\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}/*/vitest.config.{js,cjs,mjs,ts,mts}`);\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","import react from \"@vitejs/plugin-react\";\nimport { castArray, cloneDeep } from \"lodash-es\";\nimport swc from \"unplugin-swc\";\nimport type {\n LibraryOptions,\n PluginOption,\n ServerOptions,\n UserConfig,\n} from \"vite\";\nimport { checker } from \"vite-plugin-checker\";\nimport dtsPlugin from \"vite-plugin-dts\";\nimport { externalizeDeps } from \"vite-plugin-externalize-deps\";\nimport tsConfigPaths from \"vite-tsconfig-paths\";\nimport type { InlineConfig as TestConfig } from \"vitest/node.js\";\nimport { ZViteLibraryBuilder } from \"./vite-library-builder.mjs\";\nimport { ZViteTestBuilder } from \"./vite-test-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 */\nexport class ZViteConfigBuilder {\n private config: UserConfig;\n\n /**\n * Initializes a new instance of this object.\n */\n public constructor() {\n this.config = {\n build: {\n minify: true,\n sourcemap: false,\n },\n plugins: [tsConfigPaths()],\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 * Adds the swc plugin.\n *\n * This is mostly for nest projects as nest requires\n * swc to support decorators.\n */\n public swc() {\n return this.plugin(swc.vite());\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 * 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 });\n const external = externalizeDeps();\n\n return this.minify(false).sourceMap().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\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.ts\")\n .entry(\"cli\", \"src/cli.ts\")\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).swc();\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. If this is falsy,\n * then a test setup using a monorepo with an\n * istanbul provider in node is used.\n */\n public test(\n options: TestConfig = new ZViteTestBuilder()\n .node()\n .istanbul()\n .monorepo()\n .build(),\n ) {\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\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() {\n const clone = cloneDeep(this.options);\n return omitBy<ServerOptions>(clone, isUndefined) as ServerOptions;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAMO,MAAM,oBAAoB;AAAA,EAA1B,cAAA;AACL,SAAQ,UAA0B;AAAA,MAChC,OAAO,CAAC;AAAA,MACR,SAAS,CAAC,MAAM,KAAK;AAAA,IACvB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,MAAM,MAAc,MAAc;AACvC,SAAK,QAAQ,QAAQ;AAAA,MACnB,GAAI,KAAK,QAAQ;AAAA,MACjB,CAAC,IAAI,GAAG;AAAA,IACV;AACO,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUF,QAAQ;AACN,WAAA,KAAK,MAAM,SAAS,gBAAgB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStC,QAAQ;AACN,WAAA,UAAU,KAAK,OAAO;AAAA,EAAA;AAEjC;AC7CO,MAAM,iBAAi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AAA,KAAK,QAAQ,iBAAiB,MAAM;AAC7C,YAAM,QAAQ,KAAK,QAAQ,gBAAgB,CAAC;AAC5C,WAAK,QAAQ,eAAe,MAAM,OAAO,IAAI;AAAA,IAAA;AAGxC,WAAA;AAAA,EAAA;AAAA,EAGF,eAAe;AACpB,WAAO,KAAK,QAAQ;AACb,WAAA;AAAA,EAAA;AAAA,EAGF,KAAK,MAAe;AACzB,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA,EAGF,aAAa;AAClB,SAAK,QAAQ,aAAa;AACnB,WAAA;AAAA,EAAA;AAAA,EAGF,KAAK,IAAY;AACtB,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA,EAKF,MAAM;AACX,WAAO,KAAK,aAAa,KAAK,SAAS,EAAE,YAAY,IAAI;AAAA,EAAA;AAAA,EAGpD,QAAQ;AACP,UAAA,QAAQ,UAAU,KAAK,OAAO;AAC7B,WAAA,OAAsB,OAAO,WAAW;AAAA,EAAA;AAEnD;"}
|
|
1
|
+
{"version":3,"file":"vite.js","sources":["../src/vite/vite-library-builder.mts","../src/vite/vite-test-builder.mts","../src/vite/vite-config-builder.mts","../src/vite/vite-server-builder.mts"],"sourcesContent":["import { cloneDeep } from \"lodash-es\";\nimport type { LibraryOptions } from \"vite\";\n\n/**\n * A builder for Vite library configurations.\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 { 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 */\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 all: false,\n provider: undefined,\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}/*/vitest.config.{js,cjs,mjs,ts,mts}`);\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","import react from \"@vitejs/plugin-react\";\nimport { castArray, cloneDeep } from \"lodash-es\";\nimport swc from \"unplugin-swc\";\nimport type {\n LibraryOptions,\n PluginOption,\n ServerOptions,\n UserConfig,\n} from \"vite\";\nimport { checker } from \"vite-plugin-checker\";\nimport dtsPlugin from \"vite-plugin-dts\";\nimport { externalizeDeps } from \"vite-plugin-externalize-deps\";\nimport tsConfigPaths from \"vite-tsconfig-paths\";\nimport type { InlineConfig as TestConfig } from \"vitest/node.js\";\nimport { ZViteLibraryBuilder } from \"./vite-library-builder.mjs\";\nimport { ZViteTestBuilder } from \"./vite-test-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 */\nexport class ZViteConfigBuilder {\n private config: UserConfig;\n\n /**\n * Initializes a new instance of this object.\n */\n public constructor() {\n this.config = {\n build: {\n minify: true,\n sourcemap: false,\n },\n plugins: [tsConfigPaths()],\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 * Adds the swc plugin.\n *\n * This is mostly for nest projects as nest requires\n * swc to support decorators.\n */\n public swc() {\n return this.plugin(swc.vite());\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 * 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 });\n const external = externalizeDeps();\n\n return this.minify(false).sourceMap().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\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).swc();\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. If this is falsy,\n * then a test setup using a monorepo with an\n * istanbul provider in node is used.\n */\n public test(\n options: TestConfig = new ZViteTestBuilder()\n .node()\n .istanbul()\n .monorepo()\n .build(),\n ) {\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\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() {\n const clone = cloneDeep(this.options);\n return omitBy<ServerOptions>(clone, isUndefined) as ServerOptions;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAMO,MAAM,oBAAoB;AAAA,EAA1B,cAAA;AACL,SAAQ,UAA0B;AAAA,MAChC,OAAO,CAAC;AAAA,MACR,SAAS,CAAC,MAAM,KAAK;AAAA,IACvB;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.3",
|
|
4
4
|
"description": "A shared configuration for builds that create websites, apis, and tests",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"module": "./dist/index.js",
|
|
9
9
|
"exports": {
|
|
10
10
|
"./vite": {
|
|
11
|
-
"types": "./dist/vite/index.d.
|
|
11
|
+
"types": "./dist/vite/index.d.mts",
|
|
12
12
|
"require": "./dist/vite.cjs",
|
|
13
13
|
"import": "./dist/vite.js"
|
|
14
14
|
},
|
|
15
15
|
"./typedoc": {
|
|
16
|
-
"types": "./dist/typedoc/index.d.
|
|
16
|
+
"types": "./dist/typedoc/index.d.mts",
|
|
17
17
|
"require": "./dist/typedoc.cjs",
|
|
18
18
|
"import": "./dist/typedoc.js"
|
|
19
19
|
}
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"author": "Anthony Bonta",
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "9909b6c17f4409b66c87278004e3f2d7228b7f54"
|
|
69
69
|
}
|
|
File without changes
|
|
File without changes
|