@atlaspack/package-manager 2.14.21-typescript-bc4459c37.0 → 2.14.21

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 (44) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/index.d.ts +40 -0
  3. package/lib/JSONParseStream.js +2 -1
  4. package/lib/NodePackageManager.js +24 -44
  5. package/lib/Npm.js +1 -2
  6. package/lib/Pnpm.js +4 -18
  7. package/lib/Yarn.js +3 -17
  8. package/lib/getCurrentPackageManager.js +1 -3
  9. package/lib/index.d.ts +8 -8
  10. package/lib/installPackage.js +0 -1
  11. package/lib/nodejsConditions.js +0 -6
  12. package/lib/promiseFromProcess.js +0 -2
  13. package/package.json +17 -17
  14. package/src/{JSONParseStream.ts → JSONParseStream.js} +7 -8
  15. package/src/{MockPackageInstaller.ts → MockPackageInstaller.js} +6 -4
  16. package/src/{NodePackageManager.ts → NodePackageManager.js} +51 -72
  17. package/src/{Npm.ts → Npm.js} +9 -9
  18. package/src/{Pnpm.ts → Pnpm.js} +50 -68
  19. package/src/{Yarn.ts → Yarn.js} +25 -38
  20. package/src/{getCurrentPackageManager.ts → getCurrentPackageManager.js} +4 -9
  21. package/src/{index.ts → index.js} +2 -0
  22. package/src/{installPackage.ts → installPackage.js} +6 -5
  23. package/src/{nodejsConditions.ts → nodejsConditions.js} +3 -6
  24. package/src/promiseFromProcess.js +19 -0
  25. package/src/{utils.ts → utils.js} +11 -21
  26. package/src/{validateModuleSpecifier.ts → validateModuleSpecifier.js} +2 -0
  27. package/test/{NodePackageManager.test.ts → NodePackageManager.test.js} +15 -13
  28. package/test/{getCurrentPackageManager.test.ts → getCurrentPackageManager.test.js} +1 -0
  29. package/test/{validateModuleSpecifiers.test.ts → validateModuleSpecifiers.test.js} +3 -2
  30. package/LICENSE +0 -201
  31. package/lib/JSONParseStream.d.ts +0 -6
  32. package/lib/MockPackageInstaller.d.ts +0 -14
  33. package/lib/NodePackageManager.d.ts +0 -36
  34. package/lib/Npm.d.ts +0 -4
  35. package/lib/Pnpm.d.ts +0 -5
  36. package/lib/Yarn.d.ts +0 -5
  37. package/lib/getCurrentPackageManager.d.ts +0 -4
  38. package/lib/installPackage.d.ts +0 -5
  39. package/lib/nodejsConditions.d.ts +0 -3
  40. package/lib/promiseFromProcess.d.ts +0 -2
  41. package/lib/utils.d.ts +0 -15
  42. package/lib/validateModuleSpecifier.d.ts +0 -1
  43. package/src/promiseFromProcess.ts +0 -23
  44. package/tsconfig.json +0 -4
