Skip to content

Commit

Permalink
feat: support lockfile v4 (#140)
Browse files Browse the repository at this point in the history
Co-authored-by: Luca Casonato <[email protected]>
  • Loading branch information
dsherret and lucacasonato authored Sep 27, 2024
1 parent ccd8992 commit 83cae72
Show file tree
Hide file tree
Showing 23 changed files with 520 additions and 86 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,20 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@main
with:
# TODO: revert back to actually using latest stable once https://github.com/denoland/deno/issues/22926 is released
deno-version: ${{ matrix.deno == 'v1.x' && 'v1.40.3' || matrix.deno}}
deno-version: "1.x"

- name: Install Rust
uses: dsherret/rust-toolchain-file@v1

- run: deno --version

- name: Format
if: runner.os == 'Linux'
run: deno fmt --check

- name: Build Wasm
run: deno task wasmbuild

- name: Lint
if: runner.os == 'Linux'
run: deno lint
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
dist/
node_modules/
dist/

/target
src/wasm/loader.generated.d.ts
src/wasm/loader.generated.js
3 changes: 3 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
max_width = 80
tab_spaces = 2
edition = "2021"
293 changes: 293 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[workspace]
resolver = "2"
members = [
"src/wasm",
]

[profile.release]
codegen-units = 1
incremental = true
lto = true
opt-level = "z"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This example bundles an entrypoint into a single ESM output.

```js
import * as esbuild from "npm:[email protected]";
// Import the WASM build on platforms where running subprocesses is not
// Import the Wasm build on platforms where running subprocesses is not
// permitted, such as Deno Deploy, or when running without `--allow-run`.
// import * as esbuild from "https://deno.land/x/[email protected]/wasm.js";

Expand All @@ -42,7 +42,7 @@ esbuild.stop();
pre-downloaded into a local `node_modules/` directory.
- When using the `"portable"` loader with `jsr:` specifiers, a lockfile must be
present and passed to the loader (either using `configPath` or `lockPath`).
- `npm:` specifiers are not supported on WASM esbuild builds due to FS access
- `npm:` specifiers are not supported on Wasm esbuild builds due to FS access
limitations (see https://github.com/evanw/esbuild/pull/2968).

## Documentation
Expand Down
18 changes: 13 additions & 5 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@
},
"lock": false,
"tasks": {
"test": "deno test -A --parallel --trace-ops",
"test": "deno test -A --parallel --trace-leaks",
"check:types": "deno check **/*.ts",
"ok": "deno fmt --check && deno lint && deno task check:types && deno task test"
"ok": "deno fmt --check && deno lint && deno task check:types && deno task test",
"wasmbuild": "deno run -A jsr:@deno/[email protected] --sync --out src/wasm"
},
"fmt": { "exclude": ["dist"] },
"lint": { "exclude": ["dist"] },
"publish": { "exclude": ["testdata/", "*_test.ts"] }
"fmt": { "exclude": ["dist", "target"] },
"lint": { "exclude": ["dist", "target", "testdata"] },
"publish": {
"exclude": [
"testdata/",
"*_test.ts",
"!src/wasm/loader.generated.d.ts",
"!src/wasm/loader.generated.js"
]
}
}
Loading

0 comments on commit 83cae72

Please sign in to comment.