Skip to content
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

build(esm): dynamically generate package.json for ESM build #1187

Merged

Conversation

Gitarcitano
Copy link
Contributor

Description

This pull request addresses a warning emitted by Webpack that occurs when building the project. The warning indicates the absence of a version specification in the package.json of the dist/esm directory. To rectify this, I have implemented a solution to automatically copy the version from the main package.json to the dist/esm/package.json upon each successful build. This resolves the warning and ensures the version information is consistently propagated to the built package.

Changes Made

  • Implemented an automatic version copying script from package.json to dist/esm/package.json after every build.
  • Modified the existing build script to incorporate the new version copying functionality.
  • Removed unnecessary static package.json

How to Test

  1. Run the build process using the provided build script.
  2. Verify that the version in package.json matches the version in dist/esm/package.json.
  3. Confirm that the webpack warning related to the missing version is no longer present.

Checklist

  • This PR makes changes to the public API
  • I have included links for closing relevant issue numbers

@Gitarcitano
Copy link
Contributor Author

Hey @pamapa , here is the PR applying the change you suggested here: authts/react-oidc-context#936 (comment)

@pamapa pamapa added this to the 2.3.0 milestone Sep 27, 2023
@pamapa
Copy link
Member

pamapa commented Sep 27, 2023

awesome, thanks for contributing

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (46483ce) 77.92% compared to head (5a5704a) 77.92%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1187   +/-   ##
=======================================
  Coverage   77.92%   77.92%           
=======================================
  Files          45       45           
  Lines        1726     1726           
  Branches      346      346           
=======================================
  Hits         1345     1345           
  Misses        342      342           
  Partials       39       39           
Flag Coverage Δ
unittests 77.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pamapa pamapa merged commit 6937ed3 into authts:main Sep 27, 2023
@Gitarcitano Gitarcitano deleted the build/dynamically-generate-package.json branch September 28, 2023 23:01
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