Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish 15.x.x packages only under '15.x.x' tag #3411

Merged
merged 1 commit into from Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -67,5 +67,8 @@
"nyc": "15.1.0",
"prettier": "2.2.1",
"typescript": "4.1.3"
},
"publishConfig": {
"tag": "15.x.x"
}
}
8 changes: 5 additions & 3 deletions resources/build-npm.js
Expand Up @@ -58,6 +58,10 @@ function buildPackageJSON() {
packageJSON.engines = packageJSON.engines_on_npm;
delete packageJSON.engines_on_npm;

// TODO: move to integration tests
const publishTag = packageJSON.publishConfig?.tag;
assert(publishTag != null, 'Should have packageJSON.publishConfig defined!');

const { version } = packageJSON;
const versionMatch = /^\d+\.\d+\.\d+-?(?<preReleaseTag>.*)?$/.exec(version);
if (!versionMatch) {
Expand All @@ -72,9 +76,7 @@ function buildPackageJSON() {
tag.startsWith('experimental-') || ['alpha', 'beta', 'rc'].includes(tag),
`"${tag}" tag is supported.`,
);

assert(!packageJSON.publishConfig, 'Can not override "publishConfig".');
packageJSON.publishConfig = { tag: tag || 'latest' };
assert.equal(tag, publishTag, 'Publish tag and version tag should match!');
}

return packageJSON;
Expand Down