@rushstack/webpack-workspace-resolve-plugin 0.4.32 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +35 -0
- package/CHANGELOG.md +13 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/KnownDescriptionFilePlugin.d.ts.map +1 -1
- package/lib/KnownDescriptionFilePlugin.js.map +1 -1
- package/lib/KnownPackageDependenciesPlugin.d.ts.map +1 -1
- package/lib/KnownPackageDependenciesPlugin.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/webpack-workspace-resolve-plugin",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.5.1",
|
|
6
|
+
"tag": "@rushstack/webpack-workspace-resolve-plugin_v0.5.1",
|
|
7
|
+
"date": "Wed, 08 Oct 2025 00:13:29 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"dependency": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Updating dependency \"@rushstack/lookup-by-path\" to `0.8.3`"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"comment": "Updating dependency \"@rushstack/heft\" to `1.1.1`"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"version": "0.5.0",
|
|
21
|
+
"tag": "@rushstack/webpack-workspace-resolve-plugin_v0.5.0",
|
|
22
|
+
"date": "Fri, 03 Oct 2025 20:10:00 GMT",
|
|
23
|
+
"comments": {
|
|
24
|
+
"minor": [
|
|
25
|
+
{
|
|
26
|
+
"comment": "Normalize import of builtin modules to use the `node:` protocol."
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"dependency": [
|
|
30
|
+
{
|
|
31
|
+
"comment": "Updating dependency \"@rushstack/lookup-by-path\" to `0.8.2`"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"comment": "Updating dependency \"@rushstack/heft\" to `1.1.0`"
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
4
39
|
{
|
|
5
40
|
"version": "0.4.32",
|
|
6
41
|
"tag": "@rushstack/webpack-workspace-resolve-plugin_v0.4.32",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Change Log - @rushstack/webpack-workspace-resolve-plugin
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 08 Oct 2025 00:13:29 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.5.1
|
|
6
|
+
Wed, 08 Oct 2025 00:13:29 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 0.5.0
|
|
11
|
+
Fri, 03 Oct 2025 20:10:00 GMT
|
|
12
|
+
|
|
13
|
+
### Minor changes
|
|
14
|
+
|
|
15
|
+
- Normalize import of builtin modules to use the `node:` protocol.
|
|
4
16
|
|
|
5
17
|
## 0.4.32
|
|
6
18
|
Tue, 30 Sep 2025 23:57:45 GMT
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnownDescriptionFilePlugin.d.ts","sourceRoot":"","sources":["../src/KnownDescriptionFilePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"KnownDescriptionFilePlugin.d.ts","sourceRoot":"","sources":["../src/KnownDescriptionFilePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIzD,OAAO,KAAK,EAAmB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAIpF;;;;GAIG;AACH,qBAAa,0BAA0B;IACrC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAE9C;;;;;;OAMG;gBACgB,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,OAAO;IAOjG,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CA0GvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnownDescriptionFilePlugin.js","sourceRoot":"","sources":["../src/KnownDescriptionFilePlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;
|
|
1
|
+
{"version":3,"file":"KnownDescriptionFilePlugin.js","sourceRoot":"","sources":["../src/KnownDescriptionFilePlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAU3D;;;;GAIG;AACH,MAAa,0BAA0B;IAOrC;;;;;;OAMG;IACH,YAAmB,KAA2B,EAAE,MAAc,EAAE,MAAc,EAAE,cAAwB;QACtG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,cAAc,CAAC;IAC1C,CAAC;IAEM,KAAK,CAAC,QAAkB;QAC7B,IAAI,IAAI,CAAC,eAAe,IAAI,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC9D,OAAO;QACT,CAAC;QAED,MAAM,MAAM,GAAuC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpF,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;QAIhC,SAAS,4B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,CAAC,SAAS,CAChB,MAAM,EACN,GAAG,EACH,0BAA0B,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,YAAY,GAAG,GAAG,EAC3F,cAAc,EACd,CAAC,CAA2B,EAAE,MAAkC,EAAE,EAAE;oBAClE,IAAI,CAAC,EAAE,CAAC;wBACN,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;oBACrB,CAAC;oBAED,+BAA+B;oBAC/B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;wBACzB,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;oBAC9B,CAAC;oBACD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBACzB,CAAC,CACF,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AA/HD,gEA+HC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { InputFileSystem, Resolver } from 'webpack';\n\nimport type { IPrefixMatch } from '@rushstack/lookup-by-path';\n\nimport type { IResolveContext, WorkspaceLayoutCache } from './WorkspaceLayoutCache';\n\ntype ResolveRequest = Parameters<Resolver['hooks']['resolveStep']['call']>[1];\n\n/**\n * A resolver plugin that optimizes locating the package.json file for a module.\n *\n * @internal\n */\nexport class KnownDescriptionFilePlugin {\n public readonly source: string;\n public readonly target: string;\n\n private readonly _skipForContext: boolean;\n private readonly _cache: WorkspaceLayoutCache;\n\n /**\n * Constructs a new instance of `KnownDescriptionFilePlugin`.\n * @param cache - The workspace layout cache\n * @param source - The resolve step to hook into\n * @param target - The resolve step to delegate to\n * @param skipForContext - If true, don't apply this plugin if the resolver is configured to resolve to a context\n */\n public constructor(cache: WorkspaceLayoutCache, source: string, target: string, skipForContext?: boolean) {\n this.source = source;\n this.target = target;\n this._cache = cache;\n this._skipForContext = !!skipForContext;\n }\n\n public apply(resolver: Resolver): void {\n if (this._skipForContext && resolver.options.resolveToContext) {\n return;\n }\n\n const target: ReturnType<Resolver['ensureHook']> = resolver.ensureHook(this.target);\n const { fileSystem } = resolver;\n\n type JsonObjectTypes = ReturnType<NonNullable<InputFileSystem['readJsonSync']>>;\n\n function readDescriptionFileWithParse(\n descriptionFilePath: string,\n callback: (err: Error | null | undefined, data?: JsonObjectTypes) => void\n ): void {\n fileSystem.readFile(descriptionFilePath, (err: Error | null | undefined, data?: string | Buffer) => {\n if (!data?.length) {\n return callback(err);\n }\n callback(null, JSON.parse(data.toString()));\n });\n }\n\n const readDescriptionFile: (\n descriptionFilePath: string,\n cb: (err: Error | null | undefined, data?: JsonObjectTypes) => void\n ) => void = fileSystem.readJson?.bind(fileSystem) ?? readDescriptionFileWithParse;\n\n resolver\n .getHook(this.source)\n .tapAsync(KnownDescriptionFilePlugin.name, (request, resolveContext, callback) => {\n const { path } = request;\n if (!path) {\n // No request, nothing to do.\n return callback();\n }\n\n const cache: WorkspaceLayoutCache = this._cache;\n\n const match: IPrefixMatch<IResolveContext> | undefined =\n cache.contextLookup.findLongestPrefixMatch(path);\n if (!match) {\n // No description file available, proceed without.\n return callback();\n }\n\n const remainingPath: string = path.slice(match.index);\n const relativePath: string = `.${cache.normalizeToSlash?.(remainingPath) ?? remainingPath}`;\n const descriptionFileRoot: string = `${path.slice(0, match.index)}`;\n const descriptionFilePath: string = `${descriptionFileRoot}${cache.resolverPathSeparator}package.json`;\n\n const { contextForPackage } = cache;\n\n readDescriptionFile(descriptionFilePath, (err, descriptionFileData) => {\n if (!descriptionFileData) {\n resolveContext.missingDependencies?.add(descriptionFilePath);\n return callback(err);\n }\n\n resolveContext.fileDependencies?.add(descriptionFilePath);\n // Store the resolver context since a WeakMap lookup is cheaper than walking the tree again\n contextForPackage.set(descriptionFileData, match);\n\n // Using the object literal is an order of magnitude faster, at least on node 18.19.1\n const obj: ResolveRequest = {\n path: request.path,\n context: request.context,\n descriptionFilePath,\n descriptionFileRoot,\n descriptionFileData,\n relativePath,\n ignoreSymlinks: request.ignoreSymlinks,\n fullySpecified: request.fullySpecified,\n __innerRequest: request.__innerRequest,\n __innerRequest_request: request.__innerRequest_request,\n __innerRequest_relativePath: request.__innerRequest_relativePath,\n\n request: request.request,\n query: request.query,\n fragment: request.fragment,\n module: request.module,\n directory: request.directory,\n file: request.file,\n internal: request.internal\n };\n\n // Delegate to the resolver step at `target`.\n resolver.doResolve(\n target,\n obj,\n 'using description file: ' + descriptionFilePath + ' (relative path: ' + relativePath + ')',\n resolveContext,\n (e: Error | null | undefined, result: ResolveRequest | undefined) => {\n if (e) {\n return callback(e);\n }\n\n // Don't allow other processing\n if (result === undefined) {\n return callback(null, null);\n }\n callback(null, result);\n }\n );\n });\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnownPackageDependenciesPlugin.d.ts","sourceRoot":"","sources":["../src/KnownPackageDependenciesPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"KnownPackageDependenciesPlugin.d.ts","sourceRoot":"","sources":["../src/KnownPackageDependenciesPlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC,OAAO,KAAK,EAAmB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAIpF;;;;;GAKG;AACH,qBAAa,8BAA8B;IACzC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAE9C;;;;;OAKG;gBACgB,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAMvE,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAwEvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KnownPackageDependenciesPlugin.js","sourceRoot":"","sources":["../src/KnownPackageDependenciesPlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;
|
|
1
|
+
{"version":3,"file":"KnownPackageDependenciesPlugin.js","sourceRoot":"","sources":["../src/KnownPackageDependenciesPlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAU3D;;;;;GAKG;AACH,MAAa,8BAA8B;IAMzC;;;;;OAKG;IACH,YAAmB,KAA2B,EAAE,MAAc,EAAE,MAAc;QAC5E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,QAAkB;QAC7B,MAAM,MAAM,GAAuC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEpF,QAAQ;aACL,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;aACpB,QAAQ,CAAC,8BAA8B,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE;YACnF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;YAC9C,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,OAAO,QAAQ,EAAE,CAAC;YACpB,CAAC;YAED,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,OAAO,QAAQ,EAAE,CAAC;YACpB,CAAC;YAED,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;YACxC,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBACzB,OAAO,QAAQ,CAAC,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC,CAAC;YACzE,CAAC;YAED,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC;YAEhD,IAAI,KAAK,GACP,KAAK,CAAC,iBA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mB;gBACzB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,mBAAmB,EAAE,GAAG,mBAAmB,GAAG,KAAK,CAAC,qBAAqB,cAAc;gBACvF,mBAAmB;gBACnB,mBAAmB,EAAE,SAAS;gBAC9B,YAAY;gBACZ,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,cAAc;gBACd,cAAc,EAAE,OAAO,CAAC,cAAc;gBACtC,sBAAsB,EAAE,OAAO,CAAC,sBAAsB;gBACtD,2BAA2B,EAAE,OAAO,CAAC,2BAA2B;gBAEhE,OAAO,EAAE,YAAY;gBACrB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,MAAM,EAAE,KAAK;gBACb,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;aAC3B,CAAC;YACF,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AA1FD,wEA0FC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { Resolver } from 'webpack';\n\nimport type { IPrefixMatch } from '@rushstack/lookup-by-path';\n\nimport type { IResolveContext, WorkspaceLayoutCache } from './WorkspaceLayoutCache';\n\ntype ResolveRequest = Parameters<Resolver['hooks']['resolveStep']['call']>[1];\n\n/**\n * A resolver plugin that optimizes resolving installed dependencies for the current package.\n * Enforces strict resolution.\n *\n * @internal\n */\nexport class KnownPackageDependenciesPlugin {\n public readonly source: string;\n public readonly target: string;\n\n private readonly _cache: WorkspaceLayoutCache;\n\n /**\n * Constructs a new instance of `KnownPackageDependenciesPlugin`.\n * @param cache - The workspace layout cache\n * @param source - The resolve step to hook into\n * @param target - The resolve step to delegate to\n */\n public constructor(cache: WorkspaceLayoutCache, source: string, target: string) {\n this.source = source;\n this.target = target;\n this._cache = cache;\n }\n\n public apply(resolver: Resolver): void {\n const target: ReturnType<Resolver['ensureHook']> = resolver.ensureHook(this.target);\n\n resolver\n .getHook(this.source)\n .tapAsync(KnownPackageDependenciesPlugin.name, (request, resolveContext, callback) => {\n const { path, request: rawRequest } = request;\n if (!path) {\n return callback();\n }\n\n if (!rawRequest) {\n return callback();\n }\n\n const { descriptionFileData } = request;\n if (!descriptionFileData) {\n return callback(new Error(`Expected descriptionFileData for ${path}`));\n }\n\n const cache: WorkspaceLayoutCache = this._cache;\n\n let scope: IPrefixMatch<IResolveContext> | undefined =\n cache.contextForPackage.get(descriptionFileData);\n if (!scope) {\n scope = cache.contextLookup.findLongestPrefixMatch(path);\n if (!scope) {\n return callback(new Error(`Expected context for ${request.descriptionFileRoot}`));\n }\n cache.contextForPackage.set(descriptionFileData, scope);\n }\n\n let dependency: IPrefixMatch<IResolveContext> | undefined;\n while (scope && !dependency) {\n dependency = scope.value.findDependency(rawRequest);\n scope = scope.lastMatch;\n }\n\n if (!dependency) {\n return callback();\n }\n\n const isPackageRoot: boolean = dependency.index === rawRequest.length;\n const fullySpecified: boolean | undefined = isPackageRoot ? false : request.fullySpecified;\n const remainingPath: string = isPackageRoot ? '.' : `.${rawRequest.slice(dependency.index)}`;\n const relativePath: string =\n (remainingPath.length > 1 && cache.normalizeToSlash?.(remainingPath)) || remainingPath;\n const { descriptionFileRoot } = dependency.value;\n const obj: ResolveRequest = {\n path: descriptionFileRoot,\n context: request.context,\n descriptionFilePath: `${descriptionFileRoot}${cache.resolverPathSeparator}package.json`,\n descriptionFileRoot,\n descriptionFileData: undefined,\n relativePath,\n ignoreSymlinks: request.ignoreSymlinks,\n fullySpecified,\n __innerRequest: request.__innerRequest,\n __innerRequest_request: request.__innerRequest_request,\n __innerRequest_relativePath: request.__innerRequest_relativePath,\n\n request: relativePath,\n query: request.query,\n fragment: request.fragment,\n module: false,\n directory: request.directory,\n file: request.file,\n internal: request.internal\n };\n resolver.doResolve(target, obj, null, resolveContext, callback);\n });\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/webpack-workspace-resolve-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "This plugin leverages workspace-level metadata to greatly accelerate module resolution.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "dist/webpack-workspace-resolve-plugin.d.ts",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
"@types/node": "*"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@rushstack/lookup-by-path": "0.8.
|
|
21
|
+
"@rushstack/lookup-by-path": "0.8.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "20.17.19",
|
|
25
25
|
"eslint": "~9.25.1",
|
|
26
26
|
"memfs": "4.12.0",
|
|
27
27
|
"webpack": "~5.98.0",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"local-node-rig": "1.0.0",
|
|
29
|
+
"@rushstack/heft": "1.1.1"
|
|
30
30
|
},
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"peerDependenciesMeta": {
|