UNPKG

@coat/cli

Version:

TODO: See #3

52 lines (51 loc) 2.01 kB
import { CoatManifestFile } from "./coat-manifest-file"; import { CoatManifestScript } from "./coat-manifest-script"; import { CoatManifestTask } from "./coat-manifest-tasks"; export interface CoatManifest { /** * The name of the coat project or template */ name?: string; /** * The names of the coat templates that are extended. * * The names are used to resolve the template from the node_modules folder * and should bear the name of the dependency. * * It is also possible to reference local coat template files by * specifying relative paths, e.g.: * * "./template-1" -> project-dir/template-1 or project-dir/template-1/index.js * * In addition to plain strings, extends array entries can also be tuples, where * the first entry is the template name or path and the second entry is the config * that is passed to the template function, e.g.: * ["my-template", { "configValue": true }] */ extends?: string | (string | [string, Record<string, unknown>])[]; /** * Dependencies that should be applied to the root package.json file */ dependencies?: { dependencies?: Partial<Record<string, string>>; devDependencies?: Partial<Record<string, string>>; peerDependencies?: Partial<Record<string, string>>; optionalDependencies?: Partial<Record<string, string>>; }; /** * The files that should be generated by coat */ files?: CoatManifestFile[]; /** * Scripts that should be placed in the root package.json file */ scripts?: CoatManifestScript[]; /** * Setup tasks that should be run before the files are generated */ setup?: CoatManifestTask[]; } export interface CoatManifestStrict extends Pick<CoatManifest, "name">, Required<Omit<CoatManifest, "name">> { extends: Exclude<Required<CoatManifest>["extends"], string>; dependencies: Exclude<Required<CoatManifest["dependencies"]>, undefined>; }