There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
chore: move page not found error out of constants (#9547)
Saul-Mirone0d2eb64817e1
diff --git a/blocksuite/framework/store/src/index.ts b/blocksuite/framework/store/src/index.tsindex 095de799bd..3fc25cfe15 100644--- a/blocksuite/framework/store/src/index.ts+++ b/blocksuite/framework/store/src/index.ts@@ -1,14 +1,14 @@// oxlint-disable-next-line @typescript-eslint/triple-slash-reference/// <reference path="../shim.d.ts" />-export * from './adapter/index.js';-export * from './extension/index.js';-export * from './model/index.js';-export * from './reactive/index.js';-export * from './schema/index.js';-export * from './transformer/index.js';-export { type IdGenerator, nanoid, uuidv4 } from './utils/id-generator.js';-export * from './yjs/index.js';+export * from './adapter';+export * from './extension';+export * from './model';+export * from './reactive';+export * from './schema';+export * from './transformer';+export { type IdGenerator, nanoid, uuidv4 } from './utils/id-generator';+export * from './yjs';const env =typeof globalThis !== 'undefined'diff --git a/packages/common/env/src/constant.ts b/packages/common/env/src/constant.tsindex 3e907d5d43..a638a87721 100644--- a/packages/common/env/src/constant.ts+++ b/packages/common/env/src/constant.ts@@ -1,7 +1,4 @@// This file should has not side effect-// oxlint-disable-next-line-// @ts-ignore FIXME: typecheck error-import type { Workspace } from '@blocksuite/affine/store';declare global {// oxlint-disable-next-line no-var@@ -90,17 +87,6 @@ export const Messages = {};};-export class PageNotFoundError extends TypeError {- readonly docCollection: Workspace;- readonly pageId: string;-- constructor(docCollection: Workspace, pageId: string) {- super();- this.docCollection = docCollection;- this.pageId = pageId;- }-}-export class WorkspaceNotFoundError extends TypeError {readonly workspaceId: string;diff --git a/packages/frontend/core/src/components/affine/affine-error-boundary/error-fallbacks/page-not-found-fallback.tsx b/packages/frontend/core/src/components/affine/affine-error-boundary/error-fallbacks/page-not-found-fallback.tsxindex 1d93c0bd34..71a059ee19 100644--- a/packages/frontend/core/src/components/affine/affine-error-boundary/error-fallbacks/page-not-found-fallback.tsx+++ b/packages/frontend/core/src/components/affine/affine-error-boundary/error-fallbacks/page-not-found-fallback.tsx@@ -1,5 +1,5 @@-import { PageNotFoundError } from '@affine/env/constant';import { useI18n } from '@affine/i18n';+import type { Workspace } from '@blocksuite/affine/store';import { useCallback } from 'react';import {@@ -9,6 +9,17 @@ import {import { ErrorDetail, ErrorStatus } from '../error-basic/error-detail';import { createErrorFallback } from '../error-basic/fallback-creator';+class PageNotFoundError extends TypeError {+ readonly docCollection: Workspace;+ readonly pageId: string;++ constructor(docCollection: Workspace, pageId: string) {+ super();+ this.docCollection = docCollection;+ this.pageId = pageId;+ }+}+export const PageNotFoundDetail = createErrorFallback(PageNotFoundError, () => {const t = useI18n();const { jumpToIndex } = useNavigateHelper();diff --git a/packages/frontend/i18n/src/i18n-completenesses.json b/packages/frontend/i18n/src/i18n-completenesses.jsonindex f2adbc364f..50d0b8626a 100644--- a/packages/frontend/i18n/src/i18n-completenesses.json+++ b/packages/frontend/i18n/src/i18n-completenesses.json@@ -8,6 +8,7 @@"es-AR": 100,"es-CL": 100,"es": 100,+ "fa": 100,"fr": 100,"hi": 2,"it-IT": 100,diff --git a/tools/@types/env/__all.d.ts b/tools/@types/env/__all.d.tsindex a191d80038..0a07cba982 100644--- a/tools/@types/env/__all.d.ts+++ b/tools/@types/env/__all.d.ts@@ -1,4 +1,5 @@import '@affine/env/constant';+import '@blocksuite/affine/global/types'import type { BUILD_CONFIG_TYPE, Environment } from '@affine/env/global';diff --git a/tools/@types/env/package.json b/tools/@types/env/package.jsonindex 1f27c2177e..03a7feec31 100644--- a/tools/@types/env/package.json+++ b/tools/@types/env/package.json@@ -4,7 +4,8 @@"types": "./__all.d.ts","type": "module","dependencies": {- "@affine/env": "workspace:*"+ "@affine/env": "workspace:*",+ "@blocksuite/affine": "workspace:*"},"version": "0.19.0"}diff --git a/tools/utils/src/workspace.gen.ts b/tools/utils/src/workspace.gen.tsindex 92f5d0ee21..6ed6e70517 100644--- a/tools/utils/src/workspace.gen.ts+++ b/tools/utils/src/workspace.gen.ts@@ -477,7 +477,6 @@ export const PackageList = [name: '@affine/nbstore',workspaceDependencies: ['packages/common/infra',- 'packages/frontend/electron-api','packages/frontend/graphql',],},@@ -648,7 +647,7 @@ export const PackageList = [{location: 'tools/@types/env',name: '@types/affine__env',- workspaceDependencies: ['packages/common/env'],+ workspaceDependencies: ['packages/common/env', 'blocksuite/affine/all'],},{location: 'tools/changelog',diff --git a/yarn.lock b/yarn.lockindex f8e699375d..60a461f274 100644--- a/yarn.lock+++ b/yarn.lock@@ -13987,6 +13987,7 @@ __metadata:resolution: "@types/affine__env@workspace:tools/@types/env"dependencies:"@affine/env": "workspace:*"+ "@blocksuite/affine": "workspace:*"languageName: unknownlinkType: soft