Skip to content

Commit 6b6efe4

Browse files
publish 15.x.x packages only under '15.x.x' tag (#3411)
1 parent c55ac60 commit 6b6efe4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,8 @@
6767
"nyc": "15.1.0",
6868
"prettier": "2.2.1",
6969
"typescript": "4.1.3"
70+
},
71+
"publishConfig": {
72+
"tag": "15.x.x"
7073
}
7174
}

resources/build-npm.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ function buildPackageJSON() {
5858
packageJSON.engines = packageJSON.engines_on_npm;
5959
delete packageJSON.engines_on_npm;
6060

61+
// TODO: move to integration tests
62+
const publishTag = packageJSON.publishConfig?.tag;
63+
assert(publishTag != null, 'Should have packageJSON.publishConfig defined!');
64+
6165
const { version } = packageJSON;
6266
const versionMatch = /^\d+\.\d+\.\d+-?(?<preReleaseTag>.*)?$/.exec(version);
6367
if (!versionMatch) {
@@ -72,9 +76,7 @@ function buildPackageJSON() {
7276
tag.startsWith('experimental-') || ['alpha', 'beta', 'rc'].includes(tag),
7377
`"${tag}" tag is supported.`,
7478
);
75-
76-
assert(!packageJSON.publishConfig, 'Can not override "publishConfig".');
77-
packageJSON.publishConfig = { tag: tag || 'latest' };
79+
assert.equal(tag, publishTag, 'Publish tag and version tag should match!');
7880
}
7981

8082
return packageJSON;

0 commit comments

Comments
 (0)