@rushstack/package-extractor 0.11.15 → 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 +50 -0
  2. package/CHANGELOG.md +13 -1
  3. package/dist/scripts/create-links.js +45945 -61866
  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,280 +0,0 @@
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
@@ -1 +0,0 @@
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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