Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/web/app/api/pages/[pageId]/export/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { getToken } from "@/lib/auth/server";
import { getServerConvexClient } from "@/lib/convex/server";
import { getFiles } from "@/lib/files/server";
import { assertStoredChecksum, type PageExportAsset } from "./page-export";
import { iterableSource, readSource } from "@baseblocks/anydoc/sources";
import {
iterableSource,
readSource,
} from "@baseblocks/anydoc-contracts/sources";
import { api } from "@baseblocks/backend";
import { projectBaseBlocksDocumentForPortableExport } from "@baseblocks/openeditor-contracts";
import { baseBlocksBlockRegistry } from "@baseblocks/openeditor-contracts/block-registry";
Expand Down
4 changes: 2 additions & 2 deletions apps/web/components/file-viewer/anydoc-preview-client.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"use client";

import type { PreviewFile } from "@/components/file-viewer/file-viewer";
import { isSafeExternalUrl } from "@baseblocks/anydoc";
import { isSafeExternalUrl } from "@baseblocks/anydoc-contracts";
import {
AnyDocumentViewer,
type ViewerControls,
type ViewerError,
} from "@baseblocks/anydoc/react";
} from "@baseblocks/anydoc-viewer/react";
import { Spinner } from "@baseblocks/ui/spinner";
import { useMemo } from "react";
import { UnifiedViewerControls } from "./anydoc-viewer-controls";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
TextWrapIcon,
} from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import type { ViewerControls } from "@baseblocks/anydoc/react";
import type { ViewerControls } from "@baseblocks/anydoc-viewer/react";
import { Button } from "@baseblocks/ui/button";
import { Input } from "@baseblocks/ui/input";
import { cn } from "@baseblocks/ui/lib/utils";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/file-viewer/file-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
useState,
} from "react";
import { createPortal } from "react-dom";
import { detectViewerFormat } from "@baseblocks/anydoc/react";
import { detectViewerFormat } from "@baseblocks/anydoc-viewer/react";

