vibedgames 0.8.1 → 0.9.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.
Files changed (40) hide show
  1. package/README.md +14 -6
  2. package/dist/THIRD_PARTY_NOTICES.txt +58 -6
  3. package/dist/{chunk-FNYBZNW2.js → chunk-25BAMW5X.js} +3 -1
  4. package/dist/{chunk-GCX5KQ6A.js → chunk-2VUUMXAQ.js} +2 -2
  5. package/dist/{chunk-7MKUR7Y3.js → chunk-355VG7EO.js} +13 -12
  6. package/dist/{chunk-I6O4HIDY.js → chunk-3HUWAJQH.js} +76 -61
  7. package/dist/{chunk-2QBYTIMH.js → chunk-5535KDYI.js} +1 -1
  8. package/dist/chunk-56OY4TEP.js +20125 -0
  9. package/dist/{chunk-PHEDW6C7.js → chunk-6EWHKL7Z.js} +13 -5
  10. package/dist/{chunk-6FZPPUQH.js → chunk-7CXMMC5S.js} +1 -1
  11. package/dist/{chunk-QJZ72MSY.js → chunk-7QZSDU52.js} +5 -5
  12. package/dist/{chunk-MGIASPED.js → chunk-AXTLPJ2F.js} +5 -5
  13. package/dist/{chunk-RAUJA3OY.js → chunk-BMTHAVMS.js} +5 -5
  14. package/dist/{chunk-CU7UY5YJ.js → chunk-D2RF35HJ.js} +1 -1
  15. package/dist/chunk-FC233UKH.js +170 -0
  16. package/dist/{chunk-CAKBGDCY.js → chunk-GKDUYJ7R.js} +5 -0
  17. package/dist/{chunk-HCMTSR7E.js → chunk-H3IPLBXQ.js} +8 -7
  18. package/dist/{chunk-QGEITHUP.js → chunk-HNRVSBRK.js} +5 -5
  19. package/dist/chunk-K2U7L4RU.js +183 -0
  20. package/dist/{chunk-PQDBCZRT.js → chunk-KZBZNTM4.js} +203 -153
  21. package/dist/{chunk-QIVCBUYD.js → chunk-LXS3NJYD.js} +7 -6
  22. package/dist/{chunk-HKA5LBYW.js → chunk-LY2GQ32S.js} +9 -8
  23. package/dist/{chunk-2GL2WJZX.js → chunk-NDHXM4PL.js} +4 -4
  24. package/dist/{chunk-PM5UOIKR.js → chunk-OD2MNYXD.js} +16 -16
  25. package/dist/{chunk-JT2AU24K.js → chunk-QARXJGI5.js} +1 -1
  26. package/dist/{chunk-RYFO3ZPO.js → chunk-RXHTGX7C.js} +9 -2
  27. package/dist/chunk-ST5FC2W3.js +95 -0
  28. package/dist/{chunk-AYJQVZXY.js → chunk-TBQ5BU3Q.js} +4 -4
  29. package/dist/{chunk-N3XAUFKH.js → chunk-UFR6G6BL.js} +38 -63
  30. package/dist/{chunk-4BGCA3W7.js → chunk-US6QZICZ.js} +8 -8
  31. package/dist/{chunk-TLRL6FHW.js → chunk-UXCWSWWX.js} +7 -7
  32. package/dist/chunk-UZM6OSW5.js +113 -0
  33. package/dist/{chunk-NC5XCGYU.js → chunk-WSRIF6K4.js} +4 -4
  34. package/dist/chunk-X75Y7LUW.js +126 -0
  35. package/dist/chunk-Z5TFZQ5U.js +2478 -0
  36. package/dist/{chunk-C2IRIRAA.js → chunk-ZCYWDKYP.js} +2 -2
  37. package/dist/index.js +30 -19
  38. package/package.json +6 -5
  39. package/dist/chunk-MJQSHP3Y.js +0 -415
  40. package/dist/chunk-MYFLYNPO.js +0 -68
