@sanity/cli 3.44.1-mmm-canary.137 → 3.45.1-mmm-canary.139

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.
@@ -44422,7 +44422,13 @@ ${chalk2.green("Success!")} Your Sanity configuration files has been added to th
44422
44422
  projectName: displayName || answers.projectName
44423
44423
  }
44424
44424
  }, shouldImport = !unattended && template.datasetUrl && await promptForDatasetImport(template.importPrompt);
44425
- trace.log({ step: "importTemplateDataset", selectedOption: shouldImport ? "yes" : "no" }), await bootstrapTemplate(templateOptions, context);
44425
+ trace.log({ step: "importTemplateDataset", selectedOption: shouldImport ? "yes" : "no" }), await bootstrapTemplate(templateOptions, context), apiClient({ api: { projectId } }).request({ uri: `/projects/${projectId}` }).then((project) => project?.metadata?.cliInitializedAt ? Promise.resolve() : apiClient({ api: { projectId } }).request({
44426
+ method: "PATCH",
44427
+ uri: `/projects/${projectId}`,
44428
+ body: { metadata: { cliInitializedAt: (/* @__PURE__ */ new Date()).toISOString() } }
44429
+ })).catch(() => {
44430
+ loadEnv.debug("Failed to update cliInitializedAt metadata");
44431
+ });
44426
44432
  let pkgManager;
44427
44433
  if (packageManager && ALLOWED_PACKAGE_MANAGERS.includes(packageManager) ? pkgManager = packageManager : (pkgManager = (await getPackageManagerChoice(outputPath, {
44428
44434
  prompt: prompt2,
@@ -44457,15 +44463,6 @@ ${chalk2.green("Success!")} Now, use this command to continue:
44457
44463
  ${chalk2.green("Success!")} Now, use these commands to continue:
44458
44464
  `), print(`First: ${chalk2.cyan(`cd ${outputPath}`)} - to enter project\u2019s directory`), print(`Then: ${chalk2.cyan(devCommand)} - to run Sanity Studio
44459
44465
  `)), await hasGlobalCli() && (print("Other helpful commands"), print("sanity docs - to open the documentation in a browser"), print("sanity manage - to open the project settings in a browser"), print("sanity help - to explore the CLI manual"));
44460
- try {
44461
- (await apiClient({ api: { projectId } }).request({ uri: `/projects/${projectId}` }))?.metadata?.cliInitializedAt || await apiClient({ api: { projectId } }).request({
44462
- method: "PATCH",
44463
- uri: `/projects/${projectId}`,
44464
- body: { metadata: { cliInitializedAt: (/* @__PURE__ */ new Date()).toISOString() } }
44465
- });
44466
- } catch {
44467
- loadEnv.debug("Failed to update cliInitializedAt metadata");
44468
- }
44469
44466
  const sendInvite = isFirstProject && await prompt2.single({
44470
44467
  type: "confirm",
44471
44468
  message: "We have an excellent developer community, would you like us to send you an invitation to join?",
@@ -44570,7 +44567,7 @@ ${err.message}`);
44570
44567
  displayName: projectName,
44571
44568
  organizationId: await getOrganizationId(organizations),
44572
44569
  subscription: selectedPlan ? { planId: selectedPlan } : void 0,
44573
- metadata: { coupon: intendedCoupon }
44570
+ metadata: { coupon: intendedCoupon, integration: "cli" }
44574
44571
  }).then((response) => ({
44575
44572
  ...response,
44576
44573
  isFirstProject: isUsersFirstProject,