Skip to content

Commit 19e89c1

Browse files
author
ziyi.hzy
committed
feat: support max two level packages
1 parent e2e82e8 commit 19e89c1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pri",
3-
"version": "4.2.0-beta",
3+
"version": "4.2.0-beta.1",
44
"types": "src/node/index.ts",
55
"main": "built/node/index.js",
66
"scripts": {

src/utils/global-state.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ function getPriConfig(rootPath: string) {
7272
return fs.readJsonSync(configFilePath, { throws: false }) || {};
7373
}
7474

75-
function collectPackages(packageRootPath: string) {
75+
function collectPackages(packageRootPath: string, deep = 0) {
76+
// Only support two level packages
77+
if (deep >= 2) {
78+
return;
79+
}
80+
7681
const currentPackagesPath = path.join(packageRootPath, PACKAGES_NAME);
7782

7883
if (fs.existsSync(currentPackagesPath)) {
@@ -100,7 +105,7 @@ function collectPackages(packageRootPath: string) {
100105
globalState.packages.push(eachPackage);
101106

102107
// find nested packages
103-
collectPackages(eachPackage.rootPath);
108+
collectPackages(eachPackage.rootPath, deep + 1);
104109
});
105110
}
106111
}

0 commit comments

Comments
 (0)