Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename "schemas" to the more correct plural "schemaTypes" #5513

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev/studio-e2e-testing/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {copyAction} from 'sanity-test-studio/fieldActions/copyAction'
import {assistFieldActionGroup} from 'sanity-test-studio/fieldActions/assistFieldActionGroup'
import {customInspector} from 'sanity-test-studio/inspectors/custom'
import {pasteAction} from 'sanity-test-studio/fieldActions/pasteAction'
import {schemaTypes} from './schemas'
import {schemaTypes} from './schemaTypes'
import {customComponents} from './components-api'

const sharedSettings = definePlugin({
Expand Down
2 changes: 1 addition & 1 deletion examples/blog-studio/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {schemaTypes} from '../../packages/@sanity/cli/templates/blog/schemas'
import {schemaTypes} from '../../packages/@sanity/cli/templates/blog/schemaTypes'

export default defineConfig({
name: 'default',
Expand Down
2 changes: 1 addition & 1 deletion examples/clean-studio/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {schemaTypes} from '../../packages/@sanity/cli/templates/clean/schemas'
import {schemaTypes} from '../../packages/@sanity/cli/templates/clean/schemaTypes'

export default defineConfig({
name: 'default',
Expand Down
2 changes: 1 addition & 1 deletion examples/ecommerce-studio/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {schemaTypes} from '../../packages/@sanity/cli/templates/ecommerce/schemas'
import {schemaTypes} from '../../packages/@sanity/cli/templates/ecommerce/schemaTypes'
import {barcodeInput} from './plugins/barcode-input'

export default defineConfig({
Expand Down
2 changes: 1 addition & 1 deletion examples/movies-studio/sanity.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {googleMapsInput} from '@sanity/google-maps-input'

import {schemaTypes} from '../../packages/@sanity/cli/templates/moviedb/schemas'
import {schemaTypes} from '../../packages/@sanity/cli/templates/moviedb/schemaTypes'
import {BrandLogo} from './components/BrandLogo'

export default defineConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const defaultTemplate = `
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {visionTool} from '@sanity/vision'
import {schemaTypes} from './schemas'
import {schemaTypes} from './schemaTypes'

export default defineConfig({
name: '%sourceName%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ export default async function initSanity(
},
{
value: 'clean',
name: 'Clean project with no predefined schemas',
name: 'Clean project with no predefined schema types',
},
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function promptForNextTemplate(prompt: CliPrompter): Promise<'clean' | 'b
choices: [
{
value: 'clean',
name: 'Clean project with no predefined schemas',
name: 'Clean project with no predefined schema types',
},
{
value: 'blog',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const configTemplate = `
import {defineConfig, isDev} from 'sanity'
import {visionTool} from '@sanity/vision'
import {structureTool} from 'sanity/structure'
import {schemaTypes} from './schemas'
import {schemaTypes} from './schemaTypes'
import {getStartedPlugin} from './plugins/sanity-plugin-tutorial'

const devOnlyPlugins = [getStartedPlugin()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {visionTool} from '@sanity/vision'
//import {googleMapsInput} from '@sanity/google-maps-input'
import {schemaTypes} from './schemas'
import {schemaTypes} from './schemaTypes'

export default defineConfig({
name: '%sourceName%',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {blogSchemaFolder, blogSchemaTS, blogSchemaJS} from './schemas/blog'
import {blogSchemaFolder, blogSchemaTS, blogSchemaJS} from './schemaTypes/blog'

export const sanityConfigTemplate = `/**
* This configuration is used to for the Sanity Studio that’s mounted on the \`:route:\` route
Expand Down Expand Up @@ -188,7 +188,7 @@ export const sanityFolder = (
}

if (isBlogTemplate) {
structure.schemas = blogSchemaFolder(useTypeScript)
structure.schemaTypes = blogSchemaFolder(useTypeScript)
}

return structure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,20 +458,20 @@ const postJS = `export const post = {

export const blogSchemaTS = `import { type SchemaTypeDefinition } from 'sanity'

import blockContent from './schemas/blockContent'
import category from './schemas/category'
import post from './schemas/post'
import author from './schemas/author'
import blockContent from './schemaTypes/blockContent'
import category from './schemaTypes/category'
import post from './schemaTypes/post'
import author from './schemaTypes/author'

export const schema: { types: SchemaTypeDefinition[] } = {
types: [post, author, category, blockContent],
}
`

export const blogSchemaJS = `import {blockContent} from './schemas/blockContent'
import {category} from './schemas/category'
import {post} from './schemas/post'
import {author} from './schemas/author'
export const blogSchemaJS = `import {blockContent} from './schemaTypes/blockContent'
import {category} from './schemaTypes/category'
import {post} from './schemaTypes/post'
import {author} from './schemaTypes/author'

export const schema = {
types: [post, author, category, blockContent],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const configTemplate = `
import {defineConfig, isDev} from 'sanity'

import {structureTool} from 'sanity/structure'
import {schemaTypes} from './schemas'
import {schemaTypes} from './schemaTypes'
import {structure} from './structure'

import {visionTool} from '@sanity/vision'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {defineConfig, isDev} from 'sanity'
import {structureTool} from 'sanity/structure'
import {visionTool} from '@sanity/vision'
import {shopifyDocumentActions} from './plugins/shopifyDocumentActions'
import {schemaTypes} from './schemas'
import {schemaTypes} from './schemaTypes'
import {structure} from './structure'
import {SHOPIFY_STORE_ID} from './constants'

Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/cli/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export interface GraphQLAPIConfig {

/**
* Define document interface fields (`_id`, `_type` etc) as non-nullable.
* If you never use a document type as an object (within other documents) in your schemas,
* If you never use a document type as an object (within other documents) in your schema types,
* you can (and probably should) set this to `true`. Because a document type _could_ be used
* inside other documents, it is by default set to `false`, as in these cases these fields
* _can_ be null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const GetStartedTutorial = () => {
size={isSmallScreen ? 1 : undefined}
align={isSmallScreen ? 'left' : 'center'}
>
Next, our docs will guide you through building schemas, adding content, and connecting
Next, our docs will guide you through building schema types, adding content, and connecting
a frontend. You’ll see updates reflected in your Studio below.
</TextContainer>
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you're building a headless storefront, you may want to check out our [starter

## Features

This studio comes preconfigured with Shopify-friendly content schemas and a whole host of customizations to make managing Shopify data in your Sanity studio easier. It also comes bundled with our [Shopify asset plugin](https://github.com/sanity-io/sanity-plugin-shopify-assets), which enables you to choose assets from your Shopify store in your Sanity Studio.
This studio comes preconfigured with Shopify-friendly content schema types and a whole host of customizations to make managing Shopify data in your Sanity studio easier. It also comes bundled with our [Shopify asset plugin](https://github.com/sanity-io/sanity-plugin-shopify-assets), which enables you to choose assets from your Shopify store in your Sanity Studio.

Once you have sync'd content to your Shopify store, you can follow our documentation on how to [display content in Liquid](https://www.sanity.io/docs/displaying-sanity-content-in-liquid).

Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/cli/templates/shopify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This studio can be used with our [Hydrogen starter][hydrogen-demo], your fronten

## Features

This studio comes preconfigured with Shopify-friendly content schemas and a whole host of customizations to make managing Shopify data in your Sanity studio easier.
This studio comes preconfigured with Shopify-friendly content schema types and a whole host of customizations to make managing Shopify data in your Sanity studio easier.

It also comes with several convenient layout modules which can be re-used across various pages.

Expand Down
22 changes: 11 additions & 11 deletions packages/@sanity/cli/templates/shopify/docs/features.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Studio features

## Shopify friendly content schemas
## Shopify friendly content schema types

This studio is built to accommodate both collections and products coming from a Shopify Store.

You can use the official [Sanity Connect app on Shopify][sanity-shopify] to sync your Shopify collection and products with your dataset. All your data will be available over APIs that you can access with [`@sanity/client`][docs-js-client] or the [HTTP API][docs-http-api].

Inside `/schemas` you'll find schema definitions for all the content types. They are organized in folders:
Inside `/schemaTypes` you'll find schema definitions for all the content types. They are organized in folders:

- `/schemas/annotations/`: Annotations let editors mark up inline text in the block content editor with rich objects. These can be used to augment editorial content with product information.
- `/schemas/documents/`: Document types determines the shape of the JSON documents that's stored in your content lake. This is where you define the content forms for things like collections, products, product variants, as well as articles.
- `/schemas/objects/`: General purpose & re-usable content structures, such as links, custom product options and modules.
- `/schemaTypes/annotations/`: Annotations let editors mark up inline text in the block content editor with rich objects. These can be used to augment editorial content with product information.
- `/schemaTypes/documents/`: Document types determines the shape of the JSON documents that's stored in your content lake. This is where you define the content forms for things like collections, products, product variants, as well as articles.
- `/schemaTypes/objects/`: General purpose & re-usable content structures, such as links, custom product options and modules.

## Structure

Expand All @@ -27,37 +27,37 @@ Sanity Studio will automatically list all your [document types][docs-document-ty

<p><img width="600" src="https://user-images.githubusercontent.com/209129/173630522-1251875d-175d-430a-bdc7-8923ebe08044.png"></p>

`/schemas/objects/module/callToAction.tsx`
`/schemaTypes/objects/module/callToAction.tsx`

### Callout

<p><img width="600"src="https://user-images.githubusercontent.com/209129/173630517-003a6942-b45e-48d4-8ec6-d87365e957c7.png"></p>

`/schemas/objects/module/callout.tsx`
`/schemaTypes/objects/module/callout.tsx`

### Collection

<p><img width="600" src="https://user-images.githubusercontent.com/209129/173630535-73eab084-f424-435f-b426-7fbc9baed152.png"></p>

`/schemas/objects/module/collection.tsx`
`/schemaTypes/objects/module/collection.tsx`

### Image

<p><img width="600" src="https://user-images.githubusercontent.com/209129/174492490-aefa1a0d-40ea-473d-be73-ba6326d66ee8.png"></p>

`/schemas/objects/module/image.ts`
`/schemaTypes/objects/module/image.ts`

### Instagram

<p><img width="600" src="https://user-images.githubusercontent.com/209129/173630524-b8b7253f-704a-4935-9b66-1c5673477b1c.png"></p>

`/schemas/objects/module/instagram.ts`
`/schemaTypes/objects/module/instagram.ts`

### Product

<p><img width="600" src="https://user-images.githubusercontent.com/209129/173630533-b4a202bd-6385-4eef-a7e2-c67ba596dad1.png"></p>

`/schemas/objects/module/product.tsx`
`/schemaTypes/objects/module/product.tsx`

## Custom document actions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import settings from './settingStructure'
* and `settings` document types as singletons, and grouping product details
* and variants for easy editorial access.
*
* You can customize this even further as your schemas progress.
* You can customize this even further as your schema types progress.
* To learn more about structure builder, visit our docs:
* https://www.sanity.io/docs/overview-structure-builder
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/types/src/schema/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type {FieldDefinitionBase, IntrinsicTypeName} from './definition'
*
* This function will narrow the schema type down to fields and options based on the provided type-string.
*
* Schemas defined using `defineType` should typically be added to the Studio config under `schema.types`.
* Schema types defined using `defineType` should typically be added to the Studio config under `schema.types`.
* Defined types can be referenced by their `name`. This is referred to as a type-alias.
*
* When using type-aliases as `type`, `defineType` cannot know the base-type, so type-safety will be reduced.
Expand Down
2 changes: 1 addition & 1 deletion packages/@sanity/util/src/legacyDateFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type ParseResult = {isValid: boolean; date?: Date; error?: string} & (
)

// todo: find a way to get rid of moment there.
// note: the format comes form peoples schemas, so we need to deprecate it for a while and
// note: the format comes from peoples schema types, so we need to deprecate it for a while and
// find a way to tell people that they need to change it
export function format(input: Date, format: string) {
return moment(input).format(format)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function getRecentStoredSearch(lsKey: string, version: number): StoredSearch {

/**
* Get a list of recent searches from Local Storage.
* Recent searches contain full document schemas.
* Recent searches contain full document schema types.
*/
function getRecentSearchTerms({
lsKey,
Expand Down Expand Up @@ -292,7 +292,7 @@ function verifySearchVersionNumber({
* Sanitize stored search.
*
* Ignore searches containing:
* - Any number of invalid document schemas
* - Any number of invalid document schema types
* - Document types hidden from omnisearch with __experimental_omnisearch_visibility
* - Invalid filters
*
Expand Down
Loading