Skip to content

Commit

Permalink
Document --isolate-workspaces + reword principal → program
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Dec 13, 2023
1 parent f72bf62 commit c5f98fd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/docs/src/content/docs/guides/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ messages like this:

```sh
...
[*] Installed 2 principals for 29 workspaces
[*] Installed 2 programs for 29 workspaces
...
[*] Analyzing used resolved files [P1/1] (123)
...
Expand Down
15 changes: 15 additions & 0 deletions packages/docs/src/content/docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ Total running time: 5s (mem: 631.27MB)
- `median`: the median invocation
- `sum` the accumulated time of all invocations

### `--isolate-workspaces`

By default, Knip optimizes performance by adding eligible workspaces to existing
TypeScript programs, based on the compatibility of their `compilerOptions`. Use
this flag to disable this behavior and create one program per workspace.

You can see the behavior in action in [debug mode](#--debug). Look for messages
like this:

```sh
[*] Installed 4 programs for 18 workspaces
...
[*] Analyzing used resolved files [P1/1] (78)
```

## Configuration

### `--config [file]`
Expand Down
2 changes: 1 addition & 1 deletion packages/knip/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export const main = async (unresolvedConfiguration: CommandLineOptions) => {

const principals = factory.getPrincipals();

debugLog('*', `Installed ${principals.length} principals for ${workspaces.length} workspaces`);
debugLog('*', `Created ${principals.length} programs for ${workspaces.length} workspaces`);

const analyzedFiles = new Set<string>();
const exportedSymbols: Exports = new Map();
Expand Down
2 changes: 1 addition & 1 deletion packages/knip/src/util/cli-arguments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Options:
--fix Fix issues
--fix-type Fix only issues of type, can be comma-separated or repeated (2)
--include-entry-exports Include entry files when reporting unused exports
--isolate-workspaces Isolated workspaces in monorepo
--isolate-workspaces Isolate workspaces into separate programs (default: false)
-n, --no-progress Don't show dynamic progress updates (automatically enabled in CI environments)
--preprocessor Preprocess the results before providing it to the reporter(s), can be repeated
--preprocessor-options Pass extra options to the preprocessor (as JSON string, see --reporter-options example)
Expand Down

0 comments on commit c5f98fd

Please sign in to comment.