chore: standardize package references (#9346)
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
"private": true,
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
"./blocksuite": "./src/blocksuite/index.ts",
|
||||
"./storage": "./src/storage/index.ts",
|
||||
"./utils": "./src/utils/index.ts",
|
||||
"./app-config-storage": "./src/app-config-storage.ts",
|
||||
@@ -15,7 +14,6 @@
|
||||
"@affine/debug": "workspace:*",
|
||||
"@affine/env": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@blocksuite/affine": "workspace:*",
|
||||
"@datastructures-js/binary-search-tree": "^5.3.2",
|
||||
"eventemitter2": "^6.4.9",
|
||||
"foxact": "^0.2.43",
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export * from './blocks';
|
||||
@@ -1,6 +1,5 @@
|
||||
export * from './app-config-storage';
|
||||
export * from './atom';
|
||||
export * from './blocksuite';
|
||||
export * from './framework';
|
||||
export * from './initialization';
|
||||
export * from './livedata';
|
||||
|
||||
30
packages/frontend/apps/electron-renderer/package.json
Normal file
30
packages/frontend/apps/electron-renderer/package.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "@affine/electron-renderer",
|
||||
"private": true,
|
||||
"version": "0.18.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "affine bundle",
|
||||
"dev": "affine bundle --dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@affine/component": "workspace:*",
|
||||
"@affine/core": "workspace:*",
|
||||
"@affine/electron-api": "workspace:*",
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@sentry/react": "^8.44.0",
|
||||
"@vanilla-extract/css": "^1.16.1",
|
||||
"next-themes": "^0.4.4",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^6.28.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@affine-tools/utils": "workspace:*",
|
||||
"@types/react": "^19.0.1",
|
||||
"@types/react-dom": "^19.0.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ function main() {
|
||||
}
|
||||
|
||||
function mountApp() {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
// oxlint-disable-next-line typescript-eslint/no-non-null-assertion
|
||||
const root = document.getElementById('app')!;
|
||||
createRoot(root).render(
|
||||
<StrictMode>
|
||||
17
packages/frontend/apps/electron-renderer/tsconfig.json
Normal file
17
packages/frontend/apps/electron-renderer/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "../../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"outDir": "lib",
|
||||
"moduleResolution": "Bundler",
|
||||
"types": ["affine__env"],
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["./src"],
|
||||
"references": [
|
||||
{ "path": "../../core" },
|
||||
{
|
||||
"path": "../../electron-api"
|
||||
}
|
||||
]
|
||||
}
|
||||
21
packages/frontend/apps/electron-renderer/tsconfig.test.json
Normal file
21
packages/frontend/apps/electron-renderer/tsconfig.test.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"extends": "../../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "Node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noEmit": false,
|
||||
"outDir": "./lib/tests",
|
||||
"types": ["node", "affine__env"],
|
||||
"allowJs": true
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.json"
|
||||
}
|
||||
],
|
||||
"include": ["./test"]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export const config = {
|
||||
entry: {
|
||||
app: './src/index.tsx',
|
||||
shell: './src/shell/index.tsx',
|
||||
},
|
||||
};
|
||||
@@ -16,7 +16,6 @@
|
||||
"dev:prod": "node ./scripts/dev.ts",
|
||||
"build": "cross-env NODE_ENV=production node ./scripts/build-layers.ts",
|
||||
"build:dev": "node ./scripts/build-layers.ts",
|
||||
"bundle": "affine bundle",
|
||||
"generate-assets": "node ./scripts/generate-assets.ts",
|
||||
"package": "electron-forge package",
|
||||
"make": "electron-forge make",
|
||||
@@ -26,13 +25,8 @@
|
||||
"devDependencies": {
|
||||
"@affine-test/kit": "workspace:*",
|
||||
"@affine-tools/utils": "workspace:*",
|
||||
"@affine/component": "workspace:*",
|
||||
"@affine/core": "workspace:*",
|
||||
"@affine/electron-api": "workspace:*",
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@affine/native": "workspace:*",
|
||||
"@affine/nbstore": "workspace:*",
|
||||
"@blocksuite/affine": "workspace:*",
|
||||
"@electron-forge/cli": "^7.6.0",
|
||||
"@electron-forge/core": "^7.6.0",
|
||||
"@electron-forge/core-utils": "^7.6.0",
|
||||
@@ -43,7 +37,6 @@
|
||||
"@electron-forge/maker-zip": "^7.6.0",
|
||||
"@electron-forge/plugin-auto-unpack-natives": "^7.6.0",
|
||||
"@electron-forge/shared-types": "^7.6.0",
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@pengx17/electron-forge-maker-appimage": "^1.2.1",
|
||||
"@sentry/electron": "^5.8.0",
|
||||
"@sentry/esbuild-plugin": "^2.22.7",
|
||||
@@ -51,7 +44,6 @@
|
||||
"@toeverything/infra": "workspace:*",
|
||||
"@types/set-cookie-parser": "^2.4.10",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@vanilla-extract/css": "^1.16.1",
|
||||
"@vitejs/plugin-react-swc": "^3.7.2",
|
||||
"app-builder-lib": "^25.1.8",
|
||||
"builder-util-runtime": "^9.2.10",
|
||||
@@ -67,9 +59,6 @@
|
||||
"lodash-es": "^4.17.21",
|
||||
"msw": "^2.6.8",
|
||||
"nanoid": "^5.0.9",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^6.28.0",
|
||||
"rxjs": "^7.8.1",
|
||||
"semver": "^7.6.3",
|
||||
"tree-kill": "^1.2.2",
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"extends": "../../../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "Bundler",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noEmit": false,
|
||||
"outDir": "../lib",
|
||||
"allowJs": true
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../../../../common/env"
|
||||
},
|
||||
{
|
||||
"path": "../../../core"
|
||||
},
|
||||
{
|
||||
"path": "../../../component"
|
||||
},
|
||||
{
|
||||
"path": "../../../../common/infra"
|
||||
}
|
||||
],
|
||||
"include": ["."],
|
||||
"exclude": ["dist"]
|
||||
}
|
||||
@@ -17,8 +17,7 @@ const webDir = path.join(
|
||||
'packages',
|
||||
'frontend',
|
||||
'apps',
|
||||
'electron',
|
||||
'renderer'
|
||||
'electron-renderer'
|
||||
);
|
||||
const affineWebOutDir = path.join(webDir, 'dist');
|
||||
const publicAffineOutDir = path.join(publicDistDir, `web-static`);
|
||||
|
||||
@@ -36,7 +36,7 @@ export const AIChatBlockSchema = defineBlockSchema({
|
||||
export class AIChatBlockModel extends GfxCompatible<AIChatProps>(BlockModel) {}
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
// oxlint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace BlockSuite {
|
||||
interface EdgelessBlockModelMap {
|
||||
'affine:embed-ai-chat': AIChatBlockModel;
|
||||
@@ -25,9 +25,9 @@ import {
|
||||
type SerializedXYWH,
|
||||
} from '@blocksuite/affine/global/utils';
|
||||
import type { Doc } from '@blocksuite/affine/store';
|
||||
import type { ChatMessage } from '@toeverything/infra/blocksuite';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
import type { ChatMessage } from '../../../blocks';
|
||||
import { insertFromMarkdown } from '../../_common';
|
||||
import { AIProvider, type AIUserInfo } from '../provider';
|
||||
import { reportResponse } from '../utils/action-reporter';
|
||||
|
||||
@@ -16,9 +16,9 @@ import {
|
||||
import { assertExists } from '@blocksuite/affine/global/utils';
|
||||
import { Slice } from '@blocksuite/affine/store';
|
||||
import { GfxControllerIdentifier } from '@blocksuite/block-std/gfx';
|
||||
import { AIChatBlockModel } from '@toeverything/infra';
|
||||
import type { TemplateResult } from 'lit';
|
||||
|
||||
import { AIChatBlockModel } from '../../../blocks';
|
||||
import { getContentFromSlice } from '../../_common';
|
||||
import { AIProvider } from '../provider';
|
||||
import { reportResponse } from '../utils/action-reporter';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { EditorHost } from '@blocksuite/affine/block-std';
|
||||
import { type AIError, openFileOrFiles } from '@blocksuite/affine/blocks';
|
||||
import type { ChatMessage } from '@toeverything/infra';
|
||||
import { css, html, LitElement, nothing } from 'lit';
|
||||
import { property, query, state } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
|
||||
import type { ChatMessage } from '../../../blocks';
|
||||
import {
|
||||
ChatAbortIcon,
|
||||
ChatClearIcon,
|
||||
|
||||
@@ -8,16 +8,16 @@ import {
|
||||
NotificationProvider,
|
||||
TelemetryProvider,
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import {
|
||||
type AIChatBlockModel,
|
||||
type ChatMessage,
|
||||
ChatMessagesSchema,
|
||||
} from '@toeverything/infra/blocksuite';
|
||||
import { html, LitElement, nothing } from 'lit';
|
||||
import { property, query, state } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
|
||||
import {
|
||||
type AIChatBlockModel,
|
||||
type ChatMessage,
|
||||
ChatMessagesSchema,
|
||||
} from '../../../blocks';
|
||||
import {
|
||||
ChatBlockPeekViewActions,
|
||||
constructUserInfoWithMessages,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { AIError } from '@blocksuite/affine/blocks';
|
||||
import type { ChatMessage } from '@toeverything/infra/blocksuite';
|
||||
|
||||
import type { ChatMessage } from '../../../blocks';
|
||||
|
||||
export type ChatStatus =
|
||||
| 'success'
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import type { EdgelessRootService } from '@blocksuite/affine/blocks';
|
||||
import { Bound } from '@blocksuite/affine/global/utils';
|
||||
|
||||
import {
|
||||
type AIChatBlockModel,
|
||||
CHAT_BLOCK_HEIGHT,
|
||||
CHAT_BLOCK_WIDTH,
|
||||
} from '@toeverything/infra';
|
||||
} from '../../../blocks';
|
||||
|
||||
/**
|
||||
* Calculates the bounding box for a child block
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { BlockComponent } from '@blocksuite/affine/block-std';
|
||||
import { Peekable } from '@blocksuite/affine/blocks';
|
||||
import { computed } from '@preact/signals-core';
|
||||
import {
|
||||
type AIChatBlockModel,
|
||||
ChatMessagesSchema,
|
||||
} from '@toeverything/infra/blocksuite';
|
||||
import { html } from 'lit';
|
||||
|
||||
import { type AIChatBlockModel, ChatMessagesSchema } from '../../../blocks';
|
||||
import { ChatWithAIIcon } from '../_common/icon';
|
||||
import { AIChatBlockStyles } from './styles';
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import type { EditorHost } from '@blocksuite/block-std';
|
||||
import type { AffineAIPanelState } from '@blocksuite/blocks';
|
||||
import type {
|
||||
ChatMessage,
|
||||
MessageRole,
|
||||
MessageUserInfo,
|
||||
} from '@toeverything/infra/blocksuite';
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
import { classMap } from 'lit/directives/class-map.js';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
|
||||
import type {
|
||||
ChatMessage,
|
||||
MessageRole,
|
||||
MessageUserInfo,
|
||||
} from '../../../../blocks';
|
||||
import type { TextRendererOptions } from '../../../_common/components/text-renderer';
|
||||
import { UserInfoTemplate } from './user-info';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { MessageRole, MessageUserInfo } from '@toeverything/infra';
|
||||
import { baseTheme } from '@toeverything/theme';
|
||||
import { css, html, LitElement, type TemplateResult, unsafeCSS } from 'lit';
|
||||
import { property } from 'lit/decorators.js';
|
||||
|
||||
import type { MessageRole, MessageUserInfo } from '../../../../blocks';
|
||||
import { AffineAIIcon } from '../../_common/icon';
|
||||
|
||||
export class UserInfo extends LitElement {
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
toReactNode,
|
||||
type useConfirmModal,
|
||||
} from '@affine/component';
|
||||
import { AIChatBlockSchema } from '@affine/core/blocksuite/blocks';
|
||||
import { AttachmentPreviewErrorBoundary } from '@affine/core/components/attachment-viewer/error';
|
||||
import { PDFViewerEmbedded } from '@affine/core/components/attachment-viewer/pdf-viewer-embedded';
|
||||
import { buildAttachmentProps } from '@affine/core/components/attachment-viewer/utils';
|
||||
@@ -66,11 +67,7 @@ import {
|
||||
import { Bound } from '@blocksuite/affine/global/utils';
|
||||
import { type BlockSnapshot, Text } from '@blocksuite/affine/store';
|
||||
import type { ReferenceParams } from '@blocksuite/affine-model';
|
||||
import {
|
||||
AIChatBlockSchema,
|
||||
type DocProps,
|
||||
type FrameworkProvider,
|
||||
} from '@toeverything/infra';
|
||||
import { type DocProps, type FrameworkProvider } from '@toeverything/infra';
|
||||
import { type TemplateResult } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
import { literal } from 'lit/static-html.js';
|
||||
|
||||
@@ -10,11 +10,11 @@ import type {
|
||||
} from '@blocksuite/affine/blocks';
|
||||
import { AffineReference } from '@blocksuite/affine/blocks';
|
||||
import type { Block, BlockModel } from '@blocksuite/affine/store';
|
||||
import type { AIChatBlockModel } from '@toeverything/infra';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
import type { TemplateResult } from 'lit';
|
||||
import { firstValueFrom, map, race } from 'rxjs';
|
||||
|
||||
import type { AIChatBlockModel } from '../../../blocksuite/blocks';
|
||||
import { resolveLinkToDoc } from '../../navigation';
|
||||
import type { WorkbenchService } from '../../workbench';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { AffineSchemas } from '@blocksuite/affine/blocks/schemas';
|
||||
import { Schema } from '@blocksuite/affine/store';
|
||||
import { AIChatBlockSchema } from '@toeverything/infra';
|
||||
|
||||
import { AIChatBlockSchema } from '../../blocksuite/blocks';
|
||||
|
||||
let _schema: Schema | null = null;
|
||||
export function getAFFiNEWorkspaceSchema() {
|
||||
|
||||
Reference in New Issue
Block a user