Skip to content

Commit

Permalink
feat: use deno_error crate (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Nov 21, 2024
1 parent 3ce20e8 commit 3fa6ae7
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 96 deletions.
114 changes: 57 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
name: ci

on:
pull_request:
branches: [main]
push:
branches: [main]
tags:
- '*'
workflow_dispatch:

jobs:
rust:
name: deno_ast-ubuntu-latest-release
runs-on: ubuntu-latest
timeout-minutes: 30

env:
CARGO_INCREMENTAL: 0
GH_ACTIONS: 1
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings

steps:
- name: Clone repository
uses: actions/checkout@v4

- uses: denoland/setup-deno@v1
- uses: dsherret/rust-toolchain-file@v1

- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Format
run: |
cargo fmt --all -- --check
deno fmt --check
- name: Lint
run: |
cargo clippy --all-targets --all-features --release
deno lint
- name: Build
run: cargo build --all-targets --all-features --release
- name: Test
run: cargo test --all-targets --all-features --release

- name: Publish
if: |
github.repository == 'denoland/deno_ast' &&
startsWith(github.ref, 'refs/tags/')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish
name: ci

on:
pull_request:
branches: [main]
push:
branches: [main]
tags:
- "*"
workflow_dispatch:

jobs:
rust:
name: deno_ast-ubuntu-latest-release
runs-on: ubuntu-latest
timeout-minutes: 30

env:
CARGO_INCREMENTAL: 0
GH_ACTIONS: 1
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings

steps:
- name: Clone repository
uses: actions/checkout@v4

- uses: denoland/setup-deno@v1
- uses: dsherret/rust-toolchain-file@v1

- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Format
run: |
cargo fmt --all -- --check
deno fmt --check
- name: Lint
run: |
cargo clippy --all-targets --all-features --release
deno lint
- name: Build
run: cargo build --all-targets --all-features --release
- name: Test
run: cargo test --all-targets --all-features --release

- name: Publish
if: |
github.repository == 'denoland/deno_ast' &&
startsWith(github.ref, 'refs/tags/')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
releaseKind:
description: 'Kind of release'
description: "Kind of release"
type: choice
options:
- patch
Expand Down
76 changes: 49 additions & 27 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ visit = ["swc_ecma_visit", "swc_visit", "swc_visit_macros", "swc_macros_common"]
[dependencies]
base64 = { version = "0.21.6", optional = true }
deno_media_type = "0.2.1"
deno_terminal = "0.1.1"
deno_terminal = "0.2.0"
deno_error = "0.5.0"

dprint-swc-ext = "0.20.0"
once_cell = "1.19.0"
Expand Down Expand Up @@ -76,7 +77,7 @@ swc_visit = { version = "=0.6.2", optional = true }
swc_visit_macros = { version = "=0.5.13", optional = true }
# just for error handling
sourcemap = { version = "9.0.0", optional = true }
thiserror = "1.0.58"
thiserror = "2"

[dev-dependencies]
pretty_assertions = "1.3.0"
Expand Down
Loading

0 comments on commit 3fa6ae7

Please sign in to comment.