vibedgames 0.4.1 → 0.5.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 +1 -1
- package/dist/commands/completions.d.ts +1 -1
- package/dist/commands/completions.js +21 -20
- package/dist/commands/credits.d.ts +5 -5
- package/dist/commands/credits.js +45 -47
- package/dist/commands/deploy.d.ts +10 -10
- package/dist/commands/deploy.js +157 -137
- package/dist/commands/factory.d.ts +1 -1
- package/dist/commands/factory.js +18 -15
- package/dist/commands/fork.d.ts +14 -14
- package/dist/commands/fork.js +53 -45
- package/dist/commands/generate.js +343 -286
- package/dist/commands/init.d.ts +8 -8
- package/dist/commands/init.js +31 -24
- package/dist/commands/login.js +14 -14
- package/dist/commands/logout.js +2 -2
- package/dist/commands/new.d.ts +16 -16
- package/dist/commands/new.js +191 -165
- package/dist/commands/playtest.d.ts +5 -5
- package/dist/commands/playtest.js +103 -97
- package/dist/commands/update.d.ts +7 -7
- package/dist/commands/update.js +22 -17
- package/dist/commands/whoami.d.ts +5 -5
- package/dist/commands/whoami.js +11 -10
- package/dist/index.js +12 -10
- package/dist/lib/api.d.ts +16 -4
- package/dist/lib/api.js +20 -32
- package/dist/lib/archive.d.ts +4 -4
- package/dist/lib/archive.js +123 -102
- package/dist/lib/codex.d.ts +46 -15
- package/dist/lib/codex.js +178 -108
- package/dist/lib/config-file.d.ts +6 -6
- package/dist/lib/config-file.js +33 -30
- package/dist/lib/config.d.ts +8 -8
- package/dist/lib/config.js +38 -30
- package/dist/lib/manifest.d.ts +3 -3
- package/dist/lib/manifest.js +44 -40
- package/dist/lib/media-args.d.ts +8 -6
- package/dist/lib/media-args.js +113 -94
- package/dist/lib/media-download.d.ts +9 -8
- package/dist/lib/media-download.js +158 -144
- package/dist/lib/media-poll.d.ts +8 -7
- package/dist/lib/media-poll.js +38 -32
- package/dist/lib/media-upload.d.ts +1 -1
- package/dist/lib/media-upload.js +30 -29
- package/dist/lib/output.d.ts +34 -11
- package/dist/lib/output.js +28 -20
- package/dist/lib/package-manager.d.ts +3 -3
- package/dist/lib/package-manager.js +27 -22
- package/dist/lib/run.d.ts +4 -4
- package/dist/lib/run.js +7 -4
- package/dist/lib/strict-args.d.ts +4 -4
- package/dist/lib/strict-args.js +29 -19
- package/dist/lib/types.d.ts +16 -2
- package/dist/lib/types.js +10 -4
- package/dist/lib/update.d.ts +4 -4
- package/dist/lib/update.js +47 -35
- package/dist/lib/upload.d.ts +4 -4
- package/dist/lib/upload.js +14 -9
- package/package.json +7 -8
package/dist/lib/upload.js
CHANGED
|
@@ -3,34 +3,39 @@ import { readFileSync } from "node:fs";
|
|
|
3
3
|
* Upload all files to their presigned PUT URLs with bounded concurrency.
|
|
4
4
|
* Throws on the first non-2xx response.
|
|
5
5
|
*/
|
|
6
|
-
export async
|
|
6
|
+
export const uploadAll = async ({ files, uploads, concurrency = 6, onProgress, }) => {
|
|
7
7
|
const byPath = new Map(files.map((f) => [f.path, f]));
|
|
8
8
|
let done = 0;
|
|
9
9
|
let cursor = 0;
|
|
10
|
-
async
|
|
10
|
+
const worker = async () => {
|
|
11
11
|
while (true) {
|
|
12
|
-
const idx = cursor
|
|
13
|
-
|
|
12
|
+
const idx = cursor;
|
|
13
|
+
cursor += 1;
|
|
14
|
+
if (idx >= uploads.length) {
|
|
14
15
|
return;
|
|
16
|
+
}
|
|
15
17
|
const upload = uploads[idx];
|
|
18
|
+
if (!upload) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
16
21
|
const file = byPath.get(upload.path);
|
|
17
22
|
if (!file) {
|
|
18
23
|
throw new Error(`Missing file for upload target: ${upload.path}`);
|
|
19
24
|
}
|
|
20
25
|
const body = readFileSync(file.absolutePath);
|
|
21
26
|
const res = await fetch(upload.url, {
|
|
22
|
-
method: "PUT",
|
|
23
|
-
headers: upload.headers,
|
|
24
27
|
body,
|
|
28
|
+
headers: upload.headers,
|
|
29
|
+
method: "PUT",
|
|
25
30
|
});
|
|
26
31
|
if (!res.ok) {
|
|
27
32
|
const text = await res.text().catch(() => "");
|
|
28
33
|
throw new Error(`Upload failed for ${upload.path}: ${res.status} ${res.statusText} ${text}`);
|
|
29
34
|
}
|
|
30
|
-
done
|
|
35
|
+
done += 1;
|
|
31
36
|
onProgress?.(done, uploads.length);
|
|
32
37
|
}
|
|
33
|
-
}
|
|
38
|
+
};
|
|
34
39
|
const workers = Array.from({ length: Math.min(concurrency, uploads.length) }, () => worker());
|
|
35
40
|
await Promise.all(workers);
|
|
36
|
-
}
|
|
41
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibedgames",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"vg": "./dist/index.js"
|
|
@@ -10,23 +10,22 @@
|
|
|
10
10
|
],
|
|
11
11
|
"type": "module",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@
|
|
13
|
+
"@orpc/client": "2.0.0-beta.31",
|
|
14
14
|
"citty": "^0.2.2",
|
|
15
15
|
"consola": "^3.4.2",
|
|
16
16
|
"cross-spawn": "^7.0.6",
|
|
17
17
|
"ignore": "^7.0.6",
|
|
18
|
-
"superjson": "^2.2.6",
|
|
19
18
|
"tar": "^7.5.22",
|
|
20
19
|
"tiged": "^2.12.8"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
|
-
"@cloudflare/workers-types": "^5.
|
|
22
|
+
"@cloudflare/workers-types": "^5.20260829.1",
|
|
24
23
|
"@kyh/tsconfig": "^1.2.0",
|
|
25
|
-
"@
|
|
24
|
+
"@orpc/server": "2.0.0-beta.31",
|
|
25
|
+
"@repo/api": "^0.1.0",
|
|
26
26
|
"@types/cross-spawn": "^6.0.6",
|
|
27
|
-
"@types/node": "^26.
|
|
28
|
-
"typescript": "^7.0.2"
|
|
29
|
-
"@repo/api": "^0.1.0"
|
|
27
|
+
"@types/node": "^26.4.0",
|
|
28
|
+
"typescript": "^7.0.2"
|
|
30
29
|
},
|
|
31
30
|
"scripts": {
|
|
32
31
|
"build": "tsc && chmod +x dist/index.js",
|