@layerzerolabs/vitest-configuration 1.2.25 → 1.2.26

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.
@@ -10,6 +10,6 @@
10
10
  CLI Target: ES2023
11
11
  CLI Cleaning output folder
12
12
  ESM Build start
13
- ESM dist/index.js 627.00 B
14
- ESM dist/index.js.map 1.13 KB
15
- ESM ⚡️ Build success in 54ms
13
+ ESM dist/index.js 935.00 B
14
+ ESM dist/index.js.map 2.29 KB
15
+ ESM ⚡️ Build success in 47ms
@@ -2,7 +2,7 @@
2
2
  > @layerzerolabs/vitest-configuration@0.0.0 lint /home/runner/work/monorepo-internal/monorepo-internal/tooling-configs/vitest
3
3
  > eslint . --max-warnings 0 || (eslint . --fix --max-warnings 0 && false)
4
4
 
5
- (node:86722) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/eslint.config.js?mtime=1784834384472 is not specified and it doesn't parse as CommonJS.
5
+ (node:59144) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/eslint.config.js?mtime=1785546631907 is not specified and it doesn't parse as CommonJS.
6
6
  Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
7
7
  To eliminate this warning, add "type": "module" to /home/runner/work/monorepo-internal/monorepo-internal/package.json.
8
8
  (Use `node --trace-warnings ...` to show where the warning was created)
@@ -13,6 +13,6 @@ Breaking changes might not follow SemVer, please pin Vitest's version when using
13
13
   Test Files  2 passed (2)
14
14
   Tests  4 passed (4)
15
15
  Type Errors  no errors
16
-  Start at  19:22:17
17
-  Duration  1.65s (transform 24ms, setup 0ms, collect 131ms, tests 3ms, environment 0ms, prepare 159ms, typecheck 1.22s)
16
+  Start at  01:12:22
17
+  Duration  1.37s (transform 13ms, setup 0ms, collect 104ms, tests 3ms, environment 0ms, prepare 117ms, typecheck 1.19s)
18
18
 
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { ViteUserConfig } from 'vitest/config';
2
- export declare const defineConfig: (config?: ViteUserConfig) => ViteUserConfig;
2
+ export declare const defineConfig: ({ test, ...config }?: ViteUserConfig) => ViteUserConfig;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,eAAO,MAAM,YAAY,GAAI,SAAQ,cAAmB,KAAG,cActD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AASpD,eAAO,MAAM,YAAY,GAAI,sBAAqB,cAAmB,KAAG,cA8BnE,CAAC"}
package/dist/index.js CHANGED
@@ -2,19 +2,32 @@ import { mergeConfig, defineConfig as defineConfig$1 } from 'vitest/config';
2
2
 
3
3
  var __defProp = Object.defineProperty;
4
4
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- var defineConfig = /* @__PURE__ */ __name((config = {}) => mergeConfig(defineConfig$1({
5
+ var typecheck = {
6
+ enabled: true,
7
+ include: [
8
+ "**/*.test.ts{,x}"
9
+ ],
10
+ tsconfig: "tsconfig.test.json"
11
+ };
12
+ var defineConfig = /* @__PURE__ */ __name(({ test, ...config } = {}) => mergeConfig(defineConfig$1({
6
13
  test: {
7
14
  passWithNoTests: true,
8
- typecheck: {
9
- enabled: true,
10
- include: [
11
- "**/*.test.ts{,x}"
12
- ],
13
- tsconfig: "tsconfig.test.json"
14
- },
15
+ typecheck,
15
16
  watch: false
16
17
  }
17
- }), defineConfig$1(config)), "defineConfig");
18
+ }), defineConfig$1({
19
+ ...config,
20
+ test: {
21
+ ...test,
22
+ projects: test?.projects ? test.projects.map((project) => typeof project === "string" || typeof project === "function" || project instanceof Promise ? project : {
23
+ ...project,
24
+ test: {
25
+ ...project.test,
26
+ typecheck
27
+ }
28
+ }) : void 0
29
+ }
30
+ })), "defineConfig");
18
31
 
19
32
  export { defineConfig };
