Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File existence checks does not work on exports of non-js files #96

Closed
freshgum-bubbles opened this issue May 8, 2024 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@freshgum-bubbles
Copy link

freshgum-bubbles commented May 8, 2024

As of current, publint doesn't seem to support Bun's export field entry.

For example, the following raises no error:

{
  "exports": {
    ".": {
      "bun": "./lufhwuh.js"
    }
  }
}

I'd be more than happy to send in a PR if you'd like.

(It's also worth noting that Bun supports TypeScript out-of-the-box, so "bun": "./src/index.ts" is possible.)

P.S. I'm loving publint so far. It's found two pretty painful issues from the start -- thank you so much!

@bluwy
Copy link
Owner

bluwy commented May 9, 2024

Thanks! I wonder what error do you expect from that currently? It seems the missing published files check, and the file extension check seems to be working fine.

About TypeScript support, publint doesn't have much checks for it right now, but it still does check if the file is missing for example.

@freshgum-bubbles
Copy link
Author

It seems the missing published files check, and the file extension check seems to be working fine.

Hmm, they don't seem to work on my machine -- whatever I enter into the bun condition goes unnoticed.

About TypeScript support, publint doesn't have much checks for it right now, but it still does check if the file is missing for example.

Roger that :-)

@bluwy
Copy link
Owner

bluwy commented May 13, 2024

Would be great if you can share an example here, otherwise I'm not sure what to fix for this issue.

@freshgum-bubbles
Copy link
Author

Sorry for the delay -- I haven't got as much time as I usually have this week, but I could get you a repro. next week. In my testing, publint wasn't checking what was in the bun condition, so "bun": "efuhefefouhefu.ts" would pass just fine.

If it helps, the repository in question is https://github.com/freshgum/typedi -- that's where I was able to reproduce the issue :)

@bluwy
Copy link
Owner

bluwy commented May 17, 2024

Ah ok I found the issue. On this line:

publint/pkg/src/index.js

Lines 622 to 623 in 7ba9aa3

// TODO: maybe check .ts in the future
if (!isFilePathLintable(filePath)) continue

