@webiny/cli 5.32.0 → 5.33.0-beta.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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.33.0-beta.0](https://github.com/webiny/webiny-js/compare/v5.32.0...v5.33.0-beta.0) (2022-10-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* do not continue if there's no WCP project ID present ([faf54da](https://github.com/webiny/webiny-js/commit/faf54da5d8028c1658ba15429e2c366482727c3a))
|
|
12
|
+
* replace verb "activated" with "linked" ([a4634eb](https://github.com/webiny/webiny-js/commit/a4634eb6b0cf5d05edf9b0ca45e742731af21924))
|
|
13
|
+
* skip PAT auth if the environment is being retrieved via API key ([99214e3](https://github.com/webiny/webiny-js/commit/99214e3b124884eafdc94ba8df03bc9345837b92))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
# [5.32.0](https://github.com/webiny/webiny-js/compare/v5.32.0-beta.0...v5.32.0) (2022-09-07)
|
|
7
20
|
|
|
8
21
|
**Note:** Version bump only for package @webiny/cli
|
package/commands/wcp/hooks.js
CHANGED
|
@@ -22,6 +22,12 @@ const { getUser, getProjectEnvironment, updateUserLastActiveOn } = require("./ut
|
|
|
22
22
|
let projectEnvironment;
|
|
23
23
|
|
|
24
24
|
const getEnvironmentHookHandler = async (args, context) => {
|
|
25
|
+
// If the project isn't linked with WCP, do nothing.
|
|
26
|
+
const wcpProjectId = context.project.config.id || process.env.WCP_PROJECT_ID;
|
|
27
|
+
if (!wcpProjectId) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
// For development purposes, we allow setting the WCP_PROJECT_ENVIRONMENT env var directly.
|
|
26
32
|
if (process.env.WCP_PROJECT_ENVIRONMENT) {
|
|
27
33
|
// If we have WCP_PROJECT_ENVIRONMENT env var, we set the WCP_PROJECT_ENVIRONMENT_API_KEY too.
|
|
@@ -30,12 +36,6 @@ const getEnvironmentHookHandler = async (args, context) => {
|
|
|
30
36
|
return;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
// If the project isn't activated, do nothing.
|
|
34
|
-
const wcpProjectId = context.project.config.id || process.env.WCP_PROJECT_ID;
|
|
35
|
-
if (!wcpProjectId) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
39
|
// The `id` has the orgId/projectId structure, for example `my-org-x/my-project-y`.
|
|
40
40
|
const [orgId, projectId] = wcpProjectId.split("/");
|
|
41
41
|
|
|
@@ -69,6 +69,16 @@ module.exports.getProjectEnvironment = async ({
|
|
|
69
69
|
environmentId,
|
|
70
70
|
apiKey
|
|
71
71
|
}) => {
|
|
72
|
+
if (apiKey) {
|
|
73
|
+
return request(getWcpGqlApiUrl(), GET_ENVIRONMENT, { apiKey })
|
|
74
|
+
.then(response => response.projects.getEnvironment)
|
|
75
|
+
.catch(() => {
|
|
76
|
+
throw new Error(
|
|
77
|
+
`It seems the API key you provided is incorrect or disabled. Please double check the API key and try again.`
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
72
82
|
const pat = localStorage().get("wcpPat");
|
|
73
83
|
if (!pat) {
|
|
74
84
|
throw new Error(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.33.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"webiny": "./bin.js"
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"author": "Pavel Denisjuk <pavel@webiny.com>",
|
|
14
14
|
"description": "A tool to bootstrap a Webiny project.",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webiny/telemetry": "5.
|
|
17
|
-
"@webiny/wcp": "5.
|
|
16
|
+
"@webiny/telemetry": "5.33.0-beta.0",
|
|
17
|
+
"@webiny/wcp": "5.33.0-beta.0",
|
|
18
18
|
"boolean": "3.1.4",
|
|
19
19
|
"camelcase": "5.3.1",
|
|
20
20
|
"chalk": "4.1.2",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "8809a70796e5117e92416d6859c1f5dcae2a8c98"
|
|
68
68
|
}
|