mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat: migrate to blocksuite/affine (#8332)
Use `@blocksuite/affine` package for all blocksuite features in affine. ```ts @blocksuite/store -> @blocksuite/affine/store @blocksuite/global -> @blocksuite/affine/global @blocksuite/block-std -> @blocksuite/affine/block-std @blocksuite/blocks -> @blocksuite/affine/blocks @blocksuite/presets -> @blocksuite/affine/presets ```
This commit is contained in:
2
tools/@types/env/__all.d.ts
vendored
2
tools/@types/env/__all.d.ts
vendored
@@ -20,7 +20,7 @@ declare global {
|
||||
var SENTRY_RELEASE: { id: string } | undefined;
|
||||
}
|
||||
|
||||
declare module '@blocksuite/store' {
|
||||
declare module '@blocksuite/affine/store' {
|
||||
interface DocMeta {
|
||||
/**
|
||||
* @deprecated
|
||||
|
||||
@@ -17,13 +17,11 @@ import corePackage from '../../packages/frontend/core/package.json' assert { typ
|
||||
|
||||
const clipboard = new Clipboard();
|
||||
|
||||
const oldHash = corePackage.dependencies['@blocksuite/block-std']
|
||||
.split('-')
|
||||
.pop();
|
||||
const oldHash = corePackage.dependencies['@blocksuite/affine'].split('-').pop();
|
||||
|
||||
const info = await fetch(
|
||||
'https://registry.npmjs.org/@blocksuite/block-std'
|
||||
).then(res => res.json());
|
||||
const info = await fetch('https://registry.npmjs.org/@blocksuite/affine').then(
|
||||
res => res.json()
|
||||
);
|
||||
|
||||
const latestVersion = info['dist-tags'].latest;
|
||||
const latestHash = latestVersion.split('-').pop();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"@affine/env": "workspace:*",
|
||||
"@affine/templates": "workspace:*",
|
||||
"@aws-sdk/client-s3": "^3.620.0",
|
||||
"@blocksuite/presets": "0.17.14",
|
||||
"@blocksuite/affine": "0.17.14",
|
||||
"@clack/core": "^0.3.4",
|
||||
"@clack/prompts": "^0.7.0",
|
||||
"@magic-works/i18n-codegen": "^0.6.0",
|
||||
|
||||
@@ -155,7 +155,7 @@ export const createConfiguration: (
|
||||
alias: {
|
||||
yjs: join(workspaceRoot, 'node_modules', 'yjs'),
|
||||
lit: join(workspaceRoot, 'node_modules', 'lit'),
|
||||
'@blocksuite/block-std': blocksuiteBaseDir
|
||||
'@blocksuite/affine/block-std': blocksuiteBaseDir
|
||||
? join(blocksuiteBaseDir, 'packages', 'framework', 'block-std', 'src')
|
||||
: join(
|
||||
workspaceRoot,
|
||||
@@ -164,7 +164,7 @@ export const createConfiguration: (
|
||||
'block-std',
|
||||
'dist'
|
||||
),
|
||||
'@blocksuite/blocks': blocksuiteBaseDir
|
||||
'@blocksuite/affine/blocks': blocksuiteBaseDir
|
||||
? join(blocksuiteBaseDir, 'packages', 'blocks', 'src')
|
||||
: join(
|
||||
workspaceRoot,
|
||||
@@ -173,7 +173,7 @@ export const createConfiguration: (
|
||||
'blocks',
|
||||
'dist'
|
||||
),
|
||||
'@blocksuite/presets': blocksuiteBaseDir
|
||||
'@blocksuite/affine/presets': blocksuiteBaseDir
|
||||
? join(blocksuiteBaseDir, 'packages', 'presets', 'src')
|
||||
: join(
|
||||
workspaceRoot,
|
||||
@@ -182,7 +182,7 @@ export const createConfiguration: (
|
||||
'presets',
|
||||
'dist'
|
||||
),
|
||||
'@blocksuite/global': blocksuiteBaseDir
|
||||
'@blocksuite/affine/global': blocksuiteBaseDir
|
||||
? join(blocksuiteBaseDir, 'packages', 'framework', 'global', 'src')
|
||||
: join(
|
||||
workspaceRoot,
|
||||
@@ -191,24 +191,25 @@ export const createConfiguration: (
|
||||
'global',
|
||||
'dist'
|
||||
),
|
||||
'@blocksuite/store/providers/broadcast-channel': blocksuiteBaseDir
|
||||
? join(
|
||||
blocksuiteBaseDir,
|
||||
'packages',
|
||||
'framework',
|
||||
'store',
|
||||
'src/providers/broadcast-channel'
|
||||
)
|
||||
: join(
|
||||
workspaceRoot,
|
||||
'node_modules',
|
||||
'@blocksuite',
|
||||
'store',
|
||||
'dist',
|
||||
'providers',
|
||||
'broadcast-channel.js'
|
||||
),
|
||||
'@blocksuite/store': blocksuiteBaseDir
|
||||
'@blocksuite/affine/store/providers/broadcast-channel':
|
||||
blocksuiteBaseDir
|
||||
? join(
|
||||
blocksuiteBaseDir,
|
||||
'packages',
|
||||
'framework',
|
||||
'store',
|
||||
'src/providers/broadcast-channel'
|
||||
)
|
||||
: join(
|
||||
workspaceRoot,
|
||||
'node_modules',
|
||||
'@blocksuite',
|
||||
'store',
|
||||
'dist',
|
||||
'providers',
|
||||
'broadcast-channel.js'
|
||||
),
|
||||
'@blocksuite/affine/store': blocksuiteBaseDir
|
||||
? join(blocksuiteBaseDir, 'packages', 'framework', 'store', 'src')
|
||||
: join(workspaceRoot, 'node_modules', '@blocksuite', 'store', 'dist'),
|
||||
'@blocksuite/inline': blocksuiteBaseDir
|
||||
|
||||
@@ -23,7 +23,7 @@ export function getBuildConfig(buildFlags: BuildFlags): BUILD_CONFIG_TYPE {
|
||||
appBuildType: 'stable' as const,
|
||||
serverUrlPrefix: 'https://app.affine.pro',
|
||||
appVersion: packageJson.version,
|
||||
editorVersion: packageJson.devDependencies['@blocksuite/presets'],
|
||||
editorVersion: packageJson.devDependencies['@blocksuite/affine'],
|
||||
githubUrl: 'https://github.com/toeverything/AFFiNE',
|
||||
changelogUrl: 'https://affine.pro/what-is-new',
|
||||
downloadUrl: 'https://affine.pro/download',
|
||||
|
||||
Reference in New Issue
Block a user