@@ -1,6 +0,0 @@
1
- import type { JSONObject } from '@atlaspack/types';
2
- import { Transform } from 'stream';
3
- export default class JSONParseStream extends Transform {
4
- constructor(options: unknown);
5
- _transform(chunk: Buffer | string, encoding: string, callback: (err?: Error | null | undefined, parsed?: JSONObject | null | undefined) => unknown): void;
6
- }
@@ -1,14 +0,0 @@
1
- import type { ModuleRequest, PackageInstaller, InstallerOptions } from '@atlaspack/types';
2
- import type { FileSystem } from '@atlaspack/fs';
3
- import type { FilePath } from '@atlaspack/types';
4
- type Package = {
5
- fs: FileSystem;
6
- packagePath: FilePath;
7
- };
8
- export declare class MockPackageInstaller implements PackageInstaller {
9
- packages: Map<string, Package>;
10
- register(packageName: string, fs: FileSystem, packagePath: FilePath): void;
11
- install({ modules, fs, cwd, packagePath, saveDev, }: InstallerOptions): Promise<void>;
12
- installPackage(moduleRequest: ModuleRequest, fs: FileSystem, packagePath: FilePath): Promise<any>;
13
- }
14
- export {};
@@ -1,36 +0,0 @@
1
- import type { FilePath, DependencySpecifier, SemverRange } from '@atlaspack/types';
2
- import type { FileSystem } from '@atlaspack/fs';
3
- import type { ModuleRequest, PackageManager, PackageInstaller, InstallOptions, Invalidations, PackageManagerResolveResult } from '@atlaspack/types';
4
- export declare class NodePackageManager implements PackageManager {
5
- fs: FileSystem;
6
- projectRoot: FilePath;
7
- installer: PackageInstaller | null | undefined;
8
- resolver: ResolverBase;
9
- currentExtensions: Array<string>;
10
- constructor(fs: FileSystem, projectRoot: FilePath, installer?: PackageInstaller | null);
11
- _createResolver(): ResolverBase;
12
- static deserialize(opts: any): NodePackageManager;
13
- serialize(): {
14
- $$raw: boolean;
15
- fs: FileSystem;
16
- projectRoot: FilePath;
17
- installer: PackageInstaller | null | undefined;
18
- };
19
- require(name: DependencySpecifier, from: FilePath, opts?: {
20
- range?: SemverRange | null | undefined;
21
- shouldAutoInstall?: boolean;
22
- saveDev?: boolean;
23
- } | null): Promise<any>;
24
- requireSync(name: DependencySpecifier, from: FilePath): any;
25
- load(filePath: FilePath, from: FilePath): any;
26
- resolve(id: DependencySpecifier, from: FilePath, options?: {
27
- range?: SemverRange | null | undefined;
28
- shouldAutoInstall?: boolean;
29
- saveDev?: boolean;
30
- } | null): Promise<PackageManagerResolveResult>;
31
- resolveSync(name: DependencySpecifier, from: FilePath): PackageManagerResolveResult;
32
- install(modules: Array<ModuleRequest>, from: FilePath, opts?: InstallOptions): Promise<void>;
33
- getInvalidations(name: DependencySpecifier, from: FilePath): Invalidations;
34
- invalidate(name: DependencySpecifier, from: FilePath): void;
35
- resolveInternal(name: string, from: string): PackageManagerResolveResult;
36
- }
package/lib/Npm.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import type { PackageInstaller, InstallerOptions } from '@atlaspack/types';
2
- export declare class Npm implements PackageInstaller {
3
- install({ modules, cwd, fs, packagePath, saveDev, }: InstallerOptions): Promise<void>;
4
- }
package/lib/Pnpm.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { PackageInstaller, InstallerOptions } from '@atlaspack/types';
2
- export declare class Pnpm implements PackageInstaller {
3
- static exists(): Promise<boolean>;
4
- install({ modules, cwd, saveDev, }: InstallerOptions): Promise<void>;
5
- }
package/lib/Yarn.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { PackageInstaller, InstallerOptions } from '@atlaspack/types';
2
- export declare class Yarn implements PackageInstaller {
3
- static exists(): Promise<boolean>;
4
- install({ modules, cwd, saveDev, }: InstallerOptions): Promise<void>;
5
- }
@@ -1,4 +0,0 @@
1
- export default function getCurrentPackageManager(userAgent?: string | null): {
2
- name: string;
3
- version: string;
4
- } | null | undefined;
@@ -1,5 +0,0 @@
1
- import type { FilePath } from '@atlaspack/types';
2
- import type { ModuleRequest, PackageManager, InstallOptions } from '@atlaspack/types';
3
- import type { FileSystem } from '@atlaspack/fs';
4
- export declare function _addToInstallQueue(fs: FileSystem, packageManager: PackageManager, modules: Array<ModuleRequest>, filePath: FilePath, projectRoot: FilePath, options?: InstallOptions): Promise<unknown>;
5
- export declare function installPackage(fs: FileSystem, packageManager: PackageManager, modules: Array<ModuleRequest>, filePath: FilePath, projectRoot: FilePath, options?: InstallOptions): Promise<unknown>;
@@ -1,3 +0,0 @@
1
- export declare const defaultNodejsConditions: Array<string>;
2
- /** @description Gets the export conditions from NODE_OPTIONS and node arguments */
3
- export declare function getConditionsFromEnv(): Array<string>;
@@ -1,2 +0,0 @@
1
- import type { ChildProcess } from 'child_process';
2
- export default function promiseFromProcess(childProcess: ChildProcess): Promise<void>;
package/lib/utils.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import type { FilePath, ModuleRequest } from '@atlaspack/types';
2
- import type { FileSystem } from '@atlaspack/fs';
3
- export declare const exec: (command: string, options?: child_process.execOpts) => Promise<{
4
- stdout: string | Buffer;
5
- stderr: string | Buffer;
6
- }>;
7
- export declare function npmSpecifierFromModuleRequest(moduleRequest: ModuleRequest): string;
8
- export declare function moduleRequestsFromDependencyMap(dependencyMap: {
9
- [key: string]: string;
10
- }): Array<ModuleRequest>;
11
- export declare function getConflictingLocalDependencies(fs: FileSystem, name: string, local: FilePath, projectRoot: FilePath): Promise<{
12
- json: string;
13
- filePath: FilePath;
14
- fields: Array<string>;
15
- } | null | undefined>;
@@ -1 +0,0 @@
1
- export default function validateModuleSpecifier(moduleName: string): string;
@@ -1,23 +0,0 @@
1
- import type {ChildProcess} from 'child_process';
2
-
3
- export default function promiseFromProcess(
4
- childProcess: ChildProcess,
5
- ): Promise<void> {
6
- return new Promise(
7
- (
8
- resolve: (result: Promise<undefined> | undefined) => void,
9
- reject: (error?: any) => void,
10
- ) => {
11
- childProcess.on('error', reject);
12
- childProcess.on('close', (code) => {
13
- if (code !== 0) {
14
- reject(new Error('Child process failed'));
15
- return;
16
- }
17
-
18
- // @ts-expect-error TS2794
19
- resolve();
20
- });
21
- },
22
- );
23
- }
package/tsconfig.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.json",
3
- "include": ["src"]
4
- }