@sanity/codegen
Version:
Codegen toolkit for Sanity.io
45 lines • 2.38 kB
JSON
{
"commands": {
"typegen:generate": {
"aliases": [],
"args": {},
"description": "Sanity TypeGen\n\nConfiguration:\nThis command can utilize configuration settings defined in a `sanity-typegen.json` file. These settings include:\n\n- \"path\": Specifies a glob pattern to locate your TypeScript or JavaScript files.\n Default: \"./src/**/*.{ts,tsx,js,jsx}\"\n\n- \"schema\": Defines the path to your Sanity schema file. This file should be generated using the `sanity schema extract` command.\n Default: \"schema.json\"\n\n- \"generates\": Indicates the path where the generated TypeScript type definitions will be saved.\n Default: \"./sanity.types.ts\"\n\nThe default configuration values listed above are used if not overridden in your `sanity-typegen.json` configuration file. To customize the behavior of the type generation, adjust these properties in the configuration file according to your project's needs.\n\nNote:\n- The `sanity schema extract` command is a prerequisite for extracting your Sanity Studio schema into a `schema.json` file, which is then used by the `sanity typegen generate` command to generate type definitions.",
"examples": [
{
"command": "<%= config.bin %> <%= command.id %>",
"description": "Generate TypeScript type definitions from a Sanity Studio schema extracted using the `sanity schema extract` command."
}
],
"flags": {
"config-path": {
"description": "[Default: sanity-typegen.json] Specifies the path to the typegen configuration file. This file should be a JSON file that contains settings for the type generation process.",
"name": "config-path",
"hasDynamicHelp": false,
"multiple": false,
"type": "option"
},
"watch": {
"description": "[Default: false] Run the typegen in watch mode",
"name": "watch",
"allowNo": false,
"type": "boolean"
}
},
"hasDynamicHelp": false,
"hiddenAliases": [],
"id": "typegen:generate",
"pluginAlias": "@sanity/codegen",
"pluginName": "@sanity/codegen",
"pluginType": "core",
"strict": true,
"isESM": true,
"relativePath": [
"dist",
"commands",
"typegen",
"generate.js"
]
}
},
"version": "5.10.1"
}