-
Notifications
You must be signed in to change notification settings - Fork 0
fix(vscode): treat missing dependencies as a state, not an error #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6230de5
fix(vscode): treat missing dependencies as a state, not an error
fi3ework a35984a
fix(vscode): keep the not-installed classification honest across stacks
fi3ework 9066a5b
fix(vscode): classify only bare package imports as not installed
fi3ework 8b832e7
fix(vscode): keep independent failure facts from masking each other
fi3ework 82adc59
docs(vscode): scope the config-import case to Rstest, tracked in #30
fi3ework File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { | ||
| COMMAND_CATEGORY, | ||
| STACK_LABELS, | ||
| type StackId, | ||
| stackCommandTitle, | ||
| } from '../types'; | ||
|
|
||
| /** | ||
| * The not-installed policy's words, once for all three stacks (AGENTS.md | ||
| * rules): a project whose dependencies are not installed is a `disabled` | ||
| * status whose reason names the way out, plus one `warn` line in the output | ||
| * channel. The stacks share the wording the way they share | ||
| * `formatVersionMismatch` — each keeps its own status machinery, but what | ||
| * the user reads is one sentence, not three near-copies. | ||
| * | ||
| * The trailing hint covers the recovery no watcher sees: an install that | ||
| * changes no lockfile (a fresh clone whose lockfile is already current) fires | ||
| * no detection pass, so the restart command is the way out and the status is | ||
| * where it has to be named (ADR 0002). | ||
| */ | ||
| const restartHint = (stack: StackId): string => | ||
| `then run "${COMMAND_CATEGORY}: ${stackCommandTitle(stack, 'restart')}" if this status stays`; | ||
|
|
||
| /** The `disabled` reason for a package the stack needs and cannot find. */ | ||
| export const formatNotInstalledStatus = ( | ||
| stack: StackId, | ||
| packageName: string, | ||
| ): string => | ||
| `${packageName} is not installed (node_modules missing) — install it, ${restartHint(stack)}`; | ||
|
|
||
| /** | ||
| * The `disabled` reason for a config that evaluates but imports a package | ||
| * that is not there. `configPath` is workspace-relative: the status has no | ||
| * room for more. | ||
| */ | ||
| export const formatConfigDependencyMissingStatus = ( | ||
| stack: StackId, | ||
| configPath: string, | ||
| ): string => | ||
| `${configPath} imports a package that is not installed — install the project dependencies, ${restartHint(stack)}`; | ||
|
|
||
| /** | ||
| * The output-channel line for a config that imports a package that is not | ||
| * installed. `cause` is the loader's own first line, which names the | ||
| * specifier and the importer. | ||
| */ | ||
| export const formatConfigDependencyMissingLog = ( | ||
| stack: StackId, | ||
| configPath: string, | ||
| cause: string, | ||
| ): string => | ||
| `Cannot load ${configPath}: ${cause}. Install the project dependencies to enable ${STACK_LABELS[stack]} for this config.`; | ||
|
|
||
| /** | ||
| * The output-channel line: where the stack looked, plus the stack's own | ||
| * consequence — the same shape as the shared Node preflight message | ||
| * (adaptation 6), where each caller appends what the state means for it. | ||
| */ | ||
| export const formatNotInstalledLog = ( | ||
| packageName: string, | ||
| folderName: string, | ||
| searchedFrom: string, | ||
| consequence?: string, | ||
| ): string => | ||
| `${packageName} is not installed in ${folderName} (node_modules missing); searched from ${searchedFrom}${ | ||
| consequence ? `; ${consequence}` : '' | ||
| }`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.