lopebase 0.3.0 → 0.3.1
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 +4 -4
- package/dist/lopebase.js +53 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,10 +30,10 @@ In the folder of any project you run:
|
|
|
30
30
|
npx lopebase
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
1. **Scan.**
|
|
34
|
-
variable *names* in example env files, then shows your
|
|
35
|
-
you already use, and what
|
|
36
|
-
|
|
33
|
+
1. **Scan.** After you say yes, it reads your dependency names, config file
|
|
34
|
+
names, and the variable *names* in example env files, then shows your
|
|
35
|
+
stack, the services you already use, and what it did not find (for example
|
|
36
|
+
analytics or error logging). You see each thing it reads as it reads it.
|
|
37
37
|
2. **Connect this computer.** It opens your LopeBase workspace and shows a
|
|
38
38
|
short code. Check it matches and press Connect.
|
|
39
39
|
3. **Pick what to connect.** Services already in your code are ticked; the
|
package/dist/lopebase.js
CHANGED
|
@@ -832,6 +832,24 @@ class x {
|
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
}
|
|
835
|
+
|
|
836
|
+
class dD extends x {
|
|
837
|
+
get cursor() {
|
|
838
|
+
return this.value ? 0 : 1;
|
|
839
|
+
}
|
|
840
|
+
get _value() {
|
|
841
|
+
return this.cursor === 0;
|
|
842
|
+
}
|
|
843
|
+
constructor(u) {
|
|
844
|
+
super(u, !1), this.value = !!u.initialValue, this.on("value", () => {
|
|
845
|
+
this.value = this._value;
|
|
846
|
+
}), this.on("confirm", (t) => {
|
|
847
|
+
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
|
|
848
|
+
}), this.on("cursor", () => {
|
|
849
|
+
this.value = !this.value;
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
}
|
|
835
853
|
var A;
|
|
836
854
|
A = /* @__PURE__ */ new WeakMap;
|
|
837
855
|
var kD = Object.defineProperty, $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[u] = t, H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t), SD = class extends x {
|
|
@@ -997,8 +1015,25 @@ ${import_picocolors2.default.gray(o)}` : ""}`;
|
|
|
997
1015
|
${import_picocolors2.default.cyan(d2)}
|
|
998
1016
|
`;
|
|
999
1017
|
}
|
|
1000
|
-
} }).prompt()
|
|
1001
|
-
|
|
1018
|
+
} }).prompt(), ye = (t) => {
|
|
1019
|
+
let n = t.active ?? "Yes", r2 = t.inactive ?? "No";
|
|
1020
|
+
return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? !0, render() {
|
|
1021
|
+
let i = `${import_picocolors2.default.gray(o)}
|
|
1022
|
+
${b2(this.state)} ${t.message}
|
|
1023
|
+
`, s = this.value ? n : r2;
|
|
1024
|
+
switch (this.state) {
|
|
1025
|
+
case "submit":
|
|
1026
|
+
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
|
|
1027
|
+
case "cancel":
|
|
1028
|
+
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
|
|
1029
|
+
${import_picocolors2.default.gray(o)}`;
|
|
1030
|
+
default:
|
|
1031
|
+
return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r2)}` : `${import_picocolors2.default.green(k2)} ${r2}`}
|
|
1032
|
+
${import_picocolors2.default.cyan(d2)}
|
|
1033
|
+
`;
|
|
1034
|
+
}
|
|
1035
|
+
} }).prompt();
|
|
1036
|
+
}, ve = (t) => {
|
|
1002
1037
|
let n = (r2, i) => {
|
|
1003
1038
|
let s = r2.label ?? String(r2.value);
|
|
1004
1039
|
switch (i) {
|
|
@@ -2085,7 +2120,7 @@ function detectStack(facts) {
|
|
|
2085
2120
|
why: "Know the moment the site goes down. Nothing to install."
|
|
2086
2121
|
});
|
|
2087
2122
|
if (isWebsite && !has("posthog") && !has("ga4")) {
|
|
2088
|
-
if (gaps.push("No product analytics found.
|
|
2123
|
+
if (gaps.push("No product analytics found."), !listed("posthog"))
|
|
2089
2124
|
sources.push({
|
|
2090
2125
|
source: "posthog",
|
|
2091
2126
|
label: "PostHog",
|
|
@@ -2095,7 +2130,7 @@ function detectStack(facts) {
|
|
|
2095
2130
|
});
|
|
2096
2131
|
}
|
|
2097
2132
|
if (!has("sentry")) {
|
|
2098
|
-
if (gaps.push("No error
|
|
2133
|
+
if (gaps.push("No error logging found."), !listed("sentry"))
|
|
2099
2134
|
sources.push({
|
|
2100
2135
|
source: "sentry",
|
|
2101
2136
|
label: "Sentry",
|
|
@@ -2635,24 +2670,22 @@ function scanProject(root, onProgress) {
|
|
|
2635
2670
|
// src/ui.ts
|
|
2636
2671
|
var import_picocolors3 = __toESM(require_picocolors(), 1), MARK = [
|
|
2637
2672
|
" ▗▖ ▗▖ ",
|
|
2638
|
-
" ▐▌ ▐▌ ",
|
|
2639
2673
|
" ▐█▖▗█▌ ",
|
|
2640
2674
|
" ▜██▛ ",
|
|
2641
2675
|
" ▟██▙ ",
|
|
2642
2676
|
" ▟████▙ ",
|
|
2643
2677
|
" ▟██████▙ ",
|
|
2644
|
-
"
|
|
2645
|
-
"
|
|
2646
|
-
|
|
2647
|
-
], HORIZON = /* @__PURE__ */ new Set([8, 9]);
|
|
2678
|
+
" ▄▄▄▄▄▄▄▄▄▄ ",
|
|
2679
|
+
" ▄▄▄▄▄▄ "
|
|
2680
|
+
], HORIZON = /* @__PURE__ */ new Set([6, 7]);
|
|
2648
2681
|
function motionAllowed(argv = process.argv, env = process.env, isTTY = Boolean(process.stdout.isTTY)) {
|
|
2649
2682
|
return isTTY && !env.CI && !env.LOPEBASE_NO_MOTION && env.TERM !== "dumb" && !argv.includes("--no-motion");
|
|
2650
2683
|
}
|
|
2651
2684
|
var sleep = (ms) => new Promise((r2) => setTimeout(r2, ms));
|
|
2652
2685
|
function logoLines(opts) {
|
|
2653
2686
|
let right = {
|
|
2654
|
-
|
|
2655
|
-
|
|
2687
|
+
3: `${import_picocolors3.default.bold("Lope")}${import_picocolors3.default.dim("Base")}${opts.version ? import_picocolors3.default.dim(` v${opts.version}`) : ""}`,
|
|
2688
|
+
4: import_picocolors3.default.dim(opts.tagline)
|
|
2656
2689
|
};
|
|
2657
2690
|
return MARK.map((row, i) => {
|
|
2658
2691
|
let mark = HORIZON.has(i) ? import_picocolors3.default.yellow(import_picocolors3.default.dim(row)) : import_picocolors3.default.yellow(row);
|
|
@@ -2683,7 +2716,7 @@ ${lines.join(`
|
|
|
2683
2716
|
for (let i = MARK.length - 1;i >= 0; i--)
|
|
2684
2717
|
shown.add(i), write(`${up}\r${frame(shown).join(`
|
|
2685
2718
|
`)}
|
|
2686
|
-
`), await sleep(i
|
|
2719
|
+
`), await sleep(HORIZON.has(i) ? 70 : 35);
|
|
2687
2720
|
write(`${up}\r${lines.join(`
|
|
2688
2721
|
`)}
|
|
2689
2722
|
|
|
@@ -2889,7 +2922,7 @@ async function printDetection(d3, facts) {
|
|
|
2889
2922
|
Me(possible.map((s) => `${import_picocolors4.default.yellow("?")} ${import_picocolors4.default.bold(s.label)} ${import_picocolors4.default.dim(`only ${s.evidence.join(", ")}`)}`).join(`
|
|
2890
2923
|
`), "Maybe in use, your agent will check"), await pace(motion, 150);
|
|
2891
2924
|
for (let gap of d3.gaps)
|
|
2892
|
-
M2.
|
|
2925
|
+
M2.info(import_picocolors4.default.dim(gap));
|
|
2893
2926
|
}
|
|
2894
2927
|
async function scanWithProgress() {
|
|
2895
2928
|
let s = Y2();
|
|
@@ -2919,8 +2952,13 @@ function registerMcp(agent) {
|
|
|
2919
2952
|
return res.status === 0 || /already exists/i.test(`${res.stderr}${res.stdout}`);
|
|
2920
2953
|
}
|
|
2921
2954
|
async function init() {
|
|
2922
|
-
console.clear(), await showLogo({ tagline: TAGLINE, version: version(), motion }), Ie(`${import_picocolors4.default.bgYellow(import_picocolors4.default.black(" LopeBase "))} set up this project`), Me(planLines().join(`
|
|
2923
|
-
`), "Here is what happens"), await
|
|
2955
|
+
if (console.clear(), await showLogo({ tagline: TAGLINE, version: version(), motion }), Ie(`${import_picocolors4.default.bgYellow(import_picocolors4.default.black(" LopeBase "))} set up this project`), Me(planLines().join(`
|
|
2956
|
+
`), "Here is what happens"), !guard(await ye({
|
|
2957
|
+
message: `Scan ${import_picocolors4.default.bold(cwd)}?`,
|
|
2958
|
+
initialValue: !0
|
|
2959
|
+
})))
|
|
2960
|
+
xe("Nothing was read. Run lopebase again any time."), process.exit(0);
|
|
2961
|
+
M2.step(stepTitle(1));
|
|
2924
2962
|
let { facts, detection } = await scanWithProgress();
|
|
2925
2963
|
await printDetection(detection, facts), M2.step(stepTitle(2));
|
|
2926
2964
|
let auth = loadAuth();
|
package/package.json
CHANGED