@tenderprompt/cli 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/bin/tender.js +30 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +4169 -0
- package/dist/local-files.d.ts +5 -0
- package/dist/local-files.js +46 -0
- package/package.json +34 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
const SKIPPED_DIRECTORIES = new Set([
|
|
4
|
+
".git",
|
|
5
|
+
".wrangler",
|
|
6
|
+
".next",
|
|
7
|
+
".turbo",
|
|
8
|
+
"build",
|
|
9
|
+
"dist",
|
|
10
|
+
"node_modules",
|
|
11
|
+
]);
|
|
12
|
+
function toPosixPath(value) {
|
|
13
|
+
return value.split(path.sep).join("/");
|
|
14
|
+
}
|
|
15
|
+
export async function collectTenderAppFiles(input) {
|
|
16
|
+
const entries = await readdir(input.current, { withFileTypes: true });
|
|
17
|
+
const files = [];
|
|
18
|
+
for (const entry of entries) {
|
|
19
|
+
if (entry.name.startsWith(".") &&
|
|
20
|
+
entry.name !== ".agents" &&
|
|
21
|
+
entry.name !== ".tenderprompt" &&
|
|
22
|
+
SKIPPED_DIRECTORIES.has(entry.name)) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (SKIPPED_DIRECTORIES.has(entry.name)) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const absolutePath = path.join(input.current, entry.name);
|
|
29
|
+
if (entry.isDirectory()) {
|
|
30
|
+
files.push(...(await collectTenderAppFiles({
|
|
31
|
+
root: input.root,
|
|
32
|
+
current: absolutePath,
|
|
33
|
+
})));
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (!entry.isFile()) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const relativePath = toPosixPath(path.relative(input.root, absolutePath));
|
|
40
|
+
files.push({
|
|
41
|
+
path: relativePath,
|
|
42
|
+
content: await readFile(absolutePath),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return files.sort((left, right) => left.path.localeCompare(right.path));
|
|
46
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tenderprompt/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bin": {
|
|
6
|
+
"tender": "./bin/tender.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"bin",
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "yarn clean && tsc -p tsconfig.build.json",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"prepack": "yarn build"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@tenderprompt/tender-app-validator": "0.1.0"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=20"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
34
|
+
}
|