vibedgames 0.8.1 → 0.10.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 (96) hide show
  1. package/README.md +17 -8
  2. package/assets/align-framing.py +242 -0
  3. package/assets/render-model.py +406 -0
  4. package/assets/tilemap-editor.html +630 -0
  5. package/dist/THIRD_PARTY_NOTICES.txt +59 -7
  6. package/dist/chunk-2KVQJKIZ.js +6495 -0
  7. package/dist/chunk-2SBBKY5C.js +16993 -0
  8. package/dist/chunk-2ZKS7V72.js +170 -0
  9. package/dist/{chunk-RAUJA3OY.js → chunk-3HGBIUM5.js} +21 -18
  10. package/dist/chunk-3UGGMFJJ.js +22 -0
  11. package/dist/{chunk-I6O4HIDY.js → chunk-42K3BJJH.js} +163 -131
  12. package/dist/chunk-43P4U7CB.js +104 -0
  13. package/dist/chunk-4FJXCS3K.js +741 -0
  14. package/dist/{chunk-NC5XCGYU.js → chunk-4UU622RK.js} +6 -5
  15. package/dist/{chunk-2QBYTIMH.js → chunk-5535KDYI.js} +1 -1
  16. package/dist/chunk-5YPLKGY3.js +87 -0
  17. package/dist/chunk-6KXXZXSO.js +475 -0
  18. package/dist/chunk-7RPLQWR2.js +91 -0
  19. package/dist/{chunk-C2IRIRAA.js → chunk-A556KALN.js} +15 -14
  20. package/dist/{chunk-N3XAUFKH.js → chunk-ABTUEIRC.js} +576 -301
  21. package/dist/{chunk-PEUP4MZR.js → chunk-AWJNAGPE.js} +6 -3
  22. package/dist/{chunk-QGEITHUP.js → chunk-BN3Q7UEC.js} +22 -19
  23. package/dist/chunk-BZOMEG3X.js +412 -0
  24. package/dist/{chunk-ZYCSYJWX.js → chunk-COSLGSVO.js} +14 -24
  25. package/dist/{chunk-PQDBCZRT.js → chunk-CTY2WZQK.js} +204 -158
  26. package/dist/{chunk-CU7UY5YJ.js → chunk-D2RF35HJ.js} +1 -1
  27. package/dist/chunk-DB7WVFS7.js +80 -0
  28. package/dist/chunk-DOOQUFPG.js +73 -0
  29. package/dist/chunk-E3FJUPLT.js +177 -0
  30. package/dist/chunk-E7NDOZ27.js +428 -0
  31. package/dist/chunk-F42QKWBB.js +39 -0
  32. package/dist/chunk-FXXVXDTW.js +168 -0
  33. package/dist/{chunk-VFFOT7KD.js → chunk-G66HRVDW.js} +1 -1
  34. package/dist/{chunk-CAKBGDCY.js → chunk-GKDUYJ7R.js} +5 -0
  35. package/dist/chunk-GLEW7VJQ.js +45 -0
  36. package/dist/{chunk-MGIASPED.js → chunk-H2C4QUTG.js} +9 -8
  37. package/dist/{chunk-HCMTSR7E.js → chunk-HRKVAXNN.js} +21 -17
  38. package/dist/{chunk-TLRL6FHW.js → chunk-HSMG6U7J.js} +10 -9
  39. package/dist/chunk-HX5Q63UA.js +48 -0
  40. package/dist/chunk-HYOXGNWS.js +53 -0
  41. package/dist/chunk-I5LELJSK.js +22 -0
  42. package/dist/{chunk-6FZPPUQH.js → chunk-JN4WZCR7.js} +5 -4
  43. package/dist/{chunk-QJZ72MSY.js → chunk-K36EOII3.js} +7 -6
  44. package/dist/chunk-KAGVI3CE.js +62 -0
  45. package/dist/chunk-KJK5CB6E.js +58 -0
  46. package/dist/chunk-KLFBAFXD.js +25 -0
  47. package/dist/{chunk-7MKUR7Y3.js → chunk-LONQWRTR.js} +112 -81
  48. package/dist/chunk-LORGE2NB.js +2484 -0
  49. package/dist/{chunk-HKA5LBYW.js → chunk-MEAO33XW.js} +22 -19
  50. package/dist/{chunk-PM5UOIKR.js → chunk-MR5KIFI7.js} +22 -21
  51. package/dist/{chunk-GCX5KQ6A.js → chunk-N2UHAQXC.js} +18 -11
  52. package/dist/chunk-NCX6LYNJ.js +117 -0
  53. package/dist/chunk-OGX4DKIS.js +215 -0
  54. package/dist/chunk-OPUCUUID.js +41 -0
  55. package/dist/chunk-Q2QC6KAZ.js +132 -0
  56. package/dist/{chunk-2GL2WJZX.js → chunk-Q3XQPNF6.js} +14 -14
  57. package/dist/{chunk-RYFO3ZPO.js → chunk-Q5NZNXJE.js} +15 -12
  58. package/dist/{chunk-JT2AU24K.js → chunk-QARXJGI5.js} +1 -1
  59. package/dist/chunk-QLCVLCPM.js +126 -0
  60. package/dist/chunk-R2WVORGD.js +91 -0
  61. package/dist/chunk-RKS7SI5L.js +64 -0
  62. package/dist/{chunk-4BGCA3W7.js → chunk-RPJR3S5S.js} +32 -18
  63. package/dist/chunk-RPSUFZAG.js +3307 -0
  64. package/dist/chunk-RRI23NK2.js +40 -0
  65. package/dist/chunk-S7HYWITX.js +57 -0
  66. package/dist/chunk-SBXCK2I2.js +48 -0
  67. package/dist/chunk-SUSX3QIA.js +62 -0
  68. package/dist/{chunk-PHEDW6C7.js → chunk-SXYQL4GK.js} +16 -7
  69. package/dist/{chunk-ZI6PKVXG.js → chunk-TMPBGXT4.js} +6 -5
  70. package/dist/chunk-TXOE5UY5.js +72 -0
  71. package/dist/chunk-U6DTE5IX.js +124 -0
  72. package/dist/chunk-UPHB5HWO.js +115 -0
  73. package/dist/chunk-UQ7VO6B3.js +91 -0
  74. package/dist/chunk-VB4WLJR2.js +47 -0
  75. package/dist/{chunk-FNYBZNW2.js → chunk-VIEKOGKG.js} +21 -3
  76. package/dist/{chunk-QIVCBUYD.js → chunk-VZEJ2ZHE.js} +18 -18
  77. package/dist/chunk-X75Y7LUW.js +126 -0
  78. package/dist/{chunk-Z4Z24FWO.js → chunk-YNCYMWER.js} +8 -5
  79. package/dist/chunk-ZHLPE6LI.js +71 -0
  80. package/dist/index.js +48 -34
  81. package/package.json +32 -16
  82. package/templates/none/src/main.ts +4 -0
  83. package/templates/none/vite.config.ts +0 -2
  84. package/templates/phaser/src/main.ts +0 -1
  85. package/templates/phaser/src/scenes/game-scene.ts +10 -8
  86. package/templates/phaser/vite.config.ts +0 -2
  87. package/templates/react-r3f/src/app.tsx +3 -1
  88. package/templates/react-r3f/src/main.tsx +1 -0
  89. package/templates/react-r3f/vite.config.ts +0 -2
  90. package/templates/threejs/src/main.ts +10 -1
  91. package/templates/threejs/vite.config.ts +0 -2
  92. package/LICENSE +0 -21
  93. package/dist/chunk-AYJQVZXY.js +0 -39
  94. package/dist/chunk-J6PKNPI2.js +0 -26
  95. package/dist/chunk-MJQSHP3Y.js +0 -415
  96. package/dist/chunk-MYFLYNPO.js +0 -68
