vibedgames 0.5.0 → 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/LICENSE +21 -0
  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 +43 -33
  6. package/dist/commands/deploy.d.ts +10 -10
  7. package/dist/commands/deploy.js +155 -139
  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 +51 -46
  12. package/dist/commands/generate.js +318 -264
  13. package/dist/commands/init.d.ts +8 -8
  14. package/dist/commands/init.js +31 -24
  15. package/dist/commands/login.js +12 -12
  16. package/dist/commands/logout.js +2 -2
  17. package/dist/commands/new.d.ts +16 -16
  18. package/dist/commands/new.js +153 -142
  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 +20 -17
  23. package/dist/commands/whoami.d.ts +5 -5
  24. package/dist/commands/whoami.js +8 -7
  25. package/dist/index.js +10 -10
  26. package/dist/lib/api.d.ts +4 -4
  27. package/dist/lib/api.js +6 -12
  28. package/dist/lib/archive.d.ts +4 -4
  29. package/dist/lib/archive.js +121 -104
  30. package/dist/lib/codex.d.ts +45 -15
  31. package/dist/lib/codex.js +175 -106
  32. package/dist/lib/config-file.d.ts +6 -6
  33. package/dist/lib/config-file.js +28 -26
  34. package/dist/lib/config.d.ts +8 -8
  35. package/dist/lib/config.js +31 -33
  36. package/dist/lib/manifest.d.ts +3 -3
  37. package/dist/lib/manifest.js +42 -38
  38. package/dist/lib/media-args.d.ts +7 -7
  39. package/dist/lib/media-args.js +113 -95
  40. package/dist/lib/media-download.d.ts +9 -9
  41. package/dist/lib/media-download.js +148 -134
  42. package/dist/lib/media-poll.d.ts +8 -8
  43. package/dist/lib/media-poll.js +32 -27
  44. package/dist/lib/media-upload.d.ts +2 -2
  45. package/dist/lib/media-upload.js +27 -27
  46. package/dist/lib/output.d.ts +27 -12
  47. package/dist/lib/output.js +26 -26
  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 +28 -18
  54. package/dist/lib/types.d.ts +5 -5
  55. package/dist/lib/types.js +9 -12
  56. package/dist/lib/update.d.ts +4 -4
  57. package/dist/lib/update.js +41 -32
  58. package/dist/lib/upload.d.ts +4 -4
  59. package/dist/lib/upload.js +14 -9
  60. package/package.json +16 -16
@@ -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.5.0",
3
+ "version": "0.5.1",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "vg": "./dist/index.js"
@@ -9,15 +9,8 @@
9
9
  "dist"
10
10
  ],
11
11
  "type": "module",
12
- "scripts": {
13
- "build": "tsc && chmod +x dist/index.js",
14
- "dev": "tsc --watch",
15
- "clean": "rm -rf .turbo dist node_modules",
16
- "test": "node --import tsx --test test/*.test.ts",
17
- "typecheck": "tsc --noEmit"
18
- },
19
12
  "dependencies": {
20
- "@orpc/client": "catalog:",
13
+ "@orpc/client": "2.0.0-beta.31",
21
14
  "citty": "^0.2.2",
22
15
  "consola": "^3.4.2",
23
16
  "cross-spawn": "^7.0.6",
@@ -26,12 +19,19 @@
26
19
  "tiged": "^2.12.8"
27
20
  },
28
21
  "devDependencies": {
29
- "@cloudflare/workers-types": "catalog:",
30
- "@kyh/tsconfig": "catalog:",
31
- "@orpc/server": "catalog:",
32
- "@repo/api": "workspace:^",
22
+ "@cloudflare/workers-types": "^5.20260829.1",
23
+ "@kyh/tsconfig": "^1.2.0",
24
+ "@orpc/server": "2.0.0-beta.31",
25
+ "@repo/api": "^0.1.0",
33
26
  "@types/cross-spawn": "^6.0.6",
34
- "@types/node": "catalog:",
35
- "typescript": "catalog:"
27
+ "@types/node": "^26.4.0",
28
+ "typescript": "^7.0.2"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc && chmod +x dist/index.js",
32
+ "dev": "tsc --watch",
33
+ "clean": "rm -rf .turbo dist node_modules",
34
+ "test": "node --import tsx --test test/*.test.ts",
35
+ "typecheck": "tsc --noEmit"
36
36
  }
37
- }
37
+ }