@bemedev/dev-utils 1.5.0 → 1.5.2
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/README.md +83 -12
- package/lib/_virtual/_rolldown/runtime.cjs +1 -2
- package/lib/build-tests/addTarball.cjs +8 -3
- package/lib/build-tests/addTarball.cjs.map +1 -1
- package/lib/build-tests/addTarball.d.ts +7 -1
- package/lib/build-tests/addTarball.js +8 -3
- package/lib/build-tests/addTarball.js.map +1 -1
- package/lib/build-tests/buildPackageJson.cjs +9 -4
- package/lib/build-tests/buildPackageJson.cjs.map +1 -1
- package/lib/build-tests/buildPackageJson.d.ts +14 -2
- package/lib/build-tests/buildPackageJson.js +9 -4
- package/lib/build-tests/buildPackageJson.js.map +1 -1
- package/lib/build-tests/cleanup.cjs +5 -3
- package/lib/build-tests/cleanup.cjs.map +1 -1
- package/lib/build-tests/cleanup.d.ts +4 -1
- package/lib/build-tests/cleanup.js +5 -3
- package/lib/build-tests/cleanup.js.map +1 -1
- package/lib/build-tests/cli/cli.cjs +6 -4
- package/lib/build-tests/cli/cli.cjs.map +1 -1
- package/lib/build-tests/cli/cli.d.ts +3 -0
- package/lib/build-tests/cli/cli.js +6 -4
- package/lib/build-tests/cli/cli.js.map +1 -1
- package/lib/build-tests/cli/index.cjs +1 -2
- package/lib/build-tests/cli/index.cjs.map +1 -1
- package/lib/build-tests/cli/index.js +1 -2
- package/lib/build-tests/cli/post.cjs +5 -3
- package/lib/build-tests/cli/post.cjs.map +1 -1
- package/lib/build-tests/cli/post.d.ts +4 -1
- package/lib/build-tests/cli/post.js +5 -3
- package/lib/build-tests/cli/post.js.map +1 -1
- package/lib/build-tests/cli/pre.cjs +5 -3
- package/lib/build-tests/cli/pre.cjs.map +1 -1
- package/lib/build-tests/cli/pre.d.ts +4 -1
- package/lib/build-tests/cli/pre.js +5 -3
- package/lib/build-tests/cli/pre.js.map +1 -1
- package/lib/build-tests/cli/test.cjs +4 -2
- package/lib/build-tests/cli/test.cjs.map +1 -1
- package/lib/build-tests/cli/test.d.ts +3 -0
- package/lib/build-tests/cli/test.js +4 -2
- package/lib/build-tests/cli/test.js.map +1 -1
- package/lib/build-tests/constants.cjs +1 -2
- package/lib/build-tests/constants.js +1 -2
- package/lib/build-tests/getRelativePath.cjs +1 -2
- package/lib/build-tests/getRelativePath.d.ts +1 -1
- package/lib/build-tests/getRelativePath.js +1 -2
- package/lib/build-tests/getTypescriptOutdir.cjs +1 -2
- package/lib/build-tests/getTypescriptOutdir.d.ts +1 -1
- package/lib/build-tests/getTypescriptOutdir.js +1 -2
- package/lib/build-tests/import.cjs +1 -2
- package/lib/build-tests/import.js +1 -2
- package/lib/build-tests/imports/create.cjs +1 -2
- package/lib/build-tests/imports/create.js +1 -2
- package/lib/build-tests/imports/helper.cjs +1 -2
- package/lib/build-tests/imports/helper.js +1 -2
- package/lib/build-tests/imports/index.js +1 -2
- package/lib/build-tests/index.cjs +1 -1
- package/lib/build-tests/index.js +1 -1
- package/lib/build-tests/pack.cjs +2 -3
- package/lib/build-tests/pack.d.ts +1 -1
- package/lib/build-tests/pack.js +2 -3
- package/lib/pack/config.cjs +103 -0
- package/lib/pack/config.cjs.map +1 -0
- package/lib/pack/config.d.ts +21 -0
- package/lib/pack/config.js +102 -0
- package/lib/pack/config.js.map +1 -0
- package/lib/pack/constants.cjs +45 -0
- package/lib/pack/constants.cjs.map +1 -0
- package/lib/pack/constants.d.ts +23 -0
- package/lib/pack/constants.js +40 -0
- package/lib/pack/constants.js.map +1 -0
- package/lib/pack/index.cjs +17 -0
- package/lib/pack/index.d.ts +6 -0
- package/lib/pack/index.js +6 -0
- package/lib/pack/input.cjs +19 -0
- package/lib/pack/input.cjs.map +1 -0
- package/lib/pack/input.d.ts +10 -0
- package/lib/pack/input.js +18 -0
- package/lib/pack/input.js.map +1 -0
- package/lib/pack/output.cjs +26 -0
- package/lib/pack/output.cjs.map +1 -0
- package/lib/pack/output.d.ts +13 -0
- package/lib/pack/output.js +25 -0
- package/lib/pack/output.js.map +1 -0
- package/lib/pack/plugins/circulars.cjs +39 -0
- package/lib/pack/plugins/circulars.cjs.map +1 -0
- package/lib/pack/plugins/circulars.d.ts +18 -0
- package/lib/pack/plugins/circulars.js +38 -0
- package/lib/pack/plugins/circulars.js.map +1 -0
- package/lib/pack/plugins/index.cjs +22 -0
- package/lib/pack/plugins/index.cjs.map +1 -0
- package/lib/pack/plugins/index.d.ts +25 -0
- package/lib/pack/plugins/index.js +21 -0
- package/lib/pack/plugins/index.js.map +1 -0
- package/lib/pack/project.cjs +32 -0
- package/lib/pack/project.cjs.map +1 -0
- package/lib/pack/project.d.ts +9 -0
- package/lib/pack/project.js +31 -0
- package/lib/pack/project.js.map +1 -0
- package/lib/pack/types.d.ts +46 -0
- package/lib/plugins/hmr.cjs +3 -4
- package/lib/plugins/hmr.cjs.map +1 -1
- package/lib/plugins/hmr.d.ts +1 -1
- package/lib/plugins/hmr.js +2 -3
- package/lib/plugins/suppressWarnings.cjs +1 -2
- package/lib/plugins/suppressWarnings.js +1 -2
- package/lib/rolldown-config/config.cjs +3 -4
- package/lib/rolldown-config/config.cjs.map +1 -1
- package/lib/rolldown-config/config.js +3 -4
- package/lib/rolldown-config/config.js.map +1 -1
- package/lib/rolldown-config/constants.cjs +1 -2
- package/lib/rolldown-config/constants.js +1 -2
- package/lib/rolldown-config/helpers.cjs +1 -2
- package/lib/rolldown-config/helpers.js +1 -2
- package/lib/rolldown-config/index.cjs +1 -1
- package/lib/rolldown-config/index.js +1 -1
- package/lib/rolldown-config/input.cjs +1 -2
- package/lib/rolldown-config/input.js +1 -2
- package/lib/rolldown-config/output.cjs +1 -2
- package/lib/rolldown-config/output.js +1 -2
- package/lib/rolldown-config/plugins/circulars.cjs +1 -2
- package/lib/rolldown-config/plugins/circulars.js +1 -2
- package/lib/rolldown-config/plugins/clean.cjs +2 -3
- package/lib/rolldown-config/plugins/clean.js +2 -3
- package/lib/rolldown-config/plugins/externals.cjs +1 -2
- package/lib/rolldown-config/plugins/externals.js +1 -2
- package/lib/rolldown-config/plugins/index.cjs +1 -2
- package/lib/rolldown-config/plugins/index.js +1 -2
- package/lib/rolldown-config/plugins/typescript.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.config.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.config.js +1 -2
- package/lib/rolldown-config/plugins/typescript.fast.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.fast.js +1 -2
- package/lib/rolldown-config/plugins/typescript.js +1 -2
- package/lib/utils/array.cjs +1 -2
- package/lib/utils/array.js +1 -2
- package/lib/utils/bemedev/globals/types.d.ts +1 -0
- package/lib/utils/bemedev/globals/utils/_unknown.cjs +1 -2
- package/lib/utils/bemedev/globals/utils/_unknown.js +1 -2
- package/lib/utils/bemedev/globals/utils/expandFn.cjs +1 -2
- package/lib/utils/bemedev/globals/utils/expandFn.js +1 -2
- package/lib/utils/clamp.cjs +1 -2
- package/lib/utils/clamp.js +1 -2
- package/lib/utils/identity.cjs +1 -2
- package/lib/utils/identity.js +1 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/sleep.cjs +1 -2
- package/lib/utils/sleep.js +1 -2
- package/lib/utils/types.d.ts +1 -1
- package/lib/vitest-exclude/constants.cjs +1 -2
- package/lib/vitest-exclude/constants.js +1 -2
- package/lib/vitest-exclude/index.js +1 -2
- package/lib/vitest-exclude/vitest.cjs +2 -3
- package/lib/vitest-exclude/vitest.js +2 -3
- package/lib/vitest-exclude/vitest.utils.cjs +1 -2
- package/lib/vitest-exclude/vitest.utils.js +1 -2
- package/lib/vitest-extended/acceptation.cjs +1 -2
- package/lib/vitest-extended/acceptation.js +1 -2
- package/lib/vitest-extended/createTests.cjs +2 -3
- package/lib/vitest-extended/createTests.js +2 -3
- package/lib/vitest-extended/done.cjs +1 -2
- package/lib/vitest-extended/done.js +1 -2
- package/lib/vitest-extended/each/error.cjs +2 -3
- package/lib/vitest-extended/each/error.js +2 -3
- package/lib/vitest-extended/each/pass.cjs +2 -3
- package/lib/vitest-extended/each/pass.js +2 -3
- package/lib/vitest-extended/fakeWaiter.cjs +1 -2
- package/lib/vitest-extended/fakeWaiter.js +1 -2
- package/lib/vitest-extended/fixtures/coverage.cjs +1 -2
- package/lib/vitest-extended/fixtures/coverage.js +1 -2
- package/lib/vitest-extended/fixtures/partialCall.cjs +1 -2
- package/lib/vitest-extended/fixtures/partialCall.js +1 -2
- package/lib/vitest-extended/fixtures/toUpper.cjs +1 -2
- package/lib/vitest-extended/fixtures/toUpper.js +1 -2
- package/lib/vitest-extended/fixtures/vitest.cjs +1 -2
- package/lib/vitest-extended/fixtures/vitest.js +1 -2
- package/lib/vitest-extended/fixtures/zod.cjs +1 -2
- package/lib/vitest-extended/fixtures/zod.js +1 -2
- package/lib/vitest-extended/identity.cjs +1 -2
- package/lib/vitest-extended/identity.js +1 -2
- package/lib/vitest-extended/index.cjs +2 -2
- package/lib/vitest-extended/index.js +2 -2
- package/lib/vitest-extended/isDefined.cjs +1 -2
- package/lib/vitest-extended/isDefined.js +1 -2
- package/lib/vitest-extended/isFunction.cjs +1 -2
- package/lib/vitest-extended/isFunction.js +1 -2
- package/lib/vitest-extended/project.cjs +9 -7
- package/lib/vitest-extended/project.cjs.map +1 -1
- package/lib/vitest-extended/project.d.ts +2 -2
- package/lib/vitest-extended/project.js +10 -8
- package/lib/vitest-extended/project.js.map +1 -1
- package/lib/vitest-extended/toArray.cjs +1 -2
- package/lib/vitest-extended/toArray.js +1 -2
- package/lib/vitest-extended/toStringFlat.cjs +1 -2
- package/lib/vitest-extended/toStringFlat.js +1 -2
- package/package.json +68 -59
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.cjs","names":["project"],"sources":["../../src/pack/project.ts"],"sourcesContent":["import { defineProject as project, type UserWorkspaceConfig } from 'vite-plus';\n\n/**\n * Helper function to define a Vitest project configuration with defaults.\n *\n * @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.\n *\n * @returns Configured Vitest project configuration.\n */\nexport const defineProject = (conf: UserWorkspaceConfig) => {\n const _env = conf.test?.env ?? {};\n\n return project({\n ...conf,\n resolve: { ...conf.resolve, tsconfigPaths: true },\n\n test: {\n ...conf.test,\n globals: true,\n logHeapUsage: false,\n env: { NODE_ENV: 'test', ..._env },\n },\n });\n};\n"],"mappings":";;;;;;;;;;AASA,MAAa,iBAAiB,SAA8B;CAC1D,MAAM,OAAO,KAAK,MAAM,OAAO,CAAC;CAEhC,QAAA,GAAOA,UAAAA,cAAAA,CAAQ;EACb,GAAG;EACH,SAAS;GAAE,GAAG,KAAK;GAAS,eAAe;EAAK;EAEhD,MAAM;GACJ,GAAG,KAAK;GACR,SAAS;GACT,cAAc;GACd,KAAK;IAAE,UAAU;IAAQ,GAAG;GAAK;EACnC;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type UserWorkspaceConfig } from 'vite-plus';
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to define a Vitest project configuration with defaults.
|
|
4
|
+
*
|
|
5
|
+
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
6
|
+
*
|
|
7
|
+
* @returns Configured Vitest project configuration.
|
|
8
|
+
*/
|
|
9
|
+
export declare const defineProject: (conf: UserWorkspaceConfig) => UserWorkspaceConfig;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineProject as defineProject$1 } from "vite-plus";
|
|
2
|
+
// src/pack/project.ts
|
|
3
|
+
/**
|
|
4
|
+
* Helper function to define a Vitest project configuration with defaults.
|
|
5
|
+
*
|
|
6
|
+
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
7
|
+
*
|
|
8
|
+
* @returns Configured Vitest project configuration.
|
|
9
|
+
*/
|
|
10
|
+
const defineProject = (conf) => {
|
|
11
|
+
const _env = conf.test?.env ?? {};
|
|
12
|
+
return defineProject$1({
|
|
13
|
+
...conf,
|
|
14
|
+
resolve: {
|
|
15
|
+
...conf.resolve,
|
|
16
|
+
tsconfigPaths: true
|
|
17
|
+
},
|
|
18
|
+
test: {
|
|
19
|
+
...conf.test,
|
|
20
|
+
globals: true,
|
|
21
|
+
logHeapUsage: false,
|
|
22
|
+
env: {
|
|
23
|
+
NODE_ENV: "test",
|
|
24
|
+
..._env
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export { defineProject };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","names":["project"],"sources":["../../src/pack/project.ts"],"sourcesContent":["import { defineProject as project, type UserWorkspaceConfig } from 'vite-plus';\n\n/**\n * Helper function to define a Vitest project configuration with defaults.\n *\n * @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.\n *\n * @returns Configured Vitest project configuration.\n */\nexport const defineProject = (conf: UserWorkspaceConfig) => {\n const _env = conf.test?.env ?? {};\n\n return project({\n ...conf,\n resolve: { ...conf.resolve, tsconfigPaths: true },\n\n test: {\n ...conf.test,\n globals: true,\n logHeapUsage: false,\n env: { NODE_ENV: 'test', ..._env },\n },\n });\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,iBAAiB,SAA8B;CAC1D,MAAM,OAAO,KAAK,MAAM,OAAO,CAAC;CAEhC,OAAOA,gBAAQ;EACb,GAAG;EACH,SAAS;GAAE,GAAG,KAAK;GAAS,eAAe;EAAK;EAEhD,MAAM;GACJ,GAAG,KAAK;GACR,SAAS;GACT,cAAc;GACd,KAAK;IAAE,UAAU;IAAQ,GAAG;GAAK;EACnC;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { PackUserConfig, TsdownPluginOption } from 'vite-plus/pack';
|
|
2
|
+
import type { NOmit } from '../utils/types.js';
|
|
3
|
+
import type { DEFAULT_PLUGINS } from './plugins';
|
|
4
|
+
/**
|
|
5
|
+
* Output formats supported by Vite+ Pack.
|
|
6
|
+
*/
|
|
7
|
+
export type PackFormat = 'esm' | 'cjs' | 'iife' | 'umd';
|
|
8
|
+
/**
|
|
9
|
+
* Declaration file generators supported by Vite+ Pack.
|
|
10
|
+
*/
|
|
11
|
+
export type DtsGenerator = 'tsc' | 'oxc' | 'tsgo';
|
|
12
|
+
/**
|
|
13
|
+
* Declaration file options of Vite+ Pack.
|
|
14
|
+
*/
|
|
15
|
+
export type DtsOptions = PackUserConfig['dts'];
|
|
16
|
+
/**
|
|
17
|
+
* Configuration parameters for Vite+ Pack configuration generation.
|
|
18
|
+
*/
|
|
19
|
+
export type Params = {
|
|
20
|
+
circularDeps?: string | string[];
|
|
21
|
+
excludesTS?: string | string[];
|
|
22
|
+
externals?: string | string[];
|
|
23
|
+
ignoresJS?: string | string[];
|
|
24
|
+
dir?: string;
|
|
25
|
+
sourcemap?: boolean;
|
|
26
|
+
dts?: DtsOptions;
|
|
27
|
+
plugins?: (TsdownPluginOption | keyof typeof DEFAULT_PLUGINS)[];
|
|
28
|
+
} & NOmit<PackUserConfig, keyof PackOutput | 'entry' | 'platform' | 'dts' | 'external' | 'plugins' | 'sourcemap'>;
|
|
29
|
+
/**
|
|
30
|
+
* Function type building the entry points record from glob patterns.
|
|
31
|
+
*/
|
|
32
|
+
export type BuildEntry_F = (...ignores: string[]) => Record<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Output options shared by every bundle generated by Vite+ Pack.
|
|
35
|
+
*/
|
|
36
|
+
export type PackOutput = Pick<PackUserConfig, 'outDir' | 'format' | 'unbundle' | 'fixedExtension' | 'sourcemap'>;
|
|
37
|
+
/**
|
|
38
|
+
* Vite+ Pack configuration generator with predefined presets
|
|
39
|
+
* (`bemedev`, `fast`, `default`).
|
|
40
|
+
*/
|
|
41
|
+
export type Config_F = {
|
|
42
|
+
(additionals?: Params): PackUserConfig;
|
|
43
|
+
bemedev: (additionals?: Params) => PackUserConfig;
|
|
44
|
+
fast: (additionals?: Omit<Params, 'plugins' | 'dts'>) => PackUserConfig;
|
|
45
|
+
default: (additionals?: Params) => PackUserConfig;
|
|
46
|
+
};
|
package/lib/plugins/hmr.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils_clamp = require("../utils/clamp.cjs");
|
|
3
2
|
const require_utils_array = require("../utils/array.cjs");
|
|
3
|
+
const require_utils_clamp = require("../utils/clamp.cjs");
|
|
4
4
|
let path = require("path");
|
|
5
5
|
let child_process = require("child_process");
|
|
6
|
-
|
|
6
|
+
// src/plugins/hmr.ts
|
|
7
7
|
/**
|
|
8
8
|
* Normalizes backslashes in a file path to forward slashes.
|
|
9
9
|
*
|
|
@@ -11,7 +11,7 @@ let child_process = require("child_process");
|
|
|
11
11
|
*
|
|
12
12
|
* @returns Normalized path string.
|
|
13
13
|
*/
|
|
14
|
-
const normalizePath = (path
|
|
14
|
+
const normalizePath = (path) => path.replace(/\\/g, "/");
|
|
15
15
|
/**
|
|
16
16
|
* Vite plugin providing Hot Module Reloading (HMR) capabilities for external
|
|
17
17
|
* file paths by watching files and executing mapped build scripts on changes.
|
|
@@ -69,7 +69,6 @@ const hmr = (props) => {
|
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
//#endregion
|
|
73
72
|
exports.hmr = hmr;
|
|
74
73
|
|
|
75
74
|
//# sourceMappingURL=hmr.cjs.map
|
package/lib/plugins/hmr.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmr.cjs","names":["
|
|
1
|
+
{"version":3,"file":"hmr.cjs","names":["clamp","isAbsolute","resolve","toArray","execSync"],"sources":["../../src/plugins/hmr.ts"],"sourcesContent":["import { execSync } from 'child_process';\nimport { isAbsolute, resolve } from 'path';\n\nimport { type Plugin } from 'vitest/config';\n\nimport { toArray } from '#utils/array';\nimport { clamp } from '#utils/clamp';\nimport type { SoA } from '#utils/types';\n\n/**\n * Configuration options for the HMR add-on plugin.\n */\nexport type HmrPluginProps = {\n /**\n * Map of watched file/directory paths to one or many shell commands to execute\n * when changes are detected.\n * Map of watched file or directory paths to one or many shell commands of\n * type {@linkcode SoA} to execute when changes are detected.\n */\n paths?: Record<string, SoA<string>>;\n\n /** Optional interval in milliseconds to wait before allowing another build. */\n debounce?: number;\n};\n\n/**\n * Normalizes backslashes in a file path to forward slashes.\n *\n * @param path - File path to normalize.\n *\n * @returns Normalized path string.\n */\nconst normalizePath = (path: string) => path.replace(/\\\\/g, '/');\n\n/**\n * Vite plugin providing Hot Module Reloading (HMR) capabilities for external\n * file paths by watching files and executing mapped build scripts on changes.\n *\n * @param props - Configuration properties of type {@linkcode HmrPluginProps}.\n *\n * @returns A Vite plugin object of type {@linkcode Plugin}.\n */\nexport const hmr = (props?: HmrPluginProps): Plugin => {\n // Lock variable to prevent infinite build loops\n let isBuilding = false;\n const debounce = clamp(props?.debounce ?? 500, 500, 10_000);\n const pathMap = new Map<string, string[]>();\n let isDev = false;\n\n return {\n name: 'hmr-add-on',\n\n configResolved(config) {\n isDev = !config.isProduction;\n if (!isDev) return;\n\n pathMap.clear();\n const rawPaths = props?.paths ?? {};\n\n Object.entries(rawPaths).forEach(([pathKey, rawScripts]) => {\n const resolved = isAbsolute(pathKey)\n ? pathKey\n : resolve(config.root, pathKey);\n\n const normalized = normalizePath(resolved);\n const scripts = toArray(rawScripts);\n pathMap.set(normalized, scripts);\n });\n },\n\n configureServer(server) {\n if (!isDev) return;\n\n server.watcher.add(Array.from(pathMap.keys()));\n },\n\n handleHotUpdate(ctx) {\n if (!isDev) return;\n\n // 1. If a build is already in progress, ignore ALL changes (prevents loops)\n if (isBuilding) return ctx.modules;\n const normalizedFile = normalizePath(ctx.file);\n\n // Find all matching path entries for the changed file\n const matchingScripts = new Set<string>();\n for (const [watchedPath, scripts] of pathMap.entries()) {\n if (normalizedFile.includes(watchedPath)) {\n scripts.forEach(d => matchingScripts.add(d));\n }\n }\n\n if (matchingScripts.size > 0) {\n console.log(`\\n⚡ External file modified: ${ctx.file}. Starting build...`);\n\n try {\n // 2. Acquire lock before starting the build\n isBuilding = true;\n\n // Invalidate module graph so Vite reads fresh built files from disk\n ctx.server.moduleGraph.invalidateAll();\n matchingScripts.forEach(script => execSync(script, { stdio: 'inherit' }));\n ctx.server.ws.send({ type: 'full-reload' });\n } catch (error) {\n console.error('❌ Command execution failed during HMR:', error);\n } finally {\n // 3. Once build is complete, wait for the debounce period to allow\n // Vite to ignore generated build files, then release the lock.\n setTimeout(() => {\n isBuilding = false;\n console.log('✅ Build completed. Ready for subsequent changes.');\n }, debounce);\n }\n }\n\n return ctx.modules;\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;AAgCA,MAAM,iBAAiB,SAAiB,KAAK,QAAQ,OAAO,GAAG;;;;;;;;;AAU/D,MAAa,OAAO,UAAmC;CAErD,IAAI,aAAa;CACjB,MAAM,WAAWA,oBAAAA,MAAM,OAAO,YAAY,KAAK,KAAK,GAAM;CAC1D,MAAM,0BAAU,IAAI,IAAsB;CAC1C,IAAI,QAAQ;CAEZ,OAAO;EACL,MAAM;EAEN,eAAe,QAAQ;GACrB,QAAQ,CAAC,OAAO;GAChB,IAAI,CAAC,OAAO;GAEZ,QAAQ,MAAM;GACd,MAAM,WAAW,OAAO,SAAS,CAAC;GAElC,OAAO,QAAQ,QAAQ,CAAC,CAAC,SAAS,CAAC,SAAS,gBAAgB;IAC1D,MAAM,YAAA,GAAWC,KAAAA,WAAAA,CAAW,OAAO,IAC/B,WAAA,GACAC,KAAAA,QAAAA,CAAQ,OAAO,MAAM,OAAO;IAEhC,MAAM,aAAa,cAAc,QAAQ;IACzC,MAAM,UAAUC,oBAAAA,QAAQ,UAAU;IAClC,QAAQ,IAAI,YAAY,OAAO;GACjC,CAAC;EACH;EAEA,gBAAgB,QAAQ;GACtB,IAAI,CAAC,OAAO;GAEZ,OAAO,QAAQ,IAAI,MAAM,KAAK,QAAQ,KAAK,CAAC,CAAC;EAC/C;EAEA,gBAAgB,KAAK;GACnB,IAAI,CAAC,OAAO;GAGZ,IAAI,YAAY,OAAO,IAAI;GAC3B,MAAM,iBAAiB,cAAc,IAAI,IAAI;GAG7C,MAAM,kCAAkB,IAAI,IAAY;GACxC,KAAK,MAAM,CAAC,aAAa,YAAY,QAAQ,QAAQ,GACnD,IAAI,eAAe,SAAS,WAAW,GACrC,QAAQ,SAAQ,MAAK,gBAAgB,IAAI,CAAC,CAAC;GAI/C,IAAI,gBAAgB,OAAO,GAAG;IAC5B,QAAQ,IAAI,+BAA+B,IAAI,KAAK,oBAAoB;IAExE,IAAI;KAEF,aAAa;KAGb,IAAI,OAAO,YAAY,cAAc;KACrC,gBAAgB,SAAQ,YAAA,GAAUC,cAAAA,SAAAA,CAAS,QAAQ,EAAE,OAAO,UAAU,CAAC,CAAC;KACxE,IAAI,OAAO,GAAG,KAAK,EAAE,MAAM,cAAc,CAAC;IAC5C,SAAS,OAAO;KACd,QAAQ,MAAM,0CAA0C,KAAK;IAC/D,UAAU;KAGR,iBAAiB;MACf,aAAa;MACb,QAAQ,IAAI,kDAAkD;KAChE,GAAG,QAAQ;IACb;GACF;GAEA,OAAO,IAAI;EACb;CACF;AACF"}
|
package/lib/plugins/hmr.d.ts
CHANGED
package/lib/plugins/hmr.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { clamp } from "../utils/clamp.js";
|
|
2
1
|
import { toArray } from "../utils/array.js";
|
|
2
|
+
import { clamp } from "../utils/clamp.js";
|
|
3
3
|
import { isAbsolute, resolve } from "path";
|
|
4
4
|
import { execSync } from "child_process";
|
|
5
|
-
|
|
5
|
+
// src/plugins/hmr.ts
|
|
6
6
|
/**
|
|
7
7
|
* Normalizes backslashes in a file path to forward slashes.
|
|
8
8
|
*
|
|
@@ -68,7 +68,6 @@ const hmr = (props) => {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
|
-
//#endregion
|
|
72
71
|
export { hmr };
|
|
73
72
|
|
|
74
73
|
//# sourceMappingURL=hmr.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/plugins/suppressWarnings.ts
|
|
3
3
|
/**
|
|
4
4
|
* Vite plugin to filter out noisy terminal stdout/stderr warnings emitted
|
|
5
5
|
* by Nitro, SSR workers, or third-party dependencies during dev.
|
|
@@ -31,7 +31,6 @@ function suppressWarnings(...patterns) {
|
|
|
31
31
|
apply: "serve"
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
exports.suppressWarnings = suppressWarnings;
|
|
36
35
|
|
|
37
36
|
//# sourceMappingURL=suppressWarnings.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/plugins/suppressWarnings.ts
|
|
2
2
|
/**
|
|
3
3
|
* Vite plugin to filter out noisy terminal stdout/stderr warnings emitted
|
|
4
4
|
* by Nitro, SSR workers, or third-party dependencies during dev.
|
|
@@ -30,7 +30,6 @@ function suppressWarnings(...patterns) {
|
|
|
30
30
|
apply: "serve"
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
export { suppressWarnings };
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=suppressWarnings.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_array = require("../utils/array.cjs");
|
|
3
3
|
const require_rolldown_config_constants = require("./constants.cjs");
|
|
4
|
-
const require_rolldown_config_output = require("./output.cjs");
|
|
5
4
|
const require_rolldown_config_input = require("./input.cjs");
|
|
5
|
+
const require_rolldown_config_output = require("./output.cjs");
|
|
6
6
|
const require_rolldown_config_plugins_index = require("./plugins/index.cjs");
|
|
7
7
|
let rolldown = require("rolldown");
|
|
8
8
|
let rolldown_plugins = require("rolldown/plugins");
|
|
9
|
-
|
|
9
|
+
// src/rolldown-config/config.ts
|
|
10
10
|
/**
|
|
11
11
|
* Generates Rolldown configuration using default or customized options.
|
|
12
12
|
*
|
|
@@ -29,7 +29,7 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
29
29
|
}),
|
|
30
30
|
circulars: () => require_rolldown_config_plugins_index.PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),
|
|
31
31
|
externals: () => require_rolldown_config_plugins_index.PLUGIN_BUILDERS.externals({
|
|
32
|
-
optDeps:
|
|
32
|
+
optDeps: true,
|
|
33
33
|
builtinsPrefix: "strip",
|
|
34
34
|
include: excludesTS
|
|
35
35
|
}),
|
|
@@ -103,7 +103,6 @@ defineConfig.bemedev = (additionals) => {
|
|
|
103
103
|
sourcemap
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
-
//#endregion
|
|
107
106
|
exports.defineConfig = defineConfig;
|
|
108
107
|
|
|
109
108
|
//# sourceMappingURL=config.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs","names":["buildInput","toArray","DEFAULT_EXCLUDE","PLUGIN_BUILDERS","esmExternalRequirePlugin","buildOutput","_defineConfig","DEFAULT_CIRCULAR_DEPS"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\n/**\n * Generates Rolldown configuration using default or customized options.\n *\n * @param additionals - Optional build configuration parameters of type {@linkcode Params}.\n *\n * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.\n */\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({ include, exclude, declarationMap, dir }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n //
|
|
1
|
+
{"version":3,"file":"config.cjs","names":["buildInput","toArray","DEFAULT_EXCLUDE","PLUGIN_BUILDERS","esmExternalRequirePlugin","buildOutput","_defineConfig","DEFAULT_CIRCULAR_DEPS"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\n/**\n * Generates Rolldown configuration using default or customized options.\n *\n * @param additionals - Optional build configuration parameters of type {@linkcode Params}.\n *\n * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.\n */\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({ include, exclude, declarationMap, dir }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // Externalize dependencies, peer dependencies and optional dependencies\n optDeps: true,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n fast: () => {\n return PLUGIN_BUILDERS.fast({ include, exclude, declarationMap, dir });\n },\n esm: esmExternalRequirePlugin,\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n unordered.esm(),\n unordered.typescript(),\n unordered.clean(),\n ];\n\n return plugins\n ? plugins\n .map(p => {\n if (typeof p === 'string') return unordered[p]();\n return p;\n })\n .filter(p => !!p)\n : defaultOrdered();\n};\n\ndefineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {\n const input = buildInput();\n const external = rest.externals;\n const output = buildOutput(dir, sourcemap);\n\n const plugins = producePlugins({ dir, sourcemap, ...rest });\n\n return _defineConfig({ input, plugins, external, output, platform: 'node' });\n};\n\ndefineConfig.fast = rest => {\n return defineConfig.default({\n ...rest,\n plugins: ['circulars', 'externals', 'esm', 'fast', 'clean'],\n });\n};\n\ndefineConfig.bemedev = additionals => {\n // #region constants\n const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(\n toArray(additionals?.circularDeps),\n );\n const ignoresJS = toArray(additionals?.ignoresJS).concat(DEFAULT_CIRCULAR_DEPS);\n\n const excludesTS = DEFAULT_EXCLUDE.concat(toArray(additionals?.excludesTS));\n const _sourcemap = additionals?.sourcemap;\n const sourcemap = _sourcemap === undefined || _sourcemap === true;\n // #endregion\n\n return defineConfig.default({\n ...additionals,\n circularDeps,\n excludesTS,\n ignoresJS,\n sourcemap,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAa,gBAAyB,gBAAe;CACnD,OAAO,aAAa,QAAQ,WAAW;AACzC;AAEA,MAAM,kBAAkB,EACtB,cACA,WACA,KACA,YAAY,OACZ,YACA,gBACA,YACU,CAAC,MAAM;CACjB,MAAM,UAAUA,8BAAAA,WAAW,GAAGC,oBAAAA,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAUC,kCAAAA,gBAAgB,OAAOD,oBAAAA,QAAQ,UAAU,CAAC;CAC1D,MAAM,YAAY;EAChB,kBACEE,sCAAAA,gBAAgB,WAAW;GAAE;GAAS;GAAS;GAAgB;EAAI,CAAC;EACtE,iBAAiBA,sCAAAA,gBAAgB,UAAU,EAAE,SAAS,aAAa,CAAC;EACpE,iBACEA,sCAAAA,gBAAgB,UAAU;GAExB,SAAS;GACT,gBAAgB;GAChB,SAAS;EACX,CAAC;EACH,aAAaA,sCAAAA,gBAAgB,MAAM;GAAE;GAAW;GAAW;EAAI,CAAC;EAChE,YAAY;GACV,OAAOA,sCAAAA,gBAAgB,KAAK;IAAE;IAAS;IAAS;IAAgB;GAAI,CAAC;EACvE;EACA,KAAKC,iBAAAA;CACP;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,UAAU,IAAI;EACd,UAAU,WAAW;EACrB,UAAU,MAAM;CAClB;CAEA,OAAO,UACH,QACG,KAAI,MAAK;EACR,IAAI,OAAO,MAAM,UAAU,OAAO,UAAU,EAAE,CAAC;EAC/C,OAAO;CACT,CAAC,CAAC,CACD,QAAO,MAAK,CAAC,CAAC,CAAC,IAClB,eAAe;AACrB;AAEA,aAAa,WAAW,EAAE,KAAK,YAAY,OAAO,GAAG,SAAS,CAAC,MAAM;CACnE,MAAM,QAAQJ,8BAAAA,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAASK,+BAAAA,YAAY,KAAK,SAAS;CAEzC,MAAM,UAAU,eAAe;EAAE;EAAK;EAAW,GAAG;CAAK,CAAC;CAE1D,QAAA,GAAOC,SAAAA,aAAAA,CAAc;EAAE;EAAO;EAAS;EAAU;EAAQ,UAAU;CAAO,CAAC;AAC7E;AAEA,aAAa,QAAO,SAAQ;CAC1B,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH,SAAS;GAAC;GAAa;GAAa;GAAO;GAAQ;EAAO;CAC5D,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAeC,kCAAAA,sBAAsB,OACzCN,oBAAAA,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAYA,oBAAAA,QAAQ,aAAa,SAAS,CAAC,CAAC,OAAOM,kCAAAA,qBAAqB;CAE9E,MAAM,aAAaL,kCAAAA,gBAAgB,OAAOD,oBAAAA,QAAQ,aAAa,UAAU,CAAC;CAC1E,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { toArray } from "../utils/array.js";
|
|
2
2
|
import { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from "./constants.js";
|
|
3
|
-
import { buildOutput } from "./output.js";
|
|
4
3
|
import { buildInput } from "./input.js";
|
|
4
|
+
import { buildOutput } from "./output.js";
|
|
5
5
|
import { PLUGIN_BUILDERS } from "./plugins/index.js";
|
|
6
6
|
import { defineConfig as defineConfig$1 } from "rolldown";
|
|
7
7
|
import { esmExternalRequirePlugin } from "rolldown/plugins";
|
|
8
|
-
|
|
8
|
+
// src/rolldown-config/config.ts
|
|
9
9
|
/**
|
|
10
10
|
* Generates Rolldown configuration using default or customized options.
|
|
11
11
|
*
|
|
@@ -28,7 +28,7 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
28
28
|
}),
|
|
29
29
|
circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),
|
|
30
30
|
externals: () => PLUGIN_BUILDERS.externals({
|
|
31
|
-
optDeps:
|
|
31
|
+
optDeps: true,
|
|
32
32
|
builtinsPrefix: "strip",
|
|
33
33
|
include: excludesTS
|
|
34
34
|
}),
|
|
@@ -102,7 +102,6 @@ defineConfig.bemedev = (additionals) => {
|
|
|
102
102
|
sourcemap
|
|
103
103
|
});
|
|
104
104
|
};
|
|
105
|
-
//#endregion
|
|
106
105
|
export { defineConfig };
|
|
107
106
|
|
|
108
107
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["_defineConfig"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\n/**\n * Generates Rolldown configuration using default or customized options.\n *\n * @param additionals - Optional build configuration parameters of type {@linkcode Params}.\n *\n * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.\n */\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({ include, exclude, declarationMap, dir }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n //
|
|
1
|
+
{"version":3,"file":"config.js","names":["_defineConfig"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\n/**\n * Generates Rolldown configuration using default or customized options.\n *\n * @param additionals - Optional build configuration parameters of type {@linkcode Params}.\n *\n * @returns Configured Rolldown options of type {@linkcode RolldownOptions}.\n */\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({ include, exclude, declarationMap, dir }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // Externalize dependencies, peer dependencies and optional dependencies\n optDeps: true,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n fast: () => {\n return PLUGIN_BUILDERS.fast({ include, exclude, declarationMap, dir });\n },\n esm: esmExternalRequirePlugin,\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n unordered.esm(),\n unordered.typescript(),\n unordered.clean(),\n ];\n\n return plugins\n ? plugins\n .map(p => {\n if (typeof p === 'string') return unordered[p]();\n return p;\n })\n .filter(p => !!p)\n : defaultOrdered();\n};\n\ndefineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {\n const input = buildInput();\n const external = rest.externals;\n const output = buildOutput(dir, sourcemap);\n\n const plugins = producePlugins({ dir, sourcemap, ...rest });\n\n return _defineConfig({ input, plugins, external, output, platform: 'node' });\n};\n\ndefineConfig.fast = rest => {\n return defineConfig.default({\n ...rest,\n plugins: ['circulars', 'externals', 'esm', 'fast', 'clean'],\n });\n};\n\ndefineConfig.bemedev = additionals => {\n // #region constants\n const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(\n toArray(additionals?.circularDeps),\n );\n const ignoresJS = toArray(additionals?.ignoresJS).concat(DEFAULT_CIRCULAR_DEPS);\n\n const excludesTS = DEFAULT_EXCLUDE.concat(toArray(additionals?.excludesTS));\n const _sourcemap = additionals?.sourcemap;\n const sourcemap = _sourcemap === undefined || _sourcemap === true;\n // #endregion\n\n return defineConfig.default({\n ...additionals,\n circularDeps,\n excludesTS,\n ignoresJS,\n sourcemap,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAa,gBAAyB,gBAAe;CACnD,OAAO,aAAa,QAAQ,WAAW;AACzC;AAEA,MAAM,kBAAkB,EACtB,cACA,WACA,KACA,YAAY,OACZ,YACA,gBACA,YACU,CAAC,MAAM;CACjB,MAAM,UAAU,WAAW,GAAG,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAU,gBAAgB,OAAO,QAAQ,UAAU,CAAC;CAC1D,MAAM,YAAY;EAChB,kBACE,gBAAgB,WAAW;GAAE;GAAS;GAAS;GAAgB;EAAI,CAAC;EACtE,iBAAiB,gBAAgB,UAAU,EAAE,SAAS,aAAa,CAAC;EACpE,iBACE,gBAAgB,UAAU;GAExB,SAAS;GACT,gBAAgB;GAChB,SAAS;EACX,CAAC;EACH,aAAa,gBAAgB,MAAM;GAAE;GAAW;GAAW;EAAI,CAAC;EAChE,YAAY;GACV,OAAO,gBAAgB,KAAK;IAAE;IAAS;IAAS;IAAgB;GAAI,CAAC;EACvE;EACA,KAAK;CACP;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,UAAU,IAAI;EACd,UAAU,WAAW;EACrB,UAAU,MAAM;CAClB;CAEA,OAAO,UACH,QACG,KAAI,MAAK;EACR,IAAI,OAAO,MAAM,UAAU,OAAO,UAAU,EAAE,CAAC;EAC/C,OAAO;CACT,CAAC,CAAC,CACD,QAAO,MAAK,CAAC,CAAC,CAAC,IAClB,eAAe;AACrB;AAEA,aAAa,WAAW,EAAE,KAAK,YAAY,OAAO,GAAG,SAAS,CAAC,MAAM;CACnE,MAAM,QAAQ,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAAS,YAAY,KAAK,SAAS;CAEzC,MAAM,UAAU,eAAe;EAAE;EAAK;EAAW,GAAG;CAAK,CAAC;CAE1D,OAAOA,eAAc;EAAE;EAAO;EAAS;EAAU;EAAQ,UAAU;CAAO,CAAC;AAC7E;AAEA,aAAa,QAAO,SAAQ;CAC1B,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH,SAAS;GAAC;GAAa;GAAa;GAAO;GAAQ;EAAO;CAC5D,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAe,sBAAsB,OACzC,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAY,QAAQ,aAAa,SAAS,CAAC,CAAC,OAAO,qBAAqB;CAE9E,MAAM,aAAa,gBAAgB,OAAO,QAAQ,aAAa,UAAU,CAAC;CAC1E,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/rolldown-config/constants.ts
|
|
3
3
|
/**
|
|
4
4
|
* Default exclude glob patterns for bundling and type generation.
|
|
5
5
|
*/
|
|
@@ -36,7 +36,6 @@ const WARNING_CODES = {
|
|
|
36
36
|
EMPTY_BUNDLE: "EMPTY_BUNDLE",
|
|
37
37
|
CIRCULAR_DEPENDENCY: "CIRCULAR_DEPENDENCY"
|
|
38
38
|
};
|
|
39
|
-
//#endregion
|
|
40
39
|
exports.DEFAULT_CIRCULAR_DEPS = DEFAULT_CIRCULAR_DEPS;
|
|
41
40
|
exports.DEFAULT_DIR = DEFAULT_DIR;
|
|
42
41
|
exports.DEFAULT_EXCLUDE = DEFAULT_EXCLUDE;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/rolldown-config/constants.ts
|
|
2
2
|
/**
|
|
3
3
|
* Default exclude glob patterns for bundling and type generation.
|
|
4
4
|
*/
|
|
@@ -35,7 +35,6 @@ const WARNING_CODES = {
|
|
|
35
35
|
EMPTY_BUNDLE: "EMPTY_BUNDLE",
|
|
36
36
|
CIRCULAR_DEPENDENCY: "CIRCULAR_DEPENDENCY"
|
|
37
37
|
};
|
|
38
|
-
//#endregion
|
|
39
38
|
export { DEFAULT_CIRCULAR_DEPS, DEFAULT_DIR, DEFAULT_EXCLUDE, IGNORE, WARNING_CODES };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let fs = require("fs");
|
|
3
3
|
let path = require("path");
|
|
4
|
-
|
|
4
|
+
// src/rolldown-config/helpers.ts
|
|
5
5
|
/**
|
|
6
6
|
* Strips the extension from a file path.
|
|
7
7
|
*
|
|
@@ -44,7 +44,6 @@ const cleanupJS = (files, dir, sourcemap) => {
|
|
|
44
44
|
console.log("***********");
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
//#endregion
|
|
48
47
|
exports.cleanupJS = cleanupJS;
|
|
49
48
|
exports.withoutExtension = withoutExtension;
|
|
50
49
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { rmSync } from "fs";
|
|
2
2
|
import { extname, relative, resolve } from "path";
|
|
3
|
-
|
|
3
|
+
// src/rolldown-config/helpers.ts
|
|
4
4
|
/**
|
|
5
5
|
* Strips the extension from a file path.
|
|
6
6
|
*
|
|
@@ -43,7 +43,6 @@ const cleanupJS = (files, dir, sourcemap) => {
|
|
|
43
43
|
console.log("***********");
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
//#endregion
|
|
47
46
|
export { cleanupJS, withoutExtension };
|
|
48
47
|
|
|
49
48
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_config_plugins_index = require("./plugins/index.cjs");
|
|
3
2
|
const require_rolldown_config_config = require("./config.cjs");
|
|
3
|
+
const require_rolldown_config_plugins_index = require("./plugins/index.cjs");
|
|
4
4
|
exports.DEFAULT_PLUGINS_ORDER = require_rolldown_config_plugins_index.DEFAULT_PLUGINS_ORDER;
|
|
5
5
|
exports.PLUGIN_BUILDERS = require_rolldown_config_plugins_index.PLUGIN_BUILDERS;
|
|
6
6
|
exports.defineConfig = require_rolldown_config_config.defineConfig;
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_rolldown_config_constants = require("./constants.cjs");
|
|
3
3
|
let path = require("path");
|
|
4
4
|
let glob = require("glob");
|
|
5
|
-
|
|
5
|
+
// src/rolldown-config/input.ts
|
|
6
6
|
/**
|
|
7
7
|
* Builds entry points record for Rolldown from all
|
|
8
8
|
* `src/[**]/*.ts]` files.
|
|
@@ -14,7 +14,6 @@ let glob = require("glob");
|
|
|
14
14
|
const buildInput = (...ignores) => Object.fromEntries((0, glob.globSync)("src/**/*.ts", { ignore: require_rolldown_config_constants.DEFAULT_EXCLUDE.concat(ignores) }).map((file) => {
|
|
15
15
|
return [(0, path.relative)("src", file.slice(0, file.length - (0, path.extname)(file).length)), `${process.cwd()}/${file}`];
|
|
16
16
|
}));
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.buildInput = buildInput;
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=input.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_EXCLUDE } from "./constants.js";
|
|
2
2
|
import { extname, relative } from "path";
|
|
3
3
|
import { globSync } from "glob";
|
|
4
|
-
|
|
4
|
+
// src/rolldown-config/input.ts
|
|
5
5
|
/**
|
|
6
6
|
* Builds entry points record for Rolldown from all
|
|
7
7
|
* `src/[**]/*.ts]` files.
|
|
@@ -13,7 +13,6 @@ import { globSync } from "glob";
|
|
|
13
13
|
const buildInput = (...ignores) => Object.fromEntries(globSync("src/**/*.ts", { ignore: DEFAULT_EXCLUDE.concat(ignores) }).map((file) => {
|
|
14
14
|
return [relative("src", file.slice(0, file.length - extname(file).length)), `${process.cwd()}/${file}`];
|
|
15
15
|
}));
|
|
16
|
-
//#endregion
|
|
17
16
|
export { buildInput };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=input.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./constants.cjs");
|
|
3
3
|
const require_rolldown_config_plugins_typescript_config = require("./plugins/typescript.config.cjs");
|
|
4
|
-
|
|
4
|
+
// src/rolldown-config/output.ts
|
|
5
5
|
/**
|
|
6
6
|
* Builds ES and CJS output configurations for Rolldown.
|
|
7
7
|
*
|
|
@@ -28,7 +28,6 @@ const buildOutput = (dir = "lib", sourcemap) => {
|
|
|
28
28
|
entryFileNames: "[name].cjs"
|
|
29
29
|
}];
|
|
30
30
|
};
|
|
31
|
-
//#endregion
|
|
32
31
|
exports.buildOutput = buildOutput;
|
|
33
32
|
|
|
34
33
|
//# sourceMappingURL=output.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./constants.js";
|
|
2
2
|
import { getConfig } from "./plugins/typescript.config.js";
|
|
3
|
-
|
|
3
|
+
// src/rolldown-config/output.ts
|
|
4
4
|
/**
|
|
5
5
|
* Builds ES and CJS output configurations for Rolldown.
|
|
6
6
|
*
|
|
@@ -27,7 +27,6 @@ const buildOutput = (dir = "lib", sourcemap) => {
|
|
|
27
27
|
entryFileNames: "[name].cjs"
|
|
28
28
|
}];
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { buildOutput };
|
|
32
31
|
|
|
33
32
|
//# sourceMappingURL=output.js.map
|
|
@@ -5,7 +5,7 @@ const require_rolldown_config_helpers = require("../helpers.cjs");
|
|
|
5
5
|
let path = require("path");
|
|
6
6
|
let glob = require("glob");
|
|
7
7
|
let rollup_plugin_circular_dependencies = require("rollup-plugin-circular-dependencies");
|
|
8
|
-
|
|
8
|
+
// src/rolldown-config/plugins/circulars.ts
|
|
9
9
|
/**
|
|
10
10
|
* Creates a configured circular dependencies plugin instance with suppression for known patterns.
|
|
11
11
|
*
|
|
@@ -32,7 +32,6 @@ function circulars(options = {}) {
|
|
|
32
32
|
} }
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
exports.circulars = circulars;
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=circulars.cjs.map
|
|
@@ -4,7 +4,7 @@ import { withoutExtension } from "../helpers.js";
|
|
|
4
4
|
import { relative } from "path";
|
|
5
5
|
import { globSync } from "glob";
|
|
6
6
|
import { circularDependencies } from "rollup-plugin-circular-dependencies";
|
|
7
|
-
|
|
7
|
+
// src/rolldown-config/plugins/circulars.ts
|
|
8
8
|
/**
|
|
9
9
|
* Creates a configured circular dependencies plugin instance with suppression for known patterns.
|
|
10
10
|
*
|
|
@@ -31,7 +31,6 @@ function circulars(options = {}) {
|
|
|
31
31
|
} }
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { circulars };
|
|
36
35
|
|
|
37
36
|
//# sourceMappingURL=circulars.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_array = require("../../utils/array.cjs");
|
|
3
3
|
const require_rolldown_config_constants = require("../constants.cjs");
|
|
4
|
-
const require_rolldown_config_plugins_typescript_config = require("./typescript.config.cjs");
|
|
5
4
|
const require_rolldown_config_helpers = require("../helpers.cjs");
|
|
5
|
+
const require_rolldown_config_plugins_typescript_config = require("./typescript.config.cjs");
|
|
6
6
|
let fs = require("fs");
|
|
7
7
|
let path = require("path");
|
|
8
8
|
let glob = require("glob");
|
|
9
9
|
let _typescript_typescript6 = require("@typescript/typescript6");
|
|
10
|
-
|
|
10
|
+
// src/rolldown-config/plugins/clean.ts
|
|
11
11
|
/**
|
|
12
12
|
* Plugin to clean up intermediate JavaScript and sourcemap files for type-only entries.
|
|
13
13
|
*
|
|
@@ -51,7 +51,6 @@ const clean = (options) => {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
//#endregion
|
|
55
54
|
exports.clean = clean;
|
|
56
55
|
|
|
57
56
|
//# sourceMappingURL=clean.cjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { toArray } from "../../utils/array.js";
|
|
2
2
|
import { WARNING_CODES } from "../constants.js";
|
|
3
|
-
import { readTsConfig } from "./typescript.config.js";
|
|
4
3
|
import { cleanupJS, withoutExtension } from "../helpers.js";
|
|
4
|
+
import { readTsConfig } from "./typescript.config.js";
|
|
5
5
|
import { existsSync } from "fs";
|
|
6
6
|
import { relative } from "path";
|
|
7
7
|
import { globSync } from "glob";
|
|
8
8
|
import { findConfigFile } from "@typescript/typescript6";
|
|
9
|
-
|
|
9
|
+
// src/rolldown-config/plugins/clean.ts
|
|
10
10
|
/**
|
|
11
11
|
* Plugin to clean up intermediate JavaScript and sourcemap files for type-only entries.
|
|
12
12
|
*
|
|
@@ -50,7 +50,6 @@ const clean = (options) => {
|
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
//#endregion
|
|
54
53
|
export { clean };
|
|
55
54
|
|
|
56
55
|
//# sourceMappingURL=clean.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let rollup_plugin_node_externals = require("rollup-plugin-node-externals");
|
|
3
|
-
|
|
3
|
+
// src/rolldown-config/plugins/externals.ts
|
|
4
4
|
/**
|
|
5
5
|
* Creates a configured node externals plugin instance for Rolldown.
|
|
6
6
|
*
|
|
@@ -11,7 +11,6 @@ let rollup_plugin_node_externals = require("rollup-plugin-node-externals");
|
|
|
11
11
|
function externals(options = {}) {
|
|
12
12
|
return (0, rollup_plugin_node_externals.nodeExternals)(options);
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
exports.externals = externals;
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=externals.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nodeExternals } from "rollup-plugin-node-externals";
|
|
2
|
-
|
|
2
|
+
// src/rolldown-config/plugins/externals.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates a configured node externals plugin instance for Rolldown.
|
|
5
5
|
*
|
|
@@ -10,7 +10,6 @@ import { nodeExternals } from "rollup-plugin-node-externals";
|
|
|
10
10
|
function externals(options = {}) {
|
|
11
11
|
return nodeExternals(options);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { externals };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=externals.js.map
|
|
@@ -5,7 +5,7 @@ const require_rolldown_config_plugins_externals = require("./externals.cjs");
|
|
|
5
5
|
const require_rolldown_config_plugins_typescript = require("./typescript.cjs");
|
|
6
6
|
const require_rolldown_config_plugins_typescript_fast = require("./typescript.fast.cjs");
|
|
7
7
|
let rolldown_plugins = require("rolldown/plugins");
|
|
8
|
-
|
|
8
|
+
// src/rolldown-config/plugins/index.ts
|
|
9
9
|
/**
|
|
10
10
|
* Registry mapping plugin keys to their factory functions.
|
|
11
11
|
*/
|
|
@@ -21,7 +21,6 @@ const PLUGIN_BUILDERS = {
|
|
|
21
21
|
* Default ordering sequence for Rolldown build plugins.
|
|
22
22
|
*/
|
|
23
23
|
const DEFAULT_PLUGINS_ORDER = Object.keys(PLUGIN_BUILDERS);
|
|
24
|
-
//#endregion
|
|
25
24
|
exports.DEFAULT_PLUGINS_ORDER = DEFAULT_PLUGINS_ORDER;
|
|
26
25
|
exports.PLUGIN_BUILDERS = PLUGIN_BUILDERS;
|
|
27
26
|
|
|
@@ -4,7 +4,7 @@ import { externals } from "./externals.js";
|
|
|
4
4
|
import { typescript } from "./typescript.js";
|
|
5
5
|
import { typescriptFast } from "./typescript.fast.js";
|
|
6
6
|
import { esmExternalRequirePlugin } from "rolldown/plugins";
|
|
7
|
-
|
|
7
|
+
// src/rolldown-config/plugins/index.ts
|
|
8
8
|
/**
|
|
9
9
|
* Registry mapping plugin keys to their factory functions.
|
|
10
10
|
*/
|
|
@@ -20,7 +20,6 @@ const PLUGIN_BUILDERS = {
|
|
|
20
20
|
* Default ordering sequence for Rolldown build plugins.
|
|
21
21
|
*/
|
|
22
22
|
const DEFAULT_PLUGINS_ORDER = Object.keys(PLUGIN_BUILDERS);
|
|
23
|
-
//#endregion
|
|
24
23
|
export { DEFAULT_PLUGINS_ORDER, PLUGIN_BUILDERS };
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=index.js.map
|