Skip to content

Commit

Permalink
ci(editor): Enforce type-safety in @n8n/chat builds as well (no-chang…
Browse files Browse the repository at this point in the history
…elog) (#9685)
  • Loading branch information
netroy authored Jun 11, 2024
1 parent 8109911 commit 63e42b9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 27 deletions.
6 changes: 3 additions & 3 deletions packages/@n8n/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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/",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { fileURLToPath, URL } from 'node:url';

import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';
import { resolve } from 'path';
Expand All @@ -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(),
Expand All @@ -18,7 +16,7 @@ const plugins = [
}),
dts(),
];
if (process.env.ENABLE_TYPE_CHECKING === 'true') {
if (!process.env.VITEST) {
plugins.push(checker({ vueTsc: true }));
}

Expand Down
30 changes: 30 additions & 0 deletions packages/@n8n/chat/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -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,
);
20 changes: 0 additions & 20 deletions packages/@n8n/chat/vitest.config.ts

This file was deleted.

0 comments on commit 63e42b9

Please sign in to comment.