@rushstack/module-minifier 0.6.19 → 0.6.21

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,36 @@
1
1
  {
2
2
  "name": "@rushstack/module-minifier",
3
3
  "entries": [
4
+ {
5
+ "version": "0.6.21",
6
+ "tag": "@rushstack/module-minifier_v0.6.21",
7
+ "date": "Tue, 10 Sep 2024 20:08:11 GMT",
8
+ "comments": {
9
+ "dependency": [
10
+ {
11
+ "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.66`"
12
+ },
13
+ {
14
+ "comment": "Updating dependency \"@rushstack/heft\" to `0.67.1`"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "version": "0.6.20",
21
+ "tag": "@rushstack/module-minifier_v0.6.20",
22
+ "date": "Wed, 21 Aug 2024 05:43:04 GMT",
23
+ "comments": {
24
+ "dependency": [
25
+ {
26
+ "comment": "Updating dependency \"@rushstack/worker-pool\" to `0.4.65`"
27
+ },
28
+ {
29
+ "comment": "Updating dependency \"@rushstack/heft\" to `0.67.0`"
30
+ }
31
+ ]
32
+ }
33
+ },
4
34
  {
5
35
  "version": "0.6.19",
6
36
  "tag": "@rushstack/module-minifier_v0.6.19",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Change Log - @rushstack/module-minifier
2
2
 
3
- This log was last generated on Mon, 12 Aug 2024 22:16:04 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 10 Sep 2024 20:08:11 GMT and should not be manually modified.
4
+
5
+ ## 0.6.21
6
+ Tue, 10 Sep 2024 20:08:11 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 0.6.20
11
+ Wed, 21 Aug 2024 05:43:04 GMT
12
+
13
+ _Version update only_
4
14
 
5
15
  ## 0.6.19
6
16
  Mon, 12 Aug 2024 22:16:04 GMT
@@ -8,9 +8,9 @@
8
8
 
9
9
  /// <reference types="node" />
10
10
 
11
- import type { MessagePort as MessagePort_2 } from 'worker_threads';
12
11
  import { MinifyOptions } from 'terser';
13
12
  import type { RawSourceMap } from 'source-map';
13
+ import type * as WorkerThreads from 'worker_threads';
14
14
 
15
15
  /**
16
16
  * Gets a base54 string suitable for use as a JavaScript identifier, omitting those that are valid ECMAScript keywords
@@ -211,9 +211,9 @@ export declare class LocalMinifier implements IModuleMinifier {
211
211
  * @public
212
212
  */
213
213
  export declare class MessagePortMinifier implements IModuleMinifier {
214
- readonly port: MessagePort_2;
214
+ readonly port: WorkerThreads.MessagePort;
215
215
  private readonly _callbacks;
216
- constructor(port: MessagePort_2);
216
+ constructor(port: WorkerThreads.MessagePort);
217
217
  /**
218
218
  * No-op code transform.
219
219
  * @param request - The request to process
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.5"
8
+ "packageVersion": "7.47.7"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,14 +1,14 @@
1
1
  /// <reference types="node" />
2
- import type { MessagePort } from 'worker_threads';
2
+ import type * as WorkerThreads from 'worker_threads';
3
3
  import type { IMinifierConnection, IModuleMinificationCallback, IModuleMinificationRequest, IModuleMinifier } from './types';
4
4
  /**
5
5
  * Minifier implementation that outsources requests to the other side of a MessagePort
6
6
  * @public
7
7
  */
8
8
  export declare class MessagePortMinifier implements IModuleMinifier {
9
- readonly port: MessagePort;
9
+ readonly port: WorkerThreads.MessagePort;
10
10
  private readonly _callbacks;
11
- constructor(port: MessagePort);
11
+ constructor(port: WorkerThreads.MessagePort);
12
12
  /**
13
13
  * No-op code transform.
14
14
  * @param request - The request to process
@@ -1 +1 @@
1
- {"version":3,"file":"MessagePortMinifier.d.ts","sourceRoot":"","sources":["../src/MessagePortMinifier.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,KAAK,EACV,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAE1B,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,SAAgB,IAAI,EAAE,WAAW,CAAC;IAElC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6C;gBAErD,IAAI,EAAE,WAAW;IAKpC;;;;OAIG;IACI,MAAM,CAAC,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAAE,2BAA2B,GAAG,IAAI;IAc/F;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,mBAAmB,CAAC;IA6BzD;;OAEG;IAEU,OAAO,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAGrD"}
1
+ {"version":3,"file":"MessagePortMinifier.d.ts","sourceRoot":"","sources":["../src/MessagePortMinifier.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,KAAK,aAAa,MAAM,gBAAgB,CAAC;AAErD,OAAO,KAAK,EACV,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAE1B,eAAe,EAChB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IACzD,SAAgB,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC;IAEhD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6C;gBAErD,IAAI,EAAE,aAAa,CAAC,WAAW;IAKlD;;;;OAIG;IACI,MAAM,CAAC,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAAE,2BAA2B,GAAG,IAAI;IAc/F;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,mBAAmB,CAAC;IA6BzD;;OAEG;IAEU,OAAO,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAGrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessagePortMinifier.js","sourceRoot":"","sources":["../src/MessagePortMinifier.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,mCAA8B;AAW9B;;;GAGG;A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,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,eAAe,GAA2C,KAAK,IAAI,EAAE;YACzE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC,CAAC;QACF,OAAO;YACL,UAAU;YACV,eAAe;YACf,UAAU,EAAE,eAAe;SAC5B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,gEAAgE;IACzD,KAAK,CAAC,OAAO;QAClB,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IACnC,CAAC;CACF;AApED,kDAoEC","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 { once } from 'events';\nimport type { MessagePort } from 'worker_threads';\n\nimport type {\n IMinifierConnection,\n IModuleMinificationCallback,\n IModuleMinificationRequest,\n IModuleMinificationResult,\n IModuleMinifier\n} from './types';\n\n/**\n * Minifier implementation that outsources requests to the other side of a MessagePort\n * @public\n */\nexport class MessagePortMinifier implements IModuleMinifier {\n public readonly port: MessagePort;\n\n private readonly _callbacks: Map<string, IModuleMinificationCallback[]>;\n\n public constructor(port: MessagePort) {\n this.port = port;\n this._callbacks = new Map();\n }\n\n /**\n * No-op code transform.\n * @param request - The request to process\n * @param callback - The callback to invoke\n */\n public minify(request: IModuleMinificationRequest, callback: IModuleMinificationCallback): void {\n const { hash } = request;\n\n const callbacks: IModuleMinificationCallback[] | undefined = this._callbacks.get(hash);\n if (callbacks) {\n callbacks.push(callback);\n return;\n }\n\n this._callbacks.set(hash, [callback]);\n\n this.port.postMessage(request);\n }\n\n /**\n * {@inheritdoc IModuleMinifier.connectAsync}\n */\n public async connectAsync(): Promise<IMinifierConnection> {\n const configHashPromise: Promise<string> = once(this.port, 'message') as unknown as Promise<string>;\n this.port.postMessage('initialize');\n const configHash: string = await configHashPromise;\n\n const callbacks: Map<string, IModuleMinificationCallback[]> = this._callbacks;\n\n function handler(message: IModuleMinificationResult | number | false): void {\n if (typeof message === 'object') {\n const callbacksForRequest: IModuleMinificationCallback[] = callbacks.get(message.hash)!;\n callbacks.delete(message.hash);\n for (const callback of callbacksForRequest) {\n callback(message);\n }\n }\n }\n\n this.port.on('message', handler);\n const disconnectAsync: IMinifierConnection['disconnectAsync'] = async () => {\n this.port.off('message', handler);\n this.port.close();\n };\n return {\n configHash,\n disconnectAsync,\n disconnect: disconnectAsync\n };\n }\n\n /**\n * @deprecated Use {@link MessagePortMinifier.connectAsync} instead\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public async connect(): Promise<IMinifierConnection> {\n return await this.connectAsync();\n }\n}\n"]}
1
+ {"version":3,"file":"MessagePortMinifier.js","sourceRoot":"","sources":["../src/MessagePortMinifier.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,mCAA8B;AAW9B;;;GAGG;AACH,MAAa,mBAAmB;IAK9B,YAAmB,IAA+B;QAChD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAmC,EAAE,QAAqC;QACtF,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QAEzB,MAAM,SAAS,GAA8C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvF,IAAI,SAAS,EAAE,CAAC;YACd,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEtC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,YAAY;QACvB,MAAM,iBAAiB,GAAoB,IAAA,aAAI,EAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAA+B,CAAC;QACpG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACpC,MAAM,UAAU,GAAW,MAAM,iBAAiB,CAAC;QAEnD,MAAM,SAAS,GAA+C,IAAI,CAAC,UAAU,CAAC;QAE9E,SAAS,OAAO,CAAC,OAAmD;YAClE,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;gBAChC,MAAM,mBAAmB,GAAkC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAE,CAAC;gBACxF,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC/B,KAAK,MAAM,QAAQ,IAAI,mBAAmB,EAAE,CAAC;oBAC3C,QAAQ,CAAC,OAAO,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACjC,MAAM,eAAe,GAA2C,KAAK,IAAI,EAAE;YACzE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC,CAAC;QACF,OAAO;YACL,UAAU;YACV,eAAe;YACf,UAAU,EAAE,eAAe;SAC5B,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,gEAAgE;IACzD,KAAK,CAAC,OAAO;QAClB,OAAO,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IACnC,CAAC;CACF;AApED,kDAoEC","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 { once } from 'events';\nimport type * as WorkerThreads from 'worker_threads';\n\nimport type {\n IMinifierConnection,\n IModuleMinificationCallback,\n IModuleMinificationRequest,\n IModuleMinificationResult,\n IModuleMinifier\n} from './types';\n\n/**\n * Minifier implementation that outsources requests to the other side of a MessagePort\n * @public\n */\nexport class MessagePortMinifier implements IModuleMinifier {\n public readonly port: WorkerThreads.MessagePort;\n\n private readonly _callbacks: Map<string, IModuleMinificationCallback[]>;\n\n public constructor(port: WorkerThreads.MessagePort) {\n this.port = port;\n this._callbacks = new Map();\n }\n\n /**\n * No-op code transform.\n * @param request - The request to process\n * @param callback - The callback to invoke\n */\n public minify(request: IModuleMinificationRequest, callback: IModuleMinificationCallback): void {\n const { hash } = request;\n\n const callbacks: IModuleMinificationCallback[] | undefined = this._callbacks.get(hash);\n if (callbacks) {\n callbacks.push(callback);\n return;\n }\n\n this._callbacks.set(hash, [callback]);\n\n this.port.postMessage(request);\n }\n\n /**\n * {@inheritdoc IModuleMinifier.connectAsync}\n */\n public async connectAsync(): Promise<IMinifierConnection> {\n const configHashPromise: Promise<string> = once(this.port, 'message') as unknown as Promise<string>;\n this.port.postMessage('initialize');\n const configHash: string = await configHashPromise;\n\n const callbacks: Map<string, IModuleMinificationCallback[]> = this._callbacks;\n\n function handler(message: IModuleMinificationResult | number | false): void {\n if (typeof message === 'object') {\n const callbacksForRequest: IModuleMinificationCallback[] = callbacks.get(message.hash)!;\n callbacks.delete(message.hash);\n for (const callback of callbacksForRequest) {\n callback(message);\n }\n }\n }\n\n this.port.on('message', handler);\n const disconnectAsync: IMinifierConnection['disconnectAsync'] = async () => {\n this.port.off('message', handler);\n this.port.close();\n };\n return {\n configHash,\n disconnectAsync,\n disconnect: disconnectAsync\n };\n }\n\n /**\n * @deprecated Use {@link MessagePortMinifier.connectAsync} instead\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public async connect(): Promise<IMinifierConnection> {\n return await this.connectAsync();\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/module-minifier",
3
- "version": "0.6.19",
3
+ "version": "0.6.21",
4
4
  "description": "Wrapper for terser to support bulk parallel minification.",
5
5
  "main": "lib/index.js",
6
6
  "typings": "dist/module-minifier.d.ts",
@@ -14,11 +14,11 @@
14
14
  "serialize-javascript": "6.0.0",
15
15
  "source-map": "~0.7.3",
16
16
  "terser": "^5.9.0",
17
- "@rushstack/worker-pool": "0.4.64"
17
+ "@rushstack/worker-pool": "0.4.66"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@types/serialize-javascript": "5.0.2",
21
- "@rushstack/heft": "0.66.26",
21
+ "@rushstack/heft": "0.67.1",
22
22
  "local-node-rig": "1.0.0"
23
23
  },
24
24
  "peerDependencies": {