pull:初次提交

This commit is contained in:
Yep_Q
2025-09-08 04:48:28 +08:00
parent 5c0619656d
commit f64f498365
11751 changed files with 1953723 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import { defineConfig } from 'vitest/config';
import type { InlineConfig } from 'vitest/node';
export const createVitestConfig = (options: InlineConfig = {}) => {
const vitestConfig = defineConfig({
test: {
silent: true,
globals: true,
environment: 'jsdom',
setupFiles: ['./src/__tests__/setup.ts'],
coverage: {
enabled: false,
all: false,
provider: 'v8',
reporter: ['text-summary', 'lcov', 'html-spa'],
},
css: {
modules: {
classNameStrategy: 'non-scoped',
},
},
...options,
},
});
if (process.env.COVERAGE_ENABLED === 'true' && vitestConfig.test?.coverage) {
const { coverage } = vitestConfig.test;
coverage.enabled = true;
if (process.env.CI === 'true' && coverage.provider === 'v8') {
coverage.all = true;
coverage.reporter = ['cobertura'];
}
}
return vitestConfig;
};
export const vitestConfig = createVitestConfig();

View File

@@ -0,0 +1,27 @@
import { defineConfig } from 'vitest/config';
import type { InlineConfig } from 'vitest/node';
export const createVitestConfig = (options: InlineConfig = {}) => {
const vitestConfig = defineConfig({
test: {
silent: true,
globals: true,
environment: 'node',
...(process.env.COVERAGE_ENABLED === 'true'
? {
coverage: {
enabled: true,
provider: 'v8',
reporter: process.env.CI === 'true' ? 'cobertura' : 'text-summary',
all: true,
},
}
: {}),
...options,
},
});
return vitestConfig;
};
export const vitestConfig = createVitestConfig();

View File

@@ -0,0 +1,45 @@
{
"name": "@n8n/vitest-config",
"version": "1.5.0",
"type": "module",
"peerDependencies": {
"vite": "catalog:",
"vitest": "catalog:"
},
"devDependencies": {
"@n8n/typescript-config": "workspace:*",
"vite": "catalog:",
"vitest": "catalog:"
},
"files": [
"backend.mjs",
"frontend.mjs"
],
"exports": {
"./backend": {
"import": "./backend.mjs",
"require": "./backend.mjs",
"types": "./backend.d.ts"
},
"./frontend": {
"import": "./dist/frontend.js",
"require": "./dist/frontend.js",
"types": "./dist/frontend.d.ts"
},
"./node": {
"import": "./dist/node.js",
"require": "./dist/node.js",
"types": "./dist/node.d.ts"
}
},
"scripts": {
"clean": "rimraf dist .turbo",
"dev": "pnpm watch",
"typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json",
"format": "biome format --write .",
"format:check": "biome ci .",
"watch": "tsc -p tsconfig.build.json --watch"
},
"license": "See LICENSE.md file in the root of the repository"
}

View File

@@ -0,0 +1,11 @@
{
"extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"],
"compilerOptions": {
"composite": true,
"rootDir": ".",
"outDir": "dist",
"tsBuildInfoFile": "dist/build.tsbuildinfo"
},
"include": ["**/*.ts"],
"exclude": ["dist", "**/*.test.ts"]
}

View File

@@ -0,0 +1,13 @@
{
"extends": "@n8n/typescript-config/tsconfig.common.json",
"compilerOptions": {
"rootDir": ".",
"types": ["node"],
"baseUrl": ".",
"module": "ESNext",
"moduleResolution": "bundler",
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
},
"include": ["**/*.ts"],
"exclude": ["dist"]
}