@genex-ai/cli-demo 0.45.0-dev.64 → 0.46.0-dev.66

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 (2) hide show
  1. package/dist/index.js +20 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10,8 +10,12 @@ import path from "path";
10
10
  import { fileURLToPath } from "url";
11
11
  var RAW_CHANNEL = "dev";
12
12
  var CLI_CHANNEL = RAW_CHANNEL === "dev" ? "dev" : "latest";
13
- var DEFAULT_AUTH_URL = CLI_CHANNEL === "dev" ? "https://dev.genex.games" : "https://genex.games";
14
- var DEFAULT_API_URL = CLI_CHANNEL === "dev" ? "https://api-dev.genex.games" : "https://api.genex.games";
13
+ var STANDS = {
14
+ prod: { api: "https://api.genex.games", dashboard: "https://genex.games" },
15
+ dev: { api: "https://api-dev.genex.games", dashboard: "https://dev.genex.games" }
16
+ };
17
+ var DEFAULT_AUTH_URL = CLI_CHANNEL === "dev" ? STANDS.dev.dashboard : STANDS.prod.dashboard;
18
+ var DEFAULT_API_URL = CLI_CHANNEL === "dev" ? STANDS.dev.api : STANDS.prod.api;
15
19
  var DEFAULT_ANIMS_BASE = "https://cdn.genex.technology/anims/ual1/v1/";
16
20
  var ANIMS_BASE_ENV = "GENEX_ANIMS_BASE";
17
21
  function getAnimsBase(override) {
@@ -991,15 +995,23 @@ var DEFAULT_DASHBOARD_ORIGIN = new URL(DEFAULT_AUTH_URL).origin;
991
995
  function renderGenexConfig() {
992
996
  return `// src/genex.config.ts \u2014 written by \`genex init\`. DO NOT hardcode URLs here.
993
997
  //
994
- // Values come from Vite env:
998
+ // One build runs on BOTH stands: the serving hostname picks the stack at runtime
999
+ // (\`-dev.genex.technology\` -> dev), so promoting a game is a copy, never a rebuild.
1000
+ // Vite env still overrides, but is loaded ONLY by \`npm run dev\`:
995
1001
  // .env -> VITE_GENEX_SLUG (this game's identity; committed)
996
- // .env.development.local -> local-stack URL overrides (dev mode ONLY \u2014 a
997
- // production build always uses the defaults below;
998
- // gitignored via *.local, never committed)
1002
+ // .env.development.local -> local-stack URL overrides (dev mode ONLY; gitignored)
1003
+ const IS_DEV =
1004
+ typeof location !== "undefined" &&
1005
+ location.hostname.endsWith("-dev.genex.technology");
999
1006
  export const GENEX = {
1000
1007
  slug: import.meta.env.VITE_GENEX_SLUG as string,
1001
- apiUrl: (import.meta.env.VITE_GENEX_API_URL as string | undefined) ?? "${DEFAULT_API_URL}",
1002
- dashboardOrigins: ((import.meta.env.VITE_GENEX_DASHBOARD_ORIGINS as string | undefined) ?? "${DEFAULT_DASHBOARD_ORIGIN}").split(","),
1008
+ apiUrl:
1009
+ (import.meta.env.VITE_GENEX_API_URL as string | undefined) ??
1010
+ (IS_DEV ? "${STANDS.dev.api}" : "${STANDS.prod.api}"),
1011
+ dashboardOrigins: (
1012
+ (import.meta.env.VITE_GENEX_DASHBOARD_ORIGINS as string | undefined) ??
1013
+ (IS_DEV ? "${STANDS.dev.dashboard}" : "${STANDS.prod.dashboard}")
1014
+ ).split(","),
1003
1015
  } as const;
1004
1016
  `;
1005
1017
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/cli-demo",
3
- "version": "0.45.0-dev.64",
3
+ "version": "0.46.0-dev.66",
4
4
  "description": "Set up your ~/.claude workspace, authorize, create a game project, generate AI assets, and publish (genex CLI).",
5
5
  "type": "module",
6
6
  "bin": {