forked from appium/appium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reinstall node modules before shrinkwrapping * Add script to check shrinkwrap will be packaged
- Loading branch information
Showing
3 changed files
with
25 additions
and
3 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,21 @@ | ||
const childProcess = require('child_process'); | ||
const _ = require('lodash'); | ||
|
||
const res = JSON.parse(childProcess.execSync('npm pack --dry-run --json --ignore-scripts', {encoding: 'utf8'}))[0]; | ||
|
||
// List of files we are testing to make sure they are included in package | ||
const testFiles = [ | ||
'npm-shrinkwrap.json', // Check that npm-shrinkwrap.json is being packed | ||
'LICENSE', // Check that license is included | ||
'build/lib/appium.js', // Sanity check that build files are being included by testing just one file | ||
]; | ||
|
||
// Get list of files in `testFiles` that aren't in the list of packaged fileNames | ||
const missingFiles = _.without(testFiles, ..._.map(res.files, 'path')); | ||
|
||
if (!_.isEmpty(missingFiles)) { | ||
throw new Error(`Files [${missingFiles.join(', ')}] are not included in package.json "files". ` + | ||
`Please make sure these files are included before publishing.`); | ||
} | ||
|
||
process.exit(0); |
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
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