Skip to content

Commit bb53acb

Browse files
committed
Move wrapper files outside of the example folder (into lib-wrapper folder)
1 parent 6a3f545 commit bb53acb

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

cardano-wasm/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ That will create it with the name `cardano-wasm.js` in the current folder.
203203

204204
You can find more information in [this url](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/wasm.html).
205205

206-
And you can find an example of how to use it in the `example` subfolder. This example assumes that the generated `.wasm` and `.js` files reside in the same folder as the code in `example` subfolder.
206+
And you can find an example of how to use it in the `example` subfolder. This example assumes that the generated `.wasm` and `.js` files as well as the files from the `lib-wrapper` subfolder, all reside in the same folder as the code in `example` subfolder.
207207

208208
## Running the example
209209

@@ -214,12 +214,13 @@ To run the example in the `example` subfolder:
214214
echo "$(env -u CABAL_CONFIG wasm32-wasi-cabal list-bin exe:cardano-wasm | tail -n1)"
215215
```
216216
2. Copy the generated `cardano-wasm.js` file (generated by the `post-link.mjs` command in the section above) to the `example` subfolder.
217-
3. Navigate to the `example` subfolder in your terminal.
218-
4. Due to browser security restrictions (CORS policy), you may need to serve the `index.html` file through a local HTTP server. A simple way to do this is using Python's built-in HTTP server:
217+
3. Copy the wrapper files from the `lib-wrapper` folder into the `example` subfolder.
218+
4. Navigate to the `example` subfolder in your terminal.
219+
5. Due to browser security restrictions (CORS policy), you may need to serve the `index.html` file through a local HTTP server. A simple way to do this is using Python's built-in HTTP server:
219220
```console
220221
python3 -m http.server 8001
221222
```
222-
5. Open your web browser and navigate to `http://localhost:8001/`. You should see a blank page, and if you open the developer console you should be able to see an output like the following:
223+
6. Open your web browser and navigate to `http://localhost:8001/`. You should see a blank page, and if you open the developer console you should be able to see an output like the following:
223224
```console
224225
[Log] wasi: – 0 – 0 (wasi.js, line 1)
225226
[Log] wasi: – 0 – 0 (wasi.js, line 1)

cardano-wasm/test/cardano-wasm-golden/Test/Golden/Cardano/Wasm/TypeScript.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ hprop_cardano_wasm_typescript_declarations_match_generated :: Property
77
hprop_cardano_wasm_typescript_declarations_match_generated =
88
H.propertyOnce $ do
99
result <- H.execFlex "cardano-wasm" "CARDANO_WASM" []
10-
H.diffVsGoldenFile result "example/cardano-api.d.ts"
10+
H.diffVsGoldenFile result "lib-wrapper/cardano-api.d.ts"

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
};
152152
})
153153
({pkgs, config, ...}: let
154-
generatedExampleFiles = ["cardano-wasm/example/cardano-api.d.ts"];
154+
generatedExampleFiles = ["cardano-wasm/lib-wrapper/cardano-api.d.ts"];
155155
exportWasmPath = "export CARDANO_WASM=${config.hsPkgs.cardano-wasm.components.exes.cardano-wasm}/bin/cardano-wasm${pkgs.stdenv.hostPlatform.extensions.executable}";
156156
in {
157157
packages.cardano-wasm.components.tests.cardano-wasm-golden.preCheck = let

0 commit comments

Comments
 (0)