From 668916f2e88552de871b6015d0b38fc27e951592 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Fri, 18 Jul 2025 09:26:56 +0200 Subject: [PATCH 01/13] add (and use) compilation scripts --- crates/xtask/src/build/workspace.rs | 2 +- package.json | 3 ++- packages/jco/package.json | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/xtask/src/build/workspace.rs b/crates/xtask/src/build/workspace.rs index c3c8fd878..664b5b6e5 100644 --- a/crates/xtask/src/build/workspace.rs +++ b/crates/xtask/src/build/workspace.rs @@ -15,6 +15,6 @@ pub(crate) fn run(release: bool) -> anyhow::Result<()> { } // Build Jco TS code - cmd!(sh, "npx -w @bytecodealliance/jco tsc -p tsconfig.json").read()?; + cmd!(sh, "npm run tsc").read()?; Ok(()) } diff --git a/package.json b/package.json index f6b573229..77356e131 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "build:types:preview3-shim": "cargo xtask generate wasi-types preview3", "fmt": "npm run fmt --ws --if-present", "lint": "npm run lint --ws --if-present", - "lint:fix": "npm run lint:fix --ws --if-present" + "lint:fix": "npm run lint:fix --ws --if-present", + "tsc": "npm run --workspaces --if-present tsc" } } diff --git a/packages/jco/package.json b/packages/jco/package.json index ca8d19bcb..238f07a3f 100644 --- a/packages/jco/package.json +++ b/packages/jco/package.json @@ -63,7 +63,8 @@ "lint:fix": "npm run lint -- --fix", "test": "vitest run -c test/vitest.ts", "test:lts": "vitest run -c test/vitest.lts.ts", - "prepack": "cargo xtask build release" + "prepack": "cargo xtask build release", + "tsc": "tsc --build" }, "dependencies": { "@bytecodealliance/componentize-js": "^0.18.3", From db9d30d9e6ed286869c92ec638b296733adf37ae Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Fri, 18 Jul 2025 09:38:49 +0200 Subject: [PATCH 02/13] ignores tsbuildinfo --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3e86e2ea5..51c2ca4b5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ # Typescript /src/**/*.d.ts /src/**/*.d.ts.map +*.tsbuildinfo # Docs /docs/book From 8c80d1bbf04e51c58baf3816678741e46dcc3ce6 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Fri, 18 Jul 2025 09:41:05 +0200 Subject: [PATCH 03/13] updates lock and artifacts --- package-lock.json | 301 +------------------------------ packages/jco/src/api.d.ts | 14 +- packages/jco/src/api.d.ts.map | 2 +- packages/jco/src/common.d.ts | 2 + packages/jco/src/common.d.ts.map | 2 +- 5 files changed, 12 insertions(+), 309 deletions(-) diff --git a/package-lock.json b/package-lock.json index e925792db..315e56011 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,39 +29,6 @@ "@bytecodealliance/jco": "^1.11.1" } }, - "examples/components/add/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/add/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, "examples/components/adder": { "name": "adder-wasm", "dependencies": { @@ -69,78 +36,12 @@ "@bytecodealliance/jco": "^1.11.1" } }, - "examples/components/adder/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/adder/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, "examples/components/host-logging": { "dependencies": { "@bytecodealliance/componentize-js": "^0.18.3", "@bytecodealliance/jco": "^1.11.1" } }, - "examples/components/host-logging/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/host-logging/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, "examples/components/http-hello-world": { "name": "http-hello-world-wasm", "dependencies": { @@ -151,78 +52,12 @@ "terminate": "^2.8.0" } }, - "examples/components/http-hello-world/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/http-hello-world/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, "examples/components/http-server-fetch-handler": { "dependencies": { "@bytecodealliance/componentize-js": "^0.18.3", "@bytecodealliance/jco": "^1.11.1" } }, - "examples/components/http-server-fetch-handler/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/http-server-fetch-handler/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, "examples/components/http-server-hono": { "license": "MIT", "dependencies": { @@ -238,80 +73,12 @@ "typescript": "^5.8.3" } }, - "examples/components/http-server-hono/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "dev": true, - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/http-server-hono/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "dev": true, - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, "examples/components/node-fetch": { "dependencies": { "@bytecodealliance/componentize-js": "^0.18.3", "@bytecodealliance/jco": "^1.11.1" } }, - "examples/components/node-fetch/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/node-fetch/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, "examples/components/string-reverse": { "name": "string-reverse-wasm", "dependencies": { @@ -326,72 +93,6 @@ "@bytecodealliance/jco": "^1.11.1" } }, - "examples/components/string-reverse-upper/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/string-reverse-upper/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, - "examples/components/string-reverse/node_modules/@bytecodealliance/jco": { - "version": "1.11.3", - "resolved": "https://registry.npmjs.org/@bytecodealliance/jco/-/jco-1.11.3.tgz", - "integrity": "sha512-Ynv0GDj9iAp+cS03UGg+ss4uo/Hx5e4FyjcFDBfkRt9qJsqbL2AnPqgO/ORNlSXg9zu9PTNC0uGgE7/Vklcn/w==", - "license": "(Apache-2.0 WITH LLVM-exception)", - "dependencies": { - "@bytecodealliance/componentize-js": "^0.17.0", - "@bytecodealliance/preview2-shim": "^0.17.2", - "binaryen": "^123.0.0", - "chalk-template": "^1", - "commander": "^12", - "mkdirp": "^3", - "ora": "^8", - "terser": "^5" - }, - "bin": { - "jco": "src/jco.js" - } - }, - "examples/components/string-reverse/node_modules/@bytecodealliance/jco/node_modules/@bytecodealliance/componentize-js": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@bytecodealliance/componentize-js/-/componentize-js-0.17.0.tgz", - "integrity": "sha512-FDgO5UPipfjyq5OghSB4JW313LkQJK3Sl647WH1jvIuYAyCq1j+bMt+Q66c3UF6IVs6PneNTGfGSjYgzID/k0w==", - "workspaces": [ - "." - ], - "dependencies": { - "@bytecodealliance/jco": "^1.9.1", - "@bytecodealliance/weval": "^0.3.3", - "@bytecodealliance/wizer": "^7.0.5", - "es-module-lexer": "^1.6.0" - } - }, "examples/components/webidl-book-library": { "name": "webidl-book-library-wasm", "devDependencies": { @@ -5761,7 +5462,7 @@ }, "packages/jco": { "name": "@bytecodealliance/jco", - "version": "1.12.0-rc.1", + "version": "1.12.0", "license": "(Apache-2.0 WITH LLVM-exception)", "dependencies": { "@bytecodealliance/componentize-js": "^0.18.3", diff --git a/packages/jco/src/api.d.ts b/packages/jco/src/api.d.ts index 6bef5ad12..6c9fce0a8 100644 --- a/packages/jco/src/api.d.ts +++ b/packages/jco/src/api.d.ts @@ -2,39 +2,39 @@ * @param {Parameters[0]} binary * @return {Promise>} */ -export function print(binary: Parameters[0]): Promise>; +export function print(binary: Parameters[0]): Promise>; /** * @param {Parameters[0]} wat * @return {Promise>} */ -export function parse(wat: Parameters[0]): Promise>; +export function parse(wat: Parameters[0]): Promise>; /** * @param {Parameters[0]} binary * @return {Promise>} */ -export function componentWit(binary: Parameters[0]): Promise>; +export function componentWit(binary: Parameters[0]): Promise>; /** * @param {Parameters[0]} binary * @param {Parameters[1]} adapters * @return {Promise>} */ -export function componentNew(binary: Parameters[0], adapters: Parameters[1]): Promise>; +export function componentNew(binary: Parameters[0], adapters: Parameters[1]): Promise>; /** * @param {Parameters[0]} embedOpts * @return {Promise>} */ -export function componentEmbed(embedOpts: Parameters[0]): Promise>; +export function componentEmbed(embedOpts: Parameters[0]): Promise>; /** * @param {Parameters[0]} binary * @param {Parameters[1]} metadata * @return {Promise>} */ -export function metadataAdd(binary: Parameters[0], metadata: Parameters[1]): Promise>; +export function metadataAdd(binary: Parameters[0], metadata: Parameters[1]): Promise>; /** * @param {Parameters[0]} binary * @return {Promise>} */ -export function metadataShow(binary: Parameters[0]): Promise>; +export function metadataShow(binary: Parameters[0]): Promise>; export function preview1AdapterCommandPath(): URL; export function preview1AdapterReactorPath(): URL; export { optimizeComponent as opt } from "./cmd/opt.js"; diff --git a/packages/jco/src/api.d.ts.map b/packages/jco/src/api.d.ts.map index da3dcb6e1..80287a46a 100644 --- a/packages/jco/src/api.d.ts.map +++ b/packages/jco/src/api.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["api.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,8BAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAKpE;AACD;;;GAGG;AACH,2BAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAKpE;AACD;;;GAGG;AACH,qCAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAK3E;AACD;;;;GAIG;AACH,qCAJW,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,YAC1D,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAK3E;AACD;;;GAGG;AACH,0CAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,GAC3D,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,cAAc,CAAC,CAAC,CAK7E;AACD;;;;GAIG;AACH,oCAJW,UAAU,CAAC,OAAO,sBAAsB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,YACzD,UAAU,CAAC,OAAO,sBAAsB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GACxD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,WAAW,CAAC,CAAC,CAK1E;AACD;;;GAGG;AACH,qCAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAK3E;AACD,kDAKC;AACD,kDAKC"} \ No newline at end of file +{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["api.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,8BAHW,UAAU,CAAC,GAAoC,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,UAAU,CAAC,GAAoC,CAAC,CAAC,CAKpE;AACD;;;GAGG;AACH,2BAHW,UAAU,CAAC,GAAoC,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,UAAU,CAAC,GAAoC,CAAC,CAAC,CAKpE;AACD;;;GAGG;AACH,qCAHW,UAAU,CAAC,GAA2C,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,GAA2C,CAAC,CAAC,CAK3E;AACD;;;;GAIG;AACH,qCAJW,UAAU,CAAC,GAA2C,CAAC,CAAC,CAAC,CAAC,YAC1D,UAAU,CAAC,GAA2C,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,GAA2C,CAAC,CAAC,CAK3E;AACD;;;GAGG;AACH,0CAHW,UAAU,CAAC,GAA6C,CAAC,CAAC,CAAC,CAAC,GAC3D,OAAO,CAAC,UAAU,CAAC,GAA6C,CAAC,CAAC,CAK7E;AACD;;;;GAIG;AACH,oCAJW,UAAU,CAAC,GAA0C,CAAC,CAAC,CAAC,CAAC,YACzD,UAAU,CAAC,GAA0C,CAAC,CAAC,CAAC,CAAC,GACxD,OAAO,CAAC,UAAU,CAAC,GAA0C,CAAC,CAAC,CAK1E;AACD;;;GAGG;AACH,qCAHW,UAAU,CAAC,GAA2C,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,GAA2C,CAAC,CAAC,CAK3E;AACD,kDAKC;AACD,kDAKC"} \ No newline at end of file diff --git a/packages/jco/src/common.d.ts b/packages/jco/src/common.d.ts index 8c0f1be49..ce40069d1 100644 --- a/packages/jco/src/common.d.ts +++ b/packages/jco/src/common.d.ts @@ -12,6 +12,8 @@ export function getTmpDir(): Promise; export function spawnIOTmp(cmd: any, input: any, args: any): Promise>; export function writeFiles(files: any, summaryTitle: any): Promise; export const isWindows: boolean; +export const ASYNC_WASI_IMPORTS: string[]; +export const ASYNC_WASI_EXPORTS: string[]; export { readFileCli as readFile }; declare function readFileCli(file: any, encoding: any): Promise>; //# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/packages/jco/src/common.d.ts.map b/packages/jco/src/common.d.ts.map index aff35feef..054680cf6 100644 --- a/packages/jco/src/common.d.ts.map +++ b/packages/jco/src/common.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.js"],"names":[],"mappings":"AA2BA,+CAEC;AACD,0CAIC;AAED,0CASC;AAED,mEAcC;AAED,wDAoBC;AAED;;;;GAIG;AACH,6CAEC;AAWD,8FAiCC;AAED,yEAmBC;AArJD,gCAA8C;;AAsF9C,yFAMC"} \ No newline at end of file +{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.js"],"names":[],"mappings":"AA4BA,+CAEC;AACD,0CAIC;AAED,0CASC;AAED,mEAcC;AAED,wDAoBC;AAED;;;;GAIG;AACH,6CAEC;AAWD,8FAiCC;AAED,yEAmBC;AArJD,gCAA8C;AAE9C,0CASE;AAEF,0CAGE;;AAsEF,yFAMC"} \ No newline at end of file From b791ea7e56fbba660f2666f9643174a88a2497ed Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Fri, 18 Jul 2025 09:58:59 +0200 Subject: [PATCH 04/13] adds some dependencies --- package-lock.json | 13 +++++++++++++ packages/jco-transpile/package.json | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/package-lock.json b/package-lock.json index 315e56011..caed0b9a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1397,6 +1397,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@tsconfig/node22": { + "version": "22.0.2", + "resolved": "https://registry.npmjs.org/@tsconfig/node22/-/node22-22.0.2.tgz", + "integrity": "sha512-Kmwj4u8sDRDrMYRoN9FDEcXD8UpBSaPQQ24Gz+Gamqfm7xxn+GBR7ge/Z7pK8OXNGyUzbSwJj+TH6B+DS/epyA==", + "dev": true, + "license": "MIT" + }, "node_modules/@tybys/wasm-util": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.0.tgz", @@ -4971,6 +4978,8 @@ }, "node_modules/typescript": { "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -5504,6 +5513,10 @@ "@bytecodealliance/preview2-shim": "^0.17.2", "chalk-template": "^1", "terser": "^5" + }, + "devDependencies": { + "@tsconfig/node22": "^22.0.2", + "typescript": "^5.8.3" } }, "packages/preview2-shim": { diff --git a/packages/jco-transpile/package.json b/packages/jco-transpile/package.json index d288ea741..1112d6907 100644 --- a/packages/jco-transpile/package.json +++ b/packages/jco-transpile/package.json @@ -53,5 +53,9 @@ "@bytecodealliance/preview2-shim": "^0.17.2", "chalk-template": "^1", "terser": "^5" + }, + "devDependencies": { + "@tsconfig/node22": "^22.0.2", + "typescript": "^5.8.3" } } From dd94330ec86211fb4823ea8dd38f32f44935ab2d Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Fri, 18 Jul 2025 10:01:14 +0200 Subject: [PATCH 05/13] adds build scripts, ignore dist --- .gitignore | 2 +- packages/jco-transpile/package.json | 3 ++- packages/jco-transpile/tsconfig.json | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 packages/jco-transpile/tsconfig.json diff --git a/.gitignore b/.gitignore index 51c2ca4b5..0550f0e6d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ # Generated ouput /target -/dist /jco.sh +dist/ # Typescript /src/**/*.d.ts diff --git a/packages/jco-transpile/package.json b/packages/jco-transpile/package.json index 1112d6907..0a8e3bbdb 100644 --- a/packages/jco-transpile/package.json +++ b/packages/jco-transpile/package.json @@ -47,7 +47,8 @@ "lint:fix": "npm run lint -- --fix", "test": "vitest run -c test/vitest.ts", "setup:vendor": "npm run -w @bytecodealliance/jco build:release && cp ../jco/obj/*.core*.wasm vendor && cp ../jco/obj/*.js vendor && cp ../jco/obj/*.ts vendor && cp -r ../jco/obj/interfaces vendor", - "prepack": "npm run setup:vendor" + "prepack": "npm run setup:vendor", + "tsc": "tsc --build" }, "dependencies": { "@bytecodealliance/preview2-shim": "^0.17.2", diff --git a/packages/jco-transpile/tsconfig.json b/packages/jco-transpile/tsconfig.json new file mode 100644 index 000000000..d90953363 --- /dev/null +++ b/packages/jco-transpile/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@tsconfig/node22", + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "sourceMap": true, + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "composite": true, + "allowJs": true + }, + "include": ["src/**/*"] +} From fa60956379107a2239cd453f6c559e4560d534f3 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Fri, 18 Jul 2025 10:01:48 +0200 Subject: [PATCH 06/13] removes build artifacts --- packages/jco-transpile/src/common.d.ts | 42 -------- packages/jco-transpile/src/common.d.ts.map | 1 - packages/jco-transpile/src/index.d.ts | 2 - packages/jco-transpile/src/opt.d.ts | 11 --- packages/jco-transpile/src/transpile.d.ts | 97 ------------------- packages/jco-transpile/src/transpile.d.ts.map | 1 - packages/jco-transpile/src/typegen.d.ts | 32 ------ 7 files changed, 186 deletions(-) delete mode 100644 packages/jco-transpile/src/common.d.ts delete mode 100644 packages/jco-transpile/src/common.d.ts.map delete mode 100644 packages/jco-transpile/src/index.d.ts delete mode 100644 packages/jco-transpile/src/opt.d.ts delete mode 100644 packages/jco-transpile/src/transpile.d.ts delete mode 100644 packages/jco-transpile/src/transpile.d.ts.map delete mode 100644 packages/jco-transpile/src/typegen.d.ts diff --git a/packages/jco-transpile/src/common.d.ts b/packages/jco-transpile/src/common.d.ts deleted file mode 100644 index 7309b119f..000000000 --- a/packages/jco-transpile/src/common.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export function setShowSpinner(val: boolean): void; -export function getShowSpinner(): boolean; - -interface SizeStrOpts { - significantDigits?: number; -} -export function sizeStr(num: any, opts?: SizeStrOpts): string; - -export function fixedDigitDisplay(num: number, maxChars: number): string; - -type CellAlignment = 'left' | 'right'; -export function table(data: any[][], cellAlignment?: CellAlignment[]): string; - -export function getTmpDir(): Promise; - -export function spawnIOTmp( - cmd: any, - input: any, - args: any -): Promise>; - -export const isWindows: boolean; - -export function readFile( - file: string, - encoding: string -): Promise>; - -export function spawnIOTmp( - cmd: string, - input: Buffer | string | any, - args: string[] -): Promise; - -export function byteLengthLEB128(val: number): number; - -/** Bytes that belong in one or more files */ -type FileBytes = { - [filename: string]: Uint8Array; -}; - -//# sourceMappingURL=common.d.ts.map diff --git a/packages/jco-transpile/src/common.d.ts.map b/packages/jco-transpile/src/common.d.ts.map deleted file mode 100644 index 6a692ec0e..000000000 --- a/packages/jco-transpile/src/common.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.js"],"names":[],"mappings":"AAWA,+CAEC;AACD,0CAIC;AAED,0CASC;AAED,mEAcC;AAED,wDAoBC;AAED;;;;GAIG;AACH,6CAEC;AAWD,8FAiCC;AAhHD,gCAA8C;;AAsE9C,yFAMC"} \ No newline at end of file diff --git a/packages/jco-transpile/src/index.d.ts b/packages/jco-transpile/src/index.d.ts deleted file mode 100644 index c41d746ea..000000000 --- a/packages/jco-transpile/src/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export type { generateGuestTypes, generateHostTypes } from './typegen.js'; -export type { transpile } from './transpile.js'; diff --git a/packages/jco-transpile/src/opt.d.ts b/packages/jco-transpile/src/opt.d.ts deleted file mode 100644 index 11743da5a..000000000 --- a/packages/jco-transpile/src/opt.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -type OptimizeOptions = { - quiet: boolean; - asyncify?: boolean; - optArgs?: string[]; - noVerify?: boolean; -}; - -type OptimizeResult = { - component: Uint8Array; - compressionInfo: { beforeBytes: number; afterBytes: number }[]; -}; diff --git a/packages/jco-transpile/src/transpile.d.ts b/packages/jco-transpile/src/transpile.d.ts deleted file mode 100644 index a5cfabb8f..000000000 --- a/packages/jco-transpile/src/transpile.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -import { Command } from 'commander'; - -type TypeGenerationOptions = { - name?: string; - worldName?: string; - instantiation?: 'async' | 'sync'; - tlaCompat?: boolean; - asyncMode?: string; - asyncImports?: string[]; - asyncExports?: string[]; - outDir?: string; - features?: string[] | 'all'; - allFeatures?: boolean; - asyncWasiImports?: boolean; - asyncWasiExports?: boolean; - guest?: boolean; -}; - -export function types( - witPath: string, - opts?: TypeGenerationOptions -): Promise; - -export function guestTypes( - witPath: string, - opts: TypeGenerationOptions -): Promise; - -/** Bytes that belong in one or more files */ -type FileBytes = { - [filename: string]: Uint8Array; -}; - -/** - * @param {string} witPath - * @param {{ - * name?: string, - * worldName?: string, - * instantiation?: 'async' | 'sync', - * tlaCompat?: bool, - * asyncMode?: string, - * asyncImports?: string[], - * asyncExports?: string[], - * outDir?: string, - * features?: string[] | 'all', - * guest?: bool, - * }} opts - * @returns {Promise<{ [filename: string]: Uint8Array }>} - */ -export function typesComponent( - witPath: string, - opts: TypeGenerationOptions -): Promise; - -type TranspilationOptions = { - name: string; - instantiation?: 'async' | 'sync'; - importBindings?: 'js' | 'optimized' | 'hybrid' | 'direct-optimized'; - map?: Record; - asyncMode?: string; - asyncImports?: string[]; - asyncExports?: string[]; - asyncWasiImports?: string[]; - asyncWasiExports?: string[]; - validLiftingOptimization?: boolean; - tracing?: boolean; - nodejsCompat?: boolean; - tlaCompat?: boolean; - base64Cutoff?: boolean; - js?: boolean; - minify?: boolean; - optimize?: boolean; - namespacedExports?: boolean; - outDir?: string; - multiMemory?: boolean; - experimentalIdlImports?: boolean; - optArgs?: string[]; -}; - -export function transpile( - componentPath: string, - opts?: TranspilationOptions, - program?: Command -): Promise; - -type TranspilationResult = { - files: FileBytes; - imports: string[]; - exports: [string, 'function' | 'instance'][]; -}; - -export function runTranspileComponent( - component: Uint8Array, - opts?: TranspilationOptions, -): Promise; - -//# sourceMappingURL=transpile.d.ts.map diff --git a/packages/jco-transpile/src/transpile.d.ts.map b/packages/jco-transpile/src/transpile.d.ts.map deleted file mode 100644 index f9dceb062..000000000 --- a/packages/jco-transpile/src/transpile.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transpile.d.ts","sourceRoot":"","sources":["transpile.js"],"names":[],"mappings":"AA+CA,8DAGC;AAED,mEAMC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wCAfW,MAAM,QACN;IACN,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC5B,KAAK,CAAC,EAAE,IAAI,CAAC;CACd,GACS,OAAO,CAAC;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC,CA+DvD;AAyCD,sFAoCC;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,8CAzBW,UAAU,SACV;IACN,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,cAAc,CAAC,EAAE,IAAI,GAAG,WAAW,GAAG,QAAQ,GAAG,kBAAkB,CAAC;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,wBAAwB,CAAC,EAAE,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,sBAAsB,CAAC,EAAE,IAAI,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GACS,OAAO,CAAC;IAAE,KAAK,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,EAAE,CAAA;CAAE,CAAC,CAyTnI"} \ No newline at end of file diff --git a/packages/jco-transpile/src/typegen.d.ts b/packages/jco-transpile/src/typegen.d.ts deleted file mode 100644 index a3e9cc7b0..000000000 --- a/packages/jco-transpile/src/typegen.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { FileBytes } from './common'; - -type TypeGenerationOptions = { - name?: string; - worldName?: string; - instantiation?: 'async' | 'sync'; - tlaCompat?: boolean; - asyncMode?: string; - asyncImports?: string[]; - asyncExports?: string[]; - outDir?: string; - features?: string[] | 'all'; - allFeatures?: boolean; - asyncWasiImports?: boolean; - asyncWasiExports?: boolean; - guest?: boolean; -}; - -export function generateHostTypes( - witPath: string, - opts?: TypeGenerationOptions -): Promise; - -export function generateGuestTypes( - witPath: string, - opts: TypeGenerationOptions -): Promise; - -export function runTypesComponent( - witPath: string, - opts: TypeGenerationOptions -): Promise; From 04306633331c51830560e452c1314dd0086a1e42 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Fri, 18 Jul 2025 10:06:04 +0200 Subject: [PATCH 07/13] update conf to use the build artifacts --- packages/jco-transpile/package.json | 5 ++--- packages/jco-transpile/types/index.d.ts | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 packages/jco-transpile/types/index.d.ts diff --git a/packages/jco-transpile/package.json b/packages/jco-transpile/package.json index 0a8e3bbdb..6e8b511d6 100644 --- a/packages/jco-transpile/package.json +++ b/packages/jco-transpile/package.json @@ -35,10 +35,9 @@ "vendor", "src" ], - "types": "./types/index.d.ts", "exports": { ".": { - "types": "./src/index.d.ts", + "types": "./dist/index.d.ts", "default": "./src/index.js" } }, @@ -47,7 +46,7 @@ "lint:fix": "npm run lint -- --fix", "test": "vitest run -c test/vitest.ts", "setup:vendor": "npm run -w @bytecodealliance/jco build:release && cp ../jco/obj/*.core*.wasm vendor && cp ../jco/obj/*.js vendor && cp ../jco/obj/*.ts vendor && cp -r ../jco/obj/interfaces vendor", - "prepack": "npm run setup:vendor", + "prepack": "npm run setup:vendor ; npm run tsc", "tsc": "tsc --build" }, "dependencies": { diff --git a/packages/jco-transpile/types/index.d.ts b/packages/jco-transpile/types/index.d.ts deleted file mode 100644 index e0a333f2c..000000000 --- a/packages/jco-transpile/types/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { transpile } from '../src/cmd/transpile.d.ts'; From 85750d5a7c4034ff899e6226c1f131c3fc8ca914 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Sat, 19 Jul 2025 15:13:41 +0200 Subject: [PATCH 08/13] chore(comment): clarifies compilation intent --- crates/xtask/src/build/workspace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/xtask/src/build/workspace.rs b/crates/xtask/src/build/workspace.rs index 664b5b6e5..aa7df8255 100644 --- a/crates/xtask/src/build/workspace.rs +++ b/crates/xtask/src/build/workspace.rs @@ -14,7 +14,7 @@ pub(crate) fn run(release: bool) -> anyhow::Result<()> { cmd!(sh, "cargo build --workspace --target wasm32-wasip1").read()?; } - // Build Jco TS code + // Compiles code in all packages where applicable cmd!(sh, "npm run tsc").read()?; Ok(()) } From fd8ac55cf77163168912fb288b146c50286358b9 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Sat, 19 Jul 2025 15:18:01 +0200 Subject: [PATCH 09/13] chore(build): rename tsc task to ts:build --- crates/xtask/src/build/workspace.rs | 2 +- package.json | 4 ++-- packages/jco-transpile/package.json | 4 ++-- packages/jco/package.json | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/xtask/src/build/workspace.rs b/crates/xtask/src/build/workspace.rs index aa7df8255..b98d3cbfb 100644 --- a/crates/xtask/src/build/workspace.rs +++ b/crates/xtask/src/build/workspace.rs @@ -15,6 +15,6 @@ pub(crate) fn run(release: bool) -> anyhow::Result<()> { } // Compiles code in all packages where applicable - cmd!(sh, "npm run tsc").read()?; + cmd!(sh, "npm run build:ts").read()?; Ok(()) } diff --git a/package.json b/package.json index 77356e131..9c3e18a53 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ "build:release": "cargo xtask build release", "build:types:preview2-shim": "cargo xtask generate wasi-types preview2", "build:types:preview3-shim": "cargo xtask generate wasi-types preview3", + "build:ts": "npm run --workspaces --if-present build:ts", "fmt": "npm run fmt --ws --if-present", "lint": "npm run lint --ws --if-present", - "lint:fix": "npm run lint:fix --ws --if-present", - "tsc": "npm run --workspaces --if-present tsc" + "lint:fix": "npm run lint:fix --ws --if-present" } } diff --git a/packages/jco-transpile/package.json b/packages/jco-transpile/package.json index 6e8b511d6..100fb6bb7 100644 --- a/packages/jco-transpile/package.json +++ b/packages/jco-transpile/package.json @@ -44,10 +44,10 @@ "scripts": { "lint": "eslint -c ../../eslint.config.mjs ./src/**/*.js ./test/**/*.js", "lint:fix": "npm run lint -- --fix", + "build:ts": "tsc --build", "test": "vitest run -c test/vitest.ts", "setup:vendor": "npm run -w @bytecodealliance/jco build:release && cp ../jco/obj/*.core*.wasm vendor && cp ../jco/obj/*.js vendor && cp ../jco/obj/*.ts vendor && cp -r ../jco/obj/interfaces vendor", - "prepack": "npm run setup:vendor ; npm run tsc", - "tsc": "tsc --build" + "prepack": "npm run setup:vendor ; npm run build:ts" }, "dependencies": { "@bytecodealliance/preview2-shim": "^0.17.2", diff --git a/packages/jco/package.json b/packages/jco/package.json index 238f07a3f..9ed432c17 100644 --- a/packages/jco/package.json +++ b/packages/jco/package.json @@ -58,13 +58,13 @@ "build": "cargo xtask build debug", "build:release": "cargo xtask build release", "build:types:preview2-shim": "npm run build:types:preview2-shim --include-workspace-root", + "build:ts": "tsc --build", "fmt": "prettier . --write", "lint": "eslint -c ../../eslint.config.mjs --ext .js src test", "lint:fix": "npm run lint -- --fix", "test": "vitest run -c test/vitest.ts", "test:lts": "vitest run -c test/vitest.lts.ts", - "prepack": "cargo xtask build release", - "tsc": "tsc --build" + "prepack": "cargo xtask build release" }, "dependencies": { "@bytecodealliance/componentize-js": "^0.18.3", From 6df75040ccb8bafdc3d37410647653f525083ce3 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Sat, 19 Jul 2025 15:27:41 +0200 Subject: [PATCH 10/13] not compile the jco package --- packages/jco/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/jco/package.json b/packages/jco/package.json index 9ed432c17..ca8d19bcb 100644 --- a/packages/jco/package.json +++ b/packages/jco/package.json @@ -58,7 +58,6 @@ "build": "cargo xtask build debug", "build:release": "cargo xtask build release", "build:types:preview2-shim": "npm run build:types:preview2-shim --include-workspace-root", - "build:ts": "tsc --build", "fmt": "prettier . --write", "lint": "eslint -c ../../eslint.config.mjs --ext .js src test", "lint:fix": "npm run lint -- --fix", From d3b123150a61fe1465efb6042d6539f0f3efe7f0 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Sat, 19 Jul 2025 15:33:23 +0200 Subject: [PATCH 11/13] chore(build): remove @tsconfig/node dependency --- package-lock.json | 8 -------- packages/jco-transpile/package.json | 1 - packages/jco-transpile/tsconfig.json | 10 ++++++---- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index caed0b9a9..d9c011ef6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1397,13 +1397,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@tsconfig/node22": { - "version": "22.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node22/-/node22-22.0.2.tgz", - "integrity": "sha512-Kmwj4u8sDRDrMYRoN9FDEcXD8UpBSaPQQ24Gz+Gamqfm7xxn+GBR7ge/Z7pK8OXNGyUzbSwJj+TH6B+DS/epyA==", - "dev": true, - "license": "MIT" - }, "node_modules/@tybys/wasm-util": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.0.tgz", @@ -5515,7 +5508,6 @@ "terser": "^5" }, "devDependencies": { - "@tsconfig/node22": "^22.0.2", "typescript": "^5.8.3" } }, diff --git a/packages/jco-transpile/package.json b/packages/jco-transpile/package.json index 100fb6bb7..030a28bb2 100644 --- a/packages/jco-transpile/package.json +++ b/packages/jco-transpile/package.json @@ -55,7 +55,6 @@ "terser": "^5" }, "devDependencies": { - "@tsconfig/node22": "^22.0.2", "typescript": "^5.8.3" } } diff --git a/packages/jco-transpile/tsconfig.json b/packages/jco-transpile/tsconfig.json index d90953363..7e94a99ef 100644 --- a/packages/jco-transpile/tsconfig.json +++ b/packages/jco-transpile/tsconfig.json @@ -1,14 +1,16 @@ { - "extends": "@tsconfig/node22", "compilerOptions": { - "rootDir": "src", - "outDir": "dist", + "module": "nodenext", + "moduleResolution": "nodenext", + "strict": true, "sourceMap": true, "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, "composite": true, - "allowJs": true + "allowJs": true, + "rootDir": "src", + "outDir": "dist", }, "include": ["src/**/*"] } From baf2a7146820544a1db7a58720a421f7f33bf4c5 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Sat, 19 Jul 2025 15:37:56 +0200 Subject: [PATCH 12/13] chore(revert): revert api.d.ts(.map) --- packages/jco/src/api.d.ts | 14 +++++++------- packages/jco/src/api.d.ts.map | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/jco/src/api.d.ts b/packages/jco/src/api.d.ts index 6c9fce0a8..6bef5ad12 100644 --- a/packages/jco/src/api.d.ts +++ b/packages/jco/src/api.d.ts @@ -2,39 +2,39 @@ * @param {Parameters[0]} binary * @return {Promise>} */ -export function print(binary: Parameters[0]): Promise>; +export function print(binary: Parameters[0]): Promise>; /** * @param {Parameters[0]} wat * @return {Promise>} */ -export function parse(wat: Parameters[0]): Promise>; +export function parse(wat: Parameters[0]): Promise>; /** * @param {Parameters[0]} binary * @return {Promise>} */ -export function componentWit(binary: Parameters[0]): Promise>; +export function componentWit(binary: Parameters[0]): Promise>; /** * @param {Parameters[0]} binary * @param {Parameters[1]} adapters * @return {Promise>} */ -export function componentNew(binary: Parameters[0], adapters: Parameters[1]): Promise>; +export function componentNew(binary: Parameters[0], adapters: Parameters[1]): Promise>; /** * @param {Parameters[0]} embedOpts * @return {Promise>} */ -export function componentEmbed(embedOpts: Parameters[0]): Promise>; +export function componentEmbed(embedOpts: Parameters[0]): Promise>; /** * @param {Parameters[0]} binary * @param {Parameters[1]} metadata * @return {Promise>} */ -export function metadataAdd(binary: Parameters[0], metadata: Parameters[1]): Promise>; +export function metadataAdd(binary: Parameters[0], metadata: Parameters[1]): Promise>; /** * @param {Parameters[0]} binary * @return {Promise>} */ -export function metadataShow(binary: Parameters[0]): Promise>; +export function metadataShow(binary: Parameters[0]): Promise>; export function preview1AdapterCommandPath(): URL; export function preview1AdapterReactorPath(): URL; export { optimizeComponent as opt } from "./cmd/opt.js"; diff --git a/packages/jco/src/api.d.ts.map b/packages/jco/src/api.d.ts.map index 80287a46a..da3dcb6e1 100644 --- a/packages/jco/src/api.d.ts.map +++ b/packages/jco/src/api.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["api.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,8BAHW,UAAU,CAAC,GAAoC,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,UAAU,CAAC,GAAoC,CAAC,CAAC,CAKpE;AACD;;;GAGG;AACH,2BAHW,UAAU,CAAC,GAAoC,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,UAAU,CAAC,GAAoC,CAAC,CAAC,CAKpE;AACD;;;GAGG;AACH,qCAHW,UAAU,CAAC,GAA2C,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,GAA2C,CAAC,CAAC,CAK3E;AACD;;;;GAIG;AACH,qCAJW,UAAU,CAAC,GAA2C,CAAC,CAAC,CAAC,CAAC,YAC1D,UAAU,CAAC,GAA2C,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,GAA2C,CAAC,CAAC,CAK3E;AACD;;;GAGG;AACH,0CAHW,UAAU,CAAC,GAA6C,CAAC,CAAC,CAAC,CAAC,GAC3D,OAAO,CAAC,UAAU,CAAC,GAA6C,CAAC,CAAC,CAK7E;AACD;;;;GAIG;AACH,oCAJW,UAAU,CAAC,GAA0C,CAAC,CAAC,CAAC,CAAC,YACzD,UAAU,CAAC,GAA0C,CAAC,CAAC,CAAC,CAAC,GACxD,OAAO,CAAC,UAAU,CAAC,GAA0C,CAAC,CAAC,CAK1E;AACD;;;GAGG;AACH,qCAHW,UAAU,CAAC,GAA2C,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,GAA2C,CAAC,CAAC,CAK3E;AACD,kDAKC;AACD,kDAKC"} \ No newline at end of file +{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["api.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,8BAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAKpE;AACD;;;GAGG;AACH,2BAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC,CAKpE;AACD;;;GAGG;AACH,qCAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAK3E;AACD;;;;GAIG;AACH,qCAJW,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,YAC1D,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAK3E;AACD;;;GAGG;AACH,0CAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,GAC3D,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,cAAc,CAAC,CAAC,CAK7E;AACD;;;;GAIG;AACH,oCAJW,UAAU,CAAC,OAAO,sBAAsB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,YACzD,UAAU,CAAC,OAAO,sBAAsB,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,GACxD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,WAAW,CAAC,CAAC,CAK1E;AACD;;;GAGG;AACH,qCAHW,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,GACzD,OAAO,CAAC,UAAU,CAAC,OAAO,sBAAsB,EAAE,YAAY,CAAC,CAAC,CAK3E;AACD,kDAKC;AACD,kDAKC"} \ No newline at end of file From 7de0ea5e4711bc52983ccf2c9215765eee3e96e6 Mon Sep 17 00:00:00 2001 From: Elmer Bulthuis Date: Sat, 19 Jul 2025 15:39:38 +0200 Subject: [PATCH 13/13] adds dist to files --- packages/jco-transpile/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jco-transpile/package.json b/packages/jco-transpile/package.json index 030a28bb2..f5d979f33 100644 --- a/packages/jco-transpile/package.json +++ b/packages/jco-transpile/package.json @@ -33,7 +33,8 @@ "files": [ "types", "vendor", - "src" + "src", + "dist" ], "exports": { ".": {