mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
fix: runtime issue for electron app (#6306)
Looks like we need to be careful to share common libraries between electron (nodejs) & web 
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"exports": {
|
"exports": {
|
||||||
|
"./blocksuite": "./src/blocksuite/index.ts",
|
||||||
|
"./app-config-storage": "./src/app-config-storage.ts",
|
||||||
".": "./src/index.ts"
|
".": "./src/index.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { InsertRow } from '@affine/native';
|
import type { InsertRow } from '@affine/native';
|
||||||
import { SqliteConnection, ValidationResult } from '@affine/native';
|
import { SqliteConnection, ValidationResult } from '@affine/native';
|
||||||
import { WorkspaceVersion } from '@toeverything/infra';
|
import { WorkspaceVersion } from '@toeverything/infra/blocksuite';
|
||||||
|
|
||||||
import { applyGuidCompatibilityFix, migrateToLatest } from '../db/migration';
|
import { applyGuidCompatibilityFix, migrateToLatest } from '../db/migration';
|
||||||
import { logger } from '../logger';
|
import { logger } from '../logger';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
migrateGuidCompatibility,
|
migrateGuidCompatibility,
|
||||||
migrateToSubdoc,
|
migrateToSubdoc,
|
||||||
WorkspaceVersion,
|
WorkspaceVersion,
|
||||||
} from '@toeverything/infra';
|
} from '@toeverything/infra/blocksuite';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
import { applyUpdate, Doc as YDoc, encodeStateAsUpdate } from 'yjs';
|
import { applyUpdate, Doc as YDoc, encodeStateAsUpdate } from 'yjs';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
|
||||||
import { ValidationResult } from '@affine/native';
|
import { ValidationResult } from '@affine/native';
|
||||||
import { WorkspaceVersion } from '@toeverything/infra';
|
import { WorkspaceVersion } from '@toeverything/infra/blocksuite';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import fs from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
|
||||||
import { AppConfigStorage, defaultAppConfig } from '@toeverything/infra';
|
import {
|
||||||
|
AppConfigStorage,
|
||||||
|
defaultAppConfig,
|
||||||
|
} from '@toeverything/infra/app-config-storage';
|
||||||
import { app } from 'electron';
|
import { app } from 'electron';
|
||||||
|
|
||||||
const FILENAME = 'config.json';
|
const FILENAME = 'config.json';
|
||||||
|
|||||||
@@ -11,7 +11,10 @@
|
|||||||
"outDir": "lib",
|
"outDir": "lib",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"noImplicitOverride": true
|
"noImplicitOverride": true,
|
||||||
|
"paths": {
|
||||||
|
"@toeverything/infra/*": ["../../common/infra/src/*"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": ["./src"],
|
"include": ["./src"],
|
||||||
"exclude": ["renderer", "node_modules", "lib", "dist", "**/__tests__/**/*"],
|
"exclude": ["renderer", "node_modules", "lib", "dist", "**/__tests__/**/*"],
|
||||||
|
|||||||
Reference in New Issue
Block a user