keypin 0.6.0 → 0.8.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/README.md +18 -0
- package/chunk-m8824n5b.js +13551 -0
- package/{chunk-j6kpw8ge.js → chunk-t31ce2x2.js} +16 -1
- package/main.js +7 -3
- package/package.json +1 -1
- package/chunk-k52ykj6s.js +0 -4326
|
@@ -31,16 +31,20 @@ function installProblem(error, repo = checkout()) {
|
|
|
31
31
|
// src/runtime.ts
|
|
32
32
|
var MIN_BUN = "1.4.4";
|
|
33
33
|
var NO_ENV_FILE = "--no-env-file";
|
|
34
|
+
var COMPILED_AUTOLOAD_OFF = "dotenv and bunfig off";
|
|
35
|
+
var COMPILED_REFUSED_ENV = ["BUN_OPTIONS", "BUN_INSPECT", "BUN_INSPECT_CONNECT_TO"];
|
|
34
36
|
var ENV_FILE = "--env-file";
|
|
35
37
|
function selfCommand(bun, script) {
|
|
36
38
|
return [bun, NO_ENV_FILE, script];
|
|
37
39
|
}
|
|
38
|
-
function runtimeProblem(bun, script, execArgv) {
|
|
40
|
+
function runtimeProblem(bun, script, execArgv, compiled) {
|
|
39
41
|
if (bun === undefined)
|
|
40
42
|
return `keypin runs on Bun ${MIN_BUN} or newer, not Node.`;
|
|
41
43
|
if (olderThan(bun, MIN_BUN)) {
|
|
42
44
|
return `keypin needs Bun ${MIN_BUN} or newer, because older Bun can read a keypin.toml wrong, and this is Bun ${bun}. Upgrade Bun, or run it with "bunx bun@${MIN_BUN} ${NO_ENV_FILE} ${script}".`;
|
|
43
45
|
}
|
|
46
|
+
if (compiled)
|
|
47
|
+
return compiledProblem(compiled);
|
|
44
48
|
if (!execArgv.includes(NO_ENV_FILE)) {
|
|
45
49
|
return `keypin needs Bun started with ${NO_ENV_FILE}, or Bun adds this folder's .env values to every command keypin runs. Run it as "keypin", or as "bun ${NO_ENV_FILE} ${script}".`;
|
|
46
50
|
}
|
|
@@ -49,6 +53,17 @@ function runtimeProblem(bun, script, execArgv) {
|
|
|
49
53
|
}
|
|
50
54
|
return null;
|
|
51
55
|
}
|
|
56
|
+
function compiledProblem({ autoload, env }) {
|
|
57
|
+
if (autoload !== COMPILED_AUTOLOAD_OFF) {
|
|
58
|
+
return "this keypin binary wasn't built by apps/cli/compile.ts, so it may load this folder's .env and bunfig.toml. Build it with that script.";
|
|
59
|
+
}
|
|
60
|
+
const set = COMPILED_REFUSED_ENV.filter((name) => env[name] !== undefined);
|
|
61
|
+
if (set.length) {
|
|
62
|
+
const names = set.join(" and ");
|
|
63
|
+
return `keypin can't run with ${names} set: Bun would let ${set.length === 1 ? "it" : "them"} load code or a debugger into keypin. Unset ${names}.`;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
52
67
|
function olderThan(version, minimum) {
|
|
53
68
|
const parts = (v) => v.split(/[.+-]/).slice(0, 3).map(Number);
|
|
54
69
|
const a = parts(version);
|
package/main.js
CHANGED
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
import {
|
|
4
4
|
installProblem,
|
|
5
5
|
runtimeProblem
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-t31ce2x2.js";
|
|
7
7
|
|
|
8
8
|
// src/main.ts
|
|
9
|
-
var
|
|
9
|
+
var compiled = typeof Bun !== "undefined" && Bun.isStandaloneExecutable ? {
|
|
10
|
+
autoload: typeof KEYPIN_COMPILED === "string" ? KEYPIN_COMPILED : undefined,
|
|
11
|
+
env: process.env
|
|
12
|
+
} : undefined;
|
|
13
|
+
var problem = runtimeProblem(typeof Bun === "undefined" ? undefined : Bun.version, process.argv[1] ?? "keypin", process.execArgv, compiled);
|
|
10
14
|
if (problem) {
|
|
11
15
|
process.stderr.write(`keypin: ${problem}
|
|
12
16
|
`);
|
|
@@ -14,7 +18,7 @@ if (problem) {
|
|
|
14
18
|
}
|
|
15
19
|
var start;
|
|
16
20
|
try {
|
|
17
|
-
start = await import("./chunk-
|
|
21
|
+
start = await import("./chunk-m8824n5b.js");
|
|
18
22
|
} catch (error) {
|
|
19
23
|
const hint = installProblem(error);
|
|
20
24
|
if (!hint)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keypin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A map of every app key across your projects, published to the account it's pinned to. Values stay in your vault.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/caiopizzol/keypin#readme",
|