@n8n/vitest-config 1.3.0 → 1.5.0

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.
Files changed (2) hide show
  1. package/package.json +26 -6
  2. package/frontend.mjs +0 -42
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/vitest-config",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "vite": "^6.3.5",
@@ -8,20 +8,31 @@
8
8
  },
9
9
  "devDependencies": {
10
10
  "vite": "^6.3.5",
11
- "vitest": "^3.1.3"
11
+ "vitest": "^3.1.3",
12
+ "@n8n/typescript-config": "1.3.0"
12
13
  },
13
14
  "files": [
15
+ "backend.mjs",
14
16
  "frontend.mjs",
15
17
  "LICENSE.md",
16
18
  "LICENSE_EE.md"
17
19
  ],
18
20
  "exports": {
21
+ "./backend": {
22
+ "import": "./backend.mjs",
23
+ "require": "./backend.mjs",
24
+ "types": "./backend.d.ts"
25
+ },
19
26
  "./frontend": {
20
- "import": "./frontend.mjs",
21
- "require": "./frontend.mjs",
22
- "types": "./frontend.d.ts"
27
+ "import": "./dist/frontend.js",
28
+ "require": "./dist/frontend.js",
29
+ "types": "./dist/frontend.d.ts"
23
30
  },
24
- "./*": "./*"
31
+ "./node": {
32
+ "import": "./dist/node.js",
33
+ "require": "./dist/node.js",
34
+ "types": "./dist/node.d.ts"
35
+ }
25
36
  },
26
37
  "license": "SEE LICENSE IN LICENSE.md",
27
38
  "homepage": "https://n8n.io",
@@ -32,5 +43,14 @@
32
43
  "repository": {
33
44
  "type": "git",
34
45
  "url": "git+https://github.com/n8n-io/n8n.git"
46
+ },
47
+ "scripts": {
48
+ "clean": "rimraf dist .turbo",
49
+ "dev": "pnpm watch",
50
+ "typecheck": "tsc --noEmit",
51
+ "build": "tsc -p tsconfig.build.json",
52
+ "format": "biome format --write .",
53
+ "format:check": "biome ci .",
54
+ "watch": "tsc -p tsconfig.build.json --watch"
35
55
  }
36
56
  }
package/frontend.mjs DELETED
@@ -1,42 +0,0 @@
1
- import { defineConfig as defineVitestConfig } from 'vitest/config';
2
-
3
- /**
4
- * Define a Vitest configuration
5
- * @param {import('vitest/node').InlineConfig} options - The options to pass to the Vitest configuration
6
- * @returns {import('vite').UserConfig}
7
- */
8
- export const createVitestConfig = (options = {}) => {
9
- const vitestConfig = defineVitestConfig({
10
- test: {
11
- silent: true,
12
- globals: true,
13
- environment: 'jsdom',
14
- setupFiles: ['./src/__tests__/setup.ts'],
15
- coverage: {
16
- enabled: false,
17
- all: false,
18
- provider: 'v8',
19
- reporter: ['text-summary', 'lcov', 'html-spa'],
20
- },
21
- css: {
22
- modules: {
23
- classNameStrategy: 'non-scoped',
24
- },
25
- },
26
- ...options,
27
- },
28
- });
29
-
30
- if (process.env.COVERAGE_ENABLED === 'true') {
31
- const { coverage } = vitestConfig.test;
32
- coverage.enabled = true;
33
- if (process.env.CI === 'true') {
34
- coverage.all = true;
35
- coverage.reporter = ['cobertura'];
36
- }
37
- }
38
-
39
- return vitestConfig;
40
- };
41
-
42
- export const vitestConfig = createVitestConfig();