Skip to content

Commit

Permalink
refactor(dev-infra): move semver utils into the utils directory (angu…
Browse files Browse the repository at this point in the history
…lar#42917)

Move semver into the utils directory rather than as a set of utils specifically
for release tooling.  While the utils are only currently used in the release
tooling, they are not providing a release specific utility and can be used by
any subtool of ng-dev.

PR Close angular#42917
  • Loading branch information
josephperrott authored and dylhunn committed Jul 22, 2021
1 parent d2b1c3e commit e462743
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dev-infra/ng-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -6196,12 +6196,12 @@ class FatalReleaseActionError extends Error {
* the version is cloned to not modify the original version instance.
*/
function semverInc(version, release, identifier) {
const clone = new semver.SemVer(version.version);
var clone = new semver.SemVer(version.version);
return clone.inc(release, identifier);
}
/** Creates the equivalent experimental version for a provided SemVer. */
function createExperimentalSemver(version) {
const experimentalVersion = new semver.SemVer(version.format());
var experimentalVersion = new semver.SemVer(version.format());
experimentalVersion.major = 0;
experimentalVersion.minor = version.major * 100 + version.minor;
return new semver.SemVer(experimentalVersion.format());
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/publish/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import * as semver from 'semver';
import {debug, error, green, info, promptConfirm, red, warn, yellow} from '../../utils/console';
import {AuthenticatedGitClient} from '../../utils/git/authenticated-git-client';
import {getListCommitsInBranchUrl, getRepositoryGitUrl} from '../../utils/git/github-urls';
import {createExperimentalSemver} from '../../utils/semver';
import {BuiltPackage, ReleaseConfig} from '../config/index';
import {ReleaseNotes} from '../notes/release-notes';
import {NpmDistTag} from '../versioning';
import {ActiveReleaseTrains} from '../versioning/active-release-trains';
import {createExperimentalSemver} from '../versioning/inc-semver';
import {runNpmPublish} from '../versioning/npm-publish';

import {FatalReleaseActionError, UserAbortedReleaseActionError} from './actions-error';
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/publish/actions/cut-lts-patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import {ListChoiceOptions, prompt} from 'inquirer';

import {semverInc} from '../../../utils/semver';
import {ActiveReleaseTrains} from '../../versioning/active-release-trains';
import {semverInc} from '../../versioning/inc-semver';
import {fetchLongTermSupportBranchesFromNpm, LtsBranch} from '../../versioning/long-term-support';
import {ReleaseAction} from '../actions';

Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/publish/actions/cut-new-patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {semverInc} from '../../../utils/semver';
import {ActiveReleaseTrains} from '../../versioning/active-release-trains';
import {semverInc} from '../../versioning/inc-semver';
import {ReleaseAction} from '../actions';

/**
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/publish/actions/cut-next-prerelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import * as semver from 'semver';

import {semverInc} from '../../versioning/inc-semver';
import {semverInc} from '../../../utils/semver';
import {computeNewPrereleaseVersionForNext} from '../../versioning/next-prerelease-version';
import {ReleaseTrain} from '../../versioning/release-trains';
import {ReleaseAction} from '../actions';
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/publish/actions/cut-release-candidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/

import {semverInc} from '../../../utils/semver';
import {ActiveReleaseTrains} from '../../versioning/active-release-trains';
import {semverInc} from '../../versioning/inc-semver';
import {ReleaseAction} from '../actions';

/**
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/versioning/next-prerelease-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import * as semver from 'semver';

import {semverInc} from '../../utils/semver';
import {ReleaseConfig} from '../config/index';

import {ActiveReleaseTrains} from './active-release-trains';
import {semverInc} from './inc-semver';
import {isVersionPublishedToNpm} from './npm-registry';

/** Computes the new pre-release version for the next release-train. */
Expand Down
File renamed without changes.

0 comments on commit e462743

Please sign in to comment.