This repository was archived by the owner on Jun 4, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/pull creates sync manifest #17
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b5eddb6
Pull creates .boxel-sync.json manifest after download
88fbf05
docs: note pull writes .boxel-sync.json, bump to 1.0.1
76bbf44
chore: ignore .gstack/ runtime directory
306b657
feat: route binary and non-source files correctly on upload
fdcb6b4
feat: add --batch flag to push for atomic bulk uploads
45d0e62
chore: add drift guards to .gitignore
e1c201d
fix: address PR #17 Copilot review
b70962c
docs: document push --batch, content-type routing, manifest shape
dbf0efc
docs: add CHANGELOG.md, backfill 1.0.0 + 1.0.1 release notes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to `boxel-cli`. Format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [SemVer](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## 1.0.1 — 2026-04-20 | ||
|
|
||
| ### New | ||
|
|
||
| - `boxel push --batch [--batch-size N]` — atomic bulk upload. Definitions upload individually in dependency order (so FieldDefs land before CardDefs that contain them); instances batch through `/_atomic` in groups of N (default 10). Faster and quieter than per-file POST on pushes of 50+ files, and reduces UI re-indexing churn. | ||
| - `boxel pull <url> ./local` writes `.boxel-sync.json` automatically after a fresh download. You can now run `boxel sync .` immediately against a just-pulled directory with no manual intermediate step. | ||
|
|
||
| ### Fixed | ||
|
|
||
| - **Binary upload corruption.** Images, fonts, PDFs, and other non-text files were being routed through the `/_atomic` JSON endpoint with text encoding, corrupting the bytes. Binary files now take the per-file POST path with `application/octet-stream`. | ||
| - **Plain-text file rejection.** `.md`, `.csv`, `.yaml`, `.xml`, and `.txt` uploads were being rejected by the realm's module compiler as "invalid source". Plain-text files now take the per-file POST path with their true MIME type. | ||
| - **Manifest shape drift between push and pull.** `push` and `pull` had diverged on the shape of `.boxel-sync.json`. Mixed-command workflows (pull → push or pull → sync → push) could mark every file as changed on the next run. All three commands now use one canonical shape; `push` migrates the pre-1.0.1 bare-string format on read. | ||
| - **Partial-failure batch marks files as synced.** In `--batch` mode, the manifest was updated for every file in a batch whenever any file succeeded, even if some of them had failed. Failed uploads could be silently stranded without retry. The manifest now tracks only files that successfully uploaded; failures stay out and get retried on the next run. | ||
| - **`boxel --version` reported wrong number.** The CLI had a hardcoded version string that drifted from `package.json`. Version is now sourced from `package.json` at runtime. | ||
| - **`--batch-size` silently accepted garbage.** `--batch-size abc` or `--batch-size -5` used to flow through as `NaN` / negative and cause weird behavior downstream. Non-positive-integer input now fails fast with a clear error. | ||
|
|
||
| ### For contributors | ||
|
|
||
| - New `src/lib/content-type.ts` — single source of truth mapping file extension → MIME type → upload-path decision. Any extension you add for atomic-compatibility should also go here. | ||
| - New drift-guards section in `.gitignore` — prevents Boxel platform docs, workspace dirs, and other content that commonly ends up at the repo root from leaking into commits. | ||
| - `AGENTS.md` now documents the content-type routing table (file class → path → headers) and the canonical manifest shape, so future additions to `batch-upload.ts` or any manifest-touching command have one reference. | ||
|
|
||
| --- | ||
|
|
||
| ## 1.0.0 — 2026-02-13 | ||
|
|
||
| Initial public release. Core sync, push, pull, watch, track, history, profiles, multi-realm config, realm repair, share/gather GitHub workflow, skill-based Claude Code integration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,18 @@ import { RealmSyncBase, validateMatrixEnvVars, type SyncOptions } from '../lib/r | |
| import { CheckpointManager, type CheckpointChange } from '../lib/checkpoint-manager.js'; | ||
| import * as fs from 'fs'; | ||
| import * as path from 'path'; | ||
| import * as crypto from 'crypto'; | ||
|
|
||
| interface SyncManifest { | ||
| workspaceUrl: string; | ||
| lastSyncTime: number; | ||
| files: Record<string, { localHash: string; remoteMtime: number }>; | ||
| } | ||
|
|
||
| function computeFileHash(filePath: string): string { | ||
| const content = fs.readFileSync(filePath); | ||
| return crypto.createHash('md5').update(content).digest('hex'); | ||
| } | ||
|
|
||
| interface PullOptions extends SyncOptions { | ||
| deleteLocal?: boolean; | ||
|
|
@@ -104,6 +116,29 @@ class RealmPuller extends RealmSyncBase { | |
| } | ||
| } | ||
|
|
||
| // Create sync manifest so subsequent `boxel sync` knows files are in sync | ||
| if (!this.options.dryRun && downloadedFiles.length > 0) { | ||
| const remoteMtimes = await this.getRemoteMtimes(); | ||
| const manifest: SyncManifest = { | ||
| workspaceUrl: this.options.workspaceUrl, | ||
| lastSyncTime: Date.now(), | ||
| files: {}, | ||
| }; | ||
|
|
||
| for (const relativePath of downloadedFiles) { | ||
| const localPath = path.join(this.options.localDir, relativePath); | ||
| if (fs.existsSync(localPath)) { | ||
| manifest.files[relativePath] = { | ||
| localHash: computeFileHash(localPath), | ||
| remoteMtime: remoteMtimes.get(relativePath) || Math.floor(Date.now() / 1000), | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| const manifestPath = path.join(this.options.localDir, '.boxel-sync.json'); | ||
| fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2)); | ||
| } | ||
|
Comment on lines
+119
to
+140
|
||
|
|
||
| // Create checkpoint for pulled files | ||
| if (!this.options.dryRun && downloadedFiles.length > 0) { | ||
| const checkpointManager = new CheckpointManager(this.options.localDir); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package.jsonversion was bumped to 1.0.1, but the CLI still reports 1.0.0 viaprogram.version('1.0.0')insrc/index.ts. Consider sourcing the version frompackage.json(or updating the hardcoded string) soboxel --versionmatches the published package version.