Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored and astrobot-houston committed Sep 22, 2023
1 parent faeead4 commit 0352dec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/integrations/cloudflare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ export default defineConfig({

default: `false`

Whether or not to import `.wasm` files [directly as ES modules](https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration).
Whether or not to import `.wasm` files [directly as ES modules](https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration).

Add `wasmModuleImports: true` to `astro.config.mjs` to enable in both the Cloudflare build and the Astro dev server.
Add `wasmModuleImports: true` to `astro.config.mjs` to enable in both the Cloudflare build and the Astro dev server.

```diff
// astro.config.mjs
Expand All @@ -214,9 +214,9 @@ export default defineConfig({
})
```

Once enabled, you can import a web assembly module in Astro with a `.wasm?module` import.
Once enabled, you can import a web assembly module in Astro with a `.wasm?module` import.

The following is an example of importing a Wasm module that then responds to requests by adding the request's number parameters together.
The following is an example of importing a Wasm module that then responds to requests by adding the request's number parameters together.

```javascript
// pages/add/[a]/[b].js
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/cloudflare/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export default function createIntegration(args?: Options): AstroIntegration {
'node:stream',
'node:string_decoder',
'node:util',
],
],
entryPoints: pathsGroup,
outbase: absolutePagesDirname,
outdir: outputDir,
Expand Down
8 changes: 6 additions & 2 deletions packages/integrations/cloudflare/test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export async function runCLI(
let cli;
let lastErr;
while (triesRemaining > 0) {
cli = await tryRunCLI(basePath, { silent, timeout, forceRotatePort: triesRemaining !== maxAttempts });
cli = await tryRunCLI(basePath, {
silent,
timeout,
forceRotatePort: triesRemaining !== maxAttempts,
});
try {
await cli.ready;
return cli;
Expand Down Expand Up @@ -148,7 +152,7 @@ const isPortOpen = async (port) => {
resolve(true);
s.close();
});
s.listen(port, "0.0.0.0");
s.listen(port, '0.0.0.0');
});
};

Expand Down

0 comments on commit 0352dec

Please sign in to comment.