Skip to content

Commit 2a98714

Browse files
authored
[BUGFIX docs] ensure we publish docs (warp-drive-data#6257)
1 parent 9cc2adc commit 2a98714

6 files changed

Lines changed: 39 additions & 3 deletions

File tree

bin/publish.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

packages/-ember-data/.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# compiled output
22
/dist/
3+
/dist/**/*
34
/tmp/
45
/types/
56
**/*.d.ts

packages/adapter/.npmignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# compiled output
22
/dist/
3+
/dist/**/*
34
/tmp/
45
/types/
56
**/*.d.ts
@@ -33,4 +34,7 @@
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

packages/model/.npmignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# compiled output
22
/dist/
3+
/dist/**/*
34
/tmp/
45
/types/
56
**/*.d.ts
@@ -33,4 +34,7 @@
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

packages/serializer/.npmignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# compiled output
22
/dist/
3+
/dist/**/*
34
/tmp/
45
/types/
56
**/*.d.ts
@@ -33,4 +34,7 @@
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

packages/store/.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# compiled output
22
/dist/
3+
/dist/**/*
34
/tmp/
45
/types/
56
**/*.d.ts
@@ -31,3 +32,6 @@
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

0 commit comments

Comments
 (0)