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: Prerelease 8.1.0-alpha.6 #26671

Merged
merged 59 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0d9a4a6
Update CHANGELOG.md for v8.0.5 [skip ci]
storybook-bot Mar 28, 2024
b2091f0
Fix sourcemap generation in webpack react-docgen-loader
valentinpalkovic Mar 28, 2024
fdad84e
Fix parallelism for check and compile command on CI
valentinpalkovic Mar 28, 2024
663194c
Merge pull request #26678 from storybookjs/valentin/fix-ci-3
valentinpalkovic Mar 28, 2024
fec5def
Merge branch 'next' into valentin/fix-webpack-react-docgen-sourcemap-…
valentinpalkovic Mar 28, 2024
eba6ed9
Merge pull request #26676 from storybookjs/valentin/fix-webpack-react…
valentinpalkovic Mar 28, 2024
0772820
Ensure all matching notifications are cleared rather than just the fi…
ghengeveld Mar 30, 2024
123774c
Improve NotificationItem stories
ghengeveld Mar 30, 2024
e84cabe
Add duration property to Notification API, and show countdown bar
ghengeveld Mar 30, 2024
b00d4ee
Add slide in animation to notifications
ghengeveld Mar 30, 2024
7f1c4e0
Fix logging onClear handler
ghengeveld Mar 30, 2024
8338f59
Add missing property
ghengeveld Mar 30, 2024
908e92e
Add onClick property to notifications
ghengeveld Mar 30, 2024
d61bfd8
Use button element for clickable notification
ghengeveld Mar 30, 2024
b280b72
Verify callback functionality
ghengeveld Mar 31, 2024
aa6984a
Fix next/font transformation on Windows machines
valentinpalkovic Mar 31, 2024
4267475
Fix local next/fonts on Windows machines
valentinpalkovic Mar 31, 2024
e40d784
Escape . character in regex
valentinpalkovic Mar 31, 2024
e6bbb14
WIP: Update multiple components guidance
kylegach Mar 18, 2024
df0bf8b
Revert "WIP: Update multiple components guidance"
kylegach Mar 20, 2024
82e9f71
Update multiple components guidance
kylegach Mar 26, 2024
30e3954
Apply suggestions from code review
kylegach Apr 1, 2024
b8e46fe
Address feedback
kylegach Apr 1, 2024
b50c241
Merge pull request #26700 from storybookjs/valentin/fix-next-font-on-…
valentinpalkovic Apr 1, 2024
6957b50
Update postcss-loader in Next.js framework
valentinpalkovic Apr 1, 2024
2ef2c80
Update TypeScript
valentinpalkovic Apr 1, 2024
403fd8e
Fix issues after TypeScript update
valentinpalkovic Apr 1, 2024
88e5b0e
Add missing dependency
valentinpalkovic Apr 2, 2024
cddf8ce
Merge pull request #26708 from storybookjs/valentin/fix-next-1
valentinpalkovic Apr 2, 2024
555f719
Merge branch 'next' into valentin/update-postcss-dependency
valentinpalkovic Apr 2, 2024
43b4f0f
Merge branch 'next' into update-docs-multiple-components
jonniebigodes Apr 2, 2024
385f9b9
Update tests
ghengeveld Apr 2, 2024
6b773a6
Merge pull request #26544 from storybookjs/update-docs-multiple-compo…
kylegach Apr 2, 2024
f3c4e00
Remove .only modifier
ghengeveld Apr 2, 2024
9dc6fe3
Rename snippet
kylegach Apr 2, 2024
874e6a3
Merge pull request #26716 from storybookjs/docs-fix-html-snippet-file…
kylegach Apr 2, 2024
983e7a7
Merge branch 'next' into improve-notifications
ghengeveld Apr 2, 2024
65e6698
CLI: Add --config-dir flag to migrate command
yannbf Apr 3, 2024
3982b79
Merge pull request #26707 from storybookjs/valentin/update-postcss-de…
valentinpalkovic Apr 3, 2024
fbd2aaf
Merge pull request #26721 from storybookjs/yann/add-config-dir-flag-t…
yannbf Apr 3, 2024
d7e5d5a
Documentation: add migrate and automigrate to the CLI Options page
yannbf Apr 3, 2024
63254fd
Merge branch 'next' into improve-notifications
ghengeveld Apr 3, 2024
e0c5ff4
Merge pull request #26696 from storybookjs/improve-notifications
ghengeveld Apr 3, 2024
d77f72e
adjust docs based on review comments
yannbf Apr 4, 2024
5819511
Bump globby dependency
valentinpalkovic Apr 4, 2024
1b5acd2
Update lock files in kitchen sinks
valentinpalkovic Apr 4, 2024
176866d
Merge branch 'next' into yann/document-cli-flags
jonniebigodes Apr 4, 2024
e73525b
Merge pull request #26733 from storybookjs/valentin/update-globby
valentinpalkovic Apr 4, 2024
4c28d88
Bump es-module-lexer
valentinpalkovic Apr 4, 2024
0f5d130
Merge pull request #26737 from storybookjs/valentin/bump-lexers
valentinpalkovic Apr 4, 2024
4b1752d
Docs: Update Styling and CSS
jonniebigodes Apr 4, 2024
95f401f
Merge branch 'next' into yann/document-cli-flags
jonniebigodes Apr 4, 2024
68b8a65
Merge branch 'next' into docs_fix_styling
jonniebigodes Apr 4, 2024
2cf5571
Merge pull request #26741 from storybookjs/docs_fix_styling
jonniebigodes Apr 4, 2024
aeb9696
Merge branch 'next' into yann/document-cli-flags
jonniebigodes Apr 4, 2024
c1f50bd
minor adjustments for consistency
jonniebigodes Apr 4, 2024
928eed4
fix automigrate table
jonniebigodes Apr 4, 2024
0943cd4
Merge pull request #26724 from storybookjs/yann/document-cli-flags
jonniebigodes Apr 4, 2024
8c43be3
Write changelog for 8.1.0-alpha.6 [skip ci]
storybook-bot Apr 4, 2024
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 8.0.5

