Skip to content

Add package.json export to pg-cloudflare#3506

Merged
brianc merged 3 commits into
brianc:masterfrom
remorses:patch-2
Jul 8, 2025
Merged

Add package.json export to pg-cloudflare#3506
brianc merged 3 commits into
brianc:masterfrom
remorses:patch-2

Conversation

@remorses

@remorses remorses commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

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

brianc commented Jul 7, 2025

Copy link
Copy Markdown
Owner

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

remorses commented Jul 7, 2025

Copy link
Copy Markdown
Contributor Author

Sorry about that, fixed

@brianc

brianc commented Jul 7, 2025

Copy link
Copy Markdown
Owner

hey! tests passed! thanks for the pr!

@brianc

brianc commented Jul 7, 2025

Copy link
Copy Markdown
Owner

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

@brianc

brianc commented Jul 7, 2025

Copy link
Copy Markdown
Owner

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

remorses commented Jul 8, 2025

Copy link
Copy Markdown
Contributor Author

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

brianc commented Jul 8, 2025

Copy link
Copy Markdown
Owner

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