Skip to content

Commit

Permalink
build: add support for experimental releases (graphql#2831)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov authored and yaacovCR committed Apr 11, 2021
1 parent d79563d commit ccad83b
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 ccad83b

Please sign in to comment.