@contrail/cli 3.6.0 → 3.7.0-alpha.1c66a91
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 +51 -3
- package/dist/auth/login.d.ts +4 -0
- package/dist/auth/login.js +134 -54
- package/dist/auth/login.spec.js +117 -3
- package/dist/auth/sign-in-error.d.ts +7 -0
- package/dist/auth/sign-in-error.js +24 -0
- package/dist/auth/sign-in-error.spec.d.ts +1 -0
- package/dist/auth/sign-in-error.spec.js +22 -0
- package/dist/auth/sso.d.ts +38 -0
- package/dist/auth/sso.js +184 -0
- package/dist/auth/sso.spec.d.ts +1 -0
- package/dist/auth/sso.spec.js +191 -0
- package/dist/basecommand.d.ts +3 -0
- package/dist/basecommand.js +8 -1
- package/dist/commands/app/publish.js +1 -1
- package/dist/commands/app/version/prerelease.d.ts +11 -0
- package/dist/commands/app/version/prerelease.js +32 -0
- package/dist/commands/login.d.ts +12 -0
- package/dist/commands/login.js +25 -0
- package/dist/helpers/app/app-config-validators.js +4 -4
- package/dist/helpers/app/app-config-validators.spec.js +36 -0
- package/dist/helpers/app/app-deployer.d.ts +1 -0
- package/dist/helpers/app/app-deployer.js +34 -0
- package/dist/helpers/app/upgrade-version.d.ts +3 -1
- package/dist/helpers/app/upgrade-version.js +7 -8
- package/dist/helpers/app/upgrade-version.spec.js +15 -0
- package/oclif.manifest.json +93 -2
- package/package.json +1 -1
|
@@ -7,7 +7,9 @@ const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
|
7
7
|
* Upgrades a semantic version based on a specified release type.
|
|
8
8
|
*
|
|
9
9
|
* @param {string} currentVersion - The current semantic version string.
|
|
10
|
-
* @param {semver.ReleaseType} type - The type of release ('major', 'minor', 'patch').
|
|
10
|
+
* @param {semver.ReleaseType} type - The type of release ('major', 'minor', 'patch', 'prerelease').
|
|
11
|
+
* 'prerelease' starts an alpha (1.2.3 becomes 1.2.4-alpha.0) or bumps the existing pre-release tag
|
|
12
|
+
* (1.2.4-alpha.0 becomes 1.2.4-alpha.1).
|
|
11
13
|
* @returns {string} The upgraded semantic version.
|
|
12
14
|
* @throws {Error} If the provided currentVersion is not a valid semantic version.
|
|
13
15
|
*
|
|
@@ -19,16 +21,13 @@ const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
|
19
21
|
*/
|
|
20
22
|
function upgradeVersion(currentVersion, type) {
|
|
21
23
|
try {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
.split('.')
|
|
25
|
-
.concat(new Array(3).fill(0).map(String))
|
|
26
|
-
.slice(0, 3)
|
|
27
|
-
.join('.');
|
|
24
|
+
const version = currentVersion.toString();
|
|
25
|
+
const paddedVersion = semver_1.default.valid(version) ??
|
|
26
|
+
version.split('.').concat(new Array(3).fill(0).map(String)).slice(0, 3).join('.');
|
|
28
27
|
if (!semver_1.default.valid(paddedVersion)) {
|
|
29
28
|
throw new Error('Invalid version string');
|
|
30
29
|
}
|
|
31
|
-
return semver_1.default.inc(paddedVersion, type);
|
|
30
|
+
return semver_1.default.inc(paddedVersion, type, semver_1.default.prerelease(paddedVersion) ? undefined : 'alpha');
|
|
32
31
|
}
|
|
33
32
|
catch (e) {
|
|
34
33
|
throw new Error(`ERROR PARSING YAML: ${e}`);
|
|
@@ -25,6 +25,21 @@ describe('upgradeVersion', () => {
|
|
|
25
25
|
const expectedVersion = semver_1.default.inc(currentVersion, releaseType);
|
|
26
26
|
expect(upgradedVersion).toBe(expectedVersion);
|
|
27
27
|
});
|
|
28
|
+
it('should start an alpha pre-release of the next patch from a stable version', () => {
|
|
29
|
+
expect((0, upgrade_version_1.upgradeVersion)('1.3.0', 'prerelease')).toBe('1.3.1-alpha.0');
|
|
30
|
+
});
|
|
31
|
+
it('should bump the number of an existing pre-release', () => {
|
|
32
|
+
expect((0, upgrade_version_1.upgradeVersion)('1.4.0-alpha.1', 'prerelease')).toBe('1.4.0-alpha.2');
|
|
33
|
+
});
|
|
34
|
+
it('should keep the existing pre-release tag when it is not alpha', () => {
|
|
35
|
+
expect((0, upgrade_version_1.upgradeVersion)('1.4.0-beta.1', 'prerelease')).toBe('1.4.0-beta.2');
|
|
36
|
+
});
|
|
37
|
+
it('should pad a short version before upgrading it', () => {
|
|
38
|
+
expect((0, upgrade_version_1.upgradeVersion)('1.2', 'patch')).toBe('1.2.1');
|
|
39
|
+
});
|
|
40
|
+
it('should upgrade a pre-release to its stable version', () => {
|
|
41
|
+
expect((0, upgrade_version_1.upgradeVersion)('1.4.0-alpha.1', 'patch')).toBe('1.4.0');
|
|
42
|
+
});
|
|
28
43
|
it('should throw an error for an invalid semantic version input', () => {
|
|
29
44
|
const currentVersion = 'invalidVersion';
|
|
30
45
|
const releaseType = 'patch';
|
package/oclif.manifest.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.
|
|
2
|
+
"version": "3.7.0-alpha.1c66a91",
|
|
3
3
|
"commands": {
|
|
4
|
+
"login": {
|
|
5
|
+
"id": "login",
|
|
6
|
+
"description": "Sign in to VibeIQ with SSO or your email and password",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"pluginName": "@contrail/cli",
|
|
9
|
+
"pluginAlias": "@contrail/cli",
|
|
10
|
+
"pluginType": "core",
|
|
11
|
+
"aliases": [],
|
|
12
|
+
"examples": [
|
|
13
|
+
"$ contrail login",
|
|
14
|
+
"$ contrail login --no-browser"
|
|
15
|
+
],
|
|
16
|
+
"flags": {
|
|
17
|
+
"logLevel": {
|
|
18
|
+
"name": "logLevel",
|
|
19
|
+
"type": "option",
|
|
20
|
+
"char": "l",
|
|
21
|
+
"description": "The Log Level",
|
|
22
|
+
"required": false,
|
|
23
|
+
"multiple": false,
|
|
24
|
+
"options": [
|
|
25
|
+
"error",
|
|
26
|
+
"warn",
|
|
27
|
+
"info",
|
|
28
|
+
"debug"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"alwaysConfirmEnv": {
|
|
32
|
+
"name": "alwaysConfirmEnv",
|
|
33
|
+
"type": "option",
|
|
34
|
+
"char": "e",
|
|
35
|
+
"description": "The Environment variables",
|
|
36
|
+
"required": false,
|
|
37
|
+
"multiple": false,
|
|
38
|
+
"options": [
|
|
39
|
+
"true",
|
|
40
|
+
"false"
|
|
41
|
+
],
|
|
42
|
+
"default": "true"
|
|
43
|
+
},
|
|
44
|
+
"browser": {
|
|
45
|
+
"name": "browser",
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "Open a browser for SSO. Use --no-browser to paste a sign-in code instead.",
|
|
48
|
+
"allowNo": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"args": {}
|
|
52
|
+
},
|
|
4
53
|
"app:create": {
|
|
5
54
|
"id": "app:create",
|
|
6
55
|
"description": "Create a new app. The current organization will be set as the owner of the app",
|
|
@@ -237,7 +286,7 @@
|
|
|
237
286
|
},
|
|
238
287
|
"app:publish": {
|
|
239
288
|
"id": "app:publish",
|
|
240
|
-
"description": "Publish the app to the marketplace. This visibility of your app depends on the app.yml configuration (\"visibility\" property)",
|
|
289
|
+
"description": "Publish the app to the marketplace. This visibility of your app depends on the app.yml configuration (\"visibility\" property). A pre-release version (e.g. \"1.4.0-alpha.1\") is published without becoming the latest version of the app.",
|
|
241
290
|
"strict": true,
|
|
242
291
|
"pluginName": "@contrail/cli",
|
|
243
292
|
"pluginAlias": "@contrail/cli",
|
|
@@ -3960,6 +4009,48 @@
|
|
|
3960
4009
|
},
|
|
3961
4010
|
"args": {}
|
|
3962
4011
|
},
|
|
4012
|
+
"app:version:prerelease": {
|
|
4013
|
+
"id": "app:version:prerelease",
|
|
4014
|
+
"description": "Upgrade the Pre-release app version. A stable version becomes the first alpha of the next patch (1.2.3 to 1.2.4-alpha.0). A pre-release version gets its number bumped (1.2.4-alpha.0 to 1.2.4-alpha.1).",
|
|
4015
|
+
"strict": true,
|
|
4016
|
+
"pluginName": "@contrail/cli",
|
|
4017
|
+
"pluginAlias": "@contrail/cli",
|
|
4018
|
+
"pluginType": "core",
|
|
4019
|
+
"aliases": [],
|
|
4020
|
+
"examples": [
|
|
4021
|
+
"$ contrail app version prerelease\n"
|
|
4022
|
+
],
|
|
4023
|
+
"flags": {
|
|
4024
|
+
"logLevel": {
|
|
4025
|
+
"name": "logLevel",
|
|
4026
|
+
"type": "option",
|
|
4027
|
+
"char": "l",
|
|
4028
|
+
"description": "The Log Level",
|
|
4029
|
+
"required": false,
|
|
4030
|
+
"multiple": false,
|
|
4031
|
+
"options": [
|
|
4032
|
+
"error",
|
|
4033
|
+
"warn",
|
|
4034
|
+
"info",
|
|
4035
|
+
"debug"
|
|
4036
|
+
]
|
|
4037
|
+
},
|
|
4038
|
+
"alwaysConfirmEnv": {
|
|
4039
|
+
"name": "alwaysConfirmEnv",
|
|
4040
|
+
"type": "option",
|
|
4041
|
+
"char": "e",
|
|
4042
|
+
"description": "The Environment variables",
|
|
4043
|
+
"required": false,
|
|
4044
|
+
"multiple": false,
|
|
4045
|
+
"options": [
|
|
4046
|
+
"true",
|
|
4047
|
+
"false"
|
|
4048
|
+
],
|
|
4049
|
+
"default": "true"
|
|
4050
|
+
}
|
|
4051
|
+
},
|
|
4052
|
+
"args": {}
|
|
4053
|
+
},
|
|
3963
4054
|
"app:extension:deployment:list": {
|
|
3964
4055
|
"id": "app:extension:deployment:list",
|
|
3965
4056
|
"description": "List extension deployments",
|