mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 12:44:07 -08:00
ci(editor): Enforce type-safety in @n8n/chat builds as well (no-changelog) (#9685)
This commit is contained in:
parent
810991156b
commit
63e42b9b52
|
@ -3,8 +3,8 @@
|
|||
"version": "0.16.0",
|
||||
"scripts": {
|
||||
"dev": "pnpm run storybook",
|
||||
"build": "pnpm type-check && pnpm build:vite && pnpm run build:individual && npm run build:prepare",
|
||||
"build:full": "pnpm type-check && pnpm build:vite && pnpm build:vite:full && pnpm run build:individual && npm run build:prepare",
|
||||
"build": "pnpm build:vite && pnpm run build:individual && npm run build:prepare",
|
||||
"build:full": "pnpm build:vite && pnpm build:vite:full && pnpm run build:individual && npm run build:prepare",
|
||||
"build:vite": "vite build",
|
||||
"build:vite:full": "INCLUDE_VUE=true vite build",
|
||||
"build:individual": "unbuild",
|
||||
|
@ -13,7 +13,7 @@
|
|||
"preview": "vite preview",
|
||||
"test:dev": "vitest",
|
||||
"test": "vitest run --coverage",
|
||||
"type-check": "vue-tsc --noEmit -p tsconfig.json --composite false",
|
||||
"typecheck": "vue-tsc --noEmit",
|
||||
"lint": "eslint . --ext .js,.ts,.vue --quiet",
|
||||
"lintfix": "eslint . --ext .js,.ts,.vue --fix",
|
||||
"format": "prettier --write src/",
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import { fileURLToPath, URL } from 'node:url';
|
||||
|
||||
import { defineConfig } from 'vite';
|
||||
import checker from 'vite-plugin-checker';
|
||||
import { resolve } from 'path';
|
||||
|
@ -8,7 +6,7 @@ import icons from 'unplugin-icons/vite';
|
|||
import dts from 'vite-plugin-dts';
|
||||
|
||||
const includeVue = process.env.INCLUDE_VUE === 'true';
|
||||
const srcPath = fileURLToPath(new URL('./src', import.meta.url));
|
||||
const srcPath = resolve(__dirname, 'src');
|
||||
|
||||
const plugins = [
|
||||
vue(),
|
||||
|
@ -18,7 +16,7 @@ const plugins = [
|
|||
}),
|
||||
dts(),
|
||||
];
|
||||
if (process.env.ENABLE_TYPE_CHECKING === 'true') {
|
||||
if (!process.env.VITEST) {
|
||||
plugins.push(checker({ vueTsc: true }));
|
||||
}
|
||||
|
30
packages/@n8n/chat/vitest.config.mts
Normal file
30
packages/@n8n/chat/vitest.config.mts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { resolve } from 'path';
|
||||
import { mergeConfig } from 'vite';
|
||||
import { type UserConfig } from 'vitest';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import viteConfig from './vite.config.mts';
|
||||
|
||||
const srcPath = resolve(__dirname, 'src');
|
||||
const vitestConfig = defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
root: srcPath,
|
||||
setupFiles: ['./src/__tests__/setup.ts'],
|
||||
...(process.env.COVERAGE_ENABLED === 'true'
|
||||
? {
|
||||
coverage: {
|
||||
enabled: true,
|
||||
provider: 'v8',
|
||||
reporter: process.env.CI === 'true' ? 'cobertura' : 'text-summary',
|
||||
all: true,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
}) as UserConfig;
|
||||
|
||||
export default mergeConfig(
|
||||
viteConfig,
|
||||
vitestConfig,
|
||||
);
|
|
@ -1,20 +0,0 @@
|
|||
import { fileURLToPath } from 'node:url';
|
||||
import { mergeConfig, defineConfig } from 'vite';
|
||||
import { configDefaults } from 'vitest/config';
|
||||
import viteConfig from './vite.config';
|
||||
|
||||
export default mergeConfig(
|
||||
viteConfig,
|
||||
defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
exclude: [...configDefaults.exclude, 'e2e/*'],
|
||||
root: fileURLToPath(new URL('./', import.meta.url)),
|
||||
setupFiles: ['./src/__tests__/setup.ts'],
|
||||
transformMode: {
|
||||
web: [/\.[jt]sx$/],
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
Loading…
Reference in a new issue