Skip to content

Commit

Permalink
Merge branch 'main' into no-new-require
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac authored Oct 15, 2024
2 parents f7b04d7 + 06e75b0 commit e5a8a0a
Show file tree
Hide file tree
Showing 674 changed files with 40,832 additions and 28,805 deletions.
45 changes: 45 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"name": "Rust",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/rust:latest",
"features": {
// add `just` for running scripts
"ghcr.io/guiyomh/features/just:0": {
"version": "latest"
},
// add `cargo-binstall` for installing other tools.
"ghcr.io/lee-orr/rusty-dev-containers/cargo-binstall:0": {
"version": "latest"
}
},
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer"
]
}
},

// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
// "source": "devcontainer-cargo-cache-${devcontainerId}",
// "target": "/usr/local/cargo",
// "type": "volume"
// }
// ]

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "just init"
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
1 change: 1 addition & 0 deletions .github/.generated_ast_watch_list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ src:
- 'crates/oxc_ast/src/ast/js.rs'
- 'crates/oxc_ast/src/ast/ts.rs'
- 'crates/oxc_ast/src/ast/jsx.rs'
- 'crates/oxc_ast/src/ast/comment.rs'
- 'crates/oxc_syntax/src/number.rs'
- 'crates/oxc_syntax/src/operator.rs'
- 'crates/oxc_span/src/span/types.rs'
Expand Down
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ about: Create a report to help us improve.
title: ''
labels: C-bug
---

<!--
!!IMPORTANT!! If you are reporting a bug for Oxlint or the Oxc VSCode extension,
please use the "Linter bug report" template instead. You can find it here:
https://github.com/oxc-project/oxc/issues/new?assignees=DonIsaac&labels=C-bug,A-linter&projects=&template=linter_bug_report.yaml&title=linter:+
-->
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ A-cli:
- changed-files:
- any-glob-to-any-file: ["apps/oxlint/**"]

A-editor:
- changed-files:
- any-glob-to-any-file: ["crates/oxc_language_server/**", "editors/**"]

A-prettier:
- changed-files:
- any-glob-to-any-file: ["crates/oxc_prettier/**", "tasks/prettier_conformance/**"]
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,19 @@ jobs:
restore-cache: false
tools: just,cargo-shear@1,dprint
components: rustfmt
- name: Restore dprint plugin cache
id: cache-restore
uses: actions/cache/restore@v4
with:
key: dprint-autofix-ci-${{ runner.os }}-${{ hashFiles('dprint.json') }}
path: ~/.cache/dprint
- run: just fmt
- uses: autofix-ci/[email protected]
with:
fail-fast: false
- name: Save dprint plugin cache
id: cache-save
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
path: ~/.cache/dprint
3 changes: 0 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ jobs:
cache-key: benchmark-linter
save-cache: ${{ github.ref_name == 'main' }}

- uses: mozilla-actions/[email protected]
if: ${{ vars.USE_SCCACHE == 'true' }}

- name: Build benchmark
env:
RUSTFLAGS: "-C debuginfo=1 -C strip=none -g --cfg codspeed"
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
- run: git diff --exit-code # Must commit everything

test-windows:
if: false
name: Test (windows-latest)
runs-on: windows-latest
steps:
Expand Down Expand Up @@ -142,7 +143,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1
- uses: crate-ci/typos@v1.24.5
- uses: crate-ci/typos@v1.26.0
with:
files: .

Expand Down Expand Up @@ -177,7 +178,16 @@ jobs:
with:
cache-key: warm
components: clippy
tools: ast-grep
- run: cargo lint -- -D warnings
- name: Check Char and Byte Offset
run: |
output=$(sg -p '$A.chars().enumerate()' -r '$A.char_indices()' -l rs)
echo "Output: $output"
if [ -n "$output" ]; then
echo "Error: Unexpected output detected"
exit 1
fi
doc:
name: Doc
Expand Down Expand Up @@ -273,13 +283,7 @@ jobs:
cache-key: warm
- uses: ./.github/actions/pnpm
if: steps.filter.outputs.src == 'true'
- name: Test napi/parser
run: pnpm build && pnpm test
if: steps.filter.outputs.src == 'true'
working-directory: napi/parser
- name: Test napi/transform
- run: pnpm run build
if: steps.filter.outputs.src == 'true'
working-directory: napi/transform
run: pnpm build && pnpm test
- run: git diff --exit-code
- run: pnpm run test
if: steps.filter.outputs.src == 'true'
8 changes: 6 additions & 2 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ on:
pull_request:
types: [opened, synchronize]
paths:
- "crates/oxc_parser/**"
- "crates/oxc_allocator/**"
- "crates/oxc_data_structures/**"
- "crates/oxc_parser/**"
- "crates/oxc_traverse/**"
- ".github/workflows/miri.yml"
push:
branches:
- main
paths:
- "crates/oxc_parser/**"
- "crates/oxc_allocator/**"
- "crates/oxc_data_structures/**"
- "crates/oxc_parser/**"
- "crates/oxc_traverse/**"
- ".github/workflows/miri.yml"

