bun-workspaces 1.8.2 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +537 -0
- package/README.md +51 -13
- package/package.json +1 -1
- package/src/2392.mjs +184 -3
- package/src/5166.mjs +1 -0
- package/src/8529.mjs +10 -0
- package/src/affected/affectedBaseRef.mjs +12 -0
- package/src/affected/externalDependencyChanges.mjs +47 -0
- package/src/affected/fileAffectedWorkspaces.mjs +152 -54
- package/src/affected/gitAffectedFiles.mjs +44 -1
- package/src/affected/gitAffectedWorkspaces.mjs +73 -3
- package/src/affected/index.mjs +2 -0
- package/src/ai/mcp/serverState.mjs +1 -1
- package/src/cli/commands/commandHandlerUtils.mjs +12 -7
- package/src/cli/commands/commands.mjs +4 -1
- package/src/cli/commands/handleSimpleCommands.mjs +2 -2
- package/src/cli/commands/listAffected.mjs +184 -0
- package/src/cli/commands/runScript/handleRunAffected.mjs +99 -0
- package/src/cli/commands/runScript/handleRunScript.mjs +19 -202
- package/src/cli/commands/runScript/index.mjs +1 -0
- package/src/cli/commands/runScript/scriptRunFlow.mjs +213 -0
- package/src/cli/index.d.ts +749 -134
- package/src/config/public.d.ts +66 -2
- package/src/config/rootConfig/rootConfig.mjs +9 -9
- package/src/config/rootConfig/rootConfigSchema.mjs +3 -0
- package/src/config/workspaceConfig/mergeWorkspaceConfig.mjs +33 -19
- package/src/config/workspaceConfig/workspaceConfig.mjs +3 -0
- package/src/config/workspaceConfig/workspaceConfigSchema.mjs +26 -0
- package/src/index.d.ts +307 -5
- package/src/index.mjs +1 -0
- package/src/internal/bun/bunLock.mjs +33 -0
- package/src/internal/generated/aiDocs/docs.mjs +169 -9
- package/src/internal/generated/ajv/validateRootConfig.mjs +1 -1
- package/src/internal/generated/ajv/validateWorkspaceConfig.mjs +1 -1
- package/src/project/implementations/fileSystemProject/affectedWorkspaces.mjs +227 -0
- package/src/project/implementations/{fileSystemProject.mjs → fileSystemProject/fileSystemProject.mjs} +169 -12
- package/src/project/implementations/fileSystemProject/index.mjs +4 -0
- package/src/project/implementations/memoryProject.mjs +1 -0
- package/src/project/implementations/projectBase.mjs +11 -17
- package/src/project/index.mjs +1 -1
- package/src/rslib-runtime.mjs +0 -31
- package/src/workspaces/applyWorkspacePatternConfigs.mjs +16 -2
- package/src/workspaces/dependencyGraph/resolveDependencies.mjs +68 -18
- package/src/workspaces/dependencyGraph/validateDependencyRules.mjs +14 -7
- package/src/workspaces/findWorkspaces.mjs +3 -0
- package/src/workspaces/workspace.mjs +8 -2
- package/src/workspaces/workspacePattern.mjs +134 -46
|
@@ -59,10 +59,43 @@ const readBunLockfile = (directory) => {
|
|
|
59
59
|
const jsonString = fs.readFileSync(bunLockPath, "utf8");
|
|
60
60
|
return parseBunLock(jsonString, bunLockPath);
|
|
61
61
|
};
|
|
62
|
+
const VERSION_SEPARATOR = "@";
|
|
63
|
+
const parseBunLockPackageVersions = (jsonString, bunLockPath) => {
|
|
64
|
+
let bunLockJson = null;
|
|
65
|
+
try {
|
|
66
|
+
bunLockJson = parseJSONC(jsonString);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
return new BUN_LOCK_ERRORS.MalformedBunLock(
|
|
69
|
+
`Failed to parse bun lockfile ${bunLockPath ? `at "${bunLockPath}"` : ""}: ${error.message}`,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
if (!isJSONObject(bunLockJson)) {
|
|
73
|
+
return new BUN_LOCK_ERRORS.MalformedBunLock(
|
|
74
|
+
`Bun lockfile ${bunLockPath ? `at "${bunLockPath}"` : ""} is not a valid JSON object`,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
const versions = new Map();
|
|
78
|
+
const packages = bunLockJson.packages;
|
|
79
|
+
if (!isJSONObject(packages)) return versions;
|
|
80
|
+
for (const [name, entry] of Object.entries(packages)) {
|
|
81
|
+
if (!Array.isArray(entry) || typeof entry[0] !== "string") continue;
|
|
82
|
+
const head = entry[0];
|
|
83
|
+
const lastAt = head.lastIndexOf(VERSION_SEPARATOR);
|
|
84
|
+
if (lastAt <= 0) continue;
|
|
85
|
+
const version = head.slice(lastAt + 1);
|
|
86
|
+
if (!version) continue;
|
|
87
|
+
// bun.lock entries for workspace packages carry a `workspace:<path>`
|
|
88
|
+
// pseudo-version. Skip — we only track real registry-resolved versions.
|
|
89
|
+
if (version.startsWith("workspace:")) continue;
|
|
90
|
+
versions.set(name, version);
|
|
91
|
+
}
|
|
92
|
+
return versions;
|
|
93
|
+
};
|
|
62
94
|
|
|
63
95
|
export {
|
|
64
96
|
BUN_LOCK_ERRORS,
|
|
65
97
|
SUPPORTED_BUN_LOCK_VERSIONS,
|
|
66
98
|
parseBunLock,
|
|
99
|
+
parseBunLockPackageVersions,
|
|
67
100
|
readBunLockfile,
|
|
68
101
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// This file is generated by scripts/
|
|
1
|
+
// This file is generated by scripts/createPublicAgentDocs.ts. Do not edit manually.
|
|
2
2
|
const DOC_OVERVIEW = `## Project Overview
|
|
3
3
|
|
|
4
4
|
bun-workspaces is a CLI and TypeScript API to help manage Bun monorepos. It reads \`bun.lock\` to find all workspaces in the project. It is referred to as "bw" for short, which is also the recommended CLI alias. The overall goal is a monorepo tool that is more lightweight than others, with still powerful comparable features, requiring no special config to get started, only a standard Bun repo using workspaces.
|
|
@@ -7,12 +7,17 @@ Three main domain terms to know:
|
|
|
7
7
|
|
|
8
8
|
- Project: generally represents a monorepo and is defined by the root \`package.json\` file
|
|
9
9
|
- Workspace: a nested package within a project. The root package.json can count as a workspace as well, but by default, only nested packages are considered workspaces.
|
|
10
|
-
- Script: an entry in the \`scripts\` field of a workspace's \`package.json\` file. bw can also run one-off commands known as "inline scripts," which can use the Bun shell or system shell (\`sh -c\` or \`cmd /d /s /c\` for windows)
|
|
10
|
+
- Script: an entry in the \`scripts\` field of a workspace's \`package.json\` file. bw can also run one-off commands known as "inline scripts," which can use the Bun shell or system shell (\`sh -c\` or \`cmd /d /s /c\` for windows).
|
|
11
|
+
|
|
12
|
+
bw also supports **affected workspace** detection: given a set of changed files (from a git diff or an explicit list), it determines which workspaces are meaningfully changed. This drives \`bw list-affected\`/\`bw run-affected\` for orchestrating builds, tests, etc. across only the workspaces that need them.
|
|
13
|
+
`;
|
|
11
14
|
const DOC_CONCEPTS = `## Concepts
|
|
12
15
|
|
|
13
16
|
### Workspace patterns
|
|
14
17
|
|
|
15
|
-
Many features accept a list of workspace patterns to match a subset of workspaces
|
|
18
|
+
Many features accept a list of workspace patterns to match a subset of workspaces:
|
|
19
|
+
|
|
20
|
+
\`[not:][(name|alias|path|tag):][re:]<value>\`
|
|
16
21
|
|
|
17
22
|
By default, a pattern matches the workspace name or alias: \`my-workspace-name\` or \`my-alias-name\`. Aliases are defined in config explained below.
|
|
18
23
|
|
|
@@ -22,8 +27,12 @@ Patterns can include a wildcard to match only by workspace name: \`my-workspace-
|
|
|
22
27
|
- Path pattern specifier (supports glob): \`path:packages/**/*\`.
|
|
23
28
|
- Name pattern specifier: \`name:my-workspace-*\`.
|
|
24
29
|
- Tag pattern specifier: \`tag:my-tag\`.
|
|
25
|
-
- Special root workspace selector: \`@root\`.
|
|
26
30
|
- Any pattern can start with \`not:\` to negate the pattern. (e.g. "not:my-workspace-name", "not:tag:my-tag-\\*") This excludes workspaces that match any other present patterns from a result.
|
|
31
|
+
- Regex pattern modifier can be applied before the pattern value: \`re:\` (e.g. "re:^my-workspace-.+" or "not:alias:re:^my-alias-.+")
|
|
32
|
+
|
|
33
|
+
#### Special selectors
|
|
34
|
+
|
|
35
|
+
- Special root workspace selector: \`@root\`. This is a reference to the root workspace, whether it's included in a Project's workspace list or not.
|
|
27
36
|
|
|
28
37
|
### Workspace Script Metadata
|
|
29
38
|
|
|
@@ -59,7 +68,29 @@ const scriptName = process.env.BW_SCRIPT_NAME;
|
|
|
59
68
|
bw run "bun <projectPath>/my-script.ts" --inline \\
|
|
60
69
|
--inline-name="my-script-name" \\
|
|
61
70
|
--args="<workspaceName> <workspacePath>"
|
|
62
|
-
|
|
71
|
+
\`\`\`
|
|
72
|
+
|
|
73
|
+
### Affected workspaces
|
|
74
|
+
|
|
75
|
+
A workspace is "affected" when something in its set of **inputs** has changed. Inputs default to:
|
|
76
|
+
|
|
77
|
+
- Files in the workspace's directory (only git-trackable files; the default file pattern is \`"."\`)
|
|
78
|
+
- Workspace dependencies — if a workspace dep is affected for any reason, dependents cascade as affected
|
|
79
|
+
- All non-workspace dependencies declared in its \`package.json\` (across all four maps: \`dependencies\`, \`devDependencies\`, \`peerDependencies\`, \`optionalDependencies\`). Version changes are detected by diffing resolved versions in \`bun.lock\`. For \`peerDependencies\`/\`optionalDependencies\`, lockfile presence is the gate — an unresolved optional (e.g., a platform-skipped native binding) emits no change.
|
|
80
|
+
|
|
81
|
+
Inputs are configurable per workspace (\`defaultInputs\`) and per script (\`scripts[name].inputs\`):
|
|
82
|
+
|
|
83
|
+
- \`files\`: file/dir/glob patterns relative to the workspace. Leading \`/\` makes a pattern relative to the project root. Prefix \`!\` to exclude. Only git-trackable files match.
|
|
84
|
+
- \`workspacePatterns\`: workspace patterns whose matched workspaces are treated as inputs (like dependencies, but without needing a real \`package.json\` dep).
|
|
85
|
+
- \`externalDependencies\`: an allowlist of package names. Omitted = all external deps participate; \`[]\` = none participate; non-empty = only listed names participate (intersected with the workspace's actual external deps).
|
|
86
|
+
|
|
87
|
+
There are two diff sources:
|
|
88
|
+
|
|
89
|
+
- **git** (default): diff \`HEAD\` against the configured base ref (default \`main\`, configurable via \`affectedBaseRef\` in the root config or \`BW_AFFECTED_BASE_REF_DEFAULT\` env var). Uncommitted changes (staged, unstaged, untracked) are included by default. Gitignored files never participate.
|
|
90
|
+
- **fileList**: pass changed files explicitly (paths, dirs, or globs) — bypasses git entirely.
|
|
91
|
+
|
|
92
|
+
Use \`--explain\` for a per-workspace summary of changed inputs and dep cascade reasons, and \`--explain --detailed\` for full per-file/edge breakdowns including the affected-dep chain.
|
|
93
|
+
`;
|
|
63
94
|
const DOC_CLI = `### CLI examples:
|
|
64
95
|
|
|
65
96
|
\`\`\`bash
|
|
@@ -124,6 +155,54 @@ bw run my-script --output-style=prefixed
|
|
|
124
155
|
# Use the plain output style (no workspace prefixes)
|
|
125
156
|
bw run my-script --output-style=plain
|
|
126
157
|
|
|
158
|
+
# List affected workspaces (default: git diff HEAD vs the configured base ref, "main" by default)
|
|
159
|
+
bw list-affected
|
|
160
|
+
bw ls-affected # alias
|
|
161
|
+
|
|
162
|
+
# Compare specific git refs
|
|
163
|
+
bw ls-affected --base=my-branch-a --head=my-branch-b
|
|
164
|
+
bw ls-affected -B my-branch-a -H my-branch-b # short forms
|
|
165
|
+
|
|
166
|
+
# Resolve inputs for a specific script (uses scripts[name].inputs when configured)
|
|
167
|
+
bw ls-affected --script=build
|
|
168
|
+
|
|
169
|
+
# Ignore some uncommitted changes (uncommitted included by default)
|
|
170
|
+
bw ls-affected --ignore-uncommitted # all of: staged, unstaged, untracked
|
|
171
|
+
bw ls-affected --ignore-untracked
|
|
172
|
+
bw ls-affected --ignore-unstaged
|
|
173
|
+
bw ls-affected --ignore-staged
|
|
174
|
+
|
|
175
|
+
# Skip workspace dep cascade (only direct file/external-dep changes flag a workspace)
|
|
176
|
+
bw ls-affected --ignore-workspace-deps
|
|
177
|
+
|
|
178
|
+
# Skip lockfile-based external dep version tracking
|
|
179
|
+
bw ls-affected --ignore-external-deps
|
|
180
|
+
|
|
181
|
+
# Bypass git entirely with an explicit list of changed files
|
|
182
|
+
# (paths, dirs, globs; '!' to exclude; whitespace-separated)
|
|
183
|
+
bw ls-affected --files="packages/example/**/*.ts packages/example/my-file.json"
|
|
184
|
+
bw ls-affected -F "packages/a/**/*.ts !packages/a/**/*.test.ts"
|
|
185
|
+
|
|
186
|
+
# Per-workspace summary of why each workspace is affected
|
|
187
|
+
bw ls-affected --explain
|
|
188
|
+
bw ls-affected -e
|
|
189
|
+
|
|
190
|
+
# Full per-file changes and dep cascade chain for each affected workspace
|
|
191
|
+
bw ls-affected --explain --detailed
|
|
192
|
+
bw ls-affected -e -D
|
|
193
|
+
|
|
194
|
+
# JSON output (with --explain produces the full result object)
|
|
195
|
+
bw ls-affected --json --pretty
|
|
196
|
+
bw ls-affected --explain --json --pretty
|
|
197
|
+
|
|
198
|
+
# Run a script across affected workspaces (accepts the same affected options
|
|
199
|
+
# as ls-affected, plus the same script-execution options as run-script:
|
|
200
|
+
# --parallel, --dep-order, --args, --output-style, --inline, etc.)
|
|
201
|
+
bw run-affected build
|
|
202
|
+
bw run-affected build --base=my-branch --ignore-uncommitted --dep-order
|
|
203
|
+
bw run-affected build --files="packages/a/src/**/*.ts" --parallel=2
|
|
204
|
+
bw run-affected "bun build" --inline --inline-name=build # inline command form
|
|
205
|
+
|
|
127
206
|
### Global Options ###
|
|
128
207
|
# Root directory of project:
|
|
129
208
|
bw --cwd=/path/to/project ls
|
|
@@ -137,7 +216,8 @@ bw --no-include-root ls # override config/env var setting
|
|
|
137
216
|
# Log level (debug|info|warn|error|silent, default info)
|
|
138
217
|
bw --log-level=silent ls
|
|
139
218
|
bw -l silent ls
|
|
140
|
-
|
|
219
|
+
\`\`\`
|
|
220
|
+
`;
|
|
141
221
|
const DOC_API = `### API examples:
|
|
142
222
|
|
|
143
223
|
The API is held in close parity with the CLI. It is developed first so that the CLI is a thin wrapper around the API.
|
|
@@ -188,6 +268,44 @@ project.runScriptAcrossWorkspaces({
|
|
|
188
268
|
// event: "start", "skip", "exit"
|
|
189
269
|
},
|
|
190
270
|
});
|
|
271
|
+
|
|
272
|
+
// Determine affected workspaces — git mode (default)
|
|
273
|
+
project.determineAffectedWorkspaces({
|
|
274
|
+
diffSource: "git",
|
|
275
|
+
// optional: resolve inputs for a specific script (uses scripts[name].inputs)
|
|
276
|
+
script: "build",
|
|
277
|
+
// optional: skip workspace dep cascade
|
|
278
|
+
ignoreWorkspaceDependencies: false,
|
|
279
|
+
// optional: skip lockfile-based external dep version tracking
|
|
280
|
+
ignoreExternalDependencies: false,
|
|
281
|
+
diffOptions: {
|
|
282
|
+
baseRef: "main", // default from config / "main"
|
|
283
|
+
headRef: "HEAD", // default
|
|
284
|
+
ignoreUncommitted: false, // staged + unstaged + untracked
|
|
285
|
+
ignoreUntracked: false,
|
|
286
|
+
ignoreUnstaged: false,
|
|
287
|
+
ignoreStaged: false,
|
|
288
|
+
},
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// Determine affected workspaces — fileList mode (bypass git)
|
|
292
|
+
project.determineAffectedWorkspaces({
|
|
293
|
+
diffSource: "fileList",
|
|
294
|
+
// paths, directories, or globs (relative to project root); '!' to exclude
|
|
295
|
+
changedFiles: ["packages/a/**/*.ts", "!packages/a/**/*.test.ts"],
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// Run a script across affected workspaces. Accepts the same affected options
|
|
299
|
+
// as determineAffectedWorkspaces, plus the script-execution options from
|
|
300
|
+
// runScriptAcrossWorkspaces (parallel, dependencyOrder, args, onScriptEvent, etc.).
|
|
301
|
+
project.runAffectedWorkspaceScript({
|
|
302
|
+
script: "build",
|
|
303
|
+
diffSource: "git",
|
|
304
|
+
diffOptions: { baseRef: "main", ignoreUncommitted: true },
|
|
305
|
+
parallel: { max: 2 },
|
|
306
|
+
dependencyOrder: true,
|
|
307
|
+
ignoreDependencyFailure: true,
|
|
308
|
+
});
|
|
191
309
|
\`\`\`
|
|
192
310
|
|
|
193
311
|
## The Workspace object
|
|
@@ -207,12 +325,29 @@ project.runScriptAcrossWorkspaces({
|
|
|
207
325
|
"scripts": ["my-script"],
|
|
208
326
|
// Aliases defined in workspace configuration (bw.workspace.jsonc/bw.workspace.json)
|
|
209
327
|
"aliases": ["my-alias"],
|
|
328
|
+
// Tags defined in workspace configuration
|
|
329
|
+
"tags": ["my-tag"],
|
|
210
330
|
// Names of other workspaces that this workspace depends on
|
|
211
331
|
"dependencies": ["my-dependency"],
|
|
212
332
|
// Names of other workspaces that depend on this workspace
|
|
213
333
|
"dependents": ["my-dependent"],
|
|
334
|
+
// Non-workspace package deps declared in package.json (across all four maps).
|
|
335
|
+
// \`source\` is one of "dependencies" | "devDependencies" | "peerDependencies" | "optionalDependencies".
|
|
336
|
+
// \`version\` is the package.json range, with \`catalog:\`/\`catalog:<name>\` resolved when possible.
|
|
337
|
+
// \`catalog\` is present when declared via a catalog ref.
|
|
338
|
+
"externalDependencies": [
|
|
339
|
+
{ "name": "lodash", "version": "^4.17.0", "source": "dependencies" },
|
|
340
|
+
{ "name": "typescript", "version": "^5.0.0", "source": "devDependencies" },
|
|
341
|
+
{
|
|
342
|
+
"name": "react",
|
|
343
|
+
"version": "^18.0.0",
|
|
344
|
+
"source": "dependencies",
|
|
345
|
+
"catalog": { "name": "" },
|
|
346
|
+
},
|
|
347
|
+
],
|
|
214
348
|
}
|
|
215
|
-
|
|
349
|
+
\`\`\`
|
|
350
|
+
`;
|
|
216
351
|
const DOC_CONFIG = `## Root config
|
|
217
352
|
|
|
218
353
|
Optional project config can be placed in \`bw.root.ts\`/\`bw.root.js\`/\`bw.root.jsonc\`/\`bw.root.json\` in the root directory, or in the \`"bw"\` key of \`package.json\`.
|
|
@@ -225,6 +360,7 @@ Config defaults here take precedence over environment variables. Explicit CLI ar
|
|
|
225
360
|
"parallelMax": 5, // same options as seen in CLI examples above
|
|
226
361
|
"shell": "system", // "bun" or "system" (default "bun")
|
|
227
362
|
"includeRootWorkspace": true, // treat root package.json as a normal workspace
|
|
363
|
+
"affectedBaseRef": "main", // default git base ref for affected resolution (env: BW_AFFECTED_BASE_REF_DEFAULT)
|
|
228
364
|
},
|
|
229
365
|
"workspacePatternConfigs": [
|
|
230
366
|
// see Workspace Pattern Configs section below
|
|
@@ -258,11 +394,24 @@ Tags are strings to group workspaces together; they do not need to be unique.
|
|
|
258
394
|
{
|
|
259
395
|
"alias": "my-alias", // can be array
|
|
260
396
|
"tags": ["my-tag"],
|
|
397
|
+
// Default inputs used to determine if the workspace is affected, applied to
|
|
398
|
+
// all scripts that don't configure their own inputs. See "Inputs" below.
|
|
399
|
+
"defaultInputs": {
|
|
400
|
+
"files": ["src/**/*.ts", "!src/**/*.test.ts"],
|
|
401
|
+
"workspacePatterns": ["tag:shared-lib"],
|
|
402
|
+
"externalDependencies": ["lodash", "react"],
|
|
403
|
+
},
|
|
261
404
|
"scripts": {
|
|
262
405
|
"lint": {
|
|
263
406
|
// set optional sorting order for scripts
|
|
264
407
|
"order": 1,
|
|
265
408
|
},
|
|
409
|
+
"build": {
|
|
410
|
+
// per-script inputs override defaultInputs for this script's affected resolution
|
|
411
|
+
"inputs": {
|
|
412
|
+
"files": ["src/**/*.ts", "/shared-types/**/*.ts"], // leading "/" = relative to the project root
|
|
413
|
+
},
|
|
414
|
+
},
|
|
266
415
|
},
|
|
267
416
|
"rules": {
|
|
268
417
|
"workspaceDependencies": {
|
|
@@ -276,6 +425,16 @@ Tags are strings to group workspaces together; they do not need to be unique.
|
|
|
276
425
|
}
|
|
277
426
|
\`\`\`
|
|
278
427
|
|
|
428
|
+
### Inputs
|
|
429
|
+
|
|
430
|
+
The \`defaultInputs\` field (and the per-script \`scripts[name].inputs\` field) controls what counts as an input for [affected workspace](#affected-workspaces) resolution. Both have the same shape (\`WorkspaceInputsConfig\`):
|
|
431
|
+
|
|
432
|
+
- \`files\` — file paths, directories, or globs relative to the workspace's directory. Leading \`/\` makes a pattern relative to the project root. Prefix with \`!\` to exclude. Only git-trackable files are matched. Default when not provided is \`["."]\` (everything in the workspace dir).
|
|
433
|
+
- \`workspacePatterns\` — workspace patterns whose matched workspaces are treated as inputs (like dependencies, but without needing a real \`package.json\` dep edge).
|
|
434
|
+
- \`externalDependencies\` — allowlist of package names that participate in lockfile-change detection. Omitted = all external deps participate; \`[]\` = none participate; non-empty list = only listed names participate (intersected with the workspace's actual external deps from \`package.json\`).
|
|
435
|
+
|
|
436
|
+
Per-script \`inputs\` fully replaces \`defaultInputs\` for that script — the two are not merged. If a script has its own \`inputs\` field, \`defaultInputs\` is ignored for that script.
|
|
437
|
+
|
|
279
438
|
### Workspace Dependency Rules
|
|
280
439
|
|
|
281
440
|
Using the \`rules.workspaceDependencies\` field, you can define rules for which workspaces are allowed to be dependencies, using \`allowPatterns\`, \`denyPatterns\`, or both.
|
|
@@ -346,7 +505,7 @@ The factory \`(workspace: RawWorkspace, prevConfig: ResolvedWorkspaceConfig) =>
|
|
|
346
505
|
- \`workspace.dependencies\` — names of workspace dependencies
|
|
347
506
|
- \`workspace.dependents\` — names of workspaces that depend on this one
|
|
348
507
|
|
|
349
|
-
\`prevConfig\` is the fully resolved workspace config at that point, including the local config and any configs applied by earlier pattern entries. It has \`aliases: string[]\`, \`tags: string[]\`, \`scripts: Record<string, ScriptConfig>\`, \`rules: WorkspaceRules\`.
|
|
508
|
+
\`prevConfig\` is the fully resolved workspace config at that point, including the local config and any configs applied by earlier pattern entries. It has \`aliases: string[]\`, \`tags: string[]\`, \`scripts: Record<string, ScriptConfig>\`, \`rules: WorkspaceRules\`, \`defaultInputs?: WorkspaceInputsConfig\`.
|
|
350
509
|
|
|
351
510
|
## TypeScript/JSON Config Files
|
|
352
511
|
|
|
@@ -373,6 +532,7 @@ export default defineRootConfig({
|
|
|
373
532
|
parallelMax: 5,
|
|
374
533
|
},
|
|
375
534
|
});
|
|
376
|
-
|
|
535
|
+
\`\`\`
|
|
536
|
+
`;
|
|
377
537
|
|
|
378
538
|
export { DOC_API, DOC_CLI, DOC_CONCEPTS, DOC_CONFIG, DOC_OVERVIEW };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";export const validate = validate11;export default validate11;const schema12 = {"type":"object","additionalProperties":false,"properties":{"defaults":{"type":"object","additionalProperties":false,"properties":{"parallelMax":{"type":["number","string"]},"shell":{"type":"string"},"includeRootWorkspace":{"type":"boolean"},"affectedBaseRef":{"type":"string"}}},"workspacePatternConfigs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["patterns","config"],"properties":{"patterns":{"type":"array","items":{"type":"string"}},"config":{}}}}}};function validate11(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!((key0 === "defaults") || (key0 === "workspacePatternConfigs"))){validate11.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.defaults !== undefined){let data0 = data.defaults;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){const _errs4 = errors;for(const key1 in data0){if(!((((key1 === "parallelMax") || (key1 === "shell")) || (key1 === "includeRootWorkspace")) || (key1 === "affectedBaseRef"))){validate11.errors = [{instancePath:instancePath+"/defaults",schemaPath:"#/properties/defaults/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs4 === errors){if(data0.parallelMax !== undefined){let data1 = data0.parallelMax;const _errs5 = errors;if((!((typeof data1 == "number") && (isFinite(data1)))) && (typeof data1 !== "string")){validate11.errors = [{instancePath:instancePath+"/defaults/parallelMax",schemaPath:"#/properties/defaults/properties/parallelMax/type",keyword:"type",params:{type: schema12.properties.defaults.properties.parallelMax.type},message:"must be number,string"}];return false;}var valid1 = _errs5 === errors;}else {var valid1 = true;}if(valid1){if(data0.shell !== undefined){const _errs7 = errors;if(typeof data0.shell !== "string"){validate11.errors = [{instancePath:instancePath+"/defaults/shell",schemaPath:"#/properties/defaults/properties/shell/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs7 === errors;}else {var valid1 = true;}if(valid1){if(data0.includeRootWorkspace !== undefined){const _errs9 = errors;if(typeof data0.includeRootWorkspace !== "boolean"){validate11.errors = [{instancePath:instancePath+"/defaults/includeRootWorkspace",schemaPath:"#/properties/defaults/properties/includeRootWorkspace/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid1 = _errs9 === errors;}else {var valid1 = true;}if(valid1){if(data0.affectedBaseRef !== undefined){const _errs11 = errors;if(typeof data0.affectedBaseRef !== "string"){validate11.errors = [{instancePath:instancePath+"/defaults/affectedBaseRef",schemaPath:"#/properties/defaults/properties/affectedBaseRef/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs11 === errors;}else {var valid1 = true;}}}}}}else {validate11.errors = [{instancePath:instancePath+"/defaults",schemaPath:"#/properties/defaults/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.workspacePatternConfigs !== undefined){let data5 = data.workspacePatternConfigs;const _errs13 = errors;if(errors === _errs13){if(Array.isArray(data5)){var valid2 = true;const len0 = data5.length;for(let i0=0; i0<len0; i0++){let data6 = data5[i0];const _errs15 = errors;if(errors === _errs15){if(data6 && typeof data6 == "object" && !Array.isArray(data6)){let missing0;if(((data6.patterns === undefined) && (missing0 = "patterns")) || ((data6.config === undefined) && (missing0 = "config"))){validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0,schemaPath:"#/properties/workspacePatternConfigs/items/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs17 = errors;for(const key2 in data6){if(!((key2 === "patterns") || (key2 === "config"))){validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0,schemaPath:"#/properties/workspacePatternConfigs/items/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"}];return false;break;}}if(_errs17 === errors){if(data6.patterns !== undefined){let data7 = data6.patterns;const _errs18 = errors;if(errors === _errs18){if(Array.isArray(data7)){var valid4 = true;const len1 = data7.length;for(let i1=0; i1<len1; i1++){const _errs20 = errors;if(typeof data7[i1] !== "string"){validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0+"/patterns/" + i1,schemaPath:"#/properties/workspacePatternConfigs/items/properties/patterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid4 = _errs20 === errors;if(!valid4){break;}}}else {validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0+"/patterns",schemaPath:"#/properties/workspacePatternConfigs/items/properties/patterns/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}}}}}else {validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs/" + i0,schemaPath:"#/properties/workspacePatternConfigs/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid2 = _errs15 === errors;if(!valid2){break;}}}else {validate11.errors = [{instancePath:instancePath+"/workspacePatternConfigs",schemaPath:"#/properties/workspacePatternConfigs/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs13 === errors;}else {var valid0 = true;}}}}else {validate11.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate11.errors = vErrors;return errors === 0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";module.exports = validate10;module.exports.default = validate10;const schema11 = {"type":"object","additionalProperties":false,"properties":{"alias":{"type":["string","array"],"items":{"type":"string"},"uniqueItems":true},"tags":{"type":"array","items":{"type":"string"},"uniqueItems":true},"scripts":{"type":"object","additionalProperties":{"type":"object","properties":{"order":{"type":"number"}},"additionalProperties":false}},"rules":{"type":"object","additionalProperties":false,"properties":{"workspaceDependencies":{"type":"object","properties":{"allowPatterns":{"type":"array","items":{"type":"string"}},"denyPatterns":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}}}}};function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!((((key0 === "alias") || (key0 === "tags")) || (key0 === "scripts")) || (key0 === "rules"))){validate10.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.alias !== undefined){let data0 = data.alias;const _errs2 = errors;if((typeof data0 !== "string") && (!(Array.isArray(data0)))){validate10.errors = [{instancePath:instancePath+"/alias",schemaPath:"#/properties/alias/type",keyword:"type",params:{type: schema11.properties.alias.type},message:"must be string,array"}];return false;}if(errors === _errs2){if(Array.isArray(data0)){var valid1 = true;const len0 = data0.length;for(let i0=0; i0<len0; i0++){const _errs4 = errors;if(typeof data0[i0] !== "string"){validate10.errors = [{instancePath:instancePath+"/alias/" + i0,schemaPath:"#/properties/alias/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs4 === errors;if(!valid1){break;}}if(valid1){let i1 = data0.length;let j0;if(i1 > 1){const indices0 = {};for(;i1--;){let item0 = data0[i1];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];validate10.errors = [{instancePath:instancePath+"/alias",schemaPath:"#/properties/alias/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break;}indices0[item0] = i1;}}}}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.tags !== undefined){let data2 = data.tags;const _errs6 = errors;if(errors === _errs6){if(Array.isArray(data2)){var valid3 = true;const len1 = data2.length;for(let i2=0; i2<len1; i2++){const _errs8 = errors;if(typeof data2[i2] !== "string"){validate10.errors = [{instancePath:instancePath+"/tags/" + i2,schemaPath:"#/properties/tags/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid3 = _errs8 === errors;if(!valid3){break;}}if(valid3){let i3 = data2.length;let j1;if(i3 > 1){const indices1 = {};for(;i3--;){let item1 = data2[i3];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];validate10.errors = [{instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/uniqueItems",keyword:"uniqueItems",params:{i: i3, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i3+" are identical)"}];return false;break;}indices1[item1] = i3;}}}}else {validate10.errors = [{instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs6 === errors;}else {var valid0 = true;}if(valid0){if(data.scripts !== undefined){let data4 = data.scripts;const _errs10 = errors;if(errors === _errs10){if(data4 && typeof data4 == "object" && !Array.isArray(data4)){for(const key1 in data4){let data5 = data4[key1];const _errs13 = errors;if(errors === _errs13){if(data5 && typeof data5 == "object" && !Array.isArray(data5)){const _errs15 = errors;for(const key2 in data5){if(!(key2 === "order")){validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/scripts/additionalProperties/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"}];return false;break;}}if(_errs15 === errors){if(data5.order !== undefined){let data6 = data5.order;if(!((typeof data6 == "number") && (isFinite(data6)))){validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/order",schemaPath:"#/properties/scripts/additionalProperties/properties/order/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}}}else {validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/scripts/additionalProperties/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid5 = _errs13 === errors;if(!valid5){break;}}}else {validate10.errors = [{instancePath:instancePath+"/scripts",schemaPath:"#/properties/scripts/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs10 === errors;}else {var valid0 = true;}if(valid0){if(data.rules !== undefined){let data7 = data.rules;const _errs18 = errors;if(errors === _errs18){if(data7 && typeof data7 == "object" && !Array.isArray(data7)){const _errs20 = errors;for(const key3 in data7){if(!(key3 === "workspaceDependencies")){validate10.errors = [{instancePath:instancePath+"/rules",schemaPath:"#/properties/rules/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs20 === errors){if(data7.workspaceDependencies !== undefined){let data8 = data7.workspaceDependencies;const _errs21 = errors;if(errors === _errs21){if(data8 && typeof data8 == "object" && !Array.isArray(data8)){const _errs23 = errors;for(const key4 in data8){if(!((key4 === "allowPatterns") || (key4 === "denyPatterns"))){validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies",schemaPath:"#/properties/rules/properties/workspaceDependencies/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"}];return false;break;}}if(_errs23 === errors){if(data8.allowPatterns !== undefined){let data9 = data8.allowPatterns;const _errs24 = errors;if(errors === _errs24){if(Array.isArray(data9)){var valid9 = true;const len2 = data9.length;for(let i4=0; i4<len2; i4++){const _errs26 = errors;if(typeof data9[i4] !== "string"){validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies/allowPatterns/" + i4,schemaPath:"#/properties/rules/properties/workspaceDependencies/properties/allowPatterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid9 = _errs26 === errors;if(!valid9){break;}}}else {validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies/allowPatterns",schemaPath:"#/properties/rules/properties/workspaceDependencies/properties/allowPatterns/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid8 = _errs24 === errors;}else {var valid8 = true;}if(valid8){if(data8.denyPatterns !== undefined){let data11 = data8.denyPatterns;const _errs28 = errors;if(errors === _errs28){if(Array.isArray(data11)){var valid10 = true;const len3 = data11.length;for(let i5=0; i5<len3; i5++){const _errs30 = errors;if(typeof data11[i5] !== "string"){validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies/denyPatterns/" + i5,schemaPath:"#/properties/rules/properties/workspaceDependencies/properties/denyPatterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid10 = _errs30 === errors;if(!valid10){break;}}}else {validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies/denyPatterns",schemaPath:"#/properties/rules/properties/workspaceDependencies/properties/denyPatterns/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid8 = _errs28 === errors;}else {var valid8 = true;}}}}else {validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies",schemaPath:"#/properties/rules/properties/workspaceDependencies/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}}}}else {validate10.errors = [{instancePath:instancePath+"/rules",schemaPath:"#/properties/rules/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs18 === errors;}else {var valid0 = true;}}}}}}else {validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate10.errors = vErrors;return errors === 0;}
|
|
1
|
+
"use strict";export const validate = validate10;export default validate10;const schema11 = {"type":"object","additionalProperties":false,"properties":{"alias":{"type":["string","array"],"items":{"type":"string"},"uniqueItems":true},"tags":{"type":"array","items":{"type":"string"},"uniqueItems":true},"scripts":{"type":"object","additionalProperties":{"type":"object","properties":{"order":{"type":"number"},"inputs":{"type":"object","additionalProperties":false,"properties":{"files":{"type":"array","items":{"type":"string"}},"workspacePatterns":{"type":"array","items":{"type":"string"}},"externalDependencies":{"type":"array","items":{"type":"string"}}}}},"additionalProperties":false}},"rules":{"type":"object","additionalProperties":false,"properties":{"workspaceDependencies":{"type":"object","properties":{"allowPatterns":{"type":"array","items":{"type":"string"}},"denyPatterns":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}}},"defaultInputs":{"type":"object","additionalProperties":false,"properties":{"files":{"type":"array","items":{"type":"string"}},"workspacePatterns":{"type":"array","items":{"type":"string"}},"externalDependencies":{"type":"array","items":{"type":"string"}}}}}};function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!(((((key0 === "alias") || (key0 === "tags")) || (key0 === "scripts")) || (key0 === "rules")) || (key0 === "defaultInputs"))){validate10.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.alias !== undefined){let data0 = data.alias;const _errs2 = errors;if((typeof data0 !== "string") && (!(Array.isArray(data0)))){validate10.errors = [{instancePath:instancePath+"/alias",schemaPath:"#/properties/alias/type",keyword:"type",params:{type: schema11.properties.alias.type},message:"must be string,array"}];return false;}if(errors === _errs2){if(Array.isArray(data0)){var valid1 = true;const len0 = data0.length;for(let i0=0; i0<len0; i0++){const _errs4 = errors;if(typeof data0[i0] !== "string"){validate10.errors = [{instancePath:instancePath+"/alias/" + i0,schemaPath:"#/properties/alias/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs4 === errors;if(!valid1){break;}}if(valid1){let i1 = data0.length;let j0;if(i1 > 1){const indices0 = {};for(;i1--;){let item0 = data0[i1];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];validate10.errors = [{instancePath:instancePath+"/alias",schemaPath:"#/properties/alias/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break;}indices0[item0] = i1;}}}}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.tags !== undefined){let data2 = data.tags;const _errs6 = errors;if(errors === _errs6){if(Array.isArray(data2)){var valid3 = true;const len1 = data2.length;for(let i2=0; i2<len1; i2++){const _errs8 = errors;if(typeof data2[i2] !== "string"){validate10.errors = [{instancePath:instancePath+"/tags/" + i2,schemaPath:"#/properties/tags/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid3 = _errs8 === errors;if(!valid3){break;}}if(valid3){let i3 = data2.length;let j1;if(i3 > 1){const indices1 = {};for(;i3--;){let item1 = data2[i3];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];validate10.errors = [{instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/uniqueItems",keyword:"uniqueItems",params:{i: i3, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i3+" are identical)"}];return false;break;}indices1[item1] = i3;}}}}else {validate10.errors = [{instancePath:instancePath+"/tags",schemaPath:"#/properties/tags/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs6 === errors;}else {var valid0 = true;}if(valid0){if(data.scripts !== undefined){let data4 = data.scripts;const _errs10 = errors;if(errors === _errs10){if(data4 && typeof data4 == "object" && !Array.isArray(data4)){for(const key1 in data4){let data5 = data4[key1];const _errs13 = errors;if(errors === _errs13){if(data5 && typeof data5 == "object" && !Array.isArray(data5)){const _errs15 = errors;for(const key2 in data5){if(!((key2 === "order") || (key2 === "inputs"))){validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/scripts/additionalProperties/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"}];return false;break;}}if(_errs15 === errors){if(data5.order !== undefined){let data6 = data5.order;const _errs16 = errors;if(!((typeof data6 == "number") && (isFinite(data6)))){validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/order",schemaPath:"#/properties/scripts/additionalProperties/properties/order/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}var valid6 = _errs16 === errors;}else {var valid6 = true;}if(valid6){if(data5.inputs !== undefined){let data7 = data5.inputs;const _errs18 = errors;if(errors === _errs18){if(data7 && typeof data7 == "object" && !Array.isArray(data7)){const _errs20 = errors;for(const key3 in data7){if(!(((key3 === "files") || (key3 === "workspacePatterns")) || (key3 === "externalDependencies"))){validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/inputs",schemaPath:"#/properties/scripts/additionalProperties/properties/inputs/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs20 === errors){if(data7.files !== undefined){let data8 = data7.files;const _errs21 = errors;if(errors === _errs21){if(Array.isArray(data8)){var valid8 = true;const len2 = data8.length;for(let i4=0; i4<len2; i4++){const _errs23 = errors;if(typeof data8[i4] !== "string"){validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/inputs/files/" + i4,schemaPath:"#/properties/scripts/additionalProperties/properties/inputs/properties/files/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid8 = _errs23 === errors;if(!valid8){break;}}}else {validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/inputs/files",schemaPath:"#/properties/scripts/additionalProperties/properties/inputs/properties/files/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid7 = _errs21 === errors;}else {var valid7 = true;}if(valid7){if(data7.workspacePatterns !== undefined){let data10 = data7.workspacePatterns;const _errs25 = errors;if(errors === _errs25){if(Array.isArray(data10)){var valid9 = true;const len3 = data10.length;for(let i5=0; i5<len3; i5++){const _errs27 = errors;if(typeof data10[i5] !== "string"){validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/inputs/workspacePatterns/" + i5,schemaPath:"#/properties/scripts/additionalProperties/properties/inputs/properties/workspacePatterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid9 = _errs27 === errors;if(!valid9){break;}}}else {validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/inputs/workspacePatterns",schemaPath:"#/properties/scripts/additionalProperties/properties/inputs/properties/workspacePatterns/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid7 = _errs25 === errors;}else {var valid7 = true;}if(valid7){if(data7.externalDependencies !== undefined){let data12 = data7.externalDependencies;const _errs29 = errors;if(errors === _errs29){if(Array.isArray(data12)){var valid10 = true;const len4 = data12.length;for(let i6=0; i6<len4; i6++){const _errs31 = errors;if(typeof data12[i6] !== "string"){validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/inputs/externalDependencies/" + i6,schemaPath:"#/properties/scripts/additionalProperties/properties/inputs/properties/externalDependencies/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid10 = _errs31 === errors;if(!valid10){break;}}}else {validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/inputs/externalDependencies",schemaPath:"#/properties/scripts/additionalProperties/properties/inputs/properties/externalDependencies/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid7 = _errs29 === errors;}else {var valid7 = true;}}}}}else {validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/inputs",schemaPath:"#/properties/scripts/additionalProperties/properties/inputs/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid6 = _errs18 === errors;}else {var valid6 = true;}}}}else {validate10.errors = [{instancePath:instancePath+"/scripts/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/scripts/additionalProperties/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid5 = _errs13 === errors;if(!valid5){break;}}}else {validate10.errors = [{instancePath:instancePath+"/scripts",schemaPath:"#/properties/scripts/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs10 === errors;}else {var valid0 = true;}if(valid0){if(data.rules !== undefined){let data14 = data.rules;const _errs33 = errors;if(errors === _errs33){if(data14 && typeof data14 == "object" && !Array.isArray(data14)){const _errs35 = errors;for(const key4 in data14){if(!(key4 === "workspaceDependencies")){validate10.errors = [{instancePath:instancePath+"/rules",schemaPath:"#/properties/rules/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"}];return false;break;}}if(_errs35 === errors){if(data14.workspaceDependencies !== undefined){let data15 = data14.workspaceDependencies;const _errs36 = errors;if(errors === _errs36){if(data15 && typeof data15 == "object" && !Array.isArray(data15)){const _errs38 = errors;for(const key5 in data15){if(!((key5 === "allowPatterns") || (key5 === "denyPatterns"))){validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies",schemaPath:"#/properties/rules/properties/workspaceDependencies/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"}];return false;break;}}if(_errs38 === errors){if(data15.allowPatterns !== undefined){let data16 = data15.allowPatterns;const _errs39 = errors;if(errors === _errs39){if(Array.isArray(data16)){var valid13 = true;const len5 = data16.length;for(let i7=0; i7<len5; i7++){const _errs41 = errors;if(typeof data16[i7] !== "string"){validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies/allowPatterns/" + i7,schemaPath:"#/properties/rules/properties/workspaceDependencies/properties/allowPatterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid13 = _errs41 === errors;if(!valid13){break;}}}else {validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies/allowPatterns",schemaPath:"#/properties/rules/properties/workspaceDependencies/properties/allowPatterns/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid12 = _errs39 === errors;}else {var valid12 = true;}if(valid12){if(data15.denyPatterns !== undefined){let data18 = data15.denyPatterns;const _errs43 = errors;if(errors === _errs43){if(Array.isArray(data18)){var valid14 = true;const len6 = data18.length;for(let i8=0; i8<len6; i8++){const _errs45 = errors;if(typeof data18[i8] !== "string"){validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies/denyPatterns/" + i8,schemaPath:"#/properties/rules/properties/workspaceDependencies/properties/denyPatterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid14 = _errs45 === errors;if(!valid14){break;}}}else {validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies/denyPatterns",schemaPath:"#/properties/rules/properties/workspaceDependencies/properties/denyPatterns/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid12 = _errs43 === errors;}else {var valid12 = true;}}}}else {validate10.errors = [{instancePath:instancePath+"/rules/workspaceDependencies",schemaPath:"#/properties/rules/properties/workspaceDependencies/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}}}}else {validate10.errors = [{instancePath:instancePath+"/rules",schemaPath:"#/properties/rules/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs33 === errors;}else {var valid0 = true;}if(valid0){if(data.defaultInputs !== undefined){let data20 = data.defaultInputs;const _errs47 = errors;if(errors === _errs47){if(data20 && typeof data20 == "object" && !Array.isArray(data20)){const _errs49 = errors;for(const key6 in data20){if(!(((key6 === "files") || (key6 === "workspacePatterns")) || (key6 === "externalDependencies"))){validate10.errors = [{instancePath:instancePath+"/defaultInputs",schemaPath:"#/properties/defaultInputs/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"}];return false;break;}}if(_errs49 === errors){if(data20.files !== undefined){let data21 = data20.files;const _errs50 = errors;if(errors === _errs50){if(Array.isArray(data21)){var valid16 = true;const len7 = data21.length;for(let i9=0; i9<len7; i9++){const _errs52 = errors;if(typeof data21[i9] !== "string"){validate10.errors = [{instancePath:instancePath+"/defaultInputs/files/" + i9,schemaPath:"#/properties/defaultInputs/properties/files/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid16 = _errs52 === errors;if(!valid16){break;}}}else {validate10.errors = [{instancePath:instancePath+"/defaultInputs/files",schemaPath:"#/properties/defaultInputs/properties/files/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid15 = _errs50 === errors;}else {var valid15 = true;}if(valid15){if(data20.workspacePatterns !== undefined){let data23 = data20.workspacePatterns;const _errs54 = errors;if(errors === _errs54){if(Array.isArray(data23)){var valid17 = true;const len8 = data23.length;for(let i10=0; i10<len8; i10++){const _errs56 = errors;if(typeof data23[i10] !== "string"){validate10.errors = [{instancePath:instancePath+"/defaultInputs/workspacePatterns/" + i10,schemaPath:"#/properties/defaultInputs/properties/workspacePatterns/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid17 = _errs56 === errors;if(!valid17){break;}}}else {validate10.errors = [{instancePath:instancePath+"/defaultInputs/workspacePatterns",schemaPath:"#/properties/defaultInputs/properties/workspacePatterns/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid15 = _errs54 === errors;}else {var valid15 = true;}if(valid15){if(data20.externalDependencies !== undefined){let data25 = data20.externalDependencies;const _errs58 = errors;if(errors === _errs58){if(Array.isArray(data25)){var valid18 = true;const len9 = data25.length;for(let i11=0; i11<len9; i11++){const _errs60 = errors;if(typeof data25[i11] !== "string"){validate10.errors = [{instancePath:instancePath+"/defaultInputs/externalDependencies/" + i11,schemaPath:"#/properties/defaultInputs/properties/externalDependencies/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid18 = _errs60 === errors;if(!valid18){break;}}}else {validate10.errors = [{instancePath:instancePath+"/defaultInputs/externalDependencies",schemaPath:"#/properties/defaultInputs/properties/externalDependencies/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid15 = _errs58 === errors;}else {var valid15 = true;}}}}}else {validate10.errors = [{instancePath:instancePath+"/defaultInputs",schemaPath:"#/properties/defaultInputs/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs47 === errors;}else {var valid0 = true;}}}}}}}else {validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate10.errors = vErrors;return errors === 0;}
|