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

refactor: remove __PRODUCTION__ and invariant; add tests for development environment #180

Merged
merged 3 commits into from
May 9, 2023

Conversation

angeloashmore
Copy link
Member

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR refactors the codebase by:

  • Replcing __PRODUCTION__ with direct access to process.env.NODE_ENV
  • Adds tests for the development environment

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

@codecov-commenter
Copy link

Codecov Report

Merging #180 (2da0d38) into master (aac1cc7) will increase coverage by 0.19%.
The diff coverage is 88.23%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #180      +/-   ##
==========================================
+ Coverage   99.24%   99.44%   +0.19%     
==========================================
  Files          21       20       -1     
  Lines        2388     2332      -56     
  Branches      129      126       -3     
==========================================
- Hits         2370     2319      -51     
+ Misses         18       13       -5     
Impacted Files Coverage Δ
src/lib/processPolyfill.ts 25.00% <25.00%> (ø)
src/SliceZone.tsx 98.57% <95.00%> (+0.96%) ⬆️
src/PrismicImage.tsx 100.00% <100.00%> (ø)
src/index.ts 100.00% <100.00%> (ø)
src/react-server/PrismicLink.tsx 100.00% <100.00%> (ø)
src/usePrismicClient.ts 100.00% <100.00%> (ø)

@github-actions
Copy link

github-actions bot commented May 9, 2023

size-limit report 📦

Path Size
./dist/index.cjs 6.97 KB (-9.85% 🔽)
./dist/index.js 4.59 KB (-13.39% 🔽)
./dist/react-server.cjs 6.16 KB (-9.99% 🔽)
./dist/react-server.js 4.14 KB (-13.75% 🔽)

@angeloashmore angeloashmore merged commit 8f30e6c into master May 9, 2023
@angeloashmore angeloashmore deleted the aa/refactor-lib branch May 9, 2023 02:49
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