Skip to content

Commit

Permalink
chore: apply patch to fast-json-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
nadilas committed Apr 27, 2024
1 parent 22725d3 commit c319746
Show file tree
Hide file tree
Showing 8 changed files with 434 additions and 18 deletions.
401 changes: 401 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"lint": "turbo run lint",
"test": "turbo run test",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"release": "auto shipit"
"release": "auto shipit",
"postinstall": "patch-package"
},
"license": "MIT",
"devDependencies": {
Expand All @@ -27,7 +28,8 @@
"auto": "^11.0.7",
"dotenv-cli": "^7.3.0",
"prettier": "^3.2.5",
"turbo": "latest"
"turbo": "latest",
"patch-package": "^8.0.0"
},
"engines": {
"npm": ">=7.0.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/ogre/src/commit.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { digest } from "./hash.js";
import { Operation } from "fast-json-patch/index.mjs";
import { Operation } from "fast-json-patch";

export interface Commit {
/*The hash of the commit. Is a sha256 of:
- tree object reference (changes?)
- parent object reference (parent hash)
- author
- author commit timestamp with timezone
- commit message
*/
- tree object reference (changes?)
- parent object reference (parent hash)
- author
- author commit timestamp with timezone
- commit message
*/
hash: string;
tree: string;

Expand Down
7 changes: 1 addition & 6 deletions packages/ogre/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,4 @@ export * from "./size.js";
export * from "./utils.js";
export * from "./git2json.js";

export {
compare,
deepClone,
Operation,
JsonPatchError,
} from "fast-json-patch/index.mjs";
export { compare, deepClone, Operation, JsonPatchError } from "fast-json-patch";
2 changes: 1 addition & 1 deletion packages/ogre/src/repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
updateHeaderData,
} from "./test.utils.js";
import { Reference } from "./interfaces.js";
import { compare } from "fast-json-patch/index.mjs";
import { compare } from "fast-json-patch";

test("diff is ok", async (t) => {
const [repo, obj] = await getBaseline();
Expand Down
2 changes: 1 addition & 1 deletion packages/ogre/src/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
Operation,
unobserve,
validate,
} from "fast-json-patch/index.mjs";
} from "fast-json-patch";
import { calculateCommitHash, Commit } from "./commit.js";
import { History, Reference } from "./interfaces.js";
import { compressSync, strToU8 } from "fflate";
Expand Down
2 changes: 1 addition & 1 deletion packages/ogre/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Commit } from "./commit.js";
import { Reference } from "./interfaces.js";
import { decompressSync, strFromU8 } from "fflate";
import { validBranch, validRef } from "./ref.js";
import { deepClone, Operation } from "fast-json-patch/index.mjs";
import { deepClone, Operation } from "fast-json-patch";
import { RepositoryObject } from "./repository.js";

const emailRegex =
Expand Down
18 changes: 18 additions & 0 deletions patches/fast-json-patch+3.1.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/node_modules/fast-json-patch/package.json b/node_modules/fast-json-patch/package.json
index 688a6d0..8eb9957 100644
--- a/node_modules/fast-json-patch/package.json
+++ b/node_modules/fast-json-patch/package.json
@@ -25,6 +25,13 @@
"main": "index.js",
"module": "index.mjs",
"typings": "index.d.ts",
+ "exports": {
+ ".": {
+ "import": "./index.mjs",
+ "require": "./index.js",
+ "types": "./index.d.ts"
+ }
+ },
"devDependencies": {
"benchmark": "^2.1.4",
"bluebird": "^3.5.5",

0 comments on commit c319746

Please sign in to comment.