@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,6 +1,6 @@
1
- import {defineField} from 'sanity'
1
+ import {defineArrayMember, defineField} from 'sanity'
2
2
 
3
- export default defineField({
3
+ export const shopifyProductType = defineField({
4
4
  name: 'shopifyProduct',
5
5
  title: 'Shopify',
6
6
  type: 'object',
@@ -31,131 +31,101 @@ export default defineField({
31
31
  },
32
32
  ],
33
33
  fields: [
34
- // Created at
35
34
  defineField({
36
35
  fieldset: 'status',
37
36
  name: 'createdAt',
38
- title: 'Created at',
39
37
  type: 'string',
40
38
  }),
41
- // Updated at
42
39
  defineField({
43
40
  fieldset: 'status',
44
41
  name: 'updatedAt',
45
- title: 'Updated at',
46
42
  type: 'string',
47
43
  }),
48
- // Product status
49
44
  defineField({
50
45
  fieldset: 'status',
51
46
  name: 'status',
52
- title: 'Product status',
53
47
  type: 'string',
54
48
  options: {
55
49
  layout: 'dropdown',
56
50
  list: ['active', 'archived', 'draft'],
57
51
  },
58
52
  }),
59
- // Deleted
60
53
  defineField({
61
54
  fieldset: 'status',
62
55
  name: 'isDeleted',
63
56
  title: 'Deleted from Shopify?',
64
57
  type: 'boolean',
65
58
  }),
66
- // Title
67
59
  defineField({
68
60
  name: 'title',
69
- title: 'Title',
70
61
  type: 'string',
71
62
  description: 'Title displayed in both cart and checkout',
72
63
  }),
73
- // Product ID
74
64
  defineField({
75
65
  name: 'id',
76
66
  title: 'ID',
77
67
  type: 'number',
78
68
  description: 'Shopify Product ID',
79
69
  }),
80
- // Product ID
81
70
  defineField({
82
71
  name: 'gid',
83
72
  title: 'GID',
84
73
  type: 'string',
85
74
  description: 'Shopify Product GID',
86
75
  }),
87
- // Slug
88
76
  defineField({
89
77
  name: 'slug',
90
- title: 'Slug',
91
78
  type: 'slug',
92
79
  description: 'Shopify Product handle',
93
80
  }),
94
- // Description
95
81
  defineField({
96
82
  name: 'descriptionHtml',
97
83
  title: 'HTML Description',
98
84
  type: 'text',
99
85
  rows: 5,
100
86
  }),
101
- // Product Type
102
87
  defineField({
103
88
  fieldset: 'organization',
104
89
  name: 'productType',
105
- title: 'Product type',
106
90
  type: 'string',
107
91
  }),
108
- // Vendor
109
92
  defineField({
110
93
  fieldset: 'organization',
111
94
  name: 'vendor',
112
- title: 'Vendor',
113
95
  type: 'string',
114
96
  }),
115
- // Tags
116
97
  defineField({
117
98
  fieldset: 'organization',
118
99
  name: 'tags',
119
- title: 'Tags',
120
100
  type: 'string',
121
101
  }),
122
- // Price range
123
102
  defineField({
124
103
  name: 'priceRange',
125
- title: 'Price range',
126
104
  type: 'priceRange',
127
105
  }),
128
- // Preview Image URL
129
106
  defineField({
130
107
  name: 'previewImageUrl',
131
108
  title: 'Preview Image URL',
132
109
  type: 'string',
133
110
  description: 'Image displayed in both cart and checkout',
134
111
  }),
135
- // Options
136
112
  defineField({
137
113
  name: 'options',
138
- title: 'Options',
139
114
  type: 'array',
140
- of: [
141
- {
142
- type: 'option',
143
- },
115
+ of: [{type: 'option'},
144
116
  ],
145
117
  }),
146
- // Variants
147
118
  defineField({
148
119
  fieldset: 'variants',
149
120
  name: 'variants',
150
- title: 'Variants',
151
121
  type: 'array',
152
122
  of: [
153
- {
123
+ defineArrayMember({
154
124
  title: 'Variant',
155
125
  type: 'reference',
156
126
  weak: true,
157
127
  to: [{type: 'productVariant'}],
158
- },
128
+ }),
159
129
  ],
160
130
  }),
161
131
  ],
@@ -1,6 +1,6 @@
1
1
  import {defineField} from 'sanity'
2
2
 
3
- export default defineField({
3
+ export const shopifyProductVariantType = defineField({
4
4
  name: 'shopifyProductVariant',
5
5
  title: 'Shopify',
6
6
  type: 'object',
@@ -22,25 +22,19 @@ export default defineField({
22
22
  },
23
23
  ],
24
24
  fields: [
25
- // Created at
26
25
  defineField({
27
26
  fieldset: 'status',
28
27
  name: 'createdAt',
29
- title: 'Created at',
30
28
  type: 'string',
31
29
  }),
32
- // Updated at
33
30
  defineField({
34
31
  fieldset: 'status',
35
32
  name: 'updatedAt',
36
- title: 'Updated at',
37
33
  type: 'string',
38
34
  }),
39
- // Product status
40
35
  defineField({
41
36
  fieldset: 'status',
42
37
  name: 'status',
43
- title: 'Product status',
44
38
  type: 'string',
45
39
  options: {
46
40
  layout: 'dropdown',
@@ -48,91 +42,71 @@ export default defineField({
48
42
  },
49
43
  validation: (Rule) => Rule.required(),
50
44
  }),
51
- // Deleted
52
45
  defineField({
53
46
  fieldset: 'status',
54
47
  name: 'isDeleted',
55
48
  title: 'Deleted from Shopify?',
56
49
  type: 'boolean',
57
50
  }),
58
- // Title
59
51
  defineField({
60
52
  name: 'title',
61
- title: 'Title',
62
53
  type: 'string',
63
54
  }),
64
- // SKU
65
55
  defineField({
66
56
  name: 'sku',
67
57
  title: 'SKU',
68
58
  type: 'string',
69
59
  }),
70
- // ID
71
60
  defineField({
72
61
  name: 'id',
73
62
  title: 'ID',
74
63
  type: 'number',
75
64
  description: 'Shopify Product Variant ID',
76
65
  }),
77
- // GID
78
66
  defineField({
79
67
  name: 'gid',
80
68
  title: 'GID',
81
69
  type: 'string',
82
70
  description: 'Shopify Product Variant GID',
83
71
  }),
84
- // Product ID
85
72
  defineField({
86
73
  name: 'productId',
87
74
  title: 'Product ID',
88
75
  type: 'number',
89
76
  }),
90
- // Product GID
91
77
  defineField({
92
78
  name: 'productGid',
93
79
  title: 'Product GID',
94
80
  type: 'string',
95
81
  }),
96
- // Price
97
82
  defineField({
98
83
  name: 'price',
99
- title: 'Price',
100
84
  type: 'number',
101
85
  }),
102
- // Compare at price
103
86
  defineField({
104
87
  name: 'compareAtPrice',
105
- title: 'Compare at price',
106
88
  type: 'number',
107
89
  }),
108
- // Inventory
109
90
  defineField({
110
91
  name: 'inventory',
111
- title: 'Inventory',
112
92
  type: 'inventory',
113
93
  options: {
114
94
  columns: 3,
115
95
  },
116
96
  }),
117
- // Option 1
118
97
  defineField({
119
98
  fieldset: 'options',
120
99
  name: 'option1',
121
- title: 'Option 1',
122
100
  type: 'string',
123
101
  }),
124
- // Option 2
125
102
  defineField({
126
103
  fieldset: 'options',
127
104
  name: 'option2',
128
- title: 'Option 2',
129
105
  type: 'string',
130
106
  }),
131
- // Option 3
132
107
  defineField({
133
108
  fieldset: 'options',
134
109
  name: 'option3',
135
- title: 'Option 3',
136
110
  type: 'string',
137
111
  }),
138
112
  // Preview Image URL
@@ -0,0 +1,45 @@
1
+ import {defineArrayMember, defineField} from 'sanity'
2
+
3
+ export const portableTextSimpleType = defineField({
4
+ name: 'portableTextSimple',
5
+ type: 'array',
6
+ of: [
7
+ defineArrayMember({
8
+ lists: [
9
+ {title: 'Bullet', value: 'bullet'},
10
+ {title: 'Numbered', value: 'number'},
11
+ ],
12
+ marks: {
13
+ decorators: [
14
+ {
15
+ title: 'Italic',
16
+ value: 'em',
17
+ },
18
+ {
19
+ title: 'Strong',
20
+ value: 'strong',
21
+ },
22
+ ],
23
+ annotations: [
24
+ {
25
+ name: 'linkProduct',
26
+ type: 'linkProduct',
27
+ },
28
+ {
29
+ name: 'linkEmail',
30
+ type: 'linkEmail',
31
+ },
32
+ {
33
+ name: 'linkInternal',
34
+ type: 'linkInternal',
35
+ },
36
+ {
37
+ name: 'linkExternal',
38
+ type: 'linkExternal',
39
+ },
40
+ ],
41
+ },
42
+ type: 'block',
43
+ }),
44
+ ],
45
+ })
@@ -0,0 +1,52 @@
1
+ import {defineArrayMember, defineField} from 'sanity'
2
+
3
+ export const portableTextType = defineField({
4
+ name: 'portableText',
5
+ type: 'array',
6
+ of: [
7
+ defineArrayMember({
8
+ lists: [
9
+ {title: 'Bullet', value: 'bullet'},
10
+ {title: 'Numbered', value: 'number'},
11
+ ],
12
+ marks: {
13
+ decorators: [
14
+ {
15
+ title: 'Italic',
16
+ value: 'em',
17
+ },
18
+ {
19
+ title: 'Strong',
20
+ value: 'strong',
21
+ },
22
+ ],
23
+ annotations: [
24
+ {
25
+ name: 'linkProduct',
26
+ type: 'linkProduct',
27
+ },
28
+ {
29
+ name: 'linkEmail',
30
+ type: 'linkEmail',
31
+ },
32
+ {
33
+ name: 'linkInternal',
34
+ type: 'linkInternal',
35
+ },
36
+ {
37
+ name: 'linkExternal',
38
+ type: 'linkExternal',
39
+ },
40
+ ],
41
+ },
42
+ type: 'block',
43
+ }),
44
+ defineArrayMember({ type: 'accordion' }),
45
+ defineArrayMember({ type: 'callout' }),
46
+ defineArrayMember({ type: 'grid' }),
47
+ defineArrayMember({ type: 'images' }),
48
+ defineArrayMember({ type: 'imageWithProductHotspots', title: 'Image with Hotspots' }),
49
+ defineArrayMember({ type: 'instagram' }),
50
+ defineArrayMember({ type: 'products' }),
51
+ ],
52
+ })
@@ -0,0 +1,49 @@
1
+ import {HomeIcon} from '@sanity/icons'
2
+ import {defineArrayMember, defineField} from 'sanity'
3
+ import { GROUPS } from '../../constants'
4
+
5
+ const TITLE = 'Home'
6
+
7
+ export const homeType = defineField({
8
+ name: 'home',
9
+ title: TITLE,
10
+ type: 'document',
11
+ icon: HomeIcon,
12
+ groups: GROUPS,
13
+ fields: [
14
+ defineField({
15
+ name: 'hero',
16
+ type: 'hero',
17
+ group: 'editorial',
18
+ }),
19
+ defineField({
20
+ name: 'modules',
21
+ type: 'array',
22
+ of: [
23
+ defineArrayMember({ type: 'accordion' }),
24
+ defineArrayMember({ type: 'callout' }),
25
+ defineArrayMember({ type: 'grid' }),
26
+ defineArrayMember({ type: 'images' }),
27
+ defineArrayMember({ type: 'imageWithProductHotspots', title: 'Image with Hotspots' }),
28
+ defineArrayMember({ type: 'instagram' }),
29
+ defineArrayMember({ type: 'products' }),
30
+ ],
31
+ group: 'editorial',
32
+ }),
33
+ defineField({
34
+ name: 'seo',
35
+ title: 'SEO',
36
+ type: 'seo',
37
+ group: 'seo',
38
+ }),
39
+ ],
40
+ preview: {
41
+ prepare() {
42
+ return {
43
+ media: HomeIcon,
44
+ subtitle: 'Index',
45
+ title: TITLE,
46
+ }
47
+ },
48
+ },
49
+ })
@@ -1,4 +1,4 @@
1
- import {CogIcon} from '@sanity/icons'
1
+ import {CogIcon, ControlsIcon, ErrorOutlineIcon, MenuIcon, SearchIcon} from '@sanity/icons'
2
2
  import {defineType, defineField} from 'sanity'
3
3
 
4
4
  const TITLE = 'Settings'
@@ -6,7 +6,7 @@ interface ProductOptions {
6
6
  title: string
7
7
  }
8
8
 
9
- export default defineType({
9
+ export const settingsType = defineType({
10
10
  name: 'settings',
11
11
  title: TITLE,
12
12
  type: 'document',
@@ -16,39 +16,37 @@ export default defineType({
16
16
  default: true,
17
17
  name: 'navigation',
18
18
  title: 'Navigation',
19
+ icon: MenuIcon,
19
20
  },
20
21
  {
21
22
  name: 'productOptions',
22
23
  title: 'Product options',
24
+ icon: ControlsIcon,
23
25
  },
24
26
  {
25
27
  name: 'notFoundPage',
26
28
  title: '404 page',
29
+ icon: ErrorOutlineIcon,
27
30
  },
28
31
  {
29
32
  name: 'seo',
30
33
  title: 'SEO',
34
+ icon: SearchIcon,
31
35
  },
32
36
  ],
33
37
  fields: [
34
- // Menu
35
38
  defineField({
36
39
  name: 'menu',
37
- title: 'Menu',
38
- type: 'menuSettings',
40
+ type: 'menu',
39
41
  group: 'navigation',
40
42
  }),
41
- // Footer
42
43
  defineField({
43
44
  name: 'footer',
44
- title: 'Footer',
45
45
  type: 'footerSettings',
46
46
  group: 'navigation',
47
47
  }),
48
- // Custom product options
49
48
  defineField({
50
49
  name: 'customProductOptions',
51
- title: 'Custom product options',
52
50
  type: 'array',
53
51
  group: 'productOptions',
54
52
  of: [
@@ -4,19 +4,19 @@ export const collectionUrl = (collectionId: number) => {
4
4
  if (!SHOPIFY_STORE_ID) {
5
5
  return null
6
6
  }
7
- return `https://${SHOPIFY_STORE_ID}/admin/collections/${collectionId}`
7
+ return `https://admin.shopify.com/store/${SHOPIFY_STORE_ID}/collections/${collectionId}`
8
8
  }
9
9
 
10
10
  export const productUrl = (productId: number) => {
11
11
  if (!SHOPIFY_STORE_ID) {
12
12
  return null
13
13
  }
14
- return `https://${SHOPIFY_STORE_ID}/admin/products/${productId}`
14
+ return `https://admin.shopify.com/store/${SHOPIFY_STORE_ID}/products/${productId}`
15
15
  }
16
16
 
17
17
  export const productVariantUrl = (productId: number, productVariantId: number) => {
18
18
  if (!SHOPIFY_STORE_ID) {
19
19
  return null
20
20
  }
21
- return `https://${SHOPIFY_STORE_ID}/admin/products/${productId}/variants/${productVariantId}`
21
+ return `https://admin.shopify.com/store/${SHOPIFY_STORE_ID}/products/${productId}/variants/${productVariantId}`
22
22
  }
@@ -1,10 +1,9 @@
1
- import {Rule, Slug} from 'sanity'
2
- import slug from 'slug'
1
+ import {SlugRule} from 'sanity'
3
2
 
4
3
  const MAX_LENGTH = 96
5
4
 
6
- export const validateSlug = (Rule: Rule) => {
7
- return Rule.required().custom(async (value: Slug) => {
5
+ export const validateSlug = (Rule: SlugRule) => {
6
+ return Rule.required().custom((value) => {
8
7
  const currentSlug = value && value.current
9
8
  if (!currentSlug) {
10
9
  return true
@@ -14,9 +13,6 @@ export const validateSlug = (Rule: Rule) => {
14
13
  return `Must be less than ${MAX_LENGTH} characters`
15
14
  }
16
15
 
17
- if (currentSlug !== slug(currentSlug, {lower: true})) {
18
- return 'Must be a valid slug'
19
- }
20
16
  return true
21
17
  })
22
18
  }