@rushstack/package-extractor 0.12.0 → 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.
Files changed (82) hide show
  1. package/CHANGELOG.json +17 -0
  2. package/CHANGELOG.md +8 -1
  3. package/dist/tsdoc-metadata.json +1 -1
  4. package/lib-commonjs/ArchiveManager.js +64 -0
  5. package/lib-commonjs/ArchiveManager.js.map +1 -0
  6. package/lib-commonjs/AssetHandler.js +171 -0
  7. package/lib-commonjs/AssetHandler.js.map +1 -0
  8. package/lib-commonjs/PackageExtractor.js +568 -0
  9. package/lib-commonjs/PackageExtractor.js.map +1 -0
  10. package/lib-commonjs/PathConstants.js +11 -0
  11. package/lib-commonjs/PathConstants.js.map +1 -0
  12. package/lib-commonjs/SymlinkAnalyzer.js +159 -0
  13. package/lib-commonjs/SymlinkAnalyzer.js.map +1 -0
  14. package/lib-commonjs/Utils.js +85 -0
  15. package/lib-commonjs/Utils.js.map +1 -0
  16. package/lib-commonjs/index.js +8 -0
  17. package/lib-commonjs/index.js.map +1 -0
  18. package/lib-commonjs/scripts/createLinks/cli/CreateLinksCommandLineParser.js +35 -0
  19. package/lib-commonjs/scripts/createLinks/cli/CreateLinksCommandLineParser.js.map +1 -0
  20. package/lib-commonjs/scripts/createLinks/cli/actions/CreateLinksAction.js +91 -0
  21. package/lib-commonjs/scripts/createLinks/cli/actions/CreateLinksAction.js.map +1 -0
  22. package/lib-commonjs/scripts/createLinks/cli/actions/RemoveLinksAction.js +38 -0
  23. package/lib-commonjs/scripts/createLinks/cli/actions/RemoveLinksAction.js.map +1 -0
  24. package/lib-commonjs/scripts/createLinks/start.js +10 -0
  25. package/lib-commonjs/scripts/createLinks/start.js.map +1 -0
  26. package/lib-commonjs/scripts/createLinks/utilities/CreateLinksUtilities.js +14 -0
  27. package/lib-commonjs/scripts/createLinks/utilities/CreateLinksUtilities.js.map +1 -0
  28. package/lib-commonjs/scripts/createLinks/utilities/constants.js +44 -0
  29. package/lib-commonjs/scripts/createLinks/utilities/constants.js.map +1 -0
  30. package/lib-dts/ArchiveManager.d.ts +13 -0
  31. package/lib-dts/ArchiveManager.d.ts.map +1 -0
  32. package/lib-dts/AssetHandler.d.ts +52 -0
  33. package/lib-dts/AssetHandler.d.ts.map +1 -0
  34. package/lib-dts/PackageExtractor.d.ts +280 -0
  35. package/lib-dts/PackageExtractor.d.ts.map +1 -0
  36. package/lib-dts/PathConstants.d.ts +4 -0
  37. package/lib-dts/PathConstants.d.ts.map +1 -0
  38. package/lib-dts/SymlinkAnalyzer.d.ts +73 -0
  39. package/lib-dts/SymlinkAnalyzer.d.ts.map +1 -0
  40. package/lib-dts/Utils.d.ts +30 -0
  41. package/lib-dts/Utils.d.ts.map +1 -0
  42. package/lib-dts/index.d.ts +3 -0
  43. package/lib-dts/index.d.ts.map +1 -0
  44. package/lib-dts/scripts/createLinks/cli/CreateLinksCommandLineParser.d.ts +8 -0
  45. package/lib-dts/scripts/createLinks/cli/CreateLinksCommandLineParser.d.ts.map +1 -0
  46. package/lib-dts/scripts/createLinks/cli/actions/CreateLinksAction.d.ts +10 -0
  47. package/lib-dts/scripts/createLinks/cli/actions/CreateLinksAction.d.ts.map +1 -0
  48. package/lib-dts/scripts/createLinks/cli/actions/RemoveLinksAction.d.ts +10 -0
  49. package/lib-dts/scripts/createLinks/cli/actions/RemoveLinksAction.d.ts.map +1 -0
  50. package/lib-dts/scripts/createLinks/start.d.ts +2 -0
  51. package/lib-dts/scripts/createLinks/start.d.ts.map +1 -0
  52. package/lib-dts/scripts/createLinks/utilities/CreateLinksUtilities.d.ts +3 -0
  53. package/lib-dts/scripts/createLinks/utilities/CreateLinksUtilities.d.ts.map +1 -0
  54. package/lib-dts/scripts/createLinks/utilities/constants.d.ts +34 -0
  55. package/lib-dts/scripts/createLinks/utilities/constants.d.ts.map +1 -0
  56. package/lib-esm/ArchiveManager.js +57 -0
  57. package/lib-esm/ArchiveManager.js.map +1 -0
  58. package/lib-esm/AssetHandler.js +164 -0
  59. package/lib-esm/AssetHandler.js.map +1 -0
  60. package/lib-esm/PackageExtractor.js +528 -0
  61. package/lib-esm/PackageExtractor.js.map +1 -0
  62. package/lib-esm/PathConstants.js +8 -0
  63. package/lib-esm/PathConstants.js.map +1 -0
  64. package/lib-esm/SymlinkAnalyzer.js +122 -0
  65. package/lib-esm/SymlinkAnalyzer.js.map +1 -0
  66. package/lib-esm/Utils.js +76 -0
  67. package/lib-esm/Utils.js.map +1 -0
  68. package/lib-esm/index.js +4 -0
  69. package/lib-esm/index.js.map +1 -0
  70. package/lib-esm/scripts/createLinks/cli/CreateLinksCommandLineParser.js +31 -0
  71. package/lib-esm/scripts/createLinks/cli/CreateLinksCommandLineParser.js.map +1 -0
  72. package/lib-esm/scripts/createLinks/cli/actions/CreateLinksAction.js +84 -0
  73. package/lib-esm/scripts/createLinks/cli/actions/CreateLinksAction.js.map +1 -0
  74. package/lib-esm/scripts/createLinks/cli/actions/RemoveLinksAction.js +30 -0
  75. package/lib-esm/scripts/createLinks/cli/actions/RemoveLinksAction.js.map +1 -0
  76. package/lib-esm/scripts/createLinks/start.js +8 -0
  77. package/lib-esm/scripts/createLinks/start.js.map +1 -0
  78. package/lib-esm/scripts/createLinks/utilities/CreateLinksUtilities.js +11 -0
  79. package/lib-esm/scripts/createLinks/utilities/CreateLinksUtilities.js.map +1 -0
  80. package/lib-esm/scripts/createLinks/utilities/constants.js +38 -0
  81. package/lib-esm/scripts/createLinks/utilities/constants.js.map +1 -0
  82. package/package.json +5 -5