const AnyDocPreview = dynamic(() => import("./anydoc-preview-client"), {
ssr: false,
Expand Down
9 changes: 5 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
"@aws-sdk/client-s3": "^3.1084.0",
"@aws-sdk/s3-presigned-post": "^3.1084.0",
"@aws-sdk/s3-request-presigner": "^3.1084.0",
"@baseblocks/anydoc-contracts": "0.2.0-alpha.3",
"@baseblocks/anydoc-viewer": "0.2.0-alpha.3",
"@baseblocks/backend": "workspace:*",
"@baseblocks/custom-blocks": "workspace:*",
"@baseblocks/anydoc": "0.1.0-alpha.15",
"@baseblocks/domain": "workspace:*",
"@baseblocks/i18n": "workspace:*",
"@baseblocks/openeditor-contracts": "workspace:*",
Expand All @@ -29,13 +30,13 @@
"@flags-sdk/vercel": "^1.4.6",
"@hugeicons/core-free-icons": "^4.2.3",
"@hugeicons/react": "^1.1.9",
"@openeditor/workspace": "0.0.48",
"@openeditor/core": "0.0.48",
"@openeditor/custom-block": "0.0.48",
"@openeditor/emoji": "0.0.48",
"@openeditor/exporters": "0.0.48",
"@openeditor/react": "0.0.48",
"@openeditor/ui": "0.0.48",
"@openeditor/workspace": "0.0.48",
"@vercel/analytics": "^2.0.1",
"@vercel/sdk": "^1.28.8",
"ai": "7.0.49",
Expand All @@ -51,8 +52,8 @@
"next": "16.3.0",
"next-intl": "4.13.6",
"next-themes": "^0.4.6",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"react-dropzone": "^15.0.0",
"server-only": "^0.0.1",
"sonner": "^2.0.7",
Expand Down
102 changes: 58 additions & 44 deletions bun.lock

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions bunfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,8 @@ minimumReleaseAgeExcludes = [
"@baseblocks/domain",
"@baseblocks/ui",
"@baseblocks/web",
"@baseblocks/anydoc",
"@baseblocks/anydoc-ingestion",
"@baseblocks/anydoc-convex",
"@baseblocks/anydoc-contracts",
"@baseblocks/anydoc-presentation-viewer",
"@baseblocks/anydoc-react-viewer",
"@baseblocks/anydoc-spreadsheet-engine",
"@baseblocks/anydoc-spreadsheet-viewer",
"@baseblocks/anydoc-viewer-ui",
"@baseblocks/anydoc-viewer",
"@firecrawl/anydoc",
"@firecrawl/anydoc-darwin-arm64",
"@firecrawl/anydoc-darwin-x64",
Expand Down
47 changes: 44 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"defu": "6.1.7",
"picomatch": "4.0.5",
"postcss": "8.5.23",
"react": "^19.2.7",
"react-dom": "^19.2.7",
"react": "^19.2.8",
"react-dom": "^19.2.8",
"convex": "^1.42.1"
},
"engines": {
Expand All @@ -40,5 +40,46 @@
"apps/*",
"packages/*",
"tooling/*"
]
],
"overrides": {
"convex": "1.43.0",
"react": "19.2.8",
"react-dom": "19.2.8",
"@tiptap/core": "3.29.2",
"@tiptap/extension-blockquote": "3.29.2",
"@tiptap/extension-bold": "3.29.2",
"@tiptap/extension-bubble-menu": "3.29.2",
"@tiptap/extension-bullet-list": "3.29.2",
"@tiptap/extension-code": "3.29.2",
"@tiptap/extension-code-block": "3.29.2",
"@tiptap/extension-document": "3.29.2",
"@tiptap/extension-dropcursor": "3.29.2",
"@tiptap/extension-floating-menu": "3.29.2",
"@tiptap/extension-gapcursor": "3.29.2",
"@tiptap/extension-hard-break": "3.29.2",
"@tiptap/extension-heading": "3.29.2",
"@tiptap/extension-horizontal-rule": "3.29.2",
"@tiptap/extension-image": "3.29.2",
"@tiptap/extension-italic": "3.29.2",
"@tiptap/extension-link": "3.29.2",
"@tiptap/extension-list": "3.29.2",
"@tiptap/extension-list-item": "3.29.2",
"@tiptap/extension-list-keymap": "3.29.2",
"@tiptap/extension-ordered-list": "3.29.2",
"@tiptap/extension-paragraph": "3.29.2",
"@tiptap/extension-placeholder": "3.29.2",
"@tiptap/extension-strike": "3.29.2",
"@tiptap/extension-table": "3.29.2",
"@tiptap/extension-task-item": "3.29.2",
"@tiptap/extension-task-list": "3.29.2",
"@tiptap/extension-text": "3.29.2",
"@tiptap/extension-text-align": "3.29.2",
"@tiptap/extension-underline": "3.29.2",
"@tiptap/extension-unique-id": "3.29.2",
"@tiptap/extensions": "3.29.2",
"@tiptap/pm": "3.29.2",
"@tiptap/react": "3.29.2",
"@tiptap/starter-kit": "3.29.2",
"@tiptap/suggestion": "3.29.2"
}
}
15 changes: 10 additions & 5 deletions packages/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ bunx convex run deploymentPreflight:checkFileExtractionEnvironment
```

The check returns only variable names and non-secret configuration. Convex
validates and installs the AnyDoc adapter's Node dependency closure when the
functions are deployed.

`convex.json` externalizes only `@baseblocks/anydoc-convex`; keep that adapter
pinned to the exact registry version verified by the application lockfile.
validates and installs the parser's Node dependency closure (`@firecrawl/anydoc`)
when the functions are deployed.

`convex.json` externalizes `@firecrawl/anydoc`, whose native NAPI binary must
stay out of the Convex bundle; keep it pinned to the exact registry version
verified by the application lockfile. `@baseblocks/anydoc-contracts` is pure
TypeScript and bundles normally. The extraction queue and its failure encoding
live in `convex/fileExtractionQueue.ts`; bounded parsing and failure
classification live in `convex/fileExtractionParser.ts`; the Node action handler
is in `convex/fileExtractionAction.ts`.
Uploads enqueue extraction immediately. Operators retry a terminal extraction
through the product's file-extraction retry action; there is no polling cron or
permanent backfill API.
2 changes: 1 addition & 1 deletion packages/backend/convex.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"$schema": "./node_modules/convex/schemas/convex.schema.json",
"functions": "convex/",
"node": {
"externalPackages": ["@baseblocks/anydoc-convex"]
"externalPackages": ["@firecrawl/anydoc"]
}
}
4 changes: 4 additions & 0 deletions packages/backend/convex/_generated/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import type * as draftRestores from "../draftRestores.js";
import type * as editorWorkspace from "../editorWorkspace.js";
import type * as fileExtraction from "../fileExtraction.js";
import type * as fileExtractionAction from "../fileExtractionAction.js";
import type * as fileExtractionParser from "../fileExtractionParser.js";
import type * as fileExtractionQueue from "../fileExtractionQueue.js";
import type * as files from "../files.js";
import type * as http from "../http.js";
import type * as integrationAccess from "../integrationAccess.js";
Expand Down Expand Up @@ -112,6 +114,8 @@ declare const fullApi: ApiFromModules<{
editorWorkspace: typeof editorWorkspace;
fileExtraction: typeof fileExtraction;
fileExtractionAction: typeof fileExtractionAction;
fileExtractionParser: typeof fileExtractionParser;
fileExtractionQueue: typeof fileExtractionQueue;
files: typeof files;
http: typeof http;
integrationAccess: typeof integrationAccess;
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/convex/fileExtraction.state.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test";
import type { WorkId } from "@baseblocks/anydoc-convex";
import type { WorkId } from "@convex-dev/workpool";
import {
completed,
fileIngestion,
Expand Down
16 changes: 8 additions & 8 deletions packages/backend/convex/fileExtraction.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import {
ConvexIngestionQueue,
decodeConvexIngestionFailure,
type ConvexIngestionJob,
type ConvexIngestionReceipt,
type DurableIngestionBinding,
type WorkId,
} from "@baseblocks/anydoc-convex";
import type { WorkId } from "@convex-dev/workpool";
import { vOnCompleteArgs } from "@convex-dev/workpool";
import { ConvexError, v } from "convex/values";
import { components, internal } from "./_generated/api";
Expand All @@ -17,6 +10,13 @@ import {
query,
type QueryCtx,
} from "./_generated/server";
import {
ConvexIngestionQueue,
decodeConvexIngestionFailure,
type ConvexIngestionJob,
type ConvexIngestionReceipt,
type DurableIngestionBinding,
} from "./fileExtractionQueue";
import { assertDraftReadable, touchSiteDraft } from "./model/draft";
import {
FILE_EXTRACTION_LIMITS,
Expand Down
Loading