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