@nocode-factory/sanity-kit 2.61.1 → 2.62.0-rc.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Journal des versions
2
2
 
3
+ ## 2.62.0 : le bouton de mise à jour du Studio copie la consigne complète pour Claude Code
4
+
5
+ ### Changé
6
+
7
+ - **Bouton « Kit X.Y.Z » de la barre du Studio**, en rouge et gras : « Copy Kit X.Y.Z » copie une
8
+ consigne complète à coller dans Claude Code (mise à jour avec
9
+ `npx -y @nocode-factory/sanity-kit@latest upgrade`, branchements listés, corrections
10
+ signalées par `doctor`, `_type` compris, déploiement du Studio, préprod). Avant, il
11
+ copiait un `npm install` nu, qui n'affiche rien de ce qu'il reste à brancher : la
12
+ nouveauté était installée mais invisible. `upgradePrompt()` et `UPGRADE_COMMAND`
13
+ exportés.
14
+
15
+ ### À brancher dans le projet
16
+
17
+ - Rien.
18
+
3
19
  ## 2.61.1 : retour à la ligne avec Maj + Entrée, recopie des valeurs par défaut fiable
4
20
 
5
21
  ### Corrigé
package/dist/index.d.ts CHANGED
@@ -1243,8 +1243,8 @@ export declare function createPreviewLauncher(config: ResolvedKitConfig, issues:
1243
1243
  *
1244
1244
  * **Il ne met pas à jour.** Un Studio tourne dans un navigateur : il ne peut
1245
1245
  * ni installer un paquet sur le poste d'un développeur, ni se redéployer. Ce
1246
- * bouton dit ce qui manque et donne la commande — prétendre faire plus serait
1247
- * mentir sur ce qui se passe.
1246
+ * bouton dit ce qui manque et copie la consigne complète à donner à Claude Code
1247
+ * (mise à jour, branchements, corrections, déploiement) : une seule action.
1248
1248
  *
1249
1249
  * Invisible tant que le kit est à jour : un bouton permanent qui ne dit rien
1250
1250
  * finit par ne plus être lu.
@@ -1262,9 +1262,18 @@ interface KitUpdate {
1262
1262
  latest: string | null;
1263
1263
  /** Vrai seulement quand une version stable dépasse celle qui s'exécute. */
1264
1264
  available: boolean;
1265
- /** Commande à lancer, prête à copier. */
1265
+ /** Commande de mise à jour (la seule qui affiche ce qu'il reste à brancher). */
1266
1266
  command: string;
1267
+ /**
1268
+ * Consigne complète à coller dans Claude Code : mise à jour, branchements listés,
1269
+ * corrections signalées par doctor (`_type` compris), déploiement du Studio,
1270
+ * préprod. Ce que copie le bouton : une seule action pour l'équipe.
1271
+ */
1272
+ prompt: string;
1267
1273
  }
1274
+ export declare const UPGRADE_COMMAND = "npx -y @nocode-factory/sanity-kit@latest upgrade";
1275
+ /** Consigne copiée par le bouton de mise à jour (testée : test/kit-update.test.ts). */
1276
+ export declare function upgradePrompt(latest: string | null): string;
1268
1277
  /**
1269
1278
  * Compare la version exécutée à la dernière publiée.
1270
1279
  *
@@ -1427,7 +1436,7 @@ export declare function ActorName(props: {
1427
1436
  * quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
1428
1437
  * le vérifie.
1429
1438
  */
1430
- export declare const KIT_VERSION = "2.61.1";
1439
+ export declare const KIT_VERSION = "2.62.0-rc.1";
1431
1440
  /**
1432
1441
  * Données de la page proposées comme colonnes.
1433
1442
  *
package/dist/index.js CHANGED
@@ -1423,7 +1423,7 @@ function explainGrantError(error) {
1423
1423
  * quelle version. Recopiée de `package.json` par `npm version` (scripts/sync-version.mjs) ; un test
1424
1424
  * le vérifie.
1425
1425
  */
1426
- const KIT_VERSION = "2.61.1";
1426
+ const KIT_VERSION = "2.62.0-rc.1";
1427
1427
  /**
1428
1428
  * Signale ce Studio au service du kit, une fois par montage.
1429
1429
  *
@@ -1899,7 +1899,17 @@ function compareVersions(a, b) {
1899
1899
  return 0;
1900
1900
  }
1901
1901
  /** Une version de pré-publication ne se propose pas. */
1902
- const isPrerelease = (version) => version.includes("-");
1902
+ const isPrerelease = (version) => version.includes("-"), PACKAGE = "@nocode-factory/sanity-kit", UPGRADE_COMMAND = `npx -y ${PACKAGE}@latest upgrade`;
1903
+ /** Consigne copiée par le bouton de mise à jour (testée : test/kit-update.test.ts). */
1904
+ function upgradePrompt(latest) {
1905
+ return [
1906
+ `Update the NCF kit (${PACKAGE}) on this project${latest ? ` to ${latest}` : ""}:`,
1907
+ `1. From studio/, run \`${UPGRADE_COMMAND}\` (never a plain npm install: it shows nothing of what is left to do).`,
1908
+ "2. Wire everything it lists under \"À brancher dans le projet\", taking the code from the starter (nocode-factory/sanity-next-starter).",
1909
+ "3. Fix every ✖ reported by `npx ncf-kit doctor` until there are none (list items without _type: `npx ncf-kit item-types`, then `--apply`).",
1910
+ "4. Typecheck and build web/, deploy the Studio (`npm run deploy` in studio/), push a branch to preprod (not main), then tell me in plain words what changed and what to check."
1911
+ ].join("\n");
1912
+ }
1903
1913
  /**
1904
1914
  * Compare la version exécutée à la dernière publiée.
1905
1915
  *
@@ -1921,48 +1931,22 @@ function useKitUpdate() {
1921
1931
  !controller.signal.aborted && body?.version && setLatest(body.version);
1922
1932
  }).catch(() => {}), () => controller.abort();
1923
1933
  }, []);
1924
- let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.61.1") > 0);
1934
+ let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.62.0-rc.1") > 0);
1925
1935
  return {
1926
1936
  current: KIT_VERSION,
1927
1937
  latest,
1928
1938
  available,
1929
- command: `npm install @nocode-factory/sanity-kit@${latest ?? "latest"}`
1939
+ command: UPGRADE_COMMAND,
1940
+ prompt: upgradePrompt(latest)
1930
1941
  };
1931
1942
  }
1932
1943
  /**
1933
- * Jetons partagés par les vues du kit.
1934
- *
1935
- * Mode Operate : la couleur sert l'état et la sélection, jamais la décoration.
1936
- * Les fonds teintés restent sous le seuil où le texte du Studio perd son
1937
- * contraste, dans les deux thèmes.
1938
- */
1939
- /** Teinte de fond d'une ligne ou d'une carte porteuse d'un critère. */
1940
- const TABULAR = { fontVariantNumeric: "tabular-nums" }, MONO = {
1941
- fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
1942
- fontVariantNumeric: "tabular-nums",
1943
- letterSpacing: "-0.01em"
1944
- }, CELL = { minWidth: 0 }, BORDER = "var(--card-border-color, rgba(127,127,127,0.22))", BORDER_SOFT = "var(--card-border-color, rgba(127,127,127,0.12))", OPTION_COLORS = [
1945
- "#f5a623",
1946
- "#43d675",
1947
- "#2276fc",
1948
- "#f03e3e",
1949
- "#a855f7",
1950
- "#8a8a8a"
1951
- ], DIFF = {
1952
- removedLine: "color-mix(in srgb, #f03e3e 9%, transparent)",
1953
- addedLine: "color-mix(in srgb, #2f9e44 11%, transparent)",
1954
- removedWord: "color-mix(in srgb, #f03e3e 26%, transparent)",
1955
- addedWord: "color-mix(in srgb, #2f9e44 30%, transparent)",
1956
- removedMark: "#e03131",
1957
- addedMark: "#2f9e44"
1958
- };
1959
- /**
1960
1944
  * Signale qu'une version plus récente du kit existe.
1961
1945
  *
1962
1946
  * **Il ne met pas à jour.** Un Studio tourne dans un navigateur : il ne peut
1963
1947
  * ni installer un paquet sur le poste d'un développeur, ni se redéployer. Ce
1964
- * bouton dit ce qui manque et donne la commande — prétendre faire plus serait
1965
- * mentir sur ce qui se passe.
1948
+ * bouton dit ce qui manque et copie la consigne complète à donner à Claude Code
1949
+ * (mise à jour, branchements, corrections, déploiement) : une seule action.
1966
1950
  *
1967
1951
  * Invisible tant que le kit est à jour : un bouton permanent qui ne dit rien
1968
1952
  * finit par ne plus être lu.
@@ -1972,7 +1956,7 @@ function NcfKitUpdate(props) {
1972
1956
  if (!update.available) return null;
1973
1957
  let copy = async () => {
1974
1958
  try {
1975
- await navigator.clipboard.writeText(update.command), setCopied(!0);
1959
+ await navigator.clipboard.writeText(update.prompt), setCopied(!0);
1976
1960
  } catch {
1977
1961
  setCopied(!1);
1978
1962
  }
@@ -1981,11 +1965,14 @@ function NcfKitUpdate(props) {
1981
1965
  width: 318,
1982
1966
  trigger: ({ toggle }) => /* @__PURE__ */ jsx(Button, {
1983
1967
  mode: "bleed",
1984
- tone: "primary",
1968
+ tone: "critical",
1985
1969
  fontSize: 1,
1986
1970
  padding: props.inline ? 2 : 3,
1987
1971
  icon: ArrowUpIcon,
1988
- text: `Kit ${update.latest}`,
1972
+ text: /* @__PURE__ */ jsx("span", {
1973
+ style: { fontWeight: 700 },
1974
+ children: `Kit ${update.latest}`
1975
+ }),
1989
1976
  title: `A newer version of the kit is available (you are running ${update.current})`,
1990
1977
  justify: props.inline ? void 0 : "flex-start",
1991
1978
  onClick: toggle
@@ -2014,29 +2001,19 @@ function NcfKitUpdate(props) {
2014
2001
  ]
2015
2002
  })]
2016
2003
  }),
2017
- /* @__PURE__ */ jsx(Card, {
2018
- padding: 2,
2019
- radius: 2,
2020
- style: { border: `1px solid ${BORDER}` },
2021
- children: /* @__PURE__ */ jsx(Text, {
2022
- size: 0,
2023
- style: {
2024
- ...MONO,
2025
- wordBreak: "break-all"
2026
- },
2027
- children: update.command
2028
- })
2029
- }),
2030
2004
  /* @__PURE__ */ jsxs(Flex, {
2031
2005
  gap: 2,
2032
2006
  wrap: "wrap",
2033
2007
  children: [/* @__PURE__ */ jsx(Button, {
2034
2008
  mode: "default",
2035
- tone: "primary",
2009
+ tone: "critical",
2036
2010
  fontSize: 1,
2037
2011
  padding: 2,
2038
2012
  icon: copied ? CheckmarkIcon : CopyIcon,
2039
- text: copied ? "Copied" : "Copy command",
2013
+ text: /* @__PURE__ */ jsx("span", {
2014
+ style: { fontWeight: 700 },
2015
+ children: copied ? "Copied" : `Copy Kit ${update.latest}`
2016
+ }),
2040
2017
  onClick: copy
2041
2018
  }), /* @__PURE__ */ jsx(Button, {
2042
2019
  as: "a",
@@ -2049,25 +2026,10 @@ function NcfKitUpdate(props) {
2049
2026
  text: "What's new"
2050
2027
  })]
2051
2028
  }),
2052
- /* @__PURE__ */ jsx(Box, {
2053
- style: {
2054
- borderTop: `1px solid ${BORDER}`,
2055
- paddingTop: 10
2056
- },
2057
- children: /* @__PURE__ */ jsxs(Text, {
2058
- size: 0,
2059
- muted: !0,
2060
- children: [
2061
- "Run it in ",
2062
- /* @__PURE__ */ jsx("code", { children: "studio/" }),
2063
- " then ",
2064
- /* @__PURE__ */ jsx("code", { children: "web/" }),
2065
- ", followed by",
2066
- " ",
2067
- /* @__PURE__ */ jsx("code", { children: "npx sanity deploy" }),
2068
- ". The Studio cannot do it itself: it runs in your browser, not on the machine that builds it."
2069
- ]
2070
- })
2029
+ /* @__PURE__ */ jsx(Text, {
2030
+ size: 0,
2031
+ muted: !0,
2032
+ children: "Copies the full instructions for Claude Code. Paste them into Claude Code, opened on this project: it updates the kit, wires what the project needs and redeploys the Studio."
2071
2033
  })
2072
2034
  ]
2073
2035
  })
@@ -2526,6 +2488,33 @@ function countByFolder(assets, folders) {
2526
2488
  }
2527
2489
  return counts;
2528
2490
  }
2491
+ /**
2492
+ * Jetons partagés par les vues du kit.
2493
+ *
2494
+ * Mode Operate : la couleur sert l'état et la sélection, jamais la décoration.
2495
+ * Les fonds teintés restent sous le seuil où le texte du Studio perd son
2496
+ * contraste, dans les deux thèmes.
2497
+ */
2498
+ /** Teinte de fond d'une ligne ou d'une carte porteuse d'un critère. */
2499
+ const TABULAR = { fontVariantNumeric: "tabular-nums" }, MONO = {
2500
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
2501
+ fontVariantNumeric: "tabular-nums",
2502
+ letterSpacing: "-0.01em"
2503
+ }, CELL = { minWidth: 0 }, BORDER = "var(--card-border-color, rgba(127,127,127,0.22))", BORDER_SOFT = "var(--card-border-color, rgba(127,127,127,0.12))", OPTION_COLORS = [
2504
+ "#f5a623",
2505
+ "#43d675",
2506
+ "#2276fc",
2507
+ "#f03e3e",
2508
+ "#a855f7",
2509
+ "#8a8a8a"
2510
+ ], DIFF = {
2511
+ removedLine: "color-mix(in srgb, #f03e3e 9%, transparent)",
2512
+ addedLine: "color-mix(in srgb, #2f9e44 11%, transparent)",
2513
+ removedWord: "color-mix(in srgb, #f03e3e 26%, transparent)",
2514
+ addedWord: "color-mix(in srgb, #2f9e44 30%, transparent)",
2515
+ removedMark: "#e03131",
2516
+ addedMark: "#2f9e44"
2517
+ };
2529
2518
  function Row$2(props) {
2530
2519
  return /* @__PURE__ */ jsxs(Flex, {
2531
2520
  align: "center",
@@ -14036,6 +14025,6 @@ function hasLanguageField(schemaType, field) {
14036
14025
  let fields = schemaType?.fields;
14037
14026
  return Array.isArray(fields) && fields.some((f) => f?.name === field);
14038
14027
  }
14039
- export { ANNOTATION_TYPE, ActorName, AssetSourceBrowser, AssetsTool, BOARD_LAYOUT_ID, BOARD_LAYOUT_TYPE, BRAIN_NODE_SIZE, BoardLayoutProvider, COLUMN_TYPE, CONTENT_SCAN_LIMIT, CONTENT_SCAN_LIMIT as OCCURRENCE_SCAN_LIMIT, CUSTOM_ENVIRONMENT_ID, CodeEditorInput, CodeEmbedInput, CollectionTable, DATA_PREFIX, DEFAULT_BOARD_TAGS, DEFAULT_COMPONENT_DEFAULTS_TYPE, DEFAULT_COMPONENT_PREVIEW, DEFAULT_I18N, DEFAULT_INTERNAL_FIELDS, DEFAULT_MORE_TOOLS, DEFAULT_PAGE_BUILDER_FIELD, DEFAULT_SLUG_FIELD, DEFAULT_TITLE_FIELD, HelpTextStyle, KIT_API_VERSION, KIT_VERSION, NCF_ASSETS_TOOL, NCF_COMPONENTS_TOOL, NCF_DESIGN_SYSTEM_TOOL, NCF_HIDDEN_TYPES, NCF_HISTORY_TOOL, NCF_MORE_TOOL, NCF_PAGES_TOOL, NCF_TOOL_NAMES, NODE_FIELD_TYPE, NODE_HEIGHT, NODE_WIDTH, NcfKitUpdate, NcfPreviewHeader, NcfPreviewLauncher, PERSPECTIVES, PROJECTION, SECTION_NODE_TYPE, STATUS_COLORS, STATUS_LABELS, SharePreview, UNSET_LABEL, addColumn, addColumnOption, announce, applySavedPositions, assetName, assetsInFolder, assignmentMap, baseId, blockName, blockTypesFromSchema, buildCollectionQuery, buildCollectionRows, buildContentsQuery, buildLinkGraph, buildPageRows, buildPagesQuery, codeEditorInput, collectLinks, collectOccurrences, colorForRow, colorFromString, columnId, compareVersions, componentDefaultsMainDocument, componentDefaultsMainDocuments, countByFolder, createPreviewLauncher, customEnvironment, defaultNodeSize, defaultsFieldName, defineCodeEmbedType, defineComponentDefaults, depth, deriveCollectionColumns, deriveDocumentColumns, detectPageBuilderField, diffDocuments, diffWords, discoverCollectionTypes, downloadText, editIntentPath, explainGrantError, fallbackLayout, fetchDetail, fetchTimeline, fillTemplate, filterAssets, filterRows as filterCollectionRows, filterRows$1 as filterRows, fixCrossLanguageReferences, flatten, formatBytes, formatDocumentValue, groupComponents, groupMap, groupPageRows, groupValue, hasBlockingIssue, humanizeBlockName, isDraftId, isImageAsset, isKitType, isPrerelease, isSafeColumnKey, isSafeFieldPath, isTextChange, isVersionId, issuesForTool, keyForPath, kitSchemaTypes, layoutGraph, layoutSectionsMap, localesInRows, mergeVersions, missingPageTypes, moveColumn, nameMap, ncfAllowedOrigins, ncfCollectionTable, ncfCollections, ncfKit, ncfMainDocuments, ncfPresentationComponents, ncfPreviewComponents, normalizeInternalPath, normalizePath, occurrencesForTypes, pageThumbnailUrl, pageTypeFor, pageTypesFromSiteRoutes, pageTypesWithoutBuilder, parentPath, presentationPath, pruneSavedPositions, releaseId, removeColumn, renameColumn, requestPreviewGrant, requiredUnlessDefault, requiredUnlessDefaultFor, resolveColorBy, resolveConfig, resolvePageBuilderField, sectionNamesFromDefaults, segments, slugKey, sortAssets, sortRows as sortCollectionRows, sortRows$1 as sortRows, summarize, thumbnailUrl, titleColumn, toCsv, toKebabCase, toPath, toUrl, topLevelBlockCount, uniqueColumnId, upsertLayout, urlOn, useAnnotations, useAssetMeta, useAssetUpload, useAssets, useBoardLayout, useCollection, useComponentNames, useDocumentColumns, useHistory, useInternalColumns, useKitClient, useKitConfig, useKitContext, useKitUpdate, useOccurrences, useOptionalKitConfig, useOptionalKitContext, usePageBuilder, usePageContents, usePages, usePreviewTarget, useRegistration, validateConfig, withAlpha, withCustomNames, withMoreTool, withSameLanguageReferences };
14028
+ export { ANNOTATION_TYPE, ActorName, AssetSourceBrowser, AssetsTool, BOARD_LAYOUT_ID, BOARD_LAYOUT_TYPE, BRAIN_NODE_SIZE, BoardLayoutProvider, COLUMN_TYPE, CONTENT_SCAN_LIMIT, CONTENT_SCAN_LIMIT as OCCURRENCE_SCAN_LIMIT, CUSTOM_ENVIRONMENT_ID, CodeEditorInput, CodeEmbedInput, CollectionTable, DATA_PREFIX, DEFAULT_BOARD_TAGS, DEFAULT_COMPONENT_DEFAULTS_TYPE, DEFAULT_COMPONENT_PREVIEW, DEFAULT_I18N, DEFAULT_INTERNAL_FIELDS, DEFAULT_MORE_TOOLS, DEFAULT_PAGE_BUILDER_FIELD, DEFAULT_SLUG_FIELD, DEFAULT_TITLE_FIELD, HelpTextStyle, KIT_API_VERSION, KIT_VERSION, NCF_ASSETS_TOOL, NCF_COMPONENTS_TOOL, NCF_DESIGN_SYSTEM_TOOL, NCF_HIDDEN_TYPES, NCF_HISTORY_TOOL, NCF_MORE_TOOL, NCF_PAGES_TOOL, NCF_TOOL_NAMES, NODE_FIELD_TYPE, NODE_HEIGHT, NODE_WIDTH, NcfKitUpdate, NcfPreviewHeader, NcfPreviewLauncher, PERSPECTIVES, PROJECTION, SECTION_NODE_TYPE, STATUS_COLORS, STATUS_LABELS, SharePreview, UNSET_LABEL, UPGRADE_COMMAND, addColumn, addColumnOption, announce, applySavedPositions, assetName, assetsInFolder, assignmentMap, baseId, blockName, blockTypesFromSchema, buildCollectionQuery, buildCollectionRows, buildContentsQuery, buildLinkGraph, buildPageRows, buildPagesQuery, codeEditorInput, collectLinks, collectOccurrences, colorForRow, colorFromString, columnId, compareVersions, componentDefaultsMainDocument, componentDefaultsMainDocuments, countByFolder, createPreviewLauncher, customEnvironment, defaultNodeSize, defaultsFieldName, defineCodeEmbedType, defineComponentDefaults, depth, deriveCollectionColumns, deriveDocumentColumns, detectPageBuilderField, diffDocuments, diffWords, discoverCollectionTypes, downloadText, editIntentPath, explainGrantError, fallbackLayout, fetchDetail, fetchTimeline, fillTemplate, filterAssets, filterRows as filterCollectionRows, filterRows$1 as filterRows, fixCrossLanguageReferences, flatten, formatBytes, formatDocumentValue, groupComponents, groupMap, groupPageRows, groupValue, hasBlockingIssue, humanizeBlockName, isDraftId, isImageAsset, isKitType, isPrerelease, isSafeColumnKey, isSafeFieldPath, isTextChange, isVersionId, issuesForTool, keyForPath, kitSchemaTypes, layoutGraph, layoutSectionsMap, localesInRows, mergeVersions, missingPageTypes, moveColumn, nameMap, ncfAllowedOrigins, ncfCollectionTable, ncfCollections, ncfKit, ncfMainDocuments, ncfPresentationComponents, ncfPreviewComponents, normalizeInternalPath, normalizePath, occurrencesForTypes, pageThumbnailUrl, pageTypeFor, pageTypesFromSiteRoutes, pageTypesWithoutBuilder, parentPath, presentationPath, pruneSavedPositions, releaseId, removeColumn, renameColumn, requestPreviewGrant, requiredUnlessDefault, requiredUnlessDefaultFor, resolveColorBy, resolveConfig, resolvePageBuilderField, sectionNamesFromDefaults, segments, slugKey, sortAssets, sortRows as sortCollectionRows, sortRows$1 as sortRows, summarize, thumbnailUrl, titleColumn, toCsv, toKebabCase, toPath, toUrl, topLevelBlockCount, uniqueColumnId, upgradePrompt, upsertLayout, urlOn, useAnnotations, useAssetMeta, useAssetUpload, useAssets, useBoardLayout, useCollection, useComponentNames, useDocumentColumns, useHistory, useInternalColumns, useKitClient, useKitConfig, useKitContext, useKitUpdate, useOccurrences, useOptionalKitConfig, useOptionalKitContext, usePageBuilder, usePageContents, usePages, usePreviewTarget, useRegistration, validateConfig, withAlpha, withCustomNames, withMoreTool, withSameLanguageReferences };
14040
14029
 
14041
14030
  //# sourceMappingURL=index.js.map