@sanity/cli 3.36.4 → 3.36.5-canary.34

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.
Files changed (116) hide show
  1. package/lib/_chunks-cjs/cli.js +1779 -1317
  2. package/lib/_chunks-cjs/cli.js.map +1 -1
  3. package/lib/_chunks-cjs/journeyConfig.js +11 -11
  4. package/lib/_chunks-cjs/journeyConfig.js.map +1 -1
  5. package/lib/_chunks-cjs/loadEnv.js +105 -2719
  6. package/lib/_chunks-cjs/loadEnv.js.map +1 -1
  7. package/lib/cli.d.ts +10 -0
  8. package/lib/index.d.ts +448 -0
  9. package/lib/index.esm.js +449 -5
  10. package/lib/index.esm.js.map +1 -1
  11. package/lib/index.js +3 -3
  12. package/lib/index.js.map +1 -1
  13. package/lib/index.mjs +452 -0
  14. package/lib/index.mjs.map +1 -0
  15. package/lib/run.d.ts +1 -0
  16. package/lib/workers/getAndWriteJourneySchema.d.ts +1 -0
  17. package/lib/workers/getCliConfig.d.ts +1 -0
  18. package/lib/workers/typegenGenerate.d.ts +37 -0
  19. package/lib/workers/typegenGenerate.js +6 -2
  20. package/lib/workers/typegenGenerate.js.map +1 -1
  21. package/package.json +18 -21
  22. package/src/actions/init-project/templates/shopify.ts +7 -0
  23. package/src/util/journeyConfig.ts +5 -5
  24. package/templates/ecommerce/plugins/barcode-input/BarcodeInput.js +1 -1
  25. package/templates/get-started/plugins/sanity-plugin-tutorial/GetStartedTutorial.tsx +1 -1
  26. package/templates/shared/tsconfig.json +2 -4
  27. package/templates/shopify/README.md +3 -3
  28. package/templates/shopify/components/hotspots/ProductTooltip.tsx +1 -1
  29. package/templates/shopify/components/icons/Shopify.tsx +1 -1
  30. package/templates/shopify/components/inputs/CollectionHidden.tsx +1 -1
  31. package/templates/shopify/components/media/ColorTheme.tsx +1 -1
  32. package/templates/shopify/components/studio/Navbar.tsx +29 -0
  33. package/templates/shopify/constants.ts +31 -1
  34. package/templates/shopify/docs/features.md +6 -7
  35. package/templates/shopify/schemaTypes/documents/collection.tsx +11 -47
  36. package/templates/shopify/schemaTypes/documents/colorTheme.tsx +2 -17
  37. package/templates/shopify/schemaTypes/documents/page.ts +10 -37
  38. package/templates/shopify/schemaTypes/documents/product.tsx +4 -27
  39. package/templates/shopify/schemaTypes/documents/productVariant.tsx +4 -13
  40. package/templates/shopify/schemaTypes/index.ts +97 -126
  41. package/templates/shopify/schemaTypes/objects/collection/{group.ts → collectionGroupType.ts} +7 -10
  42. package/templates/shopify/schemaTypes/objects/collection/{links.ts → collectionLinksType.ts} +4 -4
  43. package/templates/shopify/schemaTypes/objects/customProductOption/{colorObject.tsx → customProductOptionColorObjectType.tsx} +3 -6
  44. package/templates/shopify/schemaTypes/objects/customProductOption/{color.tsx → customProductOptionColorType.tsx} +2 -10
  45. package/templates/shopify/schemaTypes/objects/customProductOption/{sizeObject.ts → customProductOptionSizeObjectType.ts} +3 -7
  46. package/templates/shopify/schemaTypes/objects/customProductOption/{size.ts → customProductOptionSizeType.ts} +3 -12
  47. package/templates/shopify/schemaTypes/objects/global/footerType.ts +22 -0
  48. package/templates/shopify/schemaTypes/objects/global/menuLinksType.ts +21 -0
  49. package/templates/shopify/schemaTypes/objects/global/{menu.ts → menuType.ts} +2 -4
  50. package/templates/shopify/schemaTypes/objects/global/{notFoundPage.ts → notFoundPageType.ts} +1 -6
  51. package/templates/shopify/schemaTypes/objects/hotspot/{imageWithProductHotspots.ts → imageWithProductHotspotsType.ts} +4 -6
  52. package/templates/shopify/schemaTypes/objects/hotspot/{productHotspots.tsx → productHotspotsType.tsx} +3 -5
  53. package/templates/shopify/schemaTypes/objects/hotspot/{spot.tsx → spotType.tsx} +1 -3
  54. package/templates/shopify/schemaTypes/{annotations/linkEmail.tsx → objects/link/linkEmailType.tsx} +5 -13
  55. package/templates/shopify/schemaTypes/{annotations/linkExternal.tsx → objects/link/linkExternalType.tsx} +6 -13
  56. package/templates/shopify/schemaTypes/{annotations/linkInternal.tsx → objects/link/linkInternalType.tsx} +5 -12
  57. package/templates/shopify/schemaTypes/{annotations/product.tsx → objects/link/linkProductType.tsx} +4 -16
  58. package/templates/shopify/schemaTypes/objects/module/{accordionGroup.ts → accordionGroupType.ts} +6 -9
  59. package/templates/shopify/schemaTypes/objects/module/{accordion.ts → accordionType.ts} +4 -11
  60. package/templates/shopify/schemaTypes/objects/module/{callToAction.tsx → callToActionType.tsx} +10 -23
  61. package/templates/shopify/schemaTypes/objects/module/{callout.ts → calloutType.ts} +4 -10
  62. package/templates/shopify/schemaTypes/objects/module/{collection.tsx → collectionReferenceType.tsx} +4 -9
  63. package/templates/shopify/schemaTypes/objects/module/gridItemType.ts +41 -0
  64. package/templates/shopify/schemaTypes/objects/module/{grid.ts → gridType.ts} +7 -15
  65. package/templates/shopify/schemaTypes/objects/{hero/home.tsx → module/heroType.tsx} +14 -17
  66. package/templates/shopify/schemaTypes/objects/module/{imageCallToAction.tsx → imageCallToActionType.tsx} +6 -10
  67. package/templates/shopify/schemaTypes/objects/module/{image.ts → imageFeatureType.ts} +6 -18
  68. package/templates/shopify/schemaTypes/objects/module/{images.tsx → imageFeaturesType.tsx} +7 -25
  69. package/templates/shopify/schemaTypes/objects/module/{instagram.ts → instagramType.ts} +2 -2
  70. package/templates/shopify/schemaTypes/objects/module/{products.tsx → productFeaturesType.tsx} +6 -11
  71. package/templates/shopify/schemaTypes/objects/module/{product.tsx → productReferenceType.tsx} +6 -8
  72. package/templates/shopify/schemaTypes/objects/{seo/seo.ts → seoType.ts} +7 -6
  73. package/templates/shopify/schemaTypes/objects/shopify/{shopifyCollectionRule.tsx → collectionRuleType.tsx} +2 -10
  74. package/templates/shopify/schemaTypes/objects/shopify/{inventory.ts → inventoryType.ts} +7 -12
  75. package/templates/shopify/schemaTypes/objects/shopify/{option.tsx → optionType.tsx} +6 -12
  76. package/templates/shopify/schemaTypes/objects/shopify/{placeholderString.ts → placeholderStringType.ts} +3 -1
  77. package/templates/shopify/schemaTypes/objects/shopify/{priceRange.ts → priceRangeType.ts} +5 -7
  78. package/templates/shopify/schemaTypes/objects/shopify/{productWithVariant.tsx → productWithVariantType.tsx} +2 -2
  79. package/templates/shopify/schemaTypes/objects/shopify/{proxyString.ts → proxyStringType.ts} +1 -1
  80. package/templates/shopify/schemaTypes/objects/shopify/{shopifyCollection.ts → shopifyCollectionType.ts} +4 -25
  81. package/templates/shopify/schemaTypes/objects/shopify/{shopifyProduct.ts → shopifyProductType.ts} +5 -35
  82. package/templates/shopify/schemaTypes/objects/shopify/{shopifyProductVariant.ts → shopifyProductVariantType.ts} +1 -27
  83. package/templates/shopify/schemaTypes/portableText/portableTextSimpleType.tsx +45 -0
  84. package/templates/shopify/schemaTypes/portableText/portableTextType.tsx +52 -0
  85. package/templates/shopify/schemaTypes/singletons/homeType.ts +49 -0
  86. package/templates/shopify/schemaTypes/singletons/{settings.ts → settingsType.ts} +7 -9
  87. package/templates/shopify/utils/shopifyUrls.ts +3 -3
  88. package/templates/shopify/utils/validateSlug.ts +3 -7
  89. package/lib/_chunks-cjs/index.js +0 -547
  90. package/lib/_chunks-cjs/index.js.map +0 -1
  91. package/lib/_chunks-cjs/node.js +0 -213
  92. package/lib/_chunks-cjs/node.js.map +0 -1
  93. package/lib/_chunks-cjs/stegaEncodeSourceMap.js +0 -357
  94. package/lib/_chunks-cjs/stegaEncodeSourceMap.js.map +0 -1
  95. package/lib/_chunks-es/index.js +0 -3336
  96. package/lib/_chunks-es/index.js.map +0 -1
  97. package/lib/_chunks-es/node.js +0 -216
  98. package/lib/_chunks-es/node.js.map +0 -1
  99. package/lib/_chunks-es/stegaEncodeSourceMap.js +0 -358
  100. package/lib/_chunks-es/stegaEncodeSourceMap.js.map +0 -1
  101. package/lib/index.cjs.mjs +0 -7
  102. package/templates/shopify/schemaTypes/blocks/body.tsx +0 -70
  103. package/templates/shopify/schemaTypes/objects/global/footer.ts +0 -57
  104. package/templates/shopify/schemaTypes/objects/global/linkExternal.ts +0 -52
  105. package/templates/shopify/schemaTypes/objects/global/linkInternal.ts +0 -65
  106. package/templates/shopify/schemaTypes/objects/global/links.ts +0 -16
  107. package/templates/shopify/schemaTypes/objects/hero/collection.tsx +0 -42
  108. package/templates/shopify/schemaTypes/objects/hero/page.tsx +0 -35
  109. package/templates/shopify/schemaTypes/objects/module/accordionBody.ts +0 -45
  110. package/templates/shopify/schemaTypes/objects/module/gridItem.ts +0 -91
  111. package/templates/shopify/schemaTypes/objects/seo/description.tsx +0 -10
  112. package/templates/shopify/schemaTypes/objects/seo/home.tsx +0 -31
  113. package/templates/shopify/schemaTypes/objects/seo/page.tsx +0 -37
  114. package/templates/shopify/schemaTypes/objects/seo/shopify.tsx +0 -40
  115. package/templates/shopify/schemaTypes/singletons/home.ts +0 -62
  116. /package/lib/{dts/src/index.d.ts → index.d.mts} +0 -0
