Skip to content

Commit

Permalink
[BUGFIX docs] ensure we publish docs (#6257)
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Jul 18, 2019
1 parent a80f2d0 commit 62ac658
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
19 changes: 19 additions & 0 deletions bin/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,25 @@ function packAllPackages() {
const pkgInfo = require(pkgPath);
if (pkgInfo.private !== true) {
// will pack into the project root directory
// due to an issue where npm does not run prepublishOnly for pack, we run it here
// however this is also a timing bug, as typically it would be run *after* prepublish
// and prepare and now it is run *before*
// we do not use `prepublish` or `prepare` so this should be fine for now.
// https://docs.npmjs.com/misc/scripts
// https://github.com/npm/npm/issues/15363
if (pkgInfo.scripts) {
if (pkgInfo.scripts.prepublishOnly) {
if (pkgInfo.scripts.prepublish || pkgInfo.scripts.prepare) {
console.log(
`⚠️ ` +
chalk.grey(
`${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`
)
);
}
execWithLog(`cd ${pkgDir} && npm run prepublishOnly`);
}
}
execWithLog(`npm pack ${pkgDir}`);
}
});
Expand Down
1 change: 1 addition & 0 deletions packages/-ember-data/.npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# compiled output
/dist/
/dist/**/*
/tmp/
/types/
**/*.d.ts
Expand Down
6 changes: 5 additions & 1 deletion packages/adapter/.npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# compiled output
/dist/
/dist/**/*
/tmp/
/types/
**/*.d.ts
Expand Down Expand Up @@ -33,4 +34,7 @@
/package.json.ember-try

# ember-data
/node-tests
/node-tests

# whitelist yuidoc's data.json for api docs generation
!/dist/docs/data.json
6 changes: 5 additions & 1 deletion packages/model/.npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# compiled output
/dist/
/dist/**/*
/tmp/
/types/
**/*.d.ts
Expand Down Expand Up @@ -33,4 +34,7 @@
/package.json.ember-try

# ember-data
/node-tests
/node-tests

# whitelist yuidoc's data.json for api docs generation
!/dist/docs/data.json
6 changes: 5 additions & 1 deletion packages/serializer/.npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# compiled output
/dist/
/dist/**/*
/tmp/
/types/
**/*.d.ts
Expand Down Expand Up @@ -33,4 +34,7 @@
/package.json.ember-try

# ember-data
/node-tests
/node-tests

# whitelist yuidoc's data.json for api docs generation
!/dist/docs/data.json
4 changes: 4 additions & 0 deletions packages/store/.npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# compiled output
/dist/
/dist/**/*
/tmp/
/types/
**/*.d.ts
Expand Down Expand Up @@ -31,3 +32,6 @@
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try

# whitelist yuidoc's data.json for api docs generation
!/dist/docs/data.json

0 comments on commit 62ac658

Please sign in to comment.