Inputs
What is an Input?
Inputs are values considered to affect the state of a workspace or the result of a script.
These can be configured via workspace config options, which can be set at
the workspace level (defaultInputs) or at the script level (scripts[name].inputs).
Inputs are used for determining affected workspaces and the verify feature.
A workspace's inputs can include its files, other workspaces, or external dependencies, defined in depth below:
Files
A file can be an input, which must be git-trackable (not ignored and within your repo).
Default: All git-trackable files in a workspace's directory
Notes:
Files that are staged, unstaged, or untracked (but not ignored) are inputs by default but can usually be selectively excluded in features.
If a workspace is nested within another workspace, the parent workspace's input files cannot be in the nested workspace. This is usually relevant when including the root workspace as a normal workspace.
Configuring Files
Files are specified as paths relative to the workspace's directory.
Paths with a leading / are relative to the project root. Prefix with ! to exclude.
Workspace configuration example:
// /path/to/your/project/workspace/pacwich.workspace.ts
import { defineWorkspaceConfig } from "pacwich/config";
export default defineWorkspaceConfig({
// workspace's defaults
"defaultInputs": {
"files": [
"src/**/*.ts",
"!src/**/*.test.ts", // ignore test files
"/tsconfig.json" // relative to project root
],
},
// per-script
"scripts": {
"test": {
"inputs": {
"files": [
"src/**/*.ts"
],
},
},
},
});
Other Workspaces
Another workspace may be an input.
Default: All workspaces declared as dependencies in package.json
A workspace input may be a dependency on another workspace declared in package.json,
or a workspace explicitly configured to be an input (see below).
A workspace is affected if one of its workspace inputs is affected. You can also think of this as a workspace inheriting the inputs of any workspaces it depends on.
Configuring Workspace Inputs
In features using inputs, you can generally ignore the automatic inclusion
of package.json dependencies if needed.
When you need to treat other workspaces like dependencies, you can also specify workspace patterns to be considered inputs to a workspace via the inputs.
Workspace configuration example:
// /path/to/your/project/workspace/pacwich.workspace.ts
import { defineWorkspaceConfig } from "pacwich/config";
export default defineWorkspaceConfig({
// workspace's defaults
"defaultInputs": {
"workspacePatterns": ["tag:my-tag"],
},
// per-script
"scripts": {
"build": {
"inputs": {
"workspacePatterns": ["path:my-path/**/*"],
},
},
},
});
External Dependencies
The installed version of an external dependency (e.g. an npm package) is considered an input.
Default: All external dependencies declared in package.json
The resolved version in your package manager lockfile (e.g. bun.lock, package-lock.json, yarn.lock)
is used to determine if an external dependency has changed.
Configuring External Dependencies
You can configure a list of specific external package names to consider inputs.
When not provided, all external dependencies are considered inputs. When provided, only the specified dependencies are considered inputs, so an empty array means no external dependencies are considered inputs.
Workspace configuration example:
// /path/to/your/project/workspace/pacwich.workspace.ts
import { defineWorkspaceConfig } from "pacwich/config";
export default defineWorkspaceConfig({
// workspace's defaults
"defaultInputs": {
"externalDependencies": ["lodash"],
},
// per-script
"scripts": {
"build": {
"inputs": {
"externalDependencies": ["lodash", "react"],
},
},
},
});

