@backstage/cli-common 0.2.2-next.0 → 0.3.0-next.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 +13 -0
- package/dist/index.cjs.js +0 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -21
- package/package.json +4 -6
- package/dist/proxyBootstrap.cjs.js +0 -27
- package/dist/proxyBootstrap.cjs.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @backstage/cli-common
|
|
2
2
|
|
|
3
|
+
## 0.3.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 39deda4: **BREAKING**: Removed the deprecated `bootstrapEnvProxyAgents` export along with the `global-agent` and `undici` dependencies. Use Node.js built-in proxy support by setting `NODE_USE_ENV_PROXY=1` alongside your `HTTP_PROXY`/`HTTPS_PROXY`/`NO_PROXY` environment variables instead. See the [corporate proxy guide](https://backstage.io/docs/tutorials/corporate-proxy/) for details.
|
|
8
|
+
|
|
9
|
+
## 0.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @backstage/errors@1.3.1
|
|
15
|
+
|
|
3
16
|
## 0.2.2-next.0
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var paths = require('./paths.cjs.js');
|
|
4
4
|
var isChildPath = require('./isChildPath.cjs.js');
|
|
5
|
-
var proxyBootstrap = require('./proxyBootstrap.cjs.js');
|
|
6
5
|
var run = require('./run.cjs.js');
|
|
7
6
|
var errors = require('./errors.cjs.js');
|
|
8
7
|
|
|
@@ -13,7 +12,6 @@ exports.findOwnPaths = paths.findOwnPaths;
|
|
|
13
12
|
exports.findPaths = paths.findPaths;
|
|
14
13
|
exports.targetPaths = paths.targetPaths;
|
|
15
14
|
exports.isChildPath = isChildPath.isChildPath;
|
|
16
|
-
exports.bootstrapEnvProxyAgents = proxyBootstrap.bootstrapEnvProxyAgents;
|
|
17
15
|
exports.run = run.run;
|
|
18
16
|
exports.runCheck = run.runCheck;
|
|
19
17
|
exports.runOutput = run.runOutput;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -100,26 +100,6 @@ declare const BACKSTAGE_JSON = "backstage.json";
|
|
|
100
100
|
*/
|
|
101
101
|
declare function isChildPath(base: string, path: string): boolean;
|
|
102
102
|
|
|
103
|
-
/**
|
|
104
|
-
* This function can be called to setup undici and node-fetch Proxy agents.
|
|
105
|
-
*
|
|
106
|
-
* You can set GLOBAL_AGENT_HTTP(S)_PROXY to configure a proxy to be used in the
|
|
107
|
-
* CLIs.
|
|
108
|
-
*
|
|
109
|
-
* You can also configure a custom namespace by setting
|
|
110
|
-
* GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE which will replace the default
|
|
111
|
-
* "GLOBAL_AGENT_" env-var prefix.
|
|
112
|
-
*
|
|
113
|
-
* Make sure to call this function before any other imports.
|
|
114
|
-
*
|
|
115
|
-
* @public
|
|
116
|
-
* @deprecated Use Node.js built-in proxy support by setting `NODE_USE_ENV_PROXY=1`
|
|
117
|
-
* alongside your `HTTP_PROXY` / `HTTPS_PROXY` environment variables instead.
|
|
118
|
-
* This function will be removed in a future release.
|
|
119
|
-
* See {@link https://backstage.io/docs/tutorials/corporate-proxy/ | the corporate proxy guide} for details.
|
|
120
|
-
*/
|
|
121
|
-
declare function bootstrapEnvProxyAgents(): void;
|
|
122
|
-
|
|
123
103
|
/**
|
|
124
104
|
* Callback function that can be used to receive stdout or stderr data from a child process.
|
|
125
105
|
*
|
|
@@ -188,5 +168,5 @@ declare class ExitCodeError extends CustomErrorBase {
|
|
|
188
168
|
constructor(code: number, command?: string);
|
|
189
169
|
}
|
|
190
170
|
|
|
191
|
-
export { BACKSTAGE_JSON, ExitCodeError,
|
|
171
|
+
export { BACKSTAGE_JSON, ExitCodeError, findOwnPaths, findPaths, isChildPath, run, runCheck, runOutput, targetPaths };
|
|
192
172
|
export type { OwnPaths, Paths, ResolveFunc, RunChildProcess, RunOnOutput, RunOptions, TargetPaths };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-next.0",
|
|
4
4
|
"description": "Common functionality used by cli, backend, and create-app",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "node-library"
|
|
@@ -56,13 +56,11 @@
|
|
|
56
56
|
"test": "backstage-cli package test"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@backstage/errors": "1.3.1
|
|
60
|
-
"cross-spawn": "^7.0.3"
|
|
61
|
-
"global-agent": "^3.0.0",
|
|
62
|
-
"undici": "^7.24.5"
|
|
59
|
+
"@backstage/errors": "1.3.1",
|
|
60
|
+
"cross-spawn": "^7.0.3"
|
|
63
61
|
},
|
|
64
62
|
"devDependencies": {
|
|
65
|
-
"@backstage/cli": "0.36.
|
|
63
|
+
"@backstage/cli": "0.36.4-next.2",
|
|
66
64
|
"@types/cross-spawn": "^6.0.2",
|
|
67
65
|
"@types/node": "^22.13.14"
|
|
68
66
|
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
function bootstrapEnvProxyAgents() {
|
|
4
|
-
const globalAgentNamespace = process.env.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE ?? "GLOBAL_AGENT_";
|
|
5
|
-
const hasGlobalAgentProxy = process.env[`${globalAgentNamespace}HTTP_PROXY`] || process.env[`${globalAgentNamespace}HTTPS_PROXY`];
|
|
6
|
-
const hasStandardProxy = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;
|
|
7
|
-
const hasNodeEnvProxy = process.env.NODE_USE_ENV_PROXY === "1" || process.execArgv.includes("--use-env-proxy") || (process.env.NODE_OPTIONS?.split(/\s+/) ?? []).includes("--use-env-proxy");
|
|
8
|
-
if (hasGlobalAgentProxy) {
|
|
9
|
-
process.emitWarning(
|
|
10
|
-
`Configuration of proxy agents through ${globalAgentNamespace}* environment variables is deprecated and will be removed in a future release. Switch to the standard HTTP_PROXY/HTTPS_PROXY environment variables and set NODE_USE_ENV_PROXY=1 instead. See https://backstage.io/docs/tutorials/corporate-proxy/ for details.`,
|
|
11
|
-
{ type: "DeprecationWarning", code: "BACKSTAGE_CLI_GLOBAL_AGENT_PROXY" }
|
|
12
|
-
);
|
|
13
|
-
const globalAgent = require("global-agent");
|
|
14
|
-
globalAgent.bootstrap();
|
|
15
|
-
}
|
|
16
|
-
if (hasStandardProxy && !hasNodeEnvProxy) {
|
|
17
|
-
process.emitWarning(
|
|
18
|
-
"bootstrapEnvProxyAgents() is deprecated and will be removed in a future release. Set NODE_USE_ENV_PROXY=1 to use Node.js built-in proxy support instead. See https://backstage.io/docs/tutorials/corporate-proxy/ for details.",
|
|
19
|
-
{ type: "DeprecationWarning", code: "BACKSTAGE_CLI_PROXY_BOOTSTRAP" }
|
|
20
|
-
);
|
|
21
|
-
const { setGlobalDispatcher, EnvHttpProxyAgent } = require("undici");
|
|
22
|
-
setGlobalDispatcher(new EnvHttpProxyAgent());
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
exports.bootstrapEnvProxyAgents = bootstrapEnvProxyAgents;
|
|
27
|
-
//# sourceMappingURL=proxyBootstrap.cjs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"proxyBootstrap.cjs.js","sources":["../src/proxyBootstrap.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This function can be called to setup undici and node-fetch Proxy agents.\n *\n * You can set GLOBAL_AGENT_HTTP(S)_PROXY to configure a proxy to be used in the\n * CLIs.\n *\n * You can also configure a custom namespace by setting\n * GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE which will replace the default\n * \"GLOBAL_AGENT_\" env-var prefix.\n *\n * Make sure to call this function before any other imports.\n *\n * @public\n * @deprecated Use Node.js built-in proxy support by setting `NODE_USE_ENV_PROXY=1`\n * alongside your `HTTP_PROXY` / `HTTPS_PROXY` environment variables instead.\n * This function will be removed in a future release.\n * See {@link https://backstage.io/docs/tutorials/corporate-proxy/ | the corporate proxy guide} for details.\n */\nexport function bootstrapEnvProxyAgents() {\n const globalAgentNamespace =\n process.env.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE ?? 'GLOBAL_AGENT_';\n\n const hasGlobalAgentProxy =\n process.env[`${globalAgentNamespace}HTTP_PROXY`] ||\n process.env[`${globalAgentNamespace}HTTPS_PROXY`];\n const hasStandardProxy = process.env.HTTP_PROXY || process.env.HTTPS_PROXY;\n\n // Mimics the internal getOptionValue('--use-env-proxy') check in Node.js, which\n // normalizes the --use-env-proxy CLI flag and NODE_USE_ENV_PROXY=1 env var.\n // https://github.com/nodejs/node/blob/v22.x/src/node_options.cc\n const hasNodeEnvProxy =\n process.env.NODE_USE_ENV_PROXY === '1' ||\n process.execArgv.includes('--use-env-proxy') ||\n (process.env.NODE_OPTIONS?.split(/\\s+/) ?? []).includes('--use-env-proxy');\n\n // Node.js never reads GLOBAL_AGENT_* vars, so global-agent must always\n // handle those to preserve behavior during the deprecation period.\n if (hasGlobalAgentProxy) {\n process.emitWarning(\n `Configuration of proxy agents through ${globalAgentNamespace}* environment variables is deprecated and will be removed in a future release. Switch to the standard HTTP_PROXY/HTTPS_PROXY environment variables and set NODE_USE_ENV_PROXY=1 instead. See https://backstage.io/docs/tutorials/corporate-proxy/ for details.`,\n { type: 'DeprecationWarning', code: 'BACKSTAGE_CLI_GLOBAL_AGENT_PROXY' },\n );\n\n const globalAgent =\n require('global-agent') as typeof import('global-agent');\n globalAgent.bootstrap();\n }\n\n // Skip undici dispatcher setup when Node.js built-in proxy support is active,\n // as it already configures the global dispatcher during startup.\n if (hasStandardProxy && !hasNodeEnvProxy) {\n process.emitWarning(\n 'bootstrapEnvProxyAgents() is deprecated and will be removed in a future release. Set NODE_USE_ENV_PROXY=1 to use Node.js built-in proxy support instead. See https://backstage.io/docs/tutorials/corporate-proxy/ for details.',\n { type: 'DeprecationWarning', code: 'BACKSTAGE_CLI_PROXY_BOOTSTRAP' },\n );\n\n const { setGlobalDispatcher, EnvHttpProxyAgent } =\n require('undici') as typeof import('undici');\n setGlobalDispatcher(new EnvHttpProxyAgent());\n }\n}\n"],"names":[],"mappings":";;AAkCO,SAAS,uBAAA,GAA0B;AACxC,EAAA,MAAM,oBAAA,GACJ,OAAA,CAAQ,GAAA,CAAI,2CAAA,IAA+C,eAAA;AAE7D,EAAA,MAAM,mBAAA,GACJ,OAAA,CAAQ,GAAA,CAAI,CAAA,EAAG,oBAAoB,CAAA,UAAA,CAAY,CAAA,IAC/C,OAAA,CAAQ,GAAA,CAAI,CAAA,EAAG,oBAAoB,CAAA,WAAA,CAAa,CAAA;AAClD,EAAA,MAAM,gBAAA,GAAmB,OAAA,CAAQ,GAAA,CAAI,UAAA,IAAc,QAAQ,GAAA,CAAI,WAAA;AAK/D,EAAA,MAAM,kBACJ,OAAA,CAAQ,GAAA,CAAI,uBAAuB,GAAA,IACnC,OAAA,CAAQ,SAAS,QAAA,CAAS,iBAAiB,MAC1C,OAAA,CAAQ,GAAA,CAAI,cAAc,KAAA,CAAM,KAAK,KAAK,EAAC,EAAG,SAAS,iBAAiB,CAAA;AAI3E,EAAA,IAAI,mBAAA,EAAqB;AACvB,IAAA,OAAA,CAAQ,WAAA;AAAA,MACN,yCAAyC,oBAAoB,CAAA,8PAAA,CAAA;AAAA,MAC7D,EAAE,IAAA,EAAM,oBAAA,EAAsB,IAAA,EAAM,kCAAA;AAAmC,KACzE;AAEA,IAAA,MAAM,WAAA,GACJ,QAAQ,cAAc,CAAA;AACxB,IAAA,WAAA,CAAY,SAAA,EAAU;AAAA,EACxB;AAIA,EAAA,IAAI,gBAAA,IAAoB,CAAC,eAAA,EAAiB;AACxC,IAAA,OAAA,CAAQ,WAAA;AAAA,MACN,gOAAA;AAAA,MACA,EAAE,IAAA,EAAM,oBAAA,EAAsB,IAAA,EAAM,+BAAA;AAAgC,KACtE;AAEA,IAAA,MAAM,EAAE,mBAAA,EAAqB,iBAAA,EAAkB,GAC7C,QAAQ,QAAQ,CAAA;AAClB,IAAA,mBAAA,CAAoB,IAAI,mBAAmB,CAAA;AAAA,EAC7C;AACF;;;;"}
|