Skip to content

Commit

Permalink
Merge branch 'storybookjs:next' into issue-29122
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreySinha02 committed Sep 24, 2024
2 parents 9f81ec0 + 9c116c5 commit ab7139e
Show file tree
Hide file tree
Showing 103 changed files with 321 additions and 196 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 8.3.3

- CLI: Show constraints in error when getting depndencies - [#29187](https://github.com/storybookjs/storybook/pull/29187), thanks @andrasczeh!
- React-Vite: Downgrade react-docgen-typescript plugin - [#29184](https://github.com/storybookjs/storybook/pull/29184), thanks @shilman!
- UI: Fix composed storybook TooltipLinkList bug where href isn't passed forward - [#29175](https://github.com/storybookjs/storybook/pull/29175), thanks @JSMike!

## 8.3.2

- CLI: Fix skip-install for stable latest releases - [#29133](https://github.com/storybookjs/storybook/pull/29133), thanks @valentinpalkovic!
- Core: Do not add packageManager field to package.json during `storybook dev` - [#29152](https://github.com/storybookjs/storybook/pull/29152), thanks @valentinpalkovic!

## 8.3.1

- Angular: Fix sourceDecorator to apply excludeDecorators flag - [#29069](https://github.com/storybookjs/storybook/pull/29069), thanks @JSMike!
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 8.4.0-alpha.1

- Addon Test: Support story name as test description - [#29147](https://github.com/storybookjs/storybook/pull/29147), thanks @InfiniteXyy!
- Addon-Interactions: Use ansi-to-html for colored test errors - [#29110](https://github.com/storybookjs/storybook/pull/29110), thanks @kasperpeulen!
- Angular: Fix sourceDecorator to apply excludeDecorators flag - [#29069](https://github.com/storybookjs/storybook/pull/29069), thanks @JSMike!
- Builder-vite: Replace .at() call with [] in codegen - [#29048](https://github.com/storybookjs/storybook/pull/29048), thanks @Chudesnov!
- CLI: Ensure `.gitignore` updated via CLI ends with a newline - [#29124](https://github.com/storybookjs/storybook/pull/29124), thanks @3w36zj6!
- CLI: Fix skip-install for stable latest releases - [#29133](https://github.com/storybookjs/storybook/pull/29133), thanks @valentinpalkovic!
- CLI: Show constraints in error when getting depndencies - [#29187](https://github.com/storybookjs/storybook/pull/29187), thanks @andrasczeh!
- Core: Do not add packageManager field to package.json during `storybook dev` - [#29152](https://github.com/storybookjs/storybook/pull/29152), thanks @valentinpalkovic!
- Core: Do not prebundle better-opn - [#29137](https://github.com/storybookjs/storybook/pull/29137), thanks @valentinpalkovic!
- Core: Do not prebundle jsdoc-type-pratt-parser - [#29134](https://github.com/storybookjs/storybook/pull/29134), thanks @valentinpalkovic!
- Core: Replace `fs-extra` with the native APIs - [#29126](https://github.com/storybookjs/storybook/pull/29126), thanks @ziebam!
- Next.js: Upgrade sass-loader from ^12 to ^13 - [#29040](https://github.com/storybookjs/storybook/pull/29040), thanks @HoncharenkoZhenya!
- React-Vite: Downgrade react-docgen-typescript plugin - [#29184](https://github.com/storybookjs/storybook/pull/29184), thanks @shilman!
- UI: Fix composed storybook TooltipLinkList bug where href isn't passed forward - [#29175](https://github.com/storybookjs/storybook/pull/29175), thanks @JSMike!
- Viewport-addon: Add InitialViewportKeys type to viewport addon - [#29182](https://github.com/storybookjs/storybook/pull/29182), thanks @hyeongrok7874!
- Vite: Add jsdoc-type-pratt-parser to `optimizeDeps` - [#29179](https://github.com/storybookjs/storybook/pull/29179), thanks @tobiasdiez!

## 8.4.0-alpha.0


Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/controls/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/essentials/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/gfm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-mdx-gfm",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "GitHub Flavored Markdown in Storybook",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/highlight/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-highlight",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Highlight DOM nodes within your stories",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-interactions",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Automate, test and debug user interactions",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/links/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/measure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-measure",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Inspect layouts by visualizing the box model",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/onboarding/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-onboarding",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Storybook Addon Onboarding - Introduces a new onboarding experience",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/outline/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-outline",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Outline all elements with CSS to help with layout placement and alignment",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/storysource/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "View a story’s source code to see how it works and paste into your app",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/experimental-addon-test",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Integrate Vitest with Storybook",
"keywords": [
"storybook-addons",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const myCustomDecorator = ({ themes, defaultState, ...rest }) => {
Let's use Vuetify as an example. Vuetify uses it's own global state to know which theme to render. To build a custom decorator to accommodate this method we'll need to do the following

```js
// .storybook/withVeutifyTheme.decorator.js
// .storybook/withVuetifyTheme.decorator.js
import { DecoratorHelpers } from '@storybook/addon-themes';
import { useTheme } from 'vuetify';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/themes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-themes",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Switch between multiple themes for you components in Storybook",
"keywords": [
"css",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/toolbars/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-toolbars",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Create your own toolbar items that control story rendering",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/viewport/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Build responsive components by adjusting Storybook’s viewport size and orientation",
"keywords": [
"addon",
Expand Down
9 changes: 7 additions & 2 deletions code/addons/viewport/src/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ViewportMap } from './types';

export const INITIAL_VIEWPORTS: ViewportMap = {
const INITIAL_VIEWPORTS_DATA = {
iphone5: {
name: 'iPhone 5',
styles: {
Expand Down Expand Up @@ -225,7 +225,12 @@ export const INITIAL_VIEWPORTS: ViewportMap = {
},
type: 'mobile',
},
};
} as const;

export type InitialViewportKeys = keyof typeof INITIAL_VIEWPORTS_DATA;

export const INITIAL_VIEWPORTS: ViewportMap = INITIAL_VIEWPORTS_DATA;

export const DEFAULT_VIEWPORT = 'responsive';

export const MINIMAL_VIEWPORTS: ViewportMap = {
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/builder-vite",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "A plugin to run and build Storybooks with Vite",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function generateModernIframeScriptCode(options: Options, projectRo
.map(
(previewAnnotation, index) =>
// Prefer the updated module from an HMR update, otherwise import the original module
`hmrPreviewAnnotationModules.at(${index}) ?? import('${previewAnnotation}')`
`hmrPreviewAnnotationModules[${index}] ?? import('${previewAnnotation}')`
)
.join(',\n')}])
return composeConfigs(configs);
Expand Down
1 change: 1 addition & 0 deletions code/builders/builder-vite/src/optimizeDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const INCLUDE_CANDIDATES = [
'fast-deep-equal',
'html-tags',
'isobject',
'jsdoc-type-pratt-parser', // TODO: Remove this once it's converted to ESM: https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/173
'loader-utils',
'lodash/camelCase.js',
'lodash/camelCase',
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/builder-webpack5",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
Expand Down
3 changes: 2 additions & 1 deletion code/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/core",
"version": "8.4.0-alpha.0",
"version": "8.4.0-alpha.1",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
Expand Down Expand Up @@ -376,6 +376,7 @@
"glob": "^10.0.0",
"globby": "^14.0.1",
"handlebars": "^4.7.7",
"jiti": "^1.21.6",
"js-yaml": "^4.1.0",
"lazy-universal-dotenv": "^4.0.0",
"leven": "^4.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export abstract class JsPackageManager {
.find((version) => satisfies(version, constraint));
invariant(
latestVersionSatisfyingTheConstraint != null,
'No version satisfying the constraint.'
`No version satisfying the constraint: ${packageName}${constraint}`
);
return latestVersionSatisfyingTheConstraint;
}
Expand Down
24 changes: 21 additions & 3 deletions code/core/src/common/js-package-manager/JsPackageManagerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,35 @@ export class JsPackageManagerFactory {
}

function hasNPM(cwd?: string) {
const npmVersionCommand = spawnSync('npm', ['--version'], { cwd, shell: true });
const npmVersionCommand = spawnSync('npm', ['--version'], {
cwd,
shell: true,
env: {
COREPACK_ENABLE_STRICT: '0',
},
});
return npmVersionCommand.status === 0;
}

function hasPNPM(cwd?: string) {
const pnpmVersionCommand = spawnSync('pnpm', ['--version'], { cwd, shell: true });
const pnpmVersionCommand = spawnSync('pnpm', ['--version'], {
cwd,
shell: true,
env: {
COREPACK_ENABLE_STRICT: '0',
},
});
return pnpmVersionCommand.status === 0;
}

function getYarnVersion(cwd?: string): 1 | 2 | undefined {
const yarnVersionCommand = spawnSync('yarn', ['--version'], { cwd, shell: true });
const yarnVersionCommand = spawnSync('yarn', ['--version'], {
cwd,
shell: true,
env: {
COREPACK_ENABLE_STRICT: '0',
},
});

if (yarnVersionCommand.status !== 0) {
return undefined;
Expand Down
Loading

0 comments on commit ab7139e

Please sign in to comment.