@@ -0,0 +1,45 @@
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
+ import {
8
+ exportManifest,
9
+ fail,
10
+ failUsage,
11
+ getFlag,
12
+ getString,
13
+ main,
14
+ parseArgs,
15
+ writeJsonFile
16
+ } from "./chunk-2KVQJKIZ.js";
17
+ import "./chunk-2SBBKY5C.js";
18
+ import "./chunk-GKDUYJ7R.js";
19
+
20
+ // src/commands/asset/manifest-export-json.ts
21
+ import { existsSync } from "node:fs";
22
+ var run = (argv) => {
23
+ main(() => {
24
+ const args = parseArgs([...argv], {
25
+ booleans: ["keep-paths"],
26
+ values: ["manifest", "out"]
27
+ });
28
+ const manifest = getString(args, "manifest") ?? "";
29
+ const out = getString(args, "out") ?? "";
30
+ if (manifest === "") {
31
+ failUsage("--manifest is required (path to assets_index.lua or .json)");
32
+ }
33
+ if (out === "") {
34
+ failUsage("--out is required (output JSON path)");
35
+ }
36
+ if (!existsSync(manifest)) {
37
+ fail(`Manifest not found: ${manifest}`);
38
+ }
39
+ writeJsonFile(out, exportManifest(manifest, !getFlag(args, "keep-paths"), out));
40
+ console.log(`Wrote ${out}`);
41
+ });
42
+ };
43
+ export {
44
+ run
45
+ };
@@ -7,16 +7,17 @@ var __dirname = __pathDirname(__filename);
7
7
  import {
8
8
  initCommand,
9
9
  reportSkills
10
- } from "./chunk-RAUJA3OY.js";
11
- import "./chunk-AYJQVZXY.js";
12
- import "./chunk-2QBYTIMH.js";
13
- import "./chunk-VFFOT7KD.js";
14
- import "./chunk-PEUP4MZR.js";
10
+ } from "./chunk-3HGBIUM5.js";
11
+ import "./chunk-F42QKWBB.js";
12
+ import "./chunk-G66HRVDW.js";
15
13
  import "./chunk-RZ4DIJQW.js";
