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
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This is the monorepo for an extensible Obsidian syncing plugin to sync vault fil
- For mobile compatibility, Node.js API prohibited.
- Sentence case for UI text.
- Module-specific behavior should not pollute plugin core.
- All Obsidian API mocks go `packages/shared/src/obsidian-mock.ts`.
- All Obsidian API mocks go `packages/shared/test/obsidian-mock.ts`.
- Use inline Tailwind CSS for common styling, only use semantic CSS for animations and complex compositions. (Documentation website doesn't use TailwindCSS, you need to edit `docs/.vitepress/theme/styles.css`)
- When any function or class needs to use `Context` as argument, prefer structural typing instead of direct `Context`.
- Excluding main plugin, shared utils and documentation site, all packages are Sync Engine modules, they use the SDK and follow unified module structure.
Expand Down
52 changes: 3 additions & 49 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/.vitepress/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const en = {
s3: 'S3',
security: 'Security',
settings: 'Settings',
settingsAndUI: 'Settings And UI',
settingsAndUI: 'Settings and UI',
sideDescription: 'Next-generation syncing plugin for Obsidian.',
smartMerge: 'Smart Merge',
storage: 'Storage',
Expand Down
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"vue": "^3.5.41"
},
"devDependencies": {
"typescript": "^6.0.0",
"vite-plugin-json-canvas": "^1.0.1",
"vue-tsc": "^3.3.9"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/en/deep-dive/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Registration entries are consumed according to their role:
- **Factories and ID maps:** the selected remote backend, decider, and conflict resolver are looked up by the ID in settings. Missing IDs fail with an explicit error.
- **Wrappers:** request and file-system wrappers are grouped by numeric priority and applied in ascending priority order. Within one priority, the first wrapper that returns a replacement wins; returning `undefined` declines the current value.
- **First-match pipelines:** listers and optimizers are also priority ordered. The first entry that returns a result supplies the implementation for that operation.
- **Settings:** setting-definition trees are ordered by priority and merged into the native plugin settings tab. See [Settings And UI](../development/settings-and-ui).
- **Settings:** setting-definition trees are ordered by priority and merged into the native plugin settings tab. See [Settings and UI](../development/settings-and-ui).

Bootstrap uses these same APIs to build the production pipeline. For example, cancellation, rate limiting, retry, custom headers, memory control, optimization, context caching, and asymmetric storage are independent registrations layered around the base request and file-system implementations. Their behavior is specified in [Request Middleware](./request-middleware) and [File System Wrappers](./file-system-wrappers).

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/en/development/miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `digOriginal` | Unwraps nested wrappers to root filesystem. See [file system](./file-system#digoriginal). |
| `prefixWrapper` | Exposes a prefixed directory as an `Fs` root. See [file system](./file-system#prefixwrapper). |
| `setNeedMigration` | Adds migration confirmation behavior to a setting toggle; see [Settings And UI](./settings-and-ui#migration-aware-toggles). |
| `setNeedMigration` | Adds migration confirmation behavior to a setting toggle; see [Settings and UI](./settings-and-ui#migration-aware-toggles). |
| `pipe` | Transfer a file between two filesystems with auto-streaming. See [file system](./file-system#pipe). |
| `readWithSize` | Read a file with auto-streaming by size threshold. See [file system](./file-system#readwithsize). |
| `writeWithValue` | Write a value with auto-streaming by input type. See [file system](./file-system#writewithvalue). |
| `s` | Combines a parent setting definition with nested setting definitions. See [Settings And UI](./settings-and-ui#nested-setting-registration). |
| `s` | Combines a parent setting definition with nested setting definitions. See [Settings and UI](./settings-and-ui#nested-setting-registration). |

### `/dev` runtime exports

Expand Down Expand Up @@ -145,7 +145,7 @@ These Context members are not commonly used by modules. Explore source code to o
| `on(key, cb)` | Subscribes to typed SDK event. See [events](./events). |
| `dispatch(key, payload?)` | Dispatches typed SDK event. See [events](./events). |
| `isIdle` | SynthKernel `Ref<boolean>` for sync-idle state. |
| `translate` | Translates a key from merged resources. See [Settings And UI](./settings-and-ui#internationalization). |
| `translate` | Translates a key from merged resources. See [Settings and UI](./settings-and-ui#internationalization). |
| `rerenderSettingTab()` | Renders contributed settings again. |
| `refreshSettingTab()` | Cheap setting page rerender that makes Obsidian reevaluate the visibility of each setting entry. |

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/en/development/registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ type ConflictResolverEntry = { prettyName: () => string; resolver: ConflictResol
ctx.registerConflictResolver(id: string, entry: ConflictResolverEntry): () => boolean;
```

## Settings And UI
## Settings and UI

Register nested setting definitions, translations, and migration-aware controls as described in [Settings And UI](./settings-and-ui).
Register nested setting definitions, translations, and migration-aware controls as described in [Settings and UI](./settings-and-ui).

## CSS

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/en/development/settings-and-ui.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Settings And UI
# Settings and UI

Sync Engine settings use Obsidian's setting definitions. Modules can contribute nested groups, pages, lists, controls, and custom rendered settings without owning the plugin settings tab. This page also covers the translation and migration helpers used by module UI.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"oxlint-tsgolint": "^7.0.2001",
"tsdown": "^0.22.14",
"turbo": "^2.10.11",
"typescript": "^7.0.2"
"typescript": "^6.0.3"
},
"packageManager": "bun@1.3.13"
}
1 change: 0 additions & 1 deletion packages/gdrive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"devDependencies": {
"@hesprs/sync-engine-sdk": "workspace:*",
"@repo/shared": "workspace:*",
"hash-wasm": "^4.12.0",
"uni-kv": "../../uni-kv.tgz"
}
}
2 changes: 1 addition & 1 deletion packages/gdrive/test/auth.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Request, RequestParam, RequestResponse } from '@hesprs/sync-engine-sdk';
import type { SecretStorage } from 'obsidian';
import * as ObsidianMock from '@repo/shared/mocks';
import ObsidianMock from '@repo/shared/obsidian-mock';
import { expect, mock, test } from 'bun:test';

type HttpResponse = { json: unknown; status?: number };
Expand Down
3 changes: 1 addition & 2 deletions packages/gdrive/test/mocks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// oxlint-disable-next-line import/no-namespace
import * as ObsidianMock from '@repo/shared/mocks';
import ObsidianMock from '@repo/shared/obsidian-mock';
import { mock } from 'bun:test';

process.env.CLIENT_ID = btoa(process.env.GDRIVE_CLIENT_ID ?? '');
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/dist/dev.spec.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { $ as RootFs, G as Fs, P as TaskNames, ct as RecordStat, dt as StatsMap, et as WrappedFs, h as RequestParam, it as FolderStat, lt as RecordStatsMap, m as Request, nt as Binary, rt as FileStat, ut as Stat, v as Decider } from "./index-LOl_cerr.spec.js";
import { $ as RootFs, G as Fs, P as TaskNames, ct as RecordStatsMap, et as WrappedFs, ft as Binary, h as RequestParam, lt as Stat, m as Request, nt as FileStat, rt as FolderStat, st as RecordStat, ut as StatsMap, v as Decider } from "./index-g3mTMY1u.spec.js";
//#region src/sdk/debug-wrapper.d.ts
declare function debugWrapper(original: Fs, log: (content: string) => void): WrappedFs;
//#endregion
Expand Down
Loading
Loading