refactor: remove unused package (#4291)

This commit is contained in:
Alex Yang
2023-09-08 17:00:26 -07:00
committed by GitHub
parent e00f40537b
commit 162016884c
26 changed files with 31 additions and 100 deletions

View File

@@ -17,7 +17,6 @@
"cli",
"hooks",
"i18n",
"jotai",
"native",
"templates",
"y-indexeddb",

View File

@@ -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
View File

@@ -46,7 +46,6 @@ mod:storage: 'packages/storage/**/*'
mod:native: 'packages/native/**/*'
mod:store:
- 'packages/jotai/**/*'
- '**/atoms/**/*'
rust:

View File

@@ -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",

View File

@@ -26,9 +26,6 @@
{
"path": "../../packages/i18n"
},
{
"path": "../../packages/jotai"
},
{
"path": "../../packages/workspace"
},

View File

@@ -5,7 +5,7 @@ import type {
UIHandlerManager,
UnwrapManagerHandlerToServerSide,
UpdaterHandlerManager,
} from '@toeverything/infra';
} from '@toeverything/infra/index';
import { ipcMain } from 'electron';
import { clipboardHandlers } from './clipboard';

View File

@@ -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",

View File

@@ -24,9 +24,6 @@
{
"path": "../../packages/i18n"
},
{
"path": "../../packages/jotai"
},
{
"path": "../../packages/y-indexeddb"
},

View File

@@ -9,7 +9,7 @@ import type {
UnwrapManagerHandlerToClientSide,
UpdaterHandlerManager,
WorkspaceHandlerManager,
} from '@toeverything/infra';
} from '@toeverything/infra/index';
declare global {
interface Window {

View File

@@ -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",

View File

@@ -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';

View File

@@ -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) {

View File

@@ -14,9 +14,6 @@
{
"path": "../i18n"
},
{
"path": "../jotai"
},
{
"path": "../hooks"
},

View File

@@ -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';

View File

@@ -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"
}
]
}

View File

@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node"]
},
"include": ["./src/scripts"]
}

View File

@@ -1 +0,0 @@
lib

View File

@@ -1,3 +0,0 @@
# @affine/jotai
Custom Jotai utilities.

View File

@@ -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"
}

View File

@@ -1 +0,0 @@
export * from './resource';

View File

@@ -1,3 +0,0 @@
import { atom } from 'jotai';
export const lottieAtom = atom(import('lottie-web').then(m => m.default));

View File

@@ -1,9 +0,0 @@
{
"extends": "../../tsconfig.json",
"include": ["./src"],
"compilerOptions": {
"composite": true,
"noEmit": false,
"outDir": "lib"
}
}

View File

@@ -3,7 +3,8 @@
"compilerOptions": {
"noEmit": false,
"outDir": "lib",
"composite": true
"composite": true,
"types": ["node"]
},
"include": ["index.d.ts", "__tests__/**/*.mts"],
"ts-node": {

View File

@@ -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', {

View File

@@ -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"],

View File

@@ -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