20
33
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":["defineConfig","config","mergeConfig","defineVitestConfig","test","passWithNoTests","typecheck","enabled","include","tsconfig","watch"],"mappings":";;;;AAGO,IAAMA,+BAAe,MAAA,CAAA,CAACC,MAAAA,GAAyB,EAAC,KACnDC,YACIC,cAAAA,CAAmB;EACfC,IAAAA,EAAM;IACFC,eAAAA,EAAiB,IAAA;IACjBC,SAAAA,EAAW;MACPC,OAAAA,EAAS,IAAA;MACTC,OAAAA,EAAS;AAAC,QAAA;;MACVC,QAAAA,EAAU;AACd,KAAA;IACAC,KAAAA,EAAO;AACX;AACJ,CAAA,CAAA,EACAP,cAAAA,CAAmBF,MAAAA,CAAAA,CAAAA,EAbC,cAAA","file":"index.js","sourcesContent":["import type { ViteUserConfig } from 'vitest/config';\nimport { defineConfig as defineVitestConfig, mergeConfig } from 'vitest/config';\n\nexport const defineConfig = (config: ViteUserConfig = {}): ViteUserConfig =>\n mergeConfig(\n defineVitestConfig({\n test: {\n passWithNoTests: true,\n typecheck: {\n enabled: true,\n include: ['**/*.test.ts{,x}'],\n tsconfig: 'tsconfig.test.json',\n },\n watch: false,\n },\n }),\n defineVitestConfig(config),\n );\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":["typecheck","enabled","include","tsconfig","defineConfig","test","config","mergeConfig","defineVitestConfig","passWithNoTests","watch","projects","map","project","Promise","undefined"],"mappings":";;;;AAGA,IAAMA,SAAAA,GAAY;EACdC,OAAAA,EAAS,IAAA;EACTC,OAAAA,EAAS;AAAC,IAAA;;EACVC,QAAAA,EAAU;AACd,CAAA;AAEO,IAAMC,YAAAA,mBAAe,MAAA,CAAA,CAAC,EAAEC,IAAAA,EAAM,GAAGC,QAAAA,GAA2B,EAAC,KAChEC,WAAAA,CACIC,cAAAA,CAAmB;EACfH,IAAAA,EAAM;IACFI,eAAAA,EAAiB,IAAA;AACjBT,IAAAA,SAAAA;IACAU,KAAAA,EAAO;AACX;AACJ,CAAA,GACAF,cAAAA,CAAmB;EACf,GAAGF,MAAAA;EACHD,IAAAA,EAAM;IACF,GAAGA,IAAAA;AACHM,IAAAA,QAAAA,EAAUN,IAAAA,EAAMM,QAAAA,GACVN,IAAAA,CAAKM,QAAAA,CAASC,IAAI,CAACC,OAAAA,KACf,OAAOA,OAAAA,KAAY,YACnB,OAAOA,OAAAA,KAAY,UAAA,IACnBA,OAAAA,YAAmBC,UACbD,OAAAA,GACA;MACI,GAAGA,OAAAA;MACHR,IAAAA,EAAM;AACF,QAAA,GAAGQ,OAAAA,CAAQR,IAAAA;AACXL,QAAAA;AACJ;AACJ,KAAA,CAAA,GAEVe;AACV;AACJ,CAAA,CAAA,CAAA,EA7BoB,cAAA","file":"index.js","sourcesContent":["import type { ViteUserConfig } from 'vitest/config';\nimport { defineConfig as defineVitestConfig, mergeConfig } from 'vitest/config';\n\nconst typecheck = {\n enabled: true,\n include: ['**/*.test.ts{,x}'],\n tsconfig: 'tsconfig.test.json',\n};\n\nexport const defineConfig = ({ test, ...config }: ViteUserConfig = {}): ViteUserConfig =>\n mergeConfig(\n defineVitestConfig({\n test: {\n passWithNoTests: true,\n typecheck,\n watch: false,\n },\n }),\n defineVitestConfig({\n ...config,\n test: {\n ...test,\n projects: test?.projects\n ? test.projects.map((project) =>\n typeof project === 'string' ||\n typeof project === 'function' ||\n project instanceof Promise\n ? project\n : {\n ...project,\n test: {\n ...project.test,\n typecheck,\n },\n },\n )\n : undefined,\n },\n }),\n );\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerzerolabs/vitest-configuration",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,8 +16,8 @@
16
16
  "tsup": "^8.4.0",
17
17
  "typescript": "^6.0.3",
18
18
  "vitest": "^3.2.6",
19
- "@layerzerolabs/tsup-configuration": "1.2.25",
20
- "@layerzerolabs/typescript-configuration": "1.2.25"
19
+ "@layerzerolabs/tsup-configuration": "1.2.26",
20
+ "@layerzerolabs/typescript-configuration": "1.2.26"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "vitest": "^3.2.6"
package/src/index.ts CHANGED
@@ -1,18 +1,40 @@
1
1
  import type { ViteUserConfig } from 'vitest/config';
2
2
  import { defineConfig as defineVitestConfig, mergeConfig } from 'vitest/config';
3
3
 
4
- export const defineConfig = (config: ViteUserConfig = {}): ViteUserConfig =>
4
+ const typecheck = {
5
+ enabled: true,
6
+ include: ['**/*.test.ts{,x}'],
7
+ tsconfig: 'tsconfig.test.json',
8
+ };
9
+
10
+ export const defineConfig = ({ test, ...config }: ViteUserConfig = {}): ViteUserConfig =>
5
11
  mergeConfig(
6
12
  defineVitestConfig({
7
13
  test: {
8
14
  passWithNoTests: true,
9
- typecheck: {
10
- enabled: true,
11
- include: ['**/*.test.ts{,x}'],
12
- tsconfig: 'tsconfig.test.json',
13
- },
15
+ typecheck,
14
16
  watch: false,
15
17
  },
16
18
  }),
17
- defineVitestConfig(config),
19
+ defineVitestConfig({
20
+ ...config,
21
+ test: {
22
+ ...test,
23
+ projects: test?.projects
24
+ ? test.projects.map((project) =>
25
+ typeof project === 'string' ||
26
+ typeof project === 'function' ||
27
+ project instanceof Promise
28
+ ? project
29
+ : {
30
+ ...project,
31
+ test: {
32
+ ...project.test,
33
+ typecheck,
34
+ },
35
+ },
36
+ )
37
+ : undefined,
38
+ },
39
+ }),
18
40
  );