-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add diff-tarball script and more explicit files property in package.j…
…son (#9550) * More explicit files property in package.json To prevent potential upload error when publishing to npm Refer https://docs.npmjs.com/files/package.json\#files * Add a way to diff the new tarball content with previously published version This is intended to be used as part of our release process before publishing to NPM --dry-run is a useful step, but can be fairly noisy, yarn run v1.21.1 to go along the fake deploy and more clearly shows what would be added and deleted * Run the diff as part of prepublishOnly * Prompt to ensure user check before going further with publishing when running 'npm publish'
- Loading branch information
1 parent
7312e58
commit 1deb457
Showing
4 changed files
with
376 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const packlist = require('npm-packlist') | ||
const npmContent = require('list-npm-contents'); | ||
|
||
npmContent('mapbox-gl').then(function(last_version_files) { | ||
packlist({ path: '.' }).then(function(new_version_files) { | ||
new_version_files = new_version_files.map(file => file.replace(/\/\/+/g, '/')); | ||
let diff_new = new_version_files.filter(x => !last_version_files.includes(x)); | ||
let diff_last = last_version_files.filter(x => !new_version_files.includes(x)); | ||
console.log(`${diff_new.length} files are about to be added in the new tarball`) | ||
diff_new.forEach(file => { | ||
console.log('+', file); | ||
}); | ||
console.log(`${diff_last.length} files are about to be deleted in the new tarball`) | ||
diff_last.forEach(file => { | ||
console.log('-', file); | ||
}); | ||
}); | ||
}); |
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
Oops, something went wrong.