@sanity/cli 6.1.1 → 6.1.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/README.md +78 -78
- package/dist/actions/init/processTemplate.js +27 -49
- package/dist/actions/init/processTemplate.js.map +1 -1
- package/dist/actions/init/sdkAppDependencies.js +3 -3
- package/dist/actions/init/sdkAppDependencies.js.map +1 -1
- package/dist/actions/init/studioDependencies.js +3 -3
- package/dist/actions/init/studioDependencies.js.map +1 -1
- package/dist/actions/manifest/__tests__/resolveSchemaIcon.test.js +157 -0
- package/dist/actions/manifest/__tests__/resolveSchemaIcon.test.js.map +1 -0
- package/dist/actions/manifest/extractWorkspaceManifest.js.map +1 -1
- package/dist/actions/manifest/iconResolver.js +13 -6
- package/dist/actions/manifest/iconResolver.js.map +1 -1
- package/dist/actions/manifest/resolveSchemaIcon.js +43 -0
- package/dist/actions/manifest/resolveSchemaIcon.js.map +1 -0
- package/dist/commands/init.js +22 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/hooks/prerun/injectEnvVariables.js +2 -1
- package/dist/hooks/prerun/injectEnvVariables.js.map +1 -1
- package/oclif.config.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +4 -7
- package/dist/actions/manifest/SchemaIcon.js +0 -23
- package/dist/actions/manifest/SchemaIcon.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/manifest/SchemaIcon.tsx"],"sourcesContent":["import {resolveLocalPackage} from '@sanity/cli-core'\nimport {ThemeProvider} from '@sanity/ui'\nimport {buildTheme} from '@sanity/ui/theme'\nimport {type ComponentType, isValidElement, type ReactNode} from 'react'\nimport {isValidElementType} from 'react-is'\n\nconst theme = buildTheme()\n\ninterface SchemaIconProps {\n title: string\n workDir: string\n\n icon?: ComponentType | ReactNode\n subtitle?: string\n}\n\nconst SchemaIcon = async ({\n icon,\n subtitle,\n title,\n workDir,\n}: SchemaIconProps): Promise<React.JSX.Element> => {\n const normalizedIcon = await normalizeIcon(icon, title, subtitle, workDir)\n\n return <ThemeProvider theme={theme}>{normalizedIcon}</ThemeProvider>\n}\n\nasync function normalizeIcon(\n Icon: ComponentType | ReactNode | undefined,\n title: string,\n subtitle = '',\n workDir: string,\n): Promise<React.JSX.Element> {\n if (isValidElementType(Icon)) return <Icon />\n if (isValidElement(Icon)) return Icon\n\n const {createDefaultIcon} = await resolveLocalPackage<typeof import('sanity')>('sanity', workDir)\n\n return createDefaultIcon(title, subtitle)\n}\n\nexport {SchemaIcon}\nexport type {SchemaIconProps}\n"],"names":["resolveLocalPackage","ThemeProvider","buildTheme","isValidElement","isValidElementType","theme","SchemaIcon","icon","subtitle","title","workDir","normalizedIcon","normalizeIcon","Icon","createDefaultIcon"],"mappings":";AAAA,SAAQA,mBAAmB,QAAO,mBAAkB;AACpD,SAAQC,aAAa,QAAO,aAAY;AACxC,SAAQC,UAAU,QAAO,mBAAkB;AAC3C,SAA4BC,cAAc,QAAuB,QAAO;AACxE,SAAQC,kBAAkB,QAAO,WAAU;AAE3C,MAAMC,QAAQH;AAUd,MAAMI,aAAa,OAAO,EACxBC,IAAI,EACJC,QAAQ,EACRC,KAAK,EACLC,OAAO,EACS;IAChB,MAAMC,iBAAiB,MAAMC,cAAcL,MAAME,OAAOD,UAAUE;IAElE,qBAAO,KAACT;QAAcI,OAAOA;kBAAQM;;AACvC;AAEA,eAAeC,cACbC,IAA2C,EAC3CJ,KAAa,EACbD,WAAW,EAAE,EACbE,OAAe;IAEf,IAAIN,mBAAmBS,OAAO,qBAAO,KAACA;IACtC,kBAAIV,eAAeU,OAAO,OAAOA;IAEjC,MAAM,EAACC,iBAAiB,EAAC,GAAG,MAAMd,oBAA6C,UAAUU;IAEzF,OAAOI,kBAAkBL,OAAOD;AAClC;AAEA,SAAQF,UAAU,GAAC"}
|