@rushstack/webpack-plugin-utilities 0.5.1 → 0.5.3
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 +24 -0
- package/CHANGELOG.md +11 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/Testing.d.ts.map +1 -1
- package/lib/Testing.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/webpack-plugin-utilities",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.5.3",
|
|
6
|
+
"tag": "@rushstack/webpack-plugin-utilities_v0.5.3",
|
|
7
|
+
"date": "Fri, 24 Oct 2025 00:13:38 GMT",
|
|
8
|
+
"comments": {
|
|
9
|
+
"dependency": [
|
|
10
|
+
{
|
|
11
|
+
"comment": "Updating dependency \"@rushstack/heft\" to `1.1.3`"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "0.5.2",
|
|
18
|
+
"tag": "@rushstack/webpack-plugin-utilities_v0.5.2",
|
|
19
|
+
"date": "Wed, 22 Oct 2025 00:57:54 GMT",
|
|
20
|
+
"comments": {
|
|
21
|
+
"dependency": [
|
|
22
|
+
{
|
|
23
|
+
"comment": "Updating dependency \"@rushstack/heft\" to `1.1.2`"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
4
28
|
{
|
|
5
29
|
"version": "0.5.1",
|
|
6
30
|
"tag": "@rushstack/webpack-plugin-utilities_v0.5.1",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# Change Log - @rushstack/webpack-plugin-utilities
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 24 Oct 2025 00:13:38 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.5.3
|
|
6
|
+
Fri, 24 Oct 2025 00:13:38 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 0.5.2
|
|
11
|
+
Wed, 22 Oct 2025 00:57:54 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
4
14
|
|
|
5
15
|
## 0.5.1
|
|
6
16
|
Wed, 08 Oct 2025 00:13:29 GMT
|
package/dist/tsdoc-metadata.json
CHANGED
package/lib/Testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Testing.d.ts","sourceRoot":"","sources":["../src/Testing.ts"],"names":[],"mappings":"AAKA,OAAO,EAA8B,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Testing.d.ts","sourceRoot":"","sources":["../src/Testing.ts"],"names":[],"mappings":"AAKA,OAAO,EAA8B,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAEV,UAAU,EACV,KAAK,EACL,aAAa,EAId,MAAM,SAAS,CAAC;AAGjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,MAAM,EACb,gBAAgB,GAAE,aAAkB,EACpC,KAAK,GAAE,GAAsC,GAC5C,OAAO,CAAC,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,SAAS,CAAC,CAkC3C"}
|
package/lib/Testing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Testing.js","sourceRoot":"","sources":["../src/Testing.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Testing.js","sourceRoot":"","sources":["../src/Testing.ts"],"names":[],"m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S,qBAAqB,CAAC,QAAgB,OAAO;IACpD,OAAO;QACL,2DAA2D;QAC3D,oEAAoE;QACpE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,SAAS;QAClB,KAAK;QACL,MAAM,EAAE;YACN,QAAQ,EAAE,gBAAgB;SAC3B;KACF,CAAC;AACJ,CAAC","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 path from 'node:path';\n\nimport { createFsFromVolume, Volume, type IFs } from 'memfs';\nimport type {\n StatsCompilation as WebpackStatsCompilation,\n MultiStats,\n Stats,\n Configuration,\n Compiler,\n StatsError,\n OutputFileSystem\n} from 'webpack';\nimport webpackMerge from 'webpack-merge';\n\n/**\n * @public\n * This function generates a webpack compiler with default configuration and the output filesystem mapped to\n * a memory filesystem. This is useful for testing webpack plugins/loaders where we do not need to write to disk (which can be costly).\n * @param entry - The entry point for the webpack compiler\n * @param additionalConfig - Any additional configuration that should be merged with the default configuration\n * @param memFs - The memory filesystem to use for the output filesystem. Use this option if you want to _inspect_, analyze, or read the output\n * files generated by the webpack compiler. If you do not need to do this, you can omit this parameter and the output files.\n *\n * @returns - A webpack compiler with the output filesystem mapped to a memory filesystem\n *\n * @example\n * ```typescript\n * import Testing from '@rushstack/webpack-plugin-utilities';\n *\n * describe('MyPlugin', () => {\n * it('should run', async () => {\n * const stats = await Testing.getTestingWebpackCompiler(\n * `./src/index.ts`,\n * );\n *\n * expect(stats).toBeDefined();\n * });\n * });\n * ```\n *\n * @remarks\n * If you want to be able to read, analyze, access the files written to the memory filesystem,\n * you can pass in a memory filesystem instance to the `memFs` parameter.\n *\n * @example\n * ```typescript\n * import Testing from '@rushstack/webpack-plugin-utilities';\n * import { createFsFromVolume, Volume, IFs } from 'memfs';\n * import path from 'path';\n *\n * describe('MyPlugin', () => {\n * it('should run', async () => {\n * const virtualFileSystem: IFs = createFsFromVolume(new Volume());\n * const stats = await Testing.getTestingWebpackCompiler(\n * `./src/index.ts`,\n * {},\n * virtualFileSystem\n * );\n *\n * expect(stats).toBeDefined();\n * expect(virtualFileSystem.existsSync(path.join(__dirname, 'dist', 'index.js'))).toBe(true);\n * });\n * });\n * ```\n */\nexport async function getTestingWebpackCompilerAsync(\n entry: string,\n additionalConfig: Configuration = {},\n memFs: IFs = createFsFromVolume(new Volume())\n): Promise<(Stats | MultiStats) | undefined> {\n let webpackModule: typeof import('webpack');\n try {\n webpackModule = (await import('webpack')).default;\n } catch (e) {\n throw new Error(\n 'Unable to load module \"webpack\". The @rushstack/webpack-plugin-utilities package declares \"webpack\" as ' +\n 'an optional peer dependency, but a function was invoked on it that requires webpack. Make sure ' +\n `the peer dependency on \"webpack\" is fulfilled. Inner error: ${e}`\n );\n }\n\n const compilerOptions: Configuration = webpackMerge(_defaultWebpackConfig(entry), additionalConfig);\n const compiler: Compiler = webpackModule(compilerOptions);\n\n // The memFs Volume satisfies the interface contract, but the types aren't happy due to strict null checks\n const outputFileSystem: OutputFileSystem = memFs as unknown as OutputFileSystem;\n outputFileSystem.join = path.join.bind(path);\n\n compiler.outputFileSystem = outputFileSystem;\n\n return new Promise((resolve, reject) => {\n compiler.run((err, stats) => {\n compiler.close(() => {\n if (err) {\n return reject(err);\n }\n\n _processAndHandleStatsErrorsAndWarnings(stats, reject);\n\n resolve(stats);\n });\n });\n });\n}\n\nfunction _processAndHandleStatsErrorsAndWarnings(\n stats: Stats | MultiStats | undefined,\n reject: (reason: unknown) => void\n): void {\n if (stats?.hasErrors() || stats?.hasWarnings()) {\n const serializedStats: WebpackStatsCompilation[] = [stats?.toJson('errors-warnings')];\n\n const errors: StatsError[] = [];\n const warnings: StatsError[] = [];\n\n for (const compilationStats of serializedStats) {\n if (compilationStats.warnings) {\n for (const warning of compilationStats.warnings) {\n warnings.push(warning);\n }\n }\n\n if (compilationStats.errors) {\n for (const error of compilationStats.errors) {\n errors.push(error);\n }\n }\n\n if (compilationStats.children) {\n for (const child of compilationStats.children) {\n serializedStats.push(child);\n }\n }\n }\n\n reject([...errors, ...warnings]);\n }\n}\n\nfunction _defaultWebpackConfig(entry: string = './src'): Configuration {\n return {\n // We don't want to have eval source maps, nor minification\n // so we set mode to 'none' to disable both. Default is 'production'\n mode: 'none',\n context: __dirname,\n entry,\n output: {\n filename: 'test-bundle.js'\n }\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/webpack-plugin-utilities",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "This plugin sets the webpack public path at runtime.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "dist/webpack-plugin-utilities.d.ts",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"eslint": "~9.
|
|
30
|
+
"eslint": "~9.37.0",
|
|
31
31
|
"@types/tapable": "1.0.6",
|
|
32
32
|
"webpack": "~5.98.0",
|
|
33
|
-
"@rushstack/heft": "1.1.
|
|
33
|
+
"@rushstack/heft": "1.1.3",
|
|
34
34
|
"local-node-rig": "1.0.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|