@deltachat/stdio-rpc-server 1.137.4 → 1.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{Readme.md → README.md} +2 -2
- package/index.js +10 -26
- package/package.json +18 -18
package/{Readme.md → README.md}
RENAMED
|
@@ -27,7 +27,7 @@ For a more complete example refer to https://github.com/deltachat-bot/echo/pull/
|
|
|
27
27
|
|
|
28
28
|
## How to use on an unsupported platform
|
|
29
29
|
|
|
30
|
-
<!-- todo instructions, will uses an env var for pointing to `deltachat-
|
|
30
|
+
<!-- todo instructions, will uses an env var for pointing to `deltachat-rpc-server` binary -->
|
|
31
31
|
|
|
32
32
|
<!-- todo copy parts from https://github.com/deltachat/deltachat-desktop/blob/7045c6f549e4b9d5caa0709d5bd314bbd9fd53db/docs/UPDATE_CORE.md -->
|
|
33
33
|
|
|
@@ -61,7 +61,7 @@ When you import this package it searches for the rpc server in the following loc
|
|
|
61
61
|
- Then pass it as an artifact to the last CI action that publishes the main package.
|
|
62
62
|
- upload all packages from `deltachat-rpc-server/npm-package/platform_package`.
|
|
63
63
|
- then publish `deltachat-rpc-server/npm-package`,
|
|
64
|
-
- this will run `
|
|
64
|
+
- this will run `update_optional_dependencies_and_version.js` (in the `prepack` script),
|
|
65
65
|
which puts all platform packages into `optionalDependencies` and updates the `version` in `package.json`
|
|
66
66
|
|
|
67
67
|
## How to build a version you can use localy on your host machine for development
|
package/index.js
CHANGED
|
@@ -65,31 +65,15 @@ export async function getRPCServerPath(
|
|
|
65
65
|
|
|
66
66
|
// 2. check if it can be found in PATH
|
|
67
67
|
if (!process.env[SKIP_SEARCH_IN_PATH] && !skipSearchInPath) {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return join(directory, file);
|
|
78
|
-
} else {
|
|
79
|
-
throw null;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const executable_search = // TODO make code simpler to read
|
|
83
|
-
(await Promise.allSettled(cargo_dirs.map(findExecutable))).find(
|
|
84
|
-
({ status }) => status === "fulfilled"
|
|
85
|
-
) ||
|
|
86
|
-
(await Promise.allSettled(path_dirs.map(findExecutable))).find(
|
|
87
|
-
({ status }) => status === "fulfilled"
|
|
88
|
-
);
|
|
89
|
-
// TODO maybe we could the system do this stuff automatically
|
|
90
|
-
// by just trying to execute it and then use "which" (unix) or "where" (windows) to get the path to the executable
|
|
91
|
-
if (executable_search.status === "fulfilled") {
|
|
92
|
-
const executable = executable_search.value;
|
|
68
|
+
const exec = promisify(execFile);
|
|
69
|
+
|
|
70
|
+
const { stdout: executable } =
|
|
71
|
+
os.platform() !== "win32"
|
|
72
|
+
? await exec("command", ["-v", PATH_EXECUTABLE_NAME])
|
|
73
|
+
: await exec("where", [PATH_EXECUTABLE_NAME]);
|
|
74
|
+
|
|
75
|
+
// by just trying to execute it and then use "command -v deltachat-rpc-server" (unix) or "where deltachat-rpc-server" (windows) to get the path to the executable
|
|
76
|
+
if (executable.length > 1) {
|
|
93
77
|
// test if it is the right version
|
|
94
78
|
try {
|
|
95
79
|
// for some unknown reason it is in stderr and not in stdout
|
|
@@ -153,7 +137,7 @@ export async function startDeltaChat(directory, options) {
|
|
|
153
137
|
};
|
|
154
138
|
|
|
155
139
|
//@ts-expect-error
|
|
156
|
-
dc.pathToServerBinary = pathToServerBinary
|
|
140
|
+
dc.pathToServerBinary = pathToServerBinary;
|
|
157
141
|
|
|
158
142
|
return dc;
|
|
159
143
|
}
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"type": "module",
|
|
3
|
-
"name": "@deltachat/stdio-rpc-server",
|
|
4
|
-
"version": "1.137.4",
|
|
5
2
|
"license": "MPL-2.0",
|
|
6
3
|
"main": "index.js",
|
|
7
|
-
"
|
|
8
|
-
"scripts": {
|
|
9
|
-
"prepack": "node scripts/update_optional_dependencies_and_version.js"
|
|
10
|
-
},
|
|
4
|
+
"name": "@deltachat/stdio-rpc-server",
|
|
11
5
|
"optionalDependencies": {
|
|
12
|
-
"@deltachat/stdio-rpc-server-darwin-arm64": "1.
|
|
13
|
-
"@deltachat/stdio-rpc-server-android-arm64": "1.
|
|
14
|
-
"@deltachat/stdio-rpc-server-linux-arm64": "1.
|
|
15
|
-
"@deltachat/stdio-rpc-server-linux-arm": "1.
|
|
16
|
-
"@deltachat/stdio-rpc-server-android-arm": "1.
|
|
17
|
-
"@deltachat/stdio-rpc-server-win32-i32": "1.
|
|
18
|
-
"@deltachat/stdio-rpc-server-linux-i32": "1.
|
|
19
|
-
"@deltachat/stdio-rpc-server-darwin-x64": "1.
|
|
20
|
-
"@deltachat/stdio-rpc-server-win32-x64": "1.
|
|
21
|
-
"@deltachat/stdio-rpc-server-linux-x64": "1.
|
|
6
|
+
"@deltachat/stdio-rpc-server-darwin-arm64": "1.138.0",
|
|
7
|
+
"@deltachat/stdio-rpc-server-android-arm64": "1.138.0",
|
|
8
|
+
"@deltachat/stdio-rpc-server-linux-arm64": "1.138.0",
|
|
9
|
+
"@deltachat/stdio-rpc-server-linux-arm": "1.138.0",
|
|
10
|
+
"@deltachat/stdio-rpc-server-android-arm": "1.138.0",
|
|
11
|
+
"@deltachat/stdio-rpc-server-win32-i32": "1.138.0",
|
|
12
|
+
"@deltachat/stdio-rpc-server-linux-i32": "1.138.0",
|
|
13
|
+
"@deltachat/stdio-rpc-server-darwin-x64": "1.138.0",
|
|
14
|
+
"@deltachat/stdio-rpc-server-win32-x64": "1.138.0",
|
|
15
|
+
"@deltachat/stdio-rpc-server-linux-x64": "1.138.0"
|
|
22
16
|
},
|
|
23
17
|
"peerDependencies": {
|
|
24
18
|
"@deltachat/jsonrpc-client": "*"
|
|
25
|
-
}
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"prepack": "node scripts/update_optional_dependencies_and_version.js"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"types": "index.d.ts",
|
|
25
|
+
"version": "1.138.0"
|
|
26
26
|
}
|