Skip to content
Closed
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
4 changes: 2 additions & 2 deletions apps/relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"type": "module",
"scripts": {
"dev": "bun --watch src/index.ts",
"build": "rimraf dist && tsc",
"build": "bun ../../scripts/rm.mts dist && tsc --build tsconfig.json",
"start": "node dist/src/index.js",
"clean": "rimraf .turbo node_modules dist data/evolu-relay.db"
"clean": "bun ../../scripts/rm.mts .turbo node_modules dist data/evolu-relay.db"
},
"files": [
"dist",
Expand Down
4 changes: 3 additions & 1 deletion apps/relay/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"extends": "../../packages/tsconfig/universal-esm.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"types": ["node"],
"typeRoots": ["./node_modules/@types", "../../node_modules/@types"]
},
"include": ["src"],
"exclude": ["node_modules"]
Expand Down
358 changes: 166 additions & 192 deletions bun.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/angular-vite-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"generate-pwa-assets": "pwa-assets-generator"
},
"dependencies": {
"@angular/core": "^21.1.5",
"@angular/platform-browser": "^21.1.5",
"@angular/core": "^21.2.1",
"@angular/platform-browser": "^21.2.1",
"@evolu/common": "workspace:*",
"@evolu/web": "workspace:*"
},
"devDependencies": {
"@analogjs/vite-plugin-angular": "^2.3.1",
"@angular/build": "^21.1.5",
"@angular/compiler-cli": "^21.1.5",
"@angular/compiler-cli": "^21.2.1",
Comment on lines 19 to +20
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Angular 21 @angular/build @angular/compiler-cli version compatibility peer dependencies

💡 Result:

For Angular v21 (i.e., @angular/* major 21), the relevant compatibility/peer-dependency rules are:

  • @angular/build@21.1.4 peerDependencies include:

    • @angular/compiler-cli: ^21.0.0 (so any 21.x satisfies it)
    • typescript: >=5.9 <6.0
    • plus Angular framework peers like @angular/core, @angular/compiler, etc. at ^21.0.0 (and @angular/ssr at ^21.1.4). [1]
  • Angular 21 toolchain compatibility (official matrix):

    • Node.js: ^20.19.0 || ^22.12.0 || ^24.0.0
    • TypeScript: >=5.9.0 <6.0.0 [2]
  • @angular/compiler-cli version alignment

    • Angular’s core packages and CLI are major-version aligned (Angular 21 ↔ CLI 21). [3]
    • @angular/compiler-cli requires a matching @angular/compiler version (pattern shown in @angular/compiler-cli@20.1.4 → peer @angular/compiler: 20.1.4; Angular 21 follows the same “match the framework version” rule). [4]

Practical takeaway: keep @angular/build, @angular/compiler-cli, @angular/compiler, @angular/core all on major 21 (ideally the same minor/patch), and use TypeScript 5.9.x (not 5.8 or 6.0). [1][2][4]

Sources: [1] [2] [3] [4]


🌐 Web query:

Angular 21.2.1 release notes package version requirements

💡 Result:

Angular v21.x (applies to 21.2.x as well): required versions

Angular’s official compatibility table for Angular 21.0.x (i.e., the v21 line) lists these requirements: Node.js ^20.19.0 || ^22.12.0 || ^24.0.0, TypeScript >=5.9.0 <6.0.0, RxJS ^6.5.3 || ^7.4.0. (angular.dev)

Key npm peer/engine requirements (example from @angular/core)

From @angular/core’s package.json (shown here for 21.1.2, but this is the same pattern used across the v21 line):

  • engines.node: ^20.19.0 || ^22.12.0 || >=24.0.0
  • peerDependencies.rxjs: ^6.5.3 || ^7.4.0
  • peerDependencies.zone.js: ~0.15.0 || ~0.16.0
  • peerDependencies.@angular/compiler: must match exactly (same version as @angular/core) (app.unpkg.com)

About “Angular 21.2.1 release notes”

In the official Angular monorepo tags/releases, I can see v21.2.0 (Feb 25, 2026) and a vsix-21.2.1 tag (VS Code extension), but not a framework tag v21.2.1 on the tags page. (github.com)

If you confirm whether you mean Angular framework 21.2.1 (npm packages like @angular/core@21.2.1) or the VS Code extension 21.2.1, I can point you at the exact corresponding release notes.

Citations:


🏁 Script executed:

# Zkontrolovat soubor package.json a okolní kontext
cat -n examples/angular-vite-pwa/package.json | head -30

Repository: SQLoot/evolu-plan-b

Length of output: 991


Aktualizujte @angular/build na verzi ^21.2.1.

Na řádku 19 zůstává @angular/build na ^21.1.5, zatímco @angular/compiler-cli a další Angular balíčky jsou již na ^21.2.1. Podle oficiální Angular dokumentace by měly být všechny core balíčky (@angular/build, @angular/compiler-cli, @angular/compiler, @angular/core) na stejné minor/patch verzi. Ačkoli caret notace (^) technicky zajišťuje kompatibilitu, je to proti best practices.

Návrh opravy
-    "@angular/build": "^21.1.5",
+    "@angular/build": "^21.2.1",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@angular/build": "^21.1.5",
"@angular/compiler-cli": "^21.1.5",
"@angular/compiler-cli": "^21.2.1",
"@angular/build": "^21.2.1",
"@angular/compiler-cli": "^21.2.1",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/angular-vite-pwa/package.json` around lines 19 - 20, Aktualizujte
závislost `@angular/build` v package.json z ^21.1.5 na ^21.2.1, aby byla zarovnána
s ostatními Angular core balíčky (např. `@angular/compiler-cli` na ^21.2.1);
upravte hodnotu verze pro "@angular/build" v tom bloku a uložte změnu, aby
všechny core balíčky měly stejnou minor/patch verzi.

"@tailwindcss/vite": "^4.2.1",
"@vite-pwa/assets-generator": "^1.0.2",
"tailwindcss": "^4.2.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/react-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "bunx vite",
"_build": "tsc && bunx vite build && bunx electron-builder",
"clean": "rimraf node_modules .turbo dist-electron",
"clean": "bun ../../scripts/rm.mts node_modules .turbo dist-electron",
"preview": "vite preview"
},
"dependencies": {
Expand All @@ -20,7 +20,7 @@
"@types/react": "~19.2.14",
"@types/react-dom": "~19.2.3",
"@vitejs/plugin-react": "^5.1.4",
"electron": "40.6.1",
"electron": "40.7.0",
"electron-builder": "^26.8.1",
"typescript": "^5.9.3",
"vite": "^7.3.1",
Expand Down
8 changes: 4 additions & 4 deletions examples/react-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"_dev": "expo start --web",
"android": "expo run:android --no-build-cache",
"android:go": "expo start --android",
"clean": "rimraf .expo android ios node_modules",
"clean": "bun ../../scripts/rm.mts .expo android ios node_modules",
"ios": "expo run:ios",
"ios:go": "expo start --ios",
"lint": "expo lint",
Expand All @@ -26,19 +26,19 @@
"@expo/vector-icons": "^15.1.1",
"abort-signal-polyfill": "^1.0.0",
"babel-plugin-module-resolver": "^5.0.2",
"expo": "^55.0.4",
"expo": "^55.0.5",
"expo-constants": "^55.0.7",
"expo-font": "^55.0.4",
"expo-linking": "^55.0.7",
"expo-router": "^55.0.3",
"expo-router": "^55.0.4",
"expo-secure-store": "~55.0.8",
"expo-splash-screen": "~55.0.10",
"expo-sqlite": "~55.0.10",
"react": "19.2.4",
"react-dom": "19.2.4",
"react-native": "0.84.1",
"react-native-nitro-modules": "0.34.1",
"react-native-quick-crypto": "^1.0.14",
"react-native-quick-crypto": "^1.0.16",
"react-native-safe-area-context": "^5.6.2",
"react-native-screens": "^4.24.0",
"react-native-svg": "15.15.3",
Expand Down
2 changes: 1 addition & 1 deletion examples/react-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"_start": "next start",
"build": "next build --webpack",
"clean": "rimraf .turbo .next node_modules",
"clean": "bun ../../scripts/rm.mts .turbo .next node_modules",
"dev": "next dev --webpack"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/react-vite-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build": "tsc && vite build",
"clean": "rimraf node_modules dist .vite .turbo dev-dist",
"clean": "bun ../../scripts/rm.mts node_modules dist .vite .turbo dev-dist",
"dev": "vite",
"generate-pwa-assets": "pwa-assets-generator",
"preview": "vite preview"
Expand Down
4 changes: 2 additions & 2 deletions examples/svelte-vite-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "vite build",
"check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json",
"clean": "rimraf node_modules .turbo dist",
"clean": "bun ../../scripts/rm.mts node_modules .turbo dist",
"dev": "vite",
"preview": "vite preview"
},
Expand All @@ -16,7 +16,7 @@
"@evolu/web": "workspace:*",
"@sveltejs/vite-plugin-svelte": "^6.2.4",
"@tsconfig/svelte": "^5.0.8",
"svelte": "^5.53.3",
"svelte": "^5.53.7",
"svelte-check": "^4.4.3",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
Expand Down
2 changes: 1 addition & 1 deletion examples/tanstack-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@evolu/tanstack-start": "workspace:*",
"@tanstack/react-router": "^1.0.0",
"@tanstack/react-router": "^1.166.2",
"react": "19.2.4",
"react-dom": "19.2.4"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/tauri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview",
"tauri:dev": "bunx tauri dev",
"tauri:build": "bunx tauri build",
"clean": "rimraf dist src-tauri/target"
"clean": "bun ../../scripts/rm.mts dist src-tauri/target"
},
"dependencies": {
"@evolu/tauri": "workspace:*",
Expand All @@ -18,7 +18,7 @@
"react-dom": "19.2.4"
},
"devDependencies": {
"@tauri-apps/cli": "^2.8.4",
"@tauri-apps/cli": "^2.10.1",
"@types/react": "~19.2.14",
"@types/react-dom": "~19.2.3",
"@vitejs/plugin-react": "^5.1.4",
Expand Down
2 changes: 1 addition & 1 deletion examples/vue-vite-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build": "vue-tsc -b && vite build",
"clean": "rimraf node_modules dist .vite .turbo dev-dist",
"clean": "bun ../../scripts/rm.mts node_modules dist .vite .turbo dev-dist",
"dev": "vite",
"generate-pwa-assets": "pwa-assets-generator",
"preview": "vite preview"
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"dev": "turbo --filter @evolu/relay dev",
"relay": "turbo --filter @evolu/relay dev",
"build": "turbo --filter @evolu/* build",
"build": "bun run clean:ts && turbo --filter @evolu/* build",
"build:web": "bun run build:docs && turbo --filter web build",
"build:docs": "bun run docs:generate:api",
"typecheck": "tsc --build tsconfig.typecheck.json",
Expand All @@ -24,7 +24,7 @@
"test:docs": "bunx vitest run scripts/typedoc-plugin-evolu.test.mts",
"test:tree-shaking:compat": "EVOLU_TREE_SHAKING_COMPAT=1 bunx vitest run packages/common/test/TreeShaking.test.ts",
"test:coverage": "bun run test:coverage:vitest && bun run test:coverage:bun && bun run coverage:merge:bun",
"test:coverage:vitest": "bun run test:preflight && bunx vitest run --coverage",
"test:coverage:vitest": "bun run test:preflight && bunx vitest run --coverage --config vitest.coverage.config.mts",
"test:coverage:bun": "bun test ./packages/bun/test --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage/bun",
"test:coverage:astro": "bun run test:preflight && bunx vitest run --project astro --coverage --coverage.all=true --coverage.include='packages/astro/src/**/*.{ts,tsx}' --coverage.exclude='**/*.d.ts' --coverage.reporter=text --coverage.reporter=json-summary --coverage.reportsDirectory=coverage/lane-astro",
"test:coverage:tanstack": "bun run test:preflight && bunx vitest run --project tanstack-start --coverage --coverage.all=true --coverage.include='packages/tanstack-start/src/**/*.{ts,tsx}' --coverage.exclude='**/*.d.ts' --coverage.reporter=text --coverage.reporter=json-summary --coverage.reportsDirectory=coverage/lane-tanstack",
Expand Down Expand Up @@ -57,7 +57,8 @@
"sync:guard:common-v8:strict": "bun ./scripts/sync-guard-common-v8.mts --strict",
"verify:fast": "bun run build && bun run test && bun run lint && bun run lint-monorepo",
"verify": "bun run typecheck && bun run format && bun run build && bun run test && bun run test:coverage && bun run lint && bun run lint-monorepo",
"clean": "turbo clean && rimraf node_modules bun.lock .turbo out coverage",
"clean:ts": "tsc --build --clean tsconfig.typecheck.json",
"clean": "turbo clean && bun ./scripts/rm.mts node_modules .turbo out coverage",
"version": "changeset version",
"release": "bun run build && changeset publish",
"ios": "cd examples/react-expo && bun ios",
Expand All @@ -75,20 +76,20 @@
"devDependencies": {
"@biomejs/biome": "^2.4.5",
"@changesets/cli": "^2.29.8",
"@types/webpack": "^5.28.5",
"@vitest/browser": "^4.0.18",
"@vitest/browser-playwright": "^4.0.18",
"@vitest/coverage-istanbul": "^4.0.18",
"@vitest/coverage-v8": "^4.0.18",
"rimraf": "^6.1.3",
"turbo": "^2.8.11",
"turbo": "^2.8.13",
"typedoc": "^0.28.17",
"typedoc-plugin-markdown": "^4.10.0",
"typescript": "^5.9.3",
"vitest": "^4.0.18",
"webpack": "^5.105.2"
"vitest": "^4.0.18"
},
"overrides": {
"serialize-javascript": "^7.0.3"
"serialize-javascript": "^7.0.3",
"svgo": "^4.0.1",
"tar": "^7.5.10"
},
"engines": {
"node": ">=24.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"README.md"
],
"scripts": {
"build": "rimraf dist && tsc --build tsconfig.build.json",
"build": "bun ../../scripts/rm.mts dist && tsc --build tsconfig.build.json",
"test": "bunx vitest run",
"clean": "rimraf .turbo node_modules dist"
"clean": "bun ../../scripts/rm.mts .turbo node_modules dist"
},
"devDependencies": {
"@evolu/common": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/bun/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"src/**"
],
"scripts": {
"build": "rimraf dist && tsc --build",
"build": "bun ../../scripts/rm.mts dist && tsc --build",
"test": "bun test ./test",
"test:coverage": "bun test ./test --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage",
"clean": "rimraf .turbo node_modules dist"
"clean": "bun ../../scripts/rm.mts .turbo node_modules dist"
},
"devDependencies": {
"@evolu/common": "workspace:*",
Expand Down
6 changes: 2 additions & 4 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@
"README.md"
],
"scripts": {
"build": "rimraf dist && tsc --build tsconfig.build.json",
"build": "tsc --build tsconfig.build.json",
"prepack": "bun run build",
"clean": "rimraf .turbo node_modules dist coverage test/tmp test/__screenshots__",
"clean": "bun ../../scripts/rm.mts .turbo node_modules dist coverage test/tmp test/__screenshots__",
"bench": "vitest bench --config ../../vitest.config.mts --passWithNoTests"
},
"dependencies": {
"@noble/ciphers": "^2.1.1",
"@noble/hashes": "^2.0.1",
"@scure/bip39": "^2.0.1",
"disposablestack": "^1.1.7",
"kysely": "^0.28.11",
"msgpackr": "^1.11.8",
"zod": "^4.3.6"
Expand All @@ -76,7 +75,6 @@
"fast-check": "^4.5.3",
"playwright": "^1.58.2",
"typescript": "^5.9.3",
"webpack": "^5.105.2",
"ws": "^8.19.0"
}
}
10 changes: 8 additions & 2 deletions packages/common/src/Buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ export class BufferError extends Error {
constructor(message: string) {
super(message);
this.name = this.constructor.name;

Error.captureStackTrace(this, this.constructor);
(
Error as ErrorConstructor & {
captureStackTrace?: (
targetObject: object,
constructorOpt?: object,
) => void;
}
).captureStackTrace?.(this, this.constructor);
}
}

Expand Down
12 changes: 10 additions & 2 deletions packages/common/src/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ export const isHermes = "HermesInternal" in globalThis;
/** Returns true if running in a server environment (no DOM). */
export const isServer = typeof document === "undefined";

export interface NodeBufferLike {
readonly from: (
value: Uint8Array | string,
encoding?: "base64url",
) => ArrayLike<number> & { toString: (encoding?: "base64url") => string };
}

export const nodeBuffer = (globalThis as { Buffer?: NodeBufferLike }).Buffer;

/**
* Detects if Node.js Buffer is available and should be used.
*
Expand All @@ -21,8 +30,7 @@ export const isServer = typeof document === "undefined";
*
* @see https://github.com/craftzdog/react-native-quick-base64#installation
*/
export const hasNodeBuffer =
!isHermes && typeof globalThis.Buffer !== "undefined";
export const hasNodeBuffer = !isHermes && typeof nodeBuffer !== "undefined";

/**
* FlushSync is for libraries like React to flush updates synchronously inside
Expand Down
Loading
Loading