Configuration
Running the Migration mode in an existing repository will re-run create
on that repository.
You can store persistent customizations to the repository’s template in a configuration file named create.config.js
.
It should export default
a call to a createConfig()
function that takes in a preset imported from a template.
For example, keeping a repository up-to-date with create-typescript-app
’s everything preset:
Running npx create
in a repository with that create.config.js
would be the equivalent of running npx create typescript-app --preset everything
.
createConfig
The exported createConfig
function takes in up to two arguments:
- (required) A preset imported from a package
- (optional) An object containing any customizations to be applied to the preset
addons
Any Addons to be passed to the Blocks that come with the Preset. These will be merged in with Addons provided by other Blocks.
For example, this configuration file adds the word "arethetypeswrong"
to a CSpell Block’s Addons:
Running npx create
in a repository with that configuration file would merge in that words
to the Addons provided to its CSpell Block.
blocks
Any customizations to the Blocks provided as part of the Preset.
add
Any Blocks to add to what the Preset provides.
For example, this configuration file adds in an “arethetypeswrong” Block alongside existing Blocks provided by create-typescript-app
:
Running npx create
in a repository with that configuration file would add in the created outputs from blockAreTheTypesWrong
.
exclude
Any Blocks to exclude from what the Preset provides.
For example, this configuration file omits the default “This package was templated with…” notice that comes with create-typescript-app
:
Running npx create
in a repository with that configuration file would not include that Block, and so its generated README.md would not include the notice.