Configuration: Overview
Configuration is set by JSON. Config files can be written in TypeScript, JavaScript, JSON, or JSONC.
See Project Configuration and Workspace Configuration for more information on the purpose of each field.
Quick Examples
Project Configuration
The project configuration is for project-wide settings.
// path/to/your/project/pacwich.project.ts
import { defineProjectConfig } from "pacwich/config";
export default defineProjectConfig({
defaults: {
parallelMax: 4,
affectedBaseRef: "my-branch"
},
workspacePatternConfigs: [
{
patterns: [
"path:libraries/frontend/**/*"
],
config: {
tags: [
"frontend",
"library"
]
}
}
]
});
Workspace Configuration
Workspace configurations are defined in the directory of a workspace.
// path/to/your/project/workspace/pacwich.workspace.ts
import { defineWorkspaceConfig } from "pacwich/config";
export default defineWorkspaceConfig({
alias: "myApp",
tags: [
"my-tag"
],
scripts: {
start: {
order: 10
},
test: {
order: 20
}
},
rules: {
workspaceDependencies: {
allowPatterns: [
"my-workspace-a",
"tag:my-tag",
"path:my-path/**/*",
"not:tag:my-excluded-tag"
]
}
}
});
Config Locations / File Types
Configuration locations
Configuration files can be read from the following location. The first to be resolved in this order will be used:
- TypeScript file:
pacwich.<name>.ts - JavaScript file:
pacwich.<name>.js - JSONC file:
pacwich.<name>.jsonc - JSON file:
pacwich.<name>.json - package.json key:
package.json["<key>"]
Value Resolution
Values related to configuration are resolved in the following order of precedence:
- An explicit CLI or API argument/option passed to a method/function/command
- A value provided in a configuration file
- A value provided via an environment variable, if applicable
- The generic default value, if applicable


