Skip to content

Commit c35196b

Browse files
committed
Fix emscripten sloppy typescript
Signed-off-by: Andrew Stein <[email protected]>
1 parent 3677c60 commit c35196b

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

packages/perspective-jupyterlab/build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function add(builder, path, path2) {
112112
);
113113
}
114114

115-
const IS_TEST = process.argv.some((x) => x == "--test");
115+
const IS_TEST = process.argv.some((x) => x === "--test");
116116
const BUILD = IS_TEST
117117
? [LAB_BUILD, ...NB_BUILDS, TEST_BUILD]
118118
: [LAB_BUILD, ...NB_BUILDS];
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/upstream/emscripten/tools/emscripten.py b/upstream/emscripten/tools/emscripten.py
2+
index f73e2e1..9129d4f 100644
3+
--- a/upstream/emscripten/tools/emscripten.py
4+
+++ b/upstream/emscripten/tools/emscripten.py
5+
@@ -627,7 +627,7 @@ def create_tsd_exported_runtime_methods(metadata):
6+
tsc = ['tsc']
7+
else:
8+
tsc = shared.get_npm_cmd('tsc')
9+
- cmd = tsc + ['--outFile', tsc_output_file, '--declaration', '--emitDeclarationOnly', '--allowJs', js_doc_file]
10+
+ cmd = tsc + ['--outFile', tsc_output_file, '--declaration', '--skipLibCheck', '--emitDeclarationOnly', '--allowJs', js_doc_file]
11+
shared.check_call(cmd, cwd=path_from_root())
12+
return utils.read_file(tsc_output_file)
13+

tools/perspective-scripts/install_emsdk.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import * as dotenv from "dotenv";
1717
import sh from "./sh.mjs";
1818
import { getWorkspaceRoot, getWorkspacePackageJson } from "./workspace.mjs";
1919

20+
import "zx/globals";
21+
2022
const pkg = getWorkspacePackageJson();
2123

2224
const emscripten = pkg.emscripten;
@@ -66,4 +68,5 @@ if (!process.env.PSP_SKIP_EMSDK_INSTALL) {
6668
}
6769

6870
toolchain_install();
71+
$.sync`cd .emsdk && git apply ../tools/perspective-scripts/emsdk.patch`;
6972
}

tools/perspective-scripts/test_js.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
import sh from "./sh.mjs";
1414
import { getarg, run_with_scope, get_scope } from "./sh_perspective.mjs";
1515

16+
const IS_NEEDS_BUILD = get_scope().some((x) => x === "perspective-jupyterlab");
17+
1618
// Unfortunately we have to handle parts of the Jupyter test case here,
1719
// as the Jupyter server needs to be run outside of the main Jest process.
18-
const IS_JUPYTER =
19-
!!getarg("--jupyter") &&
20-
process.env.PACKAGE.indexOf("perspective-jupyterlab") > -1;
20+
const IS_JUPYTER = !!getarg("--jupyter") && IS_NEEDS_BUILD;
2121

2222
if (getarg("--debug")) {
2323
console.log("-- Running tests in debug mode.");
@@ -88,10 +88,13 @@ if (!IS_JUPYTER) {
8888
}
8989

9090
if (process.env.PACKAGE) {
91+
if (IS_NEEDS_BUILD) {
92+
await run_with_scope`test:jupyter:build`;
93+
}
94+
9195
if (IS_JUPYTER) {
9296
// Jupyterlab is guaranteed to have started at this point, so
9397
// copy the test files over and run the tests.
94-
await run_with_scope`test:jupyter:build`;
9598
playwright("perspective-jupyterlab", true).runSync();
9699
process.exit(0);
97100
}

0 commit comments

Comments
 (0)