Skip to content

Commit

Permalink
Patch serialize-javascript for mobile (#5)
Browse files Browse the repository at this point in the history
The library depended on randombytes which itself depended on
safe-buffer. Unfortunately the buffer API is not supported on all
variants of mobile platforms, so I ended up patching the serialization
library to remove the dependency on safe-buffer.
  • Loading branch information
iamrecursion committed Apr 2, 2024
1 parent 661ff68 commit 4b8ea1d
Show file tree
Hide file tree
Showing 9 changed files with 352 additions and 49 deletions.
2 changes: 1 addition & 1 deletion esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["main.ts"],
entryPoints: ["src/main.ts"],
bundle: true,
external: [
"obsidian",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "pkvs",
"name": "Persistent Key-Value Store",
"version": "1.1.0",
"version": "1.1.1",
"minAppVersion": "1.5.12",
"description": "Provides a persistent key-value store for use in scripts, along with a portable web inspector.",
"author": "Ara Adkins",
Expand Down
39 changes: 0 additions & 39 deletions package-lock.json

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

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-pkvs",
"version": "1.1.0",
"version": "1.1.1",
"description": "Provides a persistent key-value store for use in scripts in Obsidian.",
"main": "main.js",
"scripts": {
Expand All @@ -19,13 +19,12 @@
"@typescript-eslint/parser": "6.17.0",
"builtin-modules": "3.3.0",
"esbuild": "0.19.11",
"husky": "^7.0.2",
"lint-staged": "^10.5.3",
"obsidian": "latest",
"prettier": "^3.1.1",
"serialize-javascript": "^6.0.1",
"tslib": "2.6.2",
"typescript": "5.3.3",
"husky": "^7.0.2",
"lint-staged": "^10.5.3"
"typescript": "5.3.3"
},
"dependencies": {
"eruda": "^3.0.1",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion main.ts → src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
ToggleComponent,
} from "obsidian";

import serializeJS from "serialize-javascript";
import { serializeJS } from "./serialize";

import erudaBenchmark from "eruda-benchmark";
import erudaCode from "eruda-code";
Expand Down
Loading

0 comments on commit 4b8ea1d

Please sign in to comment.