@@ -0,0 +1,38 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,10 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,44 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,13 @@
1
+ import { type FileSystemStats } from '@rushstack/node-core-library';
2
+ export interface IAddToArchiveOptions {
3
+ filePath?: string;
4
+ fileData?: Buffer | string;
5
+ archivePath: string;
6
+ stats?: FileSystemStats;
7
+ }
8
+ export declare class ArchiveManager {
9
+ private _zip;
10
+ addToArchiveAsync(options: IAddToArchiveOptions): Promise<void>;
11
+ createArchiveAsync(archiveFilePath: string): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=ArchiveManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArchiveManager.d.ts","sourceRoot":"","sources":["../src/ArchiveManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,KAAK,eAAe,EAAQ,MAAM,8BAA8B,CAAC;AAUtF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,IAAI,CAAsB;IAErB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B/D,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOxE"}
@@ -0,0 +1,52 @@
1
+ import { type FileSystemStats } from '@rushstack/node-core-library';
2
+ import type { IExtractorOptions } from './PackageExtractor';
3
+ import type { SymlinkAnalyzer } from './SymlinkAnalyzer';
4
+ export interface IIncludeAssetOptions {
5
+ sourceFilePath?: string;
6
+ sourceFileStats?: FileSystemStats;
7
+ sourceFileContent?: string | Buffer;
8
+ targetFilePath: string;
9
+ ignoreIfExisting?: boolean;
10
+ }
11
+ export interface IIncludeAssetPathOptions extends IIncludeAssetOptions {
12
+ sourceFilePath: string;
13
+ sourceFileContent?: never;
14
+ }
15
+ export interface IIncludeExistingAssetPathOptions extends IIncludeAssetOptions {
16
+ sourceFilePath?: never;
17
+ sourceFileContent?: never;
18
+ }
19
+ export interface IIncludeAssetContentOptions extends IIncludeAssetOptions {
20
+ sourceFileContent: string | Buffer;
21
+ sourceFilePath?: never;
22
+ sourceFileStats?: never;
23
+ }
24
+ export interface IAssetHandlerOptions extends IExtractorOptions {
25
+ symlinkAnalyzer: SymlinkAnalyzer;
26
+ }
27
+ export interface IFinalizeOptions {
28
+ onAfterExtractSymlinksAsync: () => Promise<void>;
29
+ }
30
+ export declare class AssetHandler {
31
+ private readonly _terminal;
32
+ private readonly _sourceRootFolder;
33
+ private readonly _targetRootFolder;
34
+ private readonly _createArchiveOnly;
35
+ private readonly _symlinkAnalyzer;
36
+ private readonly _archiveManager;
37
+ private readonly _archiveFilePath;
38
+ private readonly _linkCreationMode;
39
+ private readonly _includedAssetPaths;
40
+ private _isFinalized;
41
+ constructor(options: IAssetHandlerOptions);
42
+ includeAssetAsync(options: IIncludeAssetPathOptions): Promise<void>;
43
+ includeAssetAsync(options: IIncludeExistingAssetPathOptions): Promise<void>;
44
+ includeAssetAsync(options: IIncludeAssetContentOptions): Promise<void>;
45
+ get assetPaths(): string[];
46
+ finalizeAsync(options?: IFinalizeOptions): Promise<void>;
47
+ /**
48
+ * Create a symlink as described by the ILinkInfo object.
49
+ */
50
+ private _extractSymlinkAsync;
51
+ }
52
+ //# sourceMappingURL=AssetHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AssetHandler.d.ts","sourceRoot":"","sources":["../src/AssetHandler.ts"],"names":[],"mappings":"AAMA,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAI7F,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,oBAAoB,CAAC;AA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B,CAAmB;IACrD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAkC;IACtE,OAAO,CAAC,YAAY,CAAkB;gBAEnB,OAAO,EAAE,oBAAoB;IA4BnC,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IACnE,iBAAiB,CAAC,OAAO,EAAE,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3E,iBAAiB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IAgEnF,IAAW,UAAU,IAAI,MAAM,EAAE,CAEhC;IAEY,aAAa,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBrE;;OAEG;YACW,oBAAoB;CAiDnC"}
@@ -0,0 +1,280 @@
1
+ import { type IPackageJson } from '@rushstack/node-core-library';
2
+ import { type ITerminal } from '@rushstack/terminal';
3
+ import { type ILinkInfo } from './SymlinkAnalyzer';
4
+ declare module 'npm-packlist' {
5
+ class Walker {
6
+ readonly result: string[];
7
+ constructor(opts: {
8
+ path: string;
9
+ });
10
+ on(event: 'done', callback: (result: string[]) => void): Walker;
11
+ on(event: 'error', callback: (error: Error) => void): Walker;
12
+ start(): void;
13
+ }
14
+ }
15
+ export declare const TARGET_ROOT_SCRIPT_RELATIVE_PATH_TEMPLATE_STRING: '{TARGET_ROOT_SCRIPT_RELATIVE_PATH}';
16
+ /**
17
+ * Part of the extractor-matadata.json file format. Represents an extracted project.
18
+ *
19
+ * @public
20
+ */
21
+ export interface IProjectInfoJson {
22
+ /**
23
+ * The name of the project as specified in its package.json file.
24
+ */
25
+ projectName: string;
26
+ /**
27
+ * This path is relative to the root of the extractor output folder
28
+ */
29
+ path: string;
30
+ }
31
+ /**
32
+ * The extractor-metadata.json file format.
33
+ *
34
+ * @public
35
+ */
36
+ export interface IExtractorMetadataJson {
37
+ /**
38
+ * The name of the main project the extraction was performed for.
39
+ */
40
+ mainProjectName: string;
41
+ /**
42
+ * A list of all projects that were extracted.
43
+ */
44
+ projects: IProjectInfoJson[];
45
+ /**
46
+ * A list of all links that are part of the extracted project.
47
+ */
48
+ links: ILinkInfo[];
49
+ /**
50
+ * A list of all files that are part of the extracted project.
51
+ */
52
+ files: string[];
53
+ }
54
+ /**
55
+ * The extractor subspace configurations
56
+ *
57
+ * @public
58
+ */
59
+ export interface IExtractorSubspace {
60
+ /**
61
+ * The subspace name
62
+ */
63
+ subspaceName: string;
64
+ /**
65
+ * The folder where the PNPM "node_modules" folder is located. This is used to resolve packages linked
66
+ * to the PNPM virtual store.
67
+ */
68
+ pnpmInstallFolder?: string;
69
+ /**
70
+ * The pnpmfile configuration if using PNPM, otherwise undefined. The configuration will be used to
71
+ * transform the package.json prior to extraction.
72
+ */
73
+ transformPackageJson?: (packageJson: IPackageJson) => IPackageJson;
74
+ }
75
+ /**
76
+ * The extractor configuration for individual projects.
77
+ *
78
+ * @public
79
+ */
80
+ export interface IExtractorProjectConfiguration {
81
+ /**
82
+ * The name of the project.
83
+ */
84
+ projectName: string;
85
+ /**
86
+ * The absolute path to the project.
87
+ */
88
+ projectFolder: string;
89
+ /**
90
+ * A list of glob patterns to include when extracting this project. If a path is
91
+ * matched by both "patternsToInclude" and "patternsToExclude", the path will be
92
+ * excluded. If undefined, all paths will be included.
93
+ */
94
+ patternsToInclude?: string[];
95
+ /**
96
+ * A list of glob patterns to exclude when extracting this project. If a path is
97
+ * matched by both "patternsToInclude" and "patternsToExclude", the path will be
98
+ * excluded. If undefined, no paths will be excluded.
99
+ */
100
+ patternsToExclude?: string[];
101
+ /**
102
+ * The names of additional projects to include when extracting this project.
103
+ */
104
+ additionalProjectsToInclude?: string[];
105
+ /**
106
+ * The names of additional dependencies to include when extracting this project.
107
+ */
108
+ additionalDependenciesToInclude?: string[];
109
+ /**
110
+ * The names of additional dependencies to exclude when extracting this project.
111
+ */
112
+ dependenciesToExclude?: string[];
113
+ }
114
+ /**
115
+ * The extractor configuration for individual dependencies.
116
+ *
117
+ * @public
118
+ */
119
+ export interface IExtractorDependencyConfiguration {
120
+ /**
121
+ * The name of dependency
122
+ */
123
+ dependencyName: string;
124
+ /**
125
+ * The semver version range of dependency
126
+ */
127
+ dependencyVersionRange: string;
128
+ /**
129
+ * A list of glob patterns to exclude when extracting this dependency. If a path is
130
+ * matched by both "patternsToInclude" and "patternsToExclude", the path will be
131
+ * excluded. If undefined, no paths will be excluded.
132
+ */
133
+ patternsToExclude?: string[];
134
+ /**
135
+ * A list of glob patterns to include when extracting this dependency. If a path is
136
+ * matched by both "patternsToInclude" and "patternsToExclude", the path will be
137
+ * excluded. If undefined, all paths will be included.
138
+ */
139
+ patternsToInclude?: string[];
140
+ }
141
+ /**
142
+ * The mode to use for link creation.
143
+ *
144
+ * @public
145
+ */
146
+ export type LinkCreationMode = 'default' | 'script' | 'none';
147
+ /**
148
+ * Options that can be provided to the extractor.
149
+ *
150
+ * @public
151
+ */
152
+ export interface IExtractorOptions {
153
+ /**
154
+ * A terminal to log extraction progress.
155
+ */
156
+ terminal: ITerminal;
157
+ /**
158
+ * The main project to include in the extraction operation.
159
+ */
160
+ mainProjectName: string;
161
+ /**
162
+ * The source folder that copying originates from. Generally it is the repo root folder.
163
+ */
164
+ sourceRootFolder: string;
165
+ /**
166
+ * The target folder for the extraction.
167
+ */
168
+ targetRootFolder: string;
169
+ /**
170
+ * Whether to overwrite the target folder if it already exists.
171
+ */
172
+ overwriteExisting: boolean;
173
+ /**
174
+ * The desired path to be used when archiving the target folder. Supported file extensions: .zip.
175
+ */
176
+ createArchiveFilePath?: string;
177
+ /**
178
+ * Whether to skip copying files to the extraction target directory, and only create an extraction
179
+ * archive. This is only supported when {@link IExtractorOptions.linkCreation} is 'script' or 'none'.
180
+ */
181
+ createArchiveOnly?: boolean;
182
+ /**
183
+ * The pnpmfile configuration if using PNPM, otherwise `undefined`. The configuration will be used to
184
+ * transform the package.json prior to extraction.
185
+ *
186
+ * @remarks
187
+ * When Rush subspaces are enabled, this setting applies to `default` subspace only. To configure
188
+ * each subspace, use the {@link IExtractorOptions.subspaces} array instead. The two approaches
189
+ * cannot be combined.
190
+ */
191
+ transformPackageJson?: (packageJson: IPackageJson) => IPackageJson;
192
+ /**
193
+ * If dependencies from the "devDependencies" package.json field should be included in the extraction.
194
+ */
195
+ includeDevDependencies?: boolean;
196
+ /**
197
+ * If files ignored by the .npmignore file should be included in the extraction.
198
+ */
199
+ includeNpmIgnoreFiles?: boolean;
200
+ /**
201
+ * The folder where the PNPM "node_modules" folder is located. This is used to resolve packages linked
202
+ * to the PNPM virtual store.
203
+ *
204
+ * @remarks
205
+ * When Rush subspaces are enabled, this setting applies to `default` subspace only. To configure
206
+ * each subspace, use the {@link IExtractorOptions.subspaces} array instead. The two approaches
207
+ * cannot be combined.
208
+ */
209
+ pnpmInstallFolder?: string;
210
+ /**
211
+ * The link creation mode to use.
212
+ * "default": Create the links while copying the files; this is the default behavior. Use this setting
213
+ * if your file copy tool can handle links correctly.
214
+ * "script": A Node.js script called create-links.js will be written to the target folder. Use this setting
215
+ * to create links on the server machine, after the files have been uploaded.
216
+ * "none": Do nothing; some other tool may create the links later, based on the extractor-metadata.json file.
217
+ */
218
+ linkCreation?: LinkCreationMode;
219
+ /**
220
+ * The path to the generated link creation script. This is only used when {@link IExtractorOptions.linkCreation}
221
+ * is 'script'.
222
+ */
223
+ linkCreationScriptPath?: string;
224
+ /**
225
+ * An additional folder containing files which will be copied into the root of the extraction.
226
+ */
227
+ folderToCopy?: string;
228
+ /**
229
+ * Configurations for individual projects, keyed by the project path relative to the sourceRootFolder.
230
+ */
231
+ projectConfigurations: IExtractorProjectConfiguration[];
232
+ /**
233
+ * Configurations for individual dependencies.
234
+ */
235
+ dependencyConfigurations?: IExtractorDependencyConfiguration[];
236
+ /**
237
+ * When using Rush subspaces, this setting can be used to provide configuration information for each
238
+ * individual subspace.
239
+ *
240
+ * @remarks
241
+ * To avoid confusion, if this setting is used, then the {@link IExtractorOptions.transformPackageJson} and
242
+ * {@link IExtractorOptions.pnpmInstallFolder} settings must not be used.
243
+ */
244
+ subspaces?: IExtractorSubspace[];
245
+ }
246
+ /**
247
+ * Manages the business logic for the "rush deploy" command.
248
+ *
249
+ * @public
250
+ */
251
+ export declare class PackageExtractor {
252
+ /**
253
+ * Get a list of files that would be included in a package created from the provided package root path.
254
+ *
255
+ * @beta
256
+ */
257
+ static getPackageIncludedFilesAsync(packageRootPath: string): Promise<string[]>;
258
+ /**
259
+ * Extract a package using the provided options
260
+ */
261
+ extractAsync(options: IExtractorOptions): Promise<void>;
262
+ private static _normalizeOptions;
263
+ private _performExtractionAsync;
264
+ /**
265
+ * Recursively crawl the node_modules dependencies and collect the result in IExtractorState.foldersToCopy.
266
+ */
267
+ private _collectFoldersAsync;
268
+ private _applyDependencyFilters;
269
+ /**
270
+ * Copy one package folder to the extractor target folder.
271
+ */
272
+ private _extractFolderAsync;
273
+ /**
274
+ * Write the common/deploy/deploy-metadata.json file.
275
+ */
276
+ private _writeExtractorMetadataAsync;
277
+ private _makeBinLinksAsync;
278
+ private _writeCreateLinksScriptAsync;
279
+ }
280
+ //# sourceMappingURL=PackageExtractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageExtractor.d.ts","sourceRoot":"","sources":["../src/PackageExtractor.ts"],"names":[],"mappings":"AAUA,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAmB,KAAK,SAAS,EAAiB,MAAM,mBAAmB,CAAC;AAgBnF,OAAO,QAAQ,cAAc,CAAC;IAC5B,MAAa,MAAM;QACjB,SAAgB,MAAM,EAAE,MAAM,EAAE,CAAC;oBACd,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE;QAClC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,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OAOG;IACH,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAClC;AAED;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B;;;;OAIG;WACiB,4BAA4B,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAe5F;;OAEG;IACU,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAwEpE,OAAO,CAAC,MAAM,CAAC,iBAAiB;YA8BlB,uBAAuB;IAiErC;;OAEG;YACW,oBAAoB;IAkJlC,OAAO,CAAC,uBAAuB;IAwC/B;;OAEG;YACW,mBAAmB;IAyLjC;;OAEG;YACW,4BAA4B;YAoD5B,kBAAkB;YAsBlB,4BAA4B;CAuB3C"}
@@ -0,0 +1,4 @@
1
+ export declare const CREATE_LINKS_SCRIPT_FILENAME: 'create-links.js';
2
+ export declare const EXTRACTOR_METADATA_FILENAME: 'extractor-metadata.json';
3
+ export declare const SCRIPTS_FOLDER_PATH: string;
4
+ //# sourceMappingURL=PathConstants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PathConstants.d.ts","sourceRoot":"","sources":["../src/PathConstants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B,EAAE,iBAAqC,CAAC;AAEjF,eAAO,MAAM,2BAA2B,EAAE,yBAAqD,CAAC;AAGhG,eAAO,MAAM,mBAAmB,EAAE,MAAyD,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { type FileSystemStats } from '@rushstack/node-core-library';
2
+ export interface IPathNodeBase {
3
+ kind: 'file' | 'folder' | 'link';
4
+ nodePath: string;
5
+ linkStats: FileSystemStats;
6
+ }
7
+ /**
8
+ * Represents a file object analyzed by {@link SymlinkAnalyzer}.
9
+ */
10
+ export interface IFileNode extends IPathNodeBase {
11
+ kind: 'file';
12
+ }
13
+ /**
14
+ * Represents a folder object analyzed by {@link SymlinkAnalyzer}.
15
+ */
16
+ export interface IFolderNode extends IPathNodeBase {
17
+ kind: 'folder';
18
+ }
19
+ /**
20
+ * Represents a symbolic link analyzed by {@link SymlinkAnalyzer}.
21
+ */
22
+ export interface ILinkNode extends IPathNodeBase {
23
+ kind: 'link';
24
+ /**
25
+ * The immediate target that the symlink resolves to.
26
+ */
27
+ linkTarget: string;
28
+ }
29
+ export type PathNode = IFileNode | IFolderNode | ILinkNode;
30
+ /**
31
+ * Represents a symbolic link.
32
+ *
33
+ * @public
34
+ */
35
+ export interface ILinkInfo {
36
+ /**
37
+ * The type of link that was encountered.
38
+ */
39
+ kind: 'fileLink' | 'folderLink';
40
+ /**
41
+ * The path to the link, relative to the root of the extractor output folder.
42
+ */
43
+ linkPath: string;
44
+ /**
45
+ * The target that the link points to.
46
+ */
47
+ targetPath: string;
48
+ }
49
+ export interface ISymlinkAnalyzerOptions {
50
+ requiredSourceParentPath?: string;
51
+ }
52
+ export interface IAnalyzePathOptions {
53
+ inputPath: string;
54
+ preserveLinks?: boolean;
55
+ shouldIgnoreExternalLink?: (path: string) => boolean;
56
+ }
57
+ export declare class SymlinkAnalyzer {
58
+ private readonly _requiredSourceParentPath;
59
+ private readonly _nodesByPath;
60
+ private readonly _linkInfosByPath;
61
+ constructor(options?: ISymlinkAnalyzerOptions);
62
+ analyzePathAsync(options: IAnalyzePathOptions & {
63
+ shouldIgnoreExternalLink: (path: string) => boolean;
64
+ }): Promise<PathNode | undefined>;
65
+ analyzePathAsync(options: IAnalyzePathOptions & {
66
+ shouldIgnoreExternalLink?: never;
67
+ }): Promise<PathNode>;
68
+ /**
69
+ * Returns a summary of all the symbolic links encountered by {@link SymlinkAnalyzer.analyzePathAsync}.
70
+ */
71
+ reportSymlinks(): ILinkInfo[];
72
+ }
73
+ //# sourceMappingURL=SymlinkAnalyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SymlinkAnalyzer.d.ts","sourceRoot":"","sources":["../src/SymlinkAnalyzer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,KAAK,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AC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAA;KAAE,GACrF,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IACnB,gBAAgB,CAC3B,OAAO,EAAE,mBAAmB,GAAG;QAAE,wBAAwB,CAAC,EAAE,KAAK,CAAA;KAAE,GAClE,OAAO,CAAC,QAAQ,CAAC;IAoHpB;;OAEG;IACI,cAAc,IAAI,SAAS,EAAE;CAKrC"}
@@ -0,0 +1,30 @@
1
+ import { type ITerminal } from '@rushstack/terminal';
2
+ export declare function matchesWithStar(patternWithStar: string, input: string): boolean;
3
+ export interface IRemapPathForTargetFolder {
4
+ sourcePath: string;
5
+ sourceRootFolder: string;
6
+ targetRootFolder: string;
7
+ }
8
+ /**
9
+ * Maps a file path under the provided {@link IRemapPathForTargetFolder.sourceRootFolder} to the provided
10
+ * {@link IExtractorOptions.targetRootFolder}.
11
+ *
12
+ * Example input: "C:\\MyRepo\\libraries\\my-lib"
13
+ * Example output: "C:\\MyRepo\\common\\deploy\\libraries\\my-lib"
14
+ */
15
+ export declare function remapSourcePathForTargetFolder(options: IRemapPathForTargetFolder): string;
16
+ /**
17
+ * Maps a file path under the provided folder path to the expected path format for the extractor metadata.
18
+ *
19
+ * Example input: "C:\\MyRepo\\libraries\\my-lib"
20
+ * Example output: "common/deploy/libraries/my-lib"
21
+ */
22
+ export declare function remapPathForExtractorMetadata(folderPath: string, filePath: string): string;
23
+ /**
24
+ * Creates the .bin files for the extracted projects and returns the paths to the created .bin files.
25
+ *
26
+ * @param terminal - The terminal to write to
27
+ * @param extractedProjectFolderPaths - The paths to the extracted projects
28
+ */
29
+ export declare function makeBinLinksAsync(terminal: ITerminal, extractedProjectFolderPaths: string[]): Promise<string[]>;
30
+ //# sourceMappingURL=Utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../src/Utils.ts"],"names":[],"mappings":"AAQA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAI/D,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAY/E;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,yBAAyB,GAAG,MAAM,CAQzF;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM1F;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,SAAS,EACnB,2BAA2B,EAAE,MAAM,EAAE,GACpC,OAAO,CAAC,MAAM,EAAE,CAAC,CAiCnB"}
@@ -0,0 +1,3 @@
1
+ export { PackageExtractor, type LinkCreationMode, type IExtractorOptions, type IExtractorProjectConfiguration, type IExtractorDependencyConfiguration, type IExtractorMetadataJson, type IProjectInfoJson, type IExtractorSubspace } from './PackageExtractor';
2
+ export type { ILinkInfo } from './SymlinkAnalyzer';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,iCAAiC,EACtC,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { CommandLineParser } from '@rushstack/ts-command-line';
2
+ import type { ITerminal } from '@rushstack/terminal';
3
+ export declare class CreateLinksCommandLineParser extends CommandLineParser {
4
+ private readonly _terminal;
5
+ constructor(terminal: ITerminal);
6
+ protected onExecuteAsync(): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=CreateLinksCommandLineParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateLinksCommandLineParser.d.ts","sourceRoot":"","sources":["../../../../src/scripts/createLinks/cli/CreateLinksCommandLineParser.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAKrD,qBAAa,4BAA6B,SAAQ,iBAAiB;IACjE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;gBAEnB,QAAQ,EAAE,SAAS;cAYb,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAazD"}