-
Notifications
You must be signed in to change notification settings - Fork 108
/
schema.json
132 lines (132 loc) · 8.89 KB
/
schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "wireit contributions to package.json",
"additionalProperties": true,
"properties": {
"wireit": {
"additionalProperties": {
"markdownDescription": "The wireit config for the npm script with this name.\n\nThe npm script should just run `wireit` with no args and its actual command should be put in the `command` property of this object.\n\nFor more info see: https://github.com/google/wireit#cleaning-output",
"additionalProperties": true,
"properties": {
"clean": {
"markdownDescription": "By default, `output` files are deleted before the command is run.\n\nSet `clean` to false to prevent this.\n\nSome commands, like `tsc --build`, have their own incremental run logic and only write those output files that have changed. In that case, it can be beneficial to only delete output files when one of the input files has been deleted. In that case, set `clean` to \"if-file-deleted\".\n\nFor more info see: https://github.com/google/wireit#cleaning-output",
"enum": [true, false, "if-file-deleted"]
},
"command": {
"markdownDescription": "The command to run.\n\nThis is a shell command that will be executed, with all binaries from npm dependencies and devDependencies available.\n\nFor example:\n\n```json\n\"command\": \"tsc\"\n```\n\nFor more info, see https://docs.npmjs.com/cli/v8/using-npm/scripts#environment",
"type": "string",
"minLength": 1
},
"allowUsuallyExcludedPaths": {
"markdownDescription": "By default, the following folders are excluded from the `files` and `output` arrays: `.git/`, `.hg/`, '.svn/', '.wireit/', '.yarn/', 'CVS/', and `node_modules/`. In the highly unusual case that you need to reference a file in one of those folders, set `allowUsuallyExcludedPaths` to `true` to remove these exclusions.\n\nFor more info see: https://github.com/google/wireit#default-excluded-paths",
"type": "boolean"
},
"dependencies": {
"markdownDescription": "Other npm scripts that will run before this one.\n\nThese scripts do not have to use wireit.\n\nDependencies can refer to scripts in other npm packages by using a relative path with the syntax `<relative-path>:<script-name>`. All cross-package dependencies should start with a `\".\"`. Cross-package dependencies work well for npm workspaces, as well as in other kinds of monorepos.\n\nFor example:\n\n```json\n\"dependencies\": [\n \"build\",\n \"./packages/foo:build\"\n]\n```\n\nFor more info, see https://github.com/google/wireit#dependencies",
"items": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "object",
"required": ["script"],
"properties": {
"script": {
"markdownDescription": "The name of the script (see `dependencies`).",
"type": "string",
"minLength": 1
},
"cascade": {
"markdownDescription": "When `true` (the default), whenever this dependency runs, this script (the dependent) will be marked stale and need to re-run too, regardless of whether the dependency produced new or relevant output. When `false` Wireit won't assume that the dependent is stale just because the dependency ran. This can reduce unnecessary re-building (or restarting in the case of services) when `files` captures all of the relevant output of the dependency.\n\nFor more info, see https://github.com/google/wireit#re-run-on-change",
"type": "boolean"
}
}
}
]
},
"type": "array"
},
"files": {
"markdownDescription": "The files that this script depends on.\n\nThese are the files that are watched when run with the `watch` argument. They are also used to determine if a script is stale or if its files and dependencies haven't changed and execution can be skipped.\n\nDon't specify `files` unless the array of files (and `dependencies`) are the only things that this script depends on. For example, a script that fetches data over the internet should not have a files array.\n\nThis should be a list of package-relative paths to files, or glob patterns. See https://github.com/google/wireit#glob-patterns for more info on the format of glob patterns.\n\nFor example:\n\n```json\n\"files\": [\n \"src/**/*.ts\"\n]\n```",
"items": {
"type": "string",
"minLength": 1
},
"type": "array"
},
"output": {
"markdownDescription": "The files that this script writes.\n\nThese are the files that are deleted before the script is executed (set `clean` to customize this behavior), and these are the files that are cached if `files` is specified.\n\nThis should be a list of package-relative paths to files, or glob patterns. See https://github.com/google/wireit#glob-patterns for more info on the format of glob patterns.\n\nFor example:\n\n```json\n\"output\": [\n \"lib/**/*\",\n \"!lib/bundle.js\"\n]\n```",
"items": {
"type": "string",
"minLength": 1
},
"type": "array"
},
"packageLocks": {
"markdownDescription": "By default, Wireit automatically treats lock files in the package directory, plus all parent directories, as input files (package-lock.json with npm, yarn.lock with yarn, and pnpm-lock.yaml with pnpm). This is useful because installing or upgrading your dependencies can affect the behavior of your scripts, so it's important to re-run them whenever your dependencies change.\n\nIf you are using an alternative package manager instead of npm, then your package lock files might be named something else.\n\nFor more info, see: https://github.com/google/wireit#package-locks",
"items": {
"type": "string",
"minLength": 1
},
"type": "array"
},
"service": {
"markdownDescription": "If true or an object, treat this script as a long-running process.\nServices are automatically brought up and down as they are depended upon by other scripts. If invoked directly, services continue running until Wireit is killed with Ctrl-C.\nFor more info, see: https://github.com/google/wireit#services",
"anyOf": [
{
"type": "boolean"
},
{
"type": "object",
"properties": {
"readyWhen": {
"markdownDescription": "Conditions that must be met before this service is considered \"ready\". Until a service is ready, scripts that depend on it cannot start.",
"type": "object",
"properties": {
"lineMatches": {
"markdownDescription": "A regular expression that must match within a single line of output emitted by this service on `stdout` or `stderr`.",
"type": "string"
}
}
}
}
}
]
},
"env": {
"type": "object",
"markdownDescription": "Environment variables to either set directly, or which are set externally and affect the behavior of the script.\n\nFor more info see: https://github.com/google/wireit#environment-variables",
"additionalProperties": {
"markdownDescription": "An environment variable setting.\n\nFor more info see: https://github.com/google/wireit#environment-variables",
"additionalProperties": true,
"anyOf": [
{
"type": "string"
},
{
"type": "object",
"required": ["external"],
"properties": {
"external": {
"markdownDescription": "Do not re-use output if this externally-provided environment variable changes across iterations.\n\nFor more info see: https://github.com/google/wireit#indicating-external-environment-variables",
"const": true
},
"default": {
"markdownDescription": "A default value to use when the environment variable is not provided externally.\n\nFor more info see: https://github.com/google/wireit#indicating-external-environment-variables",
"type": "string"
}
}
}
]
}
}
},
"type": "object"
},
"type": "object"
}
},
"type": "object"
}