Commit Graph

84 Commits

Author SHA1 Message Date
leaysgur 6ef3984410 refactor(ci): self-provision prettier suite in oxc_formatter_tests (#25467)
Remove the Prettier related stuff from the conformance, which is purely aimed at JS/TS.

Instead, `oxc_formatter_tests` manage Prettier's test fixtures along with Oxfmt.
2026-08-12 00:40:59 +00:00
renovate[bot] 146d7d9ea1 chore(deps): update endbug/version-check action to v3 (#20635) 2026-03-23 13:28:46 +08:00
Boshen 2af70844d4 refactor(ci): replace dorny/paths-filter with cargo tree-based change detection (#20109)
## Summary

- Replace `dorny/paths-filter` in 6 CI jobs with a unified
`check-changes.js` script that uses `cargo tree` to resolve transitive
dependencies, fixing silent CI skips when upstream crates change
- Add a reusable `check-changes` composite action to eliminate
boilerplate across jobs
- Add change detection to Miri workflow to skip expensive steps when
unrelated code changes

### Key improvements over old `dorny/paths-filter`

- **Transitive dependency tracking**: uses `cargo tree` so e.g.
`oxc_parser` changes correctly trigger minification checks
- **Task crate resolution**: uses actual task crates (`oxc_minsize`,
`oxc_track_memory_allocations`) instead of library crates, catching
dev-dependencies like `oxc_codegen` that `cargo tree -e normal` on
`oxc_minifier` alone would miss
- **Self-validation**: `.github/workflows/ci.yml` and
`.github/workflows/miri.yml` are included in trigger paths so workflow
edits exercise the affected jobs

### Modes

**Include mode** (`--packages`): resolves transitive deps via `cargo
tree`, runs if changes affect any dep crate or additional paths.

**Exclude mode** (`--exclude`): skips only if ALL changed files are in
excluded crate directories (intentionally shallow — no `cargo tree`).

### Jobs updated
`test-wasm32-wasip1-threads`, `test-napi`, `test-napi-windows`,
`minification`, `allocs`, `lintgen`, `miri`

### Jobs intentionally unchanged
`conformance` (already uses `cargo tree`), `benchmark` (already uses
`cargo tree`), `ast_changes` (uses auto-generated watch list),
`test-ubuntu` (primary gate, runs everything), `typos`/`lint` (always
run)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:45:38 +08:00
sapphi-red 1bf4c1c08c chore(infra): fix just submodules on Windows (#18285)
`just submodules` was not working on Windows.
2026-01-23 12:17:50 +00:00
Boshen 3f6387dd3b ci(workflows): add workflow_call support to update_submodules.yml (#16431)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-12-03 19:47:57 +08:00
Boshen 7b1e6f3b05 feat(apps): add pure rust binaries and release to github (#15469)
closes #14903
2025-11-08 18:29:07 +08:00
Yuji Sugiura 2ca73878f5 fix(ci): Correct boolean comparison in check-version action (#15105)
The `inputs.diff-search == false` comparison always evaluated to `false`
because composite action inputs are strings, not booleans.

> https://github.com/actions/runner/issues/2238

This caused `static-checking` to be set to an empty string instead of
`'localIsNew'`, making version-check fall back to commit history search
mode and fail to detect version changes.
2025-10-30 12:00:01 +08:00
Cameron 75371c6580 fix(ci): remove checkout step from check-version action (#15090) 2025-10-30 10:30:37 +09:00
Boshen 739d7ff21c refactor(ci): Extract "Check version" jobs into reusable action (#15034) 2025-10-28 17:40:45 +08:00
Boshen 7bcc6b0ac5 refactor(ci): expand submodule update workflow to handle all 6 conformance test repos (#14990)
- Rename workflow: update_compat_table.yml → update_submodules.yml
- Extract hardcoded SHAs in clone-parallel.sh into variables at the top
- Expand workflow to automatically update all 6 submodules:
  - test262 (tc39/test262)
  - babel (babel/babel)
  - TypeScript (microsoft/TypeScript)
  - prettier (prettier/prettier)
  - acorn-test262 (oxc-project/acorn-test262)
  - node-compat-table (williamkapke/node-compat-table)
- Workflow now fetches latest SHAs from all repos, compares with current, and updates clone-parallel.sh
- Creates single PR with summary of all updated submodules

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-27 12:44:10 +00:00
Boshen 7b9594f0a2 refactor(justfile): centralize submodule cloning script and improve existing directory handling (#14988)
## Summary

- Moved `clone-parallel.sh` from `.github/actions/clone-submodules/` to `.github/scripts/` for better organization and reusability
- Updated justfile `submodules` recipe to use the centralized script, eliminating duplication
- Fixed issue where script would fail with "destination path already exists" error when directories already exist
- Script now properly handles existing directories by initializing or updating git repos instead of failing

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-27 09:03:58 +00:00
sapphi-red 638416e291 feat(tasks/coverage): add node compat table tests for minifier (#13925)
Added test cases from https://github.com/williamkapke/node-compat-table for the minifier.
2025-09-20 03:16:04 +00:00
Boshen f897e303eb chore(tasks): update test262, babel and TypeScript (#13217) 2025-08-20 01:22:35 +00:00
Alexander S. 425373a581 fix(ci): avoid code injection via template expansion (#13064)
https://docs.zizmor.sh/audits/#remediation_18
2025-08-15 19:24:49 +08:00
Copilot fe5965d669 ci: Implement parallel submodule cloning for faster CI/CD performance (#13045) 2025-08-13 11:56:55 +08:00
renovate[bot] e1d23e4569 chore(deps): update actions/checkout action to v5 (#13046) 2025-08-13 11:21:16 +08:00
Copilot 65e211296d refactor(transformer): Use to @babel/plugin-transform-explicit-resource-management (#12874) 2025-08-08 12:03:33 +08:00
Boshen 21adcd2f2a chore(ci): add persist-credentials: false in clone-submodules 2025-08-03 17:41:28 +08:00
overlookmotel a96e78b70b ci(napi): NAPI tests skip Babel + Prettier submodules (#12752)
Cloning submodules takes a bit of time. Skip cloning `babel` and `prettier` repos in NAPI tests, because they doesn't need them. NAPI parser tests only need the other 3 submodules.
2025-08-02 12:18:41 +00:00
overlookmotel 754f01d79a refactor(ast/estree): move start and end fields to last (#12012)
Related to #10307.

Re-arrange fields in ESTree AST, so `start` and `end` are last, instead of first.

Also bump `acorn-test262` submodule to include https://github.com/oxc-project/acorn-test262/pull/54, which rearranges the fields in test snapshots.
2025-07-01 17:32:06 +00:00
overlookmotel ea30fff17f test(ast/estree): bump acorn-test262 submodule (#11762)
Bump `acorn-test262` submodule, which bumps `@typescript-eslint/parser`. Latest version of TS-ESLint contains fixes for bugs which I reported. Currently this breaks 1 conformance test - will fix in following PR.
2025-06-16 21:37:42 +00:00
overlookmotel 2694d23021 test(ast/estree): bump acorn-test262 submodule (#11563)
Bump `acorn-test262` submodule to include https://github.com/oxc-project/acorn-test262/pull/47, which bumps Acorn dependency.

Acorn v8.15.0 fixes the formatting of the `bigint` field of `Literal`s to align with ESTree spec. Currently we are failing those test cases as our behavior is incorrect. Will fix it in following PR.
2025-06-09 02:28:45 +00:00
overlookmotel bc41bdf7ce test(ast/estree): bump acorn-test262 dependency (#11449)
Bump `acorn-test262` submodule, to integrate https://github.com/oxc-project/acorn-test262/pull/44 and https://github.com/oxc-project/acorn-test262/pull/45 which fix the field order in TS snapshots of `TemplateElement` and regexp `Literal`s.
2025-06-02 21:12:25 +00:00
overlookmotel 1df6732b46 feat(ast/estree): add decorators to ESTree AST (#11393)
Close #10921.

Add decorators to ESTree AST. `decorators` field is added to `ClassDeclaration`, `ClassExpression`, `PropertyDefinition`, and `MethodDefinition` - as per [ESTree spec](https://github.com/estree/estree/blob/52399d923111fe2a4dcfe1ede795e08356f35ddc/stage3/decorators.md).

Bump `acorn-test262` dependency to include https://github.com/oxc-project/acorn-test262/pull/42 and https://github.com/oxc-project/acorn-test262/pull/43, which add test fixtures for decorators.
2025-05-31 01:20:06 +00:00
Boshen 4984ad1072 chore(ci): use oxc-project/setup-node (#11368) 2025-05-29 17:16:23 +08:00
overlookmotel 12690a10bf refactor(ast/estree): re-order fields in visitation order (#11362)
Re-order fields in ESTree and TS-ESTree ASTs to be in visitation order (which is the order in which they're defined in Rust types).

This does not align with either Acorn or TS-ESLint, but for the reasons discussed in https://github.com/oxc-project/oxc/issues/9705#issuecomment-2859250834, I feel this isn't a concern. The field order doesn't matter much per se, only that it's consistent, and this change has other benefits - it will make it simpler to build a visitor which visits fields in the correct order, and allows adding other parsers to `acorn-test262` in order to produce test cases for decorators.

Visitation order aligns with TS-ESLint except for the following types:

* `ExportSpecifier`
* `TSImportType`
* `TSIndexedAccessType`
* `TSMethodSignature`
* `TSPropertySignature`
* `TSTypePredicate`

In these 6 cases, TS-ESLint's `visitorKeys` has the wrong visitation order, because it does not visit fields in source order. I will open an issue and hopefully they can fix.

This PR also bumps `acorn-test262` to include https://github.com/oxc-project/acorn-test262/pull/37 which re-orders the fields in fixture snapshots to match the new field order here.
2025-05-29 02:20:54 +00:00
Boshen 13a349dad7 chore(ci): use a warmup cache for pnpm cache 2025-05-26 18:07:32 +08:00
Boshen df001759a5 chore(ci): use a warmup cache for pnpm cache (#11300) 2025-05-26 17:32:15 +08:00
overlookmotel 23182b811a feat(ast/estree): add phase field to ImportExpression in TS-ESTree AST (#11193)
Related to #10978. Add `phase` property to `ImportExpression` in TS-ESTree AST.

This aligns with ESTree spec, but does *not* align with TS-ESLint - TS-ESLint outputs a `CallExpression` with a `MetaProperty` as its `callee` instead.

We don't have the necessary information in our AST to match TS-ESLint, because we don't have the spans of `import`, `defer`, or `import.defer`, to use for the `MetaProperty`, or the `IdentifierName`s it contains.

This is not completely ideal, but I figure it's preferable to represent this syntax *somehow* in the AST, rather than completely ignoring it, in which case there's no way to distinguish between `import("x")`, `import.defer("x")`, and `import.source("x")`.

Presumably TS-ESLint will change their AST shape to conform to ESTree spec once these reach stage 4, so I don't think we should expend effort changing our AST to align with them in the meantime. TypeScript doesn't even have test cases for these (we'd know if they did, as we'd be failing them) - so I doubt these are popular constructs in TS.

`acorn-test262` submodule is bumped to include https://github.com/oxc-project/acorn-test262/pull/36 which adds the `phase` field to `ImportExpression`s in test snapshots.
2025-05-21 01:39:07 +00:00
overlookmotel c331eceb37 chore(deps): bump acorn-test262 (#11192)
Bump `acorn-test262` dependency to include the following tidy-up PRs:

* https://github.com/oxc-project/acorn-test262/pull/33
* https://github.com/oxc-project/acorn-test262/pull/34
* https://github.com/oxc-project/acorn-test262/pull/35
2025-05-20 18:13:56 +00:00
Boshen 13825c03bc chore(coverage): bump test262, babel and typescript versions (#11163) 2025-05-20 01:51:51 +00:00
overlookmotel 1bc8d29209 feat(ast/estree): add phase field to ImportDeclaration in ESTree AST (#11157)
Fixes #10978. Add `phase` property to `ImportDeclaration` in ESTree and TS-ESTree ASTs.

`ImportExpression` is not covered by this PR. That's more tricky as TS-ESLint already supports `import.defer(...)` and `import.source(...)`, but does not align with ESTree - it outputs a `MetaProperty` instead.

`acorn-test262` submodule is bumped to include https://github.com/oxc-project/acorn-test262/pull/30.
2025-05-19 15:13:31 +00:00
overlookmotel e7a503ce33 test(ast/estree): bump acorn-test262 (#10872)
Bump `acorn-test262` dependency to include https://github.com/oxc-project/acorn-test262/pull/26 which updates `@typescript-eslint/parser` to latest.
2025-05-07 15:57:43 +00:00
overlookmotel dcf718fceb test(ast/estree): bump acorn-test262 (#10601)
Bump `acorn-test262` to include https://github.com/oxc-project/acorn-test262/pull/22 which parses more file types.

This removes a bunch of erroneous mismatches. 97%!
2025-04-24 16:21:47 +00:00
overlookmotel 55c10c379f test(ast/estree): bump acorn-test262 (#10595)
Bump `acorn-test262` to include https://github.com/oxc-project/acorn-test262/pull/21 which fixes spans in fixture files which include a UTF-8 BOM.

This removes a bunch of erroneous mismatches. 94%!
2025-04-24 14:40:26 +00:00
renovate[bot] d5a1ffa478 chore(deps): update github-actions (#10514) 2025-04-21 09:56:25 +08:00
overlookmotel 1c5a1a55b9 test(ast/estree): bump acorn-test262 submodule (#10308)
Bump `acorn-test262` submodule, to include https://github.com/oxc-project/acorn-test262/pull/17, which fixes a bunch of test cases.
2025-04-07 22:26:39 +00:00
overlookmotel 0bdac598da test(ast/estree): fix final newlines in TS-ESLint test cases (#10009)
Bump `acorn-test262` dependency to include https://github.com/oxc-project/acorn-test262/pull/13. This fixes the mismatch between how our conformance tester and the `acorn-test262` test case generator were handling final newlines in source files.
2025-03-24 09:17:13 +00:00
hi-ogawa 5f2d36bd2e test(ast/estree): update acorn-test262 (#9816)
Syncing https://github.com/oxc-project/acorn-test262/pull/8.

Adding back `null` causes a new mismatch due to ts-eslint has `ExpresssionStatement.directive: string | undefined` https://github.com/typescript-eslint/typescript-eslint/blob/543d36ce9aacdb75e8bf85860984704dfbf8f8ff/packages/ast-spec/src/statement/ExpressionStatement/spec.ts#L7.
2025-03-17 06:02:53 +00:00
renovate[bot] f406b91ecd chore(deps): update github-actions (#9811) 2025-03-17 12:23:01 +08:00
hi-ogawa ac36103764 test(ast/estree): add typescript-eslint estree coverage (#9774)
Part of https://github.com/oxc-project/oxc/issues/9705
Requires https://github.com/oxc-project/acorn-test262/pull/6

Current result `Positive Passed: 32/10725 (0.30%)` 😢

What I observed from a few diffs I looked at:
- typescript-eslint parser's field ordering is not a super set of acorn (maybe keys are ordered alphabetically)
  - example: `ClassDeclaration`
    - typescript-eslint https://ast-explorer.dev/#eNolyDEKgDAMBdCrlD/rBTyIOGQJJUOlpqUpgpTe3YjrG8jYcPLNFluqHQuqQ3+q/LCK5aSfR/eY2SwcYUxSp+I0SEMgSLx4l2apKGFzyNzFOoF0Yr7njiIU
      - abstract, body, declare, decorators, id, implements, superClass, superTypeArguments, typeParameters,
    - acorn https://ast-explorer.dev/#eNolyTEKwzAMRuGrmH/OCXKOUjpoEaqGFMcyllMIxnePQrbH9wYyVvz4zy5tqx0LagCLtRIt0ZLZPX3SmHSTBQ0qKRFUdn5r880KYQ3I3NU7YXm+29FEX2fVZ+/2PXI0lYl5ATuZJ1U=
      - id, superClass, body
- typescript-eslint parser uses `undefined` instead of `null` for optional ts-specific field
  - example: `ClassDeclaration.typeParameters`
    - https://ast-explorer.dev/#eNolyDEKgDAMBdCrlD/rBTyIOGQJJUOlpqUpgpTe3YjrG8jYcPLNFluqHQuqQ3+q/LCK5aSfR/eY2SwcYUxSp+I0SEMgSLx4l2apKGFzyNzFOoF0Yr7njiIU
    - spec https://github.com/typescript-eslint/typescript-eslint/blob/2224f12ff05b59c5a459291fe93fc8099221089d/packages/ast-spec/src/base/ClassBase.ts#L62
2025-03-14 09:26:08 +00:00
hi-ogawa 566da83a30 feat(tasks/coverage): add acorn-jsx conformance (#9745)
Part of https://github.com/oxc-project/oxc/issues/9703
Requires https://github.com/oxc-project/acorn-test262/pull/3
2025-03-13 11:41:37 +00:00
overlookmotel c1a8cea474 refactor(ast/estree): simplify serializing RegExpLiterals (#9551)
Similar to #9546. Acorn outputs `RegExpLiteral`'s flags in same order as in source text. There is nothing wrong with this, but it makes our serialization/deserialization code more complex than it needs to be, just to match Acorn. I don't think we need to follow Acorn here - there's no particular "good" order for the flags.

Bump `acorn-test262` to include commit https://github.com/oxc-project/acorn-test262/commit/3d7013e145499268dc8f985d087208aa013e0ba2, which reorders the flags in alphabetical order in Acorn's AST.

This allows simplifying serialization/deserialization code on our side.
2025-03-05 02:21:02 +00:00
overlookmotel af02a87853 feat(ast/estree): Property have consistent field order (#9547)
Similar to #9546. Acorn has inconsistent field order for `Property` nodes - https://github.com/acornjs/acorn/pull/1347.

Bump `acorn-test262` to include commit https://github.com/oxc-project/acorn-test262/commit/7b7fa95e055352d76ddccc98cabc37ca1448cf92, which orders the fields consistently in Acorn's AST.

This allows simplifying serialization/deserialization code, as we now don't need to deal with shuffling field order to match Acorn.
2025-03-05 02:21:02 +00:00
overlookmotel 3e4f909861 feat(ast/estree): ESTree AST ExportNamedDeclaration always have attributes field (#9546)
Acorn does not include an `attributes` field on `ExportNamedDeclaration` when `source == null`. I think that's an oversight - https://github.com/acornjs/acorn/pull/1346.

Bump `acorn-test262` to include commit https://github.com/oxc-project/acorn-test262/commit/96faefa7644f16bb163484ee50fa13d6ecff7e72 which adds the missing `attributes` field to Acorn's AST.

This allows simplifying serialization/deserialization code, as we now don't need to deal with this special case.
2025-03-05 02:21:01 +00:00
Boshen a359e8e517 chore: update Babel and TypeScript (#9462) 2025-03-01 21:09:33 +08:00
overlookmotel 4eb79b89e0 ci(conformance): run ESTree conformance tests in CI (#9288)
After #9285, the ESTree conformance tests are fast enough to run in CI.
Do that, so we notice if we break anything.

Time to run conformance on CI:

Before this PR: 3m 39s
After this PR: 3m 55s
2025-02-22 10:48:15 +08:00
Boshen ff4ab88ed9 chore(deps): update github-actions (#9097)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-14 13:37:06 +08:00
Yuji Sugiura 4c3c6fafa8 chore(coverage): Bump prettier@3.5.0 (#9078)
> https://prettier.io/blog/2025/02/09/3.5.0

Test coverage has dropped slightly because they added more tests for the
new `objectWrap` and `experimentalOperatorPosition` options.

I will try to support `objectWrap` in the near future.
2025-02-13 21:54:23 +08:00
Boshen d7512a2684 chore(deps): update github-actions (#9000) 2025-02-10 07:06:07 +00:00