Skip to content
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

Enhance LookupByPath, Fix win32 paths in webpack-workspace-resolve-plugin #5050

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

dmichon-msft
Copy link
Contributor

Summary

Adds more functionality to @rushstack/lookup-by-path, especially with respect to overriding the delimiter per-method.
Fixes path parsing on Windows in @rushstack/webpack-workspace-resolve-plugin.

Details

Adds new methods to LookupByPath<TItem>:

  • isEmpty(): boolean
  • get(query: string, delimiter?: string): TItem | undefined
  • has(query: string, delimiter?: string): boolean

Enhances all read/write methods with the optional delimiter?: string parameter to allow overriding the delimiter used to parse the input.

Since the Rush cache file contains only / as the directory separator, updates the parsing in WorkspaceLayoutCache to parse all paths using / as the delimiter when hydrating LookupByPath instances.

How it was tested

Added unit tests.

Impacted documentation

API documentation for LookupByPath.

libraries/lookup-by-path/src/LookupByPath.ts Outdated Show resolved Hide resolved
Add more support for delimiter overrides per method.
Also tap hooks earlier to avoid sequencing issues.
@dmichon-msft dmichon-msft enabled auto-merge (squash) December 18, 2024 00:15
@dmichon-msft dmichon-msft merged commit 970b221 into microsoft:main Dec 18, 2024
5 checks passed
@dmichon-msft dmichon-msft deleted the lookup-enhancements branch December 18, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants