@corva/create-app 0.49.0-rc.0 → 0.49.0
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { extends: '@corva/eslint-config-node' };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"@corva/eslint-config-node/prettier"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { InvalidArgumentError, Option } from 'commander';
|
|
3
|
+
import semver from 'semver';
|
|
4
|
+
|
|
5
|
+
const flags = '--bump-version <string>';
|
|
6
|
+
const description = 'Bump version';
|
|
7
|
+
const choices = ['major', 'minor', 'patch', 'skip'];
|
|
8
|
+
|
|
9
|
+
function argParser(value, previous) {
|
|
10
|
+
// eslint-disable-next-line no-invalid-this
|
|
11
|
+
if (this.argChoices.includes(value) || semver.valid(value)) {
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
throw new InvalidArgumentError(
|
|
16
|
+
// eslint-disable-next-line no-invalid-this
|
|
17
|
+
`Allowed choices are ${this.argChoices.map((choice) => `"${choice}"`).join(', ')} or a valid semver version.`,
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export const bumpVersionOption = new Option(flags, description).choices(choices).argParser(argParser);
|
|
21
|
+
|
|
22
|
+
export const apiKeyOption = new Option(
|
|
23
|
+
'--api-key [string]',
|
|
24
|
+
'Pre generated API key for authorization during app upload',
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export const appVersion = new Option('--app-version [number]', 'App version (exp. 1, 2, 3)');
|
|
28
|
+
|
|
29
|
+
export const envOption = new Option('--env [string]', 'Environment to use').choices(['qa', 'staging', 'production']);
|
|
30
|
+
|
|
31
|
+
export const silentOption = new Option('--silent [boolean]', 'Only log result of the operation').default(false);
|
|
32
|
+
|
|
33
|
+
export const originalCwdOption = new Option('--original-cwd <string>').hideHelp();
|
|
34
|
+
|
|
35
|
+
export const bumpVersionOptionDeprecated = new Option(
|
|
36
|
+
flags,
|
|
37
|
+
chalk.bgYellow`DEPRECATED` + ` Use with ${chalk.cyan`zip`} or ${chalk.cyan`release`} command instead`,
|
|
38
|
+
)
|
|
39
|
+
.choices(choices)
|
|
40
|
+
.argParser(argParser);
|