Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c96b2d5

Browse filesBrowse files
committed
fix: support electron 30
1 parent c6e092d commit c96b2d5
Copy full SHA for c96b2d5

10 files changed

+10,587-8,107Lines changed: 10587 additions & 8107 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/obsidian/manifest.json‎

Copy file name to clipboardExpand all lines: app/obsidian/manifest.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "1.1.5",
55
"minAppVersion": "1.4.4",
66
"versions": {
7-
"better-sqlite3": "8.0.1-mod.1"
7+
"better-sqlite3": "v11.1.2"
88
},
99
"description": "Plugin to integrate with Zotero, create literature notes and insert citations from a Zotero library.",
1010
"author": "AidenLx",
Collapse file

‎app/obsidian/package.json‎

Copy file name to clipboardExpand all lines: app/obsidian/package.json
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"eslint": "~8.36.0",
3636
"@aidenlx/eslint-config": "workspace:*",
3737
"electron": "18.0.3",
38-
"@aidenlx/better-sqlite3": ">=8.0.1-mod.1 <8.0.1-mod.2",
38+
"@aidenlx/better-sqlite3": "11.1.2",
3939
"@types/react-dom": "~17.0.11",
4040
"@types/dompurify": "~2.3.4",
4141
"@types/react": "~17.0.8",
@@ -115,6 +115,7 @@
115115
"arktype": "~1.0.21-alpha",
116116
"linkedom": "~0.15.3",
117117
"p-queue": "~7.4.1",
118-
"colord": "~2.9.3"
118+
"colord": "~2.9.3",
119+
"tar": "~7.4.0"
119120
}
120121
}
Collapse file

‎app/obsidian/src/install-guide/guide/atom.ts‎

Copy file name to clipboardExpand all lines: app/obsidian/src/install-guide/guide/atom.ts
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ export const modalAtom = atom<InstallGuideModal>(null as never);
66

77
export const binaryNameAtom = atom((get) => {
88
const { arch, platform, modules } = get(modalAtom).platform;
9-
return `${platform}-${arch}-${modules}.node.gz`;
9+
const version = get(modalAtom).binaryVersion;
10+
return `better-sqlite3-${version}-electron-v${modules}-${platform}-${arch}.tar.gz`;
1011
});
1112