@@ -1,91 +0,0 @@
1
- import {defineField} from 'sanity'
2
-
3
- import blocksToText from '../../../utils/blocksToText'
4
-
5
- export default defineField({
6
- name: 'gridItem',
7
- title: 'Item',
8
- type: 'object',
9
- fields: [
10
- // Title
11
- defineField({
12
- name: 'title',
13
- title: 'Title',
14
- type: 'string',
15
- validation: (Rule) => Rule.required(),
16
- }),
17
- // Image
18
- defineField({
19
- name: 'image',
20
- title: 'Image',
21
- type: 'image',
22
- options: {hotspot: true},
23
- validation: (Rule) => Rule.required(),
24
- }),
25
- // Body
26
- defineField({
27
- name: 'body',
28
- title: 'Body',
29
- type: 'array',
30
- of: [
31
- {
32
- lists: [],
33
- marks: {
34
- annotations: [
35
- // Product
36
- {
37
- name: 'annotationProduct',
38
- type: 'annotationProduct',
39
- },
40
- // Email
41
- {
42
- name: 'annotationLinkEmail',
43
- type: 'annotationLinkEmail',
44
- },
45
- // Internal link
46
- {
47
- name: 'annotationLinkInternal',
48
- type: 'annotationLinkInternal',
49
- },
50
- // URL
51
- {
52
- name: 'annotationLinkExternal',
53
- type: 'annotationLinkExternal',
54
- },
55
- ],
56
- decorators: [
57
- {
58
- title: 'Italic',
59
- value: 'em',
60
- },
61
- {
62
- title: 'Strong',
63
- value: 'strong',
64
- },
65
- ],
66
- },
67
- // Regular styles
68
- styles: [],
69
- // Paragraphs
70
- type: 'block',
71
- },
72
- ],
73
- validation: (Rule) => Rule.required(),
74
- }),
75
- ],
76
- preview: {
77
- select: {
78
- body: 'body',
79
- image: 'image',
80
- title: 'title',
81
- },
82
- prepare(selection) {
83
- const {body, image, title} = selection
84
- return {
85
- media: image,
86
- subtitle: body && blocksToText(body),
87
- title,
88
- }
89
- },
90
- },
91
- })
@@ -1,10 +0,0 @@
1
- import {defineField} from 'sanity'
2
-
3
- export default defineField({
4
- name: 'seo.description',
5
- title: 'Description',
6
- type: 'text',
7
- rows: 3,
8
- validation: (Rule) =>
9
- Rule.max(150).warning('Longer descriptions may be truncated by search engines'),
10
- })
@@ -1,31 +0,0 @@
1
- import {defineField} from 'sanity'
2
-
3
- export default defineField({
4
- name: 'seo.home',
5
- title: 'SEO',
6
- type: 'object',
7
- options: {
8
- collapsed: false,
9
- collapsible: true,
10
- },
11
- fields: [
12
- defineField({
13
- name: 'title',
14
- title: 'Title',
15
- type: 'string',
16
- validation: (Rule) =>
17
- Rule.max(50).warning('Longer titles may be truncated by search engines'),
18
- }),
19
- defineField({
20
- name: 'description',
21
- title: 'Description',
22
- type: 'seo.description',
23
- }),
24
- defineField({
25
- name: 'image',
26
- title: 'Image',
27
- type: 'image',
28
- }),
29
- ],
30
- validation: (Rule) => Rule.required(),
31
- })
@@ -1,37 +0,0 @@
1
- import React from 'react'
2
- import {defineField} from 'sanity'
3
-
4
- export default defineField({
5
- name: 'seo.page',
6
- title: 'SEO',
7
- type: 'object',
8
- options: {
9
- collapsed: false,
10
- collapsible: true,
11
- },
12
- fields: [
13
- defineField({
14
- name: 'title',
15
- title: 'Title',
16
- type: 'placeholderString',
17
- description: (
18
- <>
19
- If empty, displays the document title (<code>title</code>)
20
- </>
21
- ),
22
- options: {field: 'title'},
23
- validation: (Rule) =>
24
- Rule.max(50).warning('Longer titles may be truncated by search engines'),
25
- }),
26
- defineField({
27
- name: 'description',
28
- title: 'Description',
29
- type: 'seo.description',
30
- }),
31
- defineField({
32
- name: 'image',
33
- title: 'Image',
34
- type: 'image',
35
- }),
36
- ],
37
- })
@@ -1,40 +0,0 @@
1
- import React from 'react'
2
- import {defineField} from 'sanity'
3
-
4
- export default defineField({
5
- name: 'seo.shopify',
6
- title: 'SEO',
7
- type: 'object',
8
- description: <></>,
9
- options: {
10
- collapsed: false,
11
- collapsible: true,
12
- },
13
- fields: [
14
- {
15
- name: 'title',
16
- title: 'Title',
17
- type: 'placeholderString',
18
- description: (
19
- <>
20
- If empty, displays the default Shopify document title (<code>store.title</code>)
21
- </>
22
- ),
23
- options: {
24
- field: 'store.title',
25
- },
26
- validation: (Rule) =>
27
- Rule.max(50).warning('Longer titles may be truncated by search engines'),
28
- },
29
- {
30
- name: 'description',
31
- title: 'Description',
32
- type: 'seo.description',
33
- },
34
- {
35
- name: 'image',
36
- title: 'Image',
37
- type: 'image',
38
- },
39
- ],
40
- })
@@ -1,62 +0,0 @@
1
- import {HomeIcon} from '@sanity/icons'
2
- import {defineField} from 'sanity'
3
-
4
- const TITLE = 'Home'
5
-
6
- export default defineField({
7
- name: 'home',
8
- title: TITLE,
9
- type: 'document',
10
- icon: HomeIcon,
11
- groups: [
12
- {
13
- default: true,
14
- name: 'editorial',
15
- title: 'Editorial',
16
- },
17
- {
18
- name: 'seo',
19
- title: 'SEO',
20
- },
21
- ],
22
- fields: [
23
- // Hero
24
- defineField({
25
- name: 'hero',
26
- title: 'Hero',
27
- type: 'hero.home',
28
- group: 'editorial',
29
- }),
30
- // Modules
31
- defineField({
32
- name: 'modules',
33
- title: 'Modules',
34
- type: 'array',
35
- of: [
36
- {type: 'module.callout'},
37
- {type: 'module.callToAction'},
38
- {type: 'module.collection'},
39
- {type: 'module.image'},
40
- {type: 'module.instagram'},
41
- {type: 'module.product'},
42
- ],
43
- group: 'editorial',
44
- }),
45
- // SEO
46
- defineField({
47
- name: 'seo',
48
- title: 'SEO',
49
- type: 'seo.home',
50
- group: 'seo',
51
- }),
52
- ],
53
- preview: {
54
- prepare() {
55
- return {
56
- // media: icon,
57
- subtitle: 'Index',
58
- title: TITLE,
59
- }
60
- },
61
- },
62
- })
File without changes