@pipelab/shared 1.0.0-beta.18 → 1.0.0-beta.21
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/CHANGELOG.md +27 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/apis.ts +3 -8
- package/src/plugins/definitions.ts +1 -0
- package/src/utils.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipelab/shared",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.21",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared logic and types for the Pipelab ecosystem",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
"tslog": "4.9.3",
|
|
38
38
|
"type-fest": "4.26.1",
|
|
39
39
|
"valibot": "0.42.1",
|
|
40
|
-
"@pipelab/constants": "1.0.0-beta.
|
|
41
|
-
"@pipelab/migration": "1.0.0-beta.
|
|
40
|
+
"@pipelab/constants": "1.0.0-beta.23",
|
|
41
|
+
"@pipelab/migration": "1.0.0-beta.21"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"esbuild-plugin-wasm": "1.1.0",
|
|
45
45
|
"tsdown": "0.21.2",
|
|
46
46
|
"typescript": "5.9.3",
|
|
47
47
|
"vitest": "3.1.4",
|
|
48
|
-
"@pipelab/tsconfig": "1.0.0-beta.
|
|
48
|
+
"@pipelab/tsconfig": "1.0.0-beta.21"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsdown",
|
package/src/apis.ts
CHANGED
|
@@ -123,6 +123,7 @@ export type IpcDefinition = {
|
|
|
123
123
|
}[];
|
|
124
124
|
}>,
|
|
125
125
|
];
|
|
126
|
+
"fs:isPathBlacklisted": [{ path: string }, EndEvent<{ isBlacklisted: boolean }>];
|
|
126
127
|
"fs:getHomeDirectory": [void, EndEvent<{ path: string }>];
|
|
127
128
|
"dialog:showOpenDialog": [
|
|
128
129
|
// input
|
|
@@ -221,10 +222,7 @@ export type IpcDefinition = {
|
|
|
221
222
|
{ name: string; options?: any },
|
|
222
223
|
EndEvent<{ data: any | null; error: any | null }>,
|
|
223
224
|
];
|
|
224
|
-
"agent:version:get": [
|
|
225
|
-
void,
|
|
226
|
-
EndEvent<{ version: string; channel: ReleaseChannel }>,
|
|
227
|
-
];
|
|
225
|
+
"agent:version:get": [void, EndEvent<{ version: string; channel: ReleaseChannel }>];
|
|
228
226
|
"startup:progress": [
|
|
229
227
|
void,
|
|
230
228
|
{ type: "progress"; data: { message: string } } | { type: "ready" } | { type: "done" },
|
|
@@ -267,10 +265,7 @@ export type IpcDefinition = {
|
|
|
267
265
|
{ plugins: Record<string, string> },
|
|
268
266
|
EndEvent<{ loaded: string[]; failed: string[] }>,
|
|
269
267
|
];
|
|
270
|
-
"migration:scan-stable": [
|
|
271
|
-
{ sourceChannel?: MigrationChannel },
|
|
272
|
-
EndEvent<StableDataReport>,
|
|
273
|
-
];
|
|
268
|
+
"migration:scan-stable": [{ sourceChannel?: MigrationChannel }, EndEvent<StableDataReport>];
|
|
274
269
|
"migration:perform": [MigrationOptions, EndEvent<{ result: "ok" }>];
|
|
275
270
|
};
|
|
276
271
|
|
package/src/utils.ts
CHANGED
|
@@ -6,7 +6,7 @@ export const transformUrl = (url: string | undefined | null): string => {
|
|
|
6
6
|
if (url && typeof url === "string") {
|
|
7
7
|
const getHost = (): string => {
|
|
8
8
|
if (typeof window !== "undefined") {
|
|
9
|
-
const isDev =
|
|
9
|
+
const isDev = process.env.NODE_ENV === "development";
|
|
10
10
|
if (isDev) {
|
|
11
11
|
return `http://${window.location.hostname}:33753`;
|
|
12
12
|
} else {
|
|
@@ -17,11 +17,11 @@ export const transformUrl = (url: string | undefined | null): string => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
if (url.startsWith("file://")) {
|
|
20
|
-
const filePath = url.substring("file://".length);
|
|
20
|
+
const filePath = decodeURIComponent(url.substring("file://".length));
|
|
21
21
|
return `${getHost()}/media-file/${encodeURIComponent(filePath)}`;
|
|
22
22
|
}
|
|
23
23
|
if (url.startsWith("media://")) {
|
|
24
|
-
const filePath = url.replace(/^media:\/\/+/, "/");
|
|
24
|
+
const filePath = decodeURIComponent(url.replace(/^media:\/\/+/, "/"));
|
|
25
25
|
return `${getHost()}/media-file/${encodeURIComponent(filePath)}`;
|
|
26
26
|
}
|
|
27
27
|
}
|