Skip to content

More tests & exports from pg-protocol#3436

Merged
brianc merged 1 commit intomasterfrom
bmc/test-exports-for-pg-protocol
Apr 23, 2025
Merged

More tests & exports from pg-protocol#3436
brianc merged 1 commit intomasterfrom
bmc/test-exports-for-pg-protocol

Conversation

@brianc
Copy link
Copy Markdown
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
Copy Markdown

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.

2 participants