@primitivedotdev/cli 0.26.1 → 0.26.3
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/dist/oclif/index.js +12554 -178
- package/dist/oclif/proxy-auto-detect.js +38 -57
- package/package.json +7 -9
- package/dist/oclif/api-command.js +0 -799
- package/dist/oclif/auth.js +0 -223
- package/dist/oclif/commands/doctor.js +0 -338
- package/dist/oclif/commands/emails-latest.js +0 -184
- package/dist/oclif/commands/emails-poll.js +0 -121
- package/dist/oclif/commands/emails-wait.js +0 -171
- package/dist/oclif/commands/emails-watch.js +0 -165
- package/dist/oclif/commands/functions-deploy.js +0 -302
- package/dist/oclif/commands/functions-init.js +0 -376
- package/dist/oclif/commands/functions-redeploy.js +0 -240
- package/dist/oclif/commands/functions-set-secret.js +0 -212
- package/dist/oclif/commands/functions-test-function.js +0 -238
- package/dist/oclif/commands/login.js +0 -236
- package/dist/oclif/commands/logout.js +0 -87
- package/dist/oclif/commands/send.js +0 -221
- package/dist/oclif/commands/whoami.js +0 -94
- package/dist/oclif/endpoints-test-redirect.js +0 -94
- package/dist/oclif/fish-completion.js +0 -87
- package/dist/oclif/lint/raw-send-mail-fetch.js +0 -98
- package/dist/oclif/secret-flags.js +0 -59
- package/oclif.manifest.json +0 -4390
|
@@ -1,64 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
// behind a corporate proxy don't have to prefix every command with
|
|
3
|
-
// `NODE_USE_ENV_PROXY=1`.
|
|
4
|
-
//
|
|
5
|
-
// Node 22+ ignores `HTTP_PROXY` / `HTTPS_PROXY` for the built-in
|
|
6
|
-
// `fetch` / undici client unless `NODE_USE_ENV_PROXY=1` is set. That
|
|
7
|
-
// turns a one-line proxy export into per-command friction: every CLI
|
|
8
|
-
// invocation either inherits the prefix or fails with `ENETUNREACH`.
|
|
9
|
-
//
|
|
10
|
-
// This module is called once from `bin/run.js` before any network
|
|
11
|
-
// initialization. If any of the standard proxy env vars are set AND
|
|
12
|
-
// `NODE_USE_ENV_PROXY` is not already set explicitly, it sets it to
|
|
13
|
-
// `1` for the current process and prints a one-time stderr hint so
|
|
14
|
-
// the user knows what changed.
|
|
15
|
-
//
|
|
16
|
-
// An explicit `NODE_USE_ENV_PROXY` value (including `0`, `""`, etc.)
|
|
17
|
-
// is always respected: if the user has chosen to disable proxy use
|
|
18
|
-
// for this invocation, we don't override that choice.
|
|
1
|
+
//#region src/oclif/proxy-auto-detect.ts
|
|
19
2
|
const PROXY_ENV_VARS = [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
"HTTP_PROXY",
|
|
4
|
+
"HTTPS_PROXY",
|
|
5
|
+
"http_proxy",
|
|
6
|
+
"https_proxy"
|
|
24
7
|
];
|
|
25
|
-
// Module-level latch so the hint is printed at most once per process
|
|
26
|
-
// even if `applyProxyAutoDetect` is called more than once (e.g. from
|
|
27
|
-
// tests, or if a future entry point routes through it twice).
|
|
28
8
|
let hintPrinted = false;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export function _resetHintLatchForTest() {
|
|
32
|
-
hintPrinted = false;
|
|
9
|
+
function _resetHintLatchForTest() {
|
|
10
|
+
hintPrinted = false;
|
|
33
11
|
}
|
|
34
12
|
function detectProxyVars(env) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
13
|
+
return PROXY_ENV_VARS.filter((name) => {
|
|
14
|
+
const value = env[name];
|
|
15
|
+
return typeof value === "string" && value.length > 0;
|
|
16
|
+
});
|
|
39
17
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
18
|
+
function applyProxyAutoDetect(options = {}) {
|
|
19
|
+
const env = options.env ?? process.env;
|
|
20
|
+
const stderr = options.stderr ?? process.stderr;
|
|
21
|
+
const detectedVars = detectProxyVars(env);
|
|
22
|
+
if (detectedVars.length === 0) return {
|
|
23
|
+
applied: false,
|
|
24
|
+
detectedVars: [],
|
|
25
|
+
reason: "no_proxy_env"
|
|
26
|
+
};
|
|
27
|
+
if (Object.hasOwn(env, "NODE_USE_ENV_PROXY")) return {
|
|
28
|
+
applied: false,
|
|
29
|
+
detectedVars,
|
|
30
|
+
reason: "node_use_env_proxy_already_set"
|
|
31
|
+
};
|
|
32
|
+
env.NODE_USE_ENV_PROXY = "1";
|
|
33
|
+
if (!hintPrinted) {
|
|
34
|
+
hintPrinted = true;
|
|
35
|
+
const names = detectedVars.join("/");
|
|
36
|
+
stderr.write(`primitive: proxy detected via ${names}, NODE_USE_ENV_PROXY=1 set automatically\n`);
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
applied: true,
|
|
40
|
+
detectedVars,
|
|
41
|
+
reason: "applied"
|
|
42
|
+
};
|
|
64
43
|
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { _resetHintLatchForTest, applyProxyAutoDetect };
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitivedotdev/cli",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.3",
|
|
4
4
|
"description": "Official Primitive CLI: deploy Primitive Functions, send and inspect mail, manage endpoints, all from the terminal. Wraps the @primitivedotdev/sdk runtime client with one-shot commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"files": [
|
|
8
8
|
"bin",
|
|
9
|
-
"dist"
|
|
10
|
-
"oclif.manifest.json"
|
|
9
|
+
"dist"
|
|
11
10
|
],
|
|
12
11
|
"bin": {
|
|
13
12
|
"primitive": "./bin/run.js"
|
|
@@ -56,15 +55,14 @@
|
|
|
56
55
|
"topicSeparator": " "
|
|
57
56
|
},
|
|
58
57
|
"scripts": {
|
|
59
|
-
"build": "
|
|
58
|
+
"build": "tsdown",
|
|
60
59
|
"test": "vitest run",
|
|
61
60
|
"test:coverage": "vitest run --coverage",
|
|
62
61
|
"test:watch": "vitest",
|
|
63
62
|
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
|
|
64
63
|
"lint": "biome check --error-on-warnings src tests",
|
|
65
64
|
"lint:fix": "biome check --write --error-on-warnings src tests",
|
|
66
|
-
"prepack": "pnpm build
|
|
67
|
-
"postpack": "shx rm -f oclif.manifest.json",
|
|
65
|
+
"prepack": "pnpm build",
|
|
68
66
|
"prepublishOnly": "pnpm build"
|
|
69
67
|
},
|
|
70
68
|
"keywords": [
|
|
@@ -91,15 +89,15 @@
|
|
|
91
89
|
"dependencies": {
|
|
92
90
|
"@oclif/core": "^4.10.5",
|
|
93
91
|
"@oclif/plugin-autocomplete": "^3.2.45",
|
|
94
|
-
"@oclif/plugin-help": "^6.2.44"
|
|
95
|
-
"@primitivedotdev/sdk": "^0.25.0"
|
|
92
|
+
"@oclif/plugin-help": "^6.2.44"
|
|
96
93
|
},
|
|
97
94
|
"devDependencies": {
|
|
98
95
|
"@biomejs/biome": "^2.4.10",
|
|
96
|
+
"@primitivedotdev/api-core": "workspace:*",
|
|
99
97
|
"@types/node": "^22.10.2",
|
|
100
98
|
"@vitest/coverage-v8": "^4.1.4",
|
|
101
99
|
"oclif": "^4.23.0",
|
|
102
|
-
"
|
|
100
|
+
"tsdown": "^0.21.10",
|
|
103
101
|
"tsx": "^4.21.0",
|
|
104
102
|
"typescript": "^5.7.2",
|
|
105
103
|
"vite": "^8.0.8",
|