@adinsure-ops/ops-cli 4.8.3 → 5.0.0-rc4
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/CHANGELOGS.md +52 -36
- package/LICENSE +1 -1
- package/README.md +32 -242
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.cmd +1 -1
- package/bin/run.js +8 -0
- package/lib/command.base.d.ts +9 -5
- package/lib/command.base.jira.d.ts +7 -8
- package/lib/command.base.jira.js +26 -24
- package/lib/command.base.js +69 -57
- package/lib/commands/docker/update-image-version.d.ts +6 -9
- package/lib/commands/docker/update-image-version.js +35 -34
- package/lib/commands/doctor.d.ts +15 -5
- package/lib/commands/doctor.js +219 -186
- package/lib/commands/download/client.d.ts +10 -7
- package/lib/commands/download/client.js +60 -52
- package/lib/commands/download/identity-server.d.ts +9 -7
- package/lib/commands/download/identity-server.js +59 -53
- package/lib/commands/download/jmeter.d.ts +5 -5
- package/lib/commands/download/jmeter.js +54 -49
- package/lib/commands/download/keycloak-scim.d.ts +6 -6
- package/lib/commands/download/keycloak-scim.js +56 -51
- package/lib/commands/download/platform.d.ts +9 -7
- package/lib/commands/download/platform.js +59 -53
- package/lib/commands/download/scheduler.d.ts +9 -7
- package/lib/commands/download/scheduler.js +59 -53
- package/lib/commands/download/server.d.ts +9 -7
- package/lib/commands/download/server.js +59 -53
- package/lib/commands/download/signalr.d.ts +9 -7
- package/lib/commands/download/signalr.js +59 -53
- package/lib/commands/download/studio.d.ts +12 -9
- package/lib/commands/download/studio.js +107 -82
- package/lib/commands/gitlab/get-tag-pipeline.d.ts +11 -14
- package/lib/commands/gitlab/get-tag-pipeline.js +95 -92
- package/lib/commands/gitlab/next-nightly-tag.d.ts +10 -12
- package/lib/commands/gitlab/next-nightly-tag.js +96 -98
- package/lib/commands/jira/issue.d.ts +6 -8
- package/lib/commands/jira/issue.js +25 -23
- package/lib/commands/jira/labels.d.ts +9 -12
- package/lib/commands/jira/labels.js +52 -51
- package/lib/commands/log/add.d.ts +6 -8
- package/lib/commands/log/add.js +92 -87
- package/lib/commands/log/generate.d.ts +9 -10
- package/lib/commands/log/generate.js +112 -107
- package/lib/commands/log/validate.d.ts +2 -2
- package/lib/commands/log/validate.js +47 -43
- package/lib/commands/login.d.ts +9 -10
- package/lib/commands/login.js +101 -97
- package/lib/commands/npm/check-publish.d.ts +7 -8
- package/lib/commands/npm/check-publish.js +59 -54
- package/lib/commands/npm/dependency-update.d.ts +14 -12
- package/lib/commands/npm/dependency-update.js +94 -86
- package/lib/commands/npm/publish.d.ts +8 -9
- package/lib/commands/npm/publish.js +154 -140
- package/lib/commands/nuget/dependency-update.d.ts +15 -10
- package/lib/commands/nuget/dependency-update.js +60 -49
- package/lib/commands/sql.d.ts +24 -20
- package/lib/commands/sql.js +245 -226
- package/lib/commands/translate.d.ts +15 -16
- package/lib/commands/translate.js +109 -104
- package/lib/commands/version.d.ts +29 -19
- package/lib/commands/version.js +215 -190
- package/lib/config.js +3 -6
- package/lib/hooks/init/version-override.d.ts +2 -2
- package/lib/hooks/init/version-override.js +15 -13
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -4
- package/lib/lib/command.d.ts +2 -0
- package/lib/lib/command.js +65 -58
- package/lib/lib/gitlab.d.ts +8 -2
- package/lib/lib/gitlab.js +94 -82
- package/lib/lib/npm.d.ts +7 -3
- package/lib/lib/npm.js +72 -60
- package/lib/lib/npmrc.d.ts +5 -0
- package/lib/lib/npmrc.js +20 -13
- package/lib/lib/nuget.d.ts +2 -0
- package/lib/lib/nuget.js +20 -17
- package/lib/security/cache.js +31 -27
- package/lib/security/context.d.ts +2 -1
- package/lib/security/context.js +106 -103
- package/lib/types/changelog.types.js +1 -2
- package/lib/types/npm.types.d.ts +5 -5
- package/lib/types/npm.types.js +1 -2
- package/oclif.manifest.json +1223 -1
- package/package.json +50 -46
- package/bin/run +0 -5
- package/lib/commands/prepare-content.d.ts +0 -29
- package/lib/commands/prepare-content.js +0 -386
package/lib/commands/version.js
CHANGED
|
@@ -1,145 +1,164 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const command_base_1 = require("../command.base");
|
|
14
|
-
class Version extends command_base_1.default {
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { Flags, Args, ux } from '@oclif/core';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
import fs from 'fs-extra';
|
|
6
|
+
import { globby } from 'globby';
|
|
7
|
+
import moment from 'moment';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import semver from 'semver';
|
|
10
|
+
import replaceInFile from 'replace-in-file';
|
|
11
|
+
import CommandBase from '../command.base.js';
|
|
12
|
+
class Version extends CommandBase {
|
|
15
13
|
/**
|
|
16
14
|
* Update NPM packages with wsrun
|
|
15
|
+
* @param type Release type of NPM package
|
|
16
|
+
* @param version Version
|
|
17
|
+
* @param filter Regular Expression filter for packages
|
|
18
|
+
* @param excludeDirs Excluded directories
|
|
19
|
+
* @returns {Promise<void>} Void
|
|
17
20
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
const paths = await globby(searchPattern);
|
|
29
|
-
for (const path of paths) {
|
|
30
|
-
try {
|
|
31
|
-
// Read the data from it
|
|
32
|
-
let data = await fs.readJSON(path);
|
|
33
|
-
// Check if version exists
|
|
34
|
-
if (!data.version || !data.name) {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
let regexp = new RegExp(filter);
|
|
38
|
-
if (!regexp.test(data.name)) {
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
// Increment the package version depending on the increment type
|
|
42
|
-
if (type === 'new') {
|
|
43
|
-
data.version = version;
|
|
44
|
-
}
|
|
45
|
-
else if (type === 'prerelease' && this.checkPrerelease(data.version, currentPrereleaseDate)) {
|
|
46
|
-
data.version = semver.inc(data.version, type, true);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
data.version = semver.inc(data.version, type, false, currentPrereleaseDate);
|
|
21
|
+
bumpNpm(type, version, filter, excludeDirs) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const currentPrereleaseDate = moment().format('YYYYMM');
|
|
24
|
+
const bumpedPackageName = [];
|
|
25
|
+
// Find all package.json files that are not in node modules
|
|
26
|
+
const searchPattern = ['**/package.json', '!**/node_modules'];
|
|
27
|
+
if (excludeDirs) {
|
|
28
|
+
for (const exclude of excludeDirs) {
|
|
29
|
+
searchPattern.push(`!${exclude}`);
|
|
50
30
|
}
|
|
51
|
-
bumpedPackageName.push(data.name);
|
|
52
|
-
// Save file
|
|
53
|
-
await fs.writeJSON(path, data, { spaces: 4, EOL: '\r\n' });
|
|
54
31
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
32
|
+
const paths = yield globby(searchPattern);
|
|
33
|
+
for (const path of paths) {
|
|
34
|
+
try {
|
|
35
|
+
// Read the data from it
|
|
36
|
+
const data = yield fs.readJSON(path);
|
|
37
|
+
// Check if version exists
|
|
38
|
+
if (!data.version || !data.name) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const regexp = new RegExp(filter);
|
|
42
|
+
if (!regexp.test(data.name)) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
// Increment the package version depending on the increment type
|
|
46
|
+
if (type === 'new') {
|
|
47
|
+
data.version = version;
|
|
48
|
+
}
|
|
49
|
+
else if (type === 'prerelease' && this.checkPrerelease(data.version, currentPrereleaseDate)) {
|
|
50
|
+
data.version = semver.inc(data.version, type, true);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
data.version = semver.inc(data.version, type, false, currentPrereleaseDate);
|
|
54
|
+
}
|
|
55
|
+
bumpedPackageName.push(data.name);
|
|
56
|
+
// Save file
|
|
57
|
+
yield fs.writeJSON(path, data, { spaces: 4, EOL: '\r\n' });
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error instanceof SyntaxError) {
|
|
62
|
+
this.warn(`Error reading package.json: ${chalk.yellow(error.message)}. Consider using '--exclude-dir'.`);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return this.error(`Unknown error: ${chalk.red(error)}`);
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
return bumpedPackageName;
|
|
70
|
+
});
|
|
65
71
|
}
|
|
66
72
|
/**
|
|
67
73
|
* Validate args and flags
|
|
68
74
|
*/
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
76
|
validateOptions(args, flags) {
|
|
70
77
|
if (args.type !== 'new' && flags.version) {
|
|
71
|
-
this.error(`${
|
|
78
|
+
this.error(`${chalk.red('Version flag can only be used with new type')}`);
|
|
72
79
|
return false;
|
|
73
80
|
}
|
|
74
|
-
|
|
75
|
-
this.error(`${
|
|
81
|
+
if (args.type === 'new' && !flags.version) {
|
|
82
|
+
this.error(`${chalk.red('Version flag is required with new type')}`);
|
|
76
83
|
return false;
|
|
77
84
|
}
|
|
78
|
-
|
|
79
|
-
this.error(`${
|
|
85
|
+
if (args.type === 'new' && flags.increment) {
|
|
86
|
+
this.error(`${chalk.red('Increment flag not supported with new type')}`);
|
|
80
87
|
return false;
|
|
81
88
|
}
|
|
82
89
|
return true;
|
|
83
90
|
}
|
|
84
91
|
/**
|
|
85
92
|
* Update dependencies in package.json files for @adinsure packages
|
|
93
|
+
* @param version Version
|
|
94
|
+
* @param updatedPackages Array of updated packages
|
|
95
|
+
* @returns {void}
|
|
86
96
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
for (const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
updateDependencies(version, updatedPackages) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
// Find all package.json files that are not in node modules
|
|
100
|
+
const paths = yield globby(['**/package.json', '!**/node_modules']);
|
|
101
|
+
for (const path of paths) {
|
|
102
|
+
for (const packageName of updatedPackages) {
|
|
103
|
+
const re = new RegExp('"' + packageName + '": "\\d+\\.\\d+\\..*"', 'g');
|
|
104
|
+
yield replaceInFile({
|
|
105
|
+
files: path,
|
|
106
|
+
from: re,
|
|
107
|
+
to: `"${packageName}": "${version}"`,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
98
110
|
}
|
|
99
|
-
}
|
|
111
|
+
});
|
|
100
112
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
114
|
+
insertScriptRequest(token, version, prefix) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
return axios.post(`https://ops.adinsure.com/api/script`, {
|
|
117
|
+
headers: {
|
|
118
|
+
Authorization: 'Bearer ' + token,
|
|
119
|
+
'Content-Type': 'application/json',
|
|
120
|
+
},
|
|
121
|
+
params: {
|
|
122
|
+
version,
|
|
123
|
+
prefix,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
});
|
|
114
127
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
else if (token) {
|
|
121
|
-
try {
|
|
122
|
-
await this.insertScriptRequest(token, version, prefix);
|
|
128
|
+
insertScript(token, version, prefix, skip = false) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
ux.action.start('Inserting new script version', undefined, { stdout: true });
|
|
131
|
+
if (skip) {
|
|
132
|
+
ux.action.stop(`${chalk.blue('skip')}`);
|
|
123
133
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
else if (token) {
|
|
135
|
+
try {
|
|
136
|
+
yield this.insertScriptRequest(token, version, prefix);
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
switch (error.statusCode) {
|
|
141
|
+
case 401: {
|
|
142
|
+
this.error(`${chalk.red('You don\'t have permissions. If this was intentional command, please contact Operations for permissions, do git reset and rerun command.')}`);
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
default: {
|
|
146
|
+
this.error(`${chalk.red(error)}`);
|
|
147
|
+
}
|
|
132
148
|
}
|
|
133
149
|
}
|
|
150
|
+
ux.action.stop(`${chalk.green('done')}`);
|
|
134
151
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
152
|
+
else {
|
|
153
|
+
ux.action.stop(`${chalk.red('error')}`);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
140
156
|
}
|
|
141
157
|
/**
|
|
142
158
|
* Check if version has valid prerelease as 'rc' or '201910' (year month)
|
|
159
|
+
* @param version Version
|
|
160
|
+
* @param month Month of release
|
|
161
|
+
* @returns {boolean} True or false
|
|
143
162
|
*/
|
|
144
163
|
checkPrerelease(version, month) {
|
|
145
164
|
const prereleaseVersion = semver.prerelease(version, true);
|
|
@@ -153,115 +172,121 @@ class Version extends command_base_1.default {
|
|
|
153
172
|
}
|
|
154
173
|
/**
|
|
155
174
|
* Write new version in VERSION file
|
|
175
|
+
* @param version The new version
|
|
176
|
+
* @returns {void}
|
|
156
177
|
*/
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
178
|
+
setVersion(version) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
const versionPath = path.resolve(yield this.getGitRoot(), 'VERSION');
|
|
181
|
+
if (!(yield fs.pathExists(versionPath))) {
|
|
182
|
+
throw new Error('VERSION file not found. File will not be updated.');
|
|
183
|
+
}
|
|
184
|
+
return fs.writeFileSync(versionPath, version, 'utf8');
|
|
185
|
+
});
|
|
163
186
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
// exit if validation fails
|
|
173
|
-
if (!this.validateOptions(args, flags)) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
let newVersion = null;
|
|
177
|
-
if (args.type === 'new' && flags.version) {
|
|
178
|
-
this.log(`Using 'new' command. VERSION file ignored.`);
|
|
179
|
-
newVersion = semver.valid(flags.version);
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
// Get current version
|
|
183
|
-
const fullVersion = await this.getVersion();
|
|
184
|
-
this.log(`Current version is ${chalk_1.default.green(fullVersion)}`);
|
|
185
|
-
// Calculate new version
|
|
186
|
-
newVersion = semver.inc(fullVersion, args.type, true, currentPrereleaseDate);
|
|
187
|
-
// Force prerelease if prerelease is in same month and increment RC correctly
|
|
188
|
-
if (args.type === 'prerelease' && this.checkPrerelease(fullVersion, currentPrereleaseDate)) {
|
|
189
|
-
newVersion = semver.inc(fullVersion, args.type, true);
|
|
187
|
+
run() {
|
|
188
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
const { args, flags } = yield this.parse(Version);
|
|
190
|
+
const currentPrereleaseDate = moment().format('YYYYMM');
|
|
191
|
+
// Check if token is correct and save it for later use
|
|
192
|
+
let token = '';
|
|
193
|
+
if (!flags['no-script']) {
|
|
194
|
+
token = yield this.security.getToken();
|
|
190
195
|
}
|
|
191
|
-
//
|
|
192
|
-
if (!flags
|
|
193
|
-
|
|
196
|
+
// exit if validation fails
|
|
197
|
+
if (!this.validateOptions(args, flags)) {
|
|
198
|
+
return;
|
|
194
199
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
200
|
+
let newVersion = null;
|
|
201
|
+
if (args.type === 'new' && flags.version) {
|
|
202
|
+
this.log(`Using 'new' command. VERSION file ignored.`);
|
|
203
|
+
newVersion = semver.valid(flags.version);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
// Get current version
|
|
207
|
+
const fullVersion = yield this.getVersion();
|
|
208
|
+
this.log(`Current version is ${chalk.green(fullVersion)}`);
|
|
209
|
+
// Calculate new version
|
|
210
|
+
newVersion = semver.inc(fullVersion, args.type, true, currentPrereleaseDate);
|
|
211
|
+
// Force prerelease if prerelease is in same month and increment RC correctly
|
|
212
|
+
if (args.type === 'prerelease' && this.checkPrerelease(fullVersion, currentPrereleaseDate)) {
|
|
213
|
+
newVersion = semver.inc(fullVersion, args.type, true);
|
|
214
|
+
}
|
|
215
|
+
// Allow npm packages to be versioned seperately. Ultimately we want to force npm package to have same verion as VERSION file.
|
|
216
|
+
if (!flags.independent) {
|
|
217
|
+
args.type = 'new';
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// Stop if version invalid
|
|
221
|
+
if (!newVersion) {
|
|
222
|
+
return this.error(`${chalk.red('Version in incorrect format')}`);
|
|
223
|
+
}
|
|
224
|
+
this.log(`Setting new version to ${chalk.green(newVersion)}`);
|
|
225
|
+
try {
|
|
226
|
+
yield this.setVersion(newVersion);
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
228
|
+
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
this.warn(`${chalk.yellow(error.message)}`);
|
|
231
|
+
}
|
|
232
|
+
ux.action.start('Bumping NPM packages', undefined, { stdout: true });
|
|
233
|
+
const packages = yield this.bumpNpm(args.type, newVersion, flags['only-npm-packages'], flags['exclude-dir']);
|
|
234
|
+
ux.action.stop(`${chalk.green('done')}`);
|
|
235
|
+
ux.action.start('Updating NPM dependencies in package.json files', undefined, { stdout: true });
|
|
236
|
+
if (flags['no-deps']) {
|
|
237
|
+
ux.action.stop(`${chalk.blue('skip')}`);
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
yield this.updateDependencies(newVersion, packages);
|
|
241
|
+
ux.action.stop(`${chalk.green('done')}`);
|
|
242
|
+
}
|
|
243
|
+
yield this.insertScript(token, newVersion, flags['script-prefix'], flags['no-script']);
|
|
244
|
+
});
|
|
219
245
|
}
|
|
220
246
|
}
|
|
221
|
-
exports.default = Version;
|
|
222
247
|
Version.description = 'release new version';
|
|
223
248
|
Version.usage = 'version <type> [flags]';
|
|
224
249
|
Version.examples = [
|
|
225
250
|
`$ ops version patch`,
|
|
226
251
|
`$ ops version prerelease -i`,
|
|
227
|
-
`$ ops version new -v 3.4.3
|
|
252
|
+
`$ ops version new -v 3.4.3`,
|
|
228
253
|
];
|
|
229
|
-
Version.args =
|
|
230
|
-
{
|
|
231
|
-
name: 'type',
|
|
232
|
-
required: true,
|
|
254
|
+
Version.args = {
|
|
255
|
+
type: Args.string({
|
|
233
256
|
description: 'Type of release',
|
|
234
|
-
options: ['patch', 'minor', 'major', 'prerelease', 'preminor', 'premajor', 'new']
|
|
235
|
-
|
|
236
|
-
|
|
257
|
+
options: ['patch', 'minor', 'major', 'prerelease', 'preminor', 'premajor', 'new'],
|
|
258
|
+
required: true,
|
|
259
|
+
}),
|
|
260
|
+
};
|
|
237
261
|
Version.flags = {
|
|
238
|
-
independent:
|
|
262
|
+
independent: Flags.boolean({
|
|
239
263
|
char: 'i',
|
|
240
264
|
description: 'increment npm packages independent of VERSION file',
|
|
241
|
-
default: false
|
|
265
|
+
default: false,
|
|
242
266
|
}),
|
|
243
|
-
version:
|
|
267
|
+
version: Flags.string({
|
|
244
268
|
char: 'v',
|
|
245
|
-
description: 'force version'
|
|
269
|
+
description: 'force version',
|
|
246
270
|
}),
|
|
247
|
-
'script-prefix':
|
|
271
|
+
'script-prefix': Flags.string({
|
|
248
272
|
description: 'prefix for db script version creation. (default: 7.10)',
|
|
249
|
-
default: '7.10'
|
|
273
|
+
default: '7.10',
|
|
250
274
|
}),
|
|
251
|
-
'no-deps':
|
|
275
|
+
'no-deps': Flags.boolean({
|
|
252
276
|
description: 'skip dependency update',
|
|
253
|
-
default: false
|
|
277
|
+
default: false,
|
|
254
278
|
}),
|
|
255
|
-
'no-script':
|
|
279
|
+
'no-script': Flags.boolean({
|
|
256
280
|
description: 'skip creation of script',
|
|
257
|
-
default: false
|
|
281
|
+
default: false,
|
|
258
282
|
}),
|
|
259
|
-
'only-npm-packages':
|
|
283
|
+
'only-npm-packages': Flags.string({
|
|
260
284
|
description: 'regular expression for which NPM packages to include',
|
|
261
|
-
default: '.*'
|
|
285
|
+
default: '.*',
|
|
262
286
|
}),
|
|
263
|
-
'exclude-dir':
|
|
287
|
+
'exclude-dir': Flags.string({
|
|
264
288
|
description: 'exclude directories where to search for package.json',
|
|
265
|
-
multiple: true
|
|
266
|
-
})
|
|
289
|
+
multiple: true,
|
|
290
|
+
}),
|
|
267
291
|
};
|
|
292
|
+
export default Version;
|
package/lib/config.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultConfig = void 0;
|
|
4
|
-
exports.DefaultConfig = {
|
|
1
|
+
export const DefaultConfig = {
|
|
5
2
|
changelogs: {
|
|
6
3
|
file: 'CHANGELOG.md',
|
|
7
|
-
unreleasedFolder: 'changelogs/unreleased'
|
|
8
|
-
}
|
|
4
|
+
unreleasedFolder: 'changelogs/unreleased',
|
|
5
|
+
},
|
|
9
6
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Hook } from '@oclif/
|
|
2
|
-
export declare const versionOverride: Hook
|
|
1
|
+
import { Hook } from '@oclif/core';
|
|
2
|
+
export declare const versionOverride: Hook<'init'>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import Version from '../../commands/version.js';
|
|
3
|
+
export const versionOverride = function () {
|
|
4
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
5
|
+
if (process.argv[2] === 'version') {
|
|
6
|
+
try {
|
|
7
|
+
yield Version.run(process.argv.splice(3));
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
this.error(error);
|
|
12
|
+
}
|
|
13
|
+
// eslint-disable-next-line no-process-exit, unicorn/no-process-exit
|
|
14
|
+
return process.exit(0);
|
|
9
15
|
}
|
|
10
|
-
|
|
11
|
-
this.error(err);
|
|
12
|
-
}
|
|
13
|
-
return process.exit(0);
|
|
14
|
-
}
|
|
16
|
+
});
|
|
15
17
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { run } from '@oclif/
|
|
1
|
+
export { run } from '@oclif/core';
|
package/lib/index.js
CHANGED