Skip to content

Commit

Permalink
Merge branch 'oxc-project:main' into well_known_symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMitchell-at authored Aug 16, 2024
2 parents 1c19a4d + 508644a commit de8c843
Show file tree
Hide file tree
Showing 1,019 changed files with 55,914 additions and 17,519 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore-interior-mutability = ["oxc_linter::rule::RuleWithSeverity"]
21 changes: 21 additions & 0 deletions .github/.generated_ast_watch_list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# To edit this generated file you have to edit `tasks/ast_tools/src/main.rs`
# Auto-generated code, DO NOT EDIT DIRECTLY!

src:
- 'crates/oxc_ast/src/ast/literal.rs'
- 'crates/oxc_ast/src/ast/js.rs'
- 'crates/oxc_ast/src/ast/ts.rs'
- 'crates/oxc_ast/src/ast/jsx.rs'
- 'crates/oxc_syntax/src/number.rs'
- 'crates/oxc_syntax/src/operator.rs'
- 'crates/oxc_span/src/span/types.rs'
- 'crates/oxc_span/src/source_type/types.rs'
- 'crates/oxc_ast/src/generated/assert_layouts.rs'
- 'crates/oxc_ast/src/generated/ast_kind.rs'
- 'crates/oxc_ast/src/generated/ast_builder.rs'
- 'crates/oxc_ast/src/generated/derive_clone_in.rs'
- 'crates/oxc_ast/src/generated/derive_get_span.rs'
- 'crates/oxc_ast/src/generated/derive_get_span_mut.rs'
- 'crates/oxc_ast/src/generated/visit.rs'
- 'crates/oxc_ast/src/generated/visit_mut.rs'
- 'tasks/ast_codegen/src/**'
1 change: 0 additions & 1 deletion .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ignore:
- "tasks"
- "editor"
- "napi"
- "fuzz"
- "crates/oxc_ast/src/generated"
- "crates/oxc_traverse"
- "crates/oxc_wasm" # Remove this once wasm is completed
Expand Down
6 changes: 5 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ A-ast:
- changed-files:
- any-glob-to-any-file: ['crates/oxc_ast/**']

A-ast-tools:
- changed-files:
- any-glob-to-any-file: ['tasks/ast_tools/**']

A-cfg:
- changed-files:
- any-glob-to-any-file: ['crates/oxc_cfg/**']
Expand Down Expand Up @@ -44,4 +48,4 @@ A-type-checking:

A-isolated-declarations:
- changed-files:
- any-glob-to-any-file: ['crates/oxc_isolated_declarations/**']
- any-glob-to-any-file: ['crates/oxc_isolated_declarations/**']
6 changes: 4 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ on:
- 'napi/parser/**/*.js'
- 'napi/parser/**/*.mjs'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/benchmark.yml'
- 'tasks/benchmark/codspeed/*.mjs'
push:
Expand All @@ -32,6 +33,7 @@ on:
- 'napi/parser/**/*.js'
- 'napi/parser/**/*.mjs'
- 'Cargo.lock'
- 'rust-toolchain.toml'
- '.github/workflows/benchmark.yml'
- 'tasks/benchmark/codspeed/*.mjs'

