@sanity/cli 3.68.4-export-comments.33 → 3.69.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/lib/_chunks-cjs/cli.js +21 -20
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/workers/getCliConfig.js.map +1 -1
- package/package.json +9 -9
- package/src/actions/init-project/bootstrapRemoteTemplate.ts +16 -4
- package/src/actions/init-project/initProject.ts +1 -1
- package/src/util/remoteTemplate.ts +1 -1
- package/bin/xdg-open +0 -1066
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -1433,7 +1433,7 @@ function requireLodash() {
|
|
1433
1433
|
if (isSymbol(value))
|
1434
1434
|
return symbolToString ? symbolToString.call(value) : "";
|
1435
1435
|
var result2 = value + "";
|
1436
|
-
return result2 == "0" && 1 / value == -
|
1436
|
+
return result2 == "0" && 1 / value == -1 / 0 ? "-0" : result2;
|
1437
1437
|
}
|
1438
1438
|
function baseUniq(array, iteratee2, comparator) {
|
1439
1439
|
var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = !0, result2 = [], seen = result2;
|
@@ -1824,7 +1824,7 @@ function requireLodash() {
|
|
1824
1824
|
}
|
1825
1825
|
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
|
1826
1826
|
var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined$1, newHoldersRight = isCurry ? undefined$1 : holders, newPartials = isCurry ? partials : undefined$1, newPartialsRight = isCurry ? undefined$1 : partials;
|
1827
|
-
bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG, bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG), bitmask & WRAP_CURRY_BOUND_FLAG || (bitmask &=
|
1827
|
+
bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG, bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG), bitmask & WRAP_CURRY_BOUND_FLAG || (bitmask &= -4);
|
1828
1828
|
var newData = [
|
1829
1829
|
func,
|
1830
1830
|
bitmask,
|
@@ -1863,7 +1863,7 @@ function requireLodash() {
|
|
1863
1863
|
if (!isBindKey && typeof func != "function")
|
1864
1864
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
1865
1865
|
var length = partials ? partials.length : 0;
|
1866
|
-
if (length || (bitmask &=
|
1866
|
+
if (length || (bitmask &= -97, partials = holders = undefined$1), ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0), arity = arity === undefined$1 ? arity : toInteger(arity), length -= holders ? holders.length : 0, bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
|
1867
1867
|
var partialsRight = partials, holdersRight = holders;
|
1868
1868
|
partials = holders = undefined$1;
|
1869
1869
|
}
|
@@ -1879,7 +1879,7 @@ function requireLodash() {
|
|
1879
1879
|
ary2,
|
1880
1880
|
arity
|
1881
1881
|
];
|
1882
|
-
if (data && mergeData(newData, data), func = newData[0], bitmask = newData[1], thisArg = newData[2], partials = newData[3], holders = newData[4], arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0), !arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG) && (bitmask &=
|
1882
|
+
if (data && mergeData(newData, data), func = newData[0], bitmask = newData[1], thisArg = newData[2], partials = newData[3], holders = newData[4], arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0), !arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG) && (bitmask &= -25), !bitmask || bitmask == WRAP_BIND_FLAG)
|
1883
1883
|
var result2 = createBind(func, bitmask, thisArg);
|
1884
1884
|
else bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG ? result2 = createCurry(func, bitmask, arity) : (bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length ? result2 = createPartial(func, bitmask, thisArg, partials) : result2 = createHybrid.apply(undefined$1, newData);
|
1885
1885
|
var setter = data ? baseSetData : setData;
|
@@ -2292,7 +2292,7 @@ function requireLodash() {
|
|
2292
2292
|
if (typeof value == "string" || isSymbol(value))
|
2293
2293
|
return value;
|
2294
2294
|
var result2 = value + "";
|
2295
|
-
return result2 == "0" && 1 / value == -
|
2295
|
+
return result2 == "0" && 1 / value == -1 / 0 ? "-0" : result2;
|
2296
2296
|
}
|
2297
2297
|
function toSource(func) {
|
2298
2298
|
if (func != null) {
|
@@ -3060,7 +3060,7 @@ function requireLodash() {
|
|
3060
3060
|
}
|
3061
3061
|
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
|
3062
3062
|
function isSafeInteger(value) {
|
3063
|
-
return isInteger2(value) && value >= -
|
3063
|
+
return isInteger2(value) && value >= -9007199254740991 && value <= MAX_SAFE_INTEGER;
|
3064
3064
|
}
|
3065
3065
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
3066
3066
|
function isString(value) {
|
@@ -3095,7 +3095,7 @@ function requireLodash() {
|
|
3095
3095
|
function toFinite(value) {
|
3096
3096
|
if (!value)
|
3097
3097
|
return value === 0 ? value : 0;
|
3098
|
-
if (value = toNumber(value), value === INFINITY || value === -
|
3098
|
+
if (value = toNumber(value), value === INFINITY || value === -1 / 0) {
|
3099
3099
|
var sign2 = value < 0 ? -1 : 1;
|
3100
3100
|
return sign2 * MAX_INTEGER;
|
3101
3101
|
}
|
@@ -3127,7 +3127,7 @@ function requireLodash() {
|
|
3127
3127
|
return copyObject(value, keysIn(value));
|
3128
3128
|
}
|
3129
3129
|
function toSafeInteger(value) {
|
3130
|
-
return value ? baseClamp(toInteger(value), -
|
3130
|
+
return value ? baseClamp(toInteger(value), -9007199254740991, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
|
3131
3131
|
}
|
3132
3132
|
function toString(value) {
|
3133
3133
|
return value == null ? "" : baseToString(value);
|
@@ -26753,7 +26753,8 @@ async function setCorsOrigin(origin, projectId, apiClient) {
|
|
26753
26753
|
await apiClient({ api: { projectId } }).request({
|
26754
26754
|
method: "POST",
|
26755
26755
|
url: "/cors",
|
26756
|
-
body: { origin, allowCredentials: !
|
26756
|
+
body: { origin, allowCredentials: !0 }
|
26757
|
+
// allowCredentials is true to allow for embedded studios if needed
|
26757
26758
|
});
|
26758
26759
|
} catch (error2) {
|
26759
26760
|
loadEnv.debug("Failed to set CORS origin", error2);
|
@@ -33239,14 +33240,14 @@ function requireEsprima$1() {
|
|
33239
33240
|
return !1;
|
33240
33241
|
}, Parser2.prototype.parseGetterMethod = function() {
|
33241
33242
|
var node = this.createNode(), isGenerator = !1, previousAllowYield = this.context.allowYield;
|
33242
|
-
this.context.allowYield = !
|
33243
|
+
this.context.allowYield = !0;
|
33243
33244
|
var formalParameters = this.parseFormalParameters();
|
33244
33245
|
formalParameters.params.length > 0 && this.tolerateError(messages_1.Messages.BadGetterArity);
|
33245
33246
|
var method = this.parsePropertyMethod(formalParameters);
|
33246
33247
|
return this.context.allowYield = previousAllowYield, this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
|
33247
33248
|
}, Parser2.prototype.parseSetterMethod = function() {
|
33248
33249
|
var node = this.createNode(), isGenerator = !1, previousAllowYield = this.context.allowYield;
|
33249
|
-
this.context.allowYield = !
|
33250
|
+
this.context.allowYield = !0;
|
33250
33251
|
var formalParameters = this.parseFormalParameters();
|
33251
33252
|
formalParameters.params.length !== 1 ? this.tolerateError(messages_1.Messages.BadSetterArity) : formalParameters.params[0] instanceof Node.RestElement && this.tolerateError(messages_1.Messages.BadSetterRestParameter);
|
33252
33253
|
var method = this.parsePropertyMethod(formalParameters);
|
@@ -47326,7 +47327,7 @@ class AST {
|
|
47326
47327
|
const s = this.toString();
|
47327
47328
|
return this.#parts = [s], this.type = null, this.#hasMagic = void 0, [s, unescape(this.toString()), !1, !1];
|
47328
47329
|
}
|
47329
|
-
let bodyDotAllowed = !repeated || allowDot || dot
|
47330
|
+
let bodyDotAllowed = !repeated || allowDot || dot ? "" : this.#partsToRegExp(!0);
|
47330
47331
|
bodyDotAllowed === body && (bodyDotAllowed = ""), bodyDotAllowed && (body = `(?:${body})(?:${bodyDotAllowed})*?`);
|
47331
47332
|
let final = "";
|
47332
47333
|
if (this.type === "!" && this.#emptyExt)
|
@@ -49304,7 +49305,7 @@ const realpathSync = require$$0$5.realpathSync.native, defaultFS = {
|
|
49304
49305
|
...defaultFS.promises,
|
49305
49306
|
...fsOption.promises || {}
|
49306
49307
|
}
|
49307
|
-
}, uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i, uncToDrive = (rootPath) => rootPath.replace(/\//g, "\\").replace(uncDriveRegexp, "$1\\"), eitherSep = /[\\\/]/, UNKNOWN = 0, IFIFO = 1, IFCHR = 2, IFDIR = 4, IFBLK = 6, IFREG = 8, IFLNK = 10, IFSOCK = 12, IFMT = 15, IFMT_UNKNOWN =
|
49308
|
+
}, uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i, uncToDrive = (rootPath) => rootPath.replace(/\//g, "\\").replace(uncDriveRegexp, "$1\\"), eitherSep = /[\\\/]/, UNKNOWN = 0, IFIFO = 1, IFCHR = 2, IFDIR = 4, IFBLK = 6, IFREG = 8, IFLNK = 10, IFSOCK = 12, IFMT = 15, IFMT_UNKNOWN = -16, READDIR_CALLED = 16, LSTAT_CALLED = 32, ENOTDIR = 64, ENOENT = 128, ENOREADLINK = 256, ENOREALPATH = 512, ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH, TYPEMASK = 1023, entToType = (s) => s.isFile() ? IFREG : s.isDirectory() ? IFDIR : s.isSymbolicLink() ? IFLNK : s.isCharacterDevice() ? IFCHR : s.isBlockDevice() ? IFBLK : s.isSocket() ? IFSOCK : s.isFIFO() ? IFIFO : UNKNOWN, normalizeCache = /* @__PURE__ */ new Map(), normalize = (s) => {
|
49308
49309
|
const c2 = normalizeCache.get(s);
|
49309
49310
|
if (c2)
|
49310
49311
|
return c2;
|
@@ -49523,7 +49524,7 @@ class PathBase {
|
|
49523
49524
|
if (cached)
|
49524
49525
|
return cached;
|
49525
49526
|
const children = Object.assign([], { provisional: 0 });
|
49526
|
-
return this.#children.set(this, children), this.#type &=
|
49527
|
+
return this.#children.set(this, children), this.#type &= -17, children;
|
49527
49528
|
}
|
49528
49529
|
/**
|
49529
49530
|
* Resolves a path portion and returns or creates the child Path.
|
@@ -51835,11 +51836,11 @@ function isInMercurialRepository(rootDir) {
|
|
51835
51836
|
}
|
51836
51837
|
return !1;
|
51837
51838
|
}
|
51838
|
-
const INITIAL_COMMIT_MESSAGE = "Initial commit from Sanity CLI";
|
51839
|
+
const SANITY_DEFAULT_PORT = 3333, READ_TOKEN_LABEL = "Live Preview API", INITIAL_COMMIT_MESSAGE = "Initial commit from Sanity CLI";
|
51839
51840
|
async function bootstrapRemoteTemplate(opts, context) {
|
51840
51841
|
const { outputPath, repoInfo, bearerToken, variables, packageName } = opts, { output, apiClient } = context, name = [repoInfo.username, repoInfo.name, repoInfo.filePath].filter(Boolean).join("/"), contentsUrl = getGitHubRawContentUrl(repoInfo), headers = {};
|
51841
51842
|
bearerToken && (headers.Authorization = `Bearer ${bearerToken}`);
|
51842
|
-
const spinner = output.spinner(`Bootstrapping files from template "${name}"`).start();
|
51843
|
+
const spinner = output.spinner(`Bootstrapping files from template "${name}"`).start(), corsAdded = [SANITY_DEFAULT_PORT];
|
51843
51844
|
loadEnv.debug("Validating remote template");
|
51844
51845
|
const fileReader = new templateValidator.GitHubFileReader(contentsUrl, headers), packages = await templateValidator.getMonoRepo(fileReader), validation = await templateValidator.validateTemplate(fileReader, packages);
|
51845
51846
|
if (!validation.isValid)
|
@@ -51850,17 +51851,17 @@ async function bootstrapRemoteTemplate(opts, context) {
|
|
51850
51851
|
(packages ?? [""]).map((pkg) => checkNeedsReadToken(path$3.join(outputPath, pkg)))
|
51851
51852
|
).then((results) => results.some(Boolean));
|
51852
51853
|
loadEnv.debug("Applying environment variables");
|
51853
|
-
const readToken = needsReadToken ? await generateSanityApiReadToken(
|
51854
|
+
const readToken = needsReadToken ? await generateSanityApiReadToken(READ_TOKEN_LABEL, variables.projectId, apiClient) : void 0;
|
51854
51855
|
for (const pkg of packages ?? [""]) {
|
51855
51856
|
const packagePath = path$3.join(outputPath, pkg), packageFramework = await distExports.detectFrameworkRecord({
|
51856
51857
|
fs: new distExports.LocalFileSystemDetector(packagePath),
|
51857
51858
|
frameworkList: frameworksExports.frameworks
|
51858
51859
|
}), port = getDefaultPortForFramework(packageFramework?.slug);
|
51859
|
-
loadEnv.debug("Setting CORS origin to http://localhost:%d", port), await setCorsOrigin(`http://localhost:${port}`, variables.projectId, apiClient), loadEnv.debug("Applying environment variables to %s", pkg);
|
51860
|
+
corsAdded.includes(port) === !1 && (loadEnv.debug("Setting CORS origin to http://localhost:%d", port), await setCorsOrigin(`http://localhost:${port}`, variables.projectId, apiClient), corsAdded.push(port)), loadEnv.debug("Applying environment variables to %s", pkg);
|
51860
51861
|
const envName = packageFramework?.slug === "nextjs" ? ".env.local" : ".env";
|
51861
51862
|
await applyEnvVariables(packagePath, { ...variables, readToken }, envName);
|
51862
51863
|
}
|
51863
|
-
loadEnv.debug("Setting package name to %s", packageName), await tryApplyPackageName(outputPath, packageName), loadEnv.debug("Initializing git repository"), tryGitInit(outputPath, INITIAL_COMMIT_MESSAGE), loadEnv.debug("Updating initial template metadata"), await updateInitialTemplateMetadata(apiClient, variables.projectId, `external-${name}`), spinner.succeed();
|
51864
|
+
loadEnv.debug("Setting package name to %s", packageName), await tryApplyPackageName(outputPath, packageName), loadEnv.debug("Initializing git repository"), tryGitInit(outputPath, INITIAL_COMMIT_MESSAGE), loadEnv.debug("Updating initial template metadata"), await updateInitialTemplateMetadata(apiClient, variables.projectId, `external-${name}`), spinner.succeed(), corsAdded.length && output.success(`CORS origins added (${corsAdded.map((p) => `localhost:${p}`).join(", ")})`), readToken && output.success(`API token generated (${READ_TOKEN_LABEL})`);
|
51864
51865
|
}
|
51865
51866
|
function validateEmptyPath(dir) {
|
51866
51867
|
const checkPath = absolutify(dir);
|
@@ -52832,7 +52833,7 @@ ${err.message}`);
|
|
52832
52833
|
loadEnv.debug(`User has ${projects.length} project(s) already, showing list of choices`);
|
52833
52834
|
const projectChoices = projects.map((project) => ({
|
52834
52835
|
value: project.id,
|
52835
|
-
name: `${project.displayName}
|
52836
|
+
name: `${project.displayName} (${project.id})`
|
52836
52837
|
})), selected = await prompt2.single({
|
52837
52838
|
message: "Create a new project or select an existing one",
|
52838
52839
|
type: "list",
|