@atlaspack/package-manager 2.14.5-canary.22 → 2.14.5-canary.220

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 (63) hide show
  1. package/CHANGELOG.md +322 -0
  2. package/dist/JSONParseStream.js +37 -0
  3. package/dist/MockPackageInstaller.js +54 -0
  4. package/dist/NodePackageManager.js +559 -0
  5. package/dist/Npm.js +73 -0
  6. package/dist/Pnpm.js +140 -0
  7. package/dist/Yarn.js +124 -0
  8. package/dist/getCurrentPackageManager.js +17 -0
  9. package/dist/index.js +24 -0
  10. package/dist/installPackage.js +197 -0
  11. package/dist/nodejsConditions.js +39 -0
  12. package/dist/promiseFromProcess.js +16 -0
  13. package/dist/utils.js +76 -0
  14. package/dist/validateModuleSpecifier.js +11 -0
  15. package/lib/JSONParseStream.js +52 -0
  16. package/lib/MockPackageInstaller.js +79 -0
  17. package/lib/NodePackageManager.js +621 -0
  18. package/lib/Npm.js +106 -0
  19. package/lib/Pnpm.js +185 -0
  20. package/lib/Yarn.js +160 -0
  21. package/lib/getCurrentPackageManager.js +20 -0
  22. package/lib/index.js +64 -5211
  23. package/lib/installPackage.js +222 -0
  24. package/lib/nodejsConditions.js +41 -0
  25. package/lib/promiseFromProcess.js +20 -0
  26. package/lib/types/JSONParseStream.d.ts +6 -0
  27. package/lib/types/MockPackageInstaller.d.ts +14 -0
  28. package/lib/types/NodePackageManager.d.ts +37 -0
  29. package/lib/types/Npm.d.ts +4 -0
  30. package/lib/types/Pnpm.d.ts +5 -0
  31. package/lib/types/Yarn.d.ts +5 -0
  32. package/lib/types/getCurrentPackageManager.d.ts +4 -0
  33. package/lib/types/index.d.ts +10 -0
  34. package/lib/types/installPackage.d.ts +5 -0
  35. package/lib/types/nodejsConditions.d.ts +3 -0
  36. package/lib/types/promiseFromProcess.d.ts +2 -0
  37. package/lib/types/utils.d.ts +15 -0
  38. package/lib/types/validateModuleSpecifier.d.ts +1 -0
  39. package/lib/utils.js +101 -0
  40. package/lib/validateModuleSpecifier.js +14 -0
  41. package/package.json +17 -20
  42. package/src/{JSONParseStream.js → JSONParseStream.ts} +8 -7
  43. package/src/{MockPackageInstaller.js → MockPackageInstaller.ts} +4 -6
  44. package/src/{NodePackageManager.js → NodePackageManager.ts} +125 -73
  45. package/src/{Npm.js → Npm.ts} +9 -9
  46. package/src/{Pnpm.js → Pnpm.ts} +68 -50
  47. package/src/{Yarn.js → Yarn.ts} +38 -25
  48. package/src/{getCurrentPackageManager.js → getCurrentPackageManager.ts} +9 -4
  49. package/src/{index.js → index.ts} +0 -2
  50. package/src/{installPackage.js → installPackage.ts} +4 -6
  51. package/src/{nodejsConditions.js → nodejsConditions.ts} +6 -3
  52. package/src/promiseFromProcess.ts +23 -0
  53. package/src/{utils.js → utils.ts} +21 -11
  54. package/src/{validateModuleSpecifier.js → validateModuleSpecifier.ts} +0 -2
  55. package/test/{NodePackageManager.test.js → NodePackageManager.test.ts} +19 -16
  56. package/test/{getCurrentPackageManager.test.js → getCurrentPackageManager.test.ts} +0 -1
  57. package/test/{validateModuleSpecifiers.test.js → validateModuleSpecifiers.test.ts} +2 -3
  58. package/tsconfig.json +33 -0
  59. package/tsconfig.tsbuildinfo +1 -0
  60. package/index.d.ts +0 -40
  61. package/lib/index.d.ts +0 -10
  62. package/lib/index.js.map +0 -1
  63. package/src/promiseFromProcess.js +0 -19
package/CHANGELOG.md CHANGED
@@ -1,5 +1,327 @@
1
1
  # @atlaspack/package-manager
2
2
 
