-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): complete apidocs for migrations (#5679)
* fix(migrate): add tsdoc config * fix(docs): complete apidocs for migrations Co-Authored-By: Knut Melvær <[email protected]> * fixup! fix(docs): complete apidocs for migrations Co-Authored-By: Knut Melvær <[email protected]> Co-authored-by: Binoy Patel <[email protected]> * fixup! fix(docs): complete apidocs for migrations --------- Co-authored-by: Knut Melvær <[email protected]> Co-authored-by: Binoy Patel <[email protected]>
- Loading branch information
1 parent
ea8f97a
commit 32569be
Showing
11 changed files
with
430 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
import {type Migration} from './types' | ||
|
||
/** | ||
* @public | ||
* | ||
* Helper function for defining a Sanity content migration. This function does not do anything on its own; | ||
* it exists to check that your schema definition is correct, and help autocompletion in your IDE. | ||
* | ||
* {@link https://www.sanity.io/docs/schema-and-content-migrations#af2be129ccd6} | ||
* @example Basic usage | ||
* | ||
* ```ts | ||
* export default defineMigration({ | ||
* title: 'Make sure all strings with “acme” is uppercased to “ACME”', | ||
* migrate: { | ||
* string(node, path, context) { | ||
* if (node === "acme") { | ||
* return set(node.toUpperCase()) | ||
* } | ||
* }, | ||
* }, | ||
* }) | ||
* ``` | ||
* @param migration - The migration definition | ||
* | ||
* See {@link Migration} | ||
*/ | ||
export function defineMigration<T extends Migration>(migration: T): T { | ||
return migration | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.