@tryclean/create 0.1.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/dist/chunk-GALY4XWB.js +31 -0
- package/dist/chunk-WHE6TEJG.js +23 -0
- package/dist/exec-OIKPD6DO.js +9 -0
- package/dist/index.js +1835 -0
- package/dist/ui-6FJJNJ7F.js +13 -0
- package/package.json +40 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/utils/ui.ts
|
|
4
|
+
import * as p from "@clack/prompts";
|
|
5
|
+
import pc from "picocolors";
|
|
6
|
+
function banner() {
|
|
7
|
+
console.log();
|
|
8
|
+
console.log(pc.bold(pc.cyan(" create-clean")));
|
|
9
|
+
console.log(pc.dim(" Set up Clean \u2014 semantic code search for AI agents"));
|
|
10
|
+
console.log();
|
|
11
|
+
}
|
|
12
|
+
function printSummary(items) {
|
|
13
|
+
const maxKey = Math.max(...Object.keys(items).map((k) => k.length));
|
|
14
|
+
for (const [key, value] of Object.entries(items)) {
|
|
15
|
+
p.log.info(`${pc.dim(key.padEnd(maxKey))} ${value}`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function cancelled() {
|
|
19
|
+
p.cancel("Setup cancelled.");
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
function isCancel2(value) {
|
|
23
|
+
return p.isCancel(value);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
banner,
|
|
28
|
+
printSummary,
|
|
29
|
+
cancelled,
|
|
30
|
+
isCancel2 as isCancel
|
|
31
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/utils/exec.ts
|
|
4
|
+
import { exec as cpExec, execSync } from "child_process";
|
|
5
|
+
function exec(command, options) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
cpExec(command, { maxBuffer: 10 * 1024 * 1024, ...options }, (error, stdout, stderr) => {
|
|
8
|
+
if (error) {
|
|
9
|
+
reject(Object.assign(error, { stdout, stderr }));
|
|
10
|
+
} else {
|
|
11
|
+
resolve({ stdout: stdout.toString(), stderr: stderr.toString() });
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function execLive(command, options) {
|
|
17
|
+
execSync(command, { stdio: "inherit", ...options });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
exec,
|
|
22
|
+
execLive
|
|
23
|
+
};
|