3
+ ## 2.14.33
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`236e546`](https://github.com/atlassian-labs/atlaspack/commit/236e5465863dca6044a7191e05260a5b924c342e)]:
8
+ - @atlaspack/utils@3.0.1
9
+ - @atlaspack/workers@2.14.33
10
+ - @atlaspack/node-resolver-core@3.7.4
11
+ - @atlaspack/fs@2.15.28
12
+ - @atlaspack/types@2.15.23
13
+ - @atlaspack/logger@2.14.25
14
+
15
+ ## 2.14.32
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`1180103`](https://github.com/atlassian-labs/atlaspack/commit/118010351ed444f8178988afb3f77807154dd933)]:
20
+ - @atlaspack/utils@3.0.0
21
+ - @atlaspack/fs@2.15.27
22
+ - @atlaspack/node-resolver-core@3.7.3
23
+ - @atlaspack/logger@2.14.24
24
+ - @atlaspack/workers@2.14.32
25
+ - @atlaspack/types@2.15.22
26
+
27
+ ## 2.14.31
28
+
29
+ ### Patch Changes
30
+
31
+ - [#785](https://github.com/atlassian-labs/atlaspack/pull/785) [`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922) Thanks [@matt-koko](https://github.com/matt-koko)! - We need to re-publish every package in Atlaspack with the corrected types field.
32
+
33
+ - Updated dependencies [[`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922)]:
34
+ - @atlaspack/build-cache@2.13.6
35
+ - @atlaspack/diagnostic@2.14.4
36
+ - @atlaspack/fs@2.15.26
37
+ - @atlaspack/logger@2.14.23
38
+ - @atlaspack/types@2.15.21
39
+ - @atlaspack/utils@2.19.3
40
+ - @atlaspack/workers@2.14.31
41
+ - @atlaspack/node-resolver-core@3.7.2
42
+
43
+ ## 2.14.30
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies []:
48
+ - @atlaspack/fs@2.15.25
49
+ - @atlaspack/utils@2.19.2
50
+ - @atlaspack/node-resolver-core@3.7.1
51
+ - @atlaspack/logger@2.14.22
52
+ - @atlaspack/types@2.15.20
53
+ - @atlaspack/workers@2.14.30
54
+
55
+ ## 2.14.29
56
+
57
+ ### Patch Changes
58
+
59
+ - [#764](https://github.com/atlassian-labs/atlaspack/pull/764) [`58ddd5d`](https://github.com/atlassian-labs/atlaspack/commit/58ddd5d79adde2ac5dc4c60ca575e4705a91e592) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Fix using Atlaspack linked with source files
60
+
61
+ - Updated dependencies [[`53dd47b`](https://github.com/atlassian-labs/atlaspack/commit/53dd47bd6d23cd47f87297347f03a609ab38a03d)]:
62
+ - @atlaspack/node-resolver-core@3.7.0
63
+ - @atlaspack/fs@2.15.24
64
+ - @atlaspack/utils@2.19.1
65
+ - @atlaspack/logger@2.14.21
66
+ - @atlaspack/types@2.15.19
67
+ - @atlaspack/workers@2.14.29
68
+
69
+ ## 2.14.28
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [[`f0349a6`](https://github.com/atlassian-labs/atlaspack/commit/f0349a6b9b04755088f121095ca6301a2ada3767)]:
74
+ - @atlaspack/utils@2.19.0
75
+ - @atlaspack/fs@2.15.23
76
+ - @atlaspack/node-resolver-core@3.6.4
77
+ - @atlaspack/workers@2.14.28
78
+ - @atlaspack/logger@2.14.20
79
+ - @atlaspack/types@2.15.18
80
+
81
+ ## 2.14.27
82
+
83
+ ### Patch Changes
84
+
85
+ - Updated dependencies []:
86
+ - @atlaspack/fs@2.15.22
87
+ - @atlaspack/utils@2.18.4
88
+ - @atlaspack/node-resolver-core@3.6.3
89
+ - @atlaspack/logger@2.14.19
90
+ - @atlaspack/types@2.15.17
91
+ - @atlaspack/workers@2.14.27
92
+
93
+ ## 2.14.26
94
+
95
+ ### Patch Changes
96
+
97
+ - [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
98
+
99
+ - Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
100
+ - @atlaspack/node-resolver-core@3.6.2
101
+ - @atlaspack/build-cache@2.13.5
102
+ - @atlaspack/diagnostic@2.14.3
103
+ - @atlaspack/workers@2.14.26
104
+ - @atlaspack/logger@2.14.18
105
+ - @atlaspack/types@2.15.16
106
+ - @atlaspack/utils@2.18.3
107
+ - @atlaspack/fs@2.15.21
108
+
109
+ ## 2.14.25
110
+
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies []:
114
+ - @atlaspack/fs@2.15.20
115
+ - @atlaspack/utils@2.18.2
116
+ - @atlaspack/node-resolver-core@3.6.1
117
+ - @atlaspack/logger@2.14.17
118
+ - @atlaspack/types@2.15.15
119
+ - @atlaspack/workers@2.14.25
120
+
121
+ ## 2.14.24
122
+
123
+ ### Patch Changes
124
+
125
+ - Updated dependencies [[`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45)]:
126
+ - @atlaspack/node-resolver-core@3.6.0
127
+ - @atlaspack/fs@2.15.19
128
+ - @atlaspack/logger@2.14.16
129
+ - @atlaspack/utils@2.18.1
130
+ - @atlaspack/types@2.15.14
131
+ - @atlaspack/workers@2.14.24
132
+
133
+ ## 2.14.23
134
+
135
+ ### Patch Changes
136
+
137
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
138
+ - @atlaspack/utils@2.18.0
139
+ - @atlaspack/fs@2.15.18
140
+ - @atlaspack/node-resolver-core@3.5.23
141
+ - @atlaspack/workers@2.14.23
142
+ - @atlaspack/logger@2.14.15
143
+ - @atlaspack/types@2.15.13
144
+
145
+ ## 2.14.22
146
+
147
+ ### Patch Changes
148
+
149
+ - [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
150
+
151
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
152
+ - @atlaspack/node-resolver-core@3.5.22
153
+ - @atlaspack/build-cache@2.13.4
154
+ - @atlaspack/diagnostic@2.14.2
155
+ - @atlaspack/workers@2.14.22
156
+ - @atlaspack/logger@2.14.14
157
+ - @atlaspack/types@2.15.12
158
+ - @atlaspack/utils@2.17.4
159
+ - @atlaspack/fs@2.15.17
160
+
161
+ ## 2.14.21
162
+
163
+ ### Patch Changes
164
+
165
+ - Updated dependencies []:
166
+ - @atlaspack/fs@2.15.16
167
+ - @atlaspack/types@2.15.11
168
+ - @atlaspack/workers@2.14.21
169
+ - @atlaspack/utils@2.17.3
170
+ - @atlaspack/node-resolver-core@3.5.21
171
+
172
+ ## 2.14.20
173
+
174
+ ### Patch Changes
175
+
176
+ - Updated dependencies []:
177
+ - @atlaspack/fs@2.15.15
178
+ - @atlaspack/utils@2.17.2
179
+ - @atlaspack/node-resolver-core@3.5.20
180
+ - @atlaspack/types@2.15.10
181
+ - @atlaspack/workers@2.14.20
182
+
183
+ ## 2.14.19
184
+
185
+ ### Patch Changes
186
+
187
+ - Updated dependencies []:
188
+ - @atlaspack/fs@2.15.14
189
+ - @atlaspack/utils@2.17.1
190
+ - @atlaspack/node-resolver-core@3.5.19
191
+ - @atlaspack/types@2.15.9
192
+ - @atlaspack/workers@2.14.19
193
+
194
+ ## 2.14.18
195
+
196
+ ### Patch Changes
197
+
198
+ - [#645](https://github.com/atlassian-labs/atlaspack/pull/645) [`de23e0c`](https://github.com/atlassian-labs/atlaspack/commit/de23e0ce49d5504fe3947ac26640a3d951087da3) Thanks [@alshdavid](https://github.com/alshdavid)! - Updated build system and added some extra test-specific code
199
+
200
+ - [#682](https://github.com/atlassian-labs/atlaspack/pull/682) [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56) Thanks [@alshdavid](https://github.com/alshdavid)! - Updating build system
201
+
202
+ - Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`de23e0c`](https://github.com/atlassian-labs/atlaspack/commit/de23e0ce49d5504fe3947ac26640a3d951087da3), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417), [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56)]:
203
+ - @atlaspack/utils@2.17.0
204
+ - @atlaspack/fs@2.15.13
205
+ - @atlaspack/node-resolver-core@3.5.18
206
+ - @atlaspack/workers@2.14.18
207
+ - @atlaspack/logger@2.14.13
208
+ - @atlaspack/types@2.15.8
209
+
210
+ ## 2.14.17
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies []:
215
+ - @atlaspack/fs@2.15.12
216
+ - @atlaspack/logger@2.14.12
217
+ - @atlaspack/utils@2.16.1
218
+ - @atlaspack/node-resolver-core@3.5.17
219
+ - @atlaspack/workers@2.14.17
220
+ - @atlaspack/types@2.15.7
221
+
222
+ ## 2.14.16
223
+
224
+ ### Patch Changes
225
+
226
+ - Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
227
+ - @atlaspack/utils@2.16.0
228
+ - @atlaspack/fs@2.15.11
229
+ - @atlaspack/node-resolver-core@3.5.16
230
+ - @atlaspack/workers@2.14.16
231
+ - @atlaspack/types@2.15.6
232
+
233
+ ## 2.14.15
234
+
235
+ ### Patch Changes
236
+
237
+ - Updated dependencies []:
238
+ - @atlaspack/fs@2.15.10
239
+ - @atlaspack/utils@2.15.3
240
+ - @atlaspack/node-resolver-core@3.5.15
241
+ - @atlaspack/types@2.15.5
242
+ - @atlaspack/workers@2.14.15
243
+
244
+ ## 2.14.14
245
+
246
+ ### Patch Changes
247
+
248
+ - Updated dependencies []:
249
+ - @atlaspack/fs@2.15.9
250
+ - @atlaspack/utils@2.15.2
251
+ - @atlaspack/node-resolver-core@3.5.14
252
+ - @atlaspack/types@2.15.4
253
+ - @atlaspack/workers@2.14.14
254
+
255
+ ## 2.14.13
256
+
257
+ ### Patch Changes
258
+
259
+ - Updated dependencies [[`ef3d622`](https://github.com/atlassian-labs/atlaspack/commit/ef3d6228f4e006702198a19c61e051d194d325cb)]:
260
+ - @atlaspack/workers@2.14.13
261
+ - @atlaspack/logger@2.14.11
262
+ - @atlaspack/fs@2.15.8
263
+ - @atlaspack/types@2.15.3
264
+ - @atlaspack/utils@2.15.1
265
+ - @atlaspack/node-resolver-core@3.5.13
266
+
267
+ ## 2.14.12
268
+
269
+ ### Patch Changes
270
+
271
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
272
+ - @atlaspack/utils@2.15.0
273
+ - @atlaspack/fs@2.15.7
274
+ - @atlaspack/node-resolver-core@3.5.12
275
+ - @atlaspack/workers@2.14.12
276
+ - @atlaspack/types@2.15.2
277
+
278
+ ## 2.14.11
279
+
280
+ ### Patch Changes
281
+
282
+ - Updated dependencies []:
283
+ - @atlaspack/fs@2.15.6
284
+ - @atlaspack/utils@2.14.11
285
+ - @atlaspack/node-resolver-core@3.5.11
286
+ - @atlaspack/types@2.15.1
287
+ - @atlaspack/workers@2.14.11
288
+
289
+ ## 2.14.10
290
+
291
+ ### Patch Changes
292
+
293
+ - Updated dependencies [[`0999fb7`](https://github.com/atlassian-labs/atlaspack/commit/0999fb78da519a6c7582d212883e515fcf6c1252), [`51aba5f`](https://github.com/atlassian-labs/atlaspack/commit/51aba5fc0e49235ee06bbc3c376f48c3e7da5c4b), [`1e32d4e`](https://github.com/atlassian-labs/atlaspack/commit/1e32d4eae6b3af3968e8a0ef97d35b4347fd4196)]:
294
+ - @atlaspack/fs@2.15.5
295
+ - @atlaspack/types@2.15.0
296
+ - @atlaspack/node-resolver-core@3.5.10
297
+ - @atlaspack/workers@2.14.10
298
+ - @atlaspack/logger@2.14.10
299
+ - @atlaspack/utils@2.14.10
300
+
301
+ ## 2.14.9
302
+
303
+ ### Patch Changes
304
+
305
+ - Updated dependencies [[`e4d966c`](https://github.com/atlassian-labs/atlaspack/commit/e4d966c3c9c4292c5013372ae65b10d19d4bacc6)]:
306
+ - @atlaspack/fs@2.15.4
307
+ - @atlaspack/logger@2.14.9
308
+ - @atlaspack/utils@2.14.9
309
+ - @atlaspack/node-resolver-core@3.5.9
310
+ - @atlaspack/workers@2.14.9
311
+ - @atlaspack/types@2.14.9
312
+
313
+ ## 2.14.8
314
+
315
+ ### Patch Changes
316
+
317
+ - Updated dependencies [[`3a3e8e7`](https://github.com/atlassian-labs/atlaspack/commit/3a3e8e7be9e2dffd7304436d792f0f595d59665a), [`1ab0a27`](https://github.com/atlassian-labs/atlaspack/commit/1ab0a275aeca40350415e2b03e7440d1dddc6228), [`b8a4ae8`](https://github.com/atlassian-labs/atlaspack/commit/b8a4ae8f83dc0a83d8b145c5f729936ce52080a3)]:
318
+ - @atlaspack/fs@2.15.3
319
+ - @atlaspack/utils@2.14.8
320
+ - @atlaspack/node-resolver-core@3.5.8
321
+ - @atlaspack/logger@2.14.8
322
+ - @atlaspack/types@2.14.8
323
+ - @atlaspack/workers@2.14.8
324
+
3
325
  ## 2.14.7
4
326
 
5
327
  ### Patch Changes
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const logger_1 = __importDefault(require("@atlaspack/logger"));
7
+ const stream_1 = require("stream");
8
+ // Transforms chunks of json strings to parsed objects.
9
+ // Pair with split2 to parse stream of newline-delimited text.
10
+ class JSONParseStream extends stream_1.Transform {
11
+ constructor(options) {
12
+ // @ts-expect-error TS2698
13
+ super({ ...options, objectMode: true });
14
+ }
15
+ _transform(chunk, encoding, callback) {
16
+ try {
17
+ let parsed;
18
+ try {
19
+ parsed = JSON.parse(chunk.toString());
20
+ }
21
+ catch (e) {
22
+ // Be permissive and ignoreJSON parse errors in case there was
23
+ // a non-JSON line in the package manager's stdout.
24
+ logger_1.default.verbose({
25
+ message: 'Ignored invalid JSON message: ' + chunk.toString(),
26
+ origin: '@atlaspack/package-manager',
27
+ });
28
+ return;
29
+ }
30
+ callback(null, parsed);
31
+ }
32
+ catch (err) {
33
+ callback(err);
34
+ }
35
+ }
36
+ }
37
+ exports.default = JSONParseStream;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MockPackageInstaller = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const build_cache_1 = require("@atlaspack/build-cache");
9
+ const fs_1 = require("@atlaspack/fs");
10
+ const package_json_1 = __importDefault(require("../package.json"));
11
+ const utils_1 = require("./utils");
12
+ // This PackageInstaller implementation simply copies files from one filesystem to another.
13
+ // Mostly useful for testing purposes.
14
+ class MockPackageInstaller {
15
+ constructor() {
16
+ this.packages = new Map();
17
+ }
18
+ register(packageName, fs, packagePath) {
19
+ this.packages.set(packageName, { fs, packagePath });
20
+ }
21
+ async install({ modules, fs, cwd, packagePath, saveDev = true, }) {
22
+ if (packagePath == null) {
23
+ packagePath = path_1.default.join(cwd, 'package.json');
24
+ await fs.writeFile(packagePath, '{}');
25
+ }
26
+ let pkg = JSON.parse(await fs.readFile(packagePath, 'utf8'));
27
+ let key = saveDev ? 'devDependencies' : 'dependencies';
28
+ if (!pkg[key]) {
29
+ pkg[key] = {};
30
+ }
31
+ for (let module of modules) {
32
+ pkg[key][module.name] =
33
+ '^' + (await this.installPackage(module, fs, packagePath));
34
+ }
35
+ await fs.writeFile(packagePath, JSON.stringify(pkg));
36
+ }
37
+ async installPackage(moduleRequest, fs, packagePath) {
38
+ let pkg = this.packages.get(moduleRequest.name);
39
+ if (!pkg) {
40
+ throw new Error('Unknown package ' + moduleRequest.name);
41
+ }
42
+ let dest = path_1.default.join(path_1.default.dirname(packagePath), 'node_modules', moduleRequest.name);
43
+ await (0, fs_1.ncp)(pkg.fs, pkg.packagePath, fs, dest);
44
+ let packageJSON = JSON.parse(await fs.readFile(path_1.default.join(dest, 'package.json'), 'utf8'));
45
+ if (packageJSON.dependencies != null) {
46
+ for (let dep of (0, utils_1.moduleRequestsFromDependencyMap)(packageJSON.dependencies)) {
47
+ await this.installPackage(dep, fs, packagePath);
48
+ }
49
+ }
50
+ return packageJSON.version;
51
+ }
52
+ }
53
+ exports.MockPackageInstaller = MockPackageInstaller;
54
+ (0, build_cache_1.registerSerializableClass)(`${package_json_1.default.version}:MockPackageInstaller`, MockPackageInstaller);