@rushstack/package-extractor 0.11.16 → 0.12.0

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.
Files changed (58) hide show
  1. package/CHANGELOG.json +32 -0
  2. package/CHANGELOG.md +8 -1
  3. package/dist/scripts/create-links.js +1277 -17204
  4. package/dist/scripts/create-links.js.map +1 -1
  5. package/dist/tsdoc-metadata.json +1 -1
  6. package/package.json +32 -10
  7. package/lib/ArchiveManager.d.ts +0 -13
  8. package/lib/ArchiveManager.d.ts.map +0 -1
  9. package/lib/ArchiveManager.js +0 -64
  10. package/lib/ArchiveManager.js.map +0 -1
  11. package/lib/AssetHandler.d.ts +0 -52
  12. package/lib/AssetHandler.d.ts.map +0 -1
  13. package/lib/AssetHandler.js +0 -171
  14. package/lib/AssetHandler.js.map +0 -1
  15. package/lib/PackageExtractor.d.ts +0 -280
  16. package/lib/PackageExtractor.d.ts.map +0 -1
  17. package/lib/PackageExtractor.js +0 -568
  18. package/lib/PackageExtractor.js.map +0 -1
  19. package/lib/PathConstants.d.ts +0 -4
  20. package/lib/PathConstants.d.ts.map +0 -1
  21. package/lib/PathConstants.js +0 -11
  22. package/lib/PathConstants.js.map +0 -1
  23. package/lib/SymlinkAnalyzer.d.ts +0 -73
  24. package/lib/SymlinkAnalyzer.d.ts.map +0 -1
  25. package/lib/SymlinkAnalyzer.js +0 -159
  26. package/lib/SymlinkAnalyzer.js.map +0 -1
  27. package/lib/Utils.d.ts +0 -30
  28. package/lib/Utils.d.ts.map +0 -1
  29. package/lib/Utils.js +0 -85
  30. package/lib/Utils.js.map +0 -1
  31. package/lib/index.d.ts +0 -3
  32. package/lib/index.d.ts.map +0 -1
  33. package/lib/index.js +0 -8
  34. package/lib/index.js.map +0 -1
  35. package/lib/scripts/createLinks/cli/CreateLinksCommandLineParser.d.ts +0 -8
  36. package/lib/scripts/createLinks/cli/CreateLinksCommandLineParser.d.ts.map +0 -1
  37. package/lib/scripts/createLinks/cli/CreateLinksCommandLineParser.js +0 -35
  38. package/lib/scripts/createLinks/cli/CreateLinksCommandLineParser.js.map +0 -1
  39. package/lib/scripts/createLinks/cli/actions/CreateLinksAction.d.ts +0 -10
  40. package/lib/scripts/createLinks/cli/actions/CreateLinksAction.d.ts.map +0 -1
  41. package/lib/scripts/createLinks/cli/actions/CreateLinksAction.js +0 -91
  42. package/lib/scripts/createLinks/cli/actions/CreateLinksAction.js.map +0 -1
  43. package/lib/scripts/createLinks/cli/actions/RemoveLinksAction.d.ts +0 -10
  44. package/lib/scripts/createLinks/cli/actions/RemoveLinksAction.d.ts.map +0 -1
  45. package/lib/scripts/createLinks/cli/actions/RemoveLinksAction.js +0 -38
  46. package/lib/scripts/createLinks/cli/actions/RemoveLinksAction.js.map +0 -1
  47. package/lib/scripts/createLinks/start.d.ts +0 -2
  48. package/lib/scripts/createLinks/start.d.ts.map +0 -1
  49. package/lib/scripts/createLinks/start.js +0 -10
  50. package/lib/scripts/createLinks/start.js.map +0 -1
  51. package/lib/scripts/createLinks/utilities/CreateLinksUtilities.d.ts +0 -3
  52. package/lib/scripts/createLinks/utilities/CreateLinksUtilities.d.ts.map +0 -1
  53. package/lib/scripts/createLinks/utilities/CreateLinksUtilities.js +0 -14
  54. package/lib/scripts/createLinks/utilities/CreateLinksUtilities.js.map +0 -1
  55. package/lib/scripts/createLinks/utilities/constants.d.ts +0 -34
  56. package/lib/scripts/createLinks/utilities/constants.d.ts.map +0 -1
  57. package/lib/scripts/createLinks/utilities/constants.js +0 -44
  58. package/lib/scripts/createLinks/utilities/constants.js.map +0 -1
