Skip to content

More tests & exports from pg-protocol #3436

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

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

brianc
Copy link
Owner

@brianc brianc commented Apr 23, 2025

Update more exports and visibility of files. Also, include the ./lib sub-directory in pg-native (it was mistakenly excluded) when the library is published to npm. This wasn't caught in my tests since they reference local copy of all source and it was a publishing specific issue.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the pg-protocol module exports and test coverage while ensuring that the pg-native ./lib sub-directory is included in the npm package.

  • Update the ESM wrapper for pg-protocol to use a namespace import
  • Add new tests for both pg-protocol and CommonJS imports
  • Extend the list of paths in the CommonJS import test to verify inclusion of additional files

Reviewed Changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.

File Description
packages/pg-protocol/esm/index.js Changed default import to a namespace import to re-export properties
packages/pg-esm-test/pg-protocol.test.js Introduced tests verifying proper export of protocol components
packages/pg-esm-test/common-js-imports.test.cjs Expanded test paths to include new modules from pg-protocol and pg-native
Files not reviewed (3)
  • packages/pg-esm-test/package.json: Language not supported
  • packages/pg-native/package.json: Language not supported
  • packages/pg-protocol/package.json: Language not supported
Comments suppressed due to low confidence (2)

packages/pg-protocol/esm/index.js:2

  • Changing from a default import to a namespace import may impact consumers expecting a default export. Please verify that this update is intentional and compatible with downstream usage.
import * as protocol from '../dist/index.js'

packages/pg-esm-test/common-js-imports.test.cjs:10

  • Ensure that 'pg-native/lib/build-result.js' is correctly included in the published npm package to prevent runtime import errors.
  'pg-native/lib/build-result.js',

@brianc brianc merged commit 6ab0c46 into master Apr 23, 2025
13 checks passed
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.

1 participant