Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Patch 7.4.6 #24352

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/generate-sandboxes-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 7.4.6

- CLI: Fix Nextjs project detection - [#24346](https://github.com/storybookjs/storybook/pull/24346), thanks [@yannbf](https://github.com/yannbf)!
- Core: Fix missing favicon during dev - [#24356](https://github.com/storybookjs/storybook/pull/24356), thanks [@ndelangen](https://github.com/ndelangen)!

## 7.4.5

- UI: Fix infinite hook call causing browsers to freeze - [#24291](https://github.com/storybookjs/storybook/pull/24291), thanks [@yannbf](https://github.com/yannbf)!
Expand Down
9 changes: 1 addition & 8 deletions code/lib/cli/src/project_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
},
Expand Down
2 changes: 0 additions & 2 deletions code/lib/core-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"prompts": "^2.4.0",
"read-pkg-up": "^7.0.1",
"semver": "^7.3.7",
"serve-favicon": "^2.5.0",
"telejson": "^7.2.0",
"tiny-invariant": "^1.3.1",
"ts-dedent": "^2.0.0",
Expand All @@ -108,7 +107,6 @@
"@types/compression": "^1.7.0",
"@types/ip": "^1.1.0",
"@types/node-fetch": "^2.5.7",
"@types/serve-favicon": "^2.5.2",
"@types/ws": "^8",
"boxen": "^5.1.2",
"jest-os-detection": "^1.3.1",
Expand Down
8 changes: 4 additions & 4 deletions code/lib/core-server/src/utils/server-statics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import type { Options, StorybookConfig } from '@storybook/types';
import { getDirectoryFromWorkingDir } from '@storybook/core-common';
import { ConflictingStaticDirConfigError } from '@storybook/core-events/server-errors';
import chalk from 'chalk';
import type { Router } from 'express';
import express from 'express';
import { pathExists } from 'fs-extra';
import path from 'path';
import favicon from 'serve-favicon';
import path, { basename } from 'path';
import isEqual from 'lodash/isEqual.js';

import { dedent } from 'ts-dedent';
import { defaultStaticDirs } from './constants';

export async function useStatics(router: any, options: Options) {
export async function useStatics(router: Router, options: Options) {
const staticDirs =
(await options.presets.apply<StorybookConfig['staticDirs']>('staticDirs')) ?? [];
const faviconPath = await options.presets.apply<string>('favicon');
Expand Down Expand Up @@ -54,7 +54,7 @@ export async function useStatics(router: any, options: Options) {
);
}

router.use(favicon(faviconPath));
router.get(`/${basename(faviconPath)}`, (req, res) => res.sendFile(faviconPath));
}

export const parseStaticDir = async (arg: string) => {
Expand Down
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,5 +327,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "7.4.6"
}
38 changes: 0 additions & 38 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6788,7 +6788,6 @@ __metadata:
"@types/node-fetch": ^2.5.7
"@types/pretty-hrtime": ^1.0.0
"@types/semver": ^7.3.4
"@types/serve-favicon": ^2.5.2
"@types/ws": ^8
better-opn: ^3.0.2
boxen: ^5.1.2
Expand All @@ -6809,7 +6808,6 @@ __metadata:
prompts: ^2.4.0
read-pkg-up: ^7.0.1
semver: ^7.3.7
serve-favicon: ^2.5.0
slash: ^5.0.0
telejson: ^7.2.0
tiny-invariant: ^1.3.1
Expand Down Expand Up @@ -9370,15 +9368,6 @@ __metadata:
languageName: node
linkType: hard

"@types/serve-favicon@npm:^2.5.2":
version: 2.5.4
resolution: "@types/serve-favicon@npm:2.5.4"
dependencies:
"@types/express": "*"
checksum: 60bb648eff8bba7f589e9a2027879c39c137c96e1afafb6a09cb220477c1ebe74c3ce4293c52724592f04e3278950b82741f449c8517a432c163107333a0d6b8
languageName: node
linkType: hard

"@types/serve-index@npm:^1.9.1":
version: 1.9.1
resolution: "@types/serve-index@npm:1.9.1"
Expand Down Expand Up @@ -23034,13 +23023,6 @@ __metadata:
languageName: node
linkType: hard

"ms@npm:2.1.1":
version: 2.1.1
resolution: "ms@npm:2.1.1"
checksum: 056140c631e740369fa21142417aba1bd629ab912334715216c666eb681c8f015c622dd4e38bc1d836b30852b05641331661703af13a0397eb0ca420fc1e75d9
languageName: node
linkType: hard

"ms@npm:2.1.2":
version: 2.1.2
resolution: "ms@npm:2.1.2"
Expand Down Expand Up @@ -27719,13 +27701,6 @@ __metadata:
languageName: node
linkType: hard

"safe-buffer@npm:5.1.1":
version: 5.1.1
resolution: "safe-buffer@npm:5.1.1"
checksum: 1c233bd105deeba3c9a8911ed4ec24ba45adbb51fec02f7944a10a202c38e3df4ef2b524bdeb55f2e4f8c77c13b2959e2e2e6022e5d99acdd70633b5f7e138cf
languageName: node
linkType: hard

"safe-buffer@npm:5.1.2, safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1":
version: 5.1.2
resolution: "safe-buffer@npm:5.1.2"
Expand Down Expand Up @@ -28037,19 +28012,6 @@ __metadata:
languageName: node
linkType: hard

"serve-favicon@npm:^2.5.0":
version: 2.5.0
resolution: "serve-favicon@npm:2.5.0"
dependencies:
etag: ~1.8.1
fresh: 0.5.2
ms: 2.1.1
parseurl: ~1.3.2
safe-buffer: 5.1.1
checksum: 7244ced3c46f8dfde591dc801f1e21ebc8fa07c4870cbbaee3ce37104b3aad32858e674e251a8ed4837867ea0dd67cb734b485ae5a7b0895cb6022f8b8c79303
languageName: node
linkType: hard

"serve-index@npm:^1.9.1":
version: 1.9.1
resolution: "serve-index@npm:1.9.1"
Expand Down
2 changes: 1 addition & 1 deletion docs/versions/latest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"7.4.5","info":{"plain":"- UI: Fix infinite hook call causing browsers to freeze - [#24291](https://github.com/storybookjs/storybook/pull/24291), thanks [@yannbf](https://github.com/yannbf)!"}}
{"version":"7.4.6","info":{"plain":"- CLI: Fix Nextjs project detection - [#24346](https://github.com/storybookjs/storybook/pull/24346), thanks [@yannbf](https://github.com/yannbf)!\n- Core: Fix missing favicon during dev - [#24356](https://github.com/storybookjs/storybook/pull/24356), thanks [@ndelangen](https://github.com/ndelangen)!"}}
4 changes: 4 additions & 0 deletions scripts/sandbox/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down