mirror of
https://github.com/encounter/jco.git
synced 2026-07-10 12:18:38 -07:00
deps: update to latest deps, including ComponentizeJS (#492)
This commit is contained in:
@@ -1,14 +1,4 @@
|
||||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 13,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"no-sparse-arrays": 0,
|
||||
"no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
||||
|
||||
Generated
+237
-323
File diff suppressed because it is too large
Load Diff
+4
-5
@@ -33,15 +33,14 @@
|
||||
"terser": "^5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@bytecodealliance/componentize-js": "^0.9.0",
|
||||
"@bytecodealliance/componentize-js": "^0.10.4",
|
||||
"@types/node": "^20.14.12",
|
||||
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
||||
"@typescript-eslint/parser": "^7.17.0",
|
||||
"eslint": "^8.56.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.2.0",
|
||||
"@typescript-eslint/parser": "^8.2.0",
|
||||
"eslint": "^9.9.0",
|
||||
"mime": "^4.0.4",
|
||||
"mocha": "^10.7.0",
|
||||
"puppeteer": "^22.14.0",
|
||||
"terser": "^5.16.1",
|
||||
"typescript": "^5.5.4"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
@@ -352,7 +352,7 @@ class Descriptor {
|
||||
let isSymlink = false;
|
||||
try {
|
||||
isSymlink = lstatSync(fullPath).isSymbolicLink();
|
||||
} catch (e) {
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
if (isSymlink) throw openFlags.directory ? "not-directory" : "loop";
|
||||
@@ -361,7 +361,7 @@ class Descriptor {
|
||||
let isFile = false;
|
||||
try {
|
||||
isFile = !statSync(fullPath).isDirectory();
|
||||
} catch (e) {
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
if (isFile) throw "not-directory";
|
||||
@@ -430,7 +430,7 @@ class Descriptor {
|
||||
let isDir = false;
|
||||
try {
|
||||
isDir = statSync(fullPath).isDirectory();
|
||||
} catch (_) {
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
if (!isDir) throw isWindows ? "no-entry" : "not-directory";
|
||||
@@ -449,7 +449,7 @@ class Descriptor {
|
||||
let isDir = false;
|
||||
try {
|
||||
isDir = statSync(fullPath).isDirectory();
|
||||
} catch (e) {
|
||||
} catch {
|
||||
//
|
||||
}
|
||||
throw isDir ? (isWindows ? "access" : (isMac ? "not-permitted" : "is-directory")) : "not-directory";
|
||||
|
||||
@@ -540,7 +540,7 @@ class Fields {
|
||||
}
|
||||
try {
|
||||
validateHeaderValue(name, new TextDecoder().decode(value));
|
||||
} catch (e) {
|
||||
} catch {
|
||||
throw { tag: "invalid-syntax" };
|
||||
}
|
||||
const lowercased = name.toLowerCase();
|
||||
|
||||
@@ -11,12 +11,16 @@ export async function componentize (jsSource, opts) {
|
||||
throw new Error(`componentize-js must first be installed separately via "npm install @bytecodealliance/componentize-js".`);
|
||||
throw e;
|
||||
}
|
||||
if (opts.disable?.includes('all')) {
|
||||
opts.disable = ['stdio', 'random', 'clocks'];
|
||||
}
|
||||
const source = await readFile(jsSource, 'utf8');
|
||||
const { component } = await componentizeFn(source, {
|
||||
sourceName: basename(jsSource),
|
||||
witPath: resolve(opts.wit),
|
||||
worldName: opts.worldName,
|
||||
disableFeatures: opts.disable,
|
||||
enableFeatures: opts.enable,
|
||||
preview2Adapter: opts.preview2Adapter,
|
||||
});
|
||||
await writeFile(opts.out, component);
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import ora from '#ora';
|
||||
let WASM_OPT;
|
||||
try {
|
||||
WASM_OPT = fileURLToPath(new URL('../../node_modules/binaryen/bin/wasm-opt', import.meta.url));
|
||||
} catch (e) {
|
||||
} catch {
|
||||
WASM_OPT = new URL('../../node_modules/binaryen/bin/wasm-opt', import.meta.url);
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -33,7 +33,8 @@ program.command('componentize')
|
||||
.argument('<js-source>', 'JS source file to build')
|
||||
.requiredOption('-w, --wit <path>', 'WIT path to build with')
|
||||
.option('-n, --world-name <name>', 'WIT world to build')
|
||||
.addOption(new Option('-d, --disable <feature...>', 'disable WASI features').choices(['stdio', 'random', 'clocks', 'http']))
|
||||
.addOption(new Option('-d, --disable <feature...>', 'disable WASI features').choices(['stdio', 'random', 'clocks', 'all']))
|
||||
.addOption(new Option('-e, --enable <feature...>', 'enable WASI features').choices(['http']))
|
||||
.option('--preview2-adapter <adapter>', 'provide a custom preview2 adapter path')
|
||||
.requiredOption('-o, --out <out>', 'output component file')
|
||||
.action(asyncAction(componentize));
|
||||
|
||||
+1
-5
@@ -511,11 +511,7 @@ export async function cliTest(fixtures) {
|
||||
"componentize",
|
||||
"test/fixtures/componentize/source.js",
|
||||
"-d",
|
||||
"clocks",
|
||||
"-d",
|
||||
"random",
|
||||
"-d",
|
||||
"stdio",
|
||||
"all",
|
||||
"-w",
|
||||
"test/fixtures/componentize/source.wit",
|
||||
"-o",
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 13,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
// allow this since we generate `const {} = e;` for empty structs
|
||||
"no-empty-pattern": 0,
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ world test {
|
||||
export consume-bar: func(bar: bar) -> string;
|
||||
|
||||
export hello: func() -> string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,8 @@ export async function preview2Test() {
|
||||
"test/fixtures/componentize/wasi-http-proxy/source.js",
|
||||
"-w",
|
||||
"test/fixtures/wit",
|
||||
"-e",
|
||||
"http",
|
||||
"--world-name",
|
||||
"test:jco/command-extended",
|
||||
"-o",
|
||||
|
||||
Reference in New Issue
Block a user