[lockfile-explorer] Architecture improvents#5357
Merged
octogonz merged 21 commits intomicrosoft:mainfrom Sep 14, 2025
Merged
Conversation
…pendency.ts into lfxGraphLoader.ts (preparing to later move this code from client to server)
octogonz
commented
Sep 13, 2025
| @@ -0,0 +1,363 @@ | |||
| // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. | |||
| // See LICENSE in the project root for license information. | |||
Collaborator
Author
There was a problem hiding this comment.
Once this code is moved to Node.js, we can start cleaning it up and improving the support for different PNPM lockfile versions.
From the spec:
Relation of pnpm version to lockfile version
| lockfile version | used by pnpm versions |
|---|---|
| 9.0 | >=9.0.0 |
| 6.0 | >=8.0.0 <9.0.0 |
| 5.4 | >=7.0.0 <8.0.0 |
| 5.3 | >=6.0.0 |
| . . . | . . . |
iclanton
reviewed
Sep 14, 2025
| "eslint": "~9.25.1", | ||
| "local-web-rig": "workspace:*" | ||
| "local-web-rig": "workspace:*", | ||
| "typescript": "5.8.2" |
Member
There was a problem hiding this comment.
That isn't a problem in other Rush repos. VSCode should be able to fall back to TypeScript that it ships with.
Comment on lines
+6
to
+11
| declare global { | ||
| // eslint-disable-next-line @typescript-eslint/naming-convention | ||
| interface Window { | ||
| appContext: IAppContext; | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| declare global { | |
| // eslint-disable-next-line @typescript-eslint/naming-convention | |
| interface Window { | |
| appContext: IAppContext; | |
| } | |
| } | |
| declare const window: Window & { appContext: IAppContext }; |
Collaborator
Author
There was a problem hiding this comment.
@iclanton Your version didn't compile:
Encountered 5 errors
[build:typescript] src/containers/LogoPanel/index.tsx:10:44 - (TS2339) Property 'appContext' does not exist on type 'Window & typeof globalThis'.
[build:typescript] src/helpers/lfxApiClient.ts:7:36 - (TS2339) Property 'appContext' does not exist on type 'Window & typeof globalThis'.
[build:typescript] src/helpers/logDiagnosticInfo.ts:7:14 - (TS2339) Property 'appContext' does not exist on type 'Window & typeof globalThis'.
[build:typescript] src/parsing/readLockfile.ts:7:35 - (TS2339) Property 'appContext' does not exist on type 'Window & typeof globalThis'.
[build:typescript] src/stub/initappcontext.ts:11:8 - (TS2339) Property 'appContext' does not exist on type 'Window & typeof globalThis'.
Member
There was a problem hiding this comment.
It'd probabl have to be /// <reference ... />'d
| "changes": [ | ||
| { | ||
| "packageName": "@rushstack/lockfile-explorer", | ||
| "comment": "Refactoring to support future work", |
Member
There was a problem hiding this comment.
Is this useful in the changelog?
Collaborator
Author
There was a problem hiding this comment.
It might be if we automatically publish a patch change and it breaks something.
octogonz
commented
Sep 14, 2025
iclanton
approved these changes
Sep 14, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
This is a refactoring step to prepare for future improvements of Lockfile Explorer.
Details
Lockfile Explorer is separated into a Node.js server and a web browser client. Today the YAML parsing is split between client/server, which makes it difficult to support and debug lockfile format versions. This PR is the first step towards a new architecture where the server will do all the YAML parsing to produce the "graph" that backs the client's UX. That means we need to isolate the graph data and make it JSON-serializable.
We also need to move lfxGraphLoader.ts to run on the server instead of client, but I will do that as a separate PR.
Summary of changes in this PR:
How it was tested
Impacted documentation
None
@william2958