monorepo-next 12.0.5 → 12.1.1
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/README.md +2 -0
- package/bin/commands/release.js +5 -0
- package/package.json +1 -1
- package/src/release.js +7 -4
package/README.md
CHANGED
@@ -124,6 +124,8 @@ Options:
|
|
124
124
|
--push git push + tags when done
|
125
125
|
[boolean] [default: true]
|
126
126
|
--publish npm publish when done[boolean] [default: true]
|
127
|
+
--dist-tag publish to a different NPM dist-tag
|
128
|
+
[string] [default: "latest"]
|
127
129
|
--bump-in-range-dependencies If a dependency is still in range, and nothing
|
128
130
|
changed in my package, still bump my version
|
129
131
|
and the dependency version.
|
package/bin/commands/release.js
CHANGED
@@ -21,6 +21,11 @@ module.exports = {
|
|
21
21
|
type: 'boolean',
|
22
22
|
default: true,
|
23
23
|
},
|
24
|
+
'dist-tag': {
|
25
|
+
describe: 'publish to a different NPM dist-tag',
|
26
|
+
type: 'string',
|
27
|
+
default: 'latest',
|
28
|
+
},
|
24
29
|
'bump-in-range-dependencies': {
|
25
30
|
describe: 'If a dependency is still in range, and nothing changed in my package, still bump my version and the dependency version.',
|
26
31
|
type: 'boolean',
|
package/package.json
CHANGED
package/src/release.js
CHANGED
@@ -26,6 +26,7 @@ async function release({
|
|
26
26
|
dryRun = builder['dry-run'].default,
|
27
27
|
shouldPush = builder['push'].default,
|
28
28
|
shouldPublish = builder['publish'].default,
|
29
|
+
distTag = builder['dist-tag'].default,
|
29
30
|
shouldBumpInRangeDependencies = builder['bump-in-range-dependencies'].default,
|
30
31
|
shouldInheritGreaterReleaseType = builder['inherit-greater-release-type'].default,
|
31
32
|
shouldExcludeDevChanges = builder['exclude-dev-changes'].default,
|
@@ -47,6 +48,7 @@ async function release({
|
|
47
48
|
|
48
49
|
let currentBranch = await getCurrentBranch(cwd);
|
49
50
|
if (currentBranch !== defaultBranch) {
|
51
|
+
console.log(`branch mismatch. defaultBranch: ${defaultBranch}, currentBranch: ${currentBranch}`);
|
50
52
|
return;
|
51
53
|
}
|
52
54
|
|
@@ -228,7 +230,7 @@ async function release({
|
|
228
230
|
}
|
229
231
|
|
230
232
|
if (shouldPublish) {
|
231
|
-
await prePublishCallback({ dryRun });
|
233
|
+
await prePublishCallback({ distTag, dryRun });
|
232
234
|
}
|
233
235
|
|
234
236
|
// eslint-disable-next-line require-atomic-updates
|
@@ -236,13 +238,14 @@ async function release({
|
|
236
238
|
if (shouldPublish && _shouldPublish) {
|
237
239
|
// eslint-disable-next-line no-inner-declarations
|
238
240
|
async function originalPublish() {
|
239
|
-
await publish({ cwd, silent, dryRun });
|
241
|
+
await publish({ cwd, silent, distTag, dryRun });
|
240
242
|
}
|
241
243
|
|
242
244
|
if (publishOverride) {
|
243
245
|
await publishOverride({
|
244
246
|
cwd,
|
245
247
|
originalPublish,
|
248
|
+
distTag,
|
246
249
|
dryRun,
|
247
250
|
});
|
248
251
|
} else {
|
@@ -294,10 +297,10 @@ async function push({ cwd, silent, dryRun }) {
|
|
294
297
|
}
|
295
298
|
}
|
296
299
|
|
297
|
-
async function publish({ cwd, silent, dryRun }) {
|
300
|
+
async function publish({ cwd, silent, distTag, dryRun }) {
|
298
301
|
let dryRunArgs = dryRun ? ['--dry-run'] : [];
|
299
302
|
|
300
|
-
await execa('npm', ['publish', ...dryRunArgs], { cwd, silent });
|
303
|
+
await execa('npm', ['publish', '--tag', distTag, ...dryRunArgs], { cwd, silent });
|
301
304
|
}
|
302
305
|
|
303
306
|
module.exports = release;
|