If the path is not lintable (which simply means if it's not .js, .cjs, .mjs), it should continue to check if the file exist like:

publint/pkg/src/index.js

Lines 580 to 588 in 7ba9aa3

// types. check file existence only
if (currentPath.includes('types')) {
const pq = createPromiseQueue()
for (const filePath of exportsFiles) {
pq.push(async () => await readFile(filePath, currentPath))
}
await pq.wait()
return
}

But it wasn't.

@bluwy bluwy added the bug Something isn't working label May 17, 2024
@bluwy bluwy changed the title Bun support in package['exports'] File existence checks does not work on exports of non-js files May 17, 2024
@bluwy bluwy closed this as completed in 0b0f517 May 18, 2024
renovate bot referenced this issue in netlify/functions May 20, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [publint](https://publint.dev)
([source](https://togithub.com/bluwy/publint/tree/HEAD/pkg)) | [`0.2.7`
-> `0.2.8`](https://renovatebot.com/diffs/npm/publint/0.2.7/0.2.8) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/publint/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/publint/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/publint/0.2.7/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/publint/0.2.7/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>bluwy/publint (publint)</summary>

### [`v0.2.8`](https://togithub.com/bluwy/publint/releases/tag/v0.2.8)

[Compare
Source](https://togithub.com/bluwy/publint/compare/v0.2.7...v0.2.8)

##### Bug fixes

- Fix file existence check for non-js files
([https://github.com/bluwy/publint/issues/96](https://togithub.com/bluwy/publint/issues/96))

**Full Changelog**:
bluwy/publint@v0.2.7...v0.2.8

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
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 [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/netlify/functions).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjMuNSIsInVwZGF0ZWRJblZlciI6IjM3LjM2My41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJqYXZhc2NyaXB0Il19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this issue in tnez/starter-npm-pkg May 20, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@changesets/cli](https://togithub.com/changesets/changesets/tree/main#readme)
([source](https://togithub.com/changesets/changesets)) | [`2.27.1` ->
`2.27.2`](https://renovatebot.com/diffs/npm/@changesets%2fcli/2.27.1/2.27.2)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@changesets%2fcli/2.27.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@changesets%2fcli/2.27.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@changesets%2fcli/2.27.1/2.27.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@changesets%2fcli/2.27.1/2.27.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node)
([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node))
| [`20.12.11` ->
`20.12.12`](https://renovatebot.com/diffs/npm/@types%2fnode/20.12.11/20.12.12)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fnode/20.12.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fnode/20.12.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fnode/20.12.11/20.12.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fnode/20.12.11/20.12.12?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [publint](https://publint.dev)
([source](https://togithub.com/bluwy/publint/tree/HEAD/pkg)) | [`0.2.7`
-> `0.2.8`](https://renovatebot.com/diffs/npm/publint/0.2.7/0.2.8) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/publint/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/publint/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/publint/0.2.7/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/publint/0.2.7/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>changesets/changesets (@&#8203;changesets/cli)</summary>

###
[`v2.27.2`](https://togithub.com/changesets/changesets/releases/tag/%40changesets/cli%402.27.2)

[Compare
Source](https://togithub.com/changesets/changesets/compare/@changesets/cli@2.27.1...@changesets/cli@2.27.2)

##### Patch Changes

- [#&#8203;1354](https://togithub.com/changesets/changesets/pull/1354)
[`69be7dc`](https://togithub.com/changesets/changesets/commit/69be7dc7195011ac6dbd00b24ea923f02adcf69c)
Thanks [@&#8203;Andarist](https://togithub.com/Andarist)! - Fixed an
issue with `changeset status` incorrectly returning an error status in
two cases:

    -   for changed ignored packages
- for changed private packages when `privatePackage.version` was set to
`false`

- [#&#8203;1351](https://togithub.com/changesets/changesets/pull/1351)
[`c6da182`](https://togithub.com/changesets/changesets/commit/c6da182ece2ec40974f15f3efcf9d9ba20cf122b)
Thanks [@&#8203;TheHolyWaffle](https://togithub.com/TheHolyWaffle)! -
Fix an issue with not applying a custom `.prettierrc` configuration with
`prettier@>= 3.1.1`

- Updated dependencies
\[[`c6da182`](https://togithub.com/changesets/changesets/commit/c6da182ece2ec40974f15f3efcf9d9ba20cf122b)]:
-
[@&#8203;changesets/apply-release-plan](https://togithub.com/changesets/apply-release-plan)[@&#8203;7](https://togithub.com/7).0.1
-
[@&#8203;changesets/write](https://togithub.com/changesets/write)[@&#8203;0](https://togithub.com/0).3.1

</details>

<details>
<summary>bluwy/publint (publint)</summary>

### [`v0.2.8`](https://togithub.com/bluwy/publint/releases/tag/v0.2.8)

[Compare
Source](https://togithub.com/bluwy/publint/compare/v0.2.7...v0.2.8)

##### Bug fixes

- Fix file existence check for non-js files
([https://github.com/bluwy/publint/issues/96](https://togithub.com/bluwy/publint/issues/96))

**Full Changelog**:
bluwy/publint@v0.2.7...v0.2.8

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - "before 4am on Monday" (UTC).

🚦 **Automerge**: Enabled.

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

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- 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/tnez/starter-npm-pkg).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM2My41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
dubzzz referenced this issue in dubzzz/fast-check May 21, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [publint](https://publint.dev)
([source](https://togithub.com/bluwy/publint/tree/HEAD/pkg)) | [`^0.2.7`
-> `^0.2.8`](https://renovatebot.com/diffs/npm/publint/0.2.7/0.2.8) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/publint/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/publint/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/publint/0.2.7/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/publint/0.2.7/0.2.8?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>bluwy/publint (publint)</summary>

### [`v0.2.8`](https://togithub.com/bluwy/publint/releases/tag/v0.2.8)

[Compare
Source](https://togithub.com/bluwy/publint/compare/v0.2.7...v0.2.8)

##### Bug fixes

- Fix file existence check for non-js files
([https://github.com/bluwy/publint/issues/96](https://togithub.com/bluwy/publint/issues/96))

**Full Changelog**:
bluwy/publint@v0.2.7...v0.2.8

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
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/dubzzz/fast-check).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants