@bemedev/dev-utils 0.8.3 → 1.0.1
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 +8 -19
- package/lib/build-tests/addTarball.cjs.map +1 -1
- package/lib/build-tests/addTarball.d.ts +1 -1
- package/lib/build-tests/addTarball.js.map +1 -1
- package/lib/build-tests/buildPackageJson.cjs.map +1 -1
- package/lib/build-tests/buildPackageJson.d.ts +3 -3
- package/lib/build-tests/buildPackageJson.js.map +1 -1
- package/lib/build-tests/cleanup.cjs.map +1 -1
- package/lib/build-tests/cleanup.d.ts +1 -1
- package/lib/build-tests/cleanup.js.map +1 -1
- package/lib/build-tests/cli/cli.cjs +0 -1
- package/lib/build-tests/cli/cli.cjs.map +1 -1
- package/lib/build-tests/cli/cli.d.ts +1 -51
- package/lib/build-tests/cli/cli.js.map +1 -1
- package/lib/build-tests/cli/index.cjs +0 -1
- package/lib/build-tests/cli/index.cjs.map +1 -1
- package/lib/build-tests/cli/index.d.ts +0 -1
- package/lib/build-tests/cli/index.js.map +1 -1
- package/lib/build-tests/cli/post.cjs +0 -1
- package/lib/build-tests/cli/post.cjs.map +1 -1
- package/lib/build-tests/cli/post.d.ts +1 -5
- package/lib/build-tests/cli/post.js.map +1 -1
- package/lib/build-tests/cli/pre.cjs +0 -1
- package/lib/build-tests/cli/pre.cjs.map +1 -1
- package/lib/build-tests/cli/pre.d.ts +1 -5
- package/lib/build-tests/cli/pre.js.map +1 -1
- package/lib/build-tests/cli/test.cjs.map +1 -1
- package/lib/build-tests/cli/test.d.ts +1 -15
- package/lib/build-tests/cli/test.js.map +1 -1
- package/lib/build-tests/constants.cjs.map +1 -1
- package/lib/build-tests/constants.d.ts +1 -1
- package/lib/build-tests/constants.js.map +1 -1
- package/lib/build-tests/getRelativePath.cjs +0 -1
- package/lib/build-tests/getRelativePath.cjs.map +1 -1
- package/lib/build-tests/getRelativePath.d.ts +1 -1
- package/lib/build-tests/getRelativePath.js.map +1 -1
- package/lib/build-tests/getTypescriptOutdir.cjs.map +1 -1
- package/lib/build-tests/getTypescriptOutdir.d.ts +1 -1
- package/lib/build-tests/getTypescriptOutdir.js.map +1 -1
- package/lib/build-tests/import.cjs.map +1 -1
- package/lib/build-tests/import.d.ts +2 -2
- package/lib/build-tests/import.js.map +1 -1
- package/lib/build-tests/imports/create.cjs +0 -1
- package/lib/build-tests/imports/create.cjs.map +1 -1
- package/lib/build-tests/imports/create.d.ts +3 -3
- package/lib/build-tests/imports/create.js.map +1 -1
- package/lib/build-tests/imports/helper.cjs +0 -1
- package/lib/build-tests/imports/helper.cjs.map +1 -1
- package/lib/build-tests/imports/helper.d.ts +3 -7
- package/lib/build-tests/imports/helper.js.map +1 -1
- package/lib/build-tests/imports/index.d.ts +1 -1
- package/lib/build-tests/index.d.ts +5 -5
- package/lib/build-tests/pack.cjs.map +1 -1
- package/lib/build-tests/pack.d.ts +1 -1
- package/lib/build-tests/pack.js.map +1 -1
- package/lib/rolldown-config/config.cjs +6 -11
- package/lib/rolldown-config/config.cjs.map +1 -1
- package/lib/rolldown-config/config.d.ts +1 -1
- package/lib/rolldown-config/config.js +1 -5
- package/lib/rolldown-config/config.js.map +1 -1
- package/lib/rolldown-config/constants.cjs.map +1 -1
- package/lib/rolldown-config/constants.d.ts +5 -5
- package/lib/rolldown-config/constants.js.map +1 -1
- package/lib/rolldown-config/helpers.cjs +0 -1
- package/lib/rolldown-config/helpers.cjs.map +1 -1
- package/lib/rolldown-config/helpers.d.ts +2 -2
- package/lib/rolldown-config/helpers.js.map +1 -1
- package/lib/rolldown-config/index.d.ts +3 -3
- package/lib/rolldown-config/input.cjs +1 -2
- package/lib/rolldown-config/input.cjs.map +1 -1
- package/lib/rolldown-config/input.d.ts +1 -1
- package/lib/rolldown-config/input.js +1 -1
- package/lib/rolldown-config/input.js.map +1 -1
- package/lib/rolldown-config/output.cjs.map +1 -1
- package/lib/rolldown-config/output.d.ts +1 -15
- package/lib/rolldown-config/output.js.map +1 -1
- package/lib/rolldown-config/plugins/circulars.cjs +6 -5
- package/lib/rolldown-config/plugins/circulars.cjs.map +1 -1
- package/lib/rolldown-config/plugins/circulars.d.ts +9 -7
- package/lib/rolldown-config/plugins/circulars.js +5 -3
- package/lib/rolldown-config/plugins/circulars.js.map +1 -1
- package/lib/rolldown-config/plugins/clean.cjs +4 -9
- package/lib/rolldown-config/plugins/clean.cjs.map +1 -1
- package/lib/rolldown-config/plugins/clean.d.ts +4 -13
- package/lib/rolldown-config/plugins/clean.js +4 -7
- package/lib/rolldown-config/plugins/clean.js.map +1 -1
- package/lib/rolldown-config/plugins/externals.cjs +1 -1
- package/lib/rolldown-config/plugins/externals.cjs.map +1 -1
- package/lib/rolldown-config/plugins/externals.d.ts +7 -6
- package/lib/rolldown-config/plugins/externals.js +1 -0
- package/lib/rolldown-config/plugins/externals.js.map +1 -1
- package/lib/rolldown-config/plugins/index.cjs +1 -8
- package/lib/rolldown-config/plugins/index.cjs.map +1 -1
- package/lib/rolldown-config/plugins/index.d.ts +2 -27
- package/lib/rolldown-config/plugins/index.js +0 -6
- package/lib/rolldown-config/plugins/index.js.map +1 -1
- package/lib/rolldown-config/plugins/typescript.cjs +45 -33
- package/lib/rolldown-config/plugins/typescript.cjs.map +1 -1
- package/lib/rolldown-config/plugins/typescript.config.cjs +39 -46
- package/lib/rolldown-config/plugins/typescript.config.cjs.map +1 -1
- package/lib/rolldown-config/plugins/typescript.config.d.ts +4 -2
- package/lib/rolldown-config/plugins/typescript.config.js +41 -47
- package/lib/rolldown-config/plugins/typescript.config.js.map +1 -1
- package/lib/rolldown-config/plugins/typescript.d.ts +6 -6
- package/lib/rolldown-config/plugins/typescript.js +44 -30
- package/lib/rolldown-config/plugins/typescript.js.map +1 -1
- package/lib/rolldown-config/types.d.ts +13 -13
- package/lib/{rolldown-config/utils.cjs → utils/array.cjs} +2 -2
- package/lib/utils/array.cjs.map +1 -0
- package/lib/utils/array.d.ts +2 -0
- package/lib/{rolldown-config/utils.js → utils/array.js} +2 -2
- package/lib/utils/array.js.map +1 -0
- package/lib/utils/identity.d.ts +1 -1
- package/lib/utils/index.cjs +2 -0
- package/lib/utils/index.d.ts +4 -3
- package/lib/utils/index.js +2 -1
- package/lib/utils/sleep.cjs.map +1 -1
- package/lib/utils/sleep.d.ts +1 -1
- package/lib/utils/sleep.js.map +1 -1
- package/lib/utils/types.d.ts +5 -1
- package/lib/vitest-exclude/index.d.ts +1 -1
- package/lib/vitest-exclude/types.d.ts +8 -11
- package/lib/vitest-exclude/vitest.cjs +6 -9
- package/lib/vitest-exclude/vitest.cjs.map +1 -1
- package/lib/vitest-exclude/vitest.d.ts +15 -30
- package/lib/vitest-exclude/vitest.js +6 -9
- package/lib/vitest-exclude/vitest.js.map +1 -1
- package/lib/vitest-exclude/vitest.utils.cjs +1 -2
- package/lib/vitest-exclude/vitest.utils.cjs.map +1 -1
- package/lib/vitest-exclude/vitest.utils.d.ts +2 -2
- package/lib/vitest-exclude/vitest.utils.js +1 -1
- package/lib/vitest-exclude/vitest.utils.js.map +1 -1
- package/lib/vitest-extended/acceptation.cjs +1 -5
- package/lib/vitest-extended/acceptation.cjs.map +1 -1
- package/lib/vitest-extended/acceptation.d.ts +3 -7
- package/lib/vitest-extended/acceptation.js +1 -4
- package/lib/vitest-extended/acceptation.js.map +1 -1
- package/lib/vitest-extended/bemedev/globals/types.d.ts +4 -1
- package/lib/vitest-extended/bemedev/globals/utils/_unknown.cjs +4 -3
- package/lib/vitest-extended/bemedev/globals/utils/_unknown.cjs.map +1 -1
- package/lib/vitest-extended/bemedev/globals/utils/_unknown.d.ts +10 -9
- package/lib/vitest-extended/bemedev/globals/utils/_unknown.js +4 -3
- package/lib/vitest-extended/bemedev/globals/utils/_unknown.js.map +1 -1
- package/lib/vitest-extended/createTests.cjs +22 -24
- package/lib/vitest-extended/createTests.cjs.map +1 -1
- package/lib/vitest-extended/createTests.d.ts +34 -56
- package/lib/vitest-extended/createTests.js +22 -23
- package/lib/vitest-extended/createTests.js.map +1 -1
- package/lib/vitest-extended/createTests.types.d.ts +10 -6
- package/lib/vitest-extended/done.cjs +6 -4
- package/lib/vitest-extended/done.cjs.map +1 -1
- package/lib/vitest-extended/done.d.ts +8 -13
- package/lib/vitest-extended/done.js +6 -3
- package/lib/vitest-extended/done.js.map +1 -1
- package/lib/vitest-extended/each/error.cjs +0 -1
- package/lib/vitest-extended/each/error.cjs.map +1 -1
- package/lib/vitest-extended/each/error.d.ts +1 -1
- package/lib/vitest-extended/each/error.js.map +1 -1
- package/lib/vitest-extended/each/error.types.d.ts +10 -4
- package/lib/vitest-extended/each/index.d.ts +2 -2
- package/lib/vitest-extended/each/pass.cjs +13 -16
- package/lib/vitest-extended/each/pass.cjs.map +1 -1
- package/lib/vitest-extended/each/pass.d.ts +26 -28
- package/lib/vitest-extended/each/pass.js +13 -15
- package/lib/vitest-extended/each/pass.js.map +1 -1
- package/lib/vitest-extended/each/pass.types.d.ts +18 -6
- package/lib/vitest-extended/fakeWaiter.cjs.map +1 -1
- package/lib/vitest-extended/fakeWaiter.d.ts +3 -3
- package/lib/vitest-extended/fakeWaiter.js.map +1 -1
- package/lib/vitest-extended/fixtures/coverage.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/coverage.js.map +1 -1
- package/lib/vitest-extended/fixtures/partialCall.cjs +2 -2
- package/lib/vitest-extended/fixtures/partialCall.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/partialCall.js +2 -2
- package/lib/vitest-extended/fixtures/partialCall.js.map +1 -1
- package/lib/vitest-extended/fixtures/toUpper.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/toUpper.js.map +1 -1
- package/lib/vitest-extended/fixtures/zod.cjs.map +1 -1
- package/lib/vitest-extended/fixtures/zod.js.map +1 -1
- package/lib/vitest-extended/identity.cjs +0 -1
- package/lib/vitest-extended/identity.cjs.map +1 -1
- package/lib/vitest-extended/identity.d.ts +2 -2
- package/lib/vitest-extended/identity.js.map +1 -1
- package/lib/vitest-extended/index.d.ts +6 -6
- package/lib/vitest-extended/isDefined.cjs.map +1 -1
- package/lib/vitest-extended/isDefined.d.ts +1 -1
- package/lib/vitest-extended/isDefined.js.map +1 -1
- package/lib/vitest-extended/isFunction.cjs.map +1 -1
- package/lib/vitest-extended/isFunction.d.ts +1 -1
- package/lib/vitest-extended/isFunction.js.map +1 -1
- package/lib/vitest-extended/toArray.cjs.map +1 -1
- package/lib/vitest-extended/toArray.d.ts +1 -1
- package/lib/vitest-extended/toArray.js.map +1 -1
- package/lib/vitest-extended/toStringFlat.cjs.map +1 -1
- package/lib/vitest-extended/toStringFlat.d.ts +1 -1
- package/lib/vitest-extended/toStringFlat.js.map +1 -1
- package/lib/vitest-extended/types.d.ts +40 -42
- package/package.json +14 -10
- package/lib/rolldown-config/plugins/alias.cjs +0 -17
- package/lib/rolldown-config/plugins/alias.cjs.map +0 -1
- package/lib/rolldown-config/plugins/alias.d.ts +0 -25
- package/lib/rolldown-config/plugins/alias.js +0 -14
- package/lib/rolldown-config/plugins/alias.js.map +0 -1
- package/lib/rolldown-config/plugins/tsPaths.cjs +0 -17
- package/lib/rolldown-config/plugins/tsPaths.cjs.map +0 -1
- package/lib/rolldown-config/plugins/tsPaths.d.ts +0 -9
- package/lib/rolldown-config/plugins/tsPaths.js +0 -14
- package/lib/rolldown-config/plugins/tsPaths.js.map +0 -1
- package/lib/rolldown-config/utils.cjs.map +0 -1
- package/lib/rolldown-config/utils.d.ts +0 -2
- package/lib/rolldown-config/utils.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./create";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export { THIS1 } from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from "./addTarball";
|
|
2
|
+
export * from "./cleanup";
|
|
3
|
+
export { THIS1 } from "./constants";
|
|
4
|
+
export * from "./import";
|
|
5
|
+
export * from "./imports";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.cjs","names":["buildPackageJson","PACKAGE_PATH","TARBALL_FOLDER","sh","getRelativePath0"],"sources":["../../src/build-tests/pack.ts"],"sourcesContent":["import { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport sh from 'shelljs';\nimport { buildPackageJson } from './buildPackageJson';\nimport { DOT, PACKAGE_PATH, TARBALL_FOLDER } from './constants';\nimport { getRelativePath0 } from './getRelativePath';\
|
|
1
|
+
{"version":3,"file":"pack.cjs","names":["buildPackageJson","PACKAGE_PATH","TARBALL_FOLDER","sh","getRelativePath0"],"sources":["../../src/build-tests/pack.ts"],"sourcesContent":["import { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport sh from 'shelljs';\n\nimport type { Fn } from '#utils/types';\n\nimport { buildPackageJson } from './buildPackageJson';\nimport { DOT, PACKAGE_PATH, TARBALL_FOLDER } from './constants';\nimport { getRelativePath0 } from './getRelativePath';\n\ntype Pack_F = Fn<[], Promise<string>>;\n\nexport const pack: Pack_F = async () => {\n const { packageJson, outDir } = buildPackageJson();\n\n const fileToWrite = `${DOT}${join(outDir, PACKAGE_PATH)}`;\n\n await writeFile(fileToWrite, JSON.stringify(packageJson, null, 2));\n const folderTocreate = `${DOT}${TARBALL_FOLDER}`;\n sh.rm('-Rf', [folderTocreate]);\n sh.mkdir(folderTocreate);\n\n sh.cd(`${DOT}${outDir}`);\n\n const out1 = sh\n .exec(`pnpm pack --pack-destination ../${TARBALL_FOLDER}`)\n .toString();\n\n sh.cd('..');\n const out2 = getRelativePath0(out1);\n return out2;\n};\n"],"mappings":";;;;;;;;;;AAaA,MAAa,OAAe,YAAY;CACtC,MAAM,EAAE,aAAa,WAAWA,qCAAAA,iBAAiB;CAIjD,OAAA,GAAA,YAAA,UAAA,CAAgB,MAAA,GAAA,KAAA,KAAA,CAFkB,QAAQC,8BAAAA,YAAY,KAEzB,KAAK,UAAU,aAAa,MAAM,CAAC,CAAC;CACjE,MAAM,iBAAiB,KAASC,8BAAAA;CAChC,QAAA,QAAG,GAAG,OAAO,CAAC,cAAc,CAAC;CAC7B,QAAA,QAAG,MAAM,cAAc;CAEvB,QAAA,QAAG,GAAG,KAAS,QAAQ;CAEvB,MAAM,OAAOC,QAAAA,QACV,KAAK,mCAAmCD,8BAAAA,gBAAgB,CAAC,CACzD,SAAS;CAEZ,QAAA,QAAG,GAAG,IAAI;CAEV,OADaE,oCAAAA,iBAAiB,IACpB;AACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pack.js","names":[],"sources":["../../src/build-tests/pack.ts"],"sourcesContent":["import { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport sh from 'shelljs';\nimport { buildPackageJson } from './buildPackageJson';\nimport { DOT, PACKAGE_PATH, TARBALL_FOLDER } from './constants';\nimport { getRelativePath0 } from './getRelativePath';\
|
|
1
|
+
{"version":3,"file":"pack.js","names":[],"sources":["../../src/build-tests/pack.ts"],"sourcesContent":["import { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport sh from 'shelljs';\n\nimport type { Fn } from '#utils/types';\n\nimport { buildPackageJson } from './buildPackageJson';\nimport { DOT, PACKAGE_PATH, TARBALL_FOLDER } from './constants';\nimport { getRelativePath0 } from './getRelativePath';\n\ntype Pack_F = Fn<[], Promise<string>>;\n\nexport const pack: Pack_F = async () => {\n const { packageJson, outDir } = buildPackageJson();\n\n const fileToWrite = `${DOT}${join(outDir, PACKAGE_PATH)}`;\n\n await writeFile(fileToWrite, JSON.stringify(packageJson, null, 2));\n const folderTocreate = `${DOT}${TARBALL_FOLDER}`;\n sh.rm('-Rf', [folderTocreate]);\n sh.mkdir(folderTocreate);\n\n sh.cd(`${DOT}${outDir}`);\n\n const out1 = sh\n .exec(`pnpm pack --pack-destination ../${TARBALL_FOLDER}`)\n .toString();\n\n sh.cd('..');\n const out2 = getRelativePath0(out1);\n return out2;\n};\n"],"mappings":";;;;;;;AAaA,MAAa,OAAe,YAAY;CACtC,MAAM,EAAE,aAAa,WAAW,iBAAiB;CAIjD,MAAM,UAAU,KAFa,KAAK,QAAQ,YAAY,KAEzB,KAAK,UAAU,aAAa,MAAM,CAAC,CAAC;CACjE,MAAM,iBAAiB,KAAS;CAChC,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC;CAC7B,GAAG,MAAM,cAAc;CAEvB,GAAG,GAAG,KAAS,QAAQ;CAEvB,MAAM,OAAO,GACV,KAAK,mCAAmC,gBAAgB,CAAC,CACzD,SAAS;CAEZ,GAAG,GAAG,IAAI;CAEV,OADa,iBAAiB,IACpB;AACZ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../
|
|
3
|
-
const require_rolldown_config_utils = require("./utils.cjs");
|
|
2
|
+
const require_utils_array = require("../utils/array.cjs");
|
|
4
3
|
const require_rolldown_config_constants = require("./constants.cjs");
|
|
5
4
|
const require_rolldown_config_output = require("./output.cjs");
|
|
6
5
|
const require_rolldown_config_input = require("./input.cjs");
|
|
@@ -12,10 +11,9 @@ const defineConfig = (additionals) => {
|
|
|
12
11
|
return defineConfig.default(additionals);
|
|
13
12
|
};
|
|
14
13
|
const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, excludesTS, declarationMap, plugins } = {}) => {
|
|
15
|
-
const include = require_rolldown_config_input.buildInput(...
|
|
16
|
-
const exclude = require_rolldown_config_constants.DEFAULT_EXCLUDE.concat(
|
|
14
|
+
const include = require_rolldown_config_input.buildInput(...require_utils_array.toArray(excludesTS));
|
|
15
|
+
const exclude = require_rolldown_config_constants.DEFAULT_EXCLUDE.concat(require_utils_array.toArray(excludesTS));
|
|
17
16
|
const unordered = {
|
|
18
|
-
alias: () => require_rolldown_config_plugins_index.PLUGIN_BUILDERS.alias(),
|
|
19
17
|
typescript: () => require_rolldown_config_plugins_index.PLUGIN_BUILDERS.typescript({
|
|
20
18
|
include,
|
|
21
19
|
exclude,
|
|
@@ -28,7 +26,6 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
28
26
|
builtinsPrefix: "strip",
|
|
29
27
|
include: excludesTS
|
|
30
28
|
}),
|
|
31
|
-
tsPaths: () => require_rolldown_config_plugins_index.PLUGIN_BUILDERS.tsPaths({ colors: true }),
|
|
32
29
|
clean: () => require_rolldown_config_plugins_index.PLUGIN_BUILDERS.clean({
|
|
33
30
|
ignoresJS,
|
|
34
31
|
sourcemap,
|
|
@@ -36,8 +33,6 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
36
33
|
})
|
|
37
34
|
};
|
|
38
35
|
const defaultOrdered = () => [
|
|
39
|
-
unordered.alias(),
|
|
40
|
-
unordered.tsPaths(),
|
|
41
36
|
unordered.circulars(),
|
|
42
37
|
unordered.externals(),
|
|
43
38
|
(0, rolldown_plugins.esmExternalRequirePlugin)(),
|
|
@@ -66,9 +61,9 @@ defineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {
|
|
|
66
61
|
});
|
|
67
62
|
};
|
|
68
63
|
defineConfig.bemedev = (additionals) => {
|
|
69
|
-
const circularDeps = require_rolldown_config_constants.DEFAULT_CIRCULAR_DEPS.concat(
|
|
70
|
-
const ignoresJS =
|
|
71
|
-
const excludesTS = require_rolldown_config_constants.DEFAULT_EXCLUDE.concat(
|
|
64
|
+
const circularDeps = require_rolldown_config_constants.DEFAULT_CIRCULAR_DEPS.concat(require_utils_array.toArray(additionals?.circularDeps));
|
|
65
|
+
const ignoresJS = require_utils_array.toArray(additionals?.ignoresJS).concat(require_rolldown_config_constants.DEFAULT_CIRCULAR_DEPS);
|
|
66
|
+
const excludesTS = require_rolldown_config_constants.DEFAULT_EXCLUDE.concat(require_utils_array.toArray(additionals?.excludesTS));
|
|
72
67
|
const _sourcemap = additionals?.sourcemap;
|
|
73
68
|
const sourcemap = _sourcemap === void 0 || _sourcemap === true;
|
|
74
69
|
return defineConfig.default({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs","names":["buildInput","toArray","DEFAULT_EXCLUDE","PLUGIN_BUILDERS","buildOutput","DEFAULT_CIRCULAR_DEPS"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\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';\
|
|
1
|
+
{"version":3,"file":"config.cjs","names":["buildInput","toArray","DEFAULT_EXCLUDE","PLUGIN_BUILDERS","buildOutput","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\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({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n esmExternalRequirePlugin(),\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 = ({\n dir,\n sourcemap = false,\n ...rest\n}: Params = {}) => {\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({\n input,\n plugins,\n external,\n output,\n platform: 'node',\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(\n DEFAULT_CIRCULAR_DEPS,\n );\n\n const excludesTS = DEFAULT_EXCLUDE.concat(\n toArray(additionals?.excludesTS),\n );\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":";;;;;;;;;AAWA,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;GACzB;GACA;GACA;GACA;EACF,CAAC;EACH,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;CAClE;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;iDACK;EACzB,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,EACtB,KACA,YAAY,OACZ,GAAG,SACO,CAAC,MAAM;CACjB,MAAM,QAAQH,8BAAAA,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAASI,+BAAAA,YAAY,KAAK,SAAS;CAIzC,QAAA,GAAA,SAAA,aAAA,CAAqB;EACnB;EACA,SAJc,eAAe;GAAE;GAAK;GAAW,GAAG;EAAK,CAIjD;EACN;EACA;EACA,UAAU;CACZ,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAeC,kCAAAA,sBAAsB,OACzCJ,oBAAAA,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAYA,oBAAAA,QAAQ,aAAa,SAAS,CAAC,CAAC,OAChDI,kCAAAA,qBACF;CAEA,MAAM,aAAaH,kCAAAA,gBAAgB,OACjCD,oBAAAA,QAAQ,aAAa,UAAU,CACjC;CACA,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config_F } from
|
|
1
|
+
import type { Config_F } from "./types";
|
|
2
2
|
export declare const defineConfig: Config_F;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toArray } from "
|
|
1
|
+
import { toArray } from "../utils/array.js";
|
|
2
2
|
import { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from "./constants.js";
|
|
3
3
|
import { buildOutput } from "./output.js";
|
|
4
4
|
import { buildInput } from "./input.js";
|
|
@@ -13,7 +13,6 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
13
13
|
const include = buildInput(...toArray(excludesTS));
|
|
14
14
|
const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));
|
|
15
15
|
const unordered = {
|
|
16
|
-
alias: () => PLUGIN_BUILDERS.alias(),
|
|
17
16
|
typescript: () => PLUGIN_BUILDERS.typescript({
|
|
18
17
|
include,
|
|
19
18
|
exclude,
|
|
@@ -26,7 +25,6 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
26
25
|
builtinsPrefix: "strip",
|
|
27
26
|
include: excludesTS
|
|
28
27
|
}),
|
|
29
|
-
tsPaths: () => PLUGIN_BUILDERS.tsPaths({ colors: true }),
|
|
30
28
|
clean: () => PLUGIN_BUILDERS.clean({
|
|
31
29
|
ignoresJS,
|
|
32
30
|
sourcemap,
|
|
@@ -34,8 +32,6 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
34
32
|
})
|
|
35
33
|
};
|
|
36
34
|
const defaultOrdered = () => [
|
|
37
|
-
unordered.alias(),
|
|
38
|
-
unordered.tsPaths(),
|
|
39
35
|
unordered.circulars(),
|
|
40
36
|
unordered.externals(),
|
|
41
37
|
esmExternalRequirePlugin(),
|
|
@@ -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';\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';\
|
|
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\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({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n esmExternalRequirePlugin(),\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 = ({\n dir,\n sourcemap = false,\n ...rest\n}: Params = {}) => {\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({\n input,\n plugins,\n external,\n output,\n platform: 'node',\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(\n DEFAULT_CIRCULAR_DEPS,\n );\n\n const excludesTS = DEFAULT_EXCLUDE.concat(\n toArray(additionals?.excludesTS),\n );\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":";;;;;;;;AAWA,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;GACzB;GACA;GACA;GACA;EACF,CAAC;EACH,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;CAClE;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,yBAAyB;EACzB,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,EACtB,KACA,YAAY,OACZ,GAAG,SACO,CAAC,MAAM;CACjB,MAAM,QAAQ,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAAS,YAAY,KAAK,SAAS;CAIzC,OAAOA,eAAc;EACnB;EACA,SAJc,eAAe;GAAE;GAAK;GAAW,GAAG;EAAK,CAIjD;EACN;EACA;EACA,UAAU;CACZ,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAe,sBAAsB,OACzC,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAY,QAAQ,aAAa,SAAS,CAAC,CAAC,OAChD,qBACF;CAEA,MAAM,aAAa,gBAAgB,OACjC,QAAQ,aAAa,UAAU,CACjC;CACA,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","names":[],"sources":["../../src/rolldown-config/constants.ts"],"sourcesContent":["export const DEFAULT_EXCLUDE = [\n '**/node_modules/**/*',\n '**/__tests__/**/*',\n '**/*.test.ts',\n '**/*.test-d.ts',\n '**/*.fixtures.ts',\n '**/fixtures.ts',\n 'src/fixtures/**/*.ts',\n];\n\nexport const DEFAULT_CIRCULAR_DEPS = [\n '**/types.ts',\n '**/type.ts',\n '**/*.types.ts',\n '**/*.type.ts',\n];\n\nexport const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);\n\nexport const DEFAULT_DIR = 'lib';\n\nexport const WARNING_CODES = {\n EMPTY_BUNDLE: 'EMPTY_BUNDLE',\n CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY',\n};\n"],"mappings":";;AAAA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"constants.cjs","names":[],"sources":["../../src/rolldown-config/constants.ts"],"sourcesContent":["export const DEFAULT_EXCLUDE = [\n '**/node_modules/**/*',\n '**/__tests__/**/*',\n '**/*.test.ts',\n '**/*.test-d.ts',\n '**/*.fixtures.ts',\n '**/fixtures.ts',\n 'src/fixtures/**/*.ts',\n];\n\nexport const DEFAULT_CIRCULAR_DEPS = [\n '**/types.ts',\n '**/type.ts',\n '**/*.types.ts',\n '**/*.type.ts',\n];\n\nexport const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);\n\nexport const DEFAULT_DIR = 'lib';\n\nexport const WARNING_CODES = {\n EMPTY_BUNDLE: 'EMPTY_BUNDLE',\n CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY',\n};\n"],"mappings":";;AAAA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;AACF;AAEA,MAAa,SAAS,gBAAgB,OAAO,qBAAqB;AAElE,MAAa,cAAc;AAE3B,MAAa,gBAAgB;CAC3B,cAAc;CACd,qBAAqB;AACvB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const DEFAULT_EXCLUDE:
|
|
2
|
-
export declare const DEFAULT_CIRCULAR_DEPS:
|
|
3
|
-
export declare const IGNORE:
|
|
1
|
+
export declare const DEFAULT_EXCLUDE: unknown;
|
|
2
|
+
export declare const DEFAULT_CIRCULAR_DEPS: unknown;
|
|
3
|
+
export declare const IGNORE: unknown;
|
|
4
4
|
export declare const DEFAULT_DIR = "lib";
|
|
5
5
|
export declare const WARNING_CODES: {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
EMPTY_BUNDLE: string;
|
|
7
|
+
CIRCULAR_DEPENDENCY: string;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../../src/rolldown-config/constants.ts"],"sourcesContent":["export const DEFAULT_EXCLUDE = [\n '**/node_modules/**/*',\n '**/__tests__/**/*',\n '**/*.test.ts',\n '**/*.test-d.ts',\n '**/*.fixtures.ts',\n '**/fixtures.ts',\n 'src/fixtures/**/*.ts',\n];\n\nexport const DEFAULT_CIRCULAR_DEPS = [\n '**/types.ts',\n '**/type.ts',\n '**/*.types.ts',\n '**/*.type.ts',\n];\n\nexport const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);\n\nexport const DEFAULT_DIR = 'lib';\n\nexport const WARNING_CODES = {\n EMPTY_BUNDLE: 'EMPTY_BUNDLE',\n CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY',\n};\n"],"mappings":";AAAA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../../src/rolldown-config/constants.ts"],"sourcesContent":["export const DEFAULT_EXCLUDE = [\n '**/node_modules/**/*',\n '**/__tests__/**/*',\n '**/*.test.ts',\n '**/*.test-d.ts',\n '**/*.fixtures.ts',\n '**/fixtures.ts',\n 'src/fixtures/**/*.ts',\n];\n\nexport const DEFAULT_CIRCULAR_DEPS = [\n '**/types.ts',\n '**/type.ts',\n '**/*.types.ts',\n '**/*.type.ts',\n];\n\nexport const IGNORE = DEFAULT_EXCLUDE.concat(DEFAULT_CIRCULAR_DEPS);\n\nexport const DEFAULT_DIR = 'lib';\n\nexport const WARNING_CODES = {\n EMPTY_BUNDLE: 'EMPTY_BUNDLE',\n CIRCULAR_DEPENDENCY: 'CIRCULAR_DEPENDENCY',\n};\n"],"mappings":";AAAA,MAAa,kBAAkB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;AACF;AAEA,MAAa,SAAS,gBAAgB,OAAO,qBAAqB;AAElE,MAAa,cAAc;AAE3B,MAAa,gBAAgB;CAC3B,cAAc;CACd,qBAAqB;AACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.cjs","names":[],"sources":["../../src/rolldown-config/helpers.ts"],"sourcesContent":["import { rmSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\n\nexport const withoutExtension = (file: string) => {\n return file.slice(0, file.length - extname(file).length);\n};\n\nexport const cleanupJS = (\n files: Set<string>,\n dir: string,\n sourcemap: boolean,\n) => {\n for (const file of files) {\n const withoutExt = withoutExtension(file);\n const rel = relative('src', withoutExt);\n const baseOut = resolve(process.cwd(), dir, rel);\n\n // #region JS outputs\n console.warn(`Cleaning up ${baseOut}`);\n\n rmSync(`${baseOut}.js`, { force: true });\n rmSync(`${baseOut}.cjs`, { force: true });\n if (sourcemap) {\n rmSync(`${baseOut}.js.map`, { force: true });\n rmSync(`${baseOut}.cjs.map`, { force: true });\n }\n\n const REMOVEDS = ['js', 'cjs', 'js.map', 'cjs.map'].map(\n ext => `${baseOut}.${ext}`,\n );\n\n const endMessage = JSON.stringify(REMOVEDS, null, 2);\n\n console.warn('removeds ::');\n console.log('***********');\n console.warn(endMessage);\n console.log('***********');\n // #endregion\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.cjs","names":[],"sources":["../../src/rolldown-config/helpers.ts"],"sourcesContent":["import { rmSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\n\nexport const withoutExtension = (file: string) => {\n return file.slice(0, file.length - extname(file).length);\n};\n\nexport const cleanupJS = (\n files: Set<string>,\n dir: string,\n sourcemap: boolean,\n) => {\n for (const file of files) {\n const withoutExt = withoutExtension(file);\n const rel = relative('src', withoutExt);\n const baseOut = resolve(process.cwd(), dir, rel);\n\n // #region JS outputs\n console.warn(`Cleaning up ${baseOut}`);\n\n rmSync(`${baseOut}.js`, { force: true });\n rmSync(`${baseOut}.cjs`, { force: true });\n if (sourcemap) {\n rmSync(`${baseOut}.js.map`, { force: true });\n rmSync(`${baseOut}.cjs.map`, { force: true });\n }\n\n const REMOVEDS = ['js', 'cjs', 'js.map', 'cjs.map'].map(\n ext => `${baseOut}.${ext}`,\n );\n\n const endMessage = JSON.stringify(REMOVEDS, null, 2);\n\n console.warn('removeds ::');\n console.log('***********');\n console.warn(endMessage);\n console.log('***********');\n // #endregion\n }\n};\n"],"mappings":";;;;AAGA,MAAa,oBAAoB,SAAiB;CAChD,OAAO,KAAK,MAAM,GAAG,KAAK,UAAA,GAAA,KAAA,QAAA,CAAiB,IAAI,CAAC,CAAC,MAAM;AACzD;AAEA,MAAa,aACX,OACA,KACA,cACG;CACH,KAAK,MAAM,QAAQ,OAAO;EAExB,MAAM,OAAA,GAAA,KAAA,SAAA,CAAe,OADF,iBAAiB,IACC,CAAC;EACtC,MAAM,WAAA,GAAA,KAAA,QAAA,CAAkB,QAAQ,IAAI,GAAG,KAAK,GAAG;EAG/C,QAAQ,KAAK,eAAe,SAAS;EAErC,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC;EACvC,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,OAAO,EAAE,OAAO,KAAK,CAAC;EACxC,IAAI,WAAW;GACb,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,UAAU,EAAE,OAAO,KAAK,CAAC;GAC3C,CAAA,GAAA,GAAA,OAAA,CAAO,GAAG,QAAQ,WAAW,EAAE,OAAO,KAAK,CAAC;EAC9C;EAEA,MAAM,WAAW;GAAC;GAAM;GAAO;GAAU;EAAS,CAAC,CAAC,KAClD,QAAO,GAAG,QAAQ,GAAG,KACvB;EAEA,MAAM,aAAa,KAAK,UAAU,UAAU,MAAM,CAAC;EAEnD,QAAQ,KAAK,aAAa;EAC1B,QAAQ,IAAI,aAAa;EACzB,QAAQ,KAAK,UAAU;EACvB,QAAQ,IAAI,aAAa;CAE3B;AACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const withoutExtension:
|
|
2
|
-
export declare const cleanupJS:
|
|
1
|
+
export declare const withoutExtension: unknown;
|
|
2
|
+
export declare const cleanupJS: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","names":[],"sources":["../../src/rolldown-config/helpers.ts"],"sourcesContent":["import { rmSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\n\nexport const withoutExtension = (file: string) => {\n return file.slice(0, file.length - extname(file).length);\n};\n\nexport const cleanupJS = (\n files: Set<string>,\n dir: string,\n sourcemap: boolean,\n) => {\n for (const file of files) {\n const withoutExt = withoutExtension(file);\n const rel = relative('src', withoutExt);\n const baseOut = resolve(process.cwd(), dir, rel);\n\n // #region JS outputs\n console.warn(`Cleaning up ${baseOut}`);\n\n rmSync(`${baseOut}.js`, { force: true });\n rmSync(`${baseOut}.cjs`, { force: true });\n if (sourcemap) {\n rmSync(`${baseOut}.js.map`, { force: true });\n rmSync(`${baseOut}.cjs.map`, { force: true });\n }\n\n const REMOVEDS = ['js', 'cjs', 'js.map', 'cjs.map'].map(\n ext => `${baseOut}.${ext}`,\n );\n\n const endMessage = JSON.stringify(REMOVEDS, null, 2);\n\n console.warn('removeds ::');\n console.log('***********');\n console.warn(endMessage);\n console.log('***********');\n // #endregion\n }\n};\n"],"mappings":";;;AAGA,MAAa,oBAAoB,SAAiB;
|
|
1
|
+
{"version":3,"file":"helpers.js","names":[],"sources":["../../src/rolldown-config/helpers.ts"],"sourcesContent":["import { rmSync } from 'node:fs';\nimport { extname, relative, resolve } from 'node:path';\n\nexport const withoutExtension = (file: string) => {\n return file.slice(0, file.length - extname(file).length);\n};\n\nexport const cleanupJS = (\n files: Set<string>,\n dir: string,\n sourcemap: boolean,\n) => {\n for (const file of files) {\n const withoutExt = withoutExtension(file);\n const rel = relative('src', withoutExt);\n const baseOut = resolve(process.cwd(), dir, rel);\n\n // #region JS outputs\n console.warn(`Cleaning up ${baseOut}`);\n\n rmSync(`${baseOut}.js`, { force: true });\n rmSync(`${baseOut}.cjs`, { force: true });\n if (sourcemap) {\n rmSync(`${baseOut}.js.map`, { force: true });\n rmSync(`${baseOut}.cjs.map`, { force: true });\n }\n\n const REMOVEDS = ['js', 'cjs', 'js.map', 'cjs.map'].map(\n ext => `${baseOut}.${ext}`,\n );\n\n const endMessage = JSON.stringify(REMOVEDS, null, 2);\n\n console.warn('removeds ::');\n console.log('***********');\n console.warn(endMessage);\n console.log('***********');\n // #endregion\n }\n};\n"],"mappings":";;;AAGA,MAAa,oBAAoB,SAAiB;CAChD,OAAO,KAAK,MAAM,GAAG,KAAK,SAAS,QAAQ,IAAI,CAAC,CAAC,MAAM;AACzD;AAEA,MAAa,aACX,OACA,KACA,cACG;CACH,KAAK,MAAM,QAAQ,OAAO;EAExB,MAAM,MAAM,SAAS,OADF,iBAAiB,IACC,CAAC;EACtC,MAAM,UAAU,QAAQ,QAAQ,IAAI,GAAG,KAAK,GAAG;EAG/C,QAAQ,KAAK,eAAe,SAAS;EAErC,OAAO,GAAG,QAAQ,MAAM,EAAE,OAAO,KAAK,CAAC;EACvC,OAAO,GAAG,QAAQ,OAAO,EAAE,OAAO,KAAK,CAAC;EACxC,IAAI,WAAW;GACb,OAAO,GAAG,QAAQ,UAAU,EAAE,OAAO,KAAK,CAAC;GAC3C,OAAO,GAAG,QAAQ,WAAW,EAAE,OAAO,KAAK,CAAC;EAC9C;EAEA,MAAM,WAAW;GAAC;GAAM;GAAO;GAAU;EAAS,CAAC,CAAC,KAClD,QAAO,GAAG,QAAQ,GAAG,KACvB;EAEA,MAAM,aAAa,KAAK,UAAU,UAAU,MAAM,CAAC;EAEnD,QAAQ,KAAK,aAAa;EAC1B,QAAQ,IAAI,aAAa;EACzB,QAAQ,KAAK,UAAU;EACvB,QAAQ,IAAI,aAAa;CAE3B;AACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./config";
|
|
2
|
+
export * from "./plugins";
|
|
3
|
+
export * from "./types";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../_virtual/_rolldown/runtime.cjs");
|
|
3
2
|
const require_rolldown_config_constants = require("./constants.cjs");
|
|
4
|
-
let glob = require("glob");
|
|
5
3
|
let path = require("path");
|
|
4
|
+
let glob = require("glob");
|
|
6
5
|
//#region src/rolldown-config/input.ts
|
|
7
6
|
const buildInput = (...ignores) => Object.fromEntries((0, glob.globSync)("src/**/*.ts", { ignore: require_rolldown_config_constants.DEFAULT_EXCLUDE.concat(ignores) }).map((file) => {
|
|
8
7
|
return [(0, path.relative)("src", file.slice(0, file.length - (0, path.extname)(file).length)), `${process.cwd()}/${file}`];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.cjs","names":["DEFAULT_EXCLUDE"],"sources":["../../src/rolldown-config/input.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"input.cjs","names":["DEFAULT_EXCLUDE"],"sources":["../../src/rolldown-config/input.ts"],"sourcesContent":["import { extname, relative } from 'node:path';\n\nimport { globSync } from 'glob';\n\nimport { DEFAULT_EXCLUDE } from './constants';\nimport type { BuildInput_F } from './types';\n\nexport const buildInput: BuildInput_F = (...ignores) =>\n Object.fromEntries(\n globSync('src/**/*.ts', {\n ignore: DEFAULT_EXCLUDE.concat(ignores),\n }).map(file => {\n const key = relative(\n 'src',\n file.slice(0, file.length - extname(file).length),\n );\n const value = `${process.cwd()}/${file}`;\n\n return [key, value];\n }),\n );\n"],"mappings":";;;;;AAOA,MAAa,cAA4B,GAAG,YAC1C,OAAO,aAAA,GAAA,KAAA,SAAA,CACI,eAAe,EACtB,QAAQA,kCAAAA,gBAAgB,OAAO,OAAO,EACxC,CAAC,CAAC,CAAC,KAAI,SAAQ;CAOb,OAAO,EAAA,GAAA,KAAA,SAAA,CALL,OACA,KAAK,MAAM,GAAG,KAAK,UAAA,GAAA,KAAA,QAAA,CAAiB,IAAI,CAAC,CAAC,MAAM,CAIxC,GAAG,GAFI,QAAQ,IAAI,EAAE,GAAG,MAEhB;AACpB,CAAC,CACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BuildInput_F } from
|
|
1
|
+
import type { BuildInput_F } from "./types";
|
|
2
2
|
export declare const buildInput: BuildInput_F;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_EXCLUDE } from "./constants.js";
|
|
2
|
-
import { globSync } from "glob";
|
|
3
2
|
import { extname, relative } from "path";
|
|
3
|
+
import { globSync } from "glob";
|
|
4
4
|
//#region src/rolldown-config/input.ts
|
|
5
5
|
const buildInput = (...ignores) => Object.fromEntries(globSync("src/**/*.ts", { ignore: DEFAULT_EXCLUDE.concat(ignores) }).map((file) => {
|
|
6
6
|
return [relative("src", file.slice(0, file.length - extname(file).length)), `${process.cwd()}/${file}`];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","names":[],"sources":["../../src/rolldown-config/input.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"input.js","names":[],"sources":["../../src/rolldown-config/input.ts"],"sourcesContent":["import { extname, relative } from 'node:path';\n\nimport { globSync } from 'glob';\n\nimport { DEFAULT_EXCLUDE } from './constants';\nimport type { BuildInput_F } from './types';\n\nexport const buildInput: BuildInput_F = (...ignores) =>\n Object.fromEntries(\n globSync('src/**/*.ts', {\n ignore: DEFAULT_EXCLUDE.concat(ignores),\n }).map(file => {\n const key = relative(\n 'src',\n file.slice(0, file.length - extname(file).length),\n );\n const value = `${process.cwd()}/${file}`;\n\n return [key, value];\n }),\n );\n"],"mappings":";;;;AAOA,MAAa,cAA4B,GAAG,YAC1C,OAAO,YACL,SAAS,eAAe,EACtB,QAAQ,gBAAgB,OAAO,OAAO,EACxC,CAAC,CAAC,CAAC,KAAI,SAAQ;CAOb,OAAO,CANK,SACV,OACA,KAAK,MAAM,GAAG,KAAK,SAAS,QAAQ,IAAI,CAAC,CAAC,MAAM,CAIxC,GAAG,GAFI,QAAQ,IAAI,EAAE,GAAG,MAEhB;AACpB,CAAC,CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.cjs","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\nimport { DEFAULT_DIR } from './constants';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"output.cjs","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;;AAIA,MAAa,eAAe,MAAA,OAAmB,cAAuB;CACpE,OAAO,CACL;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB;EACA,iBAAiB;EACjB,gBAAgB;CAClB,GACA;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB;EACA,iBAAiB;EACjB,gBAAgB;CAClB,CACF;AACF"}
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
export declare const buildOutput:
|
|
2
|
-
readonly format: "es";
|
|
3
|
-
readonly sourcemap: boolean;
|
|
4
|
-
readonly preserveModulesRoot: "src";
|
|
5
|
-
readonly dir: string;
|
|
6
|
-
readonly preserveModules: true;
|
|
7
|
-
readonly entryFileNames: "[name].js";
|
|
8
|
-
}, {
|
|
9
|
-
readonly format: "cjs";
|
|
10
|
-
readonly sourcemap: boolean;
|
|
11
|
-
readonly preserveModulesRoot: "src";
|
|
12
|
-
readonly dir: string;
|
|
13
|
-
readonly preserveModules: true;
|
|
14
|
-
readonly entryFileNames: "[name].cjs";
|
|
15
|
-
}];
|
|
1
|
+
export declare const buildOutput: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\nimport { DEFAULT_DIR } from './constants';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"output.js","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;AAIA,MAAa,eAAe,MAAA,OAAmB,cAAuB;CACpE,OAAO,CACL;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB;EACA,iBAAiB;EACjB,gBAAgB;CAClB,GACA;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB;EACA,iBAAiB;EACjB,gBAAgB;CAClB,CACF;AACF"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("../../
|
|
3
|
-
const require_rolldown_config_utils = require("../utils.cjs");
|
|
2
|
+
const require_utils_array = require("../../utils/array.cjs");
|
|
4
3
|
const require_rolldown_config_constants = require("../constants.cjs");
|
|
5
4
|
const require_rolldown_config_helpers = require("../helpers.cjs");
|
|
6
|
-
let glob = require("glob");
|
|
7
5
|
let path = require("path");
|
|
6
|
+
let glob = require("glob");
|
|
8
7
|
let rollup_plugin_circular_dependencies = require("rollup-plugin-circular-dependencies");
|
|
9
8
|
//#region src/rolldown-config/plugins/circulars.ts
|
|
10
9
|
/**
|
|
11
10
|
* Creates a configured circular dependencies plugin instance
|
|
12
|
-
*
|
|
11
|
+
*
|
|
12
|
+
* @param options - Configuration options for circular dependencies
|
|
13
|
+
* detection
|
|
13
14
|
* @returns Rolldown plugin
|
|
14
15
|
*/
|
|
15
16
|
function circulars(options = {}) {
|
|
16
17
|
const all = (0, rollup_plugin_circular_dependencies.circularDependencies)(options);
|
|
17
|
-
const CIRCULAR_CHUNKS =
|
|
18
|
+
const CIRCULAR_CHUNKS = require_utils_array.toArray(options.exclude).map((f) => (0, glob.globSync)(f, { nodir: true })).flat().map(require_rolldown_config_helpers.withoutExtension).map((file) => (0, path.relative)("src", file));
|
|
18
19
|
return {
|
|
19
20
|
...all,
|
|
20
21
|
name: "better circular-dependencies",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circulars.cjs","names":["toArray","withoutExtension","WARNING_CODES"],"sources":["../../../src/rolldown-config/plugins/circulars.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"circulars.cjs","names":["toArray","withoutExtension","WARNING_CODES"],"sources":["../../../src/rolldown-config/plugins/circulars.ts"],"sourcesContent":["import { relative } from 'node:path';\n\nimport { globSync } from 'glob';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { circularDependencies } from 'rollup-plugin-circular-dependencies';\n\nimport { toArray } from '#utils';\n\nimport { WARNING_CODES } from '../constants';\nimport { withoutExtension } from '../helpers';\n\nexport type CircularDependenciesOptions = Parameters<\n typeof circularDependencies\n>[0] & { exclude?: string | string[] };\n\n/**\n * Creates a configured circular dependencies plugin instance\n *\n * @param options - Configuration options for circular dependencies\n * detection\n * @returns Rolldown plugin\n */\nexport function circulars(\n options: CircularDependenciesOptions = {},\n): RolldownPluginOption {\n const all = circularDependencies(options);\n const exclude = toArray(options.exclude);\n\n const CIRCULAR_CHUNKS = exclude\n .map(f => globSync(f, { nodir: true }))\n .flat()\n .map(withoutExtension)\n .map(file => relative('src', file));\n\n return {\n ...all,\n name: 'better circular-dependencies',\n onLog: {\n handler: (_, { code, names }) => {\n if (\n code === WARNING_CODES.CIRCULAR_DEPENDENCY &&\n names?.every(name => CIRCULAR_CHUNKS.includes(name))\n ) {\n const STARS = '*'.repeat(20);\n console.log(STARS);\n console.log(\n '[bemedev] Skipping circular dependency warnings for:',\n );\n names?.forEach(name => console.log(` -> 📄 ${name}`));\n console.log(STARS);\n console.log();\n return false;\n }\n\n return;\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAgB,UACd,UAAuC,CAAC,GAClB;CACtB,MAAM,OAAA,GAAA,oCAAA,qBAAA,CAA2B,OAAO;CAGxC,MAAM,kBAFUA,oBAAAA,QAAQ,QAAQ,OAEF,CAAC,CAC5B,KAAI,OAAA,GAAA,KAAA,SAAA,CAAc,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,IAAIC,gCAAAA,gBAAgB,CAAC,CACrB,KAAI,UAAA,GAAA,KAAA,SAAA,CAAiB,OAAO,IAAI,CAAC;CAEpC,OAAO;EACL,GAAG;EACH,MAAM;EACN,OAAO,EACL,UAAU,GAAG,EAAE,MAAM,YAAY;GAC/B,IACE,SAASC,kCAAAA,cAAc,uBACvB,OAAO,OAAM,SAAQ,gBAAgB,SAAS,IAAI,CAAC,GACnD;IACA,MAAM,QAAQ,IAAI,OAAO,EAAE;IAC3B,QAAQ,IAAI,KAAK;IACjB,QAAQ,IACN,sDACF;IACA,OAAO,SAAQ,SAAQ,QAAQ,IAAI,WAAW,MAAM,CAAC;IACrD,QAAQ,IAAI,KAAK;IACjB,QAAQ,IAAI;IACZ,OAAO;GACT;EAGF,EACF;CACF;AACF"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type { RolldownPluginOption } from
|
|
2
|
-
import { circularDependencies } from
|
|
1
|
+
import type { RolldownPluginOption } from "rolldown";
|
|
2
|
+
import { circularDependencies } from "rollup-plugin-circular-dependencies";
|
|
3
3
|
export type CircularDependenciesOptions = Parameters<typeof circularDependencies>[0] & {
|
|
4
|
-
|
|
4
|
+
exclude?: string | string[];
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
* Creates a configured circular dependencies plugin instance
|
|
8
|
+
*
|
|
9
|
+
* @param options - Configuration options for circular dependencies
|
|
10
|
+
* detection
|
|
11
|
+
* @returns Rolldown plugin
|
|
12
|
+
*/
|
|
11
13
|
export declare function circulars(options?: CircularDependenciesOptions): RolldownPluginOption;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { toArray } from "
|
|
1
|
+
import { toArray } from "../../utils/array.js";
|
|
2
2
|
import { WARNING_CODES } from "../constants.js";
|
|
3
3
|
import { withoutExtension } from "../helpers.js";
|
|
4
|
-
import { globSync } from "glob";
|
|
5
4
|
import { relative } from "path";
|
|
5
|
+
import { globSync } from "glob";
|
|
6
6
|
import { circularDependencies } from "rollup-plugin-circular-dependencies";
|
|
7
7
|
//#region src/rolldown-config/plugins/circulars.ts
|
|
8
8
|
/**
|
|
9
9
|
* Creates a configured circular dependencies plugin instance
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
|
+
* @param options - Configuration options for circular dependencies
|
|
12
|
+
* detection
|
|
11
13
|
* @returns Rolldown plugin
|
|
12
14
|
*/
|
|
13
15
|
function circulars(options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circulars.js","names":[],"sources":["../../../src/rolldown-config/plugins/circulars.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"circulars.js","names":[],"sources":["../../../src/rolldown-config/plugins/circulars.ts"],"sourcesContent":["import { relative } from 'node:path';\n\nimport { globSync } from 'glob';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { circularDependencies } from 'rollup-plugin-circular-dependencies';\n\nimport { toArray } from '#utils';\n\nimport { WARNING_CODES } from '../constants';\nimport { withoutExtension } from '../helpers';\n\nexport type CircularDependenciesOptions = Parameters<\n typeof circularDependencies\n>[0] & { exclude?: string | string[] };\n\n/**\n * Creates a configured circular dependencies plugin instance\n *\n * @param options - Configuration options for circular dependencies\n * detection\n * @returns Rolldown plugin\n */\nexport function circulars(\n options: CircularDependenciesOptions = {},\n): RolldownPluginOption {\n const all = circularDependencies(options);\n const exclude = toArray(options.exclude);\n\n const CIRCULAR_CHUNKS = exclude\n .map(f => globSync(f, { nodir: true }))\n .flat()\n .map(withoutExtension)\n .map(file => relative('src', file));\n\n return {\n ...all,\n name: 'better circular-dependencies',\n onLog: {\n handler: (_, { code, names }) => {\n if (\n code === WARNING_CODES.CIRCULAR_DEPENDENCY &&\n names?.every(name => CIRCULAR_CHUNKS.includes(name))\n ) {\n const STARS = '*'.repeat(20);\n console.log(STARS);\n console.log(\n '[bemedev] Skipping circular dependency warnings for:',\n );\n names?.forEach(name => console.log(` -> 📄 ${name}`));\n console.log(STARS);\n console.log();\n return false;\n }\n\n return;\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,SAAgB,UACd,UAAuC,CAAC,GAClB;CACtB,MAAM,MAAM,qBAAqB,OAAO;CAGxC,MAAM,kBAFU,QAAQ,QAAQ,OAEF,CAAC,CAC5B,KAAI,MAAK,SAAS,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,IAAI,gBAAgB,CAAC,CACrB,KAAI,SAAQ,SAAS,OAAO,IAAI,CAAC;CAEpC,OAAO;EACL,GAAG;EACH,MAAM;EACN,OAAO,EACL,UAAU,GAAG,EAAE,MAAM,YAAY;GAC/B,IACE,SAAS,cAAc,uBACvB,OAAO,OAAM,SAAQ,gBAAgB,SAAS,IAAI,CAAC,GACnD;IACA,MAAM,QAAQ,IAAI,OAAO,EAAE;IAC3B,QAAQ,IAAI,KAAK;IACjB,QAAQ,IACN,sDACF;IACA,OAAO,SAAQ,SAAQ,QAAQ,IAAI,WAAW,MAAM,CAAC;IACrD,QAAQ,IAAI,KAAK;IACjB,QAAQ,IAAI;IACZ,OAAO;GACT;EAGF,EACF;CACF;AACF"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_rolldown_config_utils = require("../utils.cjs");
|
|
2
|
+
const require_utils_array = require("../../utils/array.cjs");
|
|
4
3
|
const require_rolldown_config_constants = require("../constants.cjs");
|
|
5
4
|
const require_rolldown_config_helpers = require("../helpers.cjs");
|
|
6
5
|
const require_rolldown_config_plugins_typescript_config = require("./typescript.config.cjs");
|
|
7
|
-
let fs = require("fs");
|
|
8
|
-
let glob = require("glob");
|
|
9
6
|
let path = require("path");
|
|
10
|
-
let
|
|
11
|
-
typescript = require_runtime.__toESM(typescript, 1);
|
|
7
|
+
let glob = require("glob");
|
|
12
8
|
//#region src/rolldown-config/plugins/clean.ts
|
|
13
9
|
const clean = (options) => {
|
|
14
10
|
const { ignoresJS, sourcemap = false, dir } = options;
|
|
15
|
-
const _ignoresJS =
|
|
11
|
+
const _ignoresJS = require_utils_array.toArray(ignoresJS);
|
|
16
12
|
return {
|
|
17
13
|
name: "end-bemedev",
|
|
18
14
|
onLog: { handler: (_, { code, names }) => {
|
|
@@ -29,8 +25,7 @@ const clean = (options) => {
|
|
|
29
25
|
closeBundle: {
|
|
30
26
|
order: "post",
|
|
31
27
|
handler: () => {
|
|
32
|
-
const
|
|
33
|
-
const outDir = require_rolldown_config_plugins_typescript_config.readTsConfig(typescript.default.findConfigFile(cwd, fs.existsSync, "tsconfig.json")).options.outDir ?? dir ?? "lib";
|
|
28
|
+
const outDir = require_rolldown_config_plugins_typescript_config.readTsConfig(require_rolldown_config_plugins_typescript_config.findConfigFile(process.cwd(), "tsconfig.json")).compilerOptions.outDir ?? dir ?? "lib";
|
|
34
29
|
if (_ignoresJS.length > 0) try {
|
|
35
30
|
const files = /* @__PURE__ */ new Set();
|
|
36
31
|
_ignoresJS.forEach((pat) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.cjs","names":["toArray","withoutExtension","WARNING_CODES","readTsConfig","
|
|
1
|
+
{"version":3,"file":"clean.cjs","names":["toArray","withoutExtension","WARNING_CODES","readTsConfig","findConfigFile"],"sources":["../../../src/rolldown-config/plugins/clean.ts"],"sourcesContent":["import { relative } from 'node:path';\n\nimport { globSync } from 'glob';\nimport type { RolldownPluginOption } from 'rolldown';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_DIR, WARNING_CODES } from '../constants';\nimport { cleanupJS, withoutExtension } from '../helpers';\nimport { findConfigFile, readTsConfig } from './typescript.config';\n\nexport type EndPluginOptions = {\n ignoresJS?: string | string[];\n sourcemap?: boolean;\n dir?: string;\n};\n\nexport const clean = (options: EndPluginOptions) => {\n const { ignoresJS, sourcemap = false, dir } = options;\n\n const _ignoresJS = toArray(ignoresJS);\n\n const out = {\n name: 'end-bemedev',\n\n onLog: {\n handler: (_, { code, names }) => {\n const EMPTY_CHUNKS = _ignoresJS\n .map(f => globSync(f, { nodir: true }))\n .flat()\n .map(withoutExtension)\n .map(file => relative('src', file));\n\n const check =\n code === WARNING_CODES.EMPTY_BUNDLE &&\n names?.every(name => EMPTY_CHUNKS.includes(name));\n\n if (check) {\n const STARS = '*'.repeat(20);\n console.log(STARS);\n console.log('[end-bemedev] Skipping empty chunk warnings for:');\n names?.forEach(name => console.log(` -> 📄 ${name}`));\n console.log(STARS);\n return false;\n }\n\n return;\n },\n },\n\n closeBundle: {\n order: 'post',\n handler: () => {\n const cwd = process.cwd();\n\n const tsconfigPath = findConfigFile(cwd, 'tsconfig.json')!;\n const _outDir = readTsConfig(tsconfigPath).compilerOptions.outDir;\n const outDir = _outDir ?? dir ?? DEFAULT_DIR;\n if (_ignoresJS.length > 0) {\n try {\n const files = new Set<string>();\n _ignoresJS.forEach(pat => {\n const globs = globSync(pat, { nodir: true });\n globs.forEach(file => files.add(file));\n });\n cleanupJS(files, outDir, sourcemap);\n console.log('Build finished');\n /* v8 ignore next 3 */\n } catch (err) {\n console.error('[end-bemedev] cleanup failed:', err);\n }\n }\n },\n },\n } satisfies RolldownPluginOption;\n\n return out;\n};\n"],"mappings":";;;;;;;;AAiBA,MAAa,SAAS,YAA8B;CAClD,MAAM,EAAE,WAAW,YAAY,OAAO,QAAQ;CAE9C,MAAM,aAAaA,oBAAAA,QAAQ,SAAS;CAwDpC,OAAO;EArDL,MAAM;EAEN,OAAO,EACL,UAAU,GAAG,EAAE,MAAM,YAAY;GAC/B,MAAM,eAAe,WAClB,KAAI,OAAA,GAAA,KAAA,SAAA,CAAc,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,IAAIC,gCAAAA,gBAAgB,CAAC,CACrB,KAAI,UAAA,GAAA,KAAA,SAAA,CAAiB,OAAO,IAAI,CAAC;GAMpC,IAHE,SAASC,kCAAAA,cAAc,gBACvB,OAAO,OAAM,SAAQ,aAAa,SAAS,IAAI,CAAC,GAEvC;IACT,MAAM,QAAQ,IAAI,OAAO,EAAE;IAC3B,QAAQ,IAAI,KAAK;IACjB,QAAQ,IAAI,kDAAkD;IAC9D,OAAO,SAAQ,SAAQ,QAAQ,IAAI,WAAW,MAAM,CAAC;IACrD,QAAQ,IAAI,KAAK;IACjB,OAAO;GACT;EAGF,EACF;EAEA,aAAa;GACX,OAAO;GACP,eAAe;IAKb,MAAM,SADUC,kDAAAA,aADKC,kDAAAA,eAFT,QAAQ,IAEkB,GAAG,eACD,CAAC,CAAC,CAAC,gBAAgB,UACjC,OAAA;IAC1B,IAAI,WAAW,SAAS,GACtB,IAAI;KACF,MAAM,wBAAQ,IAAI,IAAY;KAC9B,WAAW,SAAQ,QAAO;MAExB,CAAA,GAAA,KAAA,SAAA,CADuB,KAAK,EAAE,OAAO,KAAK,CACtC,CAAC,CAAC,SAAQ,SAAQ,MAAM,IAAI,IAAI,CAAC;KACvC,CAAC;KACD,gCAAA,UAAU,OAAO,QAAQ,SAAS;KAClC,QAAQ,IAAI,gBAAgB;IAE9B,SAAS,KAAK;KACZ,QAAQ,MAAM,iCAAiC,GAAG;IACpD;GAEJ;EACF;CAGO;AACX"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
export type EndPluginOptions = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export declare const clean: (options: EndPluginOptions) => {
|
|
7
|
-
name: string;
|
|
8
|
-
onLog: {
|
|
9
|
-
handler: (this: import("rolldown").MinimalPluginContext, _: import("rolldown").LogLevel, { code, names }: import("rolldown").RolldownLog) => false | undefined;
|
|
10
|
-
};
|
|
11
|
-
closeBundle: {
|
|
12
|
-
order: "post";
|
|
13
|
-
handler: () => void;
|
|
14
|
-
};
|
|
2
|
+
ignoresJS?: string | string[];
|
|
3
|
+
sourcemap?: boolean;
|
|
4
|
+
dir?: string;
|
|
15
5
|
};
|
|
6
|
+
export declare const clean: unknown;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { toArray } from "
|
|
1
|
+
import { toArray } from "../../utils/array.js";
|
|
2
2
|
import { WARNING_CODES } from "../constants.js";
|
|
3
3
|
import { cleanupJS, withoutExtension } from "../helpers.js";
|
|
4
|
-
import { readTsConfig } from "./typescript.config.js";
|
|
5
|
-
import { existsSync } from "fs";
|
|
6
|
-
import { globSync } from "glob";
|
|
4
|
+
import { findConfigFile, readTsConfig } from "./typescript.config.js";
|
|
7
5
|
import { relative } from "path";
|
|
8
|
-
import
|
|
6
|
+
import { globSync } from "glob";
|
|
9
7
|
//#region src/rolldown-config/plugins/clean.ts
|
|
10
8
|
const clean = (options) => {
|
|
11
9
|
const { ignoresJS, sourcemap = false, dir } = options;
|
|
@@ -26,8 +24,7 @@ const clean = (options) => {
|
|
|
26
24
|
closeBundle: {
|
|
27
25
|
order: "post",
|
|
28
26
|
handler: () => {
|
|
29
|
-
const
|
|
30
|
-
const outDir = readTsConfig(ts.findConfigFile(cwd, existsSync, "tsconfig.json")).options.outDir ?? dir ?? "lib";
|
|
27
|
+
const outDir = readTsConfig(findConfigFile(process.cwd(), "tsconfig.json")).compilerOptions.outDir ?? dir ?? "lib";
|
|
31
28
|
if (_ignoresJS.length > 0) try {
|
|
32
29
|
const files = /* @__PURE__ */ new Set();
|
|
33
30
|
_ignoresJS.forEach((pat) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.js","names":[],"sources":["../../../src/rolldown-config/plugins/clean.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"clean.js","names":[],"sources":["../../../src/rolldown-config/plugins/clean.ts"],"sourcesContent":["import { relative } from 'node:path';\n\nimport { globSync } from 'glob';\nimport type { RolldownPluginOption } from 'rolldown';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_DIR, WARNING_CODES } from '../constants';\nimport { cleanupJS, withoutExtension } from '../helpers';\nimport { findConfigFile, readTsConfig } from './typescript.config';\n\nexport type EndPluginOptions = {\n ignoresJS?: string | string[];\n sourcemap?: boolean;\n dir?: string;\n};\n\nexport const clean = (options: EndPluginOptions) => {\n const { ignoresJS, sourcemap = false, dir } = options;\n\n const _ignoresJS = toArray(ignoresJS);\n\n const out = {\n name: 'end-bemedev',\n\n onLog: {\n handler: (_, { code, names }) => {\n const EMPTY_CHUNKS = _ignoresJS\n .map(f => globSync(f, { nodir: true }))\n .flat()\n .map(withoutExtension)\n .map(file => relative('src', file));\n\n const check =\n code === WARNING_CODES.EMPTY_BUNDLE &&\n names?.every(name => EMPTY_CHUNKS.includes(name));\n\n if (check) {\n const STARS = '*'.repeat(20);\n console.log(STARS);\n console.log('[end-bemedev] Skipping empty chunk warnings for:');\n names?.forEach(name => console.log(` -> 📄 ${name}`));\n console.log(STARS);\n return false;\n }\n\n return;\n },\n },\n\n closeBundle: {\n order: 'post',\n handler: () => {\n const cwd = process.cwd();\n\n const tsconfigPath = findConfigFile(cwd, 'tsconfig.json')!;\n const _outDir = readTsConfig(tsconfigPath).compilerOptions.outDir;\n const outDir = _outDir ?? dir ?? DEFAULT_DIR;\n if (_ignoresJS.length > 0) {\n try {\n const files = new Set<string>();\n _ignoresJS.forEach(pat => {\n const globs = globSync(pat, { nodir: true });\n globs.forEach(file => files.add(file));\n });\n cleanupJS(files, outDir, sourcemap);\n console.log('Build finished');\n /* v8 ignore next 3 */\n } catch (err) {\n console.error('[end-bemedev] cleanup failed:', err);\n }\n }\n },\n },\n } satisfies RolldownPluginOption;\n\n return out;\n};\n"],"mappings":";;;;;;;AAiBA,MAAa,SAAS,YAA8B;CAClD,MAAM,EAAE,WAAW,YAAY,OAAO,QAAQ;CAE9C,MAAM,aAAa,QAAQ,SAAS;CAwDpC,OAAO;EArDL,MAAM;EAEN,OAAO,EACL,UAAU,GAAG,EAAE,MAAM,YAAY;GAC/B,MAAM,eAAe,WAClB,KAAI,MAAK,SAAS,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CACtC,KAAK,CAAC,CACN,IAAI,gBAAgB,CAAC,CACrB,KAAI,SAAQ,SAAS,OAAO,IAAI,CAAC;GAMpC,IAHE,SAAS,cAAc,gBACvB,OAAO,OAAM,SAAQ,aAAa,SAAS,IAAI,CAAC,GAEvC;IACT,MAAM,QAAQ,IAAI,OAAO,EAAE;IAC3B,QAAQ,IAAI,KAAK;IACjB,QAAQ,IAAI,kDAAkD;IAC9D,OAAO,SAAQ,SAAQ,QAAQ,IAAI,WAAW,MAAM,CAAC;IACrD,QAAQ,IAAI,KAAK;IACjB,OAAO;GACT;EAGF,EACF;EAEA,aAAa;GACX,OAAO;GACP,eAAe;IAKb,MAAM,SADU,aADK,eAFT,QAAQ,IAEkB,GAAG,eACD,CAAC,CAAC,CAAC,gBAAgB,UACjC,OAAA;IAC1B,IAAI,WAAW,SAAS,GACtB,IAAI;KACF,MAAM,wBAAQ,IAAI,IAAY;KAC9B,WAAW,SAAQ,QAAO;MAExB,SADuB,KAAK,EAAE,OAAO,KAAK,CACtC,CAAC,CAAC,SAAQ,SAAQ,MAAM,IAAI,IAAI,CAAC;KACvC,CAAC;KACD,UAAU,OAAO,QAAQ,SAAS;KAClC,QAAQ,IAAI,gBAAgB;IAE9B,SAAS,KAAK;KACZ,QAAQ,MAAM,iCAAiC,GAAG;IACpD;GAEJ;EACF;CAGO;AACX"}
|