-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split setSpawnParams into separate setRuntimeMetadata and setBuildCom…
…mand steps and pass runtimeMetadata to AnnounceBuild mutation
- Loading branch information
1 parent
ceb8500
commit a864a21
Showing
12 changed files
with
195 additions
and
109 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 |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import { parseNr, getCliCommand, parseNa } from '@antfu/ni'; | ||
import { execa } from 'execa'; | ||
|
||
// 'npm' | 'pnpm' | 'yarn' | 'bun' | ||
export const getPackageManagerName = async () => { | ||
return getCliCommand(parseNa, [], { programmatic: true }) as any; | ||
return getCliCommand(parseNa, [], { programmatic: true }); | ||
}; | ||
|
||
// e.g. `npm run build-storybook` | ||
export const getPackageManagerRunCommand = async (args: string[]) => { | ||
return getCliCommand(parseNr, args, { programmatic: true }); | ||
}; | ||
|
||
// e.g. `8.19.2` | ||
export const getPackageManagerVersion = async (packageManager: string) => { | ||
const { stdout } = await execa(packageManager || (await getPackageManagerName()), ['--version']); | ||
const [output] = (stdout.toString() as string).trim().split('\n', 1); | ||
return output.trim().replace(/^v/, ''); | ||
}; |
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
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
Oops, something went wrong.