@primate/native 0.4.0 → 0.5.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.
@@ -6,8 +6,8 @@ import type NextBuild from "@primate/core/NextBuild";
6
6
  import type NextServe from "@primate/core/NextServe";
7
7
  import type ServeApp from "@primate/core/ServeApp";
8
8
  declare const schema: import("pema").ObjectType<{
9
- debug: import("pema").DefaultType<import("pema/boolean").BooleanType, false>;
10
- start: import("pema").DefaultType<import("pema/string").StringType, "/">;
9
+ debug: import("pema").DefaultType<import("pema").BooleanType, false>;
10
+ start: import("pema").DefaultType<import("pema").StringType, "/">;
11
11
  }>;
12
12
  export default class NativeModule extends Module {
13
13
  #private;
@@ -17,9 +17,9 @@ export default class NativeModule extends Module {
17
17
  start?: string | undefined;
18
18
  } | undefined;
19
19
  constructor(config: typeof schema.input);
20
- init<T extends App>(app: T, next: Next<T>): import("@rcompat/type/MaybePromise").default<T>;
21
- build(app: BuildApp, next: NextBuild): import("@rcompat/type/MaybePromise").default<BuildApp>;
22
- serve(app: ServeApp, next: NextServe): import("@rcompat/type/MaybePromise").default<ServeApp>;
20
+ init<T extends App>(app: T, next: Next<T>): import("@rcompat/type").MaybePromise<T>;
21
+ build(app: BuildApp, next: NextBuild): import("@rcompat/type").MaybePromise<BuildApp>;
22
+ serve(app: ServeApp, next: NextServe): import("@rcompat/type").MaybePromise<ServeApp>;
23
23
  }
24
24
  export {};
25
25
  //# sourceMappingURL=Module.d.ts.map
@@ -2,15 +2,13 @@ import command from "#command";
2
2
  import targets from "#targets";
3
3
  import log from "@primate/core/log";
4
4
  import Module from "@primate/core/Module";
5
- import dim from "@rcompat/cli/color/dim";
6
- import execute from "@rcompat/stdio/execute";
7
- import pema from "pema";
8
- import boolean from "pema/boolean";
9
- import string from "pema/string";
5
+ import color from "@rcompat/cli/color";
6
+ import io from "@rcompat/io";
7
+ import p from "pema";
10
8
  const names = targets.map(t => t.name);
11
- const schema = pema({
12
- debug: boolean.default(false),
13
- start: string.default("/"),
9
+ const schema = p({
10
+ debug: p.boolean.default(false),
11
+ start: p.string.default("/"),
14
12
  });
15
13
  export default class NativeModule extends Module {
16
14
  name = "native";
@@ -28,7 +26,7 @@ export default class NativeModule extends Module {
28
26
  if (names.includes(app.target.name)) {
29
27
  app.done(async () => {
30
28
  const { exe, flags } = app.target.get();
31
- const executable_path = dim(`${app.path.build}/${exe}`);
29
+ const executable_path = color.dim(`${app.path.build}/${exe}`);
32
30
  const { host, port } = app.config("http");
33
31
  await app.runpath("worker.js").write(`
34
32
  import target from "@primate/native/target/${app.target.target}";
@@ -37,7 +35,7 @@ export default class NativeModule extends Module {
37
35
  webview.navigate("http://${host}:${port}/${this.#config.start}");
38
36
  webview.run();
39
37
  `);
40
- await execute(command({
38
+ await io.run(command({
41
39
  exe,
42
40
  files: ["server.js", "worker.js"],
43
41
  flags,
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
1
  {
2
2
  "name": "@primate/native",
3
- "version": "0.4.0",
4
- "description": "Primate native",
3
+ "version": "0.5.0",
4
+ "description": "Primate native applications",
5
5
  "homepage": "https://primate.run/docs/native",
6
6
  "bugs": "https://github.com/primate-run/primate/issues",
7
+ "type": "module",
7
8
  "license": "MIT",
8
- "files": [
9
- "/lib/**/*.js",
10
- "/lib/**/*.d.ts",
11
- "!/**/*.spec.*"
12
- ],
13
9
  "repository": {
14
10
  "type": "git",
15
11
  "url": "https://github.com/primate-run/primate",
16
12
  "directory": "packages/native"
17
13
  },
14
+ "files": [
15
+ "/lib/**/*.js",
16
+ "/lib/**/*.d.ts",
17
+ "!/**/*.spec.*"
18
+ ],
18
19
  "dependencies": {
19
- "@rcompat/cli": "^0.11.3",
20
- "@rcompat/fs": "^0.22.3",
21
- "@rcompat/record": "^0.9.1",
22
- "@rcompat/runtime": "^0.6.0",
23
- "@rcompat/stdio": "^0.12.2",
24
- "@rcompat/string": "^0.10.0",
25
- "@rcompat/webview": "^0.14.0",
26
- "pema": "^0.4.0",
27
- "@primate/core": "^0.4.0"
20
+ "@rcompat/cli": "^0.14.0",
21
+ "@rcompat/io": "^0.3.0",
22
+ "@rcompat/runtime": "^0.9.0",
23
+ "@rcompat/webview": "^0.18.0",
24
+ "@primate/core": "^0.5.0",
25
+ "pema": "^0.5.0"
26
+ },
27
+ "peerDependencies": {
28
+ "primate": "^0.36.0"
28
29
  },
29
- "type": "module",
30
30
  "imports": {
31
31
  "#*": {
32
32
  "apekit": "./src/private/*.ts",