Skip to content

Commit

Permalink
test(image-io): add python emscripten tests
Browse files Browse the repository at this point in the history
And add additional support: embedded, minified JS module with worker.

Missing read_image_async, etc. functions.
  • Loading branch information
thewtex committed Nov 8, 2023
1 parent 8f73d22 commit eca5bda
Show file tree
Hide file tree
Showing 86 changed files with 9,360 additions and 6,131 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ test/pipelines/bindgen-interface-types-pipeline/wasi-build/
test/pipelines/bindgen-interface-types-pipeline/python-web-demo/

packages/image-io/test/
packages/image-io/typescript/demo-app-rollup/

cypress/screenshots/
cypress/videos/
2 changes: 1 addition & 1 deletion packages/compare-images/typescript/build/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
viteStaticCopy({
targets: [
{ src: '../../../dist/pipelines/*', dest: 'pipelines' },
{ src: '../../../node_modules/@itk-wasm/image-io/dist/pipelines/*.{js,wasm.zst}', dest: 'pipelines' },
{ src: '../../../node_modules/@itk-wasm/image-io/dist/pipelines/*.{js,wasm,wasm.zst}', dest: 'pipelines' },
],
})
],
Expand Down
Empty file.
20 changes: 0 additions & 20 deletions packages/compress-stringify/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import {
parseStringDecompress,
setPipelinesBaseUrl,
getPipelinesBaseUrl,
setPipelineWorkerUrl,
getPipelineWorkerUrl,
} from "@itk-wasm/compress-stringify"
```

Expand Down Expand Up @@ -111,24 +109,6 @@ function setPipelinesBaseUrl(
function getPipelinesBaseUrl() : string | URL
```

#### setPipelineWorkerUrl

*Set base URL for the itk-wasm pipeline worker script when vendored.*

```ts
function setPipelineWorkerUrl(
baseUrl: string | URL
) : void
```

#### getPipelineWorkerUrl

*Get base URL for the itk-wasm pipeline worker script when vendored.*

```ts
function getPipelineWorkerUrl() : string | URL
```

### Node interface

Import:
Expand Down

This file was deleted.

32 changes: 0 additions & 32 deletions packages/compress-stringify/typescript/build/rollup.node.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions packages/compress-stringify/typescript/build/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export default defineConfig({
outDir: '../../../demo-app',
emptyOutDir: true,
},
optimizeDeps: {
exclude: ['itk-wasm']
},
plugins: [
// put lazy loaded JavaScript and Wasm bundles in dist directory
viteStaticCopy({
Expand Down
32 changes: 11 additions & 21 deletions packages/compress-stringify/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"version": "1.0.0",
"description": "Zstandard compression and decompression and base64 encoding and decoding in WebAssembly.",
"type": "module",
"module": "./dist/bundles/compress-stringify.js",
"types": "./dist/src/index.d.ts",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"browser": "./dist/bundles/compress-stringify.js",
"node": "./dist/bundles/compress-stringify-node.js",
"default": "./dist/bundles/compress-stringify.js"
"types": "./dist/index.d.ts",
"browser": "./dist/index.js",
"node": "./dist/index-node.js",
"default": "./dist/index.js"
}
},
"scripts": {
Expand All @@ -25,9 +25,9 @@
"cypress:open": "npx cypress open",
"cypress:runChrome": "npx cypress run --browser chrome",
"cypress:runFirefox": "npx cypress run --browser firefox",
"build": "npm run build:tsc && npm run build:node && npm run build:browser && npm run build:demo",
"build:node": "rollup -c ./build/rollup.node.config.js",
"build:browser": "rollup -c ./build/rollup.browser.config.js",
"build": "npm run build:tsc && npm run build:browser:webWorkers && npm run build:browser:workerEmbedded && npm run build:demo",
"build:browser:webWorkers": "shx mkdir -p dist/web-workers && shx cp node_modules/itk-wasm/dist/core/web-workers/bundles/* ./dist/web-workers/",
"build:browser:workerEmbedded": "esbuild --loader:.worker.js=dataurl --bundle --format=esm --outfile=./dist/compress-stringify-worker-embedded.js ./src/index-worker-embedded.ts",
"build:tsc": "tsc --pretty",
"build:demo": "npm run copyShoelaceAssets && vite -c build/vite.config.js build"
},
Expand All @@ -39,26 +39,16 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"itk-wasm": "^1.0.0-b.149"
"itk-wasm": "^1.0.0-b.152"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.1.0",
"@rollup/plugin-terser": "^0.4.0",
"@rollup/plugin-typescript": "^11.1.1",
"@shoelace-style/shoelace": "^2.5.2",
"@types/node": "^20.2.5",
"ava": "^5.1.0",
"cypress": "^13.3.1",
"rollup": "^3.9.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-ignore": "^1.0.10",
"rollup-plugin-polyfill-node": "^0.12.0",
"esbuild": "^0.19.5",
"shx": "^0.3.4",
"start-server-and-test": "^2.0.0",
"supports-color": "^9.3.1",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.4.11",
"vite-plugin-static-copy": "^0.17.0"
Expand Down
Loading

0 comments on commit eca5bda

Please sign in to comment.