Commit graph

863 commits

Author SHA1 Message Date
Boshen
d91b688f3a
chore(rulegen): default rule to nursery 2024-05-06 17:17:36 +08:00
Boshen
8fbba03afd
ci: reduce the total number of linter benchmarks (#3172)
closes #2981
2024-05-06 12:54:50 +08:00
renovate[bot]
e5c08163af
chore(deps): update dependency tar to v7.1.0 (#3162)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [tar](https://togithub.com/isaacs/node-tar) | [`7.0.1` ->
`7.1.0`](https://renovatebot.com/diffs/npm/tar/7.0.1/7.1.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/tar/7.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/tar/7.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/tar/7.0.1/7.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/tar/7.0.1/7.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>isaacs/node-tar (tar)</summary>

###
[`v7.1.0`](https://togithub.com/isaacs/node-tar/compare/v7.0.1...v7.1.0)

[Compare
Source](https://togithub.com/isaacs/node-tar/compare/v7.0.1...v7.1.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 8am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNDAuMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-06 09:33:06 +08:00
renovate[bot]
56a0db8621
chore(deps): update dependency rust to v1.78.0 (#3151) 2024-05-03 00:01:42 +08:00
Boshen
f5dccc96fd
refactor(coverage): avoid an String::from_utf8 over head during serialization (#3145) 2024-04-30 23:11:22 +08:00
Boshen
67225a8091
refactor(coverage): replace yaml parsing with saphyr (#3144)
closes #3128

Profiling `cargo run -p oxc_coverage -- parser` no longer shows a
bottleneck in yaml parsing
2024-04-30 22:49:39 +08:00
Boshen
a63a45d5b2
refactor(transformer): remove the requirement of Semantic (#3140)
It seems like we need to rebuild the scopes and symbols while
traversing. We can't utilize the scopes and symbols built by semantic
because they are immutable.
2024-04-30 12:48:21 +08:00
Boshen
d76507699d
chore(transform_conformance): skip transform-destructuring (#3136) 2024-04-30 00:09:22 +08:00
Boshen
5a3f8a5811
feat(transform_conformance): handle parse error (#3135) 2024-04-30 00:07:53 +08:00
Dunqing
b5894964d1
fix(transformer/arrow-functions): should not transform this in class (#3129) 2024-04-29 13:44:10 +00:00
Dunqing
843318cdbe
refactor(transformer/typescript): reimplementation of Enum conversion based on Babel (#3102)
The remaining test cases will perform better with a scope
implementation, and while we can implement them without the scope, it
still requires us to do what the scope did.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2024-04-29 16:26:22 +08:00
Dunqing
905ee3fef1
feat(transformer): add arrow-functions plugin (#3083)
close: #2983
2024-04-29 08:04:01 +00:00
renovate[bot]
6fd6170154
chore(deps): lock file maintenance rust crates (#3125) 2024-04-29 06:00:15 +00:00
renovate[bot]
14e4c58540
chore(deps): update pnpm to v9.0.6 (#3123)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [pnpm](https://pnpm.io) ([source](https://togithub.com/pnpm/pnpm)) |
[`9.0.5` -> `9.0.6`](https://renovatebot.com/diffs/npm/pnpm/9.0.5/9.0.6)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/pnpm/9.0.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/pnpm/9.0.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/pnpm/9.0.5/9.0.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pnpm/9.0.5/9.0.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>pnpm/pnpm (pnpm)</summary>

### [`v9.0.6`](https://togithub.com/pnpm/pnpm/compare/v9.0.5...v9.0.6)

[Compare Source](https://togithub.com/pnpm/pnpm/compare/v9.0.5...v9.0.6)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 8am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-29 09:37:30 +08:00
overlookmotel
7e1fe36c68
refactor(ast): squash nested enums (#3115)
OK, this is a big one...

I have done this as part of work on Traversable AST, but I believe it
has wider benefits, so thought better to spin it off into its own PR.

## What this PR does

This PR squashes all nested AST enum types (#2685).

e.g.: Previously:

```rs
pub enum Statement<'a> {
    BlockStatement(Box<'a, BlockStatement<'a>>),
    /* ...other Statement variants... */
    Declaration(Declaration<'a>),
}

pub enum Declaration<'a> {
    VariableDeclaration(Box<'a, VariableDeclaration<'a>>),
    /* ...other Declaration variants... */
}
```

After this PR:

```rs
#[repr(C, u8)]
pub enum Statement<'a> {
    BlockStatement(Box<'a, BlockStatement<'a>>) = 0,
    /* ...other Statement variants... */

    VariableDeclaration(Box<'a, VariableDeclaration<'a>>) = 32,
    /* ...other Declaration variants... */
}

#[repr(C, u8)]
pub enum Declaration<'a> {
    VariableDeclaration(Box<'a, VariableDeclaration<'a>>) = 32,
    /* ...other Declaration variants... */
}
```

All `Declaration`'s variants are combined into `Statement`, but
`Declaration` type still exists.

As both types are `#[repr(C, u8)]`, and the discriminants are aligned, a
`Declaration` can be transmuted to a `Statement` at zero cost.

This is the same thing as #2847, but here applied to *all* nested enums
in the AST, and with improved helper methods.

No enums increase in size, and a few get smaller. Indirection is reduced
for some types (this removes multiple levels of boxing).

## Why?

1. It is a prerequisite for Traversable AST (#2987).
2. It would help a lot with AST Transfer (#2409) - it solves the only
remaining blocker for this.
3. It is a step closer to making the whole AST `#[repr(C)]`.

## Why is it a good thing for the AST to be `#[repr(C)]`?

Oxc's direction appears to be increasingly to build up control over the
fundamental primitives we use, in order to unlock performance and
features. We have our own allocator, our own custom implementations for
`Box` and `Vec`, our own `IndexVec` (TBC). The AST is the central
building block of Oxc, and taking control of its memory layout feels
like a step in this same direction.

Oxc has a major advantage over other similar libraries in that it keeps
all the AST data in an arena. This opens the door to treating the AST
either as Rust types or as *pure data* (just bytes). That data can be
moved around and manipulated beyond what Rust natively allows.

However, to enable that, the types need to be well-specified, with
completely stable layouts. `#[repr(C)]` is the only tool Rust provides
to do this.

Once the types are `#[repr(C)]`, various features become possible:

1. Cheap transfer of the AST across boundaries without ser/deser - the
property used by AST Transfer.
2. Having multiple versions of the AST (standard, read-only,
traversable), and these AST representations can be converted to one
other at zero cost via transmute - the property used by Traversable AST
scheme.
3. Caching AST data on disk (#3079) or transferring across network.
4. Stuff we haven't thought of yet!

Allowing the AST to be treated as pure data will likely unlock other
"next level" features further down the track (caching for "edge
bundling" comes to mind).

## The problem with `#[repr(C)]`

It's not *required* to squash nested enums to make the AST `#[repr(C)]`.

But the problem with `#[repr(C)]` is that it disables some compiler
optimizations. Without `#[repr(C)]`, the compiler squashes enums itself
in some cases (which is how `Statement` is currently 16 bytes). But
making the types `#[repr(C)]` as they are currently disables this
optimization.

So this PR essentially makes explicit what the compiler is already doing
- and in fact goes a bit further with the optimization than the compiler
is able to, in squashing 3 or 4 layers of nested enums (the compiler
only does up to 2 layers).

## Implementation

One enum "inheriting" variants from another is implemented with
`inherit_variants!` macro.

```rs
inherit_variants! {
#[repr(C, u8)]
pub enum Statement<'a> {
    BlockStatement(Box<'a, BlockStatement<'a>>),
    /* ...other Statement variants... */
    
    // `Declaration` variants added here by `inherit_variants!` macro
    @inherit Declaration
    // `ModuleDeclaration` variants added here by `inherit_variants!` macro
    @inherit ModuleDeclaration
}
}
```

The macro is *fairly* lightweight, and I think the above is quite easy
to understand. No proc macros.

The macro also implements utility methods for converting between enums
e.g. `Statement::as_declaration`. These methods are all zero-cost
(essentially transmutes).

New patterns for dealing with nested enums are introduced:

Creation:

```rs
// Old
let stmt = Statement::Declaration(Declaration::VariableDeclaration(var_decl));

// New
let stmt = Statement::VariableDeclaration(var_decl);
```

Conversion:

```rs
// Old
let stmt = Statement::Declaration(decl);

// New
let stmt = Statement::from(decl);
```

Testing:

```rs
// Old
if matches!(stmt, Statement::Declaration(_)) { }
if matches!(stmt, Statement::ModuleDeclaration(m) if m.is_import()) { }

// New
if stmt.is_declaration() { }
if matches!(stmt, Statement::ImportDeclaration(_)) { }
```

Branching:

```rs
// Old
if let Statement::Declaration(decl) = &stmt { decl.do_stuff() };

// New
if let Some(decl) = stmt.as_declaration() { decl.do_stuff() };
```

Matching:

```rs
// Old
match stmt {
    Statement::Declaration(decl) => visitor.visit(decl),
}

// New (exhaustive match)
match stmt {
    match_declaration!(Statement) => visitor.visit(stmt.to_declaration()),
}

// New (alternative)
match stmt {
    _ if stmt.is_declaration() => visitor.visit(stmt.to_declaration()),
}
```

New syntax has pluses and minuses vs the old. `match` syntax is worse,
but when working with a deeply nested enum, the code is much nicer -
it's shorter and easier to read.

This PR removes 200 lines from the linter with changes like this:


https://github.com/oxc-project/oxc/pull/3115/files#diff-dc417ff57352da6727a760ec6dee22de6816f8231fb69dbef1bf05d478699103L92-R95

```diff
- let AssignmentTarget::SimpleAssignmentTarget(simple_assignment_target) =
-     &assignment_expr.left
- else {
-     return;
- };
- let SimpleAssignmentTarget::AssignmentTargetIdentifier(ident) =
-     simple_assignment_target
+ let AssignmentTarget::AssignmentTargetIdentifier(ident) = &assignment_expr.left
else {
    return;
};
```
2024-04-28 20:40:37 +08:00
Dunqing
c3d8a85eb5
feat(semantic): report that enum member must have initializer (#3113)
See
https://www.typescriptlang.org/play/?target=99#code/KYOwrgtgBAglDeAoKKoEMoF4oFk0BcALAOgGcBLEACgEYBKAGmVQCMmBfRRUSKAIQTMUGbACIaAJgDMopqihtEnRABtg+KADMwIAMZYoVOlgB8USVIDc3cNADCg+SK07dRuaw6IgA
2024-04-27 22:08:02 +08:00
Boshen
78875b79fe
feat(transformer): implement typescript namespace (#3025)
Co-authored-by: Dunqing <dengqing0821@gmail.com>
2024-04-25 10:26:11 +00:00
Dunqing
2dd96df847
feat(semantic): report namespace related errors (#3093)
See
https://www.typescriptlang.org/play/?target=99#code/GYVwdgxgLglg9mABAIzgEwJ4AoCUiDeAUIomAIYC2ApgM4AOZEViAIgQL6HtA
2024-04-25 14:01:58 +08:00
Wang Wenzhe
8de7399b08
chore(tasks): observe nursery rule in benchmark (#3082) 2024-04-24 23:03:52 +08:00
Yuji Sugiura
45649db86e
fix(tasks/rulegen): Follow #3037, settings handling update (#3077) 2024-04-23 13:28:52 +08:00
overlookmotel
ab445d6acd
chore(deps): update benchmark pnpm dependencies (#3075)
Update pnpm dependencies for benchmarks. Alter usage of `tar` package
for changes to exports in v7.

Fixes
https://github.com/oxc-project/oxc/pull/3056#issuecomment-2068362398.
2024-04-23 08:21:17 +08:00
renovate[bot]
df7b9ee8da
chore(deps): lock file maintenance rust crates (#3059) 2024-04-22 09:58:21 +08:00
renovate[bot]
6168e8dcb0
chore(deps): update pnpm to v9.0.5 (#3063)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [pnpm](https://pnpm.io) ([source](https://togithub.com/pnpm/pnpm)) |
[`9.0.4` -> `9.0.5`](https://renovatebot.com/diffs/npm/pnpm/9.0.4/9.0.5)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/pnpm/9.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/pnpm/9.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/pnpm/9.0.4/9.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pnpm/9.0.4/9.0.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>pnpm/pnpm (pnpm)</summary>

### [`v9.0.5`](https://togithub.com/pnpm/pnpm/compare/v9.0.4...v9.0.5)

[Compare Source](https://togithub.com/pnpm/pnpm/compare/v9.0.4...v9.0.5)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 8am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-22 09:04:26 +08:00
overlookmotel
6bc18e15e0
refactor(bench): reuse allocator in parser + lexer benchmarks (#3053)
Re-use allocator in parser + lexer benchmarks.

I believe this is the recommended usage when parsing a bunch of files -
to re-use one allocator rather than create a fresh one for each run, so
it makes sense to me that this is what the benchmark should measure.

Doesn't show much difference on CodSpeed because it only runs the
benchmark once, and it treats allocations as free anyway. But I imagine
the difference may show up a bit more in a standard criterion benchmark.
2024-04-22 09:03:26 +08:00
renovate[bot]
e204d192d6
chore(deps): update pnpm to v9 (#3042)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [pnpm](https://pnpm.io) ([source](https://togithub.com/pnpm/pnpm)) |
[`8.15.7` ->
`9.0.4`](https://renovatebot.com/diffs/npm/pnpm/8.15.7/9.0.4) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/pnpm/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/pnpm/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/pnpm/8.15.7/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pnpm/8.15.7/9.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>pnpm/pnpm (pnpm)</summary>

### [`v9.0.4`](https://togithub.com/pnpm/pnpm/compare/v9.0.3...v9.0.4)

[Compare Source](https://togithub.com/pnpm/pnpm/compare/v9.0.3...v9.0.4)

### [`v9.0.3`](https://togithub.com/pnpm/pnpm/compare/v9.0.2...v9.0.3)

[Compare Source](https://togithub.com/pnpm/pnpm/compare/v9.0.2...v9.0.3)

### [`v9.0.2`](https://togithub.com/pnpm/pnpm/compare/v9.0.1...v9.0.2)

[Compare Source](https://togithub.com/pnpm/pnpm/compare/v9.0.1...v9.0.2)

### [`v9.0.1`](https://togithub.com/pnpm/pnpm/compare/v9.0.0...v9.0.1)

[Compare Source](https://togithub.com/pnpm/pnpm/compare/v9.0.0...v9.0.1)

### [`v9.0.0`](https://togithub.com/pnpm/pnpm/releases/tag/v9.0.0)

[Compare
Source](https://togithub.com/pnpm/pnpm/compare/v8.15.7...v9.0.0)

##### Major Changes

-   Node.js v16 support discontinued

If you still require Node.js 16, don't worry. We ship pnpm bundled with
Node.js. This means that regardless of which Node.js version you've
installed, pnpm will operate using the necessary Node.js runtime. For
this to work you need to install pnpm either using the [standalone
script](https://pnpm.io/installation#using-a-standalone-script) or
install the `@pnpm/exe` package.

-   Configuration updates:
- [`dedupe-injected-deps`](https://pnpm.io/npmrc#dedupe-injected-deps):
enabled by default.
-
[`link-workspace-packages`](https://pnpm.io/npmrc#link-workspace-packages):
disabled by default. This means that by default, dependencies will be
linked from workspace packages only when they are specified using the
[workspace
protocol](https://pnpm.io/workspaces#workspace-protocol-workspace).
-
[`hoist-workspace-packages`](https://pnpm.io/npmrc#hoist-workspace-packages):
enabled by default.
-
[`enable-pre-post-scripts`](https://pnpm.io/cli/run#enable-pre-post-scripts):
enabled by default.
- Use the same directory for state files on macOS as on Linux
(`~/.local/state/pnpm`).
- pnpm will now check the `package.json` file for a `packageManager`
field. If this field is present and specifies a different package
manager or a different version of pnpm than the one you're currently
using, pnpm will not proceed. This ensures that you're always using the
correct package manager and version that the project requires.

-   Lockfile changes:
- Lockfile v9 is adopted. This new format has changes for better
readability, and better resistence to Git conflicts.
- Support for lockfile v5 is dropped. Use pnpm v8 to convert lockfile v5
to lockfile v6 [#&#8203;7470](https://togithub.com/pnpm/pnpm/pull/7470).

-   Dependency resolution changes:
- Correct resolution of peer dependencies that have their own peer
dependencies.
Related issue:
[#&#8203;7444](https://togithub.com/pnpm/pnpm/issues/7444).
Related PR: [#&#8203;7606](https://togithub.com/pnpm/pnpm/pull/7606).
- Optional peer dependencies may be resolved from any packages in the
dependency graph
[#&#8203;7830](https://togithub.com/pnpm/pnpm/pull/7830).

- `pnpm licenses list` prints license information of all versions of the
same package in case different versions use different licenses. The
format of the `pnpm licenses list --json` output has been changed
[#&#8203;7528](https://togithub.com/pnpm/pnpm/pull/7528).

- A new command added for printing completion code to the console: `pnpm
completion [shell]`. The old command that modified the user's shell
dotfiles has been removed
[#&#8203;3083](https://togithub.com/pnpm/pnpm/issues/3083).

- When installing git-hosted dependencies, only pick the files that
would be packed with the package
[#&#8203;7638](https://togithub.com/pnpm/pnpm/pull/7638).

##### Minor Changes

- It is now possible to install only a subdirectory from a Git
repository.

For example, `pnpm add github:user/repo#path:packages/foo` will add a
dependency from the `packages/foo` subdirectory.

This new parameter may be combined with other supported parameters
separated by `&`. For instance, the next command will install the same
package from the `dev` branch: `pnpm add
github:user/repo#dev&path:packages/bar`.

Related issue:
[#&#8203;4765](https://togithub.com/pnpm/pnpm/issues/4765).
Related PR: [#&#8203;7487](https://togithub.com/pnpm/pnpm/pull/7487).

-   `node-gyp` updated to version 10.

- PowerShell completion support added
[#&#8203;7597](https://togithub.com/pnpm/pnpm/pull/7597).

- Support `node-options` option inside `.npmrc` file when running
scripts [#&#8203;7596](https://togithub.com/pnpm/pnpm/issues/7596).

- Added support for registry-scoped SSL configurations (cert, key, and
ca). Three new settings supported: `<registryURL>:certfile`,
`<registryURL>:keyfile`, and `<registryURL>:ca`. For instance:

        //registry.mycomp.com/:certfile=server-cert.pem
        //registry.mycomp.com/:keyfile=server-key.pem
        //registry.mycomp.com/:cafile=client-cert.pem

Related issue:
[#&#8203;7427](https://togithub.com/pnpm/pnpm/issues/7427).
Related PR: [#&#8203;7626](https://togithub.com/pnpm/pnpm/pull/7626).

- Add a field named `ignoredOptionalDependencies`. This is an array of
strings. If an optional dependency has its name included in this array,
it will be skipped
[#&#8203;7714](https://togithub.com/pnpm/pnpm/pull/7714).

- The checksum of the `.pnpmfile.cjs` is saved into the lockfile. If the
pnpmfile gets modified, the lockfile is reanalyzed to apply the changes
[#&#8203;7662](https://togithub.com/pnpm/pnpm/pull/7662).

- Added cache for `pnpm dlx`
[#&#8203;5277](https://togithub.com/pnpm/pnpm/issues/5277).

##### Patch Changes

- Package tarballs are not downloaded during `--lockfile-only`
installation [#&#8203;1328](https://togithub.com/pnpm/pnpm/issues/1328).
- Peer dependency rules should only affect reporting, not data in the
lockfile [#&#8203;7758](https://togithub.com/pnpm/pnpm/pull/7758).
- Link overrides should be able to use absolute path
[#&#8203;7749](https://togithub.com/pnpm/pnpm/pull/7749).
- `pnpm dlx` should not read settings from the current working directory
[#&#8203;7916](https://togithub.com/pnpm/pnpm/pull/7916).

##### Platinum Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a href="https://bit.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank"><img src="https://pnpm.io/img/users/bit.svg"
width="80"></a>
      </td>
      <td align="center" valign="middle">
<a href="https://figma.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank"><img src="https://pnpm.io/img/users/figma.svg"
width="80"></a>
      </td>
    </tr>
  </tbody>
</table>

##### Gold Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a href="https://discord.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/discord.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/discord_light.svg" />
<img src="https://pnpm.io/img/users/discord.svg" width="220" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://prisma.io/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/prisma.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/prisma_light.svg" />
<img src="https://pnpm.io/img/users/prisma.svg" width="180" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://uscreen.de/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/uscreen.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/uscreen_light.svg" />
<img src="https://pnpm.io/img/users/uscreen.svg" width="180" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a
href="https://www.jetbrains.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/jetbrains.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/jetbrains.svg" />
<img src="https://pnpm.io/img/users/jetbrains.svg" width="85" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://nx.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/nx.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/nx_light.svg" />
            <img src="https://pnpm.io/img/users/nx.svg" width="120" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a
href="https://coderabbit.ai/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/coderabbit.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/coderabbit_light.svg" />
<img src="https://pnpm.io/img/users/coderabbit.svg" width="220" />
          </picture>
        </a>
      </td>
    </tr>
  </tbody>
</table>

##### Our Silver Sponsors

<table>
  <tbody>
    <tr>
      <td align="center" valign="middle">
<a
href="https://leniolabs.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <img src="https://pnpm.io/img/users/leniolabs.jpg" width="80">
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://vercel.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/vercel.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/vercel_light.svg" />
<img src="https://pnpm.io/img/users/vercel.svg" width="180" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://depot.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/depot.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/depot_light.svg" />
<img src="https://pnpm.io/img/users/depot.svg" width="200" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://moonrepo.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/moonrepo.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/moonrepo_light.svg" />
<img src="https://pnpm.io/img/users/moonrepo.svg" width="200" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://devowl.io/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/devowlio.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/devowlio.svg" />
<img src="https://pnpm.io/img/users/devowlio.svg" width="200" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a href="https://macpaw.com/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/macpaw.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/macpaw_light.svg" />
<img src="https://pnpm.io/img/users/macpaw.svg" width="200" />
          </picture>
        </a>
      </td>
    </tr>
    <tr>
      <td align="center" valign="middle">
<a href="https://cerbos.dev/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
          <picture>
<source media="(prefers-color-scheme: light)"
srcset="https://pnpm.io/img/users/cerbos.svg" />
<source media="(prefers-color-scheme: dark)"
srcset="https://pnpm.io/img/users/cerbos_light.svg" />
<img src="https://pnpm.io/img/users/cerbos.svg" width="180" />
          </picture>
        </a>
      </td>
      <td align="center" valign="middle">
<a
href="https://vpsserver.com/en-us/?utm_source=pnpm&utm_medium=release_notes"
target="_blank">
<img src="https://pnpm.io/img/users/vpsserver.svg" width="180" />
        </a>
      </td>
    </tr>
  </tbody>
</table>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 8am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-21 15:50:08 +08:00
Ali Rezvani
0d770f57ff
refactor: remove redundant imports to fix some of clippy warnings. (#3028)
These are raising warnings in nightly, And are in fact redundant.
2024-04-19 21:02:23 +08:00
Boshen
fa08abe20a
feat(linter): remove import/no-unresolved (#3023)
closes #3015

This plugin will always contain false positives due to module resolution
complexity.
2024-04-19 12:45:50 +08:00
Dunqing
3831147b6d
feat(transformer/typescript): report error for export = <value> (#3021) 2024-04-18 18:56:29 +08:00
Dunqing
7416de217b
feat(transformer/typescript): reports error for import lib = require(...); (#3020) 2024-04-18 18:54:45 +08:00
Dunqing
e14ac17c72
feat(transformer/typescript): insert this assignment after the super call (#3018) 2024-04-18 18:53:01 +08:00
Boshen
722d4c2350
fix(transformer): TypeScriptOptions deserialize should fallback to default (#3012) 2024-04-17 16:27:50 +08:00
Dunqing
b72bdcaf96
feat(transformer/react): reports duplicate __self/__source prop error (#3009) 2024-04-17 13:34:31 +08:00
Wang Wenzhe
d3b7fc75f4
chore(task): add specific pnpm version for codespeed task (#3010)
> Corepack is about to download
https://registry.npmjs.org/pnpm/-/pnpm-9.0.0.tgz. 
> Cannot perform a frozen installation because the version of the
lockfile is incompatible with this version of pnpm

https://github.com/oxc-project/oxc/actions/runs/8703527853/job/23877194263?pr=2874
2024-04-16 21:46:40 +08:00
Boshen
df1996157f
chore(transform_conformance): ignore more unsupported plugins (#3008) 2024-04-16 18:59:21 +08:00
Dunqing
cdd3bc5a4e
feat(transformer_conformance): enable typescript when the typescript plugin is present (#3007) 2024-04-16 10:47:06 +00:00
Dunqing
99e038cfc0
fix(transformer/typescript): modifiers should not be removed (#3005)
`codegen` relies on the modifier to decide whether to print or not. For
example, if declare is present, nothing will be printed if typescript is
not enabled.

We may need to solve this problem in a way that doesn't rely on
modifers.
2024-04-16 10:33:13 +00:00
Boshen
ae9d681b4d
feat(transform_conformance): skip windows tests (#3003) 2024-04-16 17:50:43 +08:00
Boshen
85a3653994
feat(transformer): add "_jsxFileName" variable in jsx source plugin (#3000) 2024-04-16 17:40:24 +08:00
Boshen
67045467c7
fix(transformer): react development default value should be false (#3002) 2024-04-16 17:28:31 +08:00
Boshen
5f4c1e1d3e
chore(transform_conformance): skip custom presets (#3001) 2024-04-16 17:21:34 +08:00
Dunqing
afb1dd4b24
feat(transformer/typescript): support for transform TSImportEqualsDeclaration (#2998) 2024-04-16 06:45:41 +00:00
Dunqing
6732e8b9af
feat(transformer/typescript): support for transform enum (#2997)
The current implementation is copied from the previous implementation
2024-04-16 14:39:37 +08:00
Boshen
e43c245388
feat(transformer): add import helpers to manage module imports (#2996)
closes #2971
2024-04-16 14:33:44 +08:00
Dunqing
6a53fa367b
feat(transformer/typescript): correct elide imports/exports statements (#2995)
remove ts annotations one benefit: `IdentifierReference` only used on js
code

The `TypescriptReferenceCollector` implementation is inspired by
5f75019683/crates/swc_ecma_transforms_typescript/src/strip_import_export.rs (L9-L99)

This seems simpler to implement than using scope
2024-04-16 11:06:58 +08:00
Boshen
82e00bc951
refactor(transformer): remove boilerplate code around decorators to reduce noise (#2991) 2024-04-15 13:51:09 +08:00
Boshen
b4bfa2f34c
refactor(transform_conformance): correctly handle BABEL_8_BREAKING (#2990) 2024-04-15 13:41:45 +08:00
Boshen
6532799ff2
Revert "chore(deps): update dependency tar to v7 (#2985)"
This reverts commit 00d75b2fad.
2024-04-15 10:32:01 +08:00
renovate[bot]
00d75b2fad
chore(deps): update dependency tar to v7 (#2985)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [tar](https://togithub.com/isaacs/node-tar) | [`^6.2.0` ->
`^7.0.0`](https://renovatebot.com/diffs/npm/tar/6.2.1/7.0.1) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/tar/7.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/tar/7.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/tar/6.2.1/7.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/tar/6.2.1/7.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>isaacs/node-tar (tar)</summary>

###
[`v7.0.1`](https://togithub.com/isaacs/node-tar/compare/v7.0.0...v7.0.1)

[Compare
Source](https://togithub.com/isaacs/node-tar/compare/v7.0.0...v7.0.1)

###
[`v7.0.0`](https://togithub.com/isaacs/node-tar/compare/v6.2.1...v7.0.0)

[Compare
Source](https://togithub.com/isaacs/node-tar/compare/v6.2.1...v7.0.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 8am on monday" in timezone
Asia/Shanghai, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/oxc-project/oxc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-15 10:11:05 +08:00
Boshen
5a286c3d9f
feat(transform_conformance): drop more unsupported plugins (#2984) 2024-04-14 23:04:04 +08:00
Boshen
9643cba4a4
feat(transform_conformance): drop all babel 7 specific tests (#2982)
@Dunqing Is this correct?
2024-04-14 23:02:38 +08:00