@madewithremy/admin 0.1.36 → 0.1.37

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/prod.js CHANGED
@@ -1019,6 +1019,14 @@ async function dashboardLive(ctx) {
1019
1019
  );
1020
1020
  return dashboard.liveRelease;
1021
1021
  }
1022
+ async function primaryUrl(ctx) {
1023
+ const dashboard = await call(
1024
+ ctx,
1025
+ "GET",
1026
+ `/_internal/v2/apps/${ctx.appId}/dashboard`
1027
+ );
1028
+ return dashboard.primaryUrl;
1029
+ }
1022
1030
  function summarizeRelease(release) {
1023
1031
  const summary2 = {
1024
1032
  releaseId: release.id,
@@ -2735,9 +2743,9 @@ async function prerenderInvalidate(ctx, a) {
2735
2743
  async function prerenderGet(ctx, a) {
2736
2744
  const rawPath = a.req("path");
2737
2745
  const normalized = rawPath.startsWith("/") ? rawPath : `/${rawPath}`;
2738
- const isDev = !ctx.baseUrl.includes("api.mindstudio.ai");
2739
- const host = a.str("host")?.replace(/^https?:\/\//, "").replace(/\/+$/, "") || `${ctx.appId}${isDev ? "-dev" : ""}.madewithremy.com`;
2740
- const url = `https://${host}${normalized}`;
2746
+ const host = a.str("host")?.replace(/^https?:\/\//, "").replace(/\/+$/, "");
2747
+ const origin = host ? `https://${host}` : new URL(await primaryUrl(ctx)).origin;
2748
+ const url = `${origin}${normalized}`;
2741
2749
  const res = await fetchWithTimeout(
2742
2750
  url,
2743
2751
  {
@@ -2786,6 +2794,8 @@ Notes:
2786
2794
  - 'pages'/'view' read what's stored for the LIVE release; 'get' exercises the real
2787
2795
  serve path with a bot User-Agent. A warm path returns the snapshot; a cold path
2788
2796
  returns the live SPA and triggers a render \u2014 re-run to see it.
2797
+ - 'get' fetches from the app's own URL (its custom domain, else its subdomain) unless
2798
+ --host names another.
2789
2799
  - 'view' errors with snapshot_not_found when the path has no snapshot yet.
2790
2800
  - Invalidation targets the current LIVE release; a deploy already invalidates on its own.
2791
2801
  - Mounted pages: when another app mounts this one, 'pages' lists paths carrying that
@@ -9328,7 +9338,7 @@ function parseJsonConfig(raw) {
9328
9338
  }
9329
9339
 
9330
9340
  // src/ctx.ts
9331
- var DEFAULT_BASE_URL = "https://api.mindstudio.ai";
9341
+ var DEFAULT_BASE_URL = "https://v1.mindstudio-api.com";
9332
9342
  function loadWorkspaceAppId(workspaceDir = WORKSPACE_DIR) {
9333
9343
  const manifestPath = path7.join(workspaceDir, "mindstudio.json");
9334
9344
  let raw;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",