@charlescms/astro 0.2.0 → 0.2.1

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/package.json +1 -1
  2. package/scripts/setup.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charlescms/astro",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Source-native live CMS editor for Astro sites.",
5
5
  "type": "module",
6
6
  "repository": {
package/scripts/setup.js CHANGED
@@ -321,7 +321,13 @@ function renderGitHubManifestPage({ config, state, redirectUrl }) {
321
321
  const repoOwner = config.repo.split("/")[0];
322
322
  const manifest = {
323
323
  name: appName,
324
- url: config.origin,
324
+ // GitHub validates `url` as ONE homepage URL. config.origin can be a
325
+ // comma-separated allow-list (localhost + the live site), which GitHub rejects
326
+ // with "Url must be a valid URL" — so pick a single valid URL: the public site
327
+ // if given, else the first origin, else localhost.
328
+ url: parseOrigins(config.origin).find((origin) => !isLocalOrigin(origin))
329
+ || parseOrigins(config.origin)[0]
330
+ || "http://localhost:4321",
325
331
  redirect_url: `${redirectUrl}/callback`,
326
332
  callback_urls: [`${redirectUrl}/callback`],
327
333
  public: false,