16
- import "./chunk-CU7UY5YJ.js";
17
- import "./chunk-J6PKNPI2.js";
18
14
  import "./chunk-MBXCVCC4.js";
19
- import "./chunk-CAKBGDCY.js";
15
+ import "./chunk-5535KDYI.js";
16
+ import "./chunk-D2RF35HJ.js";
17
+ import "./chunk-AWJNAGPE.js";
18
+ import "./chunk-RPSUFZAG.js";
19
+ import "./chunk-2SBBKY5C.js";
20
+ import "./chunk-GKDUYJ7R.js";
20
21
  export {
21
22
  initCommand,
22
23
  reportSkills
@@ -4,30 +4,32 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import {
8
- authErrorCode,
9
- createClient
10
- } from "./chunk-PQDBCZRT.js";
11
- import "./chunk-Z4Z24FWO.js";
12
- import "./chunk-PEUP4MZR.js";
13
- import {
14
- outputArgs,
15
- writeStructured
16
- } from "./chunk-ZYCSYJWX.js";
17
7
  import {
18
8
  assertKnownFlags
19
9
  } from "./chunk-RZ4DIJQW.js";
10
+ import {
11
+ authErrorCode,
12
+ createClient
13
+ } from "./chunk-CTY2WZQK.js";
14
+ import "./chunk-E3FJUPLT.js";
20
15
  import {
21
16
  getToken
22
- } from "./chunk-RYFO3ZPO.js";
17
+ } from "./chunk-Q5NZNXJE.js";
23
18
  import {
24
- consola
25
- } from "./chunk-CU7UY5YJ.js";
26
- import "./chunk-J6PKNPI2.js";
19
+ outputArgs,
20
+ writeStructured
21
+ } from "./chunk-COSLGSVO.js";
27
22
  import {
28
23
  defineCommand
29
24
  } from "./chunk-MBXCVCC4.js";
30
- import "./chunk-CAKBGDCY.js";
25
+ import {
26
+ consola
27
+ } from "./chunk-D2RF35HJ.js";
28
+ import "./chunk-YNCYMWER.js";
29
+ import "./chunk-AWJNAGPE.js";
30
+ import "./chunk-RPSUFZAG.js";
31
+ import "./chunk-2SBBKY5C.js";
32
+ import "./chunk-GKDUYJ7R.js";
31
33
 
32
34
  // src/commands/whoami.ts
33
35
  var whoamiArgs = { ...outputArgs };
