@hubspot/npm-scripts 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/npm-scripts",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Scripts for working with npm packages in the HubSpot ecosystem",
5
5
  "author": "",
6
6
  "license": "Apache-2.0",
package/src/release.js CHANGED
@@ -12,7 +12,7 @@ import { getDistTags, publish, updateNextTag, updatePreviousTag, } from './utils
12
12
  import { confirm, input } from './utils/prompting.js';
13
13
  const exec = promisify(_exec);
14
14
  function buildHandler({ build, postLatestRelease, packageName, localVersion, registry, repositoryUrl, mainBranch, previousBranch, ignoreScripts, }) {
15
- return async function handler({ versionIncrement, tag, dryRun, skipBranchValidation, }) {
15
+ return async function handler({ versionIncrement, tag, dryRun, skipBranchValidation, skipVersionCheck, }) {
16
16
  const branch = await getCurrentGitBranch();
17
17
  const isExperimental = tag === TAG.EXPERIMENTAL;
18
18
  const isPrevious = tag === TAG.PREVIOUS;
@@ -42,13 +42,15 @@ function buildHandler({ build, postLatestRelease, packageName, localVersion, reg
42
42
  process.exit(EXIT_CODES.ERROR);
43
43
  }
44
44
  const { latest: currentLatestTag, next: currentNextTag, experimental: currentExperimentalTag, previous: currentPreviousTag, } = await getDistTags(packageName);
45
- if (!isExperimental && !isPrevious && currentNextTag !== localVersion) {
46
- logger.error(`Local package.json version ${localVersion} is out of sync with published version ${currentNextTag}`);
47
- process.exit(EXIT_CODES.ERROR);
48
- }
49
- if (isPrevious && currentPreviousTag !== localVersion) {
50
- logger.error(`Local package.json version ${localVersion} is out of sync with published version ${currentPreviousTag}`);
51
- process.exit(EXIT_CODES.ERROR);
45
+ if (!skipVersionCheck) {
46
+ if (!isExperimental && !isPrevious && currentNextTag !== localVersion) {
47
+ logger.error(`Local package.json version ${localVersion} is out of sync with published version ${currentNextTag}`);
48
+ process.exit(EXIT_CODES.ERROR);
49
+ }
50
+ if (isPrevious && currentPreviousTag !== localVersion) {
51
+ logger.error(`Local package.json version ${localVersion} is out of sync with published version ${currentPreviousTag}`);
52
+ process.exit(EXIT_CODES.ERROR);
53
+ }
52
54
  }
53
55
  const currentVersion = isExperimental
54
56
  ? currentExperimentalTag
@@ -105,6 +107,7 @@ function buildHandler({ build, postLatestRelease, packageName, localVersion, reg
105
107
  await build();
106
108
  }
107
109
  else {
110
+ await exec('yarn');
108
111
  await exec(`yarn build`);
109
112
  }
110
113
  let otp = '';
@@ -213,6 +216,11 @@ async function builder(yargs) {
213
216
  default: false,
214
217
  type: 'boolean',
215
218
  },
219
+ skipVersionCheck: {
220
+ describe: 'Bypass checking that the local version matches the published version',
221
+ default: false,
222
+ type: 'boolean',
223
+ },
216
224
  });
217
225
  }
218
226
  export function buildReleaseScript({ packageJsonLocation, buildHandlerOptions, }) {
package/src/types.d.ts CHANGED
@@ -4,6 +4,7 @@ export type ReleaseArguments = {
4
4
  tag: (typeof TAG_OPTIONS)[number];
5
5
  dryRun: boolean;
6
6
  skipBranchValidation: boolean;
7
+ skipVersionCheck: boolean;
7
8
  };
8
9
  export type RepoSyncArguments = {
9
10
  version: string;