@rushstack/package-extractor 0.11.16 → 0.12.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 +49 -0
- package/CHANGELOG.md +15 -1
- package/dist/scripts/create-links.js +1277 -17204
- package/dist/scripts/create-links.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-esm/ArchiveManager.js +57 -0
- package/lib-esm/ArchiveManager.js.map +1 -0
- package/lib-esm/AssetHandler.js +164 -0
- package/lib-esm/AssetHandler.js.map +1 -0
- package/lib-esm/PackageExtractor.js +528 -0
- package/lib-esm/PackageExtractor.js.map +1 -0
- package/lib-esm/PathConstants.js +8 -0
- package/lib-esm/PathConstants.js.map +1 -0
- package/lib-esm/SymlinkAnalyzer.js +122 -0
- package/lib-esm/SymlinkAnalyzer.js.map +1 -0
- package/lib-esm/Utils.js +76 -0
- package/lib-esm/Utils.js.map +1 -0
- package/lib-esm/index.js +4 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/scripts/createLinks/cli/CreateLinksCommandLineParser.js +31 -0
- package/lib-esm/scripts/createLinks/cli/CreateLinksCommandLineParser.js.map +1 -0
- package/lib-esm/scripts/createLinks/cli/actions/CreateLinksAction.js +84 -0
- package/lib-esm/scripts/createLinks/cli/actions/CreateLinksAction.js.map +1 -0
- package/lib-esm/scripts/createLinks/cli/actions/RemoveLinksAction.js +30 -0
- package/lib-esm/scripts/createLinks/cli/actions/RemoveLinksAction.js.map +1 -0
- package/lib-esm/scripts/createLinks/start.js +8 -0
- package/lib-esm/scripts/createLinks/start.js.map +1 -0
- package/lib-esm/scripts/createLinks/utilities/CreateLinksUtilities.js +11 -0
- package/lib-esm/scripts/createLinks/utilities/CreateLinksUtilities.js.map +1 -0
- package/lib-esm/scripts/createLinks/utilities/constants.js +38 -0
- package/lib-esm/scripts/createLinks/utilities/constants.js.map +1 -0
- package/package.json +33 -11
- /package/{lib → lib-commonjs}/ArchiveManager.js +0 -0
- /package/{lib → lib-commonjs}/ArchiveManager.js.map +0 -0
- /package/{lib → lib-commonjs}/AssetHandler.js +0 -0
- /package/{lib → lib-commonjs}/AssetHandler.js.map +0 -0
- /package/{lib → lib-commonjs}/PackageExtractor.js +0 -0
- /package/{lib → lib-commonjs}/PackageExtractor.js.map +0 -0
- /package/{lib → lib-commonjs}/PathConstants.js +0 -0
- /package/{lib → lib-commonjs}/PathConstants.js.map +0 -0
- /package/{lib → lib-commonjs}/SymlinkAnalyzer.js +0 -0
- /package/{lib → lib-commonjs}/SymlinkAnalyzer.js.map +0 -0
- /package/{lib → lib-commonjs}/Utils.js +0 -0
- /package/{lib → lib-commonjs}/Utils.js.map +0 -0
- /package/{lib → lib-commonjs}/index.js +0 -0
- /package/{lib → lib-commonjs}/index.js.map +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/cli/CreateLinksCommandLineParser.js +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/cli/CreateLinksCommandLineParser.js.map +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/cli/actions/CreateLinksAction.js +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/cli/actions/CreateLinksAction.js.map +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/cli/actions/RemoveLinksAction.js +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/cli/actions/RemoveLinksAction.js.map +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/start.js +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/start.js.map +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/utilities/CreateLinksUtilities.js +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/utilities/CreateLinksUtilities.js.map +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/utilities/constants.js +0 -0
- /package/{lib → lib-commonjs}/scripts/createLinks/utilities/constants.js.map +0 -0
- /package/{lib → lib-dts}/ArchiveManager.d.ts +0 -0
- /package/{lib → lib-dts}/ArchiveManager.d.ts.map +0 -0
- /package/{lib → lib-dts}/AssetHandler.d.ts +0 -0
- /package/{lib → lib-dts}/AssetHandler.d.ts.map +0 -0
- /package/{lib → lib-dts}/PackageExtractor.d.ts +0 -0
- /package/{lib → lib-dts}/PackageExtractor.d.ts.map +0 -0
- /package/{lib → lib-dts}/PathConstants.d.ts +0 -0
- /package/{lib → lib-dts}/PathConstants.d.ts.map +0 -0
- /package/{lib → lib-dts}/SymlinkAnalyzer.d.ts +0 -0
- /package/{lib → lib-dts}/SymlinkAnalyzer.d.ts.map +0 -0
- /package/{lib → lib-dts}/Utils.d.ts +0 -0
- /package/{lib → lib-dts}/Utils.d.ts.map +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts.map +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/cli/CreateLinksCommandLineParser.d.ts +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/cli/CreateLinksCommandLineParser.d.ts.map +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/cli/actions/CreateLinksAction.d.ts +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/cli/actions/CreateLinksAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/cli/actions/RemoveLinksAction.d.ts +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/cli/actions/RemoveLinksAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/start.d.ts +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/start.d.ts.map +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/utilities/CreateLinksUtilities.d.ts +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/utilities/CreateLinksUtilities.d.ts.map +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/utilities/constants.d.ts +0 -0
- /package/{lib → lib-dts}/scripts/createLinks/utilities/constants.d.ts.map +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import { FileSystem } from '@rushstack/node-core-library';
|
|
4
|
+
import { EXTRACTOR_METADATA_FILENAME } from '../../../PathConstants';
|
|
5
|
+
export async function getExtractorMetadataAsync() {
|
|
6
|
+
const extractorMetadataPath = `${__dirname}/${EXTRACTOR_METADATA_FILENAME}`;
|
|
7
|
+
const extractorMetadataJson = await FileSystem.readFileAsync(extractorMetadataPath);
|
|
8
|
+
const extractorMetadataObject = JSON.parse(extractorMetadataJson);
|
|
9
|
+
return extractorMetadataObject;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=CreateLinksUtilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateLinksUtilities.js","sourceRoot":"","sources":["../../../../src/scripts/createLinks/utilities/CreateLinksUtilities.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE,MAAM,CAAC,KAAK,UAAU,yBAAyB;IAC7C,MAAM,qBAAqB,GAAW,GAAG,SAAS,IAAI,2BAA2B,EAAE,CAAC;IACpF,MAAM,qBAAqB,GAAW,MAAM,UAAU,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC5F,MAAM,uBAAuB,GAA2B,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC1F,OAAO,uBAAuB,CAAC;AACjC,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 { FileSystem } from '@rushstack/node-core-library';\n\nimport type { IExtractorMetadataJson } from '../../../PackageExtractor';\nimport { EXTRACTOR_METADATA_FILENAME } from '../../../PathConstants';\n\nexport async function getExtractorMetadataAsync(): Promise<IExtractorMetadataJson> {\n const extractorMetadataPath: string = `${__dirname}/${EXTRACTOR_METADATA_FILENAME}`;\n const extractorMetadataJson: string = await FileSystem.readFileAsync(extractorMetadataPath);\n const extractorMetadataObject: IExtractorMetadataJson = JSON.parse(extractorMetadataJson);\n return extractorMetadataObject;\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
var _a, _b;
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
/**
|
|
7
|
+
* The maximum number of concurrent operations to perform.
|
|
8
|
+
*/
|
|
9
|
+
export const MAX_CONCURRENCY = ((_b = (_a = os.availableParallelism) === null || _a === void 0 ? void 0 : _a.call(os)) !== null && _b !== void 0 ? _b : os.cpus().length) * 2;
|
|
10
|
+
/**
|
|
11
|
+
* The name of the action to create symlinks.
|
|
12
|
+
*/
|
|
13
|
+
export const CREATE_ACTION_NAME = 'create';
|
|
14
|
+
/**
|
|
15
|
+
* The name of the action to remove symlinks.
|
|
16
|
+
*/
|
|
17
|
+
export const REMOVE_ACTION_NAME = 'remove';
|
|
18
|
+
/**
|
|
19
|
+
* The name of the parameter to realize files when creating symlinks.
|
|
20
|
+
*/
|
|
21
|
+
export const REALIZE_FILES_PARAMETER_NAME = '--realize-files';
|
|
22
|
+
/**
|
|
23
|
+
* The name of the parameter to link bins when creating symlinks.
|
|
24
|
+
*/
|
|
25
|
+
export const LINK_BINS_PARAMETER_NAME = '--link-bins';
|
|
26
|
+
/**
|
|
27
|
+
* The name of the parameter to link packages when creating symlinks. The actual value of this
|
|
28
|
+
* export is modified after bundling the script to ensure that the extracted version of the script
|
|
29
|
+
* contains the relative path from the extraction target folder to the script. Generally, this
|
|
30
|
+
* value should not be used directly, but rather the `TARGET_ROOT_FOLDER` export should be used
|
|
31
|
+
* instead.
|
|
32
|
+
*/
|
|
33
|
+
export const TARGET_ROOT_SCRIPT_RELATIVE_PATH = '{TARGET_ROOT_SCRIPT_RELATIVE_PATH}';
|
|
34
|
+
/**
|
|
35
|
+
* The path to the root folder where symlinks are created.
|
|
36
|
+
*/
|
|
37
|
+
export const TARGET_ROOT_FOLDER = path.resolve(__dirname, TARGET_ROOT_SCRIPT_RELATIVE_PATH);
|
|
38
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/scripts/createLinks/utilities/constants.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;;AAE3D,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAW,CAAC,MAAA,MAAA,EAAE,CAAC,oBAAoB,kDAAI,mCAAI,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAE7F;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAa,QAAQ,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAa,QAAQ,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAsB,iBAAiB,CAAC;AAEjF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkB,aAAa,CAAC;AAErE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAC3C,oCAAoC,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,gCAAgC,CAAC,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 os from 'node:os';\nimport path from 'node:path';\n\nimport type { TARGET_ROOT_SCRIPT_RELATIVE_PATH_TEMPLATE_STRING as TargetRootScriptRelativePathTemplateString } from '../../../PackageExtractor';\n\n/**\n * The maximum number of concurrent operations to perform.\n */\nexport const MAX_CONCURRENCY: number = (os.availableParallelism?.() ?? os.cpus().length) * 2;\n\n/**\n * The name of the action to create symlinks.\n */\nexport const CREATE_ACTION_NAME: 'create' = 'create';\n\n/**\n * The name of the action to remove symlinks.\n */\nexport const REMOVE_ACTION_NAME: 'remove' = 'remove';\n\n/**\n * The name of the parameter to realize files when creating symlinks.\n */\nexport const REALIZE_FILES_PARAMETER_NAME: '--realize-files' = '--realize-files';\n\n/**\n * The name of the parameter to link bins when creating symlinks.\n */\nexport const LINK_BINS_PARAMETER_NAME: '--link-bins' = '--link-bins';\n\n/**\n * The name of the parameter to link packages when creating symlinks. The actual value of this\n * export is modified after bundling the script to ensure that the extracted version of the script\n * contains the relative path from the extraction target folder to the script. Generally, this\n * value should not be used directly, but rather the `TARGET_ROOT_FOLDER` export should be used\n * instead.\n */\nexport const TARGET_ROOT_SCRIPT_RELATIVE_PATH: typeof TargetRootScriptRelativePathTemplateString =\n '{TARGET_ROOT_SCRIPT_RELATIVE_PATH}';\n\n/**\n * The path to the root folder where symlinks are created.\n */\nexport const TARGET_ROOT_FOLDER: string = path.resolve(__dirname, TARGET_ROOT_SCRIPT_RELATIVE_PATH);\n"]}
|
package/package.json
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/package-extractor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "A library for bundling selected files and dependencies into a deployable package.",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"
|
|
5
|
+
"main": "./lib-commonjs/index.js",
|
|
6
|
+
"module": "./lib-esm/index.js",
|
|
7
|
+
"types": "./dist/package-extractor.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/package-extractor.d.ts",
|
|
11
|
+
"import": "./lib-esm/index.js",
|
|
12
|
+
"require": "./lib-commonjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./lib/*": {
|
|
15
|
+
"types": "./lib-dts/*.d.ts",
|
|
16
|
+
"import": "./lib-esm/*.js",
|
|
17
|
+
"require": "./lib-commonjs/*.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"typesVersions": {
|
|
22
|
+
"*": {
|
|
23
|
+
"lib/*": [
|
|
24
|
+
"lib-dts/*"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
7
28
|
"repository": {
|
|
8
29
|
"type": "git",
|
|
9
30
|
"url": "https://github.com/microsoft/rushstack.git",
|
|
@@ -17,21 +38,22 @@
|
|
|
17
38
|
"minimatch": "10.1.2",
|
|
18
39
|
"npm-packlist": "~5.1.3",
|
|
19
40
|
"semver": "~7.5.4",
|
|
20
|
-
"@rushstack/node-core-library": "5.
|
|
21
|
-
"@rushstack/terminal": "0.
|
|
22
|
-
"@rushstack/ts-command-line": "5.
|
|
41
|
+
"@rushstack/node-core-library": "5.20.0",
|
|
42
|
+
"@rushstack/terminal": "0.22.0",
|
|
43
|
+
"@rushstack/ts-command-line": "5.3.0"
|
|
23
44
|
},
|
|
24
45
|
"devDependencies": {
|
|
25
46
|
"@types/glob": "7.1.1",
|
|
26
47
|
"@types/npm-packlist": "~1.1.1",
|
|
27
48
|
"eslint": "~9.37.0",
|
|
28
|
-
"webpack": "~5.105.
|
|
49
|
+
"webpack": "~5.105.2",
|
|
29
50
|
"@types/semver": "7.5.0",
|
|
30
|
-
"
|
|
31
|
-
"@rushstack/heft-webpack5-plugin": "1.
|
|
32
|
-
"@rushstack/webpack-preserve-dynamic-require-plugin": "0.
|
|
33
|
-
"
|
|
51
|
+
"@rushstack/heft": "1.2.0",
|
|
52
|
+
"@rushstack/heft-webpack5-plugin": "1.3.0",
|
|
53
|
+
"@rushstack/webpack-preserve-dynamic-require-plugin": "0.12.1",
|
|
54
|
+
"local-node-rig": "1.0.0"
|
|
34
55
|
},
|
|
56
|
+
"sideEffects": false,
|
|
35
57
|
"scripts": {
|
|
36
58
|
"build": "heft build --clean",
|
|
37
59
|
"test": "heft test --clean",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|