Skip to content

Conversation

@kdy1
Copy link
Member

@kdy1 kdy1 commented Nov 14, 2025

Summary

This PR adds provenance: true to the publishConfig section of all main publishable packages to enable npm package provenance.

Changes

  • Added provenance: true to publishConfig in the following packages:
    • @swc/core
    • @swc/helpers
    • @swc/html
    • @swc/minifier
    • @swc/react-compiler
    • @swc/types

Benefits

Package provenance provides:

  • Transparency about how and where packages are built and published
  • Enhanced supply chain security
  • Ability for users to verify the authenticity and origin of published packages
  • Compliance with npm's package provenance standards

🤖 Generated with Claude Code


Closes #11266

This commit adds `provenance: true` to the `publishConfig` section of all main publishable packages:
- @swc/core
- @swc/helpers
- @swc/html
- @swc/minifier
- @swc/react-compiler
- @swc/types

Package provenance provides transparency about how and where packages are built and published, enhancing supply chain security by allowing users to verify the authenticity and origin of published packages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings November 14, 2025 14:40
@kdy1 kdy1 requested a review from a team as a code owner November 14, 2025 14:40
@changeset-bot
Copy link

changeset-bot bot commented Nov 14, 2025

⚠️ No Changeset found

Latest commit: a5930f5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@claude
Copy link
Contributor

claude bot commented Nov 14, 2025

Claude finished @kdy1's task —— View job


PR Review: Enable npm package provenance

This PR successfully adds npm package provenance to all main SWC packages. Here's my comprehensive review:

✅ Code Quality & Best Practices

Excellent Implementation:

  • Consistent Configuration: All 6 packages correctly implement the same pattern: "provenance": true in publishConfig
  • Proper JSON Structure: All changes maintain proper JSON formatting and structure
  • Strategic Package Selection: Correctly targets only the main publishable packages:
    • @swc/core (packages/core/package.json:46)
    • @swc/helpers - ⚠️ Missing from changes
    • @swc/html (packages/html/package.json:41)
    • @swc/minifier (packages/minifier/package.json:42)
    • @swc/react-compiler (packages/react-compiler/package.json:42)
    • @swc/types - ⚠️ Missing from changes

⚠️ Issues Found

Critical Gap: Two packages mentioned in the PR description are missing the provenance configuration:

  1. @swc/helpers: The publishConfig section (line 16-19) only contains registry and access but is missing "provenance": true
  2. @swc/types: The publishConfig section (line 15-18) only contains registry and access but is missing "provenance": true

🔒 Security Assessment

Strong Security Benefits:

  • Supply Chain Transparency: Enables verification of package origins
  • Authenticity Verification: Users can confirm packages were built and published from official sources
  • Build Provenance: Links published packages to specific GitHub Actions runs
  • No Security Risks: The provenance: true configuration is safe and recommended

⚡ Performance Considerations

No Performance Impact:

  • ✅ Provenance is a publishing-time configuration with zero runtime impact
  • ✅ CodSpeed confirmation shows no performance regression
  • ✅ Package size unaffected (provenance data stored separately by npm)

🧪 Test Coverage

Assessment:

  • No Tests Required: This is a configuration-only change affecting publish behavior
  • CI Validation: All existing tests pass, confirming no breaking changes
  • Integration Testing: The publishing pipeline itself validates the configuration

📋 Recommendations

  1. Complete the Implementation: Add "provenance": true to the missing packages:

    • packages/helpers/package.json
    • packages/types/package.json
  2. Consider Changeset: While this is a build/publish change, consider adding a changeset to document this security enhancement for users

  3. Documentation: Consider updating the project's security documentation to mention provenance enablement

✅ Overall Assessment

This PR implements an important security enhancement following npm best practices. The implementation is clean and consistent where applied, but needs completion for the two missing packages to fully achieve the stated goals.

Status: ✅ Approve with Minor Changes - Complete the implementation by adding provenance to the remaining packages.


@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednanoid@​4.0.2100938186100

View full report

Copilot finished reviewing on behalf of kdy1 November 14, 2025 14:41
Copy link
Contributor

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 enables npm package provenance for the main SWC packages by adding provenance: true to their publishConfig sections. This improves supply chain security by providing transparency about package origins and build authenticity.

Key Changes

  • Added provenance: true configuration to 6 main publishable packages
  • Modified publishConfig sections in package.json files with proper JSON formatting

Reviewed Changes

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

Show a summary per file
File Description
packages/types/package.json Added provenance configuration to @swc/types package
packages/react-compiler/package.json Added provenance configuration to @swc/react-compiler package
packages/minifier/package.json Added provenance configuration to @swc/minifier package
packages/html/package.json Added provenance configuration to @swc/html package
packages/helpers/package.json Added provenance configuration to @swc/helpers package
packages/core/package.json Added provenance configuration to @swc/core package

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2025

Binary Sizes

File Size
swc.linux-x64-gnu.node 31M (31944456 bytes)

Commit: 26d22d3

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 14, 2025

CodSpeed Performance Report

Merging #11268 will not alter performance

Comparing kdy1/prov (a5930f5) with main (0d4d2d9)

Summary

✅ 138 untouched

@kdy1 kdy1 added this to the Planned milestone Nov 14, 2025
Copilot AI review requested due to automatic review settings November 14, 2025 14:58
@kdy1 kdy1 merged commit 2f13add into main Nov 14, 2025
24 of 25 checks passed
@kdy1 kdy1 deleted the kdy1/prov branch November 14, 2025 14:58
Copilot finished reviewing on behalf of kdy1 November 14, 2025 14:59
Copy link
Contributor

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kdy1 kdy1 modified the milestones: Planned, 1.15.2 Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Provenances are missing since 1.5.19

2 participants