@qlover/fe-release 1.0.8 → 1.0.10
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/cli.cjs +1 -60
- package/dist/cli.js +1 -58
- package/dist/index.cjs +1 -5381
- package/dist/index.d.ts +102 -103
- package/dist/index.js +1 -5371
- package/package.json +11 -11
package/dist/cli.cjs
CHANGED
|
@@ -1,61 +1,2 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var releaseIt = require('release-it');
|
|
5
|
-
var commander = require('commander');
|
|
6
|
-
var semver = require('semver');
|
|
7
|
-
var index = require('./index.cjs');
|
|
8
|
-
require('@qlover/scripts-context');
|
|
9
|
-
require('@qlover/env-loader');
|
|
10
|
-
require('@qlover/fe-corekit');
|
|
11
|
-
require('node:path');
|
|
12
|
-
require('node:fs');
|
|
13
|
-
require('node:module');
|
|
14
|
-
require('node:url');
|
|
15
|
-
require('p-limit');
|
|
16
|
-
|
|
17
|
-
var description = "A tool for releasing front-end projects, supporting multiple release modes and configurations, simplifying the release process and improving efficiency.";
|
|
18
|
-
var version = "1.0.7";
|
|
19
|
-
|
|
20
|
-
const ALLOWED_INCREMENTS = ['patch', 'minor', 'major'];
|
|
21
|
-
const DEFAULT_INCREMENT = 'patch';
|
|
22
|
-
const splitWithComma = (value) => value.split(',').filter((value) => value != null && value != '');
|
|
23
|
-
function programArgs() {
|
|
24
|
-
const program = new commander.Command();
|
|
25
|
-
program
|
|
26
|
-
.version(version, '-v, --version', 'Show version')
|
|
27
|
-
.description(description)
|
|
28
|
-
.option('-d, --dry-run', 'Do not touch or write anything, but show the commands')
|
|
29
|
-
.option('-V, --verbose', 'Show more information')
|
|
30
|
-
.option('-P, --release-PR', 'Create a release PR')
|
|
31
|
-
.option('-M, --merge-publish', 'Merge publish')
|
|
32
|
-
// to Workspaces use workspace
|
|
33
|
-
.option('-p, --publish-path <publishPath>', 'The path of the package to release, map to feConfig.release.publishPath')
|
|
34
|
-
.option('-b, --branch-name <branchName>', 'The branch name of the release, map to feConfig.release.branchName, default(release-${pkgName}-${tagName})')
|
|
35
|
-
.option('-s, --source-branch <sourceBranch>', 'The source branch of the release')
|
|
36
|
-
// plugins args
|
|
37
|
-
.option('--pull-request.increment <increment>', 'The increment of the release, map to feConfig.release.increment', (value) => {
|
|
38
|
-
if (!ALLOWED_INCREMENTS.includes(value) && !semver.valid(value)) {
|
|
39
|
-
throw new Error(`Invalid increment(-i) Must be one of [${ALLOWED_INCREMENTS.join(', ')}] or valid version string(semver)`);
|
|
40
|
-
}
|
|
41
|
-
return value;
|
|
42
|
-
}, DEFAULT_INCREMENT)
|
|
43
|
-
.option('--publish-npm.skip-npmrc', 'Whether to skip setting the npmrc file')
|
|
44
|
-
.option('--packages-directories <packagesDirectories>', 'The packages that have been changed, multiple values use `,` to split, map to feConfig.release.packagesDirectories', splitWithComma)
|
|
45
|
-
.option('--githubPR.dry-run-create-PR', 'Whether to dry run the creation of the pull request')
|
|
46
|
-
.option('-l, --workspaces.change-labels <changeLabels>', 'The change labels of the release, multiple values use `,` to split', splitWithComma);
|
|
47
|
-
program.parse();
|
|
48
|
-
return index.reduceOptions(program.opts(), 'shared');
|
|
49
|
-
}
|
|
50
|
-
async function main() {
|
|
51
|
-
const { shared: commonOptions, ...allOptions } = programArgs();
|
|
52
|
-
const { dryRun, verbose, ...shared } = commonOptions;
|
|
53
|
-
const options = Object.assign(allOptions, {
|
|
54
|
-
releaseIt: { releaseIt }
|
|
55
|
-
});
|
|
56
|
-
await new index.ReleaseTask({ dryRun, verbose, options, shared }).exec();
|
|
57
|
-
}
|
|
58
|
-
main().catch((e) => {
|
|
59
|
-
console.error(e.message);
|
|
60
|
-
process.exit(1);
|
|
61
|
-
});
|
|
2
|
+
"use strict";var e=require("commander"),r=require("semver"),o=require("./index.cjs");require("@qlover/scripts-context"),require("@qlover/env-loader"),require("@qlover/fe-corekit"),require("@octokit/rest"),require("node:path"),require("node:fs"),require("node:module"),require("node:url"),require("p-limit"),require("conventional-changelog"),require("path"),require("fs");const n=["patch","minor","major"],t=e=>e.split(",").filter((e=>null!=e&&""!=e));(async function(){const{shared:i,...a}=function(){const i=new e.Command;return i.version("1.0.10","-v, --version","Show version").description("A tool for releasing front-end projects, supporting multiple release modes and configurations, simplifying the release process and improving efficiency.").option("-d, --dry-run","Do not touch or write anything, but show the commands").option("-V, --verbose","Show more information").option("-p, --publish-path <publishPath>","The path of the package to release, map to feConfig.release.publishPath").option("-b, --branch-name <branchName>","The branch name of the release, map to feConfig.release.branchName, default(release-${pkgName}-${tagName})").option("-s, --source-branch <sourceBranch>","The source branch of the release").option("-i, --changelog.increment <increment>","The increment of the release",(e=>{if(!n.includes(e)&&!r.valid(e))throw new Error(`Invalid increment(-i) Must be one of [${n.join(", ")}] or valid version string(semver)`);return e}),"patch").option("--changelog.skip","Whether to skip the changelog").option("--packages-directories <packagesDirectories>","The packages that have been changed, multiple values use `,` to split, map to feConfig.release.packagesDirectories",t).option("--githubPR.dry-run-create-PR","Whether to dry run the creation of the pull request").option("-P, --githubPR.release-PR","Create a release PR").option("-l, --workspaces.change-labels <changeLabels>","The change labels of the release, multiple values use `,` to split",t).option("--githubPR.command-prefix <commandPrefix>","The command prefix of the release, call @changeset/cli command","pnpm dlx"),i.parse(),o.reduceOptions(i.opts(),"shared")}(),{dryRun:s,verbose:c,...l}=i,h=Object.assign(a,{});await new o.ReleaseTask({dryRun:s,verbose:c,options:h,shared:l}).exec()})().catch((e=>{console.error(e.message),process.exit(1)}));
|
package/dist/cli.js
CHANGED
|
@@ -1,59 +1,2 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import { Command } from 'commander';
|
|
4
|
-
import semver from 'semver';
|
|
5
|
-
import { ReleaseTask, reduceOptions } from './index.js';
|
|
6
|
-
import '@qlover/scripts-context';
|
|
7
|
-
import '@qlover/env-loader';
|
|
8
|
-
import '@qlover/fe-corekit';
|
|
9
|
-
import 'node:path';
|
|
10
|
-
import 'node:fs';
|
|
11
|
-
import 'node:module';
|
|
12
|
-
import 'node:url';
|
|
13
|
-
import 'p-limit';
|
|
14
|
-
|
|
15
|
-
var description = "A tool for releasing front-end projects, supporting multiple release modes and configurations, simplifying the release process and improving efficiency.";
|
|
16
|
-
var version = "1.0.7";
|
|
17
|
-
|
|
18
|
-
const ALLOWED_INCREMENTS = ['patch', 'minor', 'major'];
|
|
19
|
-
const DEFAULT_INCREMENT = 'patch';
|
|
20
|
-
const splitWithComma = (value) => value.split(',').filter((value) => value != null && value != '');
|
|
21
|
-
function programArgs() {
|
|
22
|
-
const program = new Command();
|
|
23
|
-
program
|
|
24
|
-
.version(version, '-v, --version', 'Show version')
|
|
25
|
-
.description(description)
|
|
26
|
-
.option('-d, --dry-run', 'Do not touch or write anything, but show the commands')
|
|
27
|
-
.option('-V, --verbose', 'Show more information')
|
|
28
|
-
.option('-P, --release-PR', 'Create a release PR')
|
|
29
|
-
.option('-M, --merge-publish', 'Merge publish')
|
|
30
|
-
// to Workspaces use workspace
|
|
31
|
-
.option('-p, --publish-path <publishPath>', 'The path of the package to release, map to feConfig.release.publishPath')
|
|
32
|
-
.option('-b, --branch-name <branchName>', 'The branch name of the release, map to feConfig.release.branchName, default(release-${pkgName}-${tagName})')
|
|
33
|
-
.option('-s, --source-branch <sourceBranch>', 'The source branch of the release')
|
|
34
|
-
// plugins args
|
|
35
|
-
.option('--pull-request.increment <increment>', 'The increment of the release, map to feConfig.release.increment', (value) => {
|
|
36
|
-
if (!ALLOWED_INCREMENTS.includes(value) && !semver.valid(value)) {
|
|
37
|
-
throw new Error(`Invalid increment(-i) Must be one of [${ALLOWED_INCREMENTS.join(', ')}] or valid version string(semver)`);
|
|
38
|
-
}
|
|
39
|
-
return value;
|
|
40
|
-
}, DEFAULT_INCREMENT)
|
|
41
|
-
.option('--publish-npm.skip-npmrc', 'Whether to skip setting the npmrc file')
|
|
42
|
-
.option('--packages-directories <packagesDirectories>', 'The packages that have been changed, multiple values use `,` to split, map to feConfig.release.packagesDirectories', splitWithComma)
|
|
43
|
-
.option('--githubPR.dry-run-create-PR', 'Whether to dry run the creation of the pull request')
|
|
44
|
-
.option('-l, --workspaces.change-labels <changeLabels>', 'The change labels of the release, multiple values use `,` to split', splitWithComma);
|
|
45
|
-
program.parse();
|
|
46
|
-
return reduceOptions(program.opts(), 'shared');
|
|
47
|
-
}
|
|
48
|
-
async function main() {
|
|
49
|
-
const { shared: commonOptions, ...allOptions } = programArgs();
|
|
50
|
-
const { dryRun, verbose, ...shared } = commonOptions;
|
|
51
|
-
const options = Object.assign(allOptions, {
|
|
52
|
-
releaseIt: { releaseIt }
|
|
53
|
-
});
|
|
54
|
-
await new ReleaseTask({ dryRun, verbose, options, shared }).exec();
|
|
55
|
-
}
|
|
56
|
-
main().catch((e) => {
|
|
57
|
-
console.error(e.message);
|
|
58
|
-
process.exit(1);
|
|
59
|
-
});
|
|
2
|
+
import{Command as e}from"commander";import o from"semver";import{ReleaseTask as r,reduceOptions as t}from"./index.js";import"@qlover/scripts-context";import"@qlover/env-loader";import"@qlover/fe-corekit";import"@octokit/rest";import"node:path";import"node:fs";import"node:module";import"node:url";import"p-limit";import"conventional-changelog";import"path";import"fs";const n=["patch","minor","major"],i=e=>e.split(",").filter((e=>null!=e&&""!=e));(async function(){const{shared:a,...s}=function(){const r=new e;return r.version("1.0.10","-v, --version","Show version").description("A tool for releasing front-end projects, supporting multiple release modes and configurations, simplifying the release process and improving efficiency.").option("-d, --dry-run","Do not touch or write anything, but show the commands").option("-V, --verbose","Show more information").option("-p, --publish-path <publishPath>","The path of the package to release, map to feConfig.release.publishPath").option("-b, --branch-name <branchName>","The branch name of the release, map to feConfig.release.branchName, default(release-${pkgName}-${tagName})").option("-s, --source-branch <sourceBranch>","The source branch of the release").option("-i, --changelog.increment <increment>","The increment of the release",(e=>{if(!n.includes(e)&&!o.valid(e))throw new Error(`Invalid increment(-i) Must be one of [${n.join(", ")}] or valid version string(semver)`);return e}),"patch").option("--changelog.skip","Whether to skip the changelog").option("--packages-directories <packagesDirectories>","The packages that have been changed, multiple values use `,` to split, map to feConfig.release.packagesDirectories",i).option("--githubPR.dry-run-create-PR","Whether to dry run the creation of the pull request").option("-P, --githubPR.release-PR","Create a release PR").option("-l, --workspaces.change-labels <changeLabels>","The change labels of the release, multiple values use `,` to split",i).option("--githubPR.command-prefix <commandPrefix>","The command prefix of the release, call @changeset/cli command","pnpm dlx"),r.parse(),t(r.opts(),"shared")}(),{dryRun:p,verbose:c,...h}=a,l=Object.assign(s,{});await new r({dryRun:p,verbose:c,options:l,shared:h}).exec()})().catch((e=>{console.error(e.message),process.exit(1)}));
|