-
Notifications
You must be signed in to change notification settings - Fork 4
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
Whitelist files to publish + new GitHub workflow to auto tag / release / publish #153
Conversation
a108679
to
f7e7289
Compare
publish-npm
npm publish
on new release + reduce size of published files
f7e7289
to
db549c8
Compare
npm publish
on new release + reduce size of published filesnpm publish
on new release + whitelist files to publish
Form your dry run :
I think we can keep the npmignore to remove the .gitkeep files |
I thought about that but when I made some tests when having a And because |
This file, and some others, are always and automatically included during the publish, no matter what settings we use. (I also wanted to ignore it at first...) https://docs.npmjs.com/cli/v6/configuring-npm/package-json#files |
b248cb0
to
5689f5a
Compare
"files": [ | ||
"/addon", | ||
"/app", | ||
"/config/environment.js", | ||
"/initializers", | ||
"/instance-initializers", | ||
"/services", | ||
"/types", | ||
"/index.js", | ||
"/tsconfig.json" | ||
], |
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.
As a reminder about what is going to happen, "what will be included in the publish?".
Initially, when this PR started and we did not have this entry package.json/files
, but only our .npmignore
, the files included in the publish were:
https://github.com/peopledoc/ember-cli-embedded/runs/3941184198?check_suite_focus=true#step:5:17
npm notice === Tarball Contents ===
npm notice 22B .github/CODEOWNERS
npm notice 79B app/initializers/embedded.js
npm notice 88B app/instance-initializers/embedded.js
npm notice 63B app/services/embedded.js
npm notice 87B config/environment.js
npm notice 615B index.js
npm notice 3.8kB package.json
npm notice 1.2kB tsconfig.json
npm notice 1.1kB LICENSE.md
npm notice 363B app/README.md
npm notice 5.5kB README.md
npm notice 240B initializers/embedded.d.ts
npm notice 246B instance-initializers/embedded.d.ts
npm notice 354B services/embedded.d.ts
npm notice 3.0kB addon/initializers/embedded.ts
npm notice 379B addon/instance-initializers/embedded.ts
npm notice 851B addon/services/embedded.ts
npm notice 199B types/global.d.ts
npm notice 126B types/dummy/index.d.ts
npm notice 2.1kB .github/workflows/ci.yml
npm notice 691B .github/dependabot.yml
npm notice 683B .github/workflows/publish-npm.yml
Some files of these files are always and automatically included during a publish, no matter what settings we apply (this is a rule from npm
itself, we can't do anything):
https://docs.npmjs.com/cli/v6/configuring-npm/package-json#files
package.json
README
CHANGES / CHANGELOG / HISTORY
LICENSE / LICENCE
NOTICE
The file in the "main" field
Now, if we apply this rule from npm
to our initial list of files + our whitelist from package.json/files
, we should end up with:
npm notice === Tarball Contents ===
npm notice 79B app/initializers/embedded.js
npm notice 88B app/instance-initializers/embedded.js
npm notice 63B app/services/embedded.js
npm notice 87B config/environment.js
npm notice 615B index.js
npm notice 3.8kB package.json
npm notice 1.2kB tsconfig.json
npm notice 1.1kB LICENSE.md
npm notice 363B app/README.md
npm notice 5.5kB README.md
npm notice 240B initializers/embedded.d.ts
npm notice 246B instance-initializers/embedded.d.ts
npm notice 354B services/embedded.d.ts
npm notice 3.0kB addon/initializers/embedded.ts
npm notice 379B addon/instance-initializers/embedded.ts
npm notice 851B addon/services/embedded.ts
npm notice 199B types/global.d.ts
npm notice 126B types/dummy/index.d.ts
631b6e7
to
5c39c9a
Compare
d4c9fdc
to
27cd419
Compare
npm publish
on new release + whitelist files to publish
See the results of the previous commit, before the current final state:
|
68dd4ed
to
0183775
Compare
1. Reduce the size of the final output. 2. Overall, a whitelist of files should be prefer over a blacklist to make things explicit about what exactly is going to be published. Useful readings: - https://docs.npmjs.com/cli/v6/configuring-npm/package-json#files - https://docs.npmjs.com/cli/v6/commands/npm-publish
619aaec
to
9548c97
Compare
9548c97
to
7dd0755
Compare
Build
Whitelist files to include on publish (#153)
To reduce the final bundle size.
CI
New GitHub workflow to automatically create a new tag, a new release and publish to NPM (#153)
Anytime something is merged to
master
, this new workflow will be triggered:If a new version is detected (based on the
version
entry of thepackage.json
), it is used to create a newgit tag
.A new GitHub release is created, based on this tag ⬆️
The add-on is published to NPM