template.json
.NET template files
| Type | object |
|---|---|
| File match |
**/.template.config/template.json
|
| Schema URL | https://catalog.lintel.tools/schemas/schemastore/template-json/latest.json |
| Source | https://www.schemastore.org/template.json |
Validate with Lintel
npx @lintel/lintel check
Properties
The author of the template.
Zero or more characteristics of the template that a user might search for it by.
A unique name for this template.
The name for the template that users should see.
Common information about templates, these are effectively interchangeable with choice type parameter symbols.
2 nested properties
The type of template: project or item.
The programming language the template primarily contains or is intended for use with.
The name to use during creation if no name has been specified by the user or provided from the host.
The semantic version range of the Microsoft.TemplateEngine.Orchestrator.RunnableProjects package that this template is usable with. In older versions of the engine, the four octet version string is used but is matched against a constant which was never changed from 1.0.0.0 - either syntax is now accepted, however the four octet string will not be changed from 1.0.0.0.
The ID of the group this template belongs to. When combined with the "tags" section, this allows multiple templates to be displayed as one, with the the decision for which one to use being presented as a choice in each one of the pivot categories (keys).
A list of guids which appear in the template source and should be replaced in the template output. For each guid listed, a replacement guid is generated, and replaces all occurrences of the source guid in the output.
A filename that will be completely ignored except to indicate that its containing directory should be copied. This allows creation of an empty directory in the created template, by having a corresponding source directory containing just the placeholder file. Completely empty directories are ignored.
Defines an ordered list of actions to perform after template generation. The post action information is provided to the creation broker, to act on as appropriate.
A value used to determine how preferred this template is among the other templates with the same groupIdentity (higher values are more preferred).
Indicated which behaviour to use when no --name is specified during template creation. If true it will use the template's defaultName. If no defaultName is found, or preferDefaultName is false it uses the fallback (output folder).
Indicates whether to create a directory for the template if name is specified but an output directory is not set (instead of creating the content directly in the current directory).
A list of important output paths created during template generation. These paths need to be added to the newly created project at the end of template creation.
The text in the source content to replace with the name the user specifies. The value of the 'sourceName' is available in built-in 'name' symbol that can be used as the source for creating other symbols and condition expressions. See important information about how to select correct 'sourceName' in https://github.com/dotnet/templating/wiki/Naming-and-default-value-forms.
The set of mappings in the template content to user directories.
{
"source": "./",
"target": "./"
}
Custom value forms used by the template.
The symbols section defines variables and their values, the values may be the defined in terms of other symbols. When a defined symbol name is encountered anywhere in the template definition, it is replaced by the value defined in this configuration. The symbols configuration is a collection of key-value pairs. The keys are the symbol names, and the value contains key-value-pair configuration information on how to assign the symbol a value.
Alternate sets of defaults for symbols.
An URL for a document indicating any libraries used by the template that are not owned/provided by the template author.
A description of the template's purpose or contents for use in help.
The constraints section defines the restrictions when the template can be run. Available since .NET SDK 7.0.100.
Definitions
Indicates limitations on the valid values a symbol may be assigned. When specified, the symbol value is attempted to be converted to this type. The datatype "choice" is supported only for parameter symbols and requires providing symbols.choices configuration for the symbol.
1 nested properties
The constant value to be assigned to the symbol.
2 nested properties
This property is not maintained and may be removed in the future. Use defaultFormat instead, or use 'guids' section.
The format of guid to be generated. Accepts a single value from ('n', 'd', 'b', 'p', 'x') for lowercase output or ('N', 'D', 'B', 'P', 'X') for uppercase output. The formats are defined in Guid.ToString() method documentation.
2 nested properties
The format string to use when converting the date-time to a string representation.
If true, use UTC time. If false, use local time.
2 nested properties
An integer value indicating the low-end of the range to generate the random number in.
An integer value indicating the high-end of the range to generate the random number in. If not explicitly provided, defaults to int.MaxValue.
2 nested properties
The name of a different parameter in the template configuration. A copy of its value will be used by this generator's regex to generate the value for this parameter. The value of the source parameter is not modified.
An ordered list of key-value pairs indicating the regex replacement actions. Each element of the list must contain exactly the keys 'regex' and 'replacement' - along with their values. These replacements will be applied to the result of the previous replacement (except the first, which acts on the original value from the source).
2 nested properties
The symbol to search for a match. Its value will be used by this generator's regex to evaluate if there is a match. The value of the source parameter is not modified.
The regular expression to use to match.
3 nested properties
The name of the symbol whose value will be inspected - if the value is effectively equal to the default value, the value of the symbol referred to by fallbackVariableName is used, otherwise the value of this symbol.
The name of the symbol to return the value of if the symbol referred to by sourceVariableName has a value equal to the value of defaultValue.
The value to consider as being the default - if the value of the symbol referred to by sourceVariableName is equal to this, the value of the symbol referred to in fallbackVariableName is used instead.
2 nested properties
The name of the symbol whose value should have its case changed.
Whether the case changed to should be lower case, if false, the value is made to be uppercase instead.
3 nested properties
The lower bound of acceptable port numbers.
The upper bound of acceptable port numbers.
The port number to use if no free ports could be found.
3 nested properties
The style of evaluator to use.
Indicates limitations on the valid values a symbol may be assigned. When specified, the symbol value is attempted to be converted to this type. The datatype "choice" is supported only for parameter symbols and requires providing symbols.choices configuration for the symbol.
The set of cases to test for. The first one, in document order, to return true's value is used, if none return true, empty string is returned.
3 nested properties
The value used as the separator between the values to be concatenated, notice that you can use "/" as folder separator also on Windows since File API will convert it into "".
Indication whether null and empty strings should be removed from joining to prevent repetitive separators.
All values to concatenate.
A guid string to be replaced in source files. Format and casing is not significant in the config as format and casing is preserved based on the particular guid in processed file(s).
Boolean condition to indicate if the sources configuration should be included or ignored. If the condition evaluates to true or is not provided, the sources config will be used for creating the template. If it evaluates to false, the sources config will be ignored.
The set of globbing patterns indicating the content that was included by sources.include that should not be processed.
[
"**/[Bb]in/**",
"**/[Oo]bj/**",
".template.config/**/*",
"**/*.filelist",
"**/*.user",
"**/*.lock.json"
]
The set of globbing patterns indicating the content to process in the path referred to by the source.
[
"**/*"
]
The set of globbing patterns indicating the content that was included by sources.include, that hasn't been excluded by sources.exclude that should be placed in the user's directory without modification.
[
"**/node_modules/**/*"
]
The set of explicit renames to perform. Each key is a path to a file in the source, each value is a path to the target location.
A list of additional source information which gets added to the top-level source information, based on evaluation the corresponding source.modifiers.condition.
The path in the template content (relative to the directory containing the .template.config folder) that should be processed.
The path (relative to the directory the user has specified) that content should be written to.