-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
851a862
commit 67539ad
Showing
7 changed files
with
234 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@hyperse/hyper-env": patch | ||
--- | ||
|
||
refactor `next-standalone` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { Options } from 'globby'; | ||
import { globby } from 'globby'; | ||
import { existsSync } from 'node:fs'; | ||
import { join } from 'node:path'; | ||
|
||
export const fileWalk = ( | ||
pattern: string | readonly string[], | ||
options: Options = {} | ||
): Promise<string[]> => { | ||
const ignorePattern = options.ignore || []; | ||
return globby(pattern, { | ||
absolute: false, | ||
dot: true, | ||
unique: true, | ||
...options, | ||
ignore: [...ignorePattern, '**/__MACOSX/**', '**/*.DS_Store'], | ||
}); | ||
}; | ||
|
||
/** | ||
* A monorepo (mono repository) is a single repository that stores all of your code and assets for every project. | ||
* @param cwd normally it always process.cwd() | ||
*/ | ||
export const isMonorepo = async (cwd: string = process.cwd()) => { | ||
const monoPackageCwd = join(cwd, 'packages'); | ||
if (existsSync(monoPackageCwd)) { | ||
const packageJson = await fileWalk(join(monoPackageCwd, '*/package.json'), { | ||
cwd, | ||
}); | ||
return packageJson.length > 0; | ||
} | ||
return false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.