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

Build: Maintenance #29526

Closed
wants to merge 11 commits into from
Closed
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
894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.3.0.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ compressionLevel: mixed
enableGlobalCache: false

installStatePath: ./.yarn/root-install-state.gz
yarnPath: .yarn/releases/yarn-4.5.1.cjs

nodeLinker: node-modules

npmPublishAccess: public

yarnPath: .yarn/releases/yarn-4.3.0.cjs
1 change: 1 addition & 0 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ module.exports = {
],
rules: {
'import/no-extraneous-dependencies': 'off',
'react/prop-types': 'off',
},
},
{
Expand Down
3 changes: 1 addition & 2 deletions code/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ compressionLevel: 0
enableGlobalCache: true

installStatePath: ../.yarn/code-install-state.gz
yarnPath: ../.yarn/releases/yarn-4.5.1.cjs

logFilters:
- code: YN0005
Expand Down Expand Up @@ -35,7 +36,5 @@ supportedArchitectures:

unsafeHttpWhitelist:
- localhost

yarnPath: ../.yarn/releases/yarn-4.3.0.cjs
# Sometimes you get a "The remote archive doesn't match the expected checksum" error, uncommenting this line will fix it
# checksumBehavior: 'update'
4 changes: 2 additions & 2 deletions code/addons/a11y/src/components/VisionSimulator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ const getFilter = (filterName: string) => {
return `url('#${filterName}')`;
};

const Hidden = styled.div(() => ({
const Hidden = styled.div({
'&, & svg': {
position: 'absolute',
width: 0,
height: 0,
},
}));
});

const ColorIcon = styled.span<{ filter: string }>(
{
Expand Down
4 changes: 1 addition & 3 deletions code/addons/backgrounds/src/components/Tool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { PARAM_KEY as KEY } from '../constants';
import { DEFAULT_BACKGROUNDS } from '../defaults';
import type { Background, BackgroundMap, Config, GlobalStateUpdate } from '../types';

type Link = Parameters<typeof TooltipLinkList>['0']['links'][0];

export const BackgroundTool = memo(function BackgroundSelector() {
const config = useParameter<Config>(KEY);
const [globals, updateGlobals, storyGlobals] = useGlobals();
Expand Down Expand Up @@ -114,7 +112,7 @@ const Pure = memo(function PureTool(props: PureProps) {
},
]
: []),
...Object.entries(backgroundMap).map<Link>(([k, value]) => ({
...Object.entries(backgroundMap).map(([k, value]) => ({
id: k,
title: value.name,
icon: <CircleIcon color={value?.value || 'grey'} />,
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"rehype-external-links": "^3.0.0",
"rehype-slug": "^6.0.0",
"typescript": "^5.3.2",
"vite": "^4.0.4"
"vite": "^5.4.10"
},
"peerDependencies": {
"storybook": "workspace:^"
Expand Down
40 changes: 20 additions & 20 deletions code/addons/docs/src/compiler/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ describe('mdx3', () => {
function _createMdxContent(props) {
return _jsx("style", {
children: \`
h1 {
color: blue;
}
h1 {
color: blue;
}
\`
});
}
Expand Down Expand Up @@ -645,23 +645,23 @@ describe('docs-mdx-compiler-plugin', () => {
title: "Example/Introduction"
}), "\\n", _jsx("style", {
children: \`
.subheading {
--mediumdark: '#999999';
font-weight: 900;
font-size: 13px;
color: #999;
letter-spacing: 6px;
line-height: 24px;
text-transform: uppercase;
margin-bottom: 12px;
margin-top: 40px;
}
.link-list {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr 1fr;
row-gap: 10px;
}
.subheading {
--mediumdark: '#999999';
font-weight: 900;
font-size: 13px;
color: #999;
letter-spacing: 6px;
line-height: 24px;
text-transform: uppercase;
margin-bottom: 12px;
margin-top: 40px;
}
.link-list {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr 1fr;
row-gap: 10px;
}
\`
})]
});
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"devDependencies": {
"@devtools-ds/object-inspector": "^1.1.2",
"@storybook/icons": "^1.2.5",
"@storybook/icons": "^1.2.12",
"@types/node": "^22.0.0",
"ansi-to-html": "^0.7.2",
"formik": "^2.2.9",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/interactions/src/components/Interaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import { MatcherResult } from './MatcherResult';
import { MethodCall } from './MethodCall';
import { StatusIcon } from './StatusIcon';

const MethodCallWrapper = styled.div(() => ({
const MethodCallWrapper = styled.div({
fontFamily: typography.fonts.mono,
fontSize: typography.size.s1,
overflowWrap: 'break-word',
inlineSize: 'calc( 100% - 40px )',
}));
});

const RowContainer = styled('div', {
shouldForwardProp: (prop) => !['call', 'pausedAt'].includes(prop.toString()),
Expand Down
4 changes: 2 additions & 2 deletions code/addons/onboarding/src/components/List/List.styled.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { styled } from 'storybook/internal/theming';

export const ListWrapper = styled.ul(() => ({
export const ListWrapper = styled.ul({
display: 'flex',
flexDirection: 'column',
rowGap: 16,
padding: 0,
margin: 0,
}));
});
4 changes: 2 additions & 2 deletions code/addons/test/src/components/Interaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import { MatcherResult } from './MatcherResult';
import { MethodCall } from './MethodCall';
import { StatusIcon } from './StatusIcon';

const MethodCallWrapper = styled.div(() => ({
const MethodCallWrapper = styled.div({
fontFamily: typography.fonts.mono,
fontSize: typography.size.s1,
overflowWrap: 'break-word',
inlineSize: 'calc( 100% - 40px )',
}));
});

const RowContainer = styled('div', {
shouldForwardProp: (prop) => !['call', 'pausedAt'].includes(prop.toString()),
Expand Down
1 change: 1 addition & 0 deletions code/addons/test/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type StorybookTheme, useTheme } from 'storybook/internal/theming';

import Filter from 'ansi-to-html';
// eslint-disable-next-line depend/ban-dependencies
import stripAnsi from 'strip-ansi';

export function isTestAssertionError(error: unknown) {
Expand Down
50 changes: 25 additions & 25 deletions code/addons/viewport/src/components/Tool.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { type FC, Fragment, useCallback, useEffect, useState } from 'react';

import { IconButton, TooltipLinkList, WithTooltip } from 'storybook/internal/components';
import { IconButton, type Link, TooltipLinkList, WithTooltip } from 'storybook/internal/components';
import { type API, useGlobals, useParameter } from 'storybook/internal/manager-api';
import { Global } from 'storybook/internal/theming';

Expand Down Expand Up @@ -32,8 +32,6 @@ interface PureProps {
height: string;
}

type Link = Parameters<typeof TooltipLinkList>['0']['links'][0];

export const ViewportTool: FC<{ api: API }> = ({ api }) => {
const config = useParameter<Config>(KEY);
const [globals, updateGlobals, storyGlobals] = useGlobals();
Expand Down Expand Up @@ -116,29 +114,31 @@ const Pure = React.memo(function PureTool(props: PureProps) {
tooltip={({ onHide }) => (
<TooltipLinkList
links={[
...(length > 0 && item !== responsiveViewport
? [
{
id: 'reset',
title: 'Reset viewport',
icon: <RefreshIcon />,
onClick: () => {
update({ value: undefined, isRotated: false });
onHide();
[
...(length > 0 && item !== responsiveViewport
? [
{
id: 'reset',
title: 'Reset viewport',
icon: <RefreshIcon />,
onClick: () => {
update({ value: undefined, isRotated: false });
onHide();
},
},
},
]
: []),
...Object.entries(viewportMap).map<Link>(([k, value]) => ({
id: k,
title: value.name,
icon: iconsMap[value.type],
active: k === viewportName,
onClick: () => {
update({ value: k, isRotated: false });
onHide();
},
})),
]
: []),
...Object.entries(viewportMap).map(([k, value]) => ({
id: k,
title: value.name,
icon: iconsMap[value.type],
active: k === viewportName,
onClick: () => {
update({ value: k, isRotated: false });
onHide();
},
})),
],
]}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"polka": "^1.0.0-next.28",
"sirv": "^2.0.4",
"slash": "^5.0.0",
"vite": "^4.0.4"
"vite": "^5.4.10"
},
"peerDependencies": {
"storybook": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions code/builders/builder-vite/src/vite-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export type PluginConfigType = 'build' | 'development';
const configEnvServe: ConfigEnv = {
mode: 'development',
command: 'serve',
ssrBuild: false,
isSsrBuild: false,
};

const configEnvBuild: ConfigEnv = {
mode: 'production',
command: 'build',
ssrBuild: false,
isSsrBuild: false,
};

// Vite config that is common to development and production mode
Expand Down
4 changes: 2 additions & 2 deletions code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
"get-npm-tarball-url": "^2.0.3",
"glob": "^10.0.0",
"globby": "^14.0.1",
"jiti": "^1.21.6",
"jiti": "^2.4.0",
"js-yaml": "^4.1.0",
"lazy-universal-dotenv": "^4.0.0",
"leven": "^4.0.0",
Expand All @@ -382,7 +382,7 @@
"picoquery": "^1.4.0",
"polished": "^4.2.2",
"polka": "^1.0.0-next.28",
"prettier": "^3.2.5",
"prettier": "^3.3.3",
"pretty-hrtime": "^1.0.3",
"prompts": "^2.4.0",
"react": "^18.2.0",
Expand Down
6 changes: 3 additions & 3 deletions code/core/scripts/helpers/sourcefiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ async function generateVersionsFile(prettierConfig: prettier.Options | null): Pr

const versions = JSON.stringify(
workspace
.sort((a, b) => a.path.localeCompare(b.path))
.sort((a, b) => a!.path.localeCompare(b!.path))
.reduce<Record<string, string>>((acc, i) => {
if (i.publishConfig && i.publishConfig.access === 'public') {
acc[i.name] = i.version;
if (i!.publishConfig && i!.publishConfig.access === 'public') {
acc[i!.name] = i!.version;
}
return acc;
}, {})
Expand Down
32 changes: 19 additions & 13 deletions code/core/src/cli/detect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,25 @@ vi.mock('./helpers', () => ({
isNxProject: vi.fn(),
}));

vi.mock('fs', () => ({
existsSync: vi.fn(),
stat: vi.fn(),
lstat: vi.fn(),
access: vi.fn(),
realpathSync: vi.fn(),
lstatSync: vi.fn(),
readdir: vi.fn(),
readdirSync: vi.fn(),
readlinkSync: vi.fn(),
default: vi.fn(),
mkdirSync: vi.fn(),
}));
vi.mock('fs', async (importOriginal) => {
const actual = await importOriginal<any>();

const exported = {
...actual,
existsSync: vi.fn(),
stat: vi.fn(),
lstat: vi.fn(),
access: vi.fn(),
realpathSync: vi.fn(),
lstatSync: vi.fn(),
readdir: vi.fn(),
readdirSync: vi.fn(),
readlinkSync: vi.fn(),
default: vi.fn(),
mkdirSync: vi.fn(),
};
return { default: { ...actual.default, ...exported }, ...exported };
});

vi.mock('@storybook/core/node-logger');

Expand Down
3 changes: 2 additions & 1 deletion code/core/src/manager-api/modules/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ export const init: ModuleFn<SubAPI, SubState> = ({
return undefined;
}
if (refId) {
// @ts-expect-error (possibly undefined)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore-error (possibly undefined)
return refs[refId].index ? refs[refId].index[storyId] : undefined;
}
return index ? index[storyId] : undefined;
Expand Down
1 change: 1 addition & 0 deletions code/core/src/manager/globals/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default {
'StrictMode',
'Suspense',
'__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED',
'act',
'cloneElement',
'createContext',
'createElement',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/prop-types */
import React from 'react';

import { Rubik_Puddles } from 'next/font/google';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/prop-types */
import React from 'react';

import Link from 'next/link';
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/preact-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"devDependencies": {
"@types/node": "^22.0.0",
"typescript": "^5.3.2",
"vite": "^4.0.0"
"vite": "^5.4.10"
},
"peerDependencies": {
"preact": ">=10",
Expand Down
Loading