@atlaspack/package-manager 2.14.21 → 2.14.22-typescript-5ad950d33.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 (43) hide show
  1. package/LICENSE +201 -0
  2. package/lib/JSONParseStream.d.ts +6 -0
  3. package/lib/JSONParseStream.js +1 -2
  4. package/lib/MockPackageInstaller.d.ts +14 -0
  5. package/lib/NodePackageManager.d.ts +36 -0
  6. package/lib/NodePackageManager.js +44 -24
  7. package/lib/Npm.d.ts +4 -0
  8. package/lib/Npm.js +2 -1
  9. package/lib/Pnpm.d.ts +5 -0
  10. package/lib/Pnpm.js +18 -4
  11. package/lib/Yarn.d.ts +5 -0
  12. package/lib/Yarn.js +17 -3
  13. package/lib/getCurrentPackageManager.d.ts +4 -0
  14. package/lib/getCurrentPackageManager.js +3 -1
  15. package/lib/index.d.ts +8 -8
  16. package/lib/installPackage.d.ts +5 -0
  17. package/lib/installPackage.js +1 -0
  18. package/lib/nodejsConditions.d.ts +3 -0
  19. package/lib/nodejsConditions.js +6 -0
  20. package/lib/promiseFromProcess.d.ts +2 -0
  21. package/lib/promiseFromProcess.js +2 -0
  22. package/lib/utils.d.ts +15 -0
  23. package/lib/validateModuleSpecifier.d.ts +1 -0
  24. package/package.json +17 -17
  25. package/src/{JSONParseStream.js → JSONParseStream.ts} +8 -7
  26. package/src/{MockPackageInstaller.js → MockPackageInstaller.ts} +4 -6
  27. package/src/{NodePackageManager.js → NodePackageManager.ts} +72 -51
  28. package/src/{Npm.js → Npm.ts} +9 -9
  29. package/src/{Pnpm.js → Pnpm.ts} +68 -50
  30. package/src/{Yarn.js → Yarn.ts} +38 -25
  31. package/src/{getCurrentPackageManager.js → getCurrentPackageManager.ts} +9 -4
  32. package/src/{index.js → index.ts} +0 -2
  33. package/src/{installPackage.js → installPackage.ts} +5 -6
  34. package/src/{nodejsConditions.js → nodejsConditions.ts} +6 -3
  35. package/src/promiseFromProcess.ts +23 -0
  36. package/src/{utils.js → utils.ts} +21 -11
  37. package/src/{validateModuleSpecifier.js → validateModuleSpecifier.ts} +0 -2
  38. package/test/{NodePackageManager.test.js → NodePackageManager.test.ts} +13 -15
  39. package/test/{getCurrentPackageManager.test.js → getCurrentPackageManager.test.ts} +0 -1
  40. package/test/{validateModuleSpecifiers.test.js → validateModuleSpecifiers.test.ts} +2 -3
  41. package/tsconfig.json +4 -0
  42. package/index.d.ts +0 -40
  43. package/src/promiseFromProcess.js +0 -19
package/index.d.ts DELETED
@@ -1,40 +0,0 @@
1
- import type {
2
- FilePath,
3
- PackageInstaller,
4
- PackageManager,
5
- PackageManagerResolveResult,
6
- } from '@atlaspack/types';
7
- import type {FileSystem} from '@atlaspack/fs';
8
-
9
- export type {PackageManagerResolveResult};
10
- export type {PackageManagerResolveResult as ResolveResult};
11
-
12
- export type {
13
- PackageManager,
14
- InstallOptions,
15
- InstallerOptions,
16
- PackageInstaller,
17
- Invalidations,
18
- ModuleRequest,
19
- } from '@atlaspack/types';
20
-
21
- export const Npm: {
22
- new (): PackageInstaller;
23
- };
24
- export const Pnpm: {
25
- new (): PackageInstaller;
26
- };
27
- export const Yarn: {
28
- new (): PackageInstaller;
29
- };
30
-
31
- export const MockPackageInstaller: {
32
- new (): PackageInstaller;
33
- };
34
- export const NodePackageManager: {
35
- new (
36
- fs: FileSystem,
37
- projectRoot: FilePath,
38
- installer?: PackageInstaller,
39
- ): PackageManager;
40
- };
@@ -1,19 +0,0 @@
1
- // @flow strict-local
2
-
3
- import type {ChildProcess} from 'child_process';
4
-
5
- export default function promiseFromProcess(
6
- childProcess: ChildProcess,
7
- ): Promise<void> {
8
- return new Promise((resolve, reject) => {
9
- childProcess.on('error', reject);
10
- childProcess.on('close', (code) => {
11
- if (code !== 0) {
12
- reject(new Error('Child process failed'));
13
- return;
14
- }
15
-
16
- resolve();
17
- });
18
- });
19
- }