@@ -0,0 +1,126 @@
1
+ import { createRequire as __createRequire } from "node:module";
2
+ import { dirname as __pathDirname } from "node:path";
3
+ import { fileURLToPath as __fileURLToPath } from "node:url";
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+
8
+ // src/lib/build-dir.ts
9
+ import { existsSync } from "node:fs";
10
+ import path from "node:path";
11
+ var BUILD_OUTPUTS = ["dist", "build", "out"];
12
+ var resolveBuildDir = (dir) => {
13
+ if (!existsSync(path.join(dir, "package.json"))) {
14
+ return { dir, kind: "plain" };
15
+ }
16
+ for (const name of BUILD_OUTPUTS) {
17
+ if (existsSync(path.join(dir, name, "index.html"))) {
18
+ return { dir: path.join(dir, name), kind: "build", name };
19
+ }
20
+ }
21
+ return { dir, kind: "unbuilt" };
22
+ };
23
+
24
+ // src/lib/manifest.ts
25
+ import { createHash } from "node:crypto";
26
+ import { readFileSync, readdirSync, statSync } from "node:fs";
27
+ import path2 from "node:path";
28
+
29
+ // ../../packages/contract/src/deploy/content-types.ts
30
+ var CONTENT_TYPES = new Map(
31
+ Object.entries({
32
+ avif: "image/avif",
33
+ cjs: "application/javascript; charset=utf-8",
34
+ css: "text/css; charset=utf-8",
35
+ gif: "image/gif",
36
+ glb: "model/gltf-binary",
37
+ gltf: "model/gltf+json",
38
+ htm: "text/html; charset=utf-8",
39
+ html: "text/html; charset=utf-8",
40
+ ico: "image/x-icon",
41
+ jpeg: "image/jpeg",
42
+ jpg: "image/jpeg",
43
+ js: "application/javascript; charset=utf-8",
44
+ json: "application/json; charset=utf-8",
45
+ m4a: "audio/mp4",
46
+ map: "application/json; charset=utf-8",
47
+ mjs: "application/javascript; charset=utf-8",
48
+ mp3: "audio/mpeg",
49
+ mp4: "video/mp4",
50
+ ogg: "audio/ogg",
51
+ otf: "font/otf",
52
+ png: "image/png",
53
+ svg: "image/svg+xml",
54
+ ttf: "font/ttf",
55
+ txt: "text/plain; charset=utf-8",
56
+ wasm: "application/wasm",
57
+ wav: "audio/wav",
58
+ webm: "video/webm",
59
+ webp: "image/webp",
60
+ woff: "font/woff",
61
+ woff2: "font/woff2",
62
+ xml: "application/xml"
63
+ })
64
+ );
65
+ var contentTypeForPath = (file) => {
66
+ const ext = file.split(".").pop()?.toLowerCase() ?? "";
67
+ return CONTENT_TYPES.get(ext) ?? "application/octet-stream";
68
+ };
69
+
70
+ // src/lib/manifest.ts
71
+ var IGNORED_TOP_LEVEL = /* @__PURE__ */ new Set([
72
+ "node_modules",
73
+ ".git",
74
+ ".turbo",
75
+ ".cache",
76
+ ".DS_Store",
77
+ "vibedgames.json"
78
+ ]);
79
+ var shouldIgnore = (relPath) => {
80
+ const top = relPath.split(path2.sep)[0] ?? "";
81
+ if (IGNORED_TOP_LEVEL.has(top)) {
82
+ return true;
83
+ }
84
+ if (relPath.split(path2.sep).some((seg) => seg.startsWith("."))) {
85
+ return true;
86
+ }
87
+ return false;
88
+ };
89
+ var buildManifest = (rootDir) => {
90
+ const files = [];
91
+ const walk = (dir) => {
92
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
93
+ const abs = path2.join(dir, entry.name);
94
+ const rel = path2.relative(rootDir, abs);
95
+ if (shouldIgnore(rel)) {
96
+ continue;
97
+ }
98
+ if (entry.isDirectory()) {
99
+ walk(abs);
100
+ continue;
101
+ }
102
+ if (!entry.isFile()) {
103
+ continue;
104
+ }
105
+ const stat = statSync(abs);
106
+ const buf = readFileSync(abs);
107
+ const sha256 = createHash("sha256").update(buf).digest("hex");
108
+ const posixPath = rel.split(path2.sep).join("/");
109
+ files.push({
110
+ absolutePath: abs,
111
+ contentType: contentTypeForPath(posixPath),
112
+ path: posixPath,
113
+ sha256,
114
+ size: stat.size
115
+ });
116
+ }
117
+ };
118
+ walk(rootDir);
119
+ return files;
120
+ };
121
+
122
+ export {
123
+ resolveBuildDir,
124
+ contentTypeForPath,
125
+ buildManifest
126
+ };