@sanity/cli 6.0.0-alpha.5 → 6.0.0-alpha.7
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 +2907 -109
- package/dist/actions/dataset/create.d.ts +49 -0
- package/dist/actions/dataset/create.js +48 -0
- package/dist/actions/dataset/create.js.map +1 -0
- package/dist/actions/dataset/determineDatasetAclMode.d.ts +37 -0
- package/dist/actions/dataset/determineDatasetAclMode.js +36 -0
- package/dist/actions/dataset/determineDatasetAclMode.js.map +1 -0
- package/dist/actions/debug/gatherDebugInfo.js +15 -21
- package/dist/actions/debug/gatherDebugInfo.js.map +1 -1
- package/dist/actions/debug/types.d.ts +0 -2
- package/dist/actions/debug/types.js.map +1 -1
- package/dist/actions/deploy/deployApp.js +13 -0
- package/dist/actions/deploy/deployApp.js.map +1 -1
- package/dist/actions/init/remoteTemplate.js +1 -1
- package/dist/actions/init/remoteTemplate.js.map +1 -1
- package/dist/actions/manifest/extractAppManifest.d.ts +20 -0
- package/dist/actions/manifest/extractAppManifest.js +51 -0
- package/dist/actions/manifest/extractAppManifest.js.map +1 -0
- package/dist/actions/manifest/extractManifest.js +1 -1
- package/dist/actions/manifest/extractManifest.js.map +1 -1
- package/dist/actions/manifest/types.d.ts +6 -1
- package/dist/actions/manifest/types.js.map +1 -1
- package/dist/actions/media/importAspects.js +2 -1
- package/dist/actions/media/importAspects.js.map +1 -1
- package/dist/actions/schema/utils/uniqByProjectIdDataset.d.ts +1 -1
- package/dist/actions/telemetry/resolveConsent.d.ts +1 -9
- package/dist/actions/telemetry/resolveConsent.js +2 -2
- package/dist/actions/telemetry/resolveConsent.js.map +1 -1
- package/dist/actions/telemetry/setConsent.d.ts +1 -4
- package/dist/actions/telemetry/setConsent.js +4 -8
- package/dist/actions/telemetry/setConsent.js.map +1 -1
- package/dist/commands/dataset/create.d.ts +0 -2
- package/dist/commands/dataset/create.js +8 -54
- package/dist/commands/dataset/create.js.map +1 -1
- package/dist/commands/debug.js +5 -9
- package/dist/commands/debug.js.map +1 -1
- package/dist/commands/init.d.ts +6 -1
- package/dist/commands/init.js +358 -20
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/manifest/extract.js +7 -8
- package/dist/commands/manifest/extract.js.map +1 -1
- package/dist/commands/telemetry/disable.js +0 -1
- package/dist/commands/telemetry/disable.js.map +1 -1
- package/dist/commands/telemetry/enable.js +0 -1
- package/dist/commands/telemetry/enable.js.map +1 -1
- package/dist/commands/telemetry/status.js +1 -3
- package/dist/commands/telemetry/status.js.map +1 -1
- package/dist/config/createCliConfig.d.ts +9 -0
- package/dist/hooks/prerun/flushTelemetry.worker.d.ts +2 -0
- package/dist/hooks/prerun/flushTelemetry.worker.js +22 -0
- package/dist/hooks/prerun/flushTelemetry.worker.js.map +1 -0
- package/dist/hooks/prerun/setupTelemetry.js +65 -1
- package/dist/hooks/prerun/setupTelemetry.js.map +1 -1
- package/dist/prompts/init/promptForTypescript.d.ts +2 -0
- package/dist/prompts/init/promptForTypescript.js +15 -0
- package/dist/prompts/init/promptForTypescript.js.map +1 -0
- package/dist/prompts/promptForDatasetAclMode.d.ts +9 -0
- package/dist/prompts/promptForDatasetAclMode.js +27 -0
- package/dist/prompts/promptForDatasetAclMode.js.map +1 -0
- package/dist/prompts/promptForDatasetName.d.ts +1 -1
- package/dist/prompts/promptForDatasetName.js +4 -1
- package/dist/prompts/promptForDatasetName.js.map +1 -1
- package/dist/services/organizations.d.ts +3 -1
- package/dist/services/organizations.js +2 -1
- package/dist/services/organizations.js.map +1 -1
- package/dist/services/telemetry.d.ts +2 -0
- package/dist/services/telemetry.js +20 -0
- package/dist/services/telemetry.js.map +1 -0
- package/dist/services/user.d.ts +5 -0
- package/dist/services/user.js +12 -1
- package/dist/services/user.js.map +1 -1
- package/dist/services/userApplications.d.ts +3 -1
- package/dist/services/userApplications.js +5 -1
- package/dist/services/userApplications.js.map +1 -1
- package/dist/telemetry/cli.telemetry.d.ts +20 -0
- package/dist/telemetry/cli.telemetry.js +8 -0
- package/dist/telemetry/cli.telemetry.js.map +1 -0
- package/dist/telemetry/store/cleanupOldTelemetryFiles.d.ts +5 -0
- package/dist/telemetry/store/cleanupOldTelemetryFiles.js +30 -0
- package/dist/telemetry/store/cleanupOldTelemetryFiles.js.map +1 -0
- package/dist/telemetry/store/createTelemetryStore.d.ts +39 -0
- package/dist/telemetry/store/createTelemetryStore.js +95 -0
- package/dist/telemetry/store/createTelemetryStore.js.map +1 -0
- package/dist/telemetry/store/createTraceId.d.ts +10 -0
- package/dist/telemetry/store/createTraceId.js +10 -0
- package/dist/telemetry/store/createTraceId.js.map +1 -0
- package/dist/telemetry/store/debug.d.ts +5 -0
- package/dist/telemetry/store/debug.js +7 -0
- package/dist/telemetry/store/debug.js.map +1 -0
- package/dist/telemetry/store/findTelemetryFiles.d.ts +13 -0
- package/dist/telemetry/store/findTelemetryFiles.js +34 -0
- package/dist/telemetry/store/findTelemetryFiles.js.map +1 -0
- package/dist/telemetry/store/flushTelemetryFiles.d.ts +20 -0
- package/dist/telemetry/store/flushTelemetryFiles.js +107 -0
- package/dist/telemetry/store/flushTelemetryFiles.js.map +1 -0
- package/dist/telemetry/store/generateTelemetryFilePath.d.ts +17 -0
- package/dist/telemetry/store/generateTelemetryFilePath.js +30 -0
- package/dist/telemetry/store/generateTelemetryFilePath.js.map +1 -0
- package/dist/telemetry/store/getTelemetryBaseInfo.d.ts +27 -0
- package/dist/telemetry/store/getTelemetryBaseInfo.js +34 -0
- package/dist/telemetry/store/getTelemetryBaseInfo.js.map +1 -0
- package/dist/telemetry/store/logger.d.ts +6 -0
- package/dist/telemetry/store/logger.js +54 -0
- package/dist/telemetry/store/logger.js.map +1 -0
- package/dist/telemetry/store/trace.d.ts +6 -0
- package/dist/telemetry/store/trace.js +150 -0
- package/dist/telemetry/store/trace.js.map +1 -0
- package/dist/telemetry/utils/readNDJSON.d.ts +10 -0
- package/dist/telemetry/utils/readNDJSON.js +18 -0
- package/dist/telemetry/utils/readNDJSON.js.map +1 -0
- package/dist/util/detectRuntime.d.ts +8 -0
- package/dist/util/detectRuntime.js +20 -0
- package/dist/util/detectRuntime.js.map +1 -0
- package/dist/util/isStaging.d.ts +7 -0
- package/dist/util/isStaging.js +10 -0
- package/dist/util/isStaging.js.map +1 -0
- package/dist/util/parseArguments.d.ts +35 -0
- package/dist/util/parseArguments.js +42 -0
- package/dist/util/parseArguments.js.map +1 -0
- package/oclif.manifest.json +7 -1
- package/package.json +25 -18
- package/templates/app-quickstart/src/App.css +20 -0
- package/templates/app-quickstart/src/App.tsx +25 -0
- package/templates/app-quickstart/src/ExampleComponent.css +90 -0
- package/templates/app-quickstart/src/ExampleComponent.tsx +37 -0
- package/templates/app-sanity-ui/src/App.tsx +34 -0
- package/templates/app-sanity-ui/src/ExampleComponent.tsx +34 -0
- package/templates/app-sanity-ui/src/SanityUI.tsx +23 -0
- package/templates/blog/README.md +11 -0
- package/templates/blog/schemaTypes/author.js +50 -0
- package/templates/blog/schemaTypes/blockContent.js +67 -0
- package/templates/blog/schemaTypes/category.js +19 -0
- package/templates/blog/schemaTypes/index.js +6 -0
- package/templates/blog/schemaTypes/post.js +65 -0
- package/templates/blog/static/.gitkeep +1 -0
- package/templates/clean/README.md +9 -0
- package/templates/clean/schemaTypes/index.js +1 -0
- package/templates/clean/static/.gitkeep +1 -0
- package/templates/ecommerce/README.md +11 -0
- package/templates/ecommerce/plugins/.gitkeep +1 -0
- package/templates/ecommerce/plugins/barcode-input/BarcodeInput.js +62 -0
- package/templates/ecommerce/plugins/barcode-input/index.js +9 -0
- package/templates/ecommerce/plugins/barcode-input/schemaType.js +60 -0
- package/templates/ecommerce/schemaTypes/blockContent.js +67 -0
- package/templates/ecommerce/schemaTypes/category.js +39 -0
- package/templates/ecommerce/schemaTypes/index.js +23 -0
- package/templates/ecommerce/schemaTypes/locale/localeBlockContent.js +19 -0
- package/templates/ecommerce/schemaTypes/locale/localeString.js +19 -0
- package/templates/ecommerce/schemaTypes/locale/localeText.js +19 -0
- package/templates/ecommerce/schemaTypes/locale/supportedLanguages.js +5 -0
- package/templates/ecommerce/schemaTypes/product.js +83 -0
- package/templates/ecommerce/schemaTypes/productVariant.js +52 -0
- package/templates/ecommerce/schemaTypes/vendor.js +39 -0
- package/templates/ecommerce/static/.gitkeep +1 -0
- package/templates/get-started/README.md +9 -0
- package/templates/get-started/plugins/.gitkeep +1 -0
- package/templates/get-started/plugins/sanity-plugin-tutorial/CustomDefaultLayout.tsx +16 -0
- package/templates/get-started/plugins/sanity-plugin-tutorial/GetStartedTutorial.tsx +104 -0
- package/templates/get-started/plugins/sanity-plugin-tutorial/index.ts +11 -0
- package/templates/get-started/schemaTypes/index.ts +1 -0
- package/templates/get-started/static/.gitkeep +1 -0
- package/templates/moviedb/README.md +10 -0
- package/templates/moviedb/schemaTypes/blockContent.js +67 -0
- package/templates/moviedb/schemaTypes/castMember.js +37 -0
- package/templates/moviedb/schemaTypes/crewMember.js +52 -0
- package/templates/moviedb/schemaTypes/index.js +22 -0
- package/templates/moviedb/schemaTypes/movie.js +85 -0
- package/templates/moviedb/schemaTypes/person.js +37 -0
- package/templates/moviedb/schemaTypes/plotSummaries.js +20 -0
- package/templates/moviedb/schemaTypes/plotSummary.js +24 -0
- package/templates/moviedb/schemaTypes/screening.js +81 -0
- package/templates/moviedb/static/.gitkeep +1 -0
- package/templates/quickstart/README.md +9 -0
- package/templates/quickstart/schemaTypes/index.js +1 -0
- package/templates/quickstart/static/.gitkeep +1 -0
- package/templates/shared/gitignore.txt +29 -0
- package/templates/shared/tsconfig.json +17 -0
- package/templates/shopify/README.md +85 -0
- package/templates/shopify/components/hotspots/ProductTooltip.tsx +38 -0
- package/templates/shopify/components/icons/Shopify.tsx +20 -0
- package/templates/shopify/components/inputs/CollectionHidden.tsx +23 -0
- package/templates/shopify/components/inputs/PlaceholderString.tsx +20 -0
- package/templates/shopify/components/inputs/ProductHidden.tsx +64 -0
- package/templates/shopify/components/inputs/ProductVariantHidden.tsx +24 -0
- package/templates/shopify/components/inputs/ProxyString.tsx +32 -0
- package/templates/shopify/components/media/ColorTheme.tsx +38 -0
- package/templates/shopify/components/media/ShopifyDocumentStatus.tsx +82 -0
- package/templates/shopify/components/studio/Navbar.tsx +29 -0
- package/templates/shopify/constants.ts +61 -0
- package/templates/shopify/docs/features.md +158 -0
- package/templates/shopify/plugins/customDocumentActions/index.ts +55 -0
- package/templates/shopify/plugins/customDocumentActions/shopifyDelete.tsx +144 -0
- package/templates/shopify/plugins/customDocumentActions/shopifyLink.ts +39 -0
- package/templates/shopify/plugins/customDocumentActions/types.ts +14 -0
- package/templates/shopify/schemaTypes/documents/collection.tsx +142 -0
- package/templates/shopify/schemaTypes/documents/colorTheme.tsx +44 -0
- package/templates/shopify/schemaTypes/documents/page.ts +70 -0
- package/templates/shopify/schemaTypes/documents/product.tsx +132 -0
- package/templates/shopify/schemaTypes/documents/productVariant.tsx +67 -0
- package/templates/shopify/schemaTypes/index.ts +108 -0
- package/templates/shopify/schemaTypes/objects/collection/collectionGroupType.ts +27 -0
- package/templates/shopify/schemaTypes/objects/collection/collectionLinksType.ts +16 -0
- package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionColorObjectType.tsx +48 -0
- package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionColorType.tsx +50 -0
- package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionSizeObjectType.ts +40 -0
- package/templates/shopify/schemaTypes/objects/customProductOption/customProductOptionSizeType.ts +49 -0
- package/templates/shopify/schemaTypes/objects/global/footerType.ts +22 -0
- package/templates/shopify/schemaTypes/objects/global/menuLinksType.ts +21 -0
- package/templates/shopify/schemaTypes/objects/global/menuType.ts +17 -0
- package/templates/shopify/schemaTypes/objects/global/notFoundPageType.ts +37 -0
- package/templates/shopify/schemaTypes/objects/hotspot/imageWithProductHotspotsType.ts +48 -0
- package/templates/shopify/schemaTypes/objects/hotspot/productHotspotsType.tsx +17 -0
- package/templates/shopify/schemaTypes/objects/hotspot/spotType.tsx +60 -0
- package/templates/shopify/schemaTypes/objects/link/linkEmailType.tsx +34 -0
- package/templates/shopify/schemaTypes/objects/link/linkExternalType.tsx +37 -0
- package/templates/shopify/schemaTypes/objects/link/linkInternalType.tsx +33 -0
- package/templates/shopify/schemaTypes/objects/link/linkProductType.tsx +60 -0
- package/templates/shopify/schemaTypes/objects/module/accordionGroupType.ts +33 -0
- package/templates/shopify/schemaTypes/objects/module/accordionType.ts +28 -0
- package/templates/shopify/schemaTypes/objects/module/callToActionType.tsx +85 -0
- package/templates/shopify/schemaTypes/objects/module/calloutType.ts +38 -0
- package/templates/shopify/schemaTypes/objects/module/collectionReferenceType.tsx +47 -0
- package/templates/shopify/schemaTypes/objects/module/gridItemType.ts +41 -0
- package/templates/shopify/schemaTypes/objects/module/gridType.ts +28 -0
- package/templates/shopify/schemaTypes/objects/module/heroType.tsx +40 -0
- package/templates/shopify/schemaTypes/objects/module/imageCallToActionType.tsx +19 -0
- package/templates/shopify/schemaTypes/objects/module/imageFeatureType.ts +80 -0
- package/templates/shopify/schemaTypes/objects/module/imageFeaturesType.tsx +51 -0
- package/templates/shopify/schemaTypes/objects/module/instagramType.ts +35 -0
- package/templates/shopify/schemaTypes/objects/module/productFeaturesType.tsx +50 -0
- package/templates/shopify/schemaTypes/objects/module/productReferenceType.tsx +42 -0
- package/templates/shopify/schemaTypes/objects/seoType.ts +31 -0
- package/templates/shopify/schemaTypes/objects/shopify/collectionRuleType.tsx +37 -0
- package/templates/shopify/schemaTypes/objects/shopify/inventoryType.ts +25 -0
- package/templates/shopify/schemaTypes/objects/shopify/optionType.tsx +31 -0
- package/templates/shopify/schemaTypes/objects/shopify/placeholderStringType.ts +11 -0
- package/templates/shopify/schemaTypes/objects/shopify/priceRangeType.ts +20 -0
- package/templates/shopify/schemaTypes/objects/shopify/productWithVariantType.tsx +142 -0
- package/templates/shopify/schemaTypes/objects/shopify/proxyStringType.ts +12 -0
- package/templates/shopify/schemaTypes/objects/shopify/shopType.ts +15 -0
- package/templates/shopify/schemaTypes/objects/shopify/shopifyCollectionType.ts +84 -0
- package/templates/shopify/schemaTypes/objects/shopify/shopifyProductType.ts +131 -0
- package/templates/shopify/schemaTypes/objects/shopify/shopifyProductVariantType.ts +121 -0
- package/templates/shopify/schemaTypes/portableText/portableTextSimpleType.tsx +45 -0
- package/templates/shopify/schemaTypes/portableText/portableTextType.tsx +52 -0
- package/templates/shopify/schemaTypes/singletons/homeType.ts +49 -0
- package/templates/shopify/schemaTypes/singletons/settingsType.ts +96 -0
- package/templates/shopify/static/.gitkeep +1 -0
- package/templates/shopify/structure/collectionStructure.ts +9 -0
- package/templates/shopify/structure/colorThemeStructure.ts +9 -0
- package/templates/shopify/structure/homeStructure.ts +9 -0
- package/templates/shopify/structure/index.ts +57 -0
- package/templates/shopify/structure/pageStructure.ts +11 -0
- package/templates/shopify/structure/productStructure.ts +51 -0
- package/templates/shopify/structure/settingStructure.ts +9 -0
- package/templates/shopify/utils/blocksToText.ts +20 -0
- package/templates/shopify/utils/defineStructure.ts +11 -0
- package/templates/shopify/utils/getPriceRange.ts +24 -0
- package/templates/shopify/utils/shopifyUrls.ts +22 -0
- package/templates/shopify/utils/validateSlug.ts +18 -0
- package/templates/shopify-online-storefront/README.md +54 -0
- package/templates/shopify-online-storefront/components/icons/Shopify.tsx +22 -0
- package/templates/shopify-online-storefront/components/inputs/CollectionHidden.tsx +23 -0
- package/templates/shopify-online-storefront/components/inputs/PlaceholderString.tsx +25 -0
- package/templates/shopify-online-storefront/components/inputs/ProductHidden.tsx +66 -0
- package/templates/shopify-online-storefront/components/inputs/ProductVariantHidden.tsx +25 -0
- package/templates/shopify-online-storefront/components/inputs/ProxyString.tsx +38 -0
- package/templates/shopify-online-storefront/components/media/ShopifyDocumentStatus.tsx +83 -0
- package/templates/shopify-online-storefront/constants.ts +18 -0
- package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/index.ts +45 -0
- package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/shopifyDelete.tsx +144 -0
- package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/shopifyLink.ts +39 -0
- package/templates/shopify-online-storefront/plugins/shopifyDocumentActions/types.ts +14 -0
- package/templates/shopify-online-storefront/schemaTypes/blocks/blockContent.ts +32 -0
- package/templates/shopify-online-storefront/schemaTypes/documents/collection.tsx +83 -0
- package/templates/shopify-online-storefront/schemaTypes/documents/product.tsx +102 -0
- package/templates/shopify-online-storefront/schemaTypes/documents/productVariant.tsx +82 -0
- package/templates/shopify-online-storefront/schemaTypes/index.ts +43 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/accordion.ts +31 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/accordionGroup.ts +35 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/callout.ts +40 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/inventory.ts +30 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/option.ts +30 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/priceRange.ts +22 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/proxyString.ts +11 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/shopifyCollection.ts +109 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/shopifyCollectionRule.tsx +45 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/shopifyProduct.ts +165 -0
- package/templates/shopify-online-storefront/schemaTypes/objects/shopifyProductVariant.ts +151 -0
- package/templates/shopify-online-storefront/structure/collectionStructure.ts +9 -0
- package/templates/shopify-online-storefront/structure/index.ts +37 -0
- package/templates/shopify-online-storefront/structure/productStructure.ts +35 -0
- package/templates/shopify-online-storefront/utils/defineStructure.ts +11 -0
- package/templates/shopify-online-storefront/utils/getPriceRange.ts +24 -0
- package/templates/shopify-online-storefront/utils/shopifyUrls.ts +22 -0
- package/dist/actions/build/__tests__/buildApp.test.js +0 -367
- package/dist/actions/build/__tests__/buildApp.test.js.map +0 -1
- package/dist/actions/build/__tests__/buildStudio.test.js +0 -561
- package/dist/actions/build/__tests__/buildStudio.test.js.map +0 -1
- package/dist/actions/build/__tests__/checkRequiredDependencies.test.js +0 -233
- package/dist/actions/build/__tests__/checkRequiredDependencies.test.js.map +0 -1
- package/dist/actions/build/__tests__/checkStudioDependencyVersions.test.js +0 -414
- package/dist/actions/build/__tests__/checkStudioDependencyVersions.test.js.map +0 -1
- package/dist/actions/build/__tests__/determineBasePath.test.js +0 -24
- package/dist/actions/build/__tests__/determineBasePath.test.js.map +0 -1
- package/dist/actions/build/__tests__/getAutoUpdatesImportMap.test.js +0 -109
- package/dist/actions/build/__tests__/getAutoUpdatesImportMap.test.js.map +0 -1
- package/dist/actions/build/__tests__/getViteConfig.test.js +0 -493
- package/dist/actions/build/__tests__/getViteConfig.test.js.map +0 -1
- package/dist/actions/build/__tests__/renderDocument.test.js +0 -278
- package/dist/actions/build/__tests__/renderDocument.test.js.map +0 -1
- package/dist/actions/build/__tests__/shouldAutoUpdate.test.js +0 -153
- package/dist/actions/build/__tests__/shouldAutoUpdate.test.js.map +0 -1
- package/dist/actions/build/renderDocumentWorker/__tests__/renderDocumentWorker.test.js +0 -657
- package/dist/actions/build/renderDocumentWorker/__tests__/renderDocumentWorker.test.js.map +0 -1
- package/dist/actions/dataset/__tests__/validateDatasetName.test.js +0 -182
- package/dist/actions/dataset/__tests__/validateDatasetName.test.js.map +0 -1
- package/dist/actions/deploy/__tests__/checkDir.test.js +0 -120
- package/dist/actions/deploy/__tests__/checkDir.test.js.map +0 -1
- package/dist/actions/docs/__tests__/normalizeDocsPath.test.js +0 -16
- package/dist/actions/docs/__tests__/normalizeDocsPath.test.js.map +0 -1
- package/dist/actions/documents/validation/reporters/prettyReporter/__tests__/formatDocumentValidation.test.js +0 -124
- package/dist/actions/documents/validation/reporters/prettyReporter/__tests__/formatDocumentValidation.test.js.map +0 -1
- package/dist/actions/graphql/__tests__/getGraphQLAPIs.test.js +0 -274
- package/dist/actions/graphql/__tests__/getGraphQLAPIs.test.js.map +0 -1
- package/dist/actions/media/__tests__/importMedia.test.js +0 -182
- package/dist/actions/media/__tests__/importMedia.test.js.map +0 -1
- package/dist/actions/schema/__tests__/formatSchemaValidation.test.js +0 -174
- package/dist/actions/schema/__tests__/formatSchemaValidation.test.js.map +0 -1
- package/dist/actions/schema/__tests__/validateAction.test.js +0 -281
- package/dist/actions/schema/__tests__/validateAction.test.js.map +0 -1
- package/dist/actions/telemetry/__tests__/fetchTelemetryConsent.test.js +0 -27
- package/dist/actions/telemetry/__tests__/fetchTelemetryConsent.test.js.map +0 -1
- package/dist/actions/users/__tests__/validateEmail.test.js +0 -16
- package/dist/actions/users/__tests__/validateEmail.test.js.map +0 -1
- package/dist/commands/__tests__/blueprints.test.js +0 -54
- package/dist/commands/__tests__/blueprints.test.js.map +0 -1
- package/dist/commands/__tests__/build.test.js +0 -132
- package/dist/commands/__tests__/build.test.js.map +0 -1
- package/dist/commands/__tests__/codemod.test.js +0 -271
- package/dist/commands/__tests__/codemod.test.js.map +0 -1
- package/dist/commands/__tests__/debug.test.js +0 -590
- package/dist/commands/__tests__/debug.test.js.map +0 -1
- package/dist/commands/__tests__/deploy.test.js +0 -1945
- package/dist/commands/__tests__/deploy.test.js.map +0 -1
- package/dist/commands/__tests__/dev.test.js +0 -453
- package/dist/commands/__tests__/dev.test.js.map +0 -1
- package/dist/commands/__tests__/exec.test.js +0 -207
- package/dist/commands/__tests__/exec.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.authentication.test.js +0 -73
- package/dist/commands/__tests__/init/init.authentication.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.create-new-project.test.js +0 -195
- package/dist/commands/__tests__/init/init.create-new-project.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.plan.test.js +0 -279
- package/dist/commands/__tests__/init/init.plan.test.js.map +0 -1
- package/dist/commands/__tests__/init/init.setup.test.js +0 -335
- package/dist/commands/__tests__/init/init.setup.test.js.map +0 -1
- package/dist/commands/__tests__/install.test.js +0 -282
- package/dist/commands/__tests__/install.test.js.map +0 -1
- package/dist/commands/__tests__/learn.test.js +0 -29
- package/dist/commands/__tests__/learn.test.js.map +0 -1
- package/dist/commands/__tests__/logout.test.js +0 -91
- package/dist/commands/__tests__/logout.test.js.map +0 -1
- package/dist/commands/__tests__/manage.test.js +0 -110
- package/dist/commands/__tests__/manage.test.js.map +0 -1
- package/dist/commands/__tests__/migration.test.js +0 -119
- package/dist/commands/__tests__/migration.test.js.map +0 -1
- package/dist/commands/__tests__/preview.test.js +0 -261
- package/dist/commands/__tests__/preview.test.js.map +0 -1
- package/dist/commands/__tests__/start.test.js +0 -253
- package/dist/commands/__tests__/start.test.js.map +0 -1
- package/dist/commands/__tests__/undeploy.test.js +0 -382
- package/dist/commands/__tests__/undeploy.test.js.map +0 -1
- package/dist/commands/__tests__/versions.test.js +0 -142
- package/dist/commands/__tests__/versions.test.js.map +0 -1
- package/dist/commands/backup/__tests__/disable.test.js +0 -204
- package/dist/commands/backup/__tests__/disable.test.js.map +0 -1
- package/dist/commands/backup/__tests__/download.test.js +0 -768
- package/dist/commands/backup/__tests__/download.test.js.map +0 -1
- package/dist/commands/backup/__tests__/enable.test.js +0 -286
- package/dist/commands/backup/__tests__/enable.test.js.map +0 -1
- package/dist/commands/backup/__tests__/list.test.js +0 -330
- package/dist/commands/backup/__tests__/list.test.js.map +0 -1
- package/dist/commands/cors/__tests__/add.test.js +0 -376
- package/dist/commands/cors/__tests__/add.test.js.map +0 -1
- package/dist/commands/cors/__tests__/delete.test.js +0 -308
- package/dist/commands/cors/__tests__/delete.test.js.map +0 -1
- package/dist/commands/cors/__tests__/list.test.js +0 -241
- package/dist/commands/cors/__tests__/list.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/copy.test.js +0 -628
- package/dist/commands/dataset/__tests__/copy.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/create.test.js +0 -342
- package/dist/commands/dataset/__tests__/create.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/delete.test.js +0 -231
- package/dist/commands/dataset/__tests__/delete.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/export.test.js +0 -601
- package/dist/commands/dataset/__tests__/export.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/import.test.js +0 -53
- package/dist/commands/dataset/__tests__/import.test.js.map +0 -1
- package/dist/commands/dataset/__tests__/list.test.js +0 -216
- package/dist/commands/dataset/__tests__/list.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/create.test.js +0 -339
- package/dist/commands/dataset/alias/__tests__/create.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/delete.test.js +0 -247
- package/dist/commands/dataset/alias/__tests__/delete.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/link.test.js +0 -376
- package/dist/commands/dataset/alias/__tests__/link.test.js.map +0 -1
- package/dist/commands/dataset/alias/__tests__/unlink.test.js +0 -313
- package/dist/commands/dataset/alias/__tests__/unlink.test.js.map +0 -1
- package/dist/commands/dataset/visibility/__tests__/get.test.js +0 -128
- package/dist/commands/dataset/visibility/__tests__/get.test.js.map +0 -1
- package/dist/commands/dataset/visibility/__tests__/set.test.js +0 -198
- package/dist/commands/dataset/visibility/__tests__/set.test.js.map +0 -1
- package/dist/commands/docs/__tests__/browse.test.js +0 -29
- package/dist/commands/docs/__tests__/browse.test.js.map +0 -1
- package/dist/commands/docs/__tests__/read.test.js +0 -78
- package/dist/commands/docs/__tests__/read.test.js.map +0 -1
- package/dist/commands/docs/__tests__/search.test.js +0 -255
- package/dist/commands/docs/__tests__/search.test.js.map +0 -1
- package/dist/commands/documents/__tests__/create.test.js +0 -1030
- package/dist/commands/documents/__tests__/create.test.js.map +0 -1
- package/dist/commands/documents/__tests__/delete.test.js +0 -300
- package/dist/commands/documents/__tests__/delete.test.js.map +0 -1
- package/dist/commands/documents/__tests__/get.test.js +0 -182
- package/dist/commands/documents/__tests__/get.test.js.map +0 -1
- package/dist/commands/documents/__tests__/query.test.js +0 -300
- package/dist/commands/documents/__tests__/query.test.js.map +0 -1
- package/dist/commands/documents/__tests__/validate.test.js +0 -249
- package/dist/commands/documents/__tests__/validate.test.js.map +0 -1
- package/dist/commands/graphql/__tests__/list.test.js +0 -240
- package/dist/commands/graphql/__tests__/list.test.js.map +0 -1
- package/dist/commands/graphql/__tests__/undeploy.test.js +0 -410
- package/dist/commands/graphql/__tests__/undeploy.test.js.map +0 -1
- package/dist/commands/hook/__tests__/attempt.test.js +0 -275
- package/dist/commands/hook/__tests__/attempt.test.js.map +0 -1
- package/dist/commands/hook/__tests__/create.test.js +0 -119
- package/dist/commands/hook/__tests__/create.test.js.map +0 -1
- package/dist/commands/hook/__tests__/delete.test.js +0 -233
- package/dist/commands/hook/__tests__/delete.test.js.map +0 -1
- package/dist/commands/hook/__tests__/list.test.js +0 -145
- package/dist/commands/hook/__tests__/list.test.js.map +0 -1
- package/dist/commands/hook/__tests__/logs.test.js +0 -798
- package/dist/commands/hook/__tests__/logs.test.js.map +0 -1
- package/dist/commands/manifest/__tests__/extract.test.js +0 -132
- package/dist/commands/manifest/__tests__/extract.test.js.map +0 -1
- package/dist/commands/mcp/__tests__/configure.test.js +0 -397
- package/dist/commands/mcp/__tests__/configure.test.js.map +0 -1
- package/dist/commands/media/__tests__/create-aspect.test.js +0 -173
- package/dist/commands/media/__tests__/create-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/delete-aspect.test.js +0 -342
- package/dist/commands/media/__tests__/delete-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/deploy-aspect.test.js +0 -619
- package/dist/commands/media/__tests__/deploy-aspect.test.js.map +0 -1
- package/dist/commands/media/__tests__/export.test.js +0 -697
- package/dist/commands/media/__tests__/export.test.js.map +0 -1
- package/dist/commands/media/__tests__/import.test.js +0 -347
- package/dist/commands/media/__tests__/import.test.js.map +0 -1
- package/dist/commands/openapi/__tests__/get.test.js +0 -149
- package/dist/commands/openapi/__tests__/get.test.js.map +0 -1
- package/dist/commands/openapi/__tests__/list.test.js +0 -113
- package/dist/commands/openapi/__tests__/list.test.js.map +0 -1
- package/dist/commands/projects/__tests__/list.test.js +0 -154
- package/dist/commands/projects/__tests__/list.test.js.map +0 -1
- package/dist/commands/schema/__tests__/delete.test.js +0 -454
- package/dist/commands/schema/__tests__/delete.test.js.map +0 -1
- package/dist/commands/schema/__tests__/deploy.test.js +0 -348
- package/dist/commands/schema/__tests__/deploy.test.js.map +0 -1
- package/dist/commands/schema/__tests__/extract.test.js +0 -121
- package/dist/commands/schema/__tests__/extract.test.js.map +0 -1
- package/dist/commands/schema/__tests__/list.test.js +0 -399
- package/dist/commands/schema/__tests__/list.test.js.map +0 -1
- package/dist/commands/schema/__tests__/validate.test.js +0 -121
- package/dist/commands/schema/__tests__/validate.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/disable.test.js +0 -147
- package/dist/commands/telemetry/__tests__/disable.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/enable.test.js +0 -133
- package/dist/commands/telemetry/__tests__/enable.test.js.map +0 -1
- package/dist/commands/telemetry/__tests__/status.test.js +0 -155
- package/dist/commands/telemetry/__tests__/status.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/add.test.js +0 -435
- package/dist/commands/tokens/__tests__/add.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/delete.test.js +0 -405
- package/dist/commands/tokens/__tests__/delete.test.js.map +0 -1
- package/dist/commands/tokens/__tests__/list.test.js +0 -395
- package/dist/commands/tokens/__tests__/list.test.js.map +0 -1
- package/dist/commands/users/__tests__/invite.test.js +0 -362
- package/dist/commands/users/__tests__/invite.test.js.map +0 -1
- package/dist/commands/users/__tests__/list.test.js +0 -407
- package/dist/commands/users/__tests__/list.test.js.map +0 -1
- package/dist/hooks/prerun/__tests__/setupTelemetry.test.js +0 -77
- package/dist/hooks/prerun/__tests__/setupTelemetry.test.js.map +0 -1
- package/dist/services/__tests__/datasetAliases.test.js +0 -131
- package/dist/services/__tests__/datasetAliases.test.js.map +0 -1
- package/dist/services/__tests__/datasets.test.js +0 -436
- package/dist/services/__tests__/datasets.test.js.map +0 -1
- package/dist/services/__tests__/graphql.test.js +0 -43
- package/dist/services/__tests__/graphql.test.js.map +0 -1
- package/dist/services/__tests__/mediaLibraries.test.js +0 -88
- package/dist/services/__tests__/mediaLibraries.test.js.map +0 -1
- package/dist/services/__tests__/projects.test.js +0 -41
- package/dist/services/__tests__/projects.test.js.map +0 -1
- package/dist/services/__tests__/userApplications.test.js +0 -113
- package/dist/services/__tests__/userApplications.test.js.map +0 -1
- package/dist/util/__tests__/appId.test.js +0 -31
- package/dist/util/__tests__/appId.test.js.map +0 -1
- package/dist/util/__tests__/cliClient.test.js +0 -184
- package/dist/util/__tests__/cliClient.test.js.map +0 -1
- package/dist/util/__tests__/compareDependencyVersions.test.js +0 -426
- package/dist/util/__tests__/compareDependencyVersions.test.js.map +0 -1
- package/dist/util/__tests__/extractDocumentsFromNdjsonOrTarball.test.js +0 -74
- package/dist/util/__tests__/extractDocumentsFromNdjsonOrTarball.test.js.map +0 -1
- package/dist/util/__tests__/findNdjsonEntry.test.js +0 -54
- package/dist/util/__tests__/findNdjsonEntry.test.js.map +0 -1
- package/dist/util/__tests__/getCliVersion.test.js +0 -28
- package/dist/util/__tests__/getCliVersion.test.js.map +0 -1
- package/dist/util/__tests__/getLocalPackageVersion.test.js +0 -84
- package/dist/util/__tests__/getLocalPackageVersion.test.js.map +0 -1
- package/dist/util/__tests__/getWorkspace.test.js +0 -37
- package/dist/util/__tests__/getWorkspace.test.js.map +0 -1
- package/dist/util/__tests__/readPackageJson.test.js +0 -69
- package/dist/util/__tests__/readPackageJson.test.js.map +0 -1
- package/dist/util/__tests__/warnAboutMissingAppId.test.js +0 -28
- package/dist/util/__tests__/warnAboutMissingAppId.test.js.map +0 -1
- package/dist/util/packageManager/__tests__/installPackages.test.js +0 -388
- package/dist/util/packageManager/__tests__/installPackages.test.js.map +0 -1
- package/dist/util/validation/ __tests__/validateDocuments.test.js +0 -274
- package/dist/util/validation/ __tests__/validateDocuments.test.js.map +0 -1
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { logSymbols } from '@sanity/cli-core/ux';
|
|
2
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
-
import { formatSchemaValidation } from '../formatSchemaValidation';
|
|
4
|
-
// disables some terminal specific things that are typically auto detected
|
|
5
|
-
vi.mock('node:tty', ()=>({
|
|
6
|
-
isatty: ()=>false
|
|
7
|
-
}));
|
|
8
|
-
describe('formatSchemaValidation', ()=>{
|
|
9
|
-
it('formats incoming validation results', ()=>{
|
|
10
|
-
const validation = [
|
|
11
|
-
{
|
|
12
|
-
path: [
|
|
13
|
-
{
|
|
14
|
-
kind: 'type',
|
|
15
|
-
name: 'arraysTest',
|
|
16
|
-
type: 'document'
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
kind: 'property',
|
|
20
|
-
name: 'fields'
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
kind: 'type',
|
|
24
|
-
name: 'imageArray',
|
|
25
|
-
type: 'array'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
kind: 'property',
|
|
29
|
-
name: 'of'
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
kind: 'type',
|
|
33
|
-
type: 'image'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
kind: 'property',
|
|
37
|
-
name: 'fields'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
kind: 'type',
|
|
41
|
-
name: '<unnamed_type_@_index_1>',
|
|
42
|
-
type: 'string'
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
problems: [
|
|
46
|
-
{
|
|
47
|
-
helpId: 'schema-object-fields-invalid',
|
|
48
|
-
message: 'Missing field name',
|
|
49
|
-
severity: 'error'
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
path: [
|
|
55
|
-
{
|
|
56
|
-
kind: 'type',
|
|
57
|
-
name: 'blocksTest',
|
|
58
|
-
type: 'document'
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
kind: 'property',
|
|
62
|
-
name: 'fields'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
kind: 'type',
|
|
66
|
-
name: '<unnamed_type_@_index_1>',
|
|
67
|
-
type: 'string'
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
problems: [
|
|
71
|
-
{
|
|
72
|
-
helpId: 'schema-object-fields-invalid',
|
|
73
|
-
message: 'Missing field name',
|
|
74
|
-
severity: 'error'
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
helpId: 'schema-type-missing-name-or-type',
|
|
78
|
-
message: 'Type is missing a type.',
|
|
79
|
-
severity: 'error'
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
path: [
|
|
85
|
-
{
|
|
86
|
-
kind: 'type',
|
|
87
|
-
name: 'blocksTest',
|
|
88
|
-
type: 'document'
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
kind: 'property',
|
|
92
|
-
name: 'fields'
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
kind: 'type',
|
|
96
|
-
name: 'defaults',
|
|
97
|
-
type: 'array'
|
|
98
|
-
}
|
|
99
|
-
],
|
|
100
|
-
problems: [
|
|
101
|
-
{
|
|
102
|
-
helpId: 'schema-array-of-type-global-type-conflict',
|
|
103
|
-
message: 'Found array member declaration with the same name as the global schema type "objectWithNestedArray". It\'s recommended to use a unique name to avoid possibly incompatible data types that shares the same name.',
|
|
104
|
-
severity: 'warning'
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
path: [
|
|
110
|
-
{
|
|
111
|
-
kind: 'type',
|
|
112
|
-
name: 'pt_customMarkersTest',
|
|
113
|
-
type: 'document'
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
kind: 'property',
|
|
117
|
-
name: 'fields'
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
kind: 'type',
|
|
121
|
-
name: 'content',
|
|
122
|
-
type: 'array'
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
kind: 'property',
|
|
126
|
-
name: 'of'
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
kind: 'type',
|
|
130
|
-
name: 'block',
|
|
131
|
-
type: 'block'
|
|
132
|
-
}
|
|
133
|
-
],
|
|
134
|
-
problems: [
|
|
135
|
-
{
|
|
136
|
-
helpId: 'schema-deprecated-blockeditor-key',
|
|
137
|
-
message: 'Decorator "boost" has deprecated key "blockEditor", please refer to the documentation on how to configure the block type for version 3.',
|
|
138
|
-
severity: 'warning'
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
helpId: 'schema-deprecated-blockeditor-key',
|
|
142
|
-
message: 'Annotation has deprecated key "blockEditor", please refer to the documentation on how to configure the block type for version 3.',
|
|
143
|
-
severity: 'warning'
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
helpId: 'schema-deprecated-blockeditor-key',
|
|
147
|
-
message: 'Style has deprecated key "blockEditor", please refer to the documentation on how to configure the block type for version 3.',
|
|
148
|
-
severity: 'warning'
|
|
149
|
-
}
|
|
150
|
-
]
|
|
151
|
-
}
|
|
152
|
-
];
|
|
153
|
-
expect(formatSchemaValidation(validation)).toBe(`
|
|
154
|
-
[ERROR] [arraysTest]
|
|
155
|
-
imageArray[<anonymous_image>].<unnamed_type_@_index_1>
|
|
156
|
-
${logSymbols.error} Missing field name
|
|
157
|
-
|
|
158
|
-
[ERROR] [blocksTest]
|
|
159
|
-
<unnamed_type_@_index_1>
|
|
160
|
-
${logSymbols.error} Missing field name
|
|
161
|
-
${logSymbols.error} Type is missing a type.
|
|
162
|
-
defaults
|
|
163
|
-
${logSymbols.warning} Found array member declaration with the same name as the global schema type "objectWithNestedArray". It's recommended to use a unique name to avoid possibly incompatible data types that shares the same name.
|
|
164
|
-
|
|
165
|
-
[WARN] [pt_customMarkersTest]
|
|
166
|
-
content[block]
|
|
167
|
-
${logSymbols.warning} Decorator "boost" has deprecated key "blockEditor", please refer to the documentation on how to configure the block type for version 3.
|
|
168
|
-
${logSymbols.warning} Annotation has deprecated key "blockEditor", please refer to the documentation on how to configure the block type for version 3.
|
|
169
|
-
${logSymbols.warning} Style has deprecated key "blockEditor", please refer to the documentation on how to configure the block type for version 3.
|
|
170
|
-
`.trim());
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
//# sourceMappingURL=formatSchemaValidation.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/schema/__tests__/formatSchemaValidation.test.ts"],"sourcesContent":["import {logSymbols} from '@sanity/cli-core/ux'\nimport {type SchemaValidationProblemGroup} from '@sanity/types'\nimport {describe, expect, it, vi} from 'vitest'\n\nimport {formatSchemaValidation} from '../formatSchemaValidation'\n\n// disables some terminal specific things that are typically auto detected\nvi.mock('node:tty', () => ({isatty: () => false}))\n\ndescribe('formatSchemaValidation', () => {\n it('formats incoming validation results', () => {\n const validation: SchemaValidationProblemGroup[] = [\n {\n path: [\n {kind: 'type', name: 'arraysTest', type: 'document'},\n {kind: 'property', name: 'fields'},\n {kind: 'type', name: 'imageArray', type: 'array'},\n {kind: 'property', name: 'of'},\n {kind: 'type', type: 'image'},\n {kind: 'property', name: 'fields'},\n {kind: 'type', name: '<unnamed_type_@_index_1>', type: 'string'},\n ],\n problems: [\n {\n helpId: 'schema-object-fields-invalid',\n message: 'Missing field name',\n severity: 'error',\n },\n ],\n },\n {\n path: [\n {kind: 'type', name: 'blocksTest', type: 'document'},\n {kind: 'property', name: 'fields'},\n {kind: 'type', name: '<unnamed_type_@_index_1>', type: 'string'},\n ],\n problems: [\n {\n helpId: 'schema-object-fields-invalid',\n message: 'Missing field name',\n severity: 'error',\n },\n {\n helpId: 'schema-type-missing-name-or-type',\n message: 'Type is missing a type.',\n severity: 'error',\n },\n ],\n },\n {\n path: [\n {kind: 'type', name: 'blocksTest', type: 'document'},\n {kind: 'property', name: 'fields'},\n {kind: 'type', name: 'defaults', type: 'array'},\n ],\n problems: [\n {\n helpId: 'schema-array-of-type-global-type-conflict',\n message:\n 'Found array member declaration with the same name as the global schema type \"objectWithNestedArray\". It\\'s recommended to use a unique name to avoid possibly incompatible data types that shares the same name.',\n severity: 'warning',\n },\n ],\n },\n {\n path: [\n {kind: 'type', name: 'pt_customMarkersTest', type: 'document'},\n {kind: 'property', name: 'fields'},\n {kind: 'type', name: 'content', type: 'array'},\n {kind: 'property', name: 'of'},\n {kind: 'type', name: 'block', type: 'block'},\n ],\n problems: [\n {\n helpId: 'schema-deprecated-blockeditor-key',\n message:\n 'Decorator \"boost\" has deprecated key \"blockEditor\", please refer to the documentation on how to configure the block type for version 3.',\n severity: 'warning',\n },\n {\n helpId: 'schema-deprecated-blockeditor-key',\n message:\n 'Annotation has deprecated key \"blockEditor\", please refer to the documentation on how to configure the block type for version 3.',\n severity: 'warning',\n },\n {\n helpId: 'schema-deprecated-blockeditor-key',\n message:\n 'Style has deprecated key \"blockEditor\", please refer to the documentation on how to configure the block type for version 3.',\n severity: 'warning',\n },\n ],\n },\n ]\n\n expect(formatSchemaValidation(validation)).toBe(\n `\n[ERROR] [arraysTest]\n imageArray[<anonymous_image>].<unnamed_type_@_index_1>\n ${logSymbols.error} Missing field name\n\n[ERROR] [blocksTest]\n <unnamed_type_@_index_1>\n ${logSymbols.error} Missing field name\n ${logSymbols.error} Type is missing a type.\n defaults\n ${logSymbols.warning} Found array member declaration with the same name as the global schema type \"objectWithNestedArray\". It's recommended to use a unique name to avoid possibly incompatible data types that shares the same name.\n\n[WARN] [pt_customMarkersTest]\n content[block]\n ${logSymbols.warning} Decorator \"boost\" has deprecated key \"blockEditor\", please refer to the documentation on how to configure the block type for version 3.\n ${logSymbols.warning} Annotation has deprecated key \"blockEditor\", please refer to the documentation on how to configure the block type for version 3.\n ${logSymbols.warning} Style has deprecated key \"blockEditor\", please refer to the documentation on how to configure the block type for version 3.\n`.trim(),\n )\n })\n})\n"],"names":["logSymbols","describe","expect","it","vi","formatSchemaValidation","mock","isatty","validation","path","kind","name","type","problems","helpId","message","severity","toBe","error","warning","trim"],"mappings":"AAAA,SAAQA,UAAU,QAAO,sBAAqB;AAE9C,SAAQC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAO,SAAQ;AAE/C,SAAQC,sBAAsB,QAAO,4BAA2B;AAEhE,0EAA0E;AAC1ED,GAAGE,IAAI,CAAC,YAAY,IAAO,CAAA;QAACC,QAAQ,IAAM;IAAK,CAAA;AAE/CN,SAAS,0BAA0B;IACjCE,GAAG,uCAAuC;QACxC,MAAMK,aAA6C;YACjD;gBACEC,MAAM;oBACJ;wBAACC,MAAM;wBAAQC,MAAM;wBAAcC,MAAM;oBAAU;oBACnD;wBAACF,MAAM;wBAAYC,MAAM;oBAAQ;oBACjC;wBAACD,MAAM;wBAAQC,MAAM;wBAAcC,MAAM;oBAAO;oBAChD;wBAACF,MAAM;wBAAYC,MAAM;oBAAI;oBAC7B;wBAACD,MAAM;wBAAQE,MAAM;oBAAO;oBAC5B;wBAACF,MAAM;wBAAYC,MAAM;oBAAQ;oBACjC;wBAACD,MAAM;wBAAQC,MAAM;wBAA4BC,MAAM;oBAAQ;iBAChE;gBACDC,UAAU;oBACR;wBACEC,QAAQ;wBACRC,SAAS;wBACTC,UAAU;oBACZ;iBACD;YACH;YACA;gBACEP,MAAM;oBACJ;wBAACC,MAAM;wBAAQC,MAAM;wBAAcC,MAAM;oBAAU;oBACnD;wBAACF,MAAM;wBAAYC,MAAM;oBAAQ;oBACjC;wBAACD,MAAM;wBAAQC,MAAM;wBAA4BC,MAAM;oBAAQ;iBAChE;gBACDC,UAAU;oBACR;wBACEC,QAAQ;wBACRC,SAAS;wBACTC,UAAU;oBACZ;oBACA;wBACEF,QAAQ;wBACRC,SAAS;wBACTC,UAAU;oBACZ;iBACD;YACH;YACA;gBACEP,MAAM;oBACJ;wBAACC,MAAM;wBAAQC,MAAM;wBAAcC,MAAM;oBAAU;oBACnD;wBAACF,MAAM;wBAAYC,MAAM;oBAAQ;oBACjC;wBAACD,MAAM;wBAAQC,MAAM;wBAAYC,MAAM;oBAAO;iBAC/C;gBACDC,UAAU;oBACR;wBACEC,QAAQ;wBACRC,SACE;wBACFC,UAAU;oBACZ;iBACD;YACH;YACA;gBACEP,MAAM;oBACJ;wBAACC,MAAM;wBAAQC,MAAM;wBAAwBC,MAAM;oBAAU;oBAC7D;wBAACF,MAAM;wBAAYC,MAAM;oBAAQ;oBACjC;wBAACD,MAAM;wBAAQC,MAAM;wBAAWC,MAAM;oBAAO;oBAC7C;wBAACF,MAAM;wBAAYC,MAAM;oBAAI;oBAC7B;wBAACD,MAAM;wBAAQC,MAAM;wBAASC,MAAM;oBAAO;iBAC5C;gBACDC,UAAU;oBACR;wBACEC,QAAQ;wBACRC,SACE;wBACFC,UAAU;oBACZ;oBACA;wBACEF,QAAQ;wBACRC,SACE;wBACFC,UAAU;oBACZ;oBACA;wBACEF,QAAQ;wBACRC,SACE;wBACFC,UAAU;oBACZ;iBACD;YACH;SACD;QAEDd,OAAOG,uBAAuBG,aAAaS,IAAI,CAC7C,CAAC;;;IAGH,EAAEjB,WAAWkB,KAAK,CAAC;;;;IAInB,EAAElB,WAAWkB,KAAK,CAAC;IACnB,EAAElB,WAAWkB,KAAK,CAAC;;IAEnB,EAAElB,WAAWmB,OAAO,CAAC;;;;IAIrB,EAAEnB,WAAWmB,OAAO,CAAC;IACrB,EAAEnB,WAAWmB,OAAO,CAAC;IACrB,EAAEnB,WAAWmB,OAAO,CAAC;AACzB,CAAC,CAACC,IAAI;IAEJ;AACF"}
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
|
2
|
-
import { validateAction } from '../validateAction.js';
|
|
3
|
-
const mockReadPackageUp = vi.hoisted(()=>vi.fn());
|
|
4
|
-
const mockSpinner = vi.hoisted(()=>({
|
|
5
|
-
fail: vi.fn().mockReturnThis(),
|
|
6
|
-
start: vi.fn().mockReturnThis(),
|
|
7
|
-
succeed: vi.fn().mockReturnThis()
|
|
8
|
-
}));
|
|
9
|
-
const mockSpinnerFn = vi.hoisted(()=>vi.fn(()=>mockSpinner));
|
|
10
|
-
const mockWorkerConstructor = vi.hoisted(()=>vi.fn());
|
|
11
|
-
const mockWriteFileSync = vi.hoisted(()=>vi.fn());
|
|
12
|
-
vi.mock('read-package-up', ()=>({
|
|
13
|
-
readPackageUp: mockReadPackageUp
|
|
14
|
-
}));
|
|
15
|
-
vi.mock('@sanity/cli-core/ux', async ()=>{
|
|
16
|
-
const actual = await vi.importActual('@sanity/cli-core/ux');
|
|
17
|
-
return {
|
|
18
|
-
...actual,
|
|
19
|
-
spinner: mockSpinnerFn
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
vi.mock('node:worker_threads', ()=>({
|
|
23
|
-
Worker: mockWorkerConstructor
|
|
24
|
-
}));
|
|
25
|
-
vi.mock('node:fs', ()=>({
|
|
26
|
-
writeFileSync: mockWriteFileSync
|
|
27
|
-
}));
|
|
28
|
-
const mockOutput = {
|
|
29
|
-
error: vi.fn(),
|
|
30
|
-
log: vi.fn(),
|
|
31
|
-
warn: vi.fn()
|
|
32
|
-
};
|
|
33
|
-
describe('#validateAction', ()=>{
|
|
34
|
-
let testWorkerResponse;
|
|
35
|
-
beforeEach(()=>{
|
|
36
|
-
vi.clearAllMocks();
|
|
37
|
-
testWorkerResponse = {
|
|
38
|
-
serializedDebug: undefined,
|
|
39
|
-
validation: []
|
|
40
|
-
};
|
|
41
|
-
const mockWorkerInstance = {
|
|
42
|
-
addListener: vi.fn()
|
|
43
|
-
};
|
|
44
|
-
mockWorkerConstructor.mockImplementation(()=>{
|
|
45
|
-
setImmediate(()=>{
|
|
46
|
-
const messageListener = mockWorkerInstance.addListener.mock.calls.find((call)=>call[0] === 'message')?.[1];
|
|
47
|
-
if (messageListener) {
|
|
48
|
-
messageListener(testWorkerResponse);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return mockWorkerInstance;
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
test('throws error if sanity package does not exist', async ()=>{
|
|
55
|
-
mockReadPackageUp.mockResolvedValueOnce(undefined);
|
|
56
|
-
const options = {
|
|
57
|
-
output: mockOutput,
|
|
58
|
-
workDir: '/test/project',
|
|
59
|
-
workspace: 'nonexistent'
|
|
60
|
-
};
|
|
61
|
-
await expect(validateAction(options)).rejects.toThrow('Could not find root directory for `sanity` package');
|
|
62
|
-
});
|
|
63
|
-
test('shows validating spinner if format flag pretty', async ()=>{
|
|
64
|
-
mockReadPackageUp.mockResolvedValueOnce({
|
|
65
|
-
path: '/test/sanity/package.json'
|
|
66
|
-
});
|
|
67
|
-
const options = {
|
|
68
|
-
format: 'pretty',
|
|
69
|
-
output: mockOutput,
|
|
70
|
-
workDir: '/test/project'
|
|
71
|
-
};
|
|
72
|
-
await validateAction(options);
|
|
73
|
-
expect(mockSpinnerFn).toHaveBeenCalledWith('Validating schema…');
|
|
74
|
-
expect(mockSpinner.start).toHaveBeenCalled();
|
|
75
|
-
});
|
|
76
|
-
test('throws serializeDebug error if debug-metafile-path flag is passed worker does not return serializeDebug', async ()=>{
|
|
77
|
-
mockReadPackageUp.mockResolvedValueOnce({
|
|
78
|
-
path: '/test/sanity/package.json'
|
|
79
|
-
});
|
|
80
|
-
const options = {
|
|
81
|
-
debugMetafilePath: '/test/metafile.json',
|
|
82
|
-
output: mockOutput,
|
|
83
|
-
workDir: '/test/project'
|
|
84
|
-
};
|
|
85
|
-
await expect(validateAction(options)).rejects.toThrow('serializedDebug should always be produced');
|
|
86
|
-
});
|
|
87
|
-
test('writes metafile', async ()=>{
|
|
88
|
-
mockReadPackageUp.mockResolvedValueOnce({
|
|
89
|
-
path: '/test/sanity/package.json'
|
|
90
|
-
});
|
|
91
|
-
testWorkerResponse = {
|
|
92
|
-
serializedDebug: {
|
|
93
|
-
hoisted: {},
|
|
94
|
-
size: 1000,
|
|
95
|
-
types: {}
|
|
96
|
-
},
|
|
97
|
-
validation: []
|
|
98
|
-
};
|
|
99
|
-
const options = {
|
|
100
|
-
debugMetafilePath: '/test/metafile.json',
|
|
101
|
-
output: mockOutput,
|
|
102
|
-
workDir: '/test/project'
|
|
103
|
-
};
|
|
104
|
-
await validateAction(options);
|
|
105
|
-
expect(mockWriteFileSync).toHaveBeenCalledWith('/test/metafile.json', expect.any(String), 'utf8');
|
|
106
|
-
});
|
|
107
|
-
test('does not write to metafile if schema validation fails', async ()=>{
|
|
108
|
-
mockReadPackageUp.mockResolvedValueOnce({
|
|
109
|
-
path: '/test/sanity/package.json'
|
|
110
|
-
});
|
|
111
|
-
testWorkerResponse = {
|
|
112
|
-
serializedDebug: {
|
|
113
|
-
hoisted: {},
|
|
114
|
-
size: 1000,
|
|
115
|
-
types: {}
|
|
116
|
-
},
|
|
117
|
-
validation: [
|
|
118
|
-
{
|
|
119
|
-
path: [
|
|
120
|
-
{
|
|
121
|
-
kind: 'type',
|
|
122
|
-
name: 'testType',
|
|
123
|
-
type: 'document'
|
|
124
|
-
}
|
|
125
|
-
],
|
|
126
|
-
problems: [
|
|
127
|
-
{
|
|
128
|
-
helpId: 'test-error',
|
|
129
|
-
message: 'Test error message',
|
|
130
|
-
severity: 'error'
|
|
131
|
-
}
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
};
|
|
136
|
-
const options = {
|
|
137
|
-
debugMetafilePath: '/test/metafile.json',
|
|
138
|
-
output: mockOutput,
|
|
139
|
-
workDir: '/test/project'
|
|
140
|
-
};
|
|
141
|
-
await validateAction(options);
|
|
142
|
-
expect(mockWriteFileSync).not.toHaveBeenCalled();
|
|
143
|
-
});
|
|
144
|
-
test('shows default output with manifest success message', async ()=>{
|
|
145
|
-
mockReadPackageUp.mockResolvedValueOnce({
|
|
146
|
-
path: '/test/sanity/package.json'
|
|
147
|
-
});
|
|
148
|
-
testWorkerResponse = {
|
|
149
|
-
serializedDebug: {
|
|
150
|
-
hoisted: {},
|
|
151
|
-
size: 1000,
|
|
152
|
-
types: {}
|
|
153
|
-
},
|
|
154
|
-
validation: []
|
|
155
|
-
};
|
|
156
|
-
const options = {
|
|
157
|
-
debugMetafilePath: '/test/metafile.json',
|
|
158
|
-
format: 'pretty',
|
|
159
|
-
output: mockOutput,
|
|
160
|
-
workDir: '/test/project'
|
|
161
|
-
};
|
|
162
|
-
await validateAction(options);
|
|
163
|
-
expect(mockSpinner.succeed).toHaveBeenCalledWith('Validated schema');
|
|
164
|
-
expect(mockOutput.log).toHaveBeenCalledWith('\nValidation results:');
|
|
165
|
-
expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Errors: 0 errors'));
|
|
166
|
-
expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Warnings: 0 warnings'));
|
|
167
|
-
expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Metafile written to: /test/metafile.json'));
|
|
168
|
-
expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('This can be analyzed at https://esbuild.github.io/analyze/'));
|
|
169
|
-
expect(process.exitCode).toBe(0);
|
|
170
|
-
});
|
|
171
|
-
test('shows default output with manifest failure message', async ()=>{
|
|
172
|
-
mockReadPackageUp.mockResolvedValueOnce({
|
|
173
|
-
path: '/test/sanity/package.json'
|
|
174
|
-
});
|
|
175
|
-
testWorkerResponse = {
|
|
176
|
-
serializedDebug: {
|
|
177
|
-
hoisted: {},
|
|
178
|
-
size: 1000,
|
|
179
|
-
types: {}
|
|
180
|
-
},
|
|
181
|
-
validation: [
|
|
182
|
-
{
|
|
183
|
-
path: [
|
|
184
|
-
{
|
|
185
|
-
kind: 'type',
|
|
186
|
-
name: 'testType',
|
|
187
|
-
type: 'document'
|
|
188
|
-
}
|
|
189
|
-
],
|
|
190
|
-
problems: [
|
|
191
|
-
{
|
|
192
|
-
helpId: 'test-error',
|
|
193
|
-
message: 'Test error message',
|
|
194
|
-
severity: 'error'
|
|
195
|
-
}
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
]
|
|
199
|
-
};
|
|
200
|
-
const options = {
|
|
201
|
-
debugMetafilePath: '/test/metafile.json',
|
|
202
|
-
output: mockOutput,
|
|
203
|
-
workDir: '/test/project'
|
|
204
|
-
};
|
|
205
|
-
await validateAction(options);
|
|
206
|
-
expect(mockOutput.log).toHaveBeenCalledWith('\nValidation results:');
|
|
207
|
-
expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Errors: 1 error'));
|
|
208
|
-
expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Warnings: 0 warnings'));
|
|
209
|
-
expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Test error message'));
|
|
210
|
-
expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Metafile not written due to validation errors'));
|
|
211
|
-
expect(process.exitCode).toBe(1);
|
|
212
|
-
});
|
|
213
|
-
test('shows json output', async ()=>{
|
|
214
|
-
mockReadPackageUp.mockResolvedValueOnce({
|
|
215
|
-
path: '/test/sanity/package.json'
|
|
216
|
-
});
|
|
217
|
-
testWorkerResponse = {
|
|
218
|
-
serializedDebug: undefined,
|
|
219
|
-
validation: [
|
|
220
|
-
{
|
|
221
|
-
path: [
|
|
222
|
-
{
|
|
223
|
-
kind: 'type',
|
|
224
|
-
name: 'testType',
|
|
225
|
-
type: 'document'
|
|
226
|
-
}
|
|
227
|
-
],
|
|
228
|
-
problems: [
|
|
229
|
-
{
|
|
230
|
-
helpId: 'test-error',
|
|
231
|
-
message: 'Test error message',
|
|
232
|
-
severity: 'error'
|
|
233
|
-
}
|
|
234
|
-
]
|
|
235
|
-
}
|
|
236
|
-
]
|
|
237
|
-
};
|
|
238
|
-
const options = {
|
|
239
|
-
format: 'json',
|
|
240
|
-
output: mockOutput,
|
|
241
|
-
workDir: '/test/project'
|
|
242
|
-
};
|
|
243
|
-
await validateAction(options);
|
|
244
|
-
expect(mockOutput.log).toHaveBeenCalledWith(JSON.stringify(testWorkerResponse.validation));
|
|
245
|
-
});
|
|
246
|
-
test('shows ndjson output', async ()=>{
|
|
247
|
-
mockReadPackageUp.mockResolvedValueOnce({
|
|
248
|
-
path: '/test/sanity/package.json'
|
|
249
|
-
});
|
|
250
|
-
testWorkerResponse = {
|
|
251
|
-
serializedDebug: undefined,
|
|
252
|
-
validation: [
|
|
253
|
-
{
|
|
254
|
-
path: [
|
|
255
|
-
{
|
|
256
|
-
kind: 'type',
|
|
257
|
-
name: 'testType',
|
|
258
|
-
type: 'document'
|
|
259
|
-
}
|
|
260
|
-
],
|
|
261
|
-
problems: [
|
|
262
|
-
{
|
|
263
|
-
helpId: 'test-error',
|
|
264
|
-
message: 'Test error message',
|
|
265
|
-
severity: 'error'
|
|
266
|
-
}
|
|
267
|
-
]
|
|
268
|
-
}
|
|
269
|
-
]
|
|
270
|
-
};
|
|
271
|
-
const options = {
|
|
272
|
-
format: 'ndjson',
|
|
273
|
-
output: mockOutput,
|
|
274
|
-
workDir: '/test/project'
|
|
275
|
-
};
|
|
276
|
-
await validateAction(options);
|
|
277
|
-
expect(mockOutput.log).toHaveBeenCalledWith(JSON.stringify(testWorkerResponse.validation[0]));
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
//# sourceMappingURL=validateAction.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/schema/__tests__/validateAction.test.ts"],"sourcesContent":["import {type Output} from '@sanity/cli-core'\nimport {beforeEach, describe, expect, test, vi} from 'vitest'\n\nimport {validateAction} from '../validateAction.js'\n\nconst mockReadPackageUp = vi.hoisted(() => vi.fn())\n\nconst mockSpinner = vi.hoisted(() => ({\n fail: vi.fn().mockReturnThis(),\n start: vi.fn().mockReturnThis(),\n succeed: vi.fn().mockReturnThis(),\n}))\nconst mockSpinnerFn = vi.hoisted(() => vi.fn(() => mockSpinner))\n\nconst mockWorkerConstructor = vi.hoisted(() => vi.fn())\n\nconst mockWriteFileSync = vi.hoisted(() => vi.fn())\n\nvi.mock('read-package-up', () => ({\n readPackageUp: mockReadPackageUp,\n}))\n\nvi.mock('@sanity/cli-core/ux', async () => {\n const actual = await vi.importActual('@sanity/cli-core/ux')\n return {\n ...actual,\n spinner: mockSpinnerFn,\n }\n})\n\nvi.mock('node:worker_threads', () => ({\n Worker: mockWorkerConstructor,\n}))\n\nvi.mock('node:fs', () => ({\n writeFileSync: mockWriteFileSync,\n}))\n\nconst mockOutput = {\n error: vi.fn(),\n log: vi.fn(),\n warn: vi.fn(),\n} as unknown as Output\n\ndescribe('#validateAction', () => {\n let testWorkerResponse: {serializedDebug?: unknown; validation: unknown[]}\n\n beforeEach(() => {\n vi.clearAllMocks()\n\n testWorkerResponse = {\n serializedDebug: undefined,\n validation: [],\n }\n\n const mockWorkerInstance = {\n addListener: vi.fn(),\n }\n\n mockWorkerConstructor.mockImplementation(() => {\n setImmediate(() => {\n const messageListener = mockWorkerInstance.addListener.mock.calls.find(\n (call) => call[0] === 'message',\n )?.[1]\n\n if (messageListener) {\n messageListener(testWorkerResponse)\n }\n })\n\n return mockWorkerInstance\n })\n })\n\n test('throws error if sanity package does not exist', async () => {\n mockReadPackageUp.mockResolvedValueOnce(undefined)\n\n const options = {\n output: mockOutput,\n workDir: '/test/project',\n workspace: 'nonexistent',\n }\n\n await expect(validateAction(options)).rejects.toThrow(\n 'Could not find root directory for `sanity` package',\n )\n })\n\n test('shows validating spinner if format flag pretty', async () => {\n mockReadPackageUp.mockResolvedValueOnce({\n path: '/test/sanity/package.json',\n })\n\n const options = {\n format: 'pretty',\n output: mockOutput,\n workDir: '/test/project',\n }\n\n await validateAction(options)\n\n expect(mockSpinnerFn).toHaveBeenCalledWith('Validating schema…')\n expect(mockSpinner.start).toHaveBeenCalled()\n })\n\n test('throws serializeDebug error if debug-metafile-path flag is passed worker does not return serializeDebug', async () => {\n mockReadPackageUp.mockResolvedValueOnce({\n path: '/test/sanity/package.json',\n })\n\n const options = {\n debugMetafilePath: '/test/metafile.json',\n output: mockOutput,\n workDir: '/test/project',\n }\n\n await expect(validateAction(options)).rejects.toThrow(\n 'serializedDebug should always be produced',\n )\n })\n\n test('writes metafile', async () => {\n mockReadPackageUp.mockResolvedValueOnce({\n path: '/test/sanity/package.json',\n })\n\n testWorkerResponse = {\n serializedDebug: {\n hoisted: {},\n size: 1000,\n types: {},\n },\n validation: [],\n }\n\n const options = {\n debugMetafilePath: '/test/metafile.json',\n output: mockOutput,\n workDir: '/test/project',\n }\n\n await validateAction(options)\n\n expect(mockWriteFileSync).toHaveBeenCalledWith(\n '/test/metafile.json',\n expect.any(String),\n 'utf8',\n )\n })\n\n test('does not write to metafile if schema validation fails', async () => {\n mockReadPackageUp.mockResolvedValueOnce({\n path: '/test/sanity/package.json',\n })\n\n testWorkerResponse = {\n serializedDebug: {\n hoisted: {},\n size: 1000,\n types: {},\n },\n validation: [\n {\n path: [{kind: 'type', name: 'testType', type: 'document'}],\n problems: [\n {\n helpId: 'test-error',\n message: 'Test error message',\n severity: 'error',\n },\n ],\n },\n ],\n }\n\n const options = {\n debugMetafilePath: '/test/metafile.json',\n output: mockOutput,\n workDir: '/test/project',\n }\n\n await validateAction(options)\n\n expect(mockWriteFileSync).not.toHaveBeenCalled()\n })\n\n test('shows default output with manifest success message', async () => {\n mockReadPackageUp.mockResolvedValueOnce({\n path: '/test/sanity/package.json',\n })\n\n testWorkerResponse = {\n serializedDebug: {\n hoisted: {},\n size: 1000,\n types: {},\n },\n validation: [],\n }\n\n const options = {\n debugMetafilePath: '/test/metafile.json',\n format: 'pretty',\n output: mockOutput,\n workDir: '/test/project',\n }\n\n await validateAction(options)\n\n expect(mockSpinner.succeed).toHaveBeenCalledWith('Validated schema')\n expect(mockOutput.log).toHaveBeenCalledWith('\\nValidation results:')\n expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Errors: 0 errors'))\n expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Warnings: 0 warnings'))\n expect(mockOutput.log).toHaveBeenCalledWith(\n expect.stringContaining('Metafile written to: /test/metafile.json'),\n )\n expect(mockOutput.log).toHaveBeenCalledWith(\n expect.stringContaining('This can be analyzed at https://esbuild.github.io/analyze/'),\n )\n expect(process.exitCode).toBe(0)\n })\n\n test('shows default output with manifest failure message', async () => {\n mockReadPackageUp.mockResolvedValueOnce({\n path: '/test/sanity/package.json',\n })\n\n testWorkerResponse = {\n serializedDebug: {\n hoisted: {},\n size: 1000,\n types: {},\n },\n validation: [\n {\n path: [{kind: 'type', name: 'testType', type: 'document'}],\n problems: [\n {\n helpId: 'test-error',\n message: 'Test error message',\n severity: 'error',\n },\n ],\n },\n ],\n }\n\n const options = {\n debugMetafilePath: '/test/metafile.json',\n output: mockOutput,\n workDir: '/test/project',\n }\n\n await validateAction(options)\n expect(mockOutput.log).toHaveBeenCalledWith('\\nValidation results:')\n expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Errors: 1 error'))\n expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Warnings: 0 warnings'))\n expect(mockOutput.log).toHaveBeenCalledWith(expect.stringContaining('Test error message'))\n expect(mockOutput.log).toHaveBeenCalledWith(\n expect.stringContaining('Metafile not written due to validation errors'),\n )\n expect(process.exitCode).toBe(1)\n })\n\n test('shows json output', async () => {\n mockReadPackageUp.mockResolvedValueOnce({\n path: '/test/sanity/package.json',\n })\n\n testWorkerResponse = {\n serializedDebug: undefined,\n validation: [\n {\n path: [{kind: 'type', name: 'testType', type: 'document'}],\n problems: [\n {\n helpId: 'test-error',\n message: 'Test error message',\n severity: 'error',\n },\n ],\n },\n ],\n }\n\n const options = {\n format: 'json',\n output: mockOutput,\n workDir: '/test/project',\n }\n\n await validateAction(options)\n\n expect(mockOutput.log).toHaveBeenCalledWith(JSON.stringify(testWorkerResponse.validation))\n })\n\n test('shows ndjson output', async () => {\n mockReadPackageUp.mockResolvedValueOnce({\n path: '/test/sanity/package.json',\n })\n\n testWorkerResponse = {\n serializedDebug: undefined,\n validation: [\n {\n path: [{kind: 'type', name: 'testType', type: 'document'}],\n problems: [\n {\n helpId: 'test-error',\n message: 'Test error message',\n severity: 'error',\n },\n ],\n },\n ],\n }\n\n const options = {\n format: 'ndjson',\n output: mockOutput,\n workDir: '/test/project',\n }\n\n await validateAction(options)\n\n expect(mockOutput.log).toHaveBeenCalledWith(JSON.stringify(testWorkerResponse.validation[0]))\n })\n})\n"],"names":["beforeEach","describe","expect","test","vi","validateAction","mockReadPackageUp","hoisted","fn","mockSpinner","fail","mockReturnThis","start","succeed","mockSpinnerFn","mockWorkerConstructor","mockWriteFileSync","mock","readPackageUp","actual","importActual","spinner","Worker","writeFileSync","mockOutput","error","log","warn","testWorkerResponse","clearAllMocks","serializedDebug","undefined","validation","mockWorkerInstance","addListener","mockImplementation","setImmediate","messageListener","calls","find","call","mockResolvedValueOnce","options","output","workDir","workspace","rejects","toThrow","path","format","toHaveBeenCalledWith","toHaveBeenCalled","debugMetafilePath","size","types","any","String","kind","name","type","problems","helpId","message","severity","not","stringContaining","process","exitCode","toBe","JSON","stringify"],"mappings":"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"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getUserConfig } from '@sanity/cli-core';
|
|
2
|
-
import { mockApi } from '@sanity/cli-test';
|
|
3
|
-
import { beforeEach, describe, expect, test } from 'vitest';
|
|
4
|
-
import { fetchTelemetryConsent, TELEMETRY_CONSENT_CONFIG_KEY } from '../fetchTelemetryConsent.js';
|
|
5
|
-
describe('#fetchTelemetryConsent', ()=>{
|
|
6
|
-
beforeEach(()=>{
|
|
7
|
-
const userConfig = getUserConfig();
|
|
8
|
-
userConfig.delete(TELEMETRY_CONSENT_CONFIG_KEY);
|
|
9
|
-
});
|
|
10
|
-
test('should return the telemetry consent status', async ()=>{
|
|
11
|
-
mockApi({
|
|
12
|
-
apiVersion: 'v2025-08-14',
|
|
13
|
-
query: {
|
|
14
|
-
tag: 'sanity.cli.telemetry-consent'
|
|
15
|
-
},
|
|
16
|
-
uri: '/intake/telemetry-status'
|
|
17
|
-
}).reply(200, {
|
|
18
|
-
status: 'granted'
|
|
19
|
-
});
|
|
20
|
-
const consent = await fetchTelemetryConsent();
|
|
21
|
-
expect(consent).toEqual({
|
|
22
|
-
status: 'granted'
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=fetchTelemetryConsent.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/telemetry/__tests__/fetchTelemetryConsent.test.ts"],"sourcesContent":["import {getUserConfig} from '@sanity/cli-core'\nimport {mockApi} from '@sanity/cli-test'\nimport {beforeEach, describe, expect, test} from 'vitest'\n\nimport {fetchTelemetryConsent, TELEMETRY_CONSENT_CONFIG_KEY} from '../fetchTelemetryConsent.js'\n\ndescribe('#fetchTelemetryConsent', () => {\n beforeEach(() => {\n const userConfig = getUserConfig()\n userConfig.delete(TELEMETRY_CONSENT_CONFIG_KEY)\n })\n\n test('should return the telemetry consent status', async () => {\n mockApi({\n apiVersion: 'v2025-08-14',\n query: {tag: 'sanity.cli.telemetry-consent'},\n uri: '/intake/telemetry-status',\n }).reply(200, {status: 'granted'})\n const consent = await fetchTelemetryConsent()\n\n expect(consent).toEqual({status: 'granted'})\n })\n})\n"],"names":["getUserConfig","mockApi","beforeEach","describe","expect","test","fetchTelemetryConsent","TELEMETRY_CONSENT_CONFIG_KEY","userConfig","delete","apiVersion","query","tag","uri","reply","status","consent","toEqual"],"mappings":"AAAA,SAAQA,aAAa,QAAO,mBAAkB;AAC9C,SAAQC,OAAO,QAAO,mBAAkB;AACxC,SAAQC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAAO,SAAQ;AAEzD,SAAQC,qBAAqB,EAAEC,4BAA4B,QAAO,8BAA6B;AAE/FJ,SAAS,0BAA0B;IACjCD,WAAW;QACT,MAAMM,aAAaR;QACnBQ,WAAWC,MAAM,CAACF;IACpB;IAEAF,KAAK,8CAA8C;QACjDJ,QAAQ;YACNS,YAAY;YACZC,OAAO;gBAACC,KAAK;YAA8B;YAC3CC,KAAK;QACP,GAAGC,KAAK,CAAC,KAAK;YAACC,QAAQ;QAAS;QAChC,MAAMC,UAAU,MAAMV;QAEtBF,OAAOY,SAASC,OAAO,CAAC;YAACF,QAAQ;QAAS;IAC5C;AACF"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'vitest';
|
|
2
|
-
import { validateEmail } from '../validateEmail.js';
|
|
3
|
-
describe('validateEmail', ()=>{
|
|
4
|
-
test('returns true for valid email', ()=>{
|
|
5
|
-
expect(validateEmail('test@test.com')).toBe(true);
|
|
6
|
-
});
|
|
7
|
-
test('returns "Email is required" for empty email', ()=>{
|
|
8
|
-
expect(validateEmail('')).toBe('Email is required');
|
|
9
|
-
expect(validateEmail(' ')).toBe('Email is required');
|
|
10
|
-
});
|
|
11
|
-
test('returns "Please enter a valid email address" for invalid email', ()=>{
|
|
12
|
-
expect(validateEmail('invalid-email')).toBe('Please enter a valid email address');
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=validateEmail.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/users/__tests__/validateEmail.test.ts"],"sourcesContent":["import {describe, expect, test} from 'vitest'\n\nimport {validateEmail} from '../validateEmail.js'\n\ndescribe('validateEmail', () => {\n test('returns true for valid email', () => {\n expect(validateEmail('test@test.com')).toBe(true)\n })\n\n test('returns \"Email is required\" for empty email', () => {\n expect(validateEmail('')).toBe('Email is required')\n expect(validateEmail(' ')).toBe('Email is required')\n })\n\n test('returns \"Please enter a valid email address\" for invalid email', () => {\n expect(validateEmail('invalid-email')).toBe('Please enter a valid email address')\n })\n})\n"],"names":["describe","expect","test","validateEmail","toBe"],"mappings":"AAAA,SAAQA,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAAO,SAAQ;AAE7C,SAAQC,aAAa,QAAO,sBAAqB;AAEjDH,SAAS,iBAAiB;IACxBE,KAAK,gCAAgC;QACnCD,OAAOE,cAAc,kBAAkBC,IAAI,CAAC;IAC9C;IAEAF,KAAK,+CAA+C;QAClDD,OAAOE,cAAc,KAAKC,IAAI,CAAC;QAC/BH,OAAOE,cAAc,MAAMC,IAAI,CAAC;IAClC;IAEAF,KAAK,kEAAkE;QACrED,OAAOE,cAAc,kBAAkBC,IAAI,CAAC;IAC9C;AACF"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { runCommand } from '@oclif/test';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
describe('#blueprints', ()=>{
|
|
4
|
-
it('should print blueprints help', async ()=>{
|
|
5
|
-
const { stdout } = await runCommand('blueprints --help');
|
|
6
|
-
expect(stdout).toMatchInlineSnapshot(`
|
|
7
|
-
"Blueprint Stack deployment and management commands
|
|
8
|
-
|
|
9
|
-
USAGE
|
|
10
|
-
$ sanity blueprints COMMAND
|
|
11
|
-
|
|
12
|
-
COMMANDS
|
|
13
|
-
blueprints add Add a Resource to a Blueprint
|
|
14
|
-
blueprints config View or edit Blueprint configuration
|
|
15
|
-
blueprints deploy Deploy a Blueprint
|
|
16
|
-
blueprints destroy Destroy a Blueprint Stack deployment and its resources
|
|
17
|
-
(will not delete local files)
|
|
18
|
-
blueprints doctor Diagnose potential issues with Blueprint configuration
|
|
19
|
-
blueprints info Show information about a Blueprint Stack deployment
|
|
20
|
-
blueprints init Initialize a new Blueprint Stack deployment
|
|
21
|
-
blueprints logs Display logs for a Blueprint Stack deployment
|
|
22
|
-
blueprints plan Enumerate resources to be deployed - will not modify any
|
|
23
|
-
resources
|
|
24
|
-
blueprints stacks List all Blueprint Stacks
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
`);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
describe('#functions', ()=>{
|
|
31
|
-
it('should print function help', async ()=>{
|
|
32
|
-
const { stdout } = await runCommand('functions --help');
|
|
33
|
-
expect(stdout).toMatchInlineSnapshot(`
|
|
34
|
-
"Sanity Function development and management commands
|
|
35
|
-
|
|
36
|
-
USAGE
|
|
37
|
-
$ sanity functions COMMAND
|
|
38
|
-
|
|
39
|
-
TOPICS
|
|
40
|
-
functions env Add or set the value of an environment variable for a Sanity
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
COMMANDS
|
|
44
|
-
functions add Add a Function to your Blueprint
|
|
45
|
-
functions dev Start the Sanity Function emulator
|
|
46
|
-
functions logs Retrieve or delete logs for a Sanity Function
|
|
47
|
-
functions test Invoke a local Sanity Function
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
`);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=blueprints.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/__tests__/blueprints.test.ts"],"sourcesContent":["import {runCommand} from '@oclif/test'\nimport {describe, expect, it} from 'vitest'\n\ndescribe('#blueprints', () => {\n it('should print blueprints help', async () => {\n const {stdout} = await runCommand('blueprints --help')\n expect(stdout).toMatchInlineSnapshot(`\n \"Blueprint Stack deployment and management commands\n\n USAGE\n $ sanity blueprints COMMAND\n\n COMMANDS\n blueprints add Add a Resource to a Blueprint\n blueprints config View or edit Blueprint configuration\n blueprints deploy Deploy a Blueprint\n blueprints destroy Destroy a Blueprint Stack deployment and its resources\n (will not delete local files)\n blueprints doctor Diagnose potential issues with Blueprint configuration\n blueprints info Show information about a Blueprint Stack deployment\n blueprints init Initialize a new Blueprint Stack deployment\n blueprints logs Display logs for a Blueprint Stack deployment\n blueprints plan Enumerate resources to be deployed - will not modify any\n resources\n blueprints stacks List all Blueprint Stacks\n\n \"\n `)\n })\n})\n\ndescribe('#functions', () => {\n it('should print function help', async () => {\n const {stdout} = await runCommand('functions --help')\n expect(stdout).toMatchInlineSnapshot(`\n \"Sanity Function development and management commands\n\n USAGE\n $ sanity functions COMMAND\n\n TOPICS\n functions env Add or set the value of an environment variable for a Sanity\n function\n\n COMMANDS\n functions add Add a Function to your Blueprint\n functions dev Start the Sanity Function emulator\n functions logs Retrieve or delete logs for a Sanity Function\n functions test Invoke a local Sanity Function\n\n \"\n `)\n })\n})\n"],"names":["runCommand","describe","expect","it","stdout","toMatchInlineSnapshot"],"mappings":"AAAA,SAAQA,UAAU,QAAO,cAAa;AACtC,SAAQC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAO,SAAQ;AAE3CF,SAAS,eAAe;IACtBE,GAAG,gCAAgC;QACjC,MAAM,EAACC,MAAM,EAAC,GAAG,MAAMJ,WAAW;QAClCE,OAAOE,QAAQC,qBAAqB,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;IAqBtC,CAAC;IACH;AACF;AAEAJ,SAAS,cAAc;IACrBE,GAAG,8BAA8B;QAC/B,MAAM,EAACC,MAAM,EAAC,GAAG,MAAMJ,WAAW;QAClCE,OAAOE,QAAQC,qBAAqB,CAAC,CAAC;;;;;;;;;;;;;;;;;IAiBtC,CAAC;IACH;AACF"}
|