@bytecodealliance/jco 1.32.0 → 1.33.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.
Files changed (54) hide show
  1. package/README.md +12 -1
  2. package/dist/bundle.d.ts +2 -0
  3. package/dist/bundle.d.ts.map +1 -1
  4. package/dist/bundle.js +7 -0
  5. package/dist/bundle.js.map +1 -1
  6. package/dist/cmd/componentize.d.ts +24 -0
  7. package/dist/cmd/componentize.d.ts.map +1 -1
  8. package/dist/cmd/componentize.js +82 -8
  9. package/dist/cmd/componentize.js.map +1 -1
  10. package/dist/cmd/opt.d.ts.map +1 -1
  11. package/dist/cmd/opt.js +102 -130
  12. package/dist/cmd/opt.js.map +1 -1
  13. package/dist/cmd/run.d.ts.map +1 -1
  14. package/dist/cmd/run.js +58 -1
  15. package/dist/cmd/run.js.map +1 -1
  16. package/dist/cmd/transpile.d.ts +5 -1
  17. package/dist/cmd/transpile.d.ts.map +1 -1
  18. package/dist/cmd/transpile.js +98 -4
  19. package/dist/cmd/transpile.js.map +1 -1
  20. package/dist/common.d.ts +0 -2
  21. package/dist/common.d.ts.map +1 -1
  22. package/dist/common.js +0 -9
  23. package/dist/common.js.map +1 -1
  24. package/dist/jco.js +8 -1
  25. package/dist/jco.js.map +1 -1
  26. package/dist/node-builtins.d.ts +127 -0
  27. package/dist/node-builtins.d.ts.map +1 -0
  28. package/dist/node-builtins.js +1085 -0
  29. package/dist/node-builtins.js.map +1 -0
  30. package/dist/node-wit.d.ts +67 -0
  31. package/dist/node-wit.d.ts.map +1 -0
  32. package/dist/node-wit.js +338 -0
  33. package/dist/node-wit.js.map +1 -0
  34. package/lib/wasi_snapshot_preview1.command.wasm +0 -0
  35. package/lib/wasi_snapshot_preview1.reactor.wasm +0 -0
  36. package/lib/wit/builtin/0.2.10/wasi-clocks/package.wit +35 -0
  37. package/lib/wit/builtin/0.2.10/wasi-io/package.wit +47 -0
  38. package/lib/wit/builtin/0.2.10/wasi-sockets/package.wit +168 -0
  39. package/lib/wit/builtin/jco-node-0.1.0/child-process.wit +42 -0
  40. package/lib/wit/builtin/jco-node-0.1.0/cluster.wit +111 -0
  41. package/lib/wit/builtin/jco-node-0.1.0/console.wit +12 -0
  42. package/lib/wit/builtin/jco-node-0.1.0/dns.wit +145 -0
  43. package/lib/wit/builtin/jco-node-0.1.0/ffi.wit +116 -0
  44. package/lib/wit/builtin/jco-node-0.1.0/fs.wit +208 -0
  45. package/lib/wit/builtin/jco-node-0.1.0/http.wit +144 -0
  46. package/lib/wit/builtin/jco-node-0.1.0/http2.wit +191 -0
  47. package/lib/wit/builtin/jco-node-0.1.0/inspector.wit +142 -0
  48. package/lib/wit/builtin/jco-node-0.1.0/os.wit +120 -0
  49. package/lib/wit/builtin/jco-node-0.1.0/types.wit +12 -0
  50. package/package.json +6 -12
  51. package/dist/ora-shim.d.ts +0 -9
  52. package/dist/ora-shim.d.ts.map +0 -1
  53. package/dist/ora-shim.js +0 -10
  54. package/dist/ora-shim.js.map +0 -1