- Addon-docs: Fix `react-dom/server` imports breaking stories and docs - [#26557](https://github.com/storybookjs/storybook/pull/26557), thanks @JReinhold!
- Automigrations: Fix missing support for mts vite config - [#26441](https://github.com/storybookjs/storybook/pull/26441), thanks @drik98!
- CLI: Improve Yarn berry error parsing - [#26616](https://github.com/storybookjs/storybook/pull/26616), thanks @yannbf!
- React-Docgen: Make sure to be able to handle empty unions - [#26639](https://github.com/storybookjs/storybook/pull/26639), thanks @kasperpeulen!
- Viewport: Fix missing style - [#26530](https://github.com/storybookjs/storybook/pull/26530), thanks @jpzwarte!

## 8.0.4

- Addon Docs: Support Stencil based display names in source snippets - [#26592](https://github.com/storybookjs/storybook/pull/26592), thanks @yannbf!
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 8.1.0-alpha.6

- CLI: Add --config-dir flag to migrate command - [#26721](https://github.com/storybookjs/storybook/pull/26721), thanks @yannbf!
- Core: Add `duration` and `onClick` support to Notification API and improve Notification UI - [#26696](https://github.com/storybookjs/storybook/pull/26696), thanks @ghengeveld!
- Dependency: Bump es-module-lexer - [#26737](https://github.com/storybookjs/storybook/pull/26737), thanks @valentinpalkovic!
- Dependency: Update globby dependency - [#26733](https://github.com/storybookjs/storybook/pull/26733), thanks @valentinpalkovic!
- Dependency: Update postcss-loader in Next.js framework - [#26707](https://github.com/storybookjs/storybook/pull/26707), thanks @valentinpalkovic!
- Next.js: Fix next/font usage on Windows machines - [#26700](https://github.com/storybookjs/storybook/pull/26700), thanks @valentinpalkovic!
- Webpack: Fix sourcemap generation in webpack react-docgen-loader - [#26676](https://github.com/storybookjs/storybook/pull/26676), thanks @valentinpalkovic!

## 8.1.0-alpha.5

- Addon-docs: Fix `react-dom/server` imports breaking stories and docs - [#26557](https://github.com/storybookjs/storybook/pull/26557), thanks @JReinhold!
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 @@ -54,7 +54,7 @@
"@storybook/types": "workspace:*",
"@types/find-cache-dir": "^3.2.1",
"browser-assert": "^1.2.1",
"es-module-lexer": "^0.9.3",
"es-module-lexer": "^1.5.0",
"express": "^4.17.3",
"find-cache-dir": "^3.0.0",
"fs-extra": "^11.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ export async function injectExportOrderPlugin() {
// instead of calling `await parse()` every time.
const [, exports] = await parse(code);

if (exports.includes('__namedExportsOrder')) {
const exportNames = exports.map((e) => code.substring(e.s, e.e));

if (exportNames.includes('__namedExportsOrder')) {
// user has defined named exports already
return undefined;
}
const s = new MagicString(code);
const orderedExports = exports.filter((e) => e !== 'default');
const orderedExports = exportNames.filter((e) => e !== 'default');
s.append(`;export const __namedExportsOrder = ${JSON.stringify(orderedExports)};`);
return {
code: s.toString(),
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"cjs-module-lexer": "^1.2.3",
"constants-browserify": "^1.0.0",
"css-loader": "^6.7.1",
"es-module-lexer": "^1.4.1",
"es-module-lexer": "^1.5.0",
"express": "^4.17.3",
"fork-ts-checker-webpack-plugin": "^8.0.0",
"fs-extra": "^11.1.0",
Expand Down
4 changes: 2 additions & 2 deletions code/frameworks/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"loader-utils": "^3.2.1",
"node-polyfill-webpack-plugin": "^2.0.1",
"pnp-webpack-plugin": "^1.7.0",
"postcss": "^8.4.21",
"postcss-loader": "^7.0.2",
"postcss": "^8.4.38",
"postcss-loader": "^8.1.1",
"react-refresh": "^0.14.0",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^12.4.0",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/src/css/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const configureCss = (baseConfig: WebpackConfig, nextConfig: NextConfig):
],
// We transform the "target.css" files from next.js into Javascript
// for Next.js to support fonts, so it should be ignored by the css-loader.
exclude: /next\/.*\/target.css$/,
exclude: /next(\\|\/|\\\\).*(\\|\/|\\\\)target\.css$/,
};
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function configureNextFont(baseConfig: Configuration, isSWC?: boolean) {

if (isSWC) {
baseConfig.module?.rules?.push({
test: /next\/.*\/target.css$/,
test: /next(\\|\/|\\\\).*(\\|\/|\\\\)target\.css$/,
loader: fontLoaderPath,
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ export async function getFontFaceDeclarations(
.map(({ prop, value }: { prop: string; value: string }) => `${prop}: ${value};`)
.join('\n');

const arePathsWin32Format = /^[a-z]:\\/iu.test(options.filename);
const cleanWin32Path = (pathString: string): string =>
arePathsWin32Format ? pathString.replace(/\\/gu, '/') : pathString;

const getFontFaceCSS = () => {
if (typeof localFontSrc === 'string') {
const localFontPath = cleanWin32Path(path.join(parentFolder, localFontSrc));
const localFontPath = path.join(parentFolder, localFontSrc).replaceAll('\\', '/');

return `@font-face {
font-family: ${id};
Expand All @@ -55,7 +51,7 @@ export async function getFontFaceDeclarations(
}
return localFontSrc
.map((font) => {
const localFontPath = cleanWin32Path(path.join(parentFolder, font.path));
const localFontPath = path.join(parentFolder, font.path).replaceAll('\\', '/');

return `@font-face {
font-family: ${id};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getFontFaceDeclarations as getLocalFontFaceDeclarations } from './local
import type { LoaderOptions } from './types';
import { getCSSMeta } from './utils/get-css-meta';
import { setFontDeclarationsInHead } from './utils/set-font-declarations-in-head';
import path from 'path';

type FontFaceDeclaration = {
id: string;
Expand Down Expand Up @@ -39,11 +40,19 @@ export default async function storybookNextjsFontLoader(this: any) {

let fontFaceDeclaration: FontFaceDeclaration | undefined;

if (options.source.endsWith('next/font/google') || options.source.endsWith('@next/font/google')) {
const pathSep = path.sep;

if (
options.source.endsWith(`next${pathSep}font${pathSep}google`) ||
options.source.endsWith(`@next${pathSep}font${pathSep}google`)
) {
fontFaceDeclaration = await getGoogleFontFaceDeclarations(options);
}

if (options.source.endsWith('next/font/local') || options.source.endsWith('@next/font/local')) {
if (
options.source.endsWith(`next${pathSep}font${pathSep}local`) ||
options.source.endsWith(`@next${pathSep}font${pathSep}local`)
) {
fontFaceDeclaration = await getLocalFontFaceDeclarations(options, rootCtx, swcMode);
}

Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"fs-extra": "^11.1.0",
"get-npm-tarball-url": "^2.0.3",
"giget": "^1.0.0",
"globby": "^11.0.2",
"globby": "^14.0.1",
"jscodeshift": "^0.15.1",
"leven": "^3.1.0",
"ora": "^5.4.1",
Expand Down
4 changes: 3 additions & 1 deletion code/lib/cli/src/automigrate/fixes/mdx-1-to-3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import chalk from 'chalk';
import { dedent } from 'ts-dedent';
import { basename } from 'path';
import fse from 'fs-extra';
import globby from 'globby';
import type { Fix } from '../types';

const MDX1_STYLE_START = /<style>{`/g;
Expand Down Expand Up @@ -48,6 +47,9 @@ export const mdx1to3: Fix<Mdx1to3Options> = {
versionRange: ['<7.0.0', '>=8.0.0-alpha.0'],

async check() {
// Dynamically import globby because it is a pure ESM module
const { globby } = await import('globby');

const storiesMdxFiles = await globby('./!(node_modules)**/*.(story|stories).mdx');
return storiesMdxFiles.length ? { storiesMdxFiles } : null;
},
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/automigrate/fixes/mdx-gfm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { mdxgfm } from './mdx-gfm';

vi.mock('globby', () => ({
__esModule: true,
default: vi.fn().mockResolvedValue(['a/fake/file.mdx']),
globby: vi.fn().mockResolvedValue(['a/fake/file.mdx']),
}));

const check = async ({
Expand Down
6 changes: 4 additions & 2 deletions code/lib/cli/src/automigrate/fixes/mdx-gfm.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { dedent } from 'ts-dedent';
import { join } from 'path';
import slash from 'slash';
import glob from 'globby';
import { commonGlobOptions } from '@storybook/core-common';
import { updateMainConfig } from '../helpers/mainConfigFile';
import type { Fix } from '../types';
Expand Down Expand Up @@ -46,7 +45,10 @@ export const mdxgfm: Fix<Options> = {
return false;
}

const files = await glob(pattern, commonGlobOptions(pattern));
// Dynamically import globby because it is a pure ESM module
const { globby } = await import('globby');

const files = await globby(pattern, commonGlobOptions(pattern));

return files.some((f) => f.endsWith('.mdx'));
}, Promise.resolve(false));
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ command('migrate [migration]')
.option('-l --list', 'List available migrations')
.option('-g --glob <glob>', 'Glob for files upon which to apply the migration', '**/*.js')
.option('-p --parser <babel | babylon | flow | ts | tsx>', 'jscodeshift parser')
.option('-c, --config-dir <dir-name>', 'Directory where to load Storybook configurations from')
.option(
'-n --dry-run',
'Dry run: verify the migration exists and show the files to which it will be applied'
Expand All @@ -142,7 +143,6 @@ command('migrate [migration]')
list,
rename,
parser,
logger: consoleLogger,
}).catch((err) => {
logger.error(err);
process.exit(1);
Expand Down
29 changes: 24 additions & 5 deletions code/lib/cli/src/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,40 @@ import { getStorybookVersionSpecifier } from './helpers';

const logger = console;

export async function migrate(migration: any, { glob, dryRun, list, rename, parser }: any) {
type CLIOptions = {
glob: string;
configDir?: string;
dryRun?: boolean;
list?: string[];
/**
* Rename suffix of matching files after codemod has been applied, e.g. ".js:.ts"
*/
rename?: string;
/**
* jscodeshift parser
*/
parser?: 'babel' | 'babylon' | 'flow' | 'ts' | 'tsx';
};

export async function migrate(
migration: any,
{ glob, dryRun, list, rename, parser, configDir: userSpecifiedConfigDir }: CLIOptions
) {
if (list) {
listCodemods().forEach((key: any) => logger.log(key));
} else if (migration) {
if (migration === 'mdx-to-csf' && !dryRun) {
const packageManager = JsPackageManagerFactory.getPackageManager();

const [packageJson, storybookVersion] = await Promise.all([
//
packageManager.retrievePackageJson(),
getCoercedStorybookVersion(packageManager),
]);
const { configDir: inferredConfigDir, mainConfig: mainConfigPath } =
getStorybookInfo(packageJson);
const configDir = inferredConfigDir || '.storybook';
const { configDir: inferredConfigDir, mainConfig: mainConfigPath } = getStorybookInfo(
packageJson,
userSpecifiedConfigDir
);
const configDir = userSpecifiedConfigDir || inferredConfigDir || '.storybook';

// GUARDS
if (!storybookVersion) {
Expand Down
27 changes: 19 additions & 8 deletions code/lib/cli/src/warn.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import { describe, beforeEach, it, expect, vi } from 'vitest';
import globby from 'globby';
import { logger } from '@storybook/node-logger';
import { warn } from './warn';

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

const mocks = vi.hoisted(() => {
return {
globby: vi.fn(),
};
});

vi.mock('globby', async (importOriginal) => {
return {
...(await importOriginal<typeof import('globby')>()),
globby: mocks.globby,
};
});

describe('warn', () => {
beforeEach(() => {
Expand All @@ -21,17 +32,17 @@ describe('warn', () => {
});

describe('when TypeScript is not installed as a dependency', () => {
it('should not warn if `.tsx?` files are not found', () => {
vi.mocked(globby.sync).mockReturnValueOnce([]);
warn({
it('should not warn if `.tsx?` files are not found', async () => {
mocks.globby.mockResolvedValue([]);
await warn({
hasTSDependency: false,
});
expect(logger.warn).toHaveBeenCalledTimes(0);
});

it('should warn if `.tsx?` files are found', () => {
vi.mocked(globby.sync).mockReturnValueOnce(['a.ts']);
warn({
it('should warn if `.tsx?` files are found', async () => {
mocks.globby.mockResolvedValue(['a.ts']);
await warn({
hasTSDependency: false,
});
expect(logger.warn).toHaveBeenCalledTimes(2);
Expand Down
11 changes: 8 additions & 3 deletions code/lib/cli/src/warn.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import globby from 'globby';
import { logger } from '@storybook/node-logger';

interface Options {
hasTSDependency: boolean;
}

export const warn = ({ hasTSDependency }: Options) => {
export const warn = async ({ hasTSDependency }: Options) => {
if (!hasTSDependency) {
const hasTSFiles = !!globby.sync(['**/*.@(ts|tsx)', '!**/node_modules', '!**/*.d.ts']).length;
// Dynamically import globby because it is a pure ESM module
const { globby } = await import('globby');

const files = await globby(['**/*.@(ts|tsx)', '!**/node_modules', '!**/*.d.ts']);

const hasTSFiles = !!files.length;

if (hasTSFiles) {
logger.warn(
'We have detected TypeScript files in your project directory, however TypeScript is not listed as a project dependency.'
Expand Down
2 changes: 1 addition & 1 deletion code/lib/codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@storybook/types": "workspace:*",
"@types/cross-spawn": "^6.0.2",
"cross-spawn": "^7.0.3",
"globby": "^11.0.2",
"globby": "^14.0.1",
"jscodeshift": "^0.15.1",
"lodash": "^4.17.21",
"prettier": "^3.1.1",
Expand Down
4 changes: 3 additions & 1 deletion code/lib/codemod/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import fs from 'fs';
import path from 'path';
import { promisify } from 'util';
import globby from 'globby';
import { sync as spawnSync } from 'cross-spawn';
import { jscodeshiftToPrettierParser } from './lib/utils';

Expand Down Expand Up @@ -63,6 +62,9 @@ export async function runCodemod(
if (knownParser !== 'babel') inferredParser = extension;
}

// Dynamically import globby because it is a pure ESM module
const { globby } = await import('globby');

const files = await globby([glob, '!**/node_modules', '!**/dist']);
const extensions = new Set(files.map((file) => path.extname(file).slice(1)));
const commaSeparatedExtensions = Array.from(extensions).join(',');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, beforeEach, it, expect, vi } from 'vitest';
import dedent from 'ts-dedent';
import { Yarn2Proxy } from './Yarn2Proxy';

describe('Yarn 2 Proxy', () => {
Expand Down
7 changes: 5 additions & 2 deletions code/lib/core-common/src/js-package-manager/Yarn2Proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const CRITICAL_YARN2_ERROR_CODES = {
YN0083: 'AUTOMERGE_GIT_ERROR',
};

// @ts-expect-error The error codes might be helpful in the future
const YARN2_ERROR_CODES = {
...CRITICAL_YARN2_ERROR_CODES,
YN0000: 'UNNAMED',
Expand Down Expand Up @@ -306,10 +307,12 @@ export class Yarn2Proxy extends JsPackageManager {
while ((match = regex.exec(logs)) !== null) {
const code = match[1];
const message = match[2].replace(/[┌│└]/g, '').trim();
if (CRITICAL_YARN2_ERROR_CODES[code]) {
if (code in CRITICAL_YARN2_ERROR_CODES) {
errorCodesWithMessages.push({
code,
message: `${CRITICAL_YARN2_ERROR_CODES[code]}\n-> ${message}\n`,
message: `${
CRITICAL_YARN2_ERROR_CODES[code as keyof typeof CRITICAL_YARN2_ERROR_CODES]
}\n-> ${message}\n`,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"detect-port": "^1.3.0",
"express": "^4.17.3",
"fs-extra": "^11.1.0",
"globby": "^11.0.2",
"globby": "^14.0.1",
"ip": "^2.0.1",
"lodash": "^4.17.21",
"open": "^8.4.0",
Expand Down
Loading