@sanity/cli 3.57.1 → 3.57.2

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.
@@ -44228,7 +44228,9 @@ ${err.message}`);
44228
44228
  }
44229
44229
  if (reconfigure)
44230
44230
  throw new Error("`--reconfigure` is deprecated - manual configuration is now required");
44231
- const envFilename = typeof env == "string" ? env : ".env";
44231
+ let envFilenameDefault = ".env";
44232
+ detectedFramework && detectedFramework.slug === "nextjs" && (envFilenameDefault = ".env.local");
44233
+ const envFilename = typeof env == "string" ? env : envFilenameDefault;
44232
44234
  if (!envFilename.startsWith(".env"))
44233
44235
  throw new Error("Env filename must start with .env");
44234
44236
  const usingBareOrEnv = cliFlags.bare || cliFlags.env;
@@ -44319,9 +44321,26 @@ You can find your project on Sanity Manage \u2014 https://www.sanity.io/manage/p
44319
44321
  await fs__default$1.default.writeFile(tsConfigPath, Buffer.from(newConfig));
44320
44322
  }
44321
44323
  }
44322
- (unattended || await promptForAppendEnv(prompt2, envFilename)) && await createOrAppendEnvVars(envFilename, detectedFramework, {
44323
- log: !0
44324
- });
44324
+ if ((unattended || await promptForAppendEnv(prompt2, envFilename)) && await createOrAppendEnvVars(envFilename, detectedFramework, { log: !0 }), embeddedStudio) {
44325
+ const nextjsLocalDevOrigin = "http://localhost:3000";
44326
+ (await apiClient({ api: { projectId } }).request({
44327
+ method: "GET",
44328
+ uri: "/cors"
44329
+ })).some(
44330
+ (item) => item.origin === nextjsLocalDevOrigin
44331
+ ) || await apiClient({ api: { projectId } }).request({
44332
+ method: "POST",
44333
+ url: "/cors",
44334
+ body: { origin: nextjsLocalDevOrigin, allowCredentials: !0 },
44335
+ maxRedirects: 0
44336
+ }).then((res) => {
44337
+ print(
44338
+ res.id ? `Added ${nextjsLocalDevOrigin} to CORS origins` : `Failed to add ${nextjsLocalDevOrigin} to CORS origins`
44339
+ );
44340
+ }).catch((error2) => {
44341
+ print(`Failed to add ${nextjsLocalDevOrigin} to CORS origins`, error2);
44342
+ });
44343
+ }
44325
44344
  const { chosen } = await getPackageManagerChoice(workDir, { interactive: !1 });
44326
44345
  trace.log({ step: "selectPackageManager", selectedOption: chosen });
44327
44346
  const packages = ["@sanity/vision@3", "sanity@3", "@sanity/image-url@1", "styled-components@6"];