@@ -1,35 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
- // See LICENSE in the project root for license information.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.CreateLinksCommandLineParser = void 0;
6
- const ts_command_line_1 = require("@rushstack/ts-command-line");
7
- const node_core_library_1 = require("@rushstack/node-core-library");
8
- const CreateLinksAction_1 = require("./actions/CreateLinksAction");
9
- const RemoveLinksAction_1 = require("./actions/RemoveLinksAction");
10
- class CreateLinksCommandLineParser extends ts_command_line_1.CommandLineParser {
11
- constructor(terminal) {
12
- super({
13
- toolFilename: 'create-links',
14
- toolDescription: 'Create or remove symlinks for the extracted packages'
15
- });
16
- this._terminal = terminal;
17
- this.addAction(new CreateLinksAction_1.CreateLinksAction(this._terminal));
18
- this.addAction(new RemoveLinksAction_1.RemoveLinksAction(this._terminal));
19
- }
20
- async onExecuteAsync() {
21
- process.exitCode = 1;
22
- try {
23
- await super.onExecuteAsync();
24
- process.exitCode = 0;
25
- }
26
- catch (error) {
27
- if (!(error instanceof node_core_library_1.AlreadyReportedError)) {
28
- this._terminal.writeErrorLine();
29
- this._terminal.writeErrorLine('ERROR: ' + error.message.trim());
30
- }
31
- }
32
- }
33
- }
34
- exports.CreateLinksCommandLineParser = CreateLinksCommandLineParser;
35
- //# sourceMappingURL=CreateLinksCommandLineParser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateLinksCommandLineParser.js","sourceRoot":"","sources":["../../../../src/scripts/createLinks/cli/CreateLinksCommandLineParser.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,gEAA+D;AAC/D,oEAAoE;AAGpE,mEAAgE;AAChE,mEAAgE;AAEhE,MAAa,4BAA6B,SAAQ,mCAAiB;IAGjE,YAAmB,QAAmB;QACpC,KAAK,CAAC;YACJ,YAAY,EAAE,cAAc;YAC5B,eAAe,EAAE,sDAAsD;SACxE,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,SAAS,CAAC,IAAI,qCAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,CAAC,IAAI,qCAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IACxD,CAAC;IAEkB,KAAK,CAAC,cAAc;QACrC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QAErB,IAAI,CAAC;YACH,MAAM,KAAK,CAAC,cAAc,EAAE,CAAC;YAC7B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,KAAK,YAAY,wCAAoB,CAAC,EAAE,CAAC;gBAC7C,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;gBAChC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA5BD,oEA4BC","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 { CommandLineParser } from '@rushstack/ts-command-line';\nimport { AlreadyReportedError } from '@rushstack/node-core-library';\nimport type { ITerminal } from '@rushstack/terminal';\n\nimport { CreateLinksAction } from './actions/CreateLinksAction';\nimport { RemoveLinksAction } from './actions/RemoveLinksAction';\n\nexport class CreateLinksCommandLineParser extends CommandLineParser {\n private readonly _terminal: ITerminal;\n\n public constructor(terminal: ITerminal) {\n super({\n toolFilename: 'create-links',\n toolDescription: 'Create or remove symlinks for the extracted packages'\n });\n\n this._terminal = terminal;\n\n this.addAction(new CreateLinksAction(this._terminal));\n this.addAction(new RemoveLinksAction(this._terminal));\n }\n\n protected override async onExecuteAsync(): Promise<void> {\n process.exitCode = 1;\n\n try {\n await super.onExecuteAsync();\n process.exitCode = 0;\n } catch (error) {\n if (!(error instanceof AlreadyReportedError)) {\n this._terminal.writeErrorLine();\n this._terminal.writeErrorLine('ERROR: ' + error.message.trim());\n }\n }\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- import type { ITerminal } from '@rushstack/terminal';
2
- import { CommandLineAction } from '@rushstack/ts-command-line';
3
- export declare class CreateLinksAction extends CommandLineAction {
4
- private _terminal;
5
- private _realizeFilesParameter;
6
- private _linkBinsParameter;
7
- constructor(terminal: ITerminal);
8
- protected onExecuteAsync(): Promise<void>;
9
- }
10
- //# sourceMappingURL=CreateLinksAction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateLinksAction.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/createLinks/cli/actions/CreateLinksAction.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAiC,MAAM,4BAA4B,CAAC;AAsE9F,qBAAa,iBAAkB,SAAQ,iBAAiB;IACtD,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,sBAAsB,CAA2B;IACzD,OAAO,CAAC,kBAAkB,CAA2B;gBAElC,QAAQ,EAAE,SAAS;cAoBb,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAsBzD"}
@@ -1,91 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
- // See LICENSE in the project root for license information.
4
- var __importDefault = (this && this.__importDefault) || function (mod) {
5
- return (mod && mod.__esModule) ? mod : { "default": mod };
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.CreateLinksAction = void 0;
9
- const node_path_1 = __importDefault(require("node:path"));
10
- const node_core_library_1 = require("@rushstack/node-core-library");
11
- const ts_command_line_1 = require("@rushstack/ts-command-line");
12
- const Utils_1 = require("../../../../Utils");
13
- const CreateLinksUtilities_1 = require("../../utilities/CreateLinksUtilities");
14
- const constants_1 = require("../../utilities/constants");
15
- const RemoveLinksAction_1 = require("./RemoveLinksAction");
16
- async function createLinksAsync(terminal, targetRootFolder, extractorMetadataObject) {
17
- await node_core_library_1.Async.forEachAsync(extractorMetadataObject.links, async (linkInfo) => {
18
- // Link to the relative path for symlinks
19
- const newLinkPath = node_path_1.default.join(targetRootFolder, linkInfo.linkPath);
20
- const linkTargetPath = node_path_1.default.join(targetRootFolder, linkInfo.targetPath);
21
- // Make sure the containing folder exists
22
- await node_core_library_1.FileSystem.ensureFolderAsync(node_path_1.default.dirname(newLinkPath));
23
- // NOTE: This logic is based on NpmLinkManager._createSymlink()
24
- if (linkInfo.kind === 'folderLink') {
25
- terminal.writeVerboseLine(`Creating linked folder at path "${newLinkPath}"`);
26
- await node_core_library_1.FileSystem.createSymbolicLinkJunctionAsync({ newLinkPath, linkTargetPath });
27
- }
28
- else if (linkInfo.kind === 'fileLink') {
29
- // Use hardlinks for Windows and symlinks for other platforms since creating a symbolic link
30
- // requires administrator permission on Windows. This may cause unexpected behaviour for consumers
31
- // of the hardlinked files. If this becomes an issue, we may need to revisit this.
32
- terminal.writeVerboseLine(`Creating linked file at path "${newLinkPath}"`);
33
- if (process.platform === 'win32') {
34
- await node_core_library_1.FileSystem.createHardLinkAsync({ newLinkPath, linkTargetPath });
35
- }
36
- else {
37
- await node_core_library_1.FileSystem.createSymbolicLinkFileAsync({ newLinkPath, linkTargetPath });
38
- }
39
- }
40
- }, { concurrency: constants_1.MAX_CONCURRENCY });
41
- }
42
- async function realizeFilesAsync(terminal, targetRootFolder, extractorMetadataObject) {
43
- await node_core_library_1.Async.forEachAsync(extractorMetadataObject.files, async (relativeFilePath) => {
44
- const filePath = `${targetRootFolder}/${relativeFilePath}`;
45
- const realFilePath = await node_core_library_1.FileSystem.getRealPathAsync(filePath);
46
- if (!node_core_library_1.Path.isEqual(realFilePath, filePath)) {
47
- // Delete the existing symlink and create a hardlink to the real file, since creating hardlinks
48
- // is less overhead than copying the file.
49
- terminal.writeVerboseLine(`Realizing file at path "${filePath}"`);
50
- await node_core_library_1.FileSystem.deleteFileAsync(filePath);
51
- await node_core_library_1.FileSystem.createHardLinkAsync({ newLinkPath: filePath, linkTargetPath: realFilePath });
52
- }
53
- }, { concurrency: constants_1.MAX_CONCURRENCY });
54
- }
55
- class CreateLinksAction extends ts_command_line_1.CommandLineAction {
56
- constructor(terminal) {
57
- super({
58
- actionName: 'create',
59
- summary: 'Create symlinks for extraction',
60
- documentation: 'This action creates symlinks for the extraction process.'
61
- });
62
- this._terminal = terminal;
63
- this._realizeFilesParameter = this.defineFlagParameter({
64
- parameterLongName: constants_1.REALIZE_FILES_PARAMETER_NAME,
65
- description: 'Realize files instead of creating symlinks'
66
- });
67
- this._linkBinsParameter = this.defineFlagParameter({
68
- parameterLongName: constants_1.LINK_BINS_PARAMETER_NAME,
69
- description: 'Create the .bin files for extracted packages'
70
- });
71
- }
72
- async onExecuteAsync() {
73
- const extractorMetadataObject = await (0, CreateLinksUtilities_1.getExtractorMetadataAsync)();
74
- const realizeFiles = this._realizeFilesParameter.value;
75
- const linkBins = this._linkBinsParameter.value;
76
- this._terminal.writeLine(`Creating links for extraction at path "${constants_1.TARGET_ROOT_FOLDER}"`);
77
- await (0, RemoveLinksAction_1.removeLinksAsync)(this._terminal, constants_1.TARGET_ROOT_FOLDER, extractorMetadataObject);
78
- await createLinksAsync(this._terminal, constants_1.TARGET_ROOT_FOLDER, extractorMetadataObject);
79
- if (realizeFiles) {
80
- this._terminal.writeLine(`Realizing files for extraction at path "${constants_1.TARGET_ROOT_FOLDER}"`);
81
- await realizeFilesAsync(this._terminal, constants_1.TARGET_ROOT_FOLDER, extractorMetadataObject);
82
- }
83
- if (linkBins) {
84
- this._terminal.writeLine(`Linking bins for extraction at path "${constants_1.TARGET_ROOT_FOLDER}"`);
85
- const extractedProjectFolderPaths = extractorMetadataObject.projects.map((project) => node_path_1.default.join(constants_1.TARGET_ROOT_FOLDER, project.path));
86
- await (0, Utils_1.makeBinLinksAsync)(this._terminal, extractedProjectFolderPaths);
87
- }
88
- }
89
- }
90
- exports.CreateLinksAction = CreateLinksAction;
91
- //# sourceMappingURL=CreateLinksAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateLinksAction.js","sourceRoot":"","sources":["../../../../../src/scripts/createLinks/cli/actions/CreateLinksAction.ts"],"names":[],"mappings":";AAAA,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. 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 { Async, FileSystem, Path } from '@rushstack/node-core-library';\nimport type { ITerminal } from '@rushstack/terminal';\nimport { CommandLineAction, type CommandLineFlagParameter } from '@rushstack/ts-command-line';\n\nimport type { IExtractorMetadataJson, IProjectInfoJson } from '../../../../PackageExtractor';\nimport { makeBinLinksAsync } from '../../../../Utils';\nimport { getExtractorMetadataAsync } from '../../utilities/CreateLinksUtilities';\nimport {\n TARGET_ROOT_FOLDER,\n REALIZE_FILES_PARAMETER_NAME,\n LINK_BINS_PARAMETER_NAME,\n MAX_CONCURRENCY\n} from '../../utilities/constants';\nimport { removeLinksAsync } from './RemoveLinksAction';\n\nasync function createLinksAsync(\n terminal: ITerminal,\n targetRootFolder: string,\n extractorMetadataObject: IExtractorMetadataJson\n): Promise<void> {\n await Async.forEachAsync(\n extractorMetadataObject.links,\n async (linkInfo) => {\n // Link to the relative path for symlinks\n const newLinkPath: string = path.join(targetRootFolder, linkInfo.linkPath);\n const linkTargetPath: string = path.join(targetRootFolder, linkInfo.targetPath);\n\n // Make sure the containing folder exists\n await FileSystem.ensureFolderAsync(path.dirname(newLinkPath));\n\n // NOTE: This logic is based on NpmLinkManager._createSymlink()\n if (linkInfo.kind === 'folderLink') {\n terminal.writeVerboseLine(`Creating linked folder at path \"${newLinkPath}\"`);\n await FileSystem.createSymbolicLinkJunctionAsync({ newLinkPath, linkTargetPath });\n } else if (linkInfo.kind === 'fileLink') {\n // Use hardlinks for Windows and symlinks for other platforms since creating a symbolic link\n // requires administrator permission on Windows. This may cause unexpected behaviour for consumers\n // of the hardlinked files. If this becomes an issue, we may need to revisit this.\n terminal.writeVerboseLine(`Creating linked file at path \"${newLinkPath}\"`);\n if (process.platform === 'win32') {\n await FileSystem.createHardLinkAsync({ newLinkPath, linkTargetPath });\n } else {\n await FileSystem.createSymbolicLinkFileAsync({ newLinkPath, linkTargetPath });\n }\n }\n },\n { concurrency: MAX_CONCURRENCY }\n );\n}\n\nasync function realizeFilesAsync(\n terminal: ITerminal,\n targetRootFolder: string,\n extractorMetadataObject: IExtractorMetadataJson\n): Promise<void> {\n await Async.forEachAsync(\n extractorMetadataObject.files,\n async (relativeFilePath) => {\n const filePath: string = `${targetRootFolder}/${relativeFilePath}`;\n const realFilePath: string = await FileSystem.getRealPathAsync(filePath);\n if (!Path.isEqual(realFilePath, filePath)) {\n // Delete the existing symlink and create a hardlink to the real file, since creating hardlinks\n // is less overhead than copying the file.\n terminal.writeVerboseLine(`Realizing file at path \"${filePath}\"`);\n await FileSystem.deleteFileAsync(filePath);\n await FileSystem.createHardLinkAsync({ newLinkPath: filePath, linkTargetPath: realFilePath });\n }\n },\n { concurrency: MAX_CONCURRENCY }\n );\n}\n\nexport class CreateLinksAction extends CommandLineAction {\n private _terminal: ITerminal;\n private _realizeFilesParameter: CommandLineFlagParameter;\n private _linkBinsParameter: CommandLineFlagParameter;\n\n public constructor(terminal: ITerminal) {\n super({\n actionName: 'create',\n summary: 'Create symlinks for extraction',\n documentation: 'This action creates symlinks for the extraction process.'\n });\n\n this._terminal = terminal;\n\n this._realizeFilesParameter = this.defineFlagParameter({\n parameterLongName: REALIZE_FILES_PARAMETER_NAME,\n description: 'Realize files instead of creating symlinks'\n });\n\n this._linkBinsParameter = this.defineFlagParameter({\n parameterLongName: LINK_BINS_PARAMETER_NAME,\n description: 'Create the .bin files for extracted packages'\n });\n }\n\n protected override async onExecuteAsync(): Promise<void> {\n const extractorMetadataObject: IExtractorMetadataJson = await getExtractorMetadataAsync();\n const realizeFiles: boolean = this._realizeFilesParameter.value;\n const linkBins: boolean = this._linkBinsParameter.value;\n\n this._terminal.writeLine(`Creating links for extraction at path \"${TARGET_ROOT_FOLDER}\"`);\n await removeLinksAsync(this._terminal, TARGET_ROOT_FOLDER, extractorMetadataObject);\n await createLinksAsync(this._terminal, TARGET_ROOT_FOLDER, extractorMetadataObject);\n\n if (realizeFiles) {\n this._terminal.writeLine(`Realizing files for extraction at path \"${TARGET_ROOT_FOLDER}\"`);\n await realizeFilesAsync(this._terminal, TARGET_ROOT_FOLDER, extractorMetadataObject);\n }\n\n if (linkBins) {\n this._terminal.writeLine(`Linking bins for extraction at path \"${TARGET_ROOT_FOLDER}\"`);\n const extractedProjectFolderPaths: string[] = extractorMetadataObject.projects.map(\n (project: IProjectInfoJson) => path.join(TARGET_ROOT_FOLDER, project.path)\n );\n await makeBinLinksAsync(this._terminal, extractedProjectFolderPaths);\n }\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- import type { ITerminal } from '@rushstack/terminal';
2
- import { CommandLineAction } from '@rushstack/ts-command-line';
3
- import type { IExtractorMetadataJson } from '../../../../PackageExtractor';
4
- export declare function removeLinksAsync(terminal: ITerminal, targetRootFolder: string, extractorMetadataObject: IExtractorMetadataJson): Promise<void>;
5
- export declare class RemoveLinksAction extends CommandLineAction {
6
- private _terminal;
7
- constructor(terminal: ITerminal);
8
- protected onExecuteAsync(): Promise<void>;
9
- }
10
- //# sourceMappingURL=RemoveLinksAction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoveLinksAction.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/createLinks/cli/actions/RemoveLinksAction.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAI3E,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,SAAS,EACnB,gBAAgB,EAAE,MAAM,EACxB,uBAAuB,EAAE,sBAAsB,GAC9C,OAAO,CAAC,IAAI,CAAC,CAUf;AAED,qBAAa,iBAAkB,SAAQ,iBAAiB;IACtD,OAAO,CAAC,SAAS,CAAY;gBAEV,QAAQ,EAAE,SAAS;cAUb,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAMzD"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
- // See LICENSE in the project root for license information.
4
- var __importDefault = (this && this.__importDefault) || function (mod) {
5
- return (mod && mod.__esModule) ? mod : { "default": mod };
6
- };
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.RemoveLinksAction = void 0;
9
- exports.removeLinksAsync = removeLinksAsync;
10
- const node_path_1 = __importDefault(require("node:path"));
11
- const node_core_library_1 = require("@rushstack/node-core-library");
12
- const ts_command_line_1 = require("@rushstack/ts-command-line");
13
- const CreateLinksUtilities_1 = require("../../utilities/CreateLinksUtilities");
14
- const constants_1 = require("../../utilities/constants");
15
- async function removeLinksAsync(terminal, targetRootFolder, extractorMetadataObject) {
16
- await node_core_library_1.Async.forEachAsync(extractorMetadataObject.links, async ({ linkPath }) => {
17
- const newLinkPath = node_path_1.default.join(targetRootFolder, linkPath);
18
- terminal.writeVerboseLine(`Removing link at path "${newLinkPath}"`);
19
- await node_core_library_1.FileSystem.deleteFileAsync(newLinkPath, { throwIfNotExists: false });
20
- }, { concurrency: constants_1.MAX_CONCURRENCY });
21
- }
22
- class RemoveLinksAction extends ts_command_line_1.CommandLineAction {
23
- constructor(terminal) {
24
- super({
25
- actionName: 'remove',
26
- summary: 'Remove symlinks created by the "create" action',
27
- documentation: 'This action removes the symlinks created by the "create" action.'
28
- });
29
- this._terminal = terminal;
30
- }
31
- async onExecuteAsync() {
32
- const extractorMetadataObject = await (0, CreateLinksUtilities_1.getExtractorMetadataAsync)();
33
- this._terminal.writeLine(`Removing links for extraction at path "${constants_1.TARGET_ROOT_FOLDER}"`);
34
- await removeLinksAsync(this._terminal, constants_1.TARGET_ROOT_FOLDER, extractorMetadataObject);
35
- }
36
- }
37
- exports.RemoveLinksAction = RemoveLinksAction;
38
- //# sourceMappingURL=RemoveLinksAction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoveLinksAction.js","sourceRoot":"","sources":["../../../../../src/scripts/createLinks/cli/actions/RemoveLinksAction.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;AAY3D,4CAcC;AAxBD,0DAA6B;AAE7B,oEAAiE;AAEjE,gEAA+D;AAG/D,+EAAiF;AACjF,yDAAgF;AAEzE,KAAK,UAAU,gBAAgB,CACpC,QAAmB,EACnB,gBAAwB,EACxB,uBAA+C;IAE/C,MAAM,yBAAK,CAAC,YAAY,CACtB,uBAAuB,CAAC,KAAK,EAC7B,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QACrB,MAAM,WAAW,GAAW,mBAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;QAClE,QAAQ,CAAC,gBAAgB,CAAC,0BAA0B,WAAW,GAAG,CAAC,CAAC;QACpE,MAAM,8BAAU,CAAC,eAAe,CAAC,WAAW,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7E,CAAC,EACD,EAAE,WAAW,EAAE,2BAAe,EAAE,CACjC,CAAC;AACJ,CAAC;AAED,MAAa,iBAAkB,SAAQ,mCAAiB;IAGtD,YAAmB,QAAmB;QACpC,KAAK,CAAC;YACJ,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,gDAAgD;YACzD,aAAa,EAAE,kEAAkE;SAClF,CAAC,CAAC;QAEH,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEkB,KAAK,CAAC,cAAc;QACrC,MAAM,uBAAuB,GAA2B,MAAM,IAAA,gDAAyB,GAAE,CAAC;QAE1F,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,0CAA0C,8BAAkB,GAAG,CAAC,CAAC;QAC1F,MAAM,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,8BAAkB,EAAE,uBAAuB,CAAC,CAAC;IACtF,CAAC;CACF;AAnBD,8CAmBC","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 { Async, FileSystem } from '@rushstack/node-core-library';\nimport type { ITerminal } from '@rushstack/terminal';\nimport { CommandLineAction } from '@rushstack/ts-command-line';\n\nimport type { IExtractorMetadataJson } from '../../../../PackageExtractor';\nimport { getExtractorMetadataAsync } from '../../utilities/CreateLinksUtilities';\nimport { TARGET_ROOT_FOLDER, MAX_CONCURRENCY } from '../../utilities/constants';\n\nexport async function removeLinksAsync(\n terminal: ITerminal,\n targetRootFolder: string,\n extractorMetadataObject: IExtractorMetadataJson\n): Promise<void> {\n await Async.forEachAsync(\n extractorMetadataObject.links,\n async ({ linkPath }) => {\n const newLinkPath: string = path.join(targetRootFolder, linkPath);\n terminal.writeVerboseLine(`Removing link at path \"${newLinkPath}\"`);\n await FileSystem.deleteFileAsync(newLinkPath, { throwIfNotExists: false });\n },\n { concurrency: MAX_CONCURRENCY }\n );\n}\n\nexport class RemoveLinksAction extends CommandLineAction {\n private _terminal: ITerminal;\n\n public constructor(terminal: ITerminal) {\n super({\n actionName: 'remove',\n summary: 'Remove symlinks created by the \"create\" action',\n documentation: 'This action removes the symlinks created by the \"create\" action.'\n });\n\n this._terminal = terminal;\n }\n\n protected override async onExecuteAsync(): Promise<void> {\n const extractorMetadataObject: IExtractorMetadataJson = await getExtractorMetadataAsync();\n\n this._terminal.writeLine(`Removing links for extraction at path \"${TARGET_ROOT_FOLDER}\"`);\n await removeLinksAsync(this._terminal, TARGET_ROOT_FOLDER, extractorMetadataObject);\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=start.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/scripts/createLinks/start.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
- // See LICENSE in the project root for license information.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- const terminal_1 = require("@rushstack/terminal");
6
- const CreateLinksCommandLineParser_1 = require("./cli/CreateLinksCommandLineParser");
7
- const terminal = new terminal_1.Terminal(new terminal_1.ConsoleTerminalProvider({ verboseEnabled: true }));
8
- const parser = new CreateLinksCommandLineParser_1.CreateLinksCommandLineParser(terminal);
9
- parser.executeAsync().catch(terminal.writeErrorLine);
10
- //# sourceMappingURL=start.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/scripts/createLinks/start.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAE3D,kDAAwE;AAExE,qFAAkF;AAElF,MAAM,QAAQ,GAAa,IAAI,mBAAQ,CAAC,IAAI,kCAAuB,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAE/F,MAAM,MAAM,GAAiC,IAAI,2DAA4B,CAAC,QAAQ,CAAC,CAAC;AACxF,MAAM,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,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 { Terminal, ConsoleTerminalProvider } from '@rushstack/terminal';\n\nimport { CreateLinksCommandLineParser } from './cli/CreateLinksCommandLineParser';\n\nconst terminal: Terminal = new Terminal(new ConsoleTerminalProvider({ verboseEnabled: true }));\n\nconst parser: CreateLinksCommandLineParser = new CreateLinksCommandLineParser(terminal);\nparser.executeAsync().catch(terminal.writeErrorLine);\n"]}
@@ -1,3 +0,0 @@
1
- import type { IExtractorMetadataJson } from '../../../PackageExtractor';
2
- export declare function getExtractorMetadataAsync(): Promise<IExtractorMetadataJson>;
3
- //# sourceMappingURL=CreateLinksUtilities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateLinksUtilities.d.ts","sourceRoot":"","sources":["../../../../src/scripts/createLinks/utilities/CreateLinksUtilities.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAGxE,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAKjF"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
- // See LICENSE in the project root for license information.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getExtractorMetadataAsync = getExtractorMetadataAsync;
6
- const node_core_library_1 = require("@rushstack/node-core-library");
7
- const PathConstants_1 = require("../../../PathConstants");
8
- async function getExtractorMetadataAsync() {
9
- const extractorMetadataPath = `${__dirname}/${PathConstants_1.EXTRACTOR_METADATA_FILENAME}`;
10
- const extractorMetadataJson = await node_core_library_1.FileSystem.readFileAsync(extractorMetadataPath);
11
- const extractorMetadataObject = JSON.parse(extractorMetadataJson);
12
- return extractorMetadataObject;
13
- }
14
- //# sourceMappingURL=CreateLinksUtilities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CreateLinksUtilities.js","sourceRoot":"","sources":["../../../../src/scripts/createLinks/utilities/CreateLinksUtilities.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAO3D,8DAKC;AAVD,oEAA0D;AAG1D,0DAAqE;AAE9D,KAAK,UAAU,yBAAyB;IAC7C,MAAM,qBAAqB,GAAW,GAAG,SAAS,IAAI,2CAA2B,EAAE,CAAC;IACpF,MAAM,qBAAqB,GAAW,MAAM,8BAAU,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"]}
@@ -1,34 +0,0 @@
1
- import type { TARGET_ROOT_SCRIPT_RELATIVE_PATH_TEMPLATE_STRING as TargetRootScriptRelativePathTemplateString } from '../../../PackageExtractor';
2
- /**
3
- * The maximum number of concurrent operations to perform.
4
- */
5
- export declare const MAX_CONCURRENCY: number;
6
- /**
7
- * The name of the action to create symlinks.
8
- */
9
- export declare const CREATE_ACTION_NAME: 'create';
10
- /**
11
- * The name of the action to remove symlinks.
12
- */
13
- export declare const REMOVE_ACTION_NAME: 'remove';
14
- /**
15
- * The name of the parameter to realize files when creating symlinks.
16
- */
17
- export declare const REALIZE_FILES_PARAMETER_NAME: '--realize-files';
18
- /**
19
- * The name of the parameter to link bins when creating symlinks.
20
- */
21
- export declare const LINK_BINS_PARAMETER_NAME: '--link-bins';
22
- /**
23
- * The name of the parameter to link packages when creating symlinks. The actual value of this
24
- * export is modified after bundling the script to ensure that the extracted version of the script
25
- * contains the relative path from the extraction target folder to the script. Generally, this
26
- * value should not be used directly, but rather the `TARGET_ROOT_FOLDER` export should be used
27
- * instead.
28
- */
29
- export declare const TARGET_ROOT_SCRIPT_RELATIVE_PATH: typeof TargetRootScriptRelativePathTemplateString;
30
- /**
31
- * The path to the root folder where symlinks are created.
32
- */
33
- export declare const TARGET_ROOT_FOLDER: string;
34
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/scripts/createLinks/utilities/constants.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gDAAgD,IAAI,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AAEhJ;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAA8D,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAmB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,QAAmB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,iBAAqC,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,aAA6B,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,EAAE,OAAO,0CAChB,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAkE,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
3
- // See LICENSE in the project root for license information.
4
- var __importDefault = (this && this.__importDefault) || function (mod) {
5
- return (mod && mod.__esModule) ? mod : { "default": mod };
6
- };
7
- var _a, _b;
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.TARGET_ROOT_FOLDER = exports.TARGET_ROOT_SCRIPT_RELATIVE_PATH = exports.LINK_BINS_PARAMETER_NAME = exports.REALIZE_FILES_PARAMETER_NAME = exports.REMOVE_ACTION_NAME = exports.CREATE_ACTION_NAME = exports.MAX_CONCURRENCY = void 0;
10
- const node_os_1 = __importDefault(require("node:os"));
11
- const node_path_1 = __importDefault(require("node:path"));
12
- /**
13
- * The maximum number of concurrent operations to perform.
14
- */
15
- exports.MAX_CONCURRENCY = ((_b = (_a = node_os_1.default.availableParallelism) === null || _a === void 0 ? void 0 : _a.call(node_os_1.default)) !== null && _b !== void 0 ? _b : node_os_1.default.cpus().length) * 2;
16
- /**
17
- * The name of the action to create symlinks.
18
- */
19
- exports.CREATE_ACTION_NAME = 'create';
20
- /**
21
- * The name of the action to remove symlinks.
22
- */
23
- exports.REMOVE_ACTION_NAME = 'remove';
24
- /**
25
- * The name of the parameter to realize files when creating symlinks.
26
- */
27
- exports.REALIZE_FILES_PARAMETER_NAME = '--realize-files';
28
- /**
29
- * The name of the parameter to link bins when creating symlinks.
30
- */
31
- exports.LINK_BINS_PARAMETER_NAME = '--link-bins';
32
- /**
33
- * The name of the parameter to link packages when creating symlinks. The actual value of this
34
- * export is modified after bundling the script to ensure that the extracted version of the script
35
- * contains the relative path from the extraction target folder to the script. Generally, this
36
- * value should not be used directly, but rather the `TARGET_ROOT_FOLDER` export should be used
37
- * instead.
38
- */
39
- exports.TARGET_ROOT_SCRIPT_RELATIVE_PATH = '{TARGET_ROOT_SCRIPT_RELATIVE_PATH}';
40
- /**
41
- * The path to the root folder where symlinks are created.
42
- */
43
- exports.TARGET_ROOT_FOLDER = node_path_1.default.resolve(__dirname, exports.TARGET_ROOT_SCRIPT_RELATIVE_PATH);
44
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/scripts/createLinks/utilities/constants.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;AAE3D,sDAAyB;AACzB,0DAA6B;AAI7B;;GAEG;AACU,QAAA,eAAe,GAAW,CAAC,MAAA,MAAA,iBAAE,CAAC,oBAAoB,iEAAI,mCAAI,iBAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAE7F;;GAEG;AACU,QAAA,kBAAkB,GAAa,QAAQ,CAAC;AAErD;;GAEG;AACU,QAAA,kBAAkB,GAAa,QAAQ,CAAC;AAErD;;GAEG;AACU,QAAA,4BAA4B,GAAsB,iBAAiB,CAAC;AAEjF;;GAEG;AACU,QAAA,wBAAwB,GAAkB,aAAa,CAAC;AAErE;;;;;;GAMG;AACU,QAAA,gCAAgC,GAC3C,oCAAoC,CAAC;AAEvC;;GAEG;AACU,QAAA,kBAAkB,GAAW,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wCAAgC,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"]}