Fix Nextjs project detection

This commit is contained in:
Yann Braga 2023-10-03 09:11:40 +02:00
parent c1b33d8118
commit 6ee8dcadba
3 changed files with 6 additions and 9 deletions

View File

@ -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

View File

@ -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);
},

View File

@ -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);