Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Mar 17, 2023
1 parent 4e96d42 commit 96288dd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,6 +6,7 @@
/deno/
/esbuild
/github/
/lib/deno/lib.deno.d.ts
/npm/@esbuild/android-arm/esbuild.wasm
/npm/@esbuild/android-arm/wasm_exec_node.js
/npm/@esbuild/android-arm/wasm_exec.js
Expand Down
9 changes: 8 additions & 1 deletion Makefile
Expand Up @@ -107,10 +107,17 @@ test-old-ts: platform-neutral | require/old-ts/node_modules
node-unref-tests: | scripts/node_modules
node scripts/node-unref-tests.js

lib-typecheck: | lib/node_modules
lib-typecheck: lib-typecheck-node lib-typecheck-deno

lib-typecheck-node: | lib/node_modules
cd lib && node_modules/.bin/tsc -noEmit -p tsconfig.json

lib-typecheck-deno: lib/deno/lib.deno.d.ts | lib/node_modules
cd lib && node_modules/.bin/tsc -noEmit -p tsconfig-deno.json

lib/deno/lib.deno.d.ts:
deno types > lib/deno/lib.deno.d.ts

# End-to-end tests
test-e2e: test-e2e-npm test-e2e-pnpm test-e2e-yarn-berry test-e2e-deno

Expand Down
3 changes: 3 additions & 0 deletions lib/deno/external.d.ts
@@ -1,3 +1,6 @@
declare module "https://deno.land/x/denoflate@1.2.1/mod.ts" {
export function gunzip(input: Uint8Array): Uint8Array
}

// This is used by "worker.ts"
declare let onmessage: (event: any) => void
2 changes: 1 addition & 1 deletion lib/deno/wasm.ts
Expand Up @@ -79,7 +79,7 @@ export const initialize: typeof types.initialize = async (options) => {

const startRunningService = async (wasmURL: string | URL, wasmModule: WebAssembly.Module | undefined, useWorker: boolean): Promise<Service> => {
let worker: {
onmessage: ((event: any) => void) | null
onmessage?: ((event: any) => void) | null | undefined
postMessage: (data: Uint8Array | ArrayBuffer | WebAssembly.Module) => void
terminate: () => void
}
Expand Down
1 change: 1 addition & 0 deletions lib/tsconfig-deno.json
Expand Up @@ -3,6 +3,7 @@
"module": "esnext", // Allow the "import.meta" and top-level await syntax
"target": "es2017", // Allow calling APIs such as "Object.entries"
"strict": true,
"skipLibCheck": true,
},
"exclude": [
"npm",
Expand Down

0 comments on commit 96288dd

Please sign in to comment.