@anyday/sanity-workspace-manager 0.6.0 → 0.7.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.
package/README.md CHANGED
@@ -109,7 +109,7 @@ A renamed field reads as one removed and one added, so `generate` asks rather th
109
109
  | Source | Used for |
110
110
  | ----------------------------- | -------------------------------------------------------------------------------------------- |
111
111
  | git remote and default branch | `site`, the suggested id and name |
112
- | `.env.example`, names only | `siteEnv`, the variables each new site needs |
112
+ | `.env.example`, names only | `siteEnv`, the variables each new site needs (`*_WORKSPACES_API_URL` if the site has one) |
113
113
  | `sanity.schema.json` | copy sections, singletons, home page, language documents, settings fields, colours and fonts |
114
114
  | the live project | organisation, Studio, theme colours and defaults, fonts named in `themeFiles`, starter pages |
115
115
 
package/dist/cli.mjs CHANGED
@@ -233,6 +233,10 @@ var workspace_manager_schema_default = {
233
233
  },
234
234
  baseUrl: {
235
235
  $ref: "#/definitions/name"
236
+ },
237
+ workspacesApiUrl: {
238
+ description: "Set to the Workspaces API's address, so the site's own /studio lists every workspace.",
239
+ $ref: "#/definitions/name"
236
240
  }
237
241
  }
238
242
  },
@@ -583,6 +587,9 @@ function draftManifest(repo, answers, live = {}, choices) {
583
587
  return [key, found ?? ENV_DEFAULTS[key]];
584
588
  })
585
589
  );
590
+ const apiUrlNames = repo.envNames.filter((name) => /WORKSPACES_API_URL$/.test(name));
591
+ const apiUrl = apiUrlNames.find((name) => name.startsWith("NEXT_PUBLIC_")) ?? apiUrlNames[0];
592
+ if (apiUrl) siteEnv.workspacesApiUrl = apiUrl;
586
593
  if (!repo.repo) note("No GitHub remote found: set site.repo to owner/name");
587
594
  if (!repo.hasRevalidateRoute) note("No /api/revalidate route found: check site.revalidatePath");
588
595
  if (answers.vercelTeamId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anyday/sanity-workspace-manager",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Generates and checks a site repo's workspace-manager.json for the Anyday workspace manager",
5
5
  "repository": {
6
6
  "type": "git",