@genex-ai/cli-demo 0.80.2-dev.213 → 0.81.0-dev.214

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/dist/index.js CHANGED
@@ -3006,11 +3006,29 @@ async function walkFiles(dir) {
3006
3006
  return out;
3007
3007
  }
3008
3008
  async function collectUiAuditFindings(assetDir, srcDir, cwd = process.cwd()) {
3009
+ const viewportFindings = [];
3010
+ try {
3011
+ const indexHtml = await fs10.readFile(path10.join(cwd, "index.html"), "utf8");
3012
+ if (!/<meta[^>]+name=["']viewport["']/i.test(indexHtml)) {
3013
+ viewportFindings.push({
3014
+ kind: "viewport-meta",
3015
+ message: `index.html has no viewport meta \u2014 phones will render a zoomed-out desktop canvas. Add: <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">`
3016
+ });
3017
+ } else if (!/viewport-fit\s*=/i.test(indexHtml)) {
3018
+ viewportFindings.push({
3019
+ kind: "viewport-meta",
3020
+ message: `index.html's viewport meta lacks viewport-fit=cover \u2014 env(safe-area-inset-*) (touch-kit widget offsets) is 0 without it. Append ", viewport-fit=cover" to the meta's content.`
3021
+ });
3022
+ }
3023
+ } catch {
3024
+ }
3009
3025
  const absAssets = path10.resolve(cwd, assetDir);
3010
3026
  try {
3011
- if (!(await fs10.stat(absAssets)).isDirectory()) return null;
3027
+ if (!(await fs10.stat(absAssets)).isDirectory()) {
3028
+ return viewportFindings.length > 0 ? viewportFindings : null;
3029
+ }
3012
3030
  } catch {
3013
- return null;
3031
+ return viewportFindings.length > 0 ? viewportFindings : null;
3014
3032
  }
3015
3033
  const srcFiles = (await walkFiles(path10.resolve(cwd, srcDir))).filter(
3016
3034
  (p) => AUDIT_SRC_EXTS.has(path10.extname(p).toLowerCase())
@@ -3030,7 +3048,7 @@ async function collectUiAuditFindings(assetDir, srcDir, cwd = process.cwd()) {
3030
3048
  }
3031
3049
  }
3032
3050
  const referenced = (basename) => sources.some((s) => s.text.includes(basename));
3033
- const findings = [];
3051
+ const findings = [...viewportFindings];
3034
3052
  const assetFiles = await walkFiles(absAssets);
3035
3053
  const maskReported = /* @__PURE__ */ new Set();
3036
3054
  for (const p of assetFiles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/cli-demo",
3
- "version": "0.80.2-dev.213",
3
+ "version": "0.81.0-dev.214",
4
4
  "description": "Set up your project's agent workspace (.claude/.codex/.cursor in the game folder), authorize, create a game project, generate AI assets, and publish (genex CLI).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -615,7 +615,8 @@ after a bad single costs the whole chain).
615
615
  Use the returned hex verbatim for the DOM text over that region.
616
616
  - `npx genex ui trim --in <png>` — crop to alpha content + report real dims.
617
617
  - `npx genex ui audit [--dir public/assets/hud] [--src src]` — the mechanical
618
- wiring scan (unreferenced sprites/masks, naive %-fill patterns); warn-only,
618
+ wiring scan (unreferenced sprites/masks, naive %-fill patterns, and a
619
+ missing/incomplete mobile viewport meta in the root `index.html`); warn-only,
619
620
  `--strict` exits 1 on findings.
620
621
 
621
622
  ## Troubleshooting
@@ -149,6 +149,13 @@ z-order stays: drag zone (5) under joystick/buttons (10) under pause menus.
149
149
  - **Safe-area insets are built in** — default positions clear notches and the
150
150
  home indicator. If you position widgets yourself near screen edges, keep
151
151
  `env(safe-area-inset-*)` in the calc.
152
+ - **Viewport meta is a prerequisite** — every `env(safe-area-inset-*)` value is
153
+ silently **0** unless the page's viewport meta carries `viewport-fit=cover`.
154
+ Ship `<meta name="viewport" content="width=device-width, initial-scale=1,
155
+ viewport-fit=cover">` in the game's own `index.html`: the platform edge-injects
156
+ a default for published games, but the local dev server doesn't go through
157
+ that edge — without your own meta, widgets hug the notch in local testing
158
+ and look different from production.
152
159
  - **The drag zone swallows its touches** — taps inside it don't reach the
153
160
  canvas. If the game also needs taps there (tap to shoot), read them from the
154
161
  zone (`onChange` + a small-movement threshold) or shrink the zone.