1213
export const binaryLinkAtom = atom(
1314
(get) =>
1415
`https://github.com/aidenlx/better-sqlite3/releases/download/${
1516
get(modalAtom).binaryVersion
16-
}/${get(binaryNameAtom)}`,
17+
}/${get(binaryNameAtom)}`
1718
);
1819

1920
export const binaryLinkFastgitAtom = atom((get) =>
20-
get(binaryLinkAtom).replace("github.com", "download.fastgit.org"),
21+
get(binaryLinkAtom).replace("github.com", "download.fastgit.org")
2122
);
2223

2324
export const binaryFullPathAtom = atom((get) =>
24-
getBinaryFullPath(get(modalAtom).manifest),
25+
getBinaryFullPath(get(modalAtom).manifest)
2526
);
2627

2728
export const guideModeAtom = atom<GuideMode>((get) => get(modalAtom).mode);
Collapse file

‎app/obsidian/src/install-guide/guide/utils.ts‎

Copy file name to clipboardExpand all lines: app/obsidian/src/install-guide/guide/utils.ts
+27-10Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,42 @@
11
import { createWriteStream } from "fs";
2-
import { rm } from "fs/promises";
2+
import { rm, writeFile } from "fs/promises";
33
import { Readable } from "stream";
44
import { pipeline } from "stream/promises";
55
import { createGunzip } from "zlib";
66
import { app as electronApp } from "@electron/remote";
77
import { fileDialog } from "file-select-dialog";
88
import { requestUrl } from "obsidian";
9+
import { list } from "tar";
910

1011
export const importModule = async (
1112
ab: ArrayBuffer,
1213
writeTo: string,
13-
decompressed: boolean,
14+
decompressed: boolean
1415
): Promise<void> => {
15-
const source = Readable.from(Buffer.from(ab)),
16-
target = createWriteStream(writeTo);
16+
if (decompressed) {
17+
await writeFile(writeTo, Buffer.from(ab));
18+
return;
19+
}
20+
const target = createWriteStream(writeTo);
1721
try {
18-
if (decompressed) {
19-
await pipeline(source, target);
20-
} else {
21-
await pipeline(source, createGunzip(), target);
22-
}
22+
const sourceFile = "build/Release/better_sqlite3.node";
23+
let tasks: Promise<any>[] = [];
24+
tasks.push(
25+
pipeline(
26+
Readable.from(Buffer.from(ab)),
27+
list(
28+
{
29+
gzip: true,
30+
onReadEntry: (e) => {
31+
if (e.path !== sourceFile) return;
32+
tasks.push(pipeline(e, target));
33+
},
34+
},
35+
[sourceFile]
36+
)
37+
)
38+
);
39+
await Promise.all(tasks);
2340
} catch (error) {
2441
target.destroy();
2542
await rm(writeTo, { force: true });
@@ -30,7 +47,7 @@ export const importModule = async (
3047
export const uploadModule = async () => {
3148
const file = await fileDialog({
3249
multiple: false,
33-
accept: [".gz", ".node"],
50+
accept: [".tar.gz", ".node"],
3451
strict: true,
3552
});
3653
if (!file) return null;
Collapse file

‎app/obsidian/src/platform.json‎

Copy file name to clipboard
+12-17Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
{
2-
"103": {
3-
"darwin": ["arm64", "x64"],
4-
"linux": ["x64"],
5-
"win32": ["x64", "arm64"]
6-
},
7-
"109": {
2+
"116": {
83
"darwin": ["arm64", "x64"],
94
"linux": ["x64"],
10-
"win32": ["x64", "arm64"]
5+
"win32": ["ia32", "x64", "arm64"]
116
},
12-
"110": {
7+
"118": {
138
"darwin": ["arm64", "x64"],
149
"linux": ["x64"],
15-
"win32": ["x64", "arm64"]
10+
"win32": ["ia32", "x64", "arm64"]
1611
},
17-
"114": {
12+
"119": {
1813
"darwin": ["arm64", "x64"],
1914
"linux": ["x64"],
20-
"win32": ["x64", "arm64"]
15+
"win32": ["ia32", "x64", "arm64"]
2116
},
22-
"116": {
17+
"121": {
2318
"darwin": ["arm64", "x64"],
2419
"linux": ["x64"],
25-
"win32": ["x64", "arm64"]
20+
"win32": ["ia32", "x64", "arm64"]
2621
},
27-
"118": {
22+
"123": {
2823
"darwin": ["arm64", "x64"],
2924
"linux": ["x64"],
30-
"win32": ["x64", "arm64"]
25+
"win32": ["ia32", "x64", "arm64"]
3126
},
32-
"119": {
27+
"125": {
3328
"darwin": ["arm64", "x64"],
3429
"linux": ["x64"],
35-
"win32": ["x64", "arm64"]
30+
"win32": ["ia32", "x64", "arm64"]
3631
}
3732
}
Collapse file

‎common/config/rush/pnpm-config.json‎

Copy file name to clipboardExpand all lines: common/config/rush/pnpm-config.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
*
152152
* PNPM documentation: https://pnpm.io/package_json#pnpmneverbuiltdependencies
153153
*/
154-
"globalNeverBuiltDependencies": ["electron", "@aidenlx/better-sqlite3"],
154+
"globalNeverBuiltDependencies": ["electron", "@aidenlx/better-sqlite3", "better-sqlite3"],
155155

156156
/**
157157
* The `globalAllowedDeprecatedVersions` setting suppresses installation warnings for package

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.