@sanity/cli 3.91.1-next.3.8e8a224f4d → 3.91.1-next.30.97cd5c79a3
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 +23 -14
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +8 -8
- package/src/actions/init-project/initProject.ts +19 -10
- package/src/actions/init-project/templates/appQuickstart.ts +1 -1
- package/src/actions/init-project/templates/appSanityUi.ts +1 -1
- package/src/studioDependencies.ts +7 -7
package/lib/_chunks-cjs/cli.js
CHANGED
@@ -27797,18 +27797,18 @@ const studioDependencies = {
|
|
27797
27797
|
// Official studio plugin dependencies
|
27798
27798
|
"@sanity/vision": "latest",
|
27799
27799
|
// Non-Sanity dependencies
|
27800
|
-
react: "^
|
27801
|
-
"react-dom": "^
|
27802
|
-
"styled-components": "^6.1.
|
27800
|
+
react: "^19.1",
|
27801
|
+
"react-dom": "^19.1",
|
27802
|
+
"styled-components": "^6.1.18"
|
27803
27803
|
},
|
27804
27804
|
devDependencies: {
|
27805
27805
|
// Linting/tooling
|
27806
27806
|
"@sanity/eslint-config-studio": "latest",
|
27807
27807
|
// When using typescript, we'll want the these types too, so might as well install them
|
27808
|
-
"@types/react": "^
|
27809
|
-
eslint: "^9.
|
27810
|
-
prettier: "^3.
|
27811
|
-
typescript: "^5.
|
27808
|
+
"@types/react": "^19.1",
|
27809
|
+
eslint: "^9.28",
|
27810
|
+
prettier: "^3.5",
|
27811
|
+
typescript: "^5.8"
|
27812
27812
|
// Peer dependency of eslint-config-studio (implicitly)
|
27813
27813
|
}
|
27814
27814
|
};
|
@@ -47588,7 +47588,7 @@ const appTemplate = {
|
|
47588
47588
|
"react-dom": "^19"
|
47589
47589
|
},
|
47590
47590
|
devDependencies: {
|
47591
|
-
"@types/react": "^
|
47591
|
+
"@types/react": "^19",
|
47592
47592
|
sanity: "^3",
|
47593
47593
|
typescript: "^5.1.6"
|
47594
47594
|
},
|
@@ -47608,7 +47608,7 @@ const appTemplate = {
|
|
47608
47608
|
"styled-components": "^6.1.17"
|
47609
47609
|
},
|
47610
47610
|
devDependencies: {
|
47611
|
-
"@types/react": "^
|
47611
|
+
"@types/react": "^19",
|
47612
47612
|
sanity: "^3",
|
47613
47613
|
typescript: "^5.1.6"
|
47614
47614
|
},
|
@@ -53812,7 +53812,7 @@ ${err.message}`);
|
|
53812
53812
|
});
|
53813
53813
|
return createProject(apiClient, {
|
53814
53814
|
displayName: projectName,
|
53815
|
-
organizationId: await getOrganizationId(organizations),
|
53815
|
+
organizationId: cliFlags.organization || await getOrganizationId(organizations),
|
53816
53816
|
subscription: selectedPlan ? { planId: selectedPlan } : void 0,
|
53817
53817
|
metadata: { coupon: intendedCoupon }
|
53818
53818
|
}).then((response) => ({
|
@@ -53841,7 +53841,7 @@ ${err.message}`);
|
|
53841
53841
|
message: "Your project name:",
|
53842
53842
|
default: "My Sanity Project"
|
53843
53843
|
}),
|
53844
|
-
organizationId: await getOrganizationId(organizations),
|
53844
|
+
organizationId: cliFlags.organization || await getOrganizationId(organizations),
|
53845
53845
|
subscription: selectedPlan ? { planId: selectedPlan } : void 0,
|
53846
53846
|
metadata: { coupon: intendedCoupon }
|
53847
53847
|
}).then((response) => ({
|
@@ -54025,12 +54025,23 @@ The default dataset configuration has a public dataset named "production".`;
|
|
54025
54025
|
throw new Error(
|
54026
54026
|
"`--project <id>` or `--create-project <name>` must be specified in unattended mode"
|
54027
54027
|
);
|
54028
|
+
if (createProjectName && !cliFlags.organization)
|
54029
|
+
throw new Error(
|
54030
|
+
"--create-project is not supported in unattended mode without an organization, please specify an organization with `--organization <id>`"
|
54031
|
+
);
|
54028
54032
|
}
|
54029
54033
|
if (createProjectName) {
|
54030
54034
|
loadEnv.debug("--create-project specified, creating a new project");
|
54035
|
+
let orgForCreateProjectFlag = cliFlags.organization;
|
54036
|
+
if (!orgForCreateProjectFlag) {
|
54037
|
+
loadEnv.debug("no organization specified, selecting one");
|
54038
|
+
const organizations = await apiClient({ requireUser: !0, requireProject: !1 }).request({ uri: "/organizations" });
|
54039
|
+
orgForCreateProjectFlag = await getOrganizationId(organizations);
|
54040
|
+
}
|
54041
|
+
loadEnv.debug("creating a new project");
|
54031
54042
|
const createdProject = await createProject(apiClient, {
|
54032
54043
|
displayName: createProjectName.trim(),
|
54033
|
-
organizationId:
|
54044
|
+
organizationId: orgForCreateProjectFlag,
|
54034
54045
|
subscription: selectedPlan ? { planId: selectedPlan } : void 0,
|
54035
54046
|
metadata: { coupon: intendedCoupon }
|
54036
54047
|
});
|
@@ -54077,8 +54088,6 @@ The default dataset configuration has a public dataset named "production".`;
|
|
54077
54088
|
return chosenOrg === "-new-" ? createOrganization().then((org) => org.id) : chosenOrg || void 0;
|
54078
54089
|
}
|
54079
54090
|
async function getOrganizationId(organizations) {
|
54080
|
-
if (unattended || flags.organization)
|
54081
|
-
return flags.organization || void 0;
|
54082
54091
|
if (organizations.length === 0)
|
54083
54092
|
return createOrganization().then((org) => org.id);
|
54084
54093
|
loadEnv.debug(`User has ${organizations.length} organization(s), checking attach access`);
|