@primate/native 0.6.0 → 0.8.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/lib/private/module.d.ts +4 -4
- package/lib/private/module.js +5 -6
- package/lib/private/targets.js +8 -0
- package/package.json +10 -10
package/lib/private/module.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Module } from "@primate/core";
|
|
2
|
-
declare const
|
|
3
|
-
readonly debug: import("pema").DefaultType<import("pema").BooleanType
|
|
2
|
+
declare const Schema: import("pema").ObjectType<import("pema").NormalizeSchemaObject<{
|
|
3
|
+
readonly debug: import("pema").DefaultType<import("pema").BooleanType<undefined>, false>;
|
|
4
4
|
readonly start: import("pema").DefaultType<import("pema").StringType, "/">;
|
|
5
|
-
}>, {
|
|
5
|
+
}>, undefined, {
|
|
6
6
|
debug: boolean;
|
|
7
7
|
start: string;
|
|
8
8
|
}>;
|
|
9
|
-
export default function module(input?: typeof
|
|
9
|
+
export default function module(input?: typeof Schema.input): Module;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=module.d.ts.map
|
package/lib/private/module.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import command from "#command";
|
|
2
2
|
import targets from "#targets";
|
|
3
|
-
import
|
|
4
|
-
import color from "@rcompat/cli/color";
|
|
3
|
+
import cli from "@rcompat/cli";
|
|
5
4
|
import io from "@rcompat/io";
|
|
6
5
|
import p from "pema";
|
|
7
|
-
const
|
|
6
|
+
const Schema = p({
|
|
8
7
|
debug: p.boolean.default(false),
|
|
9
8
|
start: p.string.default("/"),
|
|
10
9
|
});
|
|
11
10
|
const names = new Set([...targets.map(t => t.name)]);
|
|
12
11
|
export default function module(input = {}) {
|
|
13
|
-
const options =
|
|
12
|
+
const options = Schema.parse(input);
|
|
14
13
|
return {
|
|
15
14
|
name: module.name,
|
|
16
15
|
setup({ onInit, onBuild, onServe }) {
|
|
@@ -21,7 +20,7 @@ export default function module(input = {}) {
|
|
|
21
20
|
if (names.has(app.target.name)) {
|
|
22
21
|
app.done(async () => {
|
|
23
22
|
const { exe, flags } = app.target.get();
|
|
24
|
-
const executable_path =
|
|
23
|
+
const executable_path = cli.fg.dim(`${app.path.build}/${exe}`);
|
|
25
24
|
const { host, port } = app.config("http");
|
|
26
25
|
await app.runpath("worker.js").write(`
|
|
27
26
|
import target from "@primate/native/target/${app.target.target}";
|
|
@@ -35,7 +34,7 @@ export default function module(input = {}) {
|
|
|
35
34
|
files: ["server.js", "worker.js"],
|
|
36
35
|
flags,
|
|
37
36
|
}));
|
|
38
|
-
log.system
|
|
37
|
+
app.log.system `executable written to ${executable_path}`;
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
});
|
package/lib/private/targets.js
CHANGED
|
@@ -6,6 +6,8 @@ const targets = [
|
|
|
6
6
|
name: "linux-x64",
|
|
7
7
|
runner,
|
|
8
8
|
target: "linux-x64",
|
|
9
|
+
conditions: ["bun", "node"],
|
|
10
|
+
externals: ["bun:*", "node:*"],
|
|
9
11
|
},
|
|
10
12
|
{
|
|
11
13
|
exe: "app.exe",
|
|
@@ -13,6 +15,8 @@ const targets = [
|
|
|
13
15
|
name: "windows-x64",
|
|
14
16
|
runner,
|
|
15
17
|
target: "windows-x64",
|
|
18
|
+
conditions: ["bun", "node"],
|
|
19
|
+
externals: ["bun:*", "node:*"],
|
|
16
20
|
},
|
|
17
21
|
{
|
|
18
22
|
exe: "app",
|
|
@@ -20,6 +24,8 @@ const targets = [
|
|
|
20
24
|
name: "darwin-x64",
|
|
21
25
|
runner,
|
|
22
26
|
target: "darwin-x64",
|
|
27
|
+
conditions: ["bun", "node"],
|
|
28
|
+
externals: ["bun:*", "node:*"],
|
|
23
29
|
},
|
|
24
30
|
{
|
|
25
31
|
exe: "app",
|
|
@@ -27,6 +33,8 @@ const targets = [
|
|
|
27
33
|
name: "darwin-arm64",
|
|
28
34
|
runner,
|
|
29
35
|
target: "darwin-arm64",
|
|
36
|
+
conditions: ["bun", "node"],
|
|
37
|
+
externals: ["bun:*", "node:*"],
|
|
30
38
|
},
|
|
31
39
|
];
|
|
32
40
|
targets.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primate/native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Primate native applications",
|
|
5
5
|
"homepage": "https://primate.run/docs/native",
|
|
6
6
|
"bugs": "https://github.com/primate-run/primate/issues",
|
|
@@ -17,16 +17,16 @@
|
|
|
17
17
|
"!/**/*.spec.*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@rcompat/cli": "^0.
|
|
21
|
-
"@rcompat/error": "^0.
|
|
22
|
-
"@rcompat/io": "^0.
|
|
23
|
-
"@rcompat/runtime": "^0.
|
|
24
|
-
"@rcompat/webview": "^0.
|
|
25
|
-
"@primate/core": "^0.
|
|
26
|
-
"pema": "^0.
|
|
20
|
+
"@rcompat/cli": "^0.24.0",
|
|
21
|
+
"@rcompat/error": "^0.8.0",
|
|
22
|
+
"@rcompat/io": "^0.10.0",
|
|
23
|
+
"@rcompat/runtime": "^0.16.0",
|
|
24
|
+
"@rcompat/webview": "^0.25.0",
|
|
25
|
+
"@primate/core": "^0.8.0",
|
|
26
|
+
"pema": "^0.8.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"primate": "^0.
|
|
29
|
+
"primate": "^0.39.0"
|
|
30
30
|
},
|
|
31
31
|
"imports": {
|
|
32
32
|
"#*": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
|
-
"build": "npm run clean &&
|
|
48
|
+
"build": "npm run clean && tsgo",
|
|
49
49
|
"clean": "rm -rf ./lib",
|
|
50
50
|
"lint": "eslint ."
|
|
51
51
|
}
|