mopub 0.0.2 → 0.0.3
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/dist/publish.js +11 -2
- package/package.json +2 -2
package/dist/publish.js
CHANGED
|
@@ -21,6 +21,10 @@ export const PublishInput = z
|
|
|
21
21
|
.string()
|
|
22
22
|
.describe('npm OTP to pass through to `npm publish --otp`. Only needed for registries that still require OTP-based 2FA. Leave unset to use npm\'s default browser-based auth flow.')
|
|
23
23
|
.optional(),
|
|
24
|
+
tag: z
|
|
25
|
+
.string()
|
|
26
|
+
.describe('tag to publish to. Leave unset to use the last tag from the registry.')
|
|
27
|
+
.optional(),
|
|
24
28
|
bump: z
|
|
25
29
|
.enum(['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease', 'other', 'independent'])
|
|
26
30
|
.describe('semver "bump" strategy - if not provided you will be prompted for it. Do not use with --version.')
|
|
@@ -440,7 +444,7 @@ export const publish = async (input) => {
|
|
|
440
444
|
rendererOptions: { persistentOutput: true },
|
|
441
445
|
task: async (ctx, task) => {
|
|
442
446
|
const shouldActuallyPublish = input.publish;
|
|
443
|
-
const publishTasks = createPublishTasks(ctx, { otp: input.otp });
|
|
447
|
+
const publishTasks = createPublishTasks(ctx, { otp: input.otp, tag: input.tag });
|
|
444
448
|
if (!shouldActuallyPublish)
|
|
445
449
|
publishTasks.forEach(t => (t.skip = true));
|
|
446
450
|
return task.newListr(publishTasks, { rendererOptions: { collapseSubtasks: false } });
|
|
@@ -479,6 +483,10 @@ export const PrebuiltInput = z.tuple([
|
|
|
479
483
|
.string()
|
|
480
484
|
.describe('npm OTP to pass through to `npm publish --otp`. Only needed for registries that still require OTP-based 2FA. Leave unset to use npm\'s default browser-based auth flow.')
|
|
481
485
|
.optional(),
|
|
486
|
+
tag: z
|
|
487
|
+
.string()
|
|
488
|
+
.describe('tag to publish to. Leave unset to use the last tag from the registry.')
|
|
489
|
+
.optional(),
|
|
482
490
|
}),
|
|
483
491
|
]);
|
|
484
492
|
export async function publishPrebuilt([folder, options]) {
|
|
@@ -504,7 +512,8 @@ function createPublishTasks(ctx, options) {
|
|
|
504
512
|
publishArgs.push('--otp', options.otp);
|
|
505
513
|
if (rhsPackageJson && semver.prerelease(rhsPackageJson.version)) {
|
|
506
514
|
const first = semver.prerelease(rhsPackageJson.version)?.[0];
|
|
507
|
-
|
|
515
|
+
let tag = options.tag;
|
|
516
|
+
tag ||= typeof first === 'string' ? first : 'next';
|
|
508
517
|
publishArgs.push('--tag', tag);
|
|
509
518
|
}
|
|
510
519
|
await pipeExeca(subtask, 'pnpm', ['publish', ...publishArgs], {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mopub",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Publish packages in a pnpm monorepo",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"typescript": "^6.0.3"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"
|
|
35
|
+
"clean": "rm -rf dist",
|
|
36
36
|
"build": "tsc --noEmit false --outDir dist",
|
|
37
37
|
"lint": "eslint .",
|
|
38
38
|
"test": "echo maybe later"
|