Skip to content

fix(register): fix esm entry resolver for third-party executer, close #762#766

Merged
Brooooooklyn merged 3 commits into
swc-project:masterfrom
yeliex:fix/specifer-format
Apr 9, 2024
Merged

fix(register): fix esm entry resolver for third-party executer, close #762#766
Brooooooklyn merged 3 commits into
swc-project:masterfrom
yeliex:fix/specifer-format

Conversation

@yeliex

@yeliex yeliex commented Apr 8, 2024

Copy link
Copy Markdown
Contributor

Third-party executors like mocha, may import scripts with fileUrl absolute path.

This pr converts specifier from fileUrl to path.

close #762

@changeset-bot

changeset-bot Bot commented Apr 8, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 069b289

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@yeliex yeliex force-pushed the fix/specifer-format branch from 354f60b to cb31ec4 Compare April 8, 2024 11:05
@yeliex

yeliex commented Apr 8, 2024

Copy link
Copy Markdown
Contributor Author

@Brooooooklyn @martinslota please take a look

@martinslota martinslota left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that with startsWith instead of endsWith this addresses #762.

Comment thread packages/register/esm.mts Outdated
@Brooooooklyn Brooooooklyn merged commit 9e6c02f into swc-project:master Apr 9, 2024
@yeliex yeliex deleted the fix/specifer-format branch April 9, 2024 03:03
yeliex added a commit to yeliex/swc-node that referenced this pull request Apr 10, 2024
…wc-project#762 (swc-project#766)

* fix(register): fix esm entry resolver for third-party executor, close swc-project#762

* Create great-goats-trade.md

* fix: bug fix
@weyert

weyert commented Apr 30, 2024

Copy link
Copy Markdown

@Brooooooklyn Could you cut a release for this PR?

tsang-bot Bot referenced this pull request in tsangste/nx-package-test May 5, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@swc-node/register](https://togithub.com/swc-project/swc-node) |
[`1.9.0` ->
`1.9.1`](https://renovatebot.com/diffs/npm/@swc-node%2fregister/1.9.0/1.9.1)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@swc-node%2fregister/1.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@swc-node%2fregister/1.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@swc-node%2fregister/1.9.0/1.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@swc-node%2fregister/1.9.0/1.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>swc-project/swc-node (@&#8203;swc-node/register)</summary>

###
[`v1.9.1`](https://togithub.com/swc-project/swc-node/releases/tag/%40swc-node/register%401.9.1)

[Compare
Source](https://togithub.com/swc-project/swc-node/compare/@swc-node/[email protected]...@swc-node/[email protected])

#### What's Changed

- fix: esm module resolve issues by
[@&#8203;yeliex](https://togithub.com/yeliex) in
[https://github.com/swc-project/swc-node/pull/754](https://togithub.com/swc-project/swc-node/pull/754)
- fix: add default tsconfig.baseUrl to align with tsc behavior by
[@&#8203;yeliex](https://togithub.com/yeliex) in
[https://github.com/swc-project/swc-node/pull/759](https://togithub.com/swc-project/swc-node/pull/759)
- fix(register): fix esm entry resolver for third-party executer, close
[#&#8203;762](https://togithub.com/swc-project/swc-node/issues/762) by
[@&#8203;yeliex](https://togithub.com/yeliex) in
[https://github.com/swc-project/swc-node/pull/766](https://togithub.com/swc-project/swc-node/pull/766)
- fix: support compile js files. close
[#&#8203;761](https://togithub.com/swc-project/swc-node/issues/761) by
[@&#8203;yeliex](https://togithub.com/yeliex) in
[https://github.com/swc-project/swc-node/pull/767](https://togithub.com/swc-project/swc-node/pull/767)
- chore: upgrade dependencies by
[@&#8203;Brooooooklyn](https://togithub.com/Brooooooklyn) in
[https://github.com/swc-project/swc-node/pull/771](https://togithub.com/swc-project/swc-node/pull/771)

**Full Changelog**:
https://github.com/swc-project/swc-node/compare/[@&#8203;swc-node/register](https://togithub.com/swc-node/register)[@&#8203;1](https://togithub.com/1).8.0...[@&#8203;swc-node/register](https://togithub.com/swc-node/register)[@&#8203;1](https://togithub.com/1).9.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **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 [Renovate
Bot](https://togithub.com/renovatebot/renovate).

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

Co-authored-by: tsang-bot[bot] <146107447+tsang-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Using @swc-node/register with Mocha leads to errors

4 participants