mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-23 01:05:23 +03:00
ec8b2cc32a
## Features - https://github.com/toeverything/BlockSuite/pull/7264 @CatsJuice - https://github.com/toeverything/BlockSuite/pull/7182 @CatsJuice - https://github.com/toeverything/BlockSuite/pull/7181 @CatsJuice ## Bugfix - https://github.com/toeverything/BlockSuite/pull/7273 @L-Sun - https://github.com/toeverything/BlockSuite/pull/7272 @doouding - https://github.com/toeverything/BlockSuite/pull/7263 @doouding - https://github.com/toeverything/BlockSuite/pull/7252 @fourdim - https://github.com/toeverything/BlockSuite/pull/7261 @fundon ## Refactor - https://github.com/toeverything/BlockSuite/pull/7271 @golok727 ## Misc - https://github.com/toeverything/BlockSuite/pull/7274 @Saul-Mirone - https://github.com/toeverything/BlockSuite/pull/7266 @Saul-Mirone
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import { resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
|
|
import react from '@vitejs/plugin-react-swc';
|
|
import * as fg from 'fast-glob';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
const rootDir = fileURLToPath(new URL('.', import.meta.url));
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
react({
|
|
tsDecorators: true,
|
|
}),
|
|
vanillaExtractPlugin(),
|
|
],
|
|
assetsInclude: ['**/*.md', '**/*.zip'],
|
|
resolve: {
|
|
alias: {
|
|
// prevent tests using two different sources of yjs
|
|
yjs: resolve(rootDir, 'node_modules/yjs'),
|
|
'@affine/core': fileURLToPath(
|
|
new URL('./packages/frontend/core/src', import.meta.url)
|
|
),
|
|
},
|
|
},
|
|
test: {
|
|
setupFiles: [
|
|
resolve(rootDir, './scripts/setup/lit.ts'),
|
|
resolve(rootDir, './scripts/setup/vi-mock.ts'),
|
|
resolve(rootDir, './scripts/setup/global.ts'),
|
|
],
|
|
include: [
|
|
// rootDir cannot be used as a pattern on windows
|
|
fg.convertPathToPattern(rootDir) +
|
|
'packages/{common,frontend}/**/*.spec.{ts,tsx}',
|
|
],
|
|
exclude: [
|
|
'**/node_modules',
|
|
'**/dist',
|
|
'**/build',
|
|
'**/out,',
|
|
'**/packages/frontend/electron',
|
|
],
|
|
testTimeout: 5000,
|
|
coverage: {
|
|
all: false,
|
|
provider: 'istanbul', // or 'c8'
|
|
reporter: ['lcov'],
|
|
reportsDirectory: resolve(rootDir, '.coverage/store'),
|
|
},
|
|
server: {
|
|
deps: {
|
|
inline: ['@blocksuite/blocks'],
|
|
},
|
|
},
|
|
},
|
|
});
|