@westbayberry/dg 1.3.0 → 1.3.2
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/index.mjs +9 -2
- package/dist/postinstall.mjs +16 -13
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -46257,7 +46257,8 @@ var init_static_output = __esm({
|
|
|
46257
46257
|
var status_exports = {};
|
|
46258
46258
|
__export(status_exports, {
|
|
46259
46259
|
collectStatusSnapshot: () => collectStatusSnapshot,
|
|
46260
|
-
handleStatusCommand: () => handleStatusCommand
|
|
46260
|
+
handleStatusCommand: () => handleStatusCommand,
|
|
46261
|
+
renderStatusHuman: () => renderStatusHuman
|
|
46261
46262
|
});
|
|
46262
46263
|
import { existsSync as existsSync18, readFileSync as readFileSync12 } from "node:fs";
|
|
46263
46264
|
import { join as join11 } from "node:path";
|
|
@@ -46317,6 +46318,7 @@ async function collectStatusSnapshot(cliVersion2) {
|
|
|
46317
46318
|
};
|
|
46318
46319
|
});
|
|
46319
46320
|
const engineResolvable = isEngineResolvable();
|
|
46321
|
+
const dirOnPath = (process.env.PATH ?? "").split(":").includes(shimDir2);
|
|
46320
46322
|
const pythonHooks = readPythonReceipt();
|
|
46321
46323
|
const cwd2 = process.cwd();
|
|
46322
46324
|
const hookPart = { installed: false };
|
|
@@ -46348,7 +46350,7 @@ async function collectStatusSnapshot(cliVersion2) {
|
|
|
46348
46350
|
}
|
|
46349
46351
|
return {
|
|
46350
46352
|
auth: authPart,
|
|
46351
|
-
shims: { rows: shimRows, engineResolvable },
|
|
46353
|
+
shims: { rows: shimRows, engineResolvable, dirOnPath },
|
|
46352
46354
|
pythonHooks,
|
|
46353
46355
|
hook: hookPart,
|
|
46354
46356
|
update: updatePart
|
|
@@ -46398,6 +46400,11 @@ async function renderStatusHuman(s) {
|
|
|
46398
46400
|
if (protectedRows.length > 0 && !s.shims.engineResolvable) {
|
|
46399
46401
|
protectedGlyph = chalk18.yellow("!");
|
|
46400
46402
|
protectedLine = `${protectedRows.join(", ")} \u2014 engine unresolved, installs pass through unscanned (run \`dg status\` to repair)`;
|
|
46403
|
+
} else if (protectedRows.length > 0 && !s.shims.dirOnPath) {
|
|
46404
|
+
const shell = process.env.SHELL ?? "";
|
|
46405
|
+
const rcHint = shell.includes("zsh") ? "~/.zshrc" : shell.includes("bash") ? "~/.bashrc" : "your shell rc";
|
|
46406
|
+
protectedGlyph = chalk18.yellow("!");
|
|
46407
|
+
protectedLine = `wired but not active in this shell \u2014 run \`source ${rcHint}\` or open a new terminal (installs here run unscanned until you do)`;
|
|
46401
46408
|
} else if (missingRows.length === 0) {
|
|
46402
46409
|
protectedGlyph = chalk18.green("\u2713");
|
|
46403
46410
|
protectedLine = protectedRows.join(", ");
|
package/dist/postinstall.mjs
CHANGED
|
@@ -680,7 +680,6 @@ function shouldSkipSilently() {
|
|
|
680
680
|
if (process.env[flag] && process.env[flag] !== "false" && process.env[flag] !== "0") return true;
|
|
681
681
|
}
|
|
682
682
|
if (process.env.DG_NO_RC_EDIT === "1") return true;
|
|
683
|
-
if (!process.stdout.isTTY) return true;
|
|
684
683
|
return false;
|
|
685
684
|
}
|
|
686
685
|
function emit(msg) {
|
|
@@ -703,22 +702,26 @@ async function main() {
|
|
|
703
702
|
} catch {
|
|
704
703
|
}
|
|
705
704
|
void ecosystemsWired;
|
|
705
|
+
const rcPath = rcAppended[0] ?? result.rcOutcomes.find((o) => o.status === "already-present")?.path ?? null;
|
|
706
|
+
const shimDir2 = `${targetHome}/.dg/shims`;
|
|
707
|
+
const activeNow = (process.env.PATH ?? "").split(":").includes(shimDir2);
|
|
706
708
|
emit("\u2713 Dependency Guardian installed.");
|
|
707
|
-
emit("\u2713
|
|
709
|
+
emit("\u2713 Wired: npm, pnpm, yarn, bun, pip, pip3, uv, pipx, conda, mamba.");
|
|
708
710
|
if (pythonVersions.length > 0) {
|
|
709
|
-
emit(`\u2713 python -m pip \u2014
|
|
710
|
-
}
|
|
711
|
-
if (rcAppended.length > 0) {
|
|
712
|
-
for (const p of rcAppended) emit(`\u2713 Updated: ${p}`);
|
|
713
|
-
} else {
|
|
714
|
-
emit("\u2139\uFE0F Shell rc not modified (already wired or not detected).");
|
|
711
|
+
emit(`\u2713 python -m pip \u2014 wired on ${pythonVersions.join(", ")}.`);
|
|
715
712
|
}
|
|
713
|
+
if (rcPath) emit(`\u2713 Added ${shimDir2} to PATH in ${rcPath}.`);
|
|
716
714
|
emit("");
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
715
|
+
if (!activeNow) {
|
|
716
|
+
emit(" \u26A0 One more step \u2014 activate it in your shell:");
|
|
717
|
+
emit(rcPath ? ` source ${rcPath} (or just open a new terminal)` : " open a new terminal");
|
|
718
|
+
emit(" Until you do, installs in THIS shell still run unscanned.");
|
|
719
|
+
emit("");
|
|
720
|
+
}
|
|
721
|
+
emit(" Then:");
|
|
722
|
+
emit(" dg login authenticate your account");
|
|
723
|
+
emit(" dg status see what's protected (and if this shell is active)");
|
|
724
|
+
emit(" dg uninstall remove everything");
|
|
722
725
|
} catch (err) {
|
|
723
726
|
emit("\u2139\uFE0F Dependency Guardian installed.");
|
|
724
727
|
emit(` Setup did not complete: ${err.message}`);
|