everything-dev 0.0.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/package.json +40 -0
- package/src/cli.ts +735 -0
- package/src/components/dev-view.tsx +243 -0
- package/src/components/status-view.tsx +173 -0
- package/src/components/streaming-view.ts +110 -0
- package/src/config.ts +214 -0
- package/src/contract.ts +364 -0
- package/src/index.ts +3 -0
- package/src/lib/env.ts +91 -0
- package/src/lib/near-cli.ts +289 -0
- package/src/lib/nova.ts +254 -0
- package/src/lib/orchestrator.ts +213 -0
- package/src/lib/process.ts +370 -0
- package/src/lib/secrets.ts +28 -0
- package/src/plugin.ts +930 -0
- package/src/utils/banner.ts +19 -0
- package/src/utils/run.ts +21 -0
- package/src/utils/theme.ts +101 -0
- package/tsconfig.json +22 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { gradients, colors, divider } from "./theme";
|
|
2
|
+
|
|
3
|
+
const ASCII_BOS = `
|
|
4
|
+
██████╗ ██████╗ ███████╗
|
|
5
|
+
██╔══██╗██╔═══██╗██╔════╝
|
|
6
|
+
██████╔╝██║ ██║███████╗
|
|
7
|
+
██╔══██╗██║ ██║╚════██║
|
|
8
|
+
██████╔╝╚██████╔╝███████║
|
|
9
|
+
╚═════╝ ╚═════╝ ╚══════╝`;
|
|
10
|
+
|
|
11
|
+
export function printBanner(title?: string, version = "1.0.0") {
|
|
12
|
+
console.log(gradients.cyber(ASCII_BOS));
|
|
13
|
+
console.log();
|
|
14
|
+
if (title) {
|
|
15
|
+
console.log(colors.dim(` ${title} ${colors.cyan(`v${version}`)}`));
|
|
16
|
+
console.log(colors.dim(` ${divider(30)}`));
|
|
17
|
+
}
|
|
18
|
+
console.log();
|
|
19
|
+
}
|
package/src/utils/run.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { execa, type Options as ExecaOptions } from "execa";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { getConfigDir } from "../config";
|
|
4
|
+
|
|
5
|
+
export async function run(
|
|
6
|
+
cmd: string,
|
|
7
|
+
args: string[],
|
|
8
|
+
options: { cwd?: string; env?: Record<string, string> } = {}
|
|
9
|
+
) {
|
|
10
|
+
console.log(chalk.dim(`$ ${cmd} ${args.join(" ")}`));
|
|
11
|
+
const execaOptions: ExecaOptions = {
|
|
12
|
+
cwd: options.cwd ?? getConfigDir(),
|
|
13
|
+
stdio: "inherit",
|
|
14
|
+
reject: false,
|
|
15
|
+
env: options.env ? { ...process.env, ...options.env } : undefined,
|
|
16
|
+
};
|
|
17
|
+
const result = await execa(cmd, args, execaOptions);
|
|
18
|
+
if (result.exitCode !== 0) {
|
|
19
|
+
process.exit(result.exitCode);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import gradient from "gradient-string";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
|
|
4
|
+
export const gradients = {
|
|
5
|
+
cyber: gradient(["#00ffff", "#ff00ff"]),
|
|
6
|
+
matrix: gradient(["#003300", "#00ff41"]),
|
|
7
|
+
frost: gradient(["#0080ff", "#00ffff"]),
|
|
8
|
+
neon: gradient(["#00ff41", "#00ffff"]),
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const colors = {
|
|
12
|
+
cyan: chalk.hex("#00ffff"),
|
|
13
|
+
magenta: chalk.hex("#ff00ff"),
|
|
14
|
+
green: chalk.hex("#00ff41"),
|
|
15
|
+
blue: chalk.hex("#0080ff"),
|
|
16
|
+
purple: chalk.hex("#bf00ff"),
|
|
17
|
+
white: chalk.hex("#f0f0f0"),
|
|
18
|
+
gray: chalk.hex("#555555"),
|
|
19
|
+
dim: chalk.dim,
|
|
20
|
+
bold: chalk.bold,
|
|
21
|
+
error: chalk.hex("#ff3366"),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const icons = {
|
|
25
|
+
config: "◆",
|
|
26
|
+
host: "●",
|
|
27
|
+
pkg: "▸",
|
|
28
|
+
scan: "○",
|
|
29
|
+
run: "▶",
|
|
30
|
+
test: "◇",
|
|
31
|
+
db: "▪",
|
|
32
|
+
clean: "✕",
|
|
33
|
+
ok: "✓",
|
|
34
|
+
err: "✗",
|
|
35
|
+
pending: "○",
|
|
36
|
+
arrow: "→",
|
|
37
|
+
line: "─",
|
|
38
|
+
dot: "·",
|
|
39
|
+
bar: "│",
|
|
40
|
+
corner: "└",
|
|
41
|
+
app: "◉",
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const frames = {
|
|
45
|
+
top: (width: number) => `┌${"─".repeat(width - 2)}┐`,
|
|
46
|
+
bottom: (width: number) => `└${"─".repeat(width - 2)}┘`,
|
|
47
|
+
side: "│",
|
|
48
|
+
empty: (width: number) => `│${" ".repeat(width - 2)}│`,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export function box(content: string, width = 50): string {
|
|
52
|
+
const lines = content.split("\n");
|
|
53
|
+
const maxLen = Math.max(...lines.map((l) => l.length), width - 4);
|
|
54
|
+
const innerWidth = maxLen + 2;
|
|
55
|
+
const totalWidth = innerWidth + 2;
|
|
56
|
+
|
|
57
|
+
const top = frames.top(totalWidth);
|
|
58
|
+
const bottom = frames.bottom(totalWidth);
|
|
59
|
+
const body = lines
|
|
60
|
+
.map((line) => {
|
|
61
|
+
const padding = " ".repeat(maxLen - stripAnsi(line).length);
|
|
62
|
+
return `${frames.side} ${line}${padding} ${frames.side}`;
|
|
63
|
+
})
|
|
64
|
+
.join("\n");
|
|
65
|
+
|
|
66
|
+
return `${top}\n${body}\n${bottom}`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function stripAnsi(str: string): string {
|
|
70
|
+
const ansiPattern = new RegExp("\\x1b\\[[0-9;]*m", "g");
|
|
71
|
+
return str.replace(ansiPattern, "");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function header(text: string): string {
|
|
75
|
+
const styled = gradients.cyber(text);
|
|
76
|
+
return box(styled);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function divider(width = 48): string {
|
|
80
|
+
return colors.dim("─".repeat(width));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function label(text: string): string {
|
|
84
|
+
return colors.cyan(text);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function value(text: string): string {
|
|
88
|
+
return colors.white(text);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function success(text: string): string {
|
|
92
|
+
return colors.green(text);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function error(text: string): string {
|
|
96
|
+
return colors.error(text);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function statusIcon(ok: boolean): string {
|
|
100
|
+
return ok ? success(icons.ok) : error(icons.err);
|
|
101
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"types": ["bun"],
|
|
4
|
+
"lib": ["ESNext", "DOM"],
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"target": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"moduleDetection": "force",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"noEmit": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"jsx": "react-jsx",
|
|
14
|
+
"jsxImportSource": "react",
|
|
15
|
+
"allowSyntheticDefaultImports": true,
|
|
16
|
+
"forceConsistentCasingInFileNames": true,
|
|
17
|
+
"allowJs": true,
|
|
18
|
+
"esModuleInterop": true,
|
|
19
|
+
"resolveJsonModule": true
|
|
20
|
+
},
|
|
21
|
+
"include": ["src/**/*"]
|
|
22
|
+
}
|