workspace-tools 0.38.4 → 0.38.6
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/lib/getPackageInfo.d.ts +13 -0
- package/lib/getPackageInfo.js +52 -0
- package/lib/getPackageInfo.js.map +1 -0
- package/lib/getPackageInfos.d.ts +14 -0
- package/lib/getPackageInfos.js +17 -20
- package/lib/getPackageInfos.js.map +1 -1
- package/lib/getPackagePaths.d.ts +2 -2
- package/lib/getPackagePaths.js +2 -2
- package/lib/git/gitUtilities.d.ts +132 -3
- package/lib/git/gitUtilities.js +141 -4
- package/lib/git/gitUtilities.js.map +1 -1
- package/lib/graph/createDependencyMap.d.ts +1 -1
- package/lib/graph/createDependencyMap.js.map +1 -1
- package/lib/graph/getPackageDependencies.d.ts +10 -1
- package/lib/graph/getPackageDependencies.js +17 -5
- package/lib/graph/getPackageDependencies.js.map +1 -1
- package/lib/index.d.ts +17 -14
- package/lib/index.js +40 -15
- package/lib/index.js.map +1 -1
- package/lib/lockfile/parseBerryLock.d.ts +3 -0
- package/lib/lockfile/parseBerryLock.js +3 -0
- package/lib/lockfile/parseBerryLock.js.map +1 -1
- package/lib/lockfile/types.d.ts +3 -0
- package/lib/paths.d.ts +3 -0
- package/lib/paths.js +4 -1
- package/lib/paths.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/types/Catalogs.d.ts +30 -0
- package/lib/types/Catalogs.js +3 -0
- package/lib/types/Catalogs.js.map +1 -0
- package/lib/types/PackageInfo.d.ts +19 -1
- package/lib/types/WorkspaceInfo.d.ts +15 -6
- package/lib/workspaces/catalogs.d.ts +33 -0
- package/lib/workspaces/catalogs.js +66 -0
- package/lib/workspaces/catalogs.js.map +1 -0
- package/lib/workspaces/findWorkspacePath.d.ts +5 -5
- package/lib/workspaces/findWorkspacePath.js +3 -3
- package/lib/workspaces/findWorkspacePath.js.map +1 -1
- package/lib/workspaces/getWorkspacePackageInfo.d.ts +12 -9
- package/lib/workspaces/getWorkspacePackageInfo.js +14 -16
- package/lib/workspaces/getWorkspacePackageInfo.js.map +1 -1
- package/lib/workspaces/getWorkspaceRoot.d.ts +18 -2
- package/lib/workspaces/getWorkspaceRoot.js +23 -4
- package/lib/workspaces/getWorkspaceRoot.js.map +1 -1
- package/lib/workspaces/getWorkspaces.d.ts +11 -14
- package/lib/workspaces/getWorkspaces.js +8 -11
- package/lib/workspaces/getWorkspaces.js.map +1 -1
- package/lib/workspaces/implementations/getWorkspaceUtilities.d.ts +16 -9
- package/lib/workspaces/implementations/getWorkspaceUtilities.js.map +1 -1
- package/lib/workspaces/implementations/index.d.ts +2 -2
- package/lib/workspaces/implementations/index.js.map +1 -1
- package/lib/workspaces/implementations/lerna.d.ts +8 -8
- package/lib/workspaces/implementations/lerna.js +5 -5
- package/lib/workspaces/implementations/lerna.js.map +1 -1
- package/lib/workspaces/implementations/npm.d.ts +9 -9
- package/lib/workspaces/implementations/npm.js +6 -6
- package/lib/workspaces/implementations/npm.js.map +1 -1
- package/lib/workspaces/implementations/packageJsonWorkspaces.d.ts +21 -10
- package/lib/workspaces/implementations/packageJsonWorkspaces.js +34 -23
- package/lib/workspaces/implementations/packageJsonWorkspaces.js.map +1 -1
- package/lib/workspaces/implementations/pnpm.d.ts +17 -9
- package/lib/workspaces/implementations/pnpm.js +37 -11
- package/lib/workspaces/implementations/pnpm.js.map +1 -1
- package/lib/workspaces/implementations/rush.d.ts +8 -8
- package/lib/workspaces/implementations/rush.js +5 -5
- package/lib/workspaces/implementations/rush.js.map +1 -1
- package/lib/workspaces/implementations/yarn.d.ts +18 -10
- package/lib/workspaces/implementations/yarn.js +51 -10
- package/lib/workspaces/implementations/yarn.js.map +1 -1
- package/lib/workspaces/listOfWorkspacePackageNames.d.ts +5 -2
- package/lib/workspaces/listOfWorkspacePackageNames.js +3 -0
- package/lib/workspaces/listOfWorkspacePackageNames.js.map +1 -1
- package/package.json +2 -3
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** Get
|
|
1
|
+
import type { WorkspaceInfos } from "../../types/WorkspaceInfo";
|
|
2
|
+
/** Get paths for each package ("workspace") in a lerna monorepo. */
|
|
3
3
|
export declare function getWorkspacePackagePaths(cwd: string): string[];
|
|
4
4
|
/**
|
|
5
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
6
|
-
*
|
|
5
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
6
|
+
* in a lerna monorepo.
|
|
7
7
|
*/
|
|
8
|
-
export declare function getLernaWorkspaces(cwd: string):
|
|
8
|
+
export declare function getLernaWorkspaces(cwd: string): WorkspaceInfos;
|
|
9
9
|
/**
|
|
10
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
11
|
-
*
|
|
10
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
11
|
+
* in a lerna monorepo.
|
|
12
12
|
*/
|
|
13
|
-
export declare function getLernaWorkspacesAsync(cwd: string): Promise<
|
|
13
|
+
export declare function getLernaWorkspacesAsync(cwd: string): Promise<WorkspaceInfos>;
|
|
14
14
|
export { getLernaWorkspaces as getWorkspaces };
|
|
15
15
|
export { getLernaWorkspacesAsync as getWorkspacesAsync };
|
|
@@ -18,7 +18,7 @@ function getLernaWorkspaceRoot(cwd) {
|
|
|
18
18
|
}
|
|
19
19
|
return root;
|
|
20
20
|
}
|
|
21
|
-
/** Get
|
|
21
|
+
/** Get paths for each package ("workspace") in a lerna monorepo. */
|
|
22
22
|
function getWorkspacePackagePaths(cwd) {
|
|
23
23
|
try {
|
|
24
24
|
const lernaWorkspaceRoot = getLernaWorkspaceRoot(cwd);
|
|
@@ -33,8 +33,8 @@ function getWorkspacePackagePaths(cwd) {
|
|
|
33
33
|
}
|
|
34
34
|
exports.getWorkspacePackagePaths = getWorkspacePackagePaths;
|
|
35
35
|
/**
|
|
36
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
37
|
-
*
|
|
36
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
37
|
+
* in a lerna monorepo.
|
|
38
38
|
*/
|
|
39
39
|
function getLernaWorkspaces(cwd) {
|
|
40
40
|
try {
|
|
@@ -49,8 +49,8 @@ function getLernaWorkspaces(cwd) {
|
|
|
49
49
|
exports.getLernaWorkspaces = getLernaWorkspaces;
|
|
50
50
|
exports.getWorkspaces = getLernaWorkspaces;
|
|
51
51
|
/**
|
|
52
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
53
|
-
*
|
|
52
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
53
|
+
* in a lerna monorepo.
|
|
54
54
|
*/
|
|
55
55
|
async function getLernaWorkspacesAsync(cwd) {
|
|
56
56
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lerna.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/lerna.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,8CAAsB;AACtB,gDAAwB;AACxB,2DAAwD;AAExD,wEAAmG;AACnG,2CAAkD;AAClD,6EAA0E;AAE1E,SAAS,qBAAqB,CAAC,GAAW;IACxC,MAAM,IAAI,GAAG,IAAA,uDAA0B,EAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC;IACvE,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,2CAA2C,GAAG,GAAG,CAAC,CAAC;KACpE;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"lerna.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/lerna.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,8CAAsB;AACtB,gDAAwB;AACxB,2DAAwD;AAExD,wEAAmG;AACnG,2CAAkD;AAClD,6EAA0E;AAE1E,SAAS,qBAAqB,CAAC,GAAW;IACxC,MAAM,IAAI,GAAG,IAAA,uDAA0B,EAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE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AiB,EAAC,sCAAsC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QACpE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,0DAQC;AAGmC,qDAAkB"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** Get
|
|
1
|
+
import type { WorkspaceInfos } from "../../types/WorkspaceInfo";
|
|
2
|
+
/** Get paths for each package ("workspace") in an npm monorepo. */
|
|
3
3
|
export declare function getWorkspacePackagePaths(cwd: string): string[];
|
|
4
|
-
/** Get
|
|
4
|
+
/** Get paths for each package ("workspace") in an npm monorepo. */
|
|
5
5
|
export declare function getWorkspacePackagePathsAsync(cwd: string): Promise<string[]>;
|
|
6
6
|
/**
|
|
7
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
8
|
-
*
|
|
7
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
8
|
+
* in an npm monorepo.
|
|
9
9
|
*/
|
|
10
|
-
export declare function getNpmWorkspaces(cwd: string):
|
|
10
|
+
export declare function getNpmWorkspaces(cwd: string): WorkspaceInfos;
|
|
11
11
|
/**
|
|
12
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
13
|
-
*
|
|
12
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
13
|
+
* in an npm monorepo.
|
|
14
14
|
*/
|
|
15
|
-
export declare function getNpmWorkspacesAsync(cwd: string): Promise<
|
|
15
|
+
export declare function getNpmWorkspacesAsync(cwd: string): Promise<WorkspaceInfos>;
|
|
16
16
|
export { getNpmWorkspaces as getWorkspaces };
|
|
17
17
|
export { getNpmWorkspacesAsync as getWorkspacesAsync };
|
|
@@ -10,21 +10,21 @@ function getNpmWorkspaceRoot(cwd) {
|
|
|
10
10
|
}
|
|
11
11
|
return root;
|
|
12
12
|
}
|
|
13
|
-
/** Get
|
|
13
|
+
/** Get paths for each package ("workspace") in an npm monorepo. */
|
|
14
14
|
function getWorkspacePackagePaths(cwd) {
|
|
15
15
|
const npmWorkspacesRoot = getNpmWorkspaceRoot(cwd);
|
|
16
16
|
return (0, packageJsonWorkspaces_1.getPackagePathsFromWorkspaceRoot)(npmWorkspacesRoot);
|
|
17
17
|
}
|
|
18
18
|
exports.getWorkspacePackagePaths = getWorkspacePackagePaths;
|
|
19
|
-
/** Get
|
|
19
|
+
/** Get paths for each package ("workspace") in an npm monorepo. */
|
|
20
20
|
function getWorkspacePackagePathsAsync(cwd) {
|
|
21
21
|
const npmWorkspacesRoot = getNpmWorkspaceRoot(cwd);
|
|
22
22
|
return (0, packageJsonWorkspaces_1.getPackagePathsFromWorkspaceRootAsync)(npmWorkspacesRoot);
|
|
23
23
|
}
|
|
24
24
|
exports.getWorkspacePackagePathsAsync = getWorkspacePackagePathsAsync;
|
|
25
25
|
/**
|
|
26
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
27
|
-
*
|
|
26
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
27
|
+
* in an npm monorepo.
|
|
28
28
|
*/
|
|
29
29
|
function getNpmWorkspaces(cwd) {
|
|
30
30
|
const npmWorkspacesRoot = getNpmWorkspaceRoot(cwd);
|
|
@@ -33,8 +33,8 @@ function getNpmWorkspaces(cwd) {
|
|
|
33
33
|
exports.getNpmWorkspaces = getNpmWorkspaces;
|
|
34
34
|
exports.getWorkspaces = getNpmWorkspaces;
|
|
35
35
|
/**
|
|
36
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
37
|
-
*
|
|
36
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
37
|
+
* in an npm monorepo.
|
|
38
38
|
*/
|
|
39
39
|
function getNpmWorkspacesAsync(cwd) {
|
|
40
40
|
const npmWorkspacesRoot = getNpmWorkspaceRoot(cwd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npm.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/npm.ts"],"names":[],"mappings":";;;AAAA,wBAA+C;AAE/C,mEAKiC;AAEjC,SAAS,m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qBAAqB,CAAC,GAAW;IAC/C,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACnD,OAAO,IAAA,8DAAsC,EAAC,iBAAiB,CAAC,CAAC;AACnE,CAAC;AAHD,sDAGC;AAGiC,mDAAkB"}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
export declare function getPackagePathsFromWorkspaceRoot(packageJsonWorkspacesRoot: string): string[];
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
|
|
3
|
+
* into absolute package paths. Returns an empty array if the `workspaces` property is not found or
|
|
4
|
+
* there's some other issue.
|
|
5
5
|
*/
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function getPackagePathsFromWorkspaceRoot(root: string): string[];
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
|
|
9
|
+
* into absolute package paths. Returns an empty array if the `workspaces` property is not found or
|
|
10
|
+
* there's some other issue.
|
|
10
11
|
*/
|
|
11
|
-
export declare function
|
|
12
|
+
export declare function getPackagePathsFromWorkspaceRootAsync(root: string): Promise<string[]>;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
14
|
+
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
|
|
15
|
+
* into an array with names, paths, and package.json contents for each package (each "workspace"
|
|
16
|
+
* in npm/yarn/pnpm terms). Returns an empty array if there's any issue.
|
|
15
17
|
*/
|
|
16
|
-
export declare function
|
|
18
|
+
export declare function getWorkspaceInfoFromWorkspaceRoot(root: string): import("../..").WorkspaceInfos;
|
|
19
|
+
/**
|
|
20
|
+
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
|
|
21
|
+
* into an array with names, paths, and package.json contents for each package (each "workspace"
|
|
22
|
+
* in npm/yarn/pnpm terms). Returns an empty array if there's any issue.
|
|
23
|
+
*
|
|
24
|
+
* NOTE: As of writing, this will start promises to read all package.json files in parallel,
|
|
25
|
+
* without direct concurrency control.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getWorkspaceInfoFromWorkspaceRootAsync(root: string): Promise<import("../..").WorkspaceInfos>;
|
|
@@ -10,10 +10,10 @@ const getPackagePaths_1 = require("../../getPackagePaths");
|
|
|
10
10
|
const getWorkspacePackageInfo_1 = require("../getWorkspacePackageInfo");
|
|
11
11
|
const logging_1 = require("../../logging");
|
|
12
12
|
/**
|
|
13
|
-
* Read the
|
|
13
|
+
* Read the monorepo root package.json and get the list of package globs from its `workspaces` property.
|
|
14
14
|
*/
|
|
15
|
-
function getPackages(
|
|
16
|
-
const packageJsonFile = path_1.default.join(
|
|
15
|
+
function getPackages(root) {
|
|
16
|
+
const packageJsonFile = path_1.default.join(root, "package.json");
|
|
17
17
|
let packageJson;
|
|
18
18
|
try {
|
|
19
19
|
packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonFile, "utf-8"));
|
|
@@ -30,58 +30,69 @@ function getPackages(packageJsonWorkspacesRoot) {
|
|
|
30
30
|
}
|
|
31
31
|
return workspaces.packages;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
|
|
35
|
+
* into absolute package paths. Returns an empty array if the `workspaces` property is not found or
|
|
36
|
+
* there's some other issue.
|
|
37
|
+
*/
|
|
38
|
+
function getPackagePathsFromWorkspaceRoot(root) {
|
|
34
39
|
try {
|
|
35
|
-
const packageGlobs = getPackages(
|
|
36
|
-
return packageGlobs ? (0, getPackagePaths_1.getPackagePaths)(
|
|
40
|
+
const packageGlobs = getPackages(root);
|
|
41
|
+
return packageGlobs ? (0, getPackagePaths_1.getPackagePaths)(root, packageGlobs) : [];
|
|
37
42
|
}
|
|
38
43
|
catch (err) {
|
|
39
|
-
(0, logging_1.logVerboseWarning)(`Error getting package paths for ${
|
|
44
|
+
(0, logging_1.logVerboseWarning)(`Error getting package paths for ${root}`, err);
|
|
40
45
|
return [];
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
48
|
exports.getPackagePathsFromWorkspaceRoot = getPackagePathsFromWorkspaceRoot;
|
|
44
49
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
50
|
+
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
|
|
51
|
+
* into absolute package paths. Returns an empty array if the `workspaces` property is not found or
|
|
52
|
+
* there's some other issue.
|
|
47
53
|
*/
|
|
48
|
-
async function getPackagePathsFromWorkspaceRootAsync(
|
|
54
|
+
async function getPackagePathsFromWorkspaceRootAsync(root) {
|
|
49
55
|
try {
|
|
50
|
-
const packageGlobs = getPackages(
|
|
51
|
-
return packageGlobs ? (0, getPackagePaths_1.getPackagePathsAsync)(
|
|
56
|
+
const packageGlobs = getPackages(root);
|
|
57
|
+
return packageGlobs ? (0, getPackagePaths_1.getPackagePathsAsync)(root, packageGlobs) : [];
|
|
52
58
|
}
|
|
53
59
|
catch (err) {
|
|
54
|
-
(0, logging_1.logVerboseWarning)(`Error getting package paths for ${
|
|
60
|
+
(0, logging_1.logVerboseWarning)(`Error getting package paths for ${root}`, err);
|
|
55
61
|
return [];
|
|
56
62
|
}
|
|
57
63
|
}
|
|
58
64
|
exports.getPackagePathsFromWorkspaceRootAsync = getPackagePathsFromWorkspaceRootAsync;
|
|
59
65
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
66
|
+
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
|
|
67
|
+
* into an array with names, paths, and package.json contents for each package (each "workspace"
|
|
68
|
+
* in npm/yarn/pnpm terms). Returns an empty array if there's any issue.
|
|
62
69
|
*/
|
|
63
|
-
function getWorkspaceInfoFromWorkspaceRoot(
|
|
70
|
+
function getWorkspaceInfoFromWorkspaceRoot(root) {
|
|
64
71
|
try {
|
|
65
|
-
const packagePaths = getPackagePathsFromWorkspaceRoot(
|
|
72
|
+
const packagePaths = getPackagePathsFromWorkspaceRoot(root);
|
|
66
73
|
return (0, getWorkspacePackageInfo_1.getWorkspacePackageInfo)(packagePaths);
|
|
67
74
|
}
|
|
68
75
|
catch (err) {
|
|
69
|
-
(0, logging_1.logVerboseWarning)(`Error getting workspace info for ${
|
|
76
|
+
(0, logging_1.logVerboseWarning)(`Error getting workspace info for ${root}`, err);
|
|
70
77
|
return [];
|
|
71
78
|
}
|
|
72
79
|
}
|
|
73
80
|
exports.getWorkspaceInfoFromWorkspaceRoot = getWorkspaceInfoFromWorkspaceRoot;
|
|
74
81
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
82
|
+
* Read the `workspaces` property the monorepo root package.json, then process the workspace globs
|
|
83
|
+
* into an array with names, paths, and package.json contents for each package (each "workspace"
|
|
84
|
+
* in npm/yarn/pnpm terms). Returns an empty array if there's any issue.
|
|
85
|
+
*
|
|
86
|
+
* NOTE: As of writing, this will start promises to read all package.json files in parallel,
|
|
87
|
+
* without direct concurrency control.
|
|
77
88
|
*/
|
|
78
|
-
async function getWorkspaceInfoFromWorkspaceRootAsync(
|
|
89
|
+
async function getWorkspaceInfoFromWorkspaceRootAsync(root) {
|
|
79
90
|
try {
|
|
80
|
-
const packagePaths = await getPackagePathsFromWorkspaceRootAsync(
|
|
91
|
+
const packagePaths = await getPackagePathsFromWorkspaceRootAsync(root);
|
|
81
92
|
return (0, getWorkspacePackageInfo_1.getWorkspacePackageInfoAsync)(packagePaths);
|
|
82
93
|
}
|
|
83
94
|
catch (err) {
|
|
84
|
-
(0, logging_1.logVerboseWarning)(`Error getting workspace info for ${
|
|
95
|
+
(0, logging_1.logVerboseWarning)(`Error getting workspace info for ${root}`, err);
|
|
85
96
|
return [];
|
|
86
97
|
}
|
|
87
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageJsonWorkspaces.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/packageJsonWorkspaces.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,2DAA8E;AAC9E,wEAAmG;AACnG,2CAAkD;AAWlD;;GAEG;AACH,SAAS,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"packageJsonWorkspaces.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/packageJsonWorkspaces.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,2DAA8E;AAC9E,wEAAmG;AACnG,2CAAkD;AAWlD;;GAEG;AACH,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,eAAe,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAExD,IAAI,WAAsC,CAAC;IAC3C,IAAI;QACF,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAA8B,CAAC;KAClG;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;KACrE;IAED,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;IAEnC,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC7B,OAAO,UAAU,CAAC;KACnB;IAED,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC,CAAC;KAC5G;IAED,OAAO,UAAU,CAAC,QAAQ,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACH,SAAgB,gCAAgC,CAAC,IAAY;IAC3D,IAAI;QACF,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO,YAAY,CAAC,CAAC,CAAC,IAAA,iCAAe,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAChE;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,mCAAmC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QAClE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,4EAQC;AAED;;;;GAIG;AACI,KAAK,UAAU,qCAAqC,CAAC,IAAY;IACtE,IAAI;QACF,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO,YAAY,CAAC,CAAC,CAAC,IAAA,sCAAoB,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACrE;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,mCAAmC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QAClE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,sFAQC;AAED;;;;GAIG;AACH,SAAgB,iCAAiC,CAAC,IAAY;IAC5D,IAAI;QACF,MAAM,YAAY,GAAG,gCAAgC,CAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAA,iDAAuB,EAAC,YAAY,CAAC,CAAC;KAC9C;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,oCAAoC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,8EAQC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,sCAAsC,CAAC,IAAY;IACvE,IAAI;QACF,MAAM,YAAY,GAAG,MAAM,qCAAqC,CAAC,IAAI,CAAC,CAAC;QACvE,OAAO,IAAA,sDAA4B,EAAC,YAAY,CAAC,CAAC;KACnD;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,oCAAoC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,wFAQC"}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { WorkspaceInfos } from "../../types/WorkspaceInfo";
|
|
2
|
+
import type { Catalogs } from "../../types/Catalogs";
|
|
3
|
+
/** @deprecated Use `getWorkspaceManagerRoot` */
|
|
3
4
|
export declare function getPnpmWorkspaceRoot(cwd: string): string;
|
|
4
|
-
/** Get
|
|
5
|
+
/** Get paths for each package ("workspace") in a pnpm monorepo. */
|
|
5
6
|
export declare function getWorkspacePackagePaths(cwd: string): string[];
|
|
6
7
|
/**
|
|
7
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
8
|
-
*
|
|
8
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
9
|
+
* in a pnpm monorepo.
|
|
9
10
|
*/
|
|
10
|
-
export declare function getPnpmWorkspaces(cwd: string):
|
|
11
|
+
export declare function getPnpmWorkspaces(cwd: string): WorkspaceInfos;
|
|
11
12
|
/**
|
|
12
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
13
|
-
*
|
|
13
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
14
|
+
* in a pnpm monorepo.
|
|
14
15
|
*/
|
|
15
|
-
export declare function getPnpmWorkspacesAsync(cwd: string): Promise<
|
|
16
|
+
export declare function getPnpmWorkspacesAsync(cwd: string): Promise<WorkspaceInfos>;
|
|
17
|
+
/**
|
|
18
|
+
* Get version catalogs if present.
|
|
19
|
+
* Returns undefined if there's no catalog, or any issue reading or parsing.
|
|
20
|
+
* @see https://pnpm.io/catalogs
|
|
21
|
+
*/
|
|
22
|
+
export declare function getPnpmCatalogs(cwd: string): Catalogs | undefined;
|
|
16
23
|
export { getPnpmWorkspaces as getWorkspaces };
|
|
17
24
|
export { getPnpmWorkspacesAsync as getWorkspacesAsync };
|
|
25
|
+
export { getPnpmCatalogs as getCatalogs };
|
|
@@ -3,14 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getWorkspacesAsync = exports.getWorkspaces = exports.getPnpmWorkspacesAsync = exports.getPnpmWorkspaces = exports.getWorkspacePackagePaths = exports.getPnpmWorkspaceRoot = void 0;
|
|
6
|
+
exports.getCatalogs = exports.getWorkspacesAsync = exports.getWorkspaces = exports.getPnpmCatalogs = exports.getPnpmWorkspacesAsync = exports.getPnpmWorkspaces = exports.getWorkspacePackagePaths = exports.getPnpmWorkspaceRoot = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const getPackagePaths_1 = require("../../getPackagePaths");
|
|
9
9
|
const getWorkspacePackageInfo_1 = require("../getWorkspacePackageInfo");
|
|
10
10
|
const readYaml_1 = require("../../lockfile/readYaml");
|
|
11
11
|
const logging_1 = require("../../logging");
|
|
12
12
|
const getWorkspaceManagerAndRoot_1 = require("./getWorkspaceManagerAndRoot");
|
|
13
|
-
|
|
13
|
+
function getPnpmWorkspaceRootAndYaml(cwd) {
|
|
14
|
+
const root = getPnpmWorkspaceRoot(cwd);
|
|
15
|
+
const pnpmWorkspacesFile = path_1.default.join(root, "pnpm-workspace.yaml");
|
|
16
|
+
return { root, workspaceYaml: (0, readYaml_1.readYaml)(pnpmWorkspacesFile) };
|
|
17
|
+
}
|
|
18
|
+
/** @deprecated Use `getWorkspaceManagerRoot` */
|
|
14
19
|
function getPnpmWorkspaceRoot(cwd) {
|
|
15
20
|
const root = (0, getWorkspaceManagerAndRoot_1.getWorkspaceManagerAndRoot)(cwd, undefined, "pnpm")?.root;
|
|
16
21
|
if (!root) {
|
|
@@ -19,13 +24,11 @@ function getPnpmWorkspaceRoot(cwd) {
|
|
|
19
24
|
return root;
|
|
20
25
|
}
|
|
21
26
|
exports.getPnpmWorkspaceRoot = getPnpmWorkspaceRoot;
|
|
22
|
-
/** Get
|
|
27
|
+
/** Get paths for each package ("workspace") in a pnpm monorepo. */
|
|
23
28
|
function getWorkspacePackagePaths(cwd) {
|
|
24
29
|
try {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const pnpmWorkspaces = (0, readYaml_1.readYaml)(pnpmWorkspacesFile);
|
|
28
|
-
return (0, getPackagePaths_1.getPackagePaths)(pnpmWorkspacesRoot, pnpmWorkspaces.packages);
|
|
30
|
+
const { root, workspaceYaml } = getPnpmWorkspaceRootAndYaml(cwd);
|
|
31
|
+
return (0, getPackagePaths_1.getPackagePaths)(root, workspaceYaml.packages);
|
|
29
32
|
}
|
|
30
33
|
catch (err) {
|
|
31
34
|
(0, logging_1.logVerboseWarning)(`Error getting pnpm workspace package paths for ${cwd}`, err);
|
|
@@ -34,8 +37,8 @@ function getWorkspacePackagePaths(cwd) {
|
|
|
34
37
|
}
|
|
35
38
|
exports.getWorkspacePackagePaths = getWorkspacePackagePaths;
|
|
36
39
|
/**
|
|
37
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
38
|
-
*
|
|
40
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
41
|
+
* in a pnpm monorepo.
|
|
39
42
|
*/
|
|
40
43
|
function getPnpmWorkspaces(cwd) {
|
|
41
44
|
try {
|
|
@@ -50,8 +53,8 @@ function getPnpmWorkspaces(cwd) {
|
|
|
50
53
|
exports.getPnpmWorkspaces = getPnpmWorkspaces;
|
|
51
54
|
exports.getWorkspaces = getPnpmWorkspaces;
|
|
52
55
|
/**
|
|
53
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
54
|
-
*
|
|
56
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
57
|
+
* in a pnpm monorepo.
|
|
55
58
|
*/
|
|
56
59
|
async function getPnpmWorkspacesAsync(cwd) {
|
|
57
60
|
try {
|
|
@@ -65,4 +68,27 @@ async function getPnpmWorkspacesAsync(cwd) {
|
|
|
65
68
|
}
|
|
66
69
|
exports.getPnpmWorkspacesAsync = getPnpmWorkspacesAsync;
|
|
67
70
|
exports.getWorkspacesAsync = getPnpmWorkspacesAsync;
|
|
71
|
+
/**
|
|
72
|
+
* Get version catalogs if present.
|
|
73
|
+
* Returns undefined if there's no catalog, or any issue reading or parsing.
|
|
74
|
+
* @see https://pnpm.io/catalogs
|
|
75
|
+
*/
|
|
76
|
+
function getPnpmCatalogs(cwd) {
|
|
77
|
+
try {
|
|
78
|
+
const { workspaceYaml } = getPnpmWorkspaceRootAndYaml(cwd);
|
|
79
|
+
if (!workspaceYaml.catalog && !workspaceYaml.catalogs) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
default: workspaceYaml.catalog,
|
|
84
|
+
named: workspaceYaml.catalogs,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
(0, logging_1.logVerboseWarning)(`Error getting pnpm catalogs for ${cwd}`, err);
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.getPnpmCatalogs = getPnpmCatalogs;
|
|
93
|
+
exports.getCatalogs = getPnpmCatalogs;
|
|
68
94
|
//# sourceMappingURL=pnpm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnpm.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/pnpm.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,2DAAwD;AAExD,wEAAmG;AACnG,sDAAmD;AACnD,2CAAkD;AAClD,6EAA0E;
|
|
1
|
+
{"version":3,"file":"pnpm.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/pnpm.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,2DAAwD;AAExD,wEAAmG;AACnG,sDAAmD;AACnD,2CAAkD;AAClD,6EAA0E;AAU1E,SAAS,2BAA2B,CAAC,GAAW;IAC9C,MAAM,IAAI,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;IAClE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,IAAA,mBAAQ,EAAoB,kBAAkB,CAAC,EAAE,CAAC;AA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AqC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,wDAQC;AAwBkC,oDAAkB;AAtBrD;;;;GAIG;AACH,SAAgB,eAAe,CAAC,GAAW;IACzC,IAAI;QACF,MAAM,EAAE,aAAa,EAAE,GAAG,2BAA2B,CAAC,GAAG,CAAC,CAAC;QAC3D,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;YACrD,OAAO,SAAS,CAAC;SAClB;QACD,OAAO;YACL,OAAO,EAAE,aAAa,CAAC,OAAO;YAC9B,KAAK,EAAE,aAAa,CAAC,QAAQ;SAC9B,CAAC;KACH;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,mCAAmC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QACjE,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAdD,0CAcC;AAI2B,sCAAW"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { WorkspaceInfos } from "../../types/WorkspaceInfo";
|
|
2
2
|
/** @deprecated Use getWorkspaceRoot */
|
|
3
3
|
export declare function getRushWorkspaceRoot(cwd: string): string;
|
|
4
|
-
/** Get
|
|
4
|
+
/** Get paths for each package ("workspace") in a rush monorepo. */
|
|
5
5
|
export declare function getWorkspacePackagePaths(cwd: string): string[];
|
|
6
6
|
/**
|
|
7
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
8
|
-
*
|
|
7
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
8
|
+
* in a rush monorepo.
|
|
9
9
|
*/
|
|
10
|
-
export declare function getRushWorkspaces(cwd: string):
|
|
10
|
+
export declare function getRushWorkspaces(cwd: string): WorkspaceInfos;
|
|
11
11
|
/**
|
|
12
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
13
|
-
*
|
|
12
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
13
|
+
* in a rush monorepo.
|
|
14
14
|
*/
|
|
15
|
-
export declare function getRushWorkspacesAsync(cwd: string): Promise<
|
|
15
|
+
export declare function getRushWorkspacesAsync(cwd: string): Promise<WorkspaceInfos>;
|
|
16
16
|
export { getRushWorkspaces as getWorkspaces };
|
|
17
17
|
export { getRushWorkspacesAsync as getWorkspacesAsync };
|
|
@@ -19,7 +19,7 @@ function getRushWorkspaceRoot(cwd) {
|
|
|
19
19
|
return root;
|
|
20
20
|
}
|
|
21
21
|
exports.getRushWorkspaceRoot = getRushWorkspaceRoot;
|
|
22
|
-
/** Get
|
|
22
|
+
/** Get paths for each package ("workspace") in a rush monorepo. */
|
|
23
23
|
function getWorkspacePackagePaths(cwd) {
|
|
24
24
|
try {
|
|
25
25
|
const rushWorkspaceRoot = getRushWorkspaceRoot(cwd);
|
|
@@ -35,8 +35,8 @@ function getWorkspacePackagePaths(cwd) {
|
|
|
35
35
|
}
|
|
36
36
|
exports.getWorkspacePackagePaths = getWorkspacePackagePaths;
|
|
37
37
|
/**
|
|
38
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
39
|
-
*
|
|
38
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
39
|
+
* in a rush monorepo.
|
|
40
40
|
*/
|
|
41
41
|
function getRushWorkspaces(cwd) {
|
|
42
42
|
try {
|
|
@@ -51,8 +51,8 @@ function getRushWorkspaces(cwd) {
|
|
|
51
51
|
exports.getRushWorkspaces = getRushWorkspaces;
|
|
52
52
|
exports.getWorkspaces = getRushWorkspaces;
|
|
53
53
|
/**
|
|
54
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
55
|
-
*
|
|
54
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
55
|
+
* in a rush monorepo.
|
|
56
56
|
*/
|
|
57
57
|
async function getRushWorkspacesAsync(cwd) {
|
|
58
58
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rush.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/rush.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,8CAAsB;AACtB,4CAAoB;AAGpB,wEAAmG;AACnG,2CAAkD;AAClD,6EAA0E;AAE1E,uCAAuC;AACvC,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,MAAM,IAAI,GAAG,IAAA,uDAA0B,EAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC;IACtE,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,0CAA0C,GAAG,GAAG,CAAC,CAAC;KACnE;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAND,oDAMC;AAED,
|
|
1
|
+
{"version":3,"file":"rush.js","sourceRoot":"","sources":["../../../src/workspaces/implementations/rush.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,8CAAsB;AACtB,4CAAoB;AAGpB,wEAAmG;AACnG,2CAAkD;AAClD,6EAA0E;AAE1E,uCAAuC;AACvC,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,MAAM,IAAI,GAAG,IAAA,uDAA0B,EAAC,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC;IACtE,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,0CAA0C,GAAG,GAAG,CAAC,CAAC;KACnE;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAND,oDAMC;AAED,mEAAmE;AACnE,SAAgB,wBAAwB,CAAC,GAAW;IAClD,IAAI;QACF,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC;QAE/D,MAAM,UAAU,GAAmD,aAAG,CAAC,KAAK,CAC1E,YAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CACvC,CAAC;QACF,MAAM,IAAI,GAAG,cAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QACxC,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;KACrF;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,kDAAkD,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QAChF,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAdD,4DAcC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,GAAW;IAC3C,IAAI;QACF,MAAM,YAAY,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;QACnD,OAAO,IAAA,iDAAuB,EAAC,YAAY,CAAC,CAAC;KAC9C;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,qCAAqC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,8CAQC;AAgB6B,0CAAa;AAd3C;;;GAGG;AACI,KAAK,UAAU,sBAAsB,CAAC,GAAW;IACtD,IAAI;QACF,MAAM,YAAY,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;QACnD,OAAO,IAAA,sDAA4B,EAAC,YAAY,CAAC,CAAC;KACnD;IAAC,OAAO,GAAG,EAAE;QACZ,IAAA,2BAAiB,EAAC,qCAAqC,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AARD,wDAQC;AAGkC,oDAAkB"}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { WorkspaceInfos } from "../../types/WorkspaceInfo";
|
|
2
|
+
import type { Catalogs } from "../../types/Catalogs";
|
|
3
|
+
/** @deprecated Use `getWorkspaceManagerRoot` */
|
|
3
4
|
export declare function getYarnWorkspaceRoot(cwd: string): string;
|
|
4
|
-
/** Get
|
|
5
|
+
/** Get paths for each package ("workspace") in a yarn monorepo. */
|
|
5
6
|
export declare function getWorkspacePackagePaths(cwd: string): string[];
|
|
6
|
-
/** Get
|
|
7
|
+
/** Get paths for each package ("workspace") in a yarn monorepo. */
|
|
7
8
|
export declare function getWorkspacePackagePathsAsync(cwd: string): Promise<string[]>;
|
|
8
9
|
/**
|
|
9
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
10
|
-
*
|
|
10
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
11
|
+
* in a yarn monorepo.
|
|
11
12
|
*/
|
|
12
|
-
export declare function getYarnWorkspaces(cwd: string):
|
|
13
|
+
export declare function getYarnWorkspaces(cwd: string): WorkspaceInfos;
|
|
13
14
|
/**
|
|
14
|
-
* Get an array with names, paths, and package.json contents for each package
|
|
15
|
-
*
|
|
15
|
+
* Get an array with names, paths, and package.json contents for each package ("workspace")
|
|
16
|
+
* in a yarn monorepo.
|
|
16
17
|
*/
|
|
17
|
-
export declare function getYarnWorkspacesAsync(cwd: string): Promise<
|
|
18
|
+
export declare function getYarnWorkspacesAsync(cwd: string): Promise<WorkspaceInfos>;
|
|
19
|
+
/**
|
|
20
|
+
* Get version catalogs if present.
|
|
21
|
+
* Returns undefined if there's no catalog, or any issue reading or parsing.
|
|
22
|
+
* @see https://yarnpkg.com/features/catalogs
|
|
23
|
+
*/
|
|
24
|
+
export declare function getYarnCatalogs(cwd: string): Catalogs | undefined;
|
|
18
25
|
export { getYarnWorkspaces as getWorkspaces };
|
|
19
26
|
export { getYarnWorkspacesAsync as getWorkspacesAsync };
|
|
27
|
+
export { getYarnCatalogs as getCatalogs };
|