Skip to content

Commit

Permalink
build: add support for experimental releases (#2831)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Oct 28, 2020
1 parent 975c150 commit 4e722a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion resources/build-npm.js
Expand Up @@ -68,7 +68,10 @@ function buildPackageJSON() {

if (preReleaseTag != null) {
const [tag] = preReleaseTag.split('.');
assert(['alpha', 'beta', 'rc'].includes(tag), `"${tag}" tag is supported.`);
assert(
tag.startsWith('experimental-') || ['alpha', 'beta', 'rc'].includes(tag),
`"${tag}" tag is supported.`,
);

assert(!packageJSON.publishConfig, 'Can not override "publishConfig".');
packageJSON.publishConfig = { tag: tag || 'latest' };
Expand Down
4 changes: 3 additions & 1 deletion src/__tests__/version-test.js
Expand Up @@ -6,7 +6,9 @@ import { version, versionInfo } from '../version';
describe('Version', () => {
it('version', () => {
expect(version).to.be.a('string');
expect(version).to.match(/^\d+\.\d+\.\d(-(alpha|beta|rc)\.\d+)?$/);
expect(version).to.match(
/^\d+\.\d+\.\d(-(alpha|beta|rc|(experimental-[\w-]+))\.\d+)?$/,
);
});

it('versionInfo', () => {
Expand Down

0 comments on commit 4e722a8

Please sign in to comment.