mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-24 04:27:27 +08:00
refactor: remove unused package (#4291)
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
"cli",
|
"cli",
|
||||||
"hooks",
|
"hooks",
|
||||||
"i18n",
|
"i18n",
|
||||||
"jotai",
|
|
||||||
"native",
|
"native",
|
||||||
"templates",
|
"templates",
|
||||||
"y-indexeddb",
|
"y-indexeddb",
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ const allPackages = [
|
|||||||
'packages/graphql',
|
'packages/graphql',
|
||||||
'packages/hooks',
|
'packages/hooks',
|
||||||
'packages/i18n',
|
'packages/i18n',
|
||||||
'packages/jotai',
|
|
||||||
'packages/native',
|
'packages/native',
|
||||||
'packages/infra',
|
'packages/infra',
|
||||||
'packages/sdk',
|
'packages/sdk',
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ mod:storage: 'packages/storage/**/*'
|
|||||||
mod:native: 'packages/native/**/*'
|
mod:native: 'packages/native/**/*'
|
||||||
|
|
||||||
mod:store:
|
mod:store:
|
||||||
- 'packages/jotai/**/*'
|
|
||||||
- '**/atoms/**/*'
|
- '**/atoms/**/*'
|
||||||
|
|
||||||
rust:
|
rust:
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
"@affine/env": "workspace:*",
|
"@affine/env": "workspace:*",
|
||||||
"@affine/graphql": "workspace:*",
|
"@affine/graphql": "workspace:*",
|
||||||
"@affine/i18n": "workspace:*",
|
"@affine/i18n": "workspace:*",
|
||||||
"@affine/jotai": "workspace:*",
|
|
||||||
"@affine/templates": "workspace:*",
|
"@affine/templates": "workspace:*",
|
||||||
"@affine/workspace": "workspace:*",
|
"@affine/workspace": "workspace:*",
|
||||||
"@blocksuite/block-std": "0.0.0-20230907222710-102d1e99-nightly",
|
"@blocksuite/block-std": "0.0.0-20230907222710-102d1e99-nightly",
|
||||||
|
|||||||
@@ -26,9 +26,6 @@
|
|||||||
{
|
{
|
||||||
"path": "../../packages/i18n"
|
"path": "../../packages/i18n"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "../../packages/jotai"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "../../packages/workspace"
|
"path": "../../packages/workspace"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type {
|
|||||||
UIHandlerManager,
|
UIHandlerManager,
|
||||||
UnwrapManagerHandlerToServerSide,
|
UnwrapManagerHandlerToServerSide,
|
||||||
UpdaterHandlerManager,
|
UpdaterHandlerManager,
|
||||||
} from '@toeverything/infra';
|
} from '@toeverything/infra/index';
|
||||||
import { ipcMain } from 'electron';
|
import { ipcMain } from 'electron';
|
||||||
|
|
||||||
import { clipboardHandlers } from './clipboard';
|
import { clipboardHandlers } from './clipboard';
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
"@affine/env": "workspace:*",
|
"@affine/env": "workspace:*",
|
||||||
"@affine/graphql": "workspace:*",
|
"@affine/graphql": "workspace:*",
|
||||||
"@affine/i18n": "workspace:*",
|
"@affine/i18n": "workspace:*",
|
||||||
"@affine/jotai": "workspace:*",
|
|
||||||
"@affine/templates": "workspace:*",
|
"@affine/templates": "workspace:*",
|
||||||
"@affine/workspace": "workspace:*",
|
"@affine/workspace": "workspace:*",
|
||||||
"@blocksuite/block-std": "0.0.0-20230907222710-102d1e99-nightly",
|
"@blocksuite/block-std": "0.0.0-20230907222710-102d1e99-nightly",
|
||||||
|
|||||||
@@ -24,9 +24,6 @@
|
|||||||
{
|
{
|
||||||
"path": "../../packages/i18n"
|
"path": "../../packages/i18n"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "../../packages/jotai"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "../../packages/y-indexeddb"
|
"path": "../../packages/y-indexeddb"
|
||||||
},
|
},
|
||||||
|
|||||||
Vendored
+1
-1
@@ -9,7 +9,7 @@ import type {
|
|||||||
UnwrapManagerHandlerToClientSide,
|
UnwrapManagerHandlerToClientSide,
|
||||||
UpdaterHandlerManager,
|
UpdaterHandlerManager,
|
||||||
WorkspaceHandlerManager,
|
WorkspaceHandlerManager,
|
||||||
} from '@toeverything/infra';
|
} from '@toeverything/infra/index';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@affine/debug": "workspace:*",
|
"@affine/debug": "workspace:*",
|
||||||
"@affine/i18n": "workspace:*",
|
"@affine/i18n": "workspace:*",
|
||||||
"@affine/jotai": "workspace:*",
|
|
||||||
"@affine/workspace": "workspace:*",
|
"@affine/workspace": "workspace:*",
|
||||||
"@dnd-kit/core": "^6.0.8",
|
"@dnd-kit/core": "^6.0.8",
|
||||||
"@dnd-kit/modifiers": "^6.0.1",
|
"@dnd-kit/modifiers": "^6.0.1",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { isBrowser } from '@affine/env/constant';
|
import { isBrowser } from '@affine/env/constant';
|
||||||
import type { UpdateMeta } from '@toeverything/infra';
|
import type { UpdateMeta } from '@toeverything/infra/type';
|
||||||
import { atomWithObservable, atomWithStorage } from 'jotai/utils';
|
import { atomWithObservable, atomWithStorage } from 'jotai/utils';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { lottieAtom } from '@affine/jotai';
|
|
||||||
import { useAtomValue } from 'jotai';
|
|
||||||
import type { AnimationItem } from 'lottie-web';
|
import type { AnimationItem } from 'lottie-web';
|
||||||
|
import lottie from 'lottie-web';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
interface CustomLottieProps {
|
interface CustomLottieProps {
|
||||||
@@ -28,7 +27,6 @@ export const InternalLottie = ({
|
|||||||
}: CustomLottieProps) => {
|
}: CustomLottieProps) => {
|
||||||
const element = useRef<HTMLDivElement>(null);
|
const element = useRef<HTMLDivElement>(null);
|
||||||
const lottieInstance = useRef<AnimationItem>();
|
const lottieInstance = useRef<AnimationItem>();
|
||||||
const lottie = useAtomValue(lottieAtom);
|
|
||||||
const directionRef = useRef<1 | -1>(1);
|
const directionRef = useRef<1 | -1>(1);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -76,7 +74,7 @@ export const InternalLottie = ({
|
|||||||
}
|
}
|
||||||
lottieInstance.current?.destroy();
|
lottieInstance.current?.destroy();
|
||||||
};
|
};
|
||||||
}, [lottie, options]);
|
}, [options]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (speed) {
|
if (speed) {
|
||||||
|
|||||||
@@ -14,9 +14,6 @@
|
|||||||
{
|
{
|
||||||
"path": "../i18n"
|
"path": "../i18n"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "../jotai"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "../hooks"
|
"path": "../hooks"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
// cSpell:ignore Tolgee
|
// cSpell:ignore Tolgee
|
||||||
|
import { readFile } from 'node:fs/promises';
|
||||||
import { resolve } from 'node:path';
|
import { resolve } from 'node:path';
|
||||||
|
|
||||||
import { readFile } from 'fs/promises';
|
|
||||||
|
|
||||||
import { createsNewKey, getRemoteTranslations } from './api.js';
|
import { createsNewKey, getRemoteTranslations } from './api.js';
|
||||||
import type { TranslationRes } from './utils.js';
|
import type { TranslationRes } from './utils.js';
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"include": ["./src"],
|
"include": ["./src"],
|
||||||
"exclude": ["src/resources"],
|
"exclude": ["./src/resources", "./src/scripts"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"noEmit": false,
|
"noEmit": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"outDir": "lib"
|
"outDir": "lib"
|
||||||
},
|
},
|
||||||
"references": [{ "path": "./tsconfig.resources.json" }]
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.resources.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.node.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"types": ["node"]
|
||||||
|
},
|
||||||
|
"include": ["./src/scripts"]
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
lib
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# @affine/jotai
|
|
||||||
|
|
||||||
Custom Jotai utilities.
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@affine/jotai",
|
|
||||||
"private": true,
|
|
||||||
"main": "./src/index.ts",
|
|
||||||
"dependencies": {
|
|
||||||
"jotai": "^2.4.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@blocksuite/block-std": "0.0.0-20230907222710-102d1e99-nightly",
|
|
||||||
"@blocksuite/blocks": "0.0.0-20230907222710-102d1e99-nightly",
|
|
||||||
"@blocksuite/editor": "0.0.0-20230907222710-102d1e99-nightly",
|
|
||||||
"@blocksuite/global": "0.0.0-20230907222710-102d1e99-nightly",
|
|
||||||
"@blocksuite/lit": "0.0.0-20230907222710-102d1e99-nightly",
|
|
||||||
"@blocksuite/store": "0.0.0-20230907222710-102d1e99-nightly",
|
|
||||||
"lottie-web": "^5.12.2"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@blocksuite/block-std": "*",
|
|
||||||
"@blocksuite/blocks": "*",
|
|
||||||
"@blocksuite/editor": "*",
|
|
||||||
"@blocksuite/global": "*",
|
|
||||||
"@blocksuite/lit": "*",
|
|
||||||
"@blocksuite/store": "*",
|
|
||||||
"lottie-web": "*"
|
|
||||||
},
|
|
||||||
"version": "0.9.0-canary.11"
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from './resource';
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
import { atom } from 'jotai';
|
|
||||||
|
|
||||||
export const lottieAtom = atom(import('lottie-web').then(m => m.default));
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../tsconfig.json",
|
|
||||||
"include": ["./src"],
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"noEmit": false,
|
|
||||||
"outDir": "lib"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"noEmit": false,
|
"noEmit": false,
|
||||||
"outDir": "lib",
|
"outDir": "lib",
|
||||||
"composite": true
|
"composite": true,
|
||||||
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"include": ["index.d.ts", "__tests__/**/*.mts"],
|
"include": ["index.d.ts", "__tests__/**/*.mts"],
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
|
|||||||
@@ -6,6 +6,11 @@ import { getDoc } from '@affine/y-provider';
|
|||||||
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
|
||||||
import type { Y as YType } from '@blocksuite/store';
|
import type { Y as YType } from '@blocksuite/store';
|
||||||
import { Schema, uuidv4, Workspace } from '@blocksuite/store';
|
import { Schema, uuidv4, Workspace } from '@blocksuite/store';
|
||||||
|
import type { DBHandlerManager } from '@toeverything/infra/handler';
|
||||||
|
import type {
|
||||||
|
EventMap,
|
||||||
|
UnwrapManagerHandlerToClientSide,
|
||||||
|
} from '@toeverything/infra/type';
|
||||||
import { setTimeout } from 'timers/promises';
|
import { setTimeout } from 'timers/promises';
|
||||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||||
|
|
||||||
@@ -51,7 +56,7 @@ vi.stubGlobal('window', {
|
|||||||
return [];
|
return [];
|
||||||
},
|
},
|
||||||
addBlob: mockedAddBlob,
|
addBlob: mockedAddBlob,
|
||||||
} as Partial<NonNullable<typeof window.apis>['db']>,
|
} satisfies Partial<UnwrapManagerHandlerToClientSide<DBHandlerManager>>,
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
db: {
|
db: {
|
||||||
@@ -62,7 +67,7 @@ vi.stubGlobal('window', {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as Partial<NonNullable<typeof window.events>>,
|
} as Partial<EventMap>,
|
||||||
});
|
});
|
||||||
|
|
||||||
vi.stubGlobal('environment', {
|
vi.stubGlobal('environment', {
|
||||||
|
|||||||
@@ -65,7 +65,6 @@
|
|||||||
"@affine/i18n": ["./packages/i18n/src"],
|
"@affine/i18n": ["./packages/i18n/src"],
|
||||||
"@affine/i18n/hooks": ["./packages/i18n/src/i18n-generated"],
|
"@affine/i18n/hooks": ["./packages/i18n/src/i18n-generated"],
|
||||||
"@affine/debug": ["./packages/debug"],
|
"@affine/debug": ["./packages/debug"],
|
||||||
"@affine/jotai": ["./packages/jotai"],
|
|
||||||
"@affine/env": ["./packages/env/src"],
|
"@affine/env": ["./packages/env/src"],
|
||||||
"@affine/env/*": ["./packages/env/src/*"],
|
"@affine/env/*": ["./packages/env/src/*"],
|
||||||
"@affine/utils": ["./packages/utils"],
|
"@affine/utils": ["./packages/utils"],
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ __metadata:
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@affine/debug": "workspace:*"
|
"@affine/debug": "workspace:*"
|
||||||
"@affine/i18n": "workspace:*"
|
"@affine/i18n": "workspace:*"
|
||||||
"@affine/jotai": "workspace:*"
|
|
||||||
"@affine/workspace": "workspace:*"
|
"@affine/workspace": "workspace:*"
|
||||||
"@blocksuite/blocks": 0.0.0-20230907222710-102d1e99-nightly
|
"@blocksuite/blocks": 0.0.0-20230907222710-102d1e99-nightly
|
||||||
"@blocksuite/editor": 0.0.0-20230907222710-102d1e99-nightly
|
"@blocksuite/editor": 0.0.0-20230907222710-102d1e99-nightly
|
||||||
@@ -257,7 +256,6 @@ __metadata:
|
|||||||
"@affine/env": "workspace:*"
|
"@affine/env": "workspace:*"
|
||||||
"@affine/graphql": "workspace:*"
|
"@affine/graphql": "workspace:*"
|
||||||
"@affine/i18n": "workspace:*"
|
"@affine/i18n": "workspace:*"
|
||||||
"@affine/jotai": "workspace:*"
|
|
||||||
"@affine/templates": "workspace:*"
|
"@affine/templates": "workspace:*"
|
||||||
"@affine/workspace": "workspace:*"
|
"@affine/workspace": "workspace:*"
|
||||||
"@aws-sdk/client-s3": 3.400.0
|
"@aws-sdk/client-s3": 3.400.0
|
||||||
@@ -493,29 +491,6 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@affine/jotai@workspace:*, @affine/jotai@workspace:packages/jotai":
|
|
||||||
version: 0.0.0-use.local
|
|
||||||
resolution: "@affine/jotai@workspace:packages/jotai"
|
|
||||||
dependencies:
|
|
||||||
"@blocksuite/block-std": 0.0.0-20230907222710-102d1e99-nightly
|
|
||||||
"@blocksuite/blocks": 0.0.0-20230907222710-102d1e99-nightly
|
|
||||||
"@blocksuite/editor": 0.0.0-20230907222710-102d1e99-nightly
|
|
||||||
"@blocksuite/global": 0.0.0-20230907222710-102d1e99-nightly
|
|
||||||
"@blocksuite/lit": 0.0.0-20230907222710-102d1e99-nightly
|
|
||||||
"@blocksuite/store": 0.0.0-20230907222710-102d1e99-nightly
|
|
||||||
jotai: ^2.4.1
|
|
||||||
lottie-web: ^5.12.2
|
|
||||||
peerDependencies:
|
|
||||||
"@blocksuite/block-std": "*"
|
|
||||||
"@blocksuite/blocks": "*"
|
|
||||||
"@blocksuite/editor": "*"
|
|
||||||
"@blocksuite/global": "*"
|
|
||||||
"@blocksuite/lit": "*"
|
|
||||||
"@blocksuite/store": "*"
|
|
||||||
lottie-web: "*"
|
|
||||||
languageName: unknown
|
|
||||||
linkType: soft
|
|
||||||
|
|
||||||
"@affine/monorepo@workspace:.":
|
"@affine/monorepo@workspace:.":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@affine/monorepo@workspace:."
|
resolution: "@affine/monorepo@workspace:."
|
||||||
@@ -637,7 +612,6 @@ __metadata:
|
|||||||
"@affine/env": "workspace:*"
|
"@affine/env": "workspace:*"
|
||||||
"@affine/graphql": "workspace:*"
|
"@affine/graphql": "workspace:*"
|
||||||
"@affine/i18n": "workspace:*"
|
"@affine/i18n": "workspace:*"
|
||||||
"@affine/jotai": "workspace:*"
|
|
||||||
"@affine/templates": "workspace:*"
|
"@affine/templates": "workspace:*"
|
||||||
"@affine/workspace": "workspace:*"
|
"@affine/workspace": "workspace:*"
|
||||||
"@blocksuite/block-std": 0.0.0-20230907222710-102d1e99-nightly
|
"@blocksuite/block-std": 0.0.0-20230907222710-102d1e99-nightly
|
||||||
|
|||||||
Reference in New Issue
Block a user