mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat: isolated plugin system (#2742)
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
"@radix-ui/react-radio-group": "^1.1.3",
|
||||
"@radix-ui/react-toast": "^1.1.4",
|
||||
"@toeverything/hooks": "workspace:*",
|
||||
"@toeverything/plugin-infra": "workspace:*",
|
||||
"@toeverything/theme": "^0.6.1",
|
||||
"@vanilla-extract/dynamic": "^2.0.3",
|
||||
"clsx": "^1.2.1",
|
||||
|
||||
23
packages/component/src/components/context/index.tsx
Normal file
23
packages/component/src/components/context/index.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ProviderComposer } from '@affine/component/provider-composer';
|
||||
import { ThemeProvider } from '@affine/component/theme-provider';
|
||||
import { rootStore } from '@toeverything/plugin-infra/manager';
|
||||
import { Provider } from 'jotai';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
export function AffineContext(props: PropsWithChildren) {
|
||||
return (
|
||||
<ProviderComposer
|
||||
contexts={useMemo(
|
||||
() =>
|
||||
[
|
||||
<Provider key="JotaiProvider" store={rootStore} />,
|
||||
<ThemeProvider key="ThemeProvider" />,
|
||||
].filter(Boolean),
|
||||
[]
|
||||
)}
|
||||
>
|
||||
{props.children}
|
||||
</ProviderComposer>
|
||||
);
|
||||
}
|
||||
@@ -20,10 +20,10 @@
|
||||
{
|
||||
"path": "../hooks"
|
||||
},
|
||||
{ "path": "../workspace" },
|
||||
{
|
||||
"path": "../../apps/electron"
|
||||
"path": "../plugin-infra"
|
||||
},
|
||||
{ "path": "../workspace" },
|
||||
{ "path": "../../tests/fixtures" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
// to prevent the `@affine/components` contains circular references with `@affine/workspace`
|
||||
// the include files should be excluded in `./tsconfig.json`
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"noEmit": false,
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": [
|
||||
"./src/components/page-list/filter/shared-types.tsx",
|
||||
"./src/components/page-list/filter/logical/custom-type.ts",
|
||||
"./src/components/page-list/filter/logical/matcher.ts",
|
||||
"./src/components/page-list/filter/logical/typesystem.ts"
|
||||
],
|
||||
"references": [{ "path": "../env" }],
|
||||
"exclude": ["lib"]
|
||||
}
|
||||
Reference in New Issue
Block a user