ci(editor): Enforce type-safety in @n8n/chat builds as well (no-changelog) (#9685)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-06-11 11:23:36 +02:00 committed by GitHub
parent 810991156b
commit 63e42b9b52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 27 deletions

View file

@ -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/",

View file

@ -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 }));
}

View 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,
);

View file

@ -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$/],
},
},
}),
);