Expand Down Expand Up @@ -97,7 +99,7 @@ jobs:
rm target/codspeed/oxc_benchmark/*.d
- name: Run benchmark
uses: CodSpeedHQ/action@v2
uses: CodSpeedHQ/action@v3
timeout-minutes: 30
with:
# Dummy token for tokenless runs, to suppress logging hash of metadata JSON (see `upload.mjs`)
Expand Down Expand Up @@ -198,7 +200,7 @@ jobs:
node capture.mjs &
- name: Run benchmark
uses: CodSpeedHQ/action@v2
uses: CodSpeedHQ/action@v3
timeout-minutes: 30
env:
FIXTURE: ${{ matrix.fixture }}
Expand Down
52 changes: 35 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-D warnings"

jobs:
test:
name: Test
Expand Down Expand Up @@ -71,7 +67,12 @@ jobs:
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
shell: bash
run: |
sed -i -e 's/profile = "default"/profile = "minimal"/g' rust-toolchain.toml
# This `awk` command will find the value of our Minimum Supported Rust Version and store it as `MSRV`.
# NOTE: this will fail if there are any other items named `rust-version`. We assume there is only one in our `Cargo.toml`.
MSRV=$(awk -F'=' '/rust-version/ {gsub(/[" ]/, "", $2); printf "%s", ($2 + "")}' Cargo.toml)
# Set profile to minimal and channel to our Minimum Supported Rust Version.
# Running our tests on this channel ensures that our code uses APIs that are supported in our `MSRV`.
sed -i -e 's/profile = "default"/profile = "minimal"/g' -e "s/channel = .*/channel = \"$MSRV\"/g" rust-toolchain.toml
rustup set profile minimal
rustup show
git restore .
Expand All @@ -96,8 +97,28 @@ jobs:
cargo test
cargo ck
wasm:
name: Check Wasm
test-wasm32-wasip1-threads:
name: Test wasm32-wasip1-threads
if: ${{ github.ref_name == 'main' }}
runs-on: ubuntu-latest
env:
RUSTFLAGS: "--cfg tokio_unstable -C target-feature=+atomics,+bulk-memory,+mutable-globals,+simd128 -C link-args=--max-memory=67108864"
CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -S threads=y --dir=${{ github.workspace }}::${{ github.workspace }} --"
# Insta is not able to run on wasmtime, omit the packages that depend on it
TEST_FLAGS: "-p oxc_sourcemap -p oxc_ast -p oxc_cfg -p oxc_index -p oxc_js_regex -p oxc_module_lexer -- --nocapture"
steps:
- uses: taiki-e/checkout-action@v1
- uses: Boshen/setup-rust@main
with:
cache-key: wasi
save-cache: ${{ github.ref_name == 'main' }}
- run: rustup target add wasm32-wasip1-threads
- uses: bytecodealliance/actions/wasmtime/setup@v1
- run: cargo test --target wasm32-wasip1-threads ${{ env.TEST_FLAGS }}
- run: git diff --exit-code # Must commit everything

test-wasm32-unknown-unknown:
name: Check wasm32-unknown-unknown
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1
Expand Down Expand Up @@ -125,7 +146,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1
- uses: crate-ci/typos@v1.23.2
- uses: crate-ci/typos@v1.23.6
with:
files: .

Expand Down Expand Up @@ -168,7 +189,7 @@ jobs:
with:
restore-cache: false
if: steps.filter.outputs.src == 'true'
- uses: cargo-bins/cargo-binstall@v1.7.4
- uses: cargo-bins/cargo-binstall@v1.10.0
if: steps.filter.outputs.src == 'true'
- run: cargo binstall --no-confirm cargo-shear@1
if: steps.filter.outputs.src == 'true'
Expand Down Expand Up @@ -258,21 +279,18 @@ jobs:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- 'crates/oxc_ast/src/ast/**'
- 'tasks/ast_codegen/src/**'
filters: '.github/.generated_ast_watch_list.yml'

- uses: Boshen/setup-rust@main
if: steps.filter.outputs.src == 'true'
with:
components: rustfmt
cache-key: codegen
cache-key: ast_changes
save-cache: ${{ github.ref_name == 'main' }}

- name: Check AST Changes
if: steps.filter.outputs.src == 'true'
run: |
cargo run -p oxc_ast_codegen
echo 'AST changes must be commited to the repo.'
git diff --exit-code
cargo run -p oxc_ast_tools
git diff --exit-code ||
(echo 'AST changes caused the "generated" code to get outdated. Have you forgotten to run the `just ast` command and/or commit generated codes?' && exit 1)
29 changes: 0 additions & 29 deletions .github/workflows/fuzz.yml

This file was deleted.

17 changes: 16 additions & 1 deletion .github/workflows/prepare_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,23 @@ concurrency:
cancel-in-progress: true

jobs:
prepare_release:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1
- uses: Boshen/setup-rust@main
with:
cache-key: warm
tools: cargo-release-oxc
- run: cargo ck
- run: cargo release-oxc publish --release crates --dry-run

