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.
Files changed (60) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/completions.d.ts +1 -1
  3. package/dist/commands/completions.js +21 -20
  4. package/dist/commands/credits.d.ts +5 -5
  5. package/dist/commands/credits.js +45 -47
  6. package/dist/commands/deploy.d.ts +10 -10
  7. package/dist/commands/deploy.js +157 -137
  8. package/dist/commands/factory.d.ts +1 -1
  9. package/dist/commands/factory.js +18 -15
  10. package/dist/commands/fork.d.ts +14 -14
  11. package/dist/commands/fork.js +53 -45
  12. package/dist/commands/generate.js +343 -286
  13. package/dist/commands/init.d.ts +8 -8
  14. package/dist/commands/init.js +31 -24
  15. package/dist/commands/login.js +14 -14
  16. package/dist/commands/logout.js +2 -2
  17. package/dist/commands/new.d.ts +16 -16
  18. package/dist/commands/new.js +191 -165
  19. package/dist/commands/playtest.d.ts +5 -5
  20. package/dist/commands/playtest.js +103 -97
  21. package/dist/commands/update.d.ts +7 -7
  22. package/dist/commands/update.js +22 -17
  23. package/dist/commands/whoami.d.ts +5 -5
  24. package/dist/commands/whoami.js +11 -10
  25. package/dist/index.js +12 -10
  26. package/dist/lib/api.d.ts +16 -4
  27. package/dist/lib/api.js +20 -32
  28. package/dist/lib/archive.d.ts +4 -4
  29. package/dist/lib/archive.js +123 -102
  30. package/dist/lib/codex.d.ts +46 -15
  31. package/dist/lib/codex.js +178 -108
  32. package/dist/lib/config-file.d.ts +6 -6
  33. package/dist/lib/config-file.js +33 -30
  34. package/dist/lib/config.d.ts +8 -8
  35. package/dist/lib/config.js +38 -30
  36. package/dist/lib/manifest.d.ts +3 -3
  37. package/dist/lib/manifest.js +44 -40
  38. package/dist/lib/media-args.d.ts +8 -6
  39. package/dist/lib/media-args.js +113 -94
  40. package/dist/lib/media-download.d.ts +9 -8
  41. package/dist/lib/media-download.js +158 -144
  42. package/dist/lib/media-poll.d.ts +8 -7
  43. package/dist/lib/media-poll.js +38 -32
  44. package/dist/lib/media-upload.d.ts +1 -1
  45. package/dist/lib/media-upload.js +30 -29
  46. package/dist/lib/output.d.ts +34 -11
  47. package/dist/lib/output.js +28 -20
  48. package/dist/lib/package-manager.d.ts +3 -3
  49. package/dist/lib/package-manager.js +27 -22
  50. package/dist/lib/run.d.ts +4 -4
  51. package/dist/lib/run.js +7 -4
  52. package/dist/lib/strict-args.d.ts +4 -4
  53. package/dist/lib/strict-args.js +29 -19
  54. package/dist/lib/types.d.ts +16 -2
  55. package/dist/lib/types.js +10 -4
  56. package/dist/lib/update.d.ts +4 -4
  57. package/dist/lib/update.js +47 -35
  58. package/dist/lib/upload.d.ts +4 -4
  59. package/dist/lib/upload.js +14 -9
  60. package/package.json +7 -8
@@ -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 function uploadAll({ files, uploads, concurrency = 6, onProgress, }) {
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 function worker() {
10
+ const worker = async () => {
11
11
  while (true) {
12
- const idx = cursor++;
13
- if (idx >= uploads.length)
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.4.1",
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
- "@trpc/client": "^11.18.0",
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.20260814.1",
22
+ "@cloudflare/workers-types": "^5.20260829.1",
24
23
  "@kyh/tsconfig": "^1.2.0",
25
- "@trpc/server": "^11.18.0",
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.2.0",
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",