@@ -40,7 +42,7 @@ var whoamiCommand = defineCommand({
40
42
  run: async ({ args, rawArgs }) => {
41
43
  assertKnownFlags(rawArgs, whoamiArgs);
42
44
  const token = getToken();
43
- if (!token) {
45
+ if (token === null || token === "") {
44
46
  consola.warn("Not logged in. Run `vg login` to authenticate.");
45
47
  process.exit(1);
46
48
  }
@@ -50,7 +52,9 @@ var whoamiCommand = defineCommand({
50
52
  if (writeStructured({ email: user.email, id: user.id, name: user.name }, args)) {
51
53
  return;
52
54
  }
53
- consola.log(`${user.name} (${user.email})`);
55
+ consola.log(
56
+ user.email !== null && user.email !== "" ? `${user.name} (${user.email})` : user.name
57
+ );
54
58
  } catch (error) {
55
59
  const code = authErrorCode(error);
56
60
  if (code === "UNAUTHORIZED" || code === "FORBIDDEN") {
@@ -16,16 +16,17 @@ import {
16
16
  resolveGameUrl,
17
17
  runPlaytest,
18
18
  withScopedSession
19
- } from "./chunk-4BGCA3W7.js";
20
- import "./chunk-GCX5KQ6A.js";
21
- import "./chunk-6FZPPUQH.js";
22
- import "./chunk-2QBYTIMH.js";
23
- import "./chunk-ZI6PKVXG.js";
24
- import "./chunk-RYFO3ZPO.js";
25
- import "./chunk-CU7UY5YJ.js";
26
- import "./chunk-J6PKNPI2.js";
19
+ } from "./chunk-RPJR3S5S.js";
20
+ import "./chunk-N2UHAQXC.js";
21
+ import "./chunk-TMPBGXT4.js";
22
+ import "./chunk-JN4WZCR7.js";
23
+ import "./chunk-Q5NZNXJE.js";
27
24
  import "./chunk-MBXCVCC4.js";
28
- import "./chunk-CAKBGDCY.js";
25
+ import "./chunk-5535KDYI.js";
26
+ import "./chunk-D2RF35HJ.js";
27
+ import "./chunk-RPSUFZAG.js";
28
+ import "./chunk-2SBBKY5C.js";
29
+ import "./chunk-GKDUYJ7R.js";
29
30
  export {
30
31
  bareTokens,
31
32
  bootstrap,
@@ -0,0 +1,48 @@
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
+ import {
8
+ collectSizes,
9
+ defaultRoot,
10
+ fail,
11
+ getString,
12
+ main,
13
+ parseArgs,
14
+ sizesToCsv,
15
+ writeJsonFile,
16
+ writeTextFile
17
+ } from "./chunk-2KVQJKIZ.js";
18
+ import "./chunk-2SBBKY5C.js";
19
+ import "./chunk-GKDUYJ7R.js";
20
+
21
+ // src/commands/asset/sizes.ts
22
+ import { existsSync } from "node:fs";
23
+ var run = (argv) => {
24
+ main(() => {
25
+ const args = parseArgs([...argv], {
26
+ values: ["csv", "json", "root"]
27
+ });
28
+ const root = defaultRoot(getString(args, "root"));
29
+ if (!existsSync(root)) {
30
+ fail(`Root not found: ${root}`);
31
+ }
32
+ const rows = collectSizes(root);
33
+ for (const row of rows) {
34
+ console.log(`${row.width}x${row.height} ${row.path}`);
35
+ }
36
+ const csv = getString(args, "csv") ?? "";
37
+ if (csv !== "") {
38
+ writeTextFile(csv, sizesToCsv(rows));
39
+ }
40
+ const json = getString(args, "json") ?? "";
41
+ if (json !== "") {
42
+ writeJsonFile(json, rows);
43
+ }
44
+ });
45
+ };
46
+ export {
47
+ run
48
+ };
@@ -0,0 +1,53 @@
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
+ import {
8
+ Bitmap,
9
+ DEFAULT_SNAP_CONFIG,
10
+ fail,
11
+ failUsage,
12
+ getFlag,
13
+ getInt,
14
+ main,
15
+ parseArgs,
16
+ snapImage,
17
+ snapWarning
18
+ } from "./chunk-2KVQJKIZ.js";
19
+ import "./chunk-2SBBKY5C.js";
20
+ import "./chunk-GKDUYJ7R.js";
21
+
22
+ // src/commands/asset/pixel-snapper.ts
23
+ var run = (argv) => {
24
+ main(() => {
25
+ const args = parseArgs([...argv], {
26
+ booleans: ["strict"],
27
+ values: ["k-colors", "seed"]
28
+ });
29
+ const usage = "Usage: vg asset pixel-snapper input.png output.png [--k-colors N] [--seed N]";
30
+ const [input = "", output = ""] = args.positionals;
31
+ if (input === "" || output === "") {
32
+ failUsage(usage);
33
+ }
34
+ const kColors = getInt(args, "k-colors", 16);
35
+ if (kColors <= 0) {
36
+ fail("--k-colors must be a positive integer");
37
+ }
38
+ const config = { ...DEFAULT_SNAP_CONFIG, kColors, kSeed: getInt(args, "seed", 42) };
39
+ const snapped = snapImage(input, config);
40
+ snapped.toFile(output);
41
+ console.log(`Snapped ${input} -> ${output} (${snapped.width}x${snapped.height})`);
42
+ const warning = snapWarning(Bitmap.fromFile(input), snapped, config);
43
+ if (warning !== null && warning !== "") {
44
+ console.error(`[pixel_snapper] warning: ${warning}`);
45
+ if (getFlag(args, "strict")) {
46
+ process.exit(1);
47
+ }
48
+ }
49
+ });
50
+ };
51
+ export {
52
+ run
53
+ };
@@ -0,0 +1,22 @@
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
+ import {
8
+ pythonScript
9
+ } from "./chunk-RRI23NK2.js";
10
+ import "./chunk-5535KDYI.js";
11
+ import "./chunk-D2RF35HJ.js";
12
+ import "./chunk-YNCYMWER.js";
13
+ import "./chunk-AWJNAGPE.js";
14
+ import "./chunk-RPSUFZAG.js";
15
+ import "./chunk-2SBBKY5C.js";
16
+ import "./chunk-GKDUYJ7R.js";
17
+
18
+ // src/commands/asset/render-model.ts
19
+ var run = pythonScript("render-model.py");
20
+ export {
21
+ run
22
+ };
@@ -6,11 +6,12 @@ var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
7
  import {
8
8
  getConfigDir
9
- } from "./chunk-RYFO3ZPO.js";
9
+ } from "./chunk-Q5NZNXJE.js";
10
10
  import {
11
11
  isJsonObject,
12
- isJsonString
13
- } from "./chunk-J6PKNPI2.js";
12
+ isJsonString,
13
+ parseJson
14
+ } from "./chunk-RPSUFZAG.js";
14
15
 
15
16
  // src/lib/settings.ts
16
17
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
@@ -43,7 +44,7 @@ var readFile = () => {
43
44
  return {};
44
45
  }
45
46
  try {
46
- const data = JSON.parse(readFileSync(file, "utf-8"));
47
+ const data = parseJson(readFileSync(file, "utf-8"));
47
48
  return isJsonObject(data) ? data : {};
48
49
  } catch {
49
50
  return {};
@@ -10,13 +10,14 @@ import {
10
10
  installedFactoryVersion,
11
11
  runFactory,
12
12
  updateFactory
13
- } from "./chunk-C2IRIRAA.js";
14
- import "./chunk-AYJQVZXY.js";
15
- import "./chunk-2QBYTIMH.js";
16
- import "./chunk-CU7UY5YJ.js";
17
- import "./chunk-J6PKNPI2.js";
13
+ } from "./chunk-A556KALN.js";
14
+ import "./chunk-F42QKWBB.js";
18
15
  import "./chunk-MBXCVCC4.js";
19
- import "./chunk-CAKBGDCY.js";
16
+ import "./chunk-5535KDYI.js";
17
+ import "./chunk-D2RF35HJ.js";
18
+ import "./chunk-RPSUFZAG.js";
19
+ import "./chunk-2SBBKY5C.js";
20
+ import "./chunk-GKDUYJ7R.js";
20
21
  export {
21
22
  FACTORY_PACKAGE,
22
23
  factoryCommand,
@@ -0,0 +1,62 @@
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
+ import {
8
+ MANIFEST_CANDIDATES,
9
+ autoDetectManifest,
10
+ checkManifest,
11
+ defaultRoot,
12
+ fail,
13
+ getFlag,
14
+ getString,
15
+ main,
16
+ parseArgs,
17
+ writeJsonFile
18
+ } from "./chunk-2KVQJKIZ.js";
19
+ import "./chunk-2SBBKY5C.js";
20
+ import "./chunk-GKDUYJ7R.js";
21
+
22
+ // src/commands/asset/manifest-check.ts
23
+ import { existsSync } from "node:fs";
24
+ var run = (argv) => {
25
+ main(() => {
26
+ const args = parseArgs([...argv], {
27
+ booleans: ["strict"],
28
+ values: ["json", "manifest", "root"]
29
+ });
30
+ const root = defaultRoot(getString(args, "root"));
31
+ if (!existsSync(root)) {
32
+ fail(`Root not found: ${root}`);
33
+ }
34
+ const manifest = getString(args, "manifest") ?? autoDetectManifest() ?? "";
35
+ if (manifest === "" || !existsSync(manifest)) {
36
+ fail(
37
+ `Manifest not found. Pass --manifest or create one of: ${MANIFEST_CANDIDATES.join(", ")}`
38
+ );
39
+ }
40
+ const report = checkManifest(manifest, root);
41
+ console.log(`manifest paths: ${report.manifest_paths}`);
42
+ console.log(`actual pngs: ${report.actual_pngs}`);
43
+ console.log(`missing: ${report.missing.length}`);
44
+ for (const path of report.missing) {
45
+ console.log(` MISSING ${path}`);
46
+ }
47
+ console.log(`extra: ${report.extra.length}`);
48
+ for (const path of report.extra) {
49
+ console.log(` EXTRA ${path}`);
50
+ }
51
+ const json = getString(args, "json") ?? "";
52
+ if (json !== "") {
53
+ writeJsonFile(json, report);
54
+ }
55
+ if (getFlag(args, "strict") && report.missing.length + report.extra.length > 0) {
56
+ process.exit(1);
57
+ }
58
+ });
59
+ };
60
+ export {
61
+ run
62
+ };
@@ -0,0 +1,58 @@
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
+ import {
8
+ failUsage,
9
+ getFlag,
10
+ getString,
11
+ main,
12
+ parseArgs,
13
+ parseFrame,
14
+ probeSheet,
15
+ resolveTargets,
16
+ writeJsonFile
17
+ } from "./chunk-2KVQJKIZ.js";
18
+ import "./chunk-2SBBKY5C.js";
19
+ import "./chunk-GKDUYJ7R.js";
20
+
21
+ // src/commands/asset/sheet-probe.ts
22
+ var run = (argv) => {
23
+ main(() => {
24
+ const args = parseArgs([...argv], {
25
+ booleans: ["list", "show-empty"],
26
+ values: ["frame", "json"]
27
+ });
28
+ const [target = ""] = args.positionals;
29
+ if (target === "") {
30
+ failUsage("A PNG file or folder path is required.");
31
+ }
32
+ const frameSpec = getString(args, "frame") ?? "";
33
+ if (frameSpec === "") {
34
+ failUsage("--frame is required, e.g. --frame 32x32");
35
+ }
36
+ const frame = parseFrame(frameSpec);
37
+ const showEmpty = getFlag(args, "show-empty");
38
+ const results = resolveTargets(target).map((sheet) => probeSheet(sheet, frame, showEmpty));
39
+ for (const result of results) {
40
+ console.log(
41
+ `${result.path} grid=${result.grid.columns}x${result.grid.rows} non_empty=${result.non_empty.length} empty=${result.empty_count}`
42
+ );
43
+ if (getFlag(args, "list")) {
44
+ console.log(` non_empty=[${result.non_empty.map(([c, r]) => `(${c}, ${r})`).join(", ")}]`);
45
+ }
46
+ if (showEmpty) {
47
+ console.log(` empty=[${(result.empty ?? []).map(([c, r]) => `(${c}, ${r})`).join(", ")}]`);
48
+ }
49
+ }
50
+ const json = getString(args, "json") ?? "";
51
+ if (json !== "") {
52
+ writeJsonFile(json, results);
53
+ }
54
+ });
55
+ };
56
+ export {
57
+ run
58
+ };
@@ -0,0 +1,25 @@
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/checks/project-playwright.ts
9
+ import { createRequire } from "node:module";
10
+ import path from "node:path";
11
+ import { pathToFileURL } from "node:url";
12
+ var hasChromium = (module) => typeof module === "object" && module !== null && "chromium" in module;
13
+ var loadProjectChromium = async () => {
14
+ try {
15
+ const resolved = createRequire(path.join(process.cwd(), "package.json")).resolve("playwright");
16
+ const module = await import(pathToFileURL(resolved).href);
17
+ return hasChromium(module) ? module.chromium : null;
18
+ } catch {
19
+ return null;
20
+ }
21
+ };
22
+
23
+ export {
24
+ loadProjectChromium
25
+ };