Skip to content

fix: normalize repository field in package.json files to suppress npm publish warnings#40

Merged
ehuelsmann merged 4 commits intomasterfrom
copilot/fix-npm-publish-warnings
Apr 11, 2026
Merged

fix: normalize repository field in package.json files to suppress npm publish warnings#40
ehuelsmann merged 4 commits intomasterfrom
copilot/fix-npm-publish-warnings

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 11, 2026

  • Update packages/chai-openapi-response-validator/package.json repository field from string to object
  • Update packages/openapi-validator/package.json repository field from string to object
  • Update packages/jest-openapi/package.json repository field from string to object
  • Bump all package versions to 0.16.1
  • Update yarn.lock to reflect new versions
Original prompt

Create a pull request in ehuelsmann/OpenAPIValidators that fixes npm publish warnings in all package.json files across the packages.

The warning seen during publish for each package:

  • npm warn publish npm auto-corrected some errors in your package.json when publishing. Please run "npm pkg fix" to address these errors.
  • Corrections applied by npm:
    • "repository" was changed from a string to an object
    • "repository.url" was normalized to "git+https://github.com/ehuelsmann/OpenAPIValidators.git#master"

Task:

  1. Locate each package's package.json in the monorepo.
  2. Update package.json so npm will not need to auto-correct on publish:
    • Ensure repository is an object (not a string).
    • Ensure repository.url uses the normalized form git+https://github.com/ehuelsmann/OpenAPIValidators.git#master.
    • Preserve/ensure correct repository.type (likely git).
    • If applicable, add repository.directory for packages in subdirectories so the repo points to the correct package location.
  3. Run/replicate npm pkg fix behavior as needed (only for repository-related fields unless other issues are clearly present and safe to fix).
  4. Apply consistent changes across all packages.
  5. Ensure formatting and ordering remain reasonable and JSON-valid.

Notes:

  • Each package has its own package.json; apply changes to all affected.
  • Base branch not specified; default to the repository’s default branch.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: each of the packages caused this error:

npm warn publish npm auto-corrected some errors in your package.json when publishing. Please run "npm pkg fix" to address these errors.
npm warn publish errors corrected:
npm warn publish "repository" was changed from a string to an object
npm warn publish "repository.url" was normalized to "git+https://github.com/ehuelsmann/OpenAPIValidators.git#master"

(obviously, with their own package.json files).

Please create a PR to fix the package.json files for the packages.

Assistant: We’re waiting for you to approve the pending PR-creation action in the dialog; once you do, I can proceed to update all affected package.json files and open the pull request.

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Fix npm publish warnings in all package.json files fix: normalize repository field in package.json files to suppress npm publish warnings Apr 11, 2026
Copilot AI requested a review from ehuelsmann April 11, 2026 19:01
@ehuelsmann
Copy link
Copy Markdown
Owner

@copilot, please update the package versions to v0.16.1.

@ehuelsmann ehuelsmann marked this pull request as ready for review April 11, 2026 19:04
Agent-Logs-Url: https://github.com/ehuelsmann/OpenAPIValidators/sessions/24c796e3-3944-4791-852f-c938e65093a0

Co-authored-by: ehuelsmann <2326559+ehuelsmann@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Apr 11, 2026

@copilot, please update the package versions to v0.16.1.

Done in 31f25cb — all three packages bumped to 0.16.1, and the @ehuelsmann/openapi-validator dependency in chai-openapi-response-validator and jest-openapi updated to ^0.16.1 as well.

@ehuelsmann
Copy link
Copy Markdown
Owner

@copilot what about the lockfiles? shouldn't those be updated too?

Copy link
Copy Markdown
Author

Copilot AI commented Apr 11, 2026

@copilot what about the lockfiles? shouldn't those be updated too?

Updated in 9229b5cyarn.lock now reflects the ^0.16.1 dependency range for @ehuelsmann/openapi-validator.

@ehuelsmann ehuelsmann enabled auto-merge (squash) April 11, 2026 19:10
@ehuelsmann ehuelsmann merged commit 7f29286 into master Apr 11, 2026
5 checks passed
@ehuelsmann ehuelsmann deleted the copilot/fix-npm-publish-warnings branch April 11, 2026 19:11
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