File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -248,6 +248,25 @@ function packAllPackages() {
248248 const pkgInfo = require ( pkgPath ) ;
249249 if ( pkgInfo . private !== true ) {
250250 // will pack into the project root directory
251+ // due to an issue where npm does not run prepublishOnly for pack, we run it here
252+ // however this is also a timing bug, as typically it would be run *after* prepublish
253+ // and prepare and now it is run *before*
254+ // we do not use `prepublish` or `prepare` so this should be fine for now.
255+ // https://docs.npmjs.com/misc/scripts
256+ // https://github.com/npm/npm/issues/15363
257+ if ( pkgInfo . scripts ) {
258+ if ( pkgInfo . scripts . prepublishOnly ) {
259+ if ( pkgInfo . scripts . prepublish || pkgInfo . scripts . prepare ) {
260+ console . log (
261+ `⚠️ ` +
262+ chalk . grey (
263+ `${ pkgInfo . name } has both a 'prepublishOnly' and either 'prepare' or 'publish' scripts. Running prepublishOnly manually before instead of after publish and prepare. See https://github.com/npm/npm/issues/15363`
264+ )
265+ ) ;
266+ }
267+ execWithLog ( `cd ${ pkgDir } && npm run prepublishOnly` ) ;
268+ }
269+ }
251270 execWithLog ( `npm pack ${ pkgDir } ` ) ;
252271 }
253272 } ) ;
Original file line number Diff line number Diff line change 11# compiled output
22/dist /
3+ /dist /** /*
34/tmp /
45/types /
56** /* .d.ts
Original file line number Diff line number Diff line change 11# compiled output
22/dist /
3+ /dist /** /*
34/tmp /
45/types /
56** /* .d.ts
3334/package.json.ember-try
3435
3536# ember-data
36- /node-tests
37+ /node-tests
38+
39+ # whitelist yuidoc's data.json for api docs generation
40+ ! /dist /docs /data.json
Original file line number Diff line number Diff line change 11# compiled output
22/dist /
3+ /dist /** /*
34/tmp /
45/types /
56** /* .d.ts
3334/package.json.ember-try
3435
3536# ember-data
36- /node-tests
37+ /node-tests
38+
39+ # whitelist yuidoc's data.json for api docs generation
40+ ! /dist /docs /data.json
Original file line number Diff line number Diff line change 11# compiled output
22/dist /
3+ /dist /** /*
34/tmp /
45/types /
56** /* .d.ts
3334/package.json.ember-try
3435
3536# ember-data
36- /node-tests
37+ /node-tests
38+
39+ # whitelist yuidoc's data.json for api docs generation
40+ ! /dist /docs /data.json
Original file line number Diff line number Diff line change 11# compiled output
22/dist /
3+ /dist /** /*
34/tmp /
45/types /
56** /* .d.ts
3132/.node_modules.ember-try /
3233/bower.json.ember-try
3334/package.json.ember-try
35+
36+ # whitelist yuidoc's data.json for api docs generation
37+ ! /dist /docs /data.json
You can’t perform that action at this time.
0 commit comments