mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-10 00:12:22 +08:00
Fix Nextjs project detection
This commit is contained in:
parent
c1b33d8118
commit
6ee8dcadba
@ -43,7 +43,7 @@ jobs:
|
||||
run: yarn wait-on http://localhost:6001
|
||||
working-directory: ./code
|
||||
- name: Generate
|
||||
run: yarn generate-sandboxes --local-registry --exclude=angular-cli/prerelease
|
||||
run: yarn generate-sandboxes --local-registry --exclude=angular-cli/prerelease --debug
|
||||
working-directory: ./code
|
||||
- name: Publish
|
||||
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=next
|
||||
|
@ -5,11 +5,6 @@ function ltMajor(versionRange: string, major: number) {
|
||||
return validRange(versionRange) && minVersion(versionRange).major < major;
|
||||
}
|
||||
|
||||
function gtMajor(versionRange: string, major: number) {
|
||||
// Uses validRange to avoid a throw from minVersion if an invalid range gets passed
|
||||
return validRange(versionRange) && minVersion(versionRange).major > major;
|
||||
}
|
||||
|
||||
function eqMajor(versionRange: string, major: number) {
|
||||
// Uses validRange to avoid a throw from minVersion if an invalid range gets passed
|
||||
return validRange(versionRange) && minVersion(versionRange).major === major;
|
||||
@ -162,9 +157,7 @@ export const supportedTemplates: TemplateConfiguration[] = [
|
||||
},
|
||||
{
|
||||
preset: ProjectType.NEXTJS,
|
||||
dependencies: {
|
||||
next: (versionRange) => eqMajor(versionRange, 9) || gtMajor(versionRange, 9),
|
||||
},
|
||||
dependencies: ['next'],
|
||||
matcherFunction: ({ dependencies }) => {
|
||||
return dependencies.every(Boolean);
|
||||
},
|
||||
|
@ -125,6 +125,10 @@ const runGenerators = async (
|
||||
localRegistry = true,
|
||||
debug = false
|
||||
) => {
|
||||
if (debug) {
|
||||
console.log('Debug mode enabled. Verbose logs will be printed to the console.');
|
||||
}
|
||||
|
||||
console.log(`🤹♂️ Generating sandboxes with a concurrency of ${maxConcurrentTasks}`);
|
||||
|
||||
const limit = pLimit(maxConcurrentTasks);
|
||||
|
Loading…
x
Reference in New Issue
Block a user