concurrency:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- uses: actions/labeler@v5

- name: Validate PR title
id: pr-title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -45,3 +46,39 @@ jobs:
revert
style
test
- name: Get category label from PR title
id: get-category
env:
PR_TYPE: ${{ steps.pr-title.outputs.type }}
run: |
case "$PR_TYPE" in
"feat")
CATEGORY="C-enhancement"
;;
"fix")
CATEGORY="C-bug"
;;
"test")
CATEGORY="C-test"
;;
"refactor" | "chore" | "style")
CATEGORY="C-cleanup"
;;
"docs")
CATEGORY="C-docs"
;;
"perf")
CATEGORY="C-performance"
;;
*)
CATEGORY=""
;;
esac
echo "CATEGORY=$CATEGORY" >> $GITHUB_OUTPUT
- name: Add category label
uses: actions-ecosystem/action-add-labels@v1
if: ${{ steps.get-category.outputs.CATEGORY != '' }}
with:
labels: ${{ steps.get-category.outputs.CATEGORY }}
22 changes: 22 additions & 0 deletions .github/workflows/prepare_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,25 @@ jobs:
name: crates
secrets:
OXC_BOT_PAT: ${{ secrets.OXC_BOT_PAT }}

ecosystem-ci:
needs: prepare
name: Trigger Monitor Oxc
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1

- uses: peter-evans/create-or-update-comment@v4
id: comment
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ needs.prepare.outputs.pull-request-number }}
body: Triggering Monitor Oxc https://github.com/oxc-project/monitor-oxc/actions/workflows/ci.yml

- uses: benc-uk/workflow-dispatch@v1
with:
repo: oxc-project/monitor-oxc
workflow: ci.yml
token: ${{ secrets.OXC_BOT_PAT }}
ref: main
inputs: '{ "issue-number": "${{ needs.prepare.outputs.pull-request-number }}", "comment-id": "${{ steps.comment.outputs.comment-id }}" }'
7 changes: 4 additions & 3 deletions .github/workflows/release_napi_parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ jobs:
mv target/${{ matrix.target }}/release/*.@(so|dll|dylib) napi/parser/parser.${{ matrix.code-target }}.node
ls napi/parser
- uses: ./.github/actions/pnpm
if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64

- name: Test
working-directory: napi/parser
if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64
run: |
ls
node test.mjs
run: pnpm run test

# The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binary
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release_napi_transform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ jobs:
mv target/${{ matrix.target }}/release/*.@(so|dll|dylib) napi/transform/transform.${{ matrix.code-target }}.node
ls napi/transform
- uses: ./.github/actions/pnpm
if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64

- name: Test
working-directory: napi/transform
if: ${{ contains(matrix.target, 'x86') && !contains(matrix.target, 'musl') }} # Need docker for aarch64
run: |
ls
node test.mjs
run: pnpm run test

# The binary is zipped to fix permission loss https://github.com/actions/upload-artifact#permission-loss
- name: Archive Binary
Expand Down
4 changes: 4 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ extend-exclude = [
"tasks/coverage/babel",
"tasks/coverage/test262",
"tasks/coverage/typescript",
"tasks/coverage/snapshots",
"tasks/prettier_conformance/prettier",
"tasks/prettier_conformance/snapshots",
"tasks/transform_conformance/tests/**/output.js",
"tasks/transform_conformance/snapshots",
]

[default]
Expand Down
Loading

0 comments on commit e5a8a0a

Please sign in to comment.