@@ -0,0 +1,120 @@
1
+ package jco:node@0.1.0;
2
+
3
+ /// Typed, runtime-neutral host boundary for Node-compatible OS information.
4
+ interface os {
5
+ variant errno {
6
+ number(s64),
7
+ symbolic(string),
8
+ }
9
+
10
+ record error-info {
11
+ errno: option<errno>,
12
+ code: option<string>,
13
+ message: option<string>,
14
+ syscall: option<string>,
15
+ }
16
+
17
+ record error {
18
+ name: string,
19
+ message: string,
20
+ code: option<string>,
21
+ errno: option<errno>,
22
+ syscall: option<string>,
23
+ info: option<error-info>,
24
+ }
25
+
26
+ record constant-entry {
27
+ name: string,
28
+ value: s64,
29
+ }
30
+
31
+ record os-constants {
32
+ uv-udp-reuseaddr: s32,
33
+ dlopen: list<constant-entry>,
34
+ errno: list<constant-entry>,
35
+ signals: list<constant-entry>,
36
+ priority: list<constant-entry>,
37
+ }
38
+
39
+ record static-properties {
40
+ eol: string,
41
+ dev-null: string,
42
+ constants: os-constants,
43
+ }
44
+
45
+ enum byte-order {
46
+ be,
47
+ le,
48
+ }
49
+
50
+ record cpu-times {
51
+ user: u64,
52
+ nice: u64,
53
+ sys: u64,
54
+ idle: u64,
55
+ irq: u64,
56
+ }
57
+
58
+ record cpu-info {
59
+ model: string,
60
+ speed: u32,
61
+ times: cpu-times,
62
+ }
63
+
64
+ record load-average {
65
+ one: f64,
66
+ five: f64,
67
+ fifteen: f64,
68
+ }
69
+
70
+ enum network-family {
71
+ ipv4,
72
+ ipv6,
73
+ }
74
+
75
+ record network-interface {
76
+ name: string,
77
+ address: string,
78
+ netmask: string,
79
+ family: network-family,
80
+ mac: string,
81
+ internal: bool,
82
+ scopeid: option<u32>,
83
+ cidr: option<string>,
84
+ }
85
+
86
+ variant user-info-value {
87
+ text(string),
88
+ bytes(list<u8>),
89
+ }
90
+
91
+ record user-info-record {
92
+ username: user-info-value,
93
+ uid: s64,
94
+ gid: s64,
95
+ shell: option<user-info-value>,
96
+ homedir: user-info-value,
97
+ }
98
+
99
+ get-static-properties: func() -> result<static-properties, error>;
100
+ arch: func() -> result<string, error>;
101
+ available-parallelism: func() -> result<u32, error>;
102
+ cpus: func() -> result<list<cpu-info>, error>;
103
+ endianness: func() -> result<byte-order, error>;
104
+ freemem: func() -> result<u64, error>;
105
+ get-priority: func(pid: s32) -> result<s32, error>;
106
+ homedir: func() -> result<string, error>;
107
+ hostname: func() -> result<string, error>;
108
+ loadavg: func() -> result<load-average, error>;
109
+ machine: func() -> result<string, error>;
110
+ network-interfaces: func() -> result<list<network-interface>, error>;
111
+ platform: func() -> result<string, error>;
112
+ release: func() -> result<string, error>;
113
+ set-priority: func(pid: s32, priority: s32) -> result<_, error>;
114
+ tmpdir: func() -> result<string, error>;
115
+ totalmem: func() -> result<u64, error>;
116
+ %type: func() -> result<string, error>;
117
+ uptime: func() -> result<f64, error>;
118
+ user-info: func(encoding: option<string>) -> result<user-info-record, error>;
119
+ version: func() -> result<string, error>;
120
+ }
@@ -0,0 +1,12 @@
1
+ package jco:node@0.1.0;
2
+
3
+ /// Types shared by the Node API interfaces in this package.
4
+ ///
5
+ /// Anything more than one `node:*` adapter needs belongs here rather than being repeated, so the
6
+ /// interfaces agree on a single definition.
7
+ interface types {
8
+ /// Environment variables, as name/value pairs.
9
+ ///
10
+ /// TODO(map): change to `map<k, v>` when componentize-js gets support.
11
+ type env-vars = list<tuple<string, string>>;
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytecodealliance/jco",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "description": "JavaScript tooling for working with WebAssembly Components",
5
5
  "keywords": [
6
6
  "Component",
@@ -36,13 +36,6 @@
36
36
  "type": "module",
37
37
  "main": "dist/jco.js",
38
38
  "types": "dist/jco.d.ts",
39
- "imports": {
40
- "#ora": {
41
- "types": "./dist/ora-shim.d.ts",
42
- "browser": "./dist/ora-shim.js",
43
- "default": "ora"
44
- }
45
- },
46
39
  "exports": {
47
40
  ".": {
48
41
  "types": "./dist/api.d.ts",
@@ -57,16 +50,17 @@
57
50
  "dependencies": {
58
51
  "@bytecodealliance/componentize-js": "^0.22.0",
59
52
  "@bytecodealliance/componentize-js-0-19-3": "npm:@bytecodealliance/componentize-js@^0.19.3",
60
- "@bytecodealliance/jco-transpile": "^0.12.0",
61
- "@bytecodealliance/preview2-shim": "^0.22.0",
53
+ "@bytecodealliance/jco-std": "^0.3.1",
54
+ "@bytecodealliance/jco-transpile": "^0.13.0",
55
+ "@bytecodealliance/preview2-shim": "^0.24.1",
62
56
  "binaryen": "^130.0.0",
63
57
  "commander": "^14",
64
58
  "componentize-qjs": "^0.4.2",
65
59
  "mkdirp": "^3",
66
- "ora": "^8",
67
60
  "rolldown": "^1.2.4",
68
61
  "typescript": "7.0.2",
69
- "typescript-compiler-api": "npm:typescript@6.0.3"
62
+ "typescript-compiler-api": "npm:typescript@6.0.3",
63
+ "unenv": "2.0.0-rc.24"
70
64
  },
71
65
  "devDependencies": {
72
66
  "@commitlint/config-conventional": "^19.8.1",
@@ -1,9 +0,0 @@
1
- /** Browser shim for Ora */
2
- export default function ora(_options?: unknown): Ora;
3
- declare class Ora {
4
- text: string;
5
- start(): void;
6
- stop(): void;
7
- }
8
- export {};
9
- //# sourceMappingURL=ora-shim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ora-shim.d.ts","sourceRoot":"","sources":["../src/ora-shim.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,QAAQ,CAAC,EAAE,OAAO,OAE7C;AAED,cAAM,GAAG;IACL,IAAI,SAAM;IACV,KAAK,SAAK;IACV,IAAI,SAAK;CACZ"}
package/dist/ora-shim.js DELETED
@@ -1,10 +0,0 @@
1
- /** Browser shim for Ora */
2
- export default function ora(_options) {
3
- return new Ora();
4
- }
5
- class Ora {
6
- text = "";
7
- start() { }
8
- stop() { }
9
- }
10
- //# sourceMappingURL=ora-shim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ora-shim.js","sourceRoot":"","sources":["../src/ora-shim.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,QAAkB;IAC1C,OAAO,IAAI,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,MAAM,GAAG;IACL,IAAI,GAAG,EAAE,CAAC;IACV,KAAK,KAAI,CAAC;IACV,IAAI,KAAI,CAAC;CACZ"}