Skip to content

Commit

Permalink
Moving tsc build step fully to package.json
Browse files Browse the repository at this point in the history
And other changes to make the build work on Windows
  • Loading branch information
landonxjames committed Nov 20, 2023
1 parent 45e4c5a commit e4d992c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Install Rust
run: rustup update stable --no-self-update && rustup default stable
- name: Install wasm32-unknown-unknown target
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
},
"homepage": "https://github.com/bytecodealliance/jco#readme",
"scripts": {
"build": "cargo xtask build workspace",
"build": "cargo xtask build workspace && npm run build:typescript",
"build:typescript": "tsc -p tsconfig.json",
"build:types:preview2-shim": "cargo xtask generate wasi-types",
"lint": "eslint -c eslintrc.cjs lib/**/*.js packages/*/lib/**/*.js",
"test": "mocha -u tdd test/test.js --timeout 120000"
Expand Down
2 changes: 1 addition & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export async function cliTest (fixtures) {
const { stderr, stdout } = await exec(jcoPath, 'transpile', `test/fixtures/components/${name}.component.wasm`, '--no-namespaced-exports', '--no-wasi-shim', '--name', name, '-o', outDir);
strictEqual(stderr, '');
const source = await readFile(`${outDir}/${name}.js`);
const finalLine = source.toString().split(EOL).at(-1)
const finalLine = source.toString().split("\n").at(-1)
//Check final line is the export statement
ok(finalLine.toString().includes("export {"));
//Check that it does not contain the namespaced export
Expand Down
4 changes: 0 additions & 4 deletions xtask/src/build/jco.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::{Context, Result};
use std::{collections::HashMap, fs, io::Write, path::PathBuf};
use wit_component::ComponentEncoder;
use xshell::{cmd, Shell};

pub(crate) fn run() -> Result<()> {
transpile(
Expand All @@ -13,9 +12,6 @@ pub(crate) fn run() -> Result<()> {
"wasm-tools".to_string(),
)?;

let sh = Shell::new()?;
cmd!(sh, "npx tsc -p tsconfig.json").read()?;

Ok(())
}

Expand Down

0 comments on commit e4d992c

Please sign in to comment.