Skip to content

Commit

Permalink
Release v0.14.0
Browse files Browse the repository at this point in the history
Use slim automerge package import
  • Loading branch information
acurrieclark committed Aug 13, 2024
1 parent 70daa5e commit 66e21c3
Show file tree
Hide file tree
Showing 7 changed files with 861 additions and 713 deletions.
1,537 changes: 841 additions & 696 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@
"private": false,
"repository": "https://github.com/onsetsoftware/automerge-patcher",
"description": "Utility functions to apply and invert patches generated by Automerge document changes.",
"version": "0.13.0",
"version": "0.14.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"test": "vitest --watch",
"bench": "vitest bench",
"vitest.commandLine": "npm vitest run"
},
"devDependencies": {
"typescript": "^5.0.0",
"vite": "^5.0.0",
"vite-plugin-dts": "^3.0.0",
"typescript": "^5.5.4",
"vite": "^5.4.0",
"vite-plugin-dts": "^4.0.0",
"vite-plugin-externalize-deps": "^0.8.0",
"vite-plugin-top-level-await": "^1.3.0",
"vite-plugin-wasm": "^3.2.2",
"vitest": "^1.0.0"
"vite-plugin-top-level-await": "^1.4.4",
"vite-plugin-wasm": "^3.3.0",
"vitest": "^2.0.0"
},
"peerDependencies": {
"@automerge/automerge": "^2.1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Doc, Prop, Text, next } from "@automerge/automerge";
import { Doc, Prop, Text, next } from "@automerge/automerge/slim";

function baseIsPlainObject(arg: any): arg is Record<string, any> {
if (arg == null || typeof arg !== "object") {
Expand All @@ -13,9 +13,9 @@ function baseIsPlainObject(arg: any): arg is Record<string, any> {

export function isPlainObject(arg: any): arg is Record<Prop, any> {
return (
!(arg instanceof Date) &&
baseIsPlainObject(arg) &&
!isTextObject(arg) &&
!(arg instanceof Date) &&
!Array.isArray(arg)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type Doc,
type Patch,
isAutomerge,
} from "@automerge/automerge";
} from "@automerge/automerge/slim";

import {
getProperty,
Expand Down
2 changes: 1 addition & 1 deletion src/unpatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
type Patch,
type Prop,
type Text,
} from "@automerge/automerge";
} from "@automerge/automerge/slim";
import { clone, getProperty, isTextObject } from "./helpers";
import { patch } from "./patch";

Expand Down
2 changes: 1 addition & 1 deletion tests/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Counter, Text } from "@automerge/automerge";
import { Counter, Text } from "@automerge/automerge/slim";

export const documentData: {
string: string;
Expand Down
11 changes: 8 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ESNext", "DOM"],
"moduleResolution": "Node",
"lib": [
"ESNext",
"DOM"
],
"moduleResolution": "Bundler",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
Expand All @@ -18,5 +21,7 @@
"outDir": "dist",
"declaration": true
},
"include": ["src"]
"include": [
"src"
]
}

0 comments on commit 66e21c3

Please sign in to comment.