@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/coverage.ts
|
|
3
3
|
/**
|
|
4
4
|
* Test fixture constant.
|
|
5
5
|
*/
|
|
@@ -14,7 +14,6 @@ const noArgs = () => expected;
|
|
|
14
14
|
* Test fixture adding multiple numbers together.
|
|
15
15
|
*/
|
|
16
16
|
const addMany = (...numbers) => numbers.reduce((acc, value) => acc + value, 0);
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.addMany = addMany;
|
|
19
18
|
exports.expected = expected;
|
|
20
19
|
exports.noArgs = noArgs;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/coverage.ts
|
|
2
2
|
/**
|
|
3
3
|
* Test fixture constant.
|
|
4
4
|
*/
|
|
@@ -13,7 +13,6 @@ const noArgs = () => expected;
|
|
|
13
13
|
* Test fixture adding multiple numbers together.
|
|
14
14
|
*/
|
|
15
15
|
const addMany = (...numbers) => numbers.reduce((acc, value) => acc + value, 0);
|
|
16
|
-
//#endregion
|
|
17
16
|
export { addMany, expected, noArgs };
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=coverage.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/partialCall.ts
|
|
3
3
|
/**
|
|
4
4
|
* Creates a partially applied function for a single object parameter function.
|
|
5
5
|
*
|
|
@@ -18,7 +18,6 @@ function partialCallO(f, headArgs) {
|
|
|
18
18
|
...headArgs
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
exports.partialCallO = partialCallO;
|
|
23
22
|
|
|
24
23
|
//# sourceMappingURL=partialCall.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/partialCall.ts
|
|
2
2
|
/**
|
|
3
3
|
* Creates a partially applied function for a single object parameter function.
|
|
4
4
|
*
|
|
@@ -17,7 +17,6 @@ function partialCallO(f, headArgs) {
|
|
|
17
17
|
...headArgs
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { partialCallO };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=partialCall.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/toUpper.ts
|
|
3
3
|
/**
|
|
4
4
|
* Converts a string to uppercase.
|
|
5
5
|
*
|
|
@@ -24,7 +24,6 @@ const _toUpper = (str) => {
|
|
|
24
24
|
const toUpper = (...strs) => {
|
|
25
25
|
return strs.map(_toUpper);
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
exports._toUpper = _toUpper;
|
|
29
28
|
exports.toUpper = toUpper;
|
|
30
29
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/toUpper.ts
|
|
2
2
|
/**
|
|
3
3
|
* Converts a string to uppercase.
|
|
4
4
|
*
|
|
@@ -23,7 +23,6 @@ const _toUpper = (str) => {
|
|
|
23
23
|
const toUpper = (...strs) => {
|
|
24
24
|
return strs.map(_toUpper);
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { _toUpper, toUpper };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=toUpper.js.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/vitest.ts
|
|
3
3
|
/**
|
|
4
4
|
* Flag indicating whether tests are executed within the VS Code Vitest extension.
|
|
5
5
|
*/
|
|
6
6
|
const IS_EXTENSION = process.env.VITEST_VSCODE === "true";
|
|
7
|
-
//#endregion
|
|
8
7
|
exports.IS_EXTENSION = IS_EXTENSION;
|
|
9
8
|
|
|
10
9
|
//# sourceMappingURL=vitest.cjs.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/vitest.ts
|
|
2
2
|
/**
|
|
3
3
|
* Flag indicating whether tests are executed within the VS Code Vitest extension.
|
|
4
4
|
*/
|
|
5
5
|
const IS_EXTENSION = process.env.VITEST_VSCODE === "true";
|
|
6
|
-
//#endregion
|
|
7
6
|
export { IS_EXTENSION };
|
|
8
7
|
|
|
9
8
|
//# sourceMappingURL=vitest.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/fixtures/zod.ts
|
|
3
3
|
/**
|
|
4
4
|
* Converts a Zod schema into a synchronous type-guard validation function.
|
|
5
5
|
*
|
|
@@ -36,7 +36,6 @@ const transformZodToFunctionAsync = (zod) => {
|
|
|
36
36
|
* Alias for {@linkcode transformZodToFunctionAsync}.
|
|
37
37
|
*/
|
|
38
38
|
const transformZTFAsync = transformZodToFunctionAsync;
|
|
39
|
-
//#endregion
|
|
40
39
|
exports.transformZTF = transformZTF;
|
|
41
40
|
exports.transformZTFAsync = transformZTFAsync;
|
|
42
41
|
exports.transformZodToFunction = transformZodToFunction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/fixtures/zod.ts
|
|
2
2
|
/**
|
|
3
3
|
* Converts a Zod schema into a synchronous type-guard validation function.
|
|
4
4
|
*
|
|
@@ -35,7 +35,6 @@ const transformZodToFunctionAsync = (zod) => {
|
|
|
35
35
|
* Alias for {@linkcode transformZodToFunctionAsync}.
|
|
36
36
|
*/
|
|
37
37
|
const transformZTFAsync = transformZodToFunctionAsync;
|
|
38
|
-
//#endregion
|
|
39
38
|
export { transformZTF, transformZTFAsync, transformZodToFunction, transformZodToFunctionAsync };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=zod.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let vitest = require("vitest");
|
|
3
|
-
|
|
3
|
+
// src/vitest-extended/identity.ts
|
|
4
4
|
/**
|
|
5
5
|
* Identity function returning its argument unmodified.
|
|
6
6
|
*
|
|
@@ -24,7 +24,6 @@ const defaultEquality = (value, expected) => {
|
|
|
24
24
|
if (Array.isArray(value) && Array.isArray(expected)) return (0, vitest.expect)(value.sort()).toStrictEqual(expected.sort());
|
|
25
25
|
return (0, vitest.expect)(value).toStrictEqual(expected);
|
|
26
26
|
};
|
|
27
|
-
//#endregion
|
|
28
27
|
exports.defaultEquality = defaultEquality;
|
|
29
28
|
exports.identity = identity;
|
|
30
29
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from "vitest";
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/identity.ts
|
|
3
3
|
/**
|
|
4
4
|
* Identity function returning its argument unmodified.
|
|
5
5
|
*
|
|
@@ -23,7 +23,6 @@ const defaultEquality = (value, expected) => {
|
|
|
23
23
|
if (Array.isArray(value) && Array.isArray(expected)) return expect(value.sort()).toStrictEqual(expected.sort());
|
|
24
24
|
return expect(value).toStrictEqual(expected);
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { defaultEquality, identity };
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vitest_extended_project = require("./project.cjs");
|
|
3
2
|
const require_vitest_extended_acceptation = require("./acceptation.cjs");
|
|
3
|
+
const require_vitest_extended_createTests = require("./createTests.cjs");
|
|
4
4
|
const require_vitest_extended_each_error = require("./each/error.cjs");
|
|
5
5
|
const require_vitest_extended_each_pass = require("./each/pass.cjs");
|
|
6
|
-
const require_vitest_extended_createTests = require("./createTests.cjs");
|
|
7
6
|
const require_vitest_extended_done = require("./done.cjs");
|
|
8
7
|
require("./each/index.cjs");
|
|
9
8
|
const require_vitest_extended_fakeWaiter = require("./fakeWaiter.cjs");
|
|
9
|
+
const require_vitest_extended_project = require("./project.cjs");
|
|
10
10
|
exports.createFakeWaiter = require_vitest_extended_fakeWaiter.createFakeWaiter;
|
|
11
11
|
exports.createTests = require_vitest_extended_createTests.createTests;
|
|
12
12
|
exports.defineProject = require_vitest_extended_project.defineProject;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineProject } from "./project.js";
|
|
2
1
|
import { useTFA, useTestFunctionAcceptation } from "./acceptation.js";
|
|
2
|
+
import { createTests } from "./createTests.js";
|
|
3
3
|
import { useErrorAsyncEach, useErrorAsyncEachCases } from "./each/error.js";
|
|
4
4
|
import { useEach, useEachAsync } from "./each/pass.js";
|
|
5
|
-
import { createTests } from "./createTests.js";
|
|
6
5
|
import { doneTest } from "./done.js";
|
|
7
6
|
import "./each/index.js";
|
|
8
7
|
import { createFakeWaiter } from "./fakeWaiter.js";
|
|
8
|
+
import { defineProject } from "./project.js";
|
|
9
9
|
export { createFakeWaiter, createTests, defineProject, doneTest, useEach, useEachAsync, useErrorAsyncEach, useErrorAsyncEachCases, useTFA, useTestFunctionAcceptation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/isDefined.ts
|
|
3
3
|
/**
|
|
4
4
|
* Type guard to check if a value is defined (not `null` and not `undefined`).
|
|
5
5
|
*
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
12
12
|
const isDefined = (value) => {
|
|
13
13
|
return value !== void 0 && value !== null;
|
|
14
14
|
};
|
|
15
|
-
//#endregion
|
|
16
15
|
exports.isDefined = isDefined;
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=isDefined.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/isDefined.ts
|
|
2
2
|
/**
|
|
3
3
|
* Type guard to check if a value is defined (not `null` and not `undefined`).
|
|
4
4
|
*
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
const isDefined = (value) => {
|
|
12
12
|
return value !== void 0 && value !== null;
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { isDefined };
|
|
16
15
|
|
|
17
16
|
//# sourceMappingURL=isDefined.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/isFunction.ts
|
|
3
3
|
/**
|
|
4
4
|
* Determines whether the given value is a function.
|
|
5
5
|
*
|
|
@@ -13,7 +13,6 @@ function isFunction(arg) {
|
|
|
13
13
|
const isArrow = Object.prototype.toString.call(arg) === "[object Function]";
|
|
14
14
|
return !!arg && (isType || isInstance || isArrow);
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
exports.isFunction = isFunction;
|
|
18
17
|
|
|
19
18
|
//# sourceMappingURL=isFunction.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/isFunction.ts
|
|
2
2
|
/**
|
|
3
3
|
* Determines whether the given value is a function.
|
|
4
4
|
*
|
|
@@ -12,7 +12,6 @@ function isFunction(arg) {
|
|
|
12
12
|
const isArrow = Object.prototype.toString.call(arg) === "[object Function]";
|
|
13
13
|
return !!arg && (isType || isInstance || isArrow);
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { isFunction };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=isFunction.js.map
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let vitest_config = require("vitest/config");
|
|
3
|
-
|
|
3
|
+
// src/vitest-extended/project.ts
|
|
4
4
|
/**
|
|
5
5
|
* Helper function to define a Vitest project configuration with defaults.
|
|
6
6
|
*
|
|
7
7
|
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
8
8
|
*
|
|
9
|
-
* @returns Configured Vitest project configuration.
|
|
9
|
+
* @returns Configured Vitest project configuration: type {@linkcode UserWorkspaceConfig}.
|
|
10
10
|
*/
|
|
11
11
|
const defineProject = (conf) => {
|
|
12
12
|
const _env = conf.test?.env ?? {};
|
|
13
|
-
return (0, vitest_config.
|
|
14
|
-
resolve: { tsconfigPaths: true },
|
|
13
|
+
return (0, vitest_config.defineProject)({
|
|
15
14
|
...conf,
|
|
15
|
+
resolve: {
|
|
16
|
+
...conf.resolve,
|
|
17
|
+
tsconfigPaths: true
|
|
18
|
+
},
|
|
16
19
|
test: {
|
|
20
|
+
...conf.test,
|
|
17
21
|
globals: true,
|
|
18
22
|
logHeapUsage: false,
|
|
19
23
|
env: {
|
|
20
24
|
NODE_ENV: "test",
|
|
21
25
|
..._env
|
|
22
|
-
}
|
|
23
|
-
...conf.test
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
28
|
});
|
|
26
29
|
};
|
|
27
|
-
//#endregion
|
|
28
30
|
exports.defineProject = defineProject;
|
|
29
31
|
|
|
30
32
|
//# sourceMappingURL=project.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.cjs","names":["
|
|
1
|
+
{"version":3,"file":"project.cjs","names":["project"],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import { defineProject as project, type UserWorkspaceConfig } from 'vitest/config';\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: type {@linkcode UserWorkspaceConfig}.\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,cAAAA,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"}
|
|
@@ -4,6 +4,6 @@ import { type UserWorkspaceConfig } from 'vitest/config';
|
|
|
4
4
|
*
|
|
5
5
|
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
6
6
|
*
|
|
7
|
-
* @returns Configured Vitest project configuration.
|
|
7
|
+
* @returns Configured Vitest project configuration: type {@linkcode UserWorkspaceConfig}.
|
|
8
8
|
*/
|
|
9
|
-
export declare const defineProject: (conf: UserWorkspaceConfig) =>
|
|
9
|
+
export declare const defineProject: (conf: UserWorkspaceConfig) => UserWorkspaceConfig;
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineProject as defineProject$1 } from "vitest/config";
|
|
2
|
+
// src/vitest-extended/project.ts
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to define a Vitest project configuration with defaults.
|
|
5
5
|
*
|
|
6
6
|
* @param conf - Vitest user workspace configuration of type {@linkcode UserWorkspaceConfig}.
|
|
7
7
|
*
|
|
8
|
-
* @returns Configured Vitest project configuration.
|
|
8
|
+
* @returns Configured Vitest project configuration: type {@linkcode UserWorkspaceConfig}.
|
|
9
9
|
*/
|
|
10
10
|
const defineProject = (conf) => {
|
|
11
11
|
const _env = conf.test?.env ?? {};
|
|
12
|
-
return
|
|
13
|
-
resolve: { tsconfigPaths: true },
|
|
12
|
+
return defineProject$1({
|
|
14
13
|
...conf,
|
|
14
|
+
resolve: {
|
|
15
|
+
...conf.resolve,
|
|
16
|
+
tsconfigPaths: true
|
|
17
|
+
},
|
|
15
18
|
test: {
|
|
19
|
+
...conf.test,
|
|
16
20
|
globals: true,
|
|
17
21
|
logHeapUsage: false,
|
|
18
22
|
env: {
|
|
19
23
|
NODE_ENV: "test",
|
|
20
24
|
..._env
|
|
21
|
-
}
|
|
22
|
-
...conf.test
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
});
|
|
25
28
|
};
|
|
26
|
-
//#endregion
|
|
27
29
|
export { defineProject };
|
|
28
30
|
|
|
29
31
|
//# sourceMappingURL=project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","names":[],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"project.js","names":["project"],"sources":["../../src/vitest-extended/project.ts"],"sourcesContent":["import { defineProject as project, type UserWorkspaceConfig } from 'vitest/config';\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: type {@linkcode UserWorkspaceConfig}.\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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_vitest_extended_isDefined = require("./isDefined.cjs");
|
|
3
|
-
|
|
3
|
+
// src/vitest-extended/toArray.ts
|
|
4
4
|
/**
|
|
5
5
|
* Transforms test case arguments into the tuple format expected by Vitest each runners.
|
|
6
6
|
*/
|
|
@@ -34,7 +34,6 @@ const toArray = (obj) => {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
toArray.generic = (obj) => toArray(obj);
|
|
37
|
-
//#endregion
|
|
38
37
|
exports.toArray = toArray;
|
|
39
38
|
exports.toArrayVitest = toArrayVitest;
|
|
40
39
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isDefined } from "./isDefined.js";
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/toArray.ts
|
|
3
3
|
/**
|
|
4
4
|
* Transforms test case arguments into the tuple format expected by Vitest each runners.
|
|
5
5
|
*/
|
|
@@ -33,7 +33,6 @@ const toArray = (obj) => {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
toArray.generic = (obj) => toArray(obj);
|
|
36
|
-
//#endregion
|
|
37
36
|
export { toArray, toArrayVitest };
|
|
38
37
|
|
|
39
38
|
//# sourceMappingURL=toArray.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// src/vitest-extended/toStringFlat.ts
|
|
3
3
|
const log10 = (value) => {
|
|
4
4
|
return Math.floor(Math.log10(value));
|
|
5
5
|
};
|
|
@@ -20,7 +20,6 @@ const toStringFlat = (_value, _len) => {
|
|
|
20
20
|
out += _value;
|
|
21
21
|
return out;
|
|
22
22
|
};
|
|
23
|
-
//#endregion
|
|
24
23
|
exports.toStringFlat = toStringFlat;
|
|
25
24
|
|
|
26
25
|
//# sourceMappingURL=toStringFlat.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/vitest-extended/toStringFlat.ts
|
|
2
2
|
const log10 = (value) => {
|
|
3
3
|
return Math.floor(Math.log10(value));
|
|
4
4
|
};
|
|
@@ -19,7 +19,6 @@ const toStringFlat = (_value, _len) => {
|
|
|
19
19
|
out += _value;
|
|
20
20
|
return out;
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { toStringFlat };
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=toStringFlat.js.map
|
package/package.json
CHANGED
|
@@ -1,17 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bemedev/dev-utils",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "A collection of utilities for Node.js development, including build tools, testing utilities, and configuration management.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"build-tools",
|
|
7
|
+
"configuration",
|
|
8
|
+
"node",
|
|
9
|
+
"rollup",
|
|
10
|
+
"testing",
|
|
11
|
+
"typescript",
|
|
12
|
+
"utilities",
|
|
13
|
+
"vitest"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
5
16
|
"author": {
|
|
6
|
-
"email": "bri_lvi@icloud.com",
|
|
7
17
|
"name": "chlbri",
|
|
18
|
+
"email": "bri_lvi@icloud.com",
|
|
8
19
|
"url": "https://bemedev.vercel.app"
|
|
9
20
|
},
|
|
21
|
+
"maintainers": [
|
|
22
|
+
{
|
|
23
|
+
"email": "bri_lvi@icloud.com",
|
|
24
|
+
"name": "chlbri",
|
|
25
|
+
"url": "https://bemedev.vercel.app"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"contributors": [
|
|
29
|
+
{
|
|
30
|
+
"email": "bri_lvi@icloud.com",
|
|
31
|
+
"name": "chlbri",
|
|
32
|
+
"url": "https://bemedev.vercel.app"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
10
35
|
"repository": {
|
|
11
36
|
"type": "git",
|
|
12
37
|
"url": "https://github.com/chlbri/node-dev-utils"
|
|
13
38
|
},
|
|
14
|
-
"
|
|
39
|
+
"bin": {
|
|
40
|
+
"build-tests": "lib/build-tests/cli/index.js"
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"lib",
|
|
44
|
+
"public"
|
|
45
|
+
],
|
|
15
46
|
"type": "module",
|
|
16
47
|
"exports": {
|
|
17
48
|
"./build-tests": {
|
|
@@ -19,6 +50,11 @@
|
|
|
19
50
|
"require": "./lib/build-tests/index.cjs",
|
|
20
51
|
"types": "./lib/build-tests/index.d.ts"
|
|
21
52
|
},
|
|
53
|
+
"./pack": {
|
|
54
|
+
"import": "./lib/pack/index.js",
|
|
55
|
+
"require": "./lib/pack/index.cjs",
|
|
56
|
+
"types": "./lib/pack/index.d.ts"
|
|
57
|
+
},
|
|
22
58
|
"./rolldown": {
|
|
23
59
|
"import": "./lib/rolldown-config/index.js",
|
|
24
60
|
"require": "./lib/rolldown-config/index.cjs",
|
|
@@ -46,79 +82,52 @@
|
|
|
46
82
|
},
|
|
47
83
|
"./package.json": "./package.json"
|
|
48
84
|
},
|
|
49
|
-
"maintainers": [
|
|
50
|
-
{
|
|
51
|
-
"email": "bri_lvi@icloud.com",
|
|
52
|
-
"name": "chlbri",
|
|
53
|
-
"url": "https://bemedev.vercel.app"
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
"contributors": [
|
|
57
|
-
{
|
|
58
|
-
"email": "bri_lvi@icloud.com",
|
|
59
|
-
"name": "chlbri",
|
|
60
|
-
"url": "https://bemedev.vercel.app"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"keywords": [
|
|
64
|
-
"node",
|
|
65
|
-
"utilities",
|
|
66
|
-
"build-tools",
|
|
67
|
-
"testing",
|
|
68
|
-
"configuration",
|
|
69
|
-
"typescript",
|
|
70
|
-
"rollup",
|
|
71
|
-
"vitest"
|
|
72
|
-
],
|
|
73
|
-
"files": [
|
|
74
|
-
"lib",
|
|
75
|
-
"public"
|
|
76
|
-
],
|
|
77
|
-
"bin": {
|
|
78
|
-
"build-tests": "lib/build-tests/cli/index.js"
|
|
79
|
-
},
|
|
80
|
-
"engines": {
|
|
81
|
-
"node": ">=24"
|
|
82
|
-
},
|
|
83
|
-
"size-limit": [
|
|
84
|
-
{
|
|
85
|
-
"path": "lib/**/*.js",
|
|
86
|
-
"limit": "50 KB"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"path": "lib/**/*.cjs",
|
|
90
|
-
"limit": "50 KB"
|
|
91
|
-
}
|
|
92
|
-
],
|
|
93
85
|
"dependencies": {
|
|
94
86
|
"@typescript/typescript6": "^6.0.2",
|
|
95
87
|
"cmd-ts": "^0.15.0",
|
|
96
88
|
"edit-json-file": "^1.8.1",
|
|
97
|
-
"glob": "^
|
|
98
|
-
"oxc-transform": "^0.
|
|
89
|
+
"glob": "^14.0.4",
|
|
90
|
+
"oxc-transform": "^0.157.0",
|
|
99
91
|
"rollup-plugin-circular-dependencies": "^2.0.1",
|
|
100
92
|
"rollup-plugin-node-externals": "^9.0.1",
|
|
101
93
|
"shelljs": "^0.10.0",
|
|
102
94
|
"sort-keys": "^6.0.1",
|
|
103
|
-
"tsc-alias": "^1.9.
|
|
95
|
+
"tsc-alias": "^1.9.10"
|
|
104
96
|
},
|
|
105
97
|
"devDependencies": {
|
|
106
98
|
"@bemedev/app-ts": "3.0.2",
|
|
107
99
|
"@bemedev/basifun": "0.5.3",
|
|
108
|
-
"@rollup/plugin-typescript": "^12.3.
|
|
100
|
+
"@rollup/plugin-typescript": "^12.3.1",
|
|
109
101
|
"@types/edit-json-file": "^1.7.4",
|
|
110
|
-
"@types/node": "^26.
|
|
102
|
+
"@types/node": "^26.6.6",
|
|
111
103
|
"@types/shelljs": "^0.10.0",
|
|
112
|
-
"@vitest/ui": "
|
|
113
|
-
"rolldown": "^1.
|
|
114
|
-
"unplugin-dts": "^1.
|
|
115
|
-
"
|
|
116
|
-
"
|
|
104
|
+
"@vitest/ui": "5.1.0",
|
|
105
|
+
"rolldown": "^1.3.0",
|
|
106
|
+
"unplugin-dts": "^1.1.2",
|
|
107
|
+
"vite-plus": "^1.5.0",
|
|
108
|
+
"vitest": "5.1.0",
|
|
109
|
+
"zod": "^4.6.7",
|
|
117
110
|
"zx": "^8.8.5"
|
|
118
111
|
},
|
|
119
112
|
"peerDependencies": {
|
|
120
|
-
"rolldown": "^1.
|
|
121
|
-
"vitest": "
|
|
113
|
+
"rolldown": "^1.3.0",
|
|
114
|
+
"vitest": "5.1.0"
|
|
115
|
+
},
|
|
116
|
+
"optionalDependencies": {
|
|
117
|
+
"vite-plus": "^1.5.0"
|
|
118
|
+
},
|
|
119
|
+
"size-limit": [
|
|
120
|
+
{
|
|
121
|
+
"path": "lib/**/*.js",
|
|
122
|
+
"limit": "500 KB"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"path": "lib/**/*.cjs",
|
|
126
|
+
"limit": "500 KB"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"engines": {
|
|
130
|
+
"node": ">=24"
|
|
122
131
|
},
|
|
123
132
|
"scripts": {
|
|
124
133
|
"build": "pnpm run rm:lib && pnpm run rolldown",
|