@sanity/cli 3.66.2-upgrade-vite-v6.23 → 3.67.1-next.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.
- package/lib/_chunks-cjs/cli.js +12 -15
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +9 -9
- package/src/actions/init-project/bootstrapLocalTemplate.ts +2 -2
- package/src/actions/init-project/bootstrapRemoteTemplate.ts +12 -6
- package/src/studioDependencies.ts +1 -1
- package/src/util/remoteTemplate.ts +0 -10
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -26995,14 +26995,6 @@ async function validateRemoteTemplate(repoInfo, packages = [""], bearerToken) {
|
|
26995
26995
|
)}`
|
26996
26996
|
);
|
26997
26997
|
}
|
26998
|
-
async function isNextJsTemplate(root2) {
|
26999
|
-
try {
|
27000
|
-
const packageJson = await fs.readFile(path$3.join(root2, "package.json"), "utf8"), pkg = JSON.parse(packageJson);
|
27001
|
-
return !!(pkg.dependencies?.next || pkg.devDependencies?.next);
|
27002
|
-
} catch {
|
27003
|
-
return !1;
|
27004
|
-
}
|
27005
|
-
}
|
27006
26998
|
async function checkNeedsReadToken(root2) {
|
27007
26999
|
try {
|
27008
27000
|
const templatePath = await Promise.any(
|
@@ -27403,7 +27395,7 @@ const studioDependencies = {
|
|
27403
27395
|
"@sanity/eslint-config-studio": "latest",
|
27404
27396
|
// When using typescript, we'll want the these types too, so might as well install them
|
27405
27397
|
"@types/react": "^18.0.25",
|
27406
|
-
eslint: "^
|
27398
|
+
eslint: "^9.9.0",
|
27407
27399
|
prettier: "^3.0.2",
|
27408
27400
|
typescript: "^5.1.6"
|
27409
27401
|
// Peer dependency of eslint-config-studio (implicitly)
|
@@ -47203,8 +47195,10 @@ async function bootstrapLocalTemplate(opts, context) {
|
|
47203
47195
|
writeFileIfNotExists(`sanity.cli.${codeExt}`, cliConfig),
|
47204
47196
|
writeFileIfNotExists("package.json", packageManifest),
|
47205
47197
|
writeFileIfNotExists(
|
47206
|
-
".
|
47207
|
-
|
47198
|
+
"eslint.config.mjs",
|
47199
|
+
`import studio from '@sanity/eslint-config-studio'
|
47200
|
+
|
47201
|
+
export default [...studio]
|
47208
47202
|
`
|
47209
47203
|
)
|
47210
47204
|
]), loadEnv.debug("Updating initial template metadata"), await updateInitialTemplateMetadata(apiClient, variables.projectId, `cli-${templateName}`), spinner.succeed(), template;
|
@@ -52097,10 +52091,13 @@ async function bootstrapRemoteTemplate(opts, context) {
|
|
52097
52091
|
(packages ?? [""]).map((pkg) => checkNeedsReadToken(path$3.join(outputPath, pkg)))
|
52098
52092
|
).then((results) => results.some(Boolean));
|
52099
52093
|
loadEnv.debug("Applying environment variables");
|
52100
|
-
const readToken = needsReadToken ? await generateSanityApiReadToken("API Read Token", variables.projectId, apiClient) : void 0
|
52101
|
-
for (const
|
52102
|
-
const
|
52103
|
-
|
52094
|
+
const readToken = needsReadToken ? await generateSanityApiReadToken("API Read Token", variables.projectId, apiClient) : void 0;
|
52095
|
+
for (const pkg of packages ?? [""]) {
|
52096
|
+
const packagePath = path$3.join(outputPath, pkg), envName = (await distExports.detectFrameworkRecord({
|
52097
|
+
fs: new distExports.LocalFileSystemDetector(packagePath),
|
52098
|
+
frameworkList: frameworksExports.frameworks
|
52099
|
+
}))?.slug === "nextjs" ? ".env.local" : ".env";
|
52100
|
+
await applyEnvVariables(packagePath, { ...variables, readToken }, envName);
|
52104
52101
|
}
|
52105
52102
|
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();
|
52106
52103
|
}
|