-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chore: replace .npmignore to allow list of NPM artifacts #10473
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AllanZhengYP
changed the title
chore: add files to package.json to allow list artifacts published to NPM
chore: replace .npmignore to allow list of NPM artifacts
Oct 13, 2022
cshfang
approved these changes
Oct 20, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
jimblanc
approved these changes
Oct 20, 2022
AllanZhengYP
force-pushed
the
clean-npm-artifacts
branch
2 times, most recently
from
October 20, 2022 20:02
ecf315c
to
248d636
Compare
AllanZhengYP
force-pushed
the
clean-npm-artifacts
branch
from
October 20, 2022 21:28
248d636
to
c845936
Compare
Codecov Report
@@ Coverage Diff @@
## next-major-version/5 #10473 +/- ##
=====================================================
Coverage 83.81% 83.81%
=====================================================
Files 193 193
Lines 16899 16899
Branches 3585 3585
=====================================================
Hits 14164 14164
Misses 2657 2657
Partials 78 78 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
Currently all Amplify packages(except for
amazon-cognito-identity-js
) publish 4 artifacts to the NPM:src
folderlib-esm
folderlib
folderlib-esm
source code indist
folderThis change exclude the 4th one(
dist
folder) as they are used to deploy the source code to CDN. Customers should consume them from NPM package directly.This change also excludes files below beyond
.npmignore
:index.js
: deprecated CommonJS entry point file. Now the CommonJS entry point is./lib/index.js
(see original commit)build.js
: internal per-package build script. It can be excluded from publishing to NPM.index-rn.js
: possibly the deprecated react native entry point.After this change, the package size(install size) of each package is reduced by >50%:
aws-amplify
install size: 179MB to 91 MB(packagephobia); publish size: 37.7MB to 134kB;@aws-amplify/auth
install size: 22.6 MB to 13.7 MB; publish size: 2.41MB to 747kB(packagephbia)The installation time doesn't improve significantly:
npm install --force aws-amplify@latest 36.72s user 4.64s system 152% cpu 27.079 total
npm install --force aws-amplify@clean-npm-artifacts 35.74s user 4.32s system 151% cpu 26.522 total
Mostly because NPM or Yarn does pretty well downloading artifacts concurrently.
The current install size includes chunky
react-native
. It will be removed updating AWS SDK in next breaking change(commit)Description of how you validated changes
Unit test & Integ test
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.