prepare:
needs: check
name: Prepare Release Crates
uses: ./.github/workflows/reusable_prepare_release.yml
with:
name: crates
secrets:
OXC_BOT_PAT : ${{ secrets.OXC_BOT_PAT }}
6 changes: 4 additions & 2 deletions .github/workflows/prepare_release_oxlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
uses: ./.github/workflows/reusable_prepare_release.yml
with:
name: oxlint
secrets:
OXC_BOT_PAT : ${{ secrets.OXC_BOT_PAT }}

ecosystem-ci:
needs: prepare
Expand All @@ -40,7 +42,7 @@ jobs:
with:
repo: oxc-project/oxlint-ecosystem-ci
workflow: ecosystem-ci.yml
token: ${{ secrets.PAT }}
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment.outputs.comment-id }}" }'

Expand All @@ -54,6 +56,6 @@ jobs:
with:
repo: oxc-project/oxc-project.github.io
workflow: release.yml
token: ${{ secrets.PAT }}
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "version": "${{ needs.prepare.outputs.version }}" }'
4 changes: 0 additions & 4 deletions .github/workflows/release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-D warnings"

jobs:
release:
name: Release crates
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/release_oxlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.version.outputs.changed }}
version: ${{ steps.version.outputs.version }}
steps:
- uses: taiki-e/checkout-action@v1

Expand All @@ -29,10 +30,10 @@ jobs:
file-url: https://unpkg.com/oxlint@latest/package.json
file-name: npm/oxlint/package.json

- name: Set version name
- name: Print version
if: steps.version.outputs.changed == 'true'
run: |
echo "Version change found! New version: ${{ steps.version.outputs.version }} (${{ steps.version.outputs.version_type }})"
echo "Version change found! New version: ${{ steps.version.outputs.version }}"
build:
needs: check
Expand Down Expand Up @@ -77,6 +78,8 @@ jobs:
defaults:
run:
shell: bash
env:
OXC_VERSION: ${{ needs.check.outputs.version }}
steps:
- uses: taiki-e/checkout-action@v1

Expand Down Expand Up @@ -138,13 +141,11 @@ jobs:
publish:
name: Publish
needs: build
needs: [check, build]
runs-on: ubuntu-latest
permissions:
contents: write # for softprops/action-gh-release@v1
id-token: write # for `npm publish --provenance`
outputs:
version: ${{ steps.run.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -160,7 +161,6 @@ jobs:
run: |
mkdir -p target
cargo release-oxc changelog --release oxlint
echo "VERSION=$(cat ./target/OXC_VERSION)" >> $GITHUB_OUTPUT
{
echo 'CHANGELOG<<EOF'
cat ./target/OXC_CHANGELOG
Expand Down Expand Up @@ -207,16 +207,16 @@ jobs:
body: ${{ steps.run.outputs.CHANGELOG }}
draft: true
files: oxlint-*
name: oxlint v${{ steps.run.outputs.VERSION }}
tag_name: oxlint_v${{ steps.run.outputs.VERSION }}
name: oxlint v${{ needs.check.outputs.version }}
tag_name: oxlint_v${{ needs.check.outputs.version }}
fail_on_unmatched_files: true
target_commitish: ${{ github.sha }}

- name: wait 1 minute for smoke test
run: sleep 60s

smoke:
needs: publish
needs: [check, publish]
strategy:
matrix:
include:
Expand All @@ -236,7 +236,7 @@ jobs:
npx oxlint@${{ needs.check.outputs.version }} ./test.js
eslint-plugin-oxlint:
needs: publish
needs: [check, publish]
name: Update eslint-plugin-oxlint
runs-on: ubuntu-latest
steps:
Expand All @@ -245,6 +245,6 @@ jobs:
with:
repo: oxc-project/eslint-plugin-oxlint
workflow: bump_oxlint.yml
token: ${{ secrets.PAT }}
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "version": "${{ needs.publish.outputs.version }}" }'
inputs: '{ "version": "${{ needs.check.outputs.version }}" }'
Loading

0 comments on commit de8c843

Please sign in to comment.