refactor(core): migrate ai preset to AFFiNE (#7219)

## TL;DR
Move `@blocksuite/presets/ai` to AFFiNE. After this PR is merged, you can use AI features from `@affine/core/blocksuite/presets/ai`.
This commit is contained in:
L-Sun
2024-06-18 07:31:06 +00:00
parent 0fe672efa5
commit b3ec3a2b3e
84 changed files with 17228 additions and 30 deletions
+24 -4
View File
@@ -2,18 +2,38 @@ 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 swc from 'unplugin-swc';
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('.', import.meta.url));
export default defineConfig({
plugins: [
react({
tsDecorators: true,
}),
vanillaExtractPlugin(),
// https://github.com/vitejs/vite-plugin-react-swc/issues/85#issuecomment-2003922124
swc.vite({
jsc: {
preserveAllComments: true,
parser: {
syntax: 'typescript',
dynamicImport: true,
tsx: true,
decorators: true,
},
target: 'es2022',
externalHelpers: false,
transform: {
react: {
runtime: 'automatic',
},
useDefineForClassFields: false,
decoratorVersion: '2022-03',
},
},
sourceMaps: true,
inlineSourcesContent: true,
}),
],
assetsInclude: ['**/*.md', '**/*.zip'],
resolve: {