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

wrong error for "main" #79

Closed
ljharb opened this issue Oct 19, 2023 · 6 comments
Closed

wrong error for "main" #79

ljharb opened this issue Oct 19, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@ljharb
Copy link

ljharb commented Oct 19, 2023

I have a package, function-bind, that has "main" set to "index" - which node properly resolves to "index.js". However, I get:

pkg.main is index but the file is not published. Is it specified in pkg.files?
@bluwy
Copy link
Owner

bluwy commented Oct 20, 2023

Seems like it could be a bug detecting packed files locally. I'll have to check that once I get to my laptop.

@ljharb
Copy link
Author

ljharb commented Oct 20, 2023

It seems like you're not using the node resolution algorithm on the main value before checking for the file's existence.

@bluwy bluwy closed this as completed in ca0ecfe Oct 20, 2023
@bluwy
Copy link
Owner

bluwy commented Oct 20, 2023

I did

publint/pkg/src/index.js

Lines 119 to 122 in 1c70d9e

const mainContent = await readFile(mainPath, mainPkgPath, [
'.js',
'/index.js'
])

I was checking the packed files wrongly that lead to the bug that's fixed in the commit.

@bluwy bluwy added the bug Something isn't working label Oct 20, 2023
@ljharb
Copy link
Author

ljharb commented Oct 20, 2023

I doubt it's that simple, since another package has ./ and it wasn't working, but I'll test with this release.

@bluwy
Copy link
Owner

bluwy commented Oct 20, 2023

You can try with v0.2.5

@ljharb
Copy link
Author

ljharb commented Oct 21, 2023

seems good, i haven't found one that breaks yet.

renovate bot referenced this issue in tnez/starter-npm-pkg Oct 23, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@edge-runtime/jest-environment](https://edge-runtime.vercel.app/packages/jest-environment)
([source](https://togithub.com/vercel/edge-runtime)) | [`2.3.4` ->
`2.3.5`](https://renovatebot.com/diffs/npm/@edge-runtime%2fjest-environment/2.3.4/2.3.5)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@edge-runtime%2fjest-environment/2.3.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@edge-runtime%2fjest-environment/2.3.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@edge-runtime%2fjest-environment/2.3.4/2.3.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@edge-runtime%2fjest-environment/2.3.4/2.3.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [@edge-runtime/types](https://edge-runtime.vercel.app/packages/types)
([source](https://togithub.com/vercel/edge-runtime)) | [`2.2.4` ->
`2.2.5`](https://renovatebot.com/diffs/npm/@edge-runtime%2ftypes/2.2.4/2.2.5)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@edge-runtime%2ftypes/2.2.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@edge-runtime%2ftypes/2.2.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@edge-runtime%2ftypes/2.2.4/2.2.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@edge-runtime%2ftypes/2.2.4/2.2.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
|
[@types/jest](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest)
([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) |
[`29.5.5` ->
`29.5.6`](https://renovatebot.com/diffs/npm/@types%2fjest/29.5.5/29.5.6)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fjest/29.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fjest/29.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fjest/29.5.5/29.5.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fjest/29.5.5/29.5.6?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)) |
[`20.8.6` ->
`20.8.7`](https://renovatebot.com/diffs/npm/@types%2fnode/20.8.6/20.8.7)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@types%2fnode/20.8.7?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@types%2fnode/20.8.7?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@types%2fnode/20.8.6/20.8.7?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@types%2fnode/20.8.6/20.8.7?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [eslint](https://eslint.org)
([source](https://togithub.com/eslint/eslint)) | [`8.51.0` ->
`8.52.0`](https://renovatebot.com/diffs/npm/eslint/8.51.0/8.52.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/eslint/8.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/eslint/8.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/eslint/8.51.0/8.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint/8.51.0/8.52.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [publint](https://publint.dev)
([source](https://togithub.com/bluwy/publint)) | [`0.2.4` ->
`0.2.5`](https://renovatebot.com/diffs/npm/publint/0.2.4/0.2.5) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/publint/0.2.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/publint/0.2.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/publint/0.2.4/0.2.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/publint/0.2.4/0.2.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>vercel/edge-runtime
(@&#8203;edge-runtime/jest-environment)</summary>

###
[`v2.3.5`](https://togithub.com/vercel/edge-runtime/blob/HEAD/packages/jest-environment/CHANGELOG.md#235)

[Compare
Source](https://togithub.com/vercel/edge-runtime/compare/@edge-runtime/jest-environment@2.3.4...@edge-runtime/jest-environment@2.3.5)

##### Patch Changes

-   Updated dependencies \[]:
-
[@&#8203;edge-runtime/vm](https://togithub.com/edge-runtime/vm)[@&#8203;3](https://togithub.com/3).1.5

</details>

<details>
<summary>vercel/edge-runtime (@&#8203;edge-runtime/types)</summary>

###
[`v2.2.5`](https://togithub.com/vercel/edge-runtime/blob/HEAD/packages/types/CHANGELOG.md#225)

[Compare
Source](https://togithub.com/vercel/edge-runtime/compare/@edge-runtime/types@2.2.4...@edge-runtime/types@2.2.5)

##### Patch Changes

- Updated dependencies
\[[`6372f52`](https://togithub.com/vercel/edge-runtime/commit/6372f52911f40a39d7801c55a8af5066e4eee9c8)]:
-
[@&#8203;edge-runtime/primitives](https://togithub.com/edge-runtime/primitives)[@&#8203;4](https://togithub.com/4).0.3

</details>

<details>
<summary>eslint/eslint (eslint)</summary>

### [`v8.52.0`](https://togithub.com/eslint/eslint/releases/tag/v8.52.0)

[Compare
Source](https://togithub.com/eslint/eslint/compare/v8.51.0...v8.52.0)

#### Features

-
[`70648ee`](https://togithub.com/eslint/eslint/commit/70648ee49c07f7b533d09f6bf8a5291e5a5a8601)
feat: report-unused-disable-directive to report unused eslint-enable
([#&#8203;17611](https://togithub.com/eslint/eslint/issues/17611))
(Yosuke Ota)

#### Bug Fixes

-
[`5de9637`](https://togithub.com/eslint/eslint/commit/5de9637fc925729a83d5a5e9e868a41792a184e3)
fix: Ensure shared references in rule configs are separated
([#&#8203;17666](https://togithub.com/eslint/eslint/issues/17666))
(Nicholas C. Zakas)
-
[`dcfe573`](https://togithub.com/eslint/eslint/commit/dcfe5739c374c9d7ed21f14027870ec0fd453661)
fix: add preceding semicolon in suggestions of `no-object-constructor`
([#&#8203;17649](https://togithub.com/eslint/eslint/issues/17649))
(Francesco Trotta)

#### Documentation

-
[`476d58a`](https://togithub.com/eslint/eslint/commit/476d58a584d5d2db003c4c22ffee90e63566164d)
docs: Add note about invalid CLI flags when using flat config.
([#&#8203;17664](https://togithub.com/eslint/eslint/issues/17664))
(Nicholas C. Zakas)
-
[`660ed3a`](https://togithub.com/eslint/eslint/commit/660ed3afd128ad529234a855345629982caf1bc7)
docs: Plugin flat config migration guide
([#&#8203;17640](https://togithub.com/eslint/eslint/issues/17640))
(Nicholas C. Zakas)
-
[`a58aa20`](https://togithub.com/eslint/eslint/commit/a58aa200fccedae7e2e9b6129246f2cedab14f8d)
docs: fix examples for several rules
([#&#8203;17645](https://togithub.com/eslint/eslint/issues/17645))
(Milos Djermanovic)
-
[`179929b`](https://togithub.com/eslint/eslint/commit/179929bd46892f18f2aef0c159d5cc361cb69987)
docs: Remove trailing newline from the code of Playground links
([#&#8203;17641](https://togithub.com/eslint/eslint/issues/17641))
(Francesco Trotta)
-
[`f8e5c30`](https://togithub.com/eslint/eslint/commit/f8e5c30636450d4a8baf51f0e227685e6d77ac64)
docs: Update README (GitHub Actions Bot)
-
[`b7ef2f3`](https://togithub.com/eslint/eslint/commit/b7ef2f34fe12b68a366e1b4bf5f64d7332c6e72e)
docs: Enable pretty code formatter output
([#&#8203;17635](https://togithub.com/eslint/eslint/issues/17635))
(Nicholas C. Zakas)
-
[`0bcb9a8`](https://togithub.com/eslint/eslint/commit/0bcb9a8db608a3d0bd2645f99e0707b9a9bbaaf0)
docs: Fix syntax errors in rule examples
([#&#8203;17633](https://togithub.com/eslint/eslint/issues/17633))
(Francesco Trotta)
-
[`61b9083`](https://togithub.com/eslint/eslint/commit/61b90839633ef300ac7707a651f65f532e65f42d)
docs: Make no-continue example code work
([#&#8203;17643](https://togithub.com/eslint/eslint/issues/17643))
(Zhongyuan Zhou)
-
[`9fafe45`](https://togithub.com/eslint/eslint/commit/9fafe450c31ed9b6bdd9dcd6c115255943b8c1c2)
docs: upgrade to 11ty 2.0
([#&#8203;17632](https://togithub.com/eslint/eslint/issues/17632))
(Percy Ma)
-
[`ff8e4bf`](https://togithub.com/eslint/eslint/commit/ff8e4bf327b5c92b0623b0fc5f8f101954f785db)
docs: Update README (GitHub Actions Bot)
-
[`fab249a`](https://togithub.com/eslint/eslint/commit/fab249ae6addac2ee18cd81cee80916010bb469e)
docs: Update README (GitHub Actions Bot)
-
[`392305b`](https://togithub.com/eslint/eslint/commit/392305bf4797e3ebc696dfca48bd874741fca845)
docs: Update `no-irregular-whitespace` and fix examples
([#&#8203;17626](https://togithub.com/eslint/eslint/issues/17626))
(Francesco Trotta)
-
[`6b8acfb`](https://togithub.com/eslint/eslint/commit/6b8acfb770589f3941df41c3910d3b8ffc3e1e45)
docs: Add real whitespace to `no-trailing-spaces` examples
([#&#8203;17630](https://togithub.com/eslint/eslint/issues/17630))
(Francesco Trotta)
-
[`1000187`](https://togithub.com/eslint/eslint/commit/1000187e00949332babcee4d37d46c96a6a554a8)
docs: Fix examples in `unicode-bom`
([#&#8203;17631](https://togithub.com/eslint/eslint/issues/17631))
(Francesco Trotta)
-
[`000290c`](https://togithub.com/eslint/eslint/commit/000290c4c923cc1473e21b4bdbdc0c42765ef7dd)
docs: Update README (GitHub Actions Bot)

#### Chores

-
[`6d1f0c2`](https://togithub.com/eslint/eslint/commit/6d1f0c2da0309c06c21149b8d71a8f439a70d7e8)
chore: upgrade
[@&#8203;eslint/js](https://togithub.com/eslint/js)[@&#8203;8](https://togithub.com/8).52.0
([#&#8203;17671](https://togithub.com/eslint/eslint/issues/17671))
(Milos Djermanovic)
-
[`d63d4fe`](https://togithub.com/eslint/eslint/commit/d63d4fe0942e6747ab60e758aa36076f43041a30)
chore: package.json update for
[@&#8203;eslint/js](https://togithub.com/eslint/js) release (ESLint
Jenkins)
-
[`f30cefe`](https://togithub.com/eslint/eslint/commit/f30cefee6bda2789ede18e1664b84c2638ea1bb5)
test: fix FlatESLint tests for caching
([#&#8203;17658](https://togithub.com/eslint/eslint/issues/17658))
(Milos Djermanovic)
-
[`ef650cb`](https://togithub.com/eslint/eslint/commit/ef650cb612510bcfa1379c1f0af56dd563b3a705)
test: update tests for no-promise-executor-return
([#&#8203;17661](https://togithub.com/eslint/eslint/issues/17661))
(Milos Djermanovic)

</details>

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

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

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

##### Bug fixes

- Fix missing published files check when resolving a path with fallback
extensions
([https://github.com/bluwy/publint/issues/79](https://togithub.com/bluwy/publint/issues/79))

**Full Changelog**:
bluwy/publint@v0.2.4...v0.2.5

</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:eyJjcmVhdGVkSW5WZXIiOiIzNy4xOS4yIiwidXBkYXRlZEluVmVyIjoiMzcuMTkuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
tnez referenced this issue in tnez/actions Dec 30, 2023
[![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.1.16`
-> `0.2.7`](https://renovatebot.com/diffs/npm/publint/0.1.16/0.2.7) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/publint/0.2.7?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/publint/0.2.7?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/publint/0.1.16/0.2.7?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/publint/0.1.16/0.2.7?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

##### Features

- If the library exports from both `"main"`/`"module"` and `"exports"`
fields, but the `"exports"` field doesn't export the root entrypoint,
warn about the inconsistency. When `"exports"` is defined, it takes the
highest priority, so all the library's entrypoint (root and deep) needs
to be specified here.
([https://github.com/bluwy/publint/issues/88](https://togithub.com/bluwy/publint/issues/88))
- Suggest using the `"type"` field. In [Node.js
v20.10.0](https://nodejs.org/en/blog/release/v20.10.0), it introduces a
new `--experimental-default-type` flag to flip the default module system
from "CJS-as-default" to "ESM-as-default". It's recommended for
libraries to specify the `"type"` field explicitly to prevent CJS files
from being incorrectly interpreted as ESM. This suggestion helps push
towards a better ESM experience in the future.
([https://github.com/bluwy/publint/issues/83](https://togithub.com/bluwy/publint/issues/83))

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

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

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

##### Features

- Warn if the deprecated `jsnext:main` or `jsnext` fields are used by
[@&#8203;sapphi-red](https://togithub.com/sapphi-red)
([https://github.com/bluwy/publint/pull/85](https://togithub.com/bluwy/publint/pull/85))

##### Site

- Fix command on site by [@&#8203;wooorm](https://togithub.com/wooorm)
([https://github.com/bluwy/publint/pull/82](https://togithub.com/bluwy/publint/pull/82))

##### New Contributors

- [@&#8203;wooorm](https://togithub.com/wooorm) made their first
contribution in
[https://github.com/bluwy/publint/pull/82](https://togithub.com/bluwy/publint/pull/82)

**Full Changelog**:
bluwy/publint@v0.2.5...v0.2.6

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

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

##### Bug fixes

- Fix missing published files check when resolving a path with fallback
extensions
([https://github.com/bluwy/publint/issues/79](https://togithub.com/bluwy/publint/issues/79))

**Full Changelog**:
bluwy/publint@v0.2.4...v0.2.5

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

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

##### Bug fixes

- Check for packed files locally before providing the `"files"`
suggestion. An incorrect suggestion was given when you're using
`.npmignore` or `.gitignore` to limit publishing certain files.

##### Site

-   Fix rules page mobile responsiveness

**Full Changelog**:
bluwy/publint@v0.2.3...v0.2.4

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

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

##### Features

- Error if `package.json` has fields with invalid string, boolean,
object, etc type
([https://github.com/bluwy/publint/issues/73](https://togithub.com/bluwy/publint/issues/73))

- Suggest using the `"files"` field if detected test or config files are
published
([https://github.com/bluwy/publint/issues/77](https://togithub.com/bluwy/publint/issues/77))

- Warn on `"exports"` and `"browser"` object conflict for browser-ish
environments
([https://github.com/bluwy/publint/issues/58](https://togithub.com/bluwy/publint/issues/58))

    For example, given this setup:

    ```json
    {
      "browser": {
        "./lib.server.js": "./lib.browser.js"
      },
      "exports": {
        ".": {
          "worker": "./lib.server.js",
          "browser": "./lib.browser.js",
          "default": "./lib.server.js"
        }
      }
    }
    ```

When matching the `"worker"` condition, it will resolve to
`"./lib.server.js"` which is intended to work in a worker environment.
However, the `"browser"` field also has a matching mapping for
`"./lib.server.js"`, causing the final resolved path to be
`"./lib.browser.js"`. This is usually not intended and causes the wrong
file to be loaded.

- Error on invalid JSX extensions, such as `.cjsx`, `.mjsx`, `.ctsx`,
and `.mtsx`
([https://github.com/bluwy/publint/issues/76](https://togithub.com/bluwy/publint/issues/76))

These extensions are usually mistaken as ESM and CJS variants of JSX,
which is not valid. Instead they should be written in ESM with the
`.jsx` extension instead.

##### Bug fixes

-   Skip file format checks only for globbed files
- Fix `"main"` field with ESM content detection
([https://github.com/bluwy/publint/issues/75](https://togithub.com/bluwy/publint/issues/75))

##### Site

- Add sidebar menu to rules page by
[@&#8203;btea](https://togithub.com/btea)
([https://github.com/bluwy/publint/pull/65](https://togithub.com/bluwy/publint/pull/65))
- Quickly scroll to the prompt information location by
[@&#8203;btea](https://togithub.com/btea)
([https://github.com/bluwy/publint/pull/68](https://togithub.com/bluwy/publint/pull/68))
- Fix version switch title not updated by
[@&#8203;btea](https://togithub.com/btea)
([https://github.com/bluwy/publint/pull/72](https://togithub.com/bluwy/publint/pull/72))
-   Improve documentation for `"types"` format
-   Fix message border styles
-   Fix docs list missing dot

**Full Changelog**:
bluwy/publint@v0.2.2...v0.2.3

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

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

##### Features

- Lint `"typings"` field file existence
([https://github.com/bluwy/publint/pull/60](https://togithub.com/bluwy/publint/pull/60))
- Check packed files when globbing exports locally
([https://github.com/bluwy/publint/issues/61](https://togithub.com/bluwy/publint/issues/61))
- Improve `"browser"` field suggestion for using `"imports"` and
`"exports"` fields instead
([https://github.com/bluwy/publint/pull/59](https://togithub.com/bluwy/publint/pull/59))

##### Bug fixes

- Lower deprecated trailing slash glob syntax as `suggestion` instead of
a `warning` when it's used for backwards compatibility only
([https://github.com/bluwy/publint/issues/62](https://togithub.com/bluwy/publint/issues/62))
-   Suppress invalid globbed file format if has correct adjacent file
-   Fix extension replacement in messages
-   Improve invalid types format message and docs

##### Site

-   Fix invalid package name not found message
-   Highlight code blocks in rules page

##### New Contributors

- [@&#8203;btea](https://togithub.com/btea) made their first
contribution in
[https://github.com/bluwy/publint/pull/64](https://togithub.com/bluwy/publint/pull/64)

**Full Changelog**:
bluwy/publint@v0.2.1...v0.2.2

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

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

##### Bug fixes

-   Fix `"types"` condition check with `"exports"` array format
-   Disable packed files search when a `vfs` is passed
-   Fix `"browser"` field file existence extensions check
-   Fix file existence check with trailing slash

##### Site

-   Site-wide design touch-up
-   New "Popular packages" section
- New package version select switcher
([https://github.com/bluwy/publint/issues/56](https://togithub.com/bluwy/publint/issues/56))
-   New navigation header design
-   Update bottom documentation for clarity
-   Improve repo URL parsing

##### New Contributors

- [@&#8203;lachlancollins](https://togithub.com/lachlancollins) made
their first contribution in
[https://github.com/bluwy/publint/pull/53](https://togithub.com/bluwy/publint/pull/53)

**Full Changelog**:
bluwy/publint@v0.2.0...v0.2.1

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

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

##### Breaking changes

**Note:** If you're using `publint` from the CLI, these breaking changes
should not affect you.

- `publint()` now returns an object with `messages` instead of the
`messages` array directly. This makes way for future APIs where
`publint` will return more information than just `messages`.

    ```diff
    - const messages = await publint()
    + const { messages } = await publint()
    ```

- Rename `printMessage` API to `formatMessage` to better reflect it's
intent.
([https://github.com/bluwy/publint/issues/43](https://togithub.com/bluwy/publint/issues/43))

    ```diff
    - import { printMessage } from "publint/utils"
    + import { formatMessage } from "publint/utils"

    const { messages } = await publint()

    for (const message of messages) {
    - console.log(printMessage(message))
    + console.log(formatMessage(message))
    }
    ```

-   Remove `filePath` `arg` for the `FILE_DOES_NOT_EXIST` message.

    ```diff
    import type { Message } from "publint"
    import { getPkgPathValue } from "publint/utils"

function messageToString(message: Message, pkg: Record<string, any>) {
      switch (message.code) {
        case "FILE_DOES_NOT_EXIST":
    -     return `The file "${message.args.filePath}" does not exist.`
+ return `The file "${getPkgPathValue(pkg, message.path)}" does not
exist.`
      }
    }
    ```

- Remove the `import` condition for the `publint` package. This provides
a better error message if you call `require("publint")`.

##### Features

- Improve warnings when the exported `"types"` condition has an invalid
format in ESM or CJS. This ensures your library's types will work in
both environments when dual publishing.
([https://github.com/bluwy/publint/issues/46](https://togithub.com/bluwy/publint/issues/46))

    It affects packages commonly packaged like:

    ```json
    {
      "exports": {
        ".": {
          "types": "./index.d.ts", <-- only works in CJS
          "import": "./index.mjs",
          "require": "./index.js",
        }
      }
    }
    ```

For more information, visit the [rules
documentation](https://publint.dev/rules#export_types_invalid_format).
This feature is inspired by https://arethetypeswrong.github.io.

##### Bug fixes

- Suppress warnings when exported JS files using the `"exports"` field
have adjacent `.d.ts` files and no `"types"` condition. This follows
TypeScript's resolution algorithm. For more information, visit the
[rules documentation](https://publint.dev/rules#types_not_exported).
([https://github.com/bluwy/publint/issues/46](https://togithub.com/bluwy/publint/issues/46))

**Full Changelog**:
bluwy/publint@v0.1.16...v0.2.0

</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/tnez/actions).

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

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