@layerzerolabs/vitest-configuration 1.2.69 → 1.2.70

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.
@@ -0,0 +1,3 @@
1
+ import type { ViteUserConfig } from 'vitest/config';
2
+ export declare const defineConfig: ({ test, ...config }?: ViteUserConfig) => ViteUserConfig;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1 @@
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.69",
3
+ "version": "1.2.70",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -12,9 +12,12 @@
12
12
  "main": "./dist/index.js",
13
13
  "module": "./dist/index.js",
14
14
  "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist/**/*"
17
+ ],
15
18
  "devDependencies": {
16
- "@layerzerolabs/tsup-configuration": "1.2.69",
17
- "@layerzerolabs/typescript-configuration": "1.2.69",
19
+ "@layerzerolabs/tsup-configuration": "1.2.70",
20
+ "@layerzerolabs/typescript-configuration": "1.2.70",
18
21
  "tsup": "^8.4.0",
19
22
  "typescript": "^6.0.3",
20
23
  "vitest": "^4.1.10"
package/src/index.ts DELETED
@@ -1,40 +0,0 @@
1
- import type { ViteUserConfig } from 'vitest/config';
2
- import { defineConfig as defineVitestConfig, mergeConfig } from 'vitest/config';
3
-
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 =>
11
- mergeConfig(
12
- defineVitestConfig({
13
- test: {
14
- passWithNoTests: true,
15
- typecheck,
16
- watch: false,
17
- },
18
- }),
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
- }),
40
- );
@@ -1,20 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
-
3
- import { defineConfig } from '../src/index.js';
4
-
5
- describe(defineConfig, () => {
6
- it('references the static typecheck tsconfig', () => {
7
- expect(defineConfig().test?.typecheck?.tsconfig).toBe('tsconfig.test.json');
8
- });
9
-
10
- it('merges custom config', () => {
11
- const config = defineConfig({
12
- test: {
13
- sequence: { concurrent: true },
14
- },
15
- });
16
-
17
- expect(config.test?.typecheck?.tsconfig).toBe('tsconfig.test.json');
18
- expect(config.test?.sequence?.concurrent).toBe(true);
19
- });
20
- });
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "extends": "@layerzerolabs/typescript-configuration/tsconfig.base.json",
3
- "compilerOptions": {
4
- "rootDir": "./src",
5
- "outDir": "./dist",
6
- "strictPropertyInitialization": false,
7
- "noUnusedLocals": false,
8
- "noUnusedParameters": false,
9
- "jsx": "react-jsx"
10
- },
11
- "exclude": [
12
- "node_modules",
13
- "**/__mocks__/*",
14
- "**/__tests__/*",
15
- "**/*.spec.ts",
16
- "**/*.test.ts",
17
- "dist"
18
- ],
19
- "include": ["src/**/*"]
20
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "incremental": false,
5
- "noEmit": true,
6
- "rootDir": "."
7
- },
8
- "include": ["**/*"],
9
- "exclude": ["dist", "node_modules"]
10
- }
package/tsup.config.ts DELETED
@@ -1,8 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
-
3
- import { createPackageTsupConfig } from '@layerzerolabs/tsup-configuration';
4
-
5
- export default defineConfig(({ watch }) => ({
6
- ...createPackageTsupConfig(),
7
- clean: !watch,
8
- }));
package/vitest.config.ts DELETED
@@ -1,3 +0,0 @@
1
- import { defineConfig } from './src';
2
-
3
- export default defineConfig();