@rushstack/webpack-workspace-resolve-plugin 0.3.0 → 0.3.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 CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "name": "@rushstack/webpack-workspace-resolve-plugin",
3
3
  "entries": [
4
+ {
5
+ "version": "0.3.1",
6
+ "tag": "@rushstack/webpack-workspace-resolve-plugin_v0.3.1",
7
+ "date": "Thu, 29 Aug 2024 00:11:32 GMT",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "Fix description file resolution after cross-package import."
12
+ }
13
+ ]
14
+ }
15
+ },
4
16
  {
5
17
  "version": "0.3.0",
6
18
  "tag": "@rushstack/webpack-workspace-resolve-plugin_v0.3.0",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @rushstack/webpack-workspace-resolve-plugin
2
2
 
3
- This log was last generated on Wed, 28 Aug 2024 00:11:41 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 29 Aug 2024 00:11:32 GMT and should not be manually modified.
4
+
5
+ ## 0.3.1
6
+ Thu, 29 Aug 2024 00:11:32 GMT
7
+
8
+ ### Patches
9
+
10
+ - Fix description file resolution after cross-package import.
4
11
 
5
12
  ## 0.3.0
6
13
  Wed, 28 Aug 2024 00:11:41 GMT
@@ -1 +1 @@
1
- {"version":3,"file":"WorkspaceResolvePlugin.d.ts","sourceRoot":"","sources":["../src/WorkspaceResolvePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,KAAK,EAAE,oBAAoB,CAAC;CAC7B;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,qBAAqB;IAClE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;gBAE3B,KAAK,EAAE,oBAAoB;IAIvC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAgCvC"}
1
+ {"version":3,"file":"WorkspaceResolvePlugin.d.ts","sourceRoot":"","sources":["../src/WorkspaceResolvePlugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,KAAK,EAAE,oBAAoB,CAAC;CAC7B;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,qBAAqB;IAClE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;gBAE3B,KAAK,EAAE,oBAAoB;IAIvC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAkCvC"}
@@ -35,7 +35,9 @@ class WorkspaceResolvePlugin {
35
35
  new KnownDescriptionFilePlugin_1.KnownDescriptionFilePlugin(cache, 'parsed-resolve', 'described-resolve'),
36
36
  // Optimize locating the installed dependencies of the current package
37
37
  new KnownPackageDependenciesPlugin_1.KnownPackageDependenciesPlugin(cache, 'raw-module', 'resolve-as-module'),
38
- // Optimize loading the package.json file for the destination package
38
+ // Optimize loading the package.json file for the destination package (bare specifier)
39
+ new KnownDescriptionFilePlugin_1.KnownDescriptionFilePlugin(cache, 'resolve-as-module', 'resolve-in-package'),
40
+ // Optimize loading the package.json file for the destination package (relative path)
39
41
  new KnownDescriptionFilePlugin_1.KnownDescriptionFilePlugin(cache, 'relative', 'described-relative'),
40
42
  // Optimize locating and loading nested package.json for a directory
41
43
  new KnownDescriptionFilePlugin_1.KnownDescriptionFilePlugin(cache, 'undescribed-existing-directory', 'existing-directory', true),
@@ -1 +1 @@
1
- {"version":3,"file":"W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;YAC/D,IAAI,uDAA0B,CAAC,KAAK,EAAE,sBAAsB,EAAE,UAAU,CAAC,CAC1E,CAAC;YAEF,OAAO,cAAc,CAAC;QACxB,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAvCD,wDAuCC","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 { WebpackPluginInstance, Compiler } from 'webpack';\n\nimport type { WorkspaceLayoutCache } from './WorkspaceLayoutCache';\nimport { KnownDescriptionFilePlugin } from './KnownDescriptionFilePlugin';\nimport { KnownPackageDependenciesPlugin } from './KnownPackageDependenciesPlugin';\n\n/**\n * Options for constructing a `WorkspaceResolvePlugin`.\n *\n * @beta\n */\nexport interface IWorkspaceResolvePluginOptions {\n /**\n * The cache of workspace layout information.\n */\n cache: WorkspaceLayoutCache;\n}\n\n/**\n * A Webpack plugin that optimizes package.json lookups and resolution of bare specifiers in a monorepo.\n *\n * @beta\n */\nexport class WorkspaceResolvePlugin implements WebpackPluginInstance {\n private readonly _cache: WorkspaceLayoutCache;\n\n public constructor(cache: WorkspaceLayoutCache) {\n this._cache = cache;\n }\n\n public apply(compiler: Compiler): void {\n compiler.resolverFactory.hooks.resolveOptions\n .for('normal')\n .tap(WorkspaceResolvePlugin.name, (resolveOptions) => {\n // Omit default `node_modules`\n if (resolveOptions.modules) {\n resolveOptions.modules = resolveOptions.modules.filter((modulePath: string) => {\n return modulePath !== 'node_modules';\n });\n } else {\n resolveOptions.modules = [];\n }\n\n const cache: WorkspaceLayoutCache = this._cache;\n\n resolveOptions.plugins ??= [];\n resolveOptions.plugins.push(\n // Optimize identifying the package.json file for the issuer\n new KnownDescriptionFilePlugin(cache, 'parsed-resolve', 'described-resolve'),\n // Optimize locating the installed dependencies of the current package\n new KnownPackageDependenciesPlugin(cache, 'raw-module', 'resolve-as-module'),\n // Optimize loading the package.json file for the destination package\n new KnownDescriptionFilePlugin(cache, 'relative', 'described-relative'),\n // Optimize locating and loading nested package.json for a directory\n new KnownDescriptionFilePlugin(cache, 'undescribed-existing-directory', 'existing-directory', true),\n // Optimize locating and loading nested package.json for a file\n new KnownDescriptionFilePlugin(cache, 'undescribed-raw-file', 'raw-file')\n );\n\n return resolveOptions;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"WorkspaceResolvePlugin.js","sourceRoot":"","sources":["../src/WorkspaceResolvePlugin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAK3D,6EAA0E;AAC1E,qFAAkF;AAclF;;;;GAIG;AACH,MAAa,sBAAsB;IAGjC,YAAmB,KAA2B;QAC5C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,QAAkB;QAC7B,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc;aAC1C,GAAG,CAAC,QAAQ,CAAC;aACb,GAAG,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC,cAAc,EAAE,EAAE;;YACnD,8BAA8B;YAC9B,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;gBAC3B,cAAc,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,UAAkB,EAAE,EAAE;oBAC5E,OAAO,UAAU,KAAK,cAAc,CAAC;gBACvC,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,cAAc,CAAC,OAAO,GAAG,EAAE,CAAC;YAC9B,CAAC;YAED,MAAM,KAAK,GAAyB,IAAI,CAAC,MAAM,CAAC;YAEhD,MAAA,cAAc,CAAC,OAAO,oCAAtB,cAAc,CAAC,OAAO,GAAK,EAAE,EAAC;YAC9B,cAAc,CAAC,OAAO,CAAC,IAAI;YACzB,4DAA4D;YAC5D,IAAI,uDAA0B,CAAC,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,CAAC;YAC5E,sEAAsE;YACtE,IAAI,+DAA8B,CAAC,KAAK,EAAE,YAAY,EAAE,mBAAmB,CAAC;YAC5E,sFAAsF;YACtF,IAAI,uDAA0B,CAAC,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,CAAC;YAChF,qFAAqF;YACrF,IAAI,uDAA0B,CAAC,KAAK,EAAE,UAAU,EAAE,oBAAoB,CAAC;YACvE,oEAAoE;YACpE,IAAI,uDAA0B,CAAC,KAAK,EAAE,gCAAgC,EAAE,oBAAoB,EAAE,IAAI,CAAC;YACnG,+DAA+D;YAC/D,IAAI,uDAA0B,CAAC,KAAK,EAAE,sBAAsB,EAAE,UAAU,CAAC,CAC1E,CAAC;YAEF,OAAO,cAAc,CAAC;QACxB,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAzCD,wDAyCC","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 { WebpackPluginInstance, Compiler } from 'webpack';\n\nimport type { WorkspaceLayoutCache } from './WorkspaceLayoutCache';\nimport { KnownDescriptionFilePlugin } from './KnownDescriptionFilePlugin';\nimport { KnownPackageDependenciesPlugin } from './KnownPackageDependenciesPlugin';\n\n/**\n * Options for constructing a `WorkspaceResolvePlugin`.\n *\n * @beta\n */\nexport interface IWorkspaceResolvePluginOptions {\n /**\n * The cache of workspace layout information.\n */\n cache: WorkspaceLayoutCache;\n}\n\n/**\n * A Webpack plugin that optimizes package.json lookups and resolution of bare specifiers in a monorepo.\n *\n * @beta\n */\nexport class WorkspaceResolvePlugin implements WebpackPluginInstance {\n private readonly _cache: WorkspaceLayoutCache;\n\n public constructor(cache: WorkspaceLayoutCache) {\n this._cache = cache;\n }\n\n public apply(compiler: Compiler): void {\n compiler.resolverFactory.hooks.resolveOptions\n .for('normal')\n .tap(WorkspaceResolvePlugin.name, (resolveOptions) => {\n // Omit default `node_modules`\n if (resolveOptions.modules) {\n resolveOptions.modules = resolveOptions.modules.filter((modulePath: string) => {\n return modulePath !== 'node_modules';\n });\n } else {\n resolveOptions.modules = [];\n }\n\n const cache: WorkspaceLayoutCache = this._cache;\n\n resolveOptions.plugins ??= [];\n resolveOptions.plugins.push(\n // Optimize identifying the package.json file for the issuer\n new KnownDescriptionFilePlugin(cache, 'parsed-resolve', 'described-resolve'),\n // Optimize locating the installed dependencies of the current package\n new KnownPackageDependenciesPlugin(cache, 'raw-module', 'resolve-as-module'),\n // Optimize loading the package.json file for the destination package (bare specifier)\n new KnownDescriptionFilePlugin(cache, 'resolve-as-module', 'resolve-in-package'),\n // Optimize loading the package.json file for the destination package (relative path)\n new KnownDescriptionFilePlugin(cache, 'relative', 'described-relative'),\n // Optimize locating and loading nested package.json for a directory\n new KnownDescriptionFilePlugin(cache, 'undescribed-existing-directory', 'existing-directory', true),\n // Optimize locating and loading nested package.json for a file\n new KnownDescriptionFilePlugin(cache, 'undescribed-raw-file', 'raw-file')\n );\n\n return resolveOptions;\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.0",
3
+ "version": "0.3.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",