Skip to content

Conversation

@remorses
Copy link
Contributor

@remorses remorses commented Jul 3, 2025

Similar to #3488

I currently use the require.resolve(${package}/package.json) to resolve the location of packages, not having package.json exported breaks this kind of tools

@brianc
Copy link
Owner

brianc commented Jul 7, 2025

thanks for the PR unfortunately its not passing lint check. looks like the change produced invalid json. Trailing commas are not allowed in JSON.

@remorses
Copy link
Contributor Author

remorses commented Jul 7, 2025

Sorry about that, fixed

@brianc
Copy link
Owner

brianc commented Jul 7, 2025

hey! tests passed! thanks for the pr!

@brianc
Copy link
Owner

brianc commented Jul 7, 2025

Do you want to add a test here that does the requiring? That way this code will be tested for future generations. 😄

@brianc
Copy link
Owner

brianc commented Jul 7, 2025

Gonna be completely honest here - I would write it myself but I still find the process of pushing to a contributor's PR on github to be just too onerous to re-figure out every time I have to do it. I can write a diff here you can include on your own code. Add this code to this file inside the describe block

it('should be able to import package.json`, () => {
  assert.ok(require.resolve('pg-cloudflare/package.json'))
})

@remorses
Copy link
Contributor Author

remorses commented Jul 8, 2025

if you find it easier you can close this PR and push directly to main. It would be great to add support./package.json to other packages too

@brianc brianc merged commit fab87b2 into brianc:master Jul 8, 2025
7 checks passed
@brianc
Copy link
Owner

brianc commented Jul 8, 2025

yeah good call i'll just do a follow-on PR

@brianc brianc mentioned this pull request Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants