@bytecodealliance/jco 0.9.1 → 0.9.3

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.
@@ -0,0 +1,3 @@
1
+ export namespace ExportsTest {
2
+ export function hello(): string;
3
+ }
package/package.json CHANGED
@@ -1,15 +1,21 @@
1
1
  {
2
2
  "name": "@bytecodealliance/jco",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "JavaScript tooling for working with WebAssembly Components",
5
5
  "author": "Guy Bedford",
6
6
  "bin": {
7
7
  "jco": "src/jco.js"
8
8
  },
9
9
  "exports": "./src/api.js",
10
+ "imports": {
11
+ "#ora": {
12
+ "browser": "./src/ora-shim.js",
13
+ "default": "ora"
14
+ }
15
+ },
10
16
  "type": "module",
11
17
  "dependencies": {
12
- "@bytecodealliance/preview2-shim": "0.0.9",
18
+ "@bytecodealliance/preview2-shim": "0.0.10",
13
19
  "binaryen": "^111.0.0",
14
20
  "chalk-template": "^0.4.0",
15
21
  "commander": "^9.4.1",
@@ -18,7 +24,7 @@
18
24
  "terser": "^5.16.1"
19
25
  },
20
26
  "devDependencies": {
21
- "@bytecodealliance/componentize-js": "0.0.7",
27
+ "@bytecodealliance/componentize-js": "^0.1.0",
22
28
  "@types/node": "^18.11.17",
23
29
  "@typescript-eslint/eslint-plugin": "^5.41.0",
24
30
  "@typescript-eslint/parser": "^5.41.0",
package/src/cmd/opt.js CHANGED
@@ -3,7 +3,7 @@ import { writeFile } from 'fs/promises';
3
3
  import { fileURLToPath } from 'url';
4
4
  import c from 'chalk-template';
5
5
  import { readFile, sizeStr, fixedDigitDisplay, table, spawnIOTmp, setShowSpinner, getShowSpinner } from '../common.js';
6
- import ora from 'ora';
6
+ import ora from '#ora';
7
7
 
8
8
  let WASM_OPT;
9
9
  try {
@@ -7,7 +7,7 @@ import { readFile, sizeStr, table, spawnIOTmp, setShowSpinner, getShowSpinner }
7
7
  import { optimizeComponent } from './opt.js';
8
8
  import { minify } from 'terser';
9
9
  import { fileURLToPath } from 'url';
10
- import ora from 'ora';
10
+ import ora from '#ora';
11
11
 
12
12
  export async function transpile (componentPath, opts, program) {
13
13
  const varIdx = program.parent.rawArgs.indexOf('--');
@@ -91,9 +91,14 @@ export async function transpileComponent (component, opts = {}) {
91
91
  if (opts.wasiShim !== false) {
92
92
  opts.map = Object.assign({
93
93
  'wasi:cli-base/*': '@bytecodealliance/preview2-shim/cli-base#*',
94
+ 'wasi:clocks/*': '@bytecodealliance/preview2-shim/clocks#*',
94
95
  'wasi:filesystem/*': '@bytecodealliance/preview2-shim/filesystem#*',
96
+ 'wasi:http/*': '@bytecodealliance/preview2-shim/http#*',
95
97
  'wasi:io/*': '@bytecodealliance/preview2-shim/io#*',
98
+ 'wasi:logging/*': '@bytecodealliance/preview2-shim/logging#*',
99
+ 'wasi:poll/*': '@bytecodealliance/preview2-shim/poll#*',
96
100
  'wasi:random/*': '@bytecodealliance/preview2-shim/random#*',
101
+ 'wasi:sockets/*': '@bytecodealliance/preview2-shim/sockets#*',
97
102
  }, opts.map || {});
98
103
  }
99
104
 
package/src/jco.js CHANGED
@@ -10,7 +10,7 @@ program
10
10
  .name('jco')
11
11
  .description(c`{bold jco - WebAssembly JS Component Tools}\n JS Component Transpilation Bindgen & Wasm Tools for JS`)
12
12
  .usage('<command> [options]')
13
- .version('0.9.1');
13
+ .version('0.9.3');
14
14
 
15
15
  function myParseInt(value) {
16
16
  return parseInt(value, 10);
@@ -0,0 +1,9 @@
1
+ // browser shim for ora
2
+ export default function ora () {
3
+ return new Ora();
4
+ }
5
+
6
+ class Ora {
7
+ start () {}
8
+ stop () {}
9
+ }