@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.
- package/CHANGELOG.md +11 -0
- package/index.d.ts +40 -0
- package/lib/JSONParseStream.js +2 -1
- package/lib/NodePackageManager.js +24 -44
- package/lib/Npm.js +1 -2
- package/lib/Pnpm.js +4 -18
- package/lib/Yarn.js +3 -17
- package/lib/getCurrentPackageManager.js +1 -3
- package/lib/index.d.ts +8 -8
- package/lib/installPackage.js +0 -1
- package/lib/nodejsConditions.js +0 -6
- package/lib/promiseFromProcess.js +0 -2
- package/package.json +17 -17
- package/src/{JSONParseStream.ts → JSONParseStream.js} +7 -8
- package/src/{MockPackageInstaller.ts → MockPackageInstaller.js} +6 -4
- package/src/{NodePackageManager.ts → NodePackageManager.js} +51 -72
- package/src/{Npm.ts → Npm.js} +9 -9
- package/src/{Pnpm.ts → Pnpm.js} +50 -68
- package/src/{Yarn.ts → Yarn.js} +25 -38
- package/src/{getCurrentPackageManager.ts → getCurrentPackageManager.js} +4 -9
- package/src/{index.ts → index.js} +2 -0
- package/src/{installPackage.ts → installPackage.js} +6 -5
- package/src/{nodejsConditions.ts → nodejsConditions.js} +3 -6
- package/src/promiseFromProcess.js +19 -0
- package/src/{utils.ts → utils.js} +11 -21
- package/src/{validateModuleSpecifier.ts → validateModuleSpecifier.js} +2 -0
- package/test/{NodePackageManager.test.ts → NodePackageManager.test.js} +15 -13
- package/test/{getCurrentPackageManager.test.ts → getCurrentPackageManager.test.js} +1 -0
- package/test/{validateModuleSpecifiers.test.ts → validateModuleSpecifiers.test.js} +3 -2
- package/LICENSE +0 -201
- package/lib/JSONParseStream.d.ts +0 -6
- package/lib/MockPackageInstaller.d.ts +0 -14
- package/lib/NodePackageManager.d.ts +0 -36
- package/lib/Npm.d.ts +0 -4
- package/lib/Pnpm.d.ts +0 -5
- package/lib/Yarn.d.ts +0 -5
- package/lib/getCurrentPackageManager.d.ts +0 -4
- package/lib/installPackage.d.ts +0 -5
- package/lib/nodejsConditions.d.ts +0 -3
- package/lib/promiseFromProcess.d.ts +0 -2
- package/lib/utils.d.ts +0 -15
- package/lib/validateModuleSpecifier.d.ts +0 -1
- package/src/promiseFromProcess.ts +0 -23
- package/tsconfig.json +0 -4
package/lib/JSONParseStream.d.ts
DELETED
@@ -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
package/lib/Pnpm.d.ts
DELETED
package/lib/Yarn.d.ts
DELETED
package/lib/installPackage.d.ts
DELETED
@@ -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>;
|
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