@nocode-factory/sanity-kit 2.61.1-rc.2 → 2.62.0-rc.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/CHANGELOG.md +16 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.js +37 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useKitUpdate.ts +22 -2
- package/src/index.ts +1 -1
- package/src/tools/navbar/KitUpdate.tsx +14 -12
- package/src/version.ts +1 -1
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
|
|
1247
|
-
*
|
|
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 à
|
|
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.
|
|
1439
|
+
export declare const KIT_VERSION = "2.62.0-rc.0";
|
|
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.
|
|
1426
|
+
const KIT_VERSION = "2.62.0-rc.0";
|
|
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,12 +1931,13 @@ 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.
|
|
1934
|
+
let available = !!(latest && !isPrerelease(latest) && compareVersions(latest, "2.62.0-rc.0") > 0);
|
|
1925
1935
|
return {
|
|
1926
1936
|
current: KIT_VERSION,
|
|
1927
1937
|
latest,
|
|
1928
1938
|
available,
|
|
1929
|
-
command:
|
|
1939
|
+
command: UPGRADE_COMMAND,
|
|
1940
|
+
prompt: upgradePrompt(latest)
|
|
1930
1941
|
};
|
|
1931
1942
|
}
|
|
1932
1943
|
/**
|
|
@@ -1961,8 +1972,8 @@ const TABULAR = { fontVariantNumeric: "tabular-nums" }, MONO = {
|
|
|
1961
1972
|
*
|
|
1962
1973
|
* **Il ne met pas à jour.** Un Studio tourne dans un navigateur : il ne peut
|
|
1963
1974
|
* ni installer un paquet sur le poste d'un développeur, ni se redéployer. Ce
|
|
1964
|
-
* bouton dit ce qui manque et
|
|
1965
|
-
*
|
|
1975
|
+
* bouton dit ce qui manque et copie la consigne complète à donner à Claude Code
|
|
1976
|
+
* (mise à jour, branchements, corrections, déploiement) : une seule action.
|
|
1966
1977
|
*
|
|
1967
1978
|
* Invisible tant que le kit est à jour : un bouton permanent qui ne dit rien
|
|
1968
1979
|
* finit par ne plus être lu.
|
|
@@ -1972,7 +1983,7 @@ function NcfKitUpdate(props) {
|
|
|
1972
1983
|
if (!update.available) return null;
|
|
1973
1984
|
let copy = async () => {
|
|
1974
1985
|
try {
|
|
1975
|
-
await navigator.clipboard.writeText(update.
|
|
1986
|
+
await navigator.clipboard.writeText(update.prompt), setCopied(!0);
|
|
1976
1987
|
} catch {
|
|
1977
1988
|
setCopied(!1);
|
|
1978
1989
|
}
|
|
@@ -1981,11 +1992,14 @@ function NcfKitUpdate(props) {
|
|
|
1981
1992
|
width: 318,
|
|
1982
1993
|
trigger: ({ toggle }) => /* @__PURE__ */ jsx(Button, {
|
|
1983
1994
|
mode: "bleed",
|
|
1984
|
-
tone: "
|
|
1995
|
+
tone: "critical",
|
|
1985
1996
|
fontSize: 1,
|
|
1986
1997
|
padding: props.inline ? 2 : 3,
|
|
1987
1998
|
icon: ArrowUpIcon,
|
|
1988
|
-
text:
|
|
1999
|
+
text: /* @__PURE__ */ jsx("span", {
|
|
2000
|
+
style: { fontWeight: 700 },
|
|
2001
|
+
children: `Kit ${update.latest}`
|
|
2002
|
+
}),
|
|
1989
2003
|
title: `A newer version of the kit is available (you are running ${update.current})`,
|
|
1990
2004
|
justify: props.inline ? void 0 : "flex-start",
|
|
1991
2005
|
onClick: toggle
|
|
@@ -2022,9 +2036,13 @@ function NcfKitUpdate(props) {
|
|
|
2022
2036
|
size: 0,
|
|
2023
2037
|
style: {
|
|
2024
2038
|
...MONO,
|
|
2025
|
-
|
|
2039
|
+
whiteSpace: "pre-wrap",
|
|
2040
|
+
wordBreak: "break-word",
|
|
2041
|
+
maxHeight: 160,
|
|
2042
|
+
overflowY: "auto",
|
|
2043
|
+
display: "block"
|
|
2026
2044
|
},
|
|
2027
|
-
children: update.
|
|
2045
|
+
children: update.prompt
|
|
2028
2046
|
})
|
|
2029
2047
|
}),
|
|
2030
2048
|
/* @__PURE__ */ jsxs(Flex, {
|
|
@@ -2032,11 +2050,14 @@ function NcfKitUpdate(props) {
|
|
|
2032
2050
|
wrap: "wrap",
|
|
2033
2051
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
2034
2052
|
mode: "default",
|
|
2035
|
-
tone: "
|
|
2053
|
+
tone: "critical",
|
|
2036
2054
|
fontSize: 1,
|
|
2037
2055
|
padding: 2,
|
|
2038
2056
|
icon: copied ? CheckmarkIcon : CopyIcon,
|
|
2039
|
-
text:
|
|
2057
|
+
text: /* @__PURE__ */ jsx("span", {
|
|
2058
|
+
style: { fontWeight: 700 },
|
|
2059
|
+
children: copied ? "Copied" : `Copy Kit ${update.latest}`
|
|
2060
|
+
}),
|
|
2040
2061
|
onClick: copy
|
|
2041
2062
|
}), /* @__PURE__ */ jsx(Button, {
|
|
2042
2063
|
as: "a",
|
|
@@ -2054,19 +2075,10 @@ function NcfKitUpdate(props) {
|
|
|
2054
2075
|
borderTop: `1px solid ${BORDER}`,
|
|
2055
2076
|
paddingTop: 10
|
|
2056
2077
|
},
|
|
2057
|
-
children: /* @__PURE__ */
|
|
2078
|
+
children: /* @__PURE__ */ jsx(Text, {
|
|
2058
2079
|
size: 0,
|
|
2059
2080
|
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
|
-
]
|
|
2081
|
+
children: "Paste it into Claude Code, opened on this project: it updates the kit, wires what the project needs and redeploys the Studio. The Studio cannot do it itself: it runs in your browser, not on the machine that builds it."
|
|
2070
2082
|
})
|
|
2071
2083
|
})
|
|
2072
2084
|
]
|
|
@@ -14036,6 +14048,6 @@ function hasLanguageField(schemaType, field) {
|
|
|
14036
14048
|
let fields = schemaType?.fields;
|
|
14037
14049
|
return Array.isArray(fields) && fields.some((f) => f?.name === field);
|
|
14038
14050
|
}
|
|
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 };
|
|
14051
|
+
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
14052
|
|
|
14041
14053
|
//# sourceMappingURL=index.js.map
|