@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 +1 -1
- package/src/release.js +16 -8
- package/src/types.d.ts +1 -0
package/package.json
CHANGED
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 (!
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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, }) {
|