Skip to content

Commit

Permalink
Merge branch 'next' into release-8-0
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Oct 23, 2023
2 parents 233a73a + cfe7ac3 commit 99911f4
Show file tree
Hide file tree
Showing 98 changed files with 337 additions and 185 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 7.6.0-alpha.2

- Actions: Fix missing crypto module crashing React Native - [#24546](https://github.com/storybookjs/storybook/pull/24546), thanks [@dannyhw](https://github.com/dannyhw)!
- Core: Fix post message channel location.search access for React Native - [#24545](https://github.com/storybookjs/storybook/pull/24545), thanks [@dannyhw](https://github.com/dannyhw)!
- ManagerBuilder: Fix `"type": "commonjs"` compatibility - [#24534](https://github.com/storybookjs/storybook/pull/24534), thanks [@ndelangen](https://github.com/ndelangen)!
- React: Upgrade `react-docgen` to v7 - [#24530](https://github.com/storybookjs/storybook/pull/24530), thanks [@shilman](https://github.com/shilman)!

## 7.6.0-alpha.1

- Angular: Add source-map option to builder - [#24466](https://github.com/storybookjs/storybook/pull/24466), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
Expand Down
11 changes: 10 additions & 1 deletion code/addons/actions/src/runtime/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ const serializeArg = <T>(a: T) => {
return a;
};

// TODO react native doesn't have the crypto module, we should figure out a better way to generate these ids.
const generateId = () => {
return typeof crypto === 'object' && typeof crypto.getRandomValues === 'function'
? uuidv4()
: // pseudo random id, example response lo1e7zm4832bkr7yfl7
Date.now().toString(36) + Math.random().toString(36).substring(2);
};

export function action(name: string, options: ActionOptions = {}): HandlerFunction {
const actionOptions = {
...config,
Expand All @@ -47,7 +55,8 @@ export function action(name: string, options: ActionOptions = {}): HandlerFuncti

const handler = function actionHandler(...args: any[]) {
const channel = addons.getChannel();
const id = uuidv4();
// this makes sure that in js enviroments like react native you can still get an id
const id = generateId();
const minDepth = 5; // anything less is really just storybook internals
const serializedArgs = args.map(serializeArg);
const normalizedArgs = args.length > 1 ? serializedArgs : serializedArgs[0];
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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Inspect layouts by visualizing the box model",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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/themes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-themes",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Build responsive components by adjusting Storybook’s viewport size and orientation",
"keywords": [
"addon",
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-manager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/builder-manager",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook manager builder",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/builders/builder-manager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const getConfig: ManagerBuilder['getConfig'] = async (options) => {
return {
entryPoints: realEntryPoints,
outdir: join(options.outputDir || './', 'sb-addons'),
format: 'esm',
format: 'iife',
write: false,
ignoreAnnotations: true,
resolveExtensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"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
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": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/ember/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/ember",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/html-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/html-vite",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/html-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/html-webpack5",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/nextjs",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Next.js",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/preact-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/preact-vite",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/preact-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/preact-webpack5",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"
Expand Down
4 changes: 2 additions & 2 deletions code/frameworks/react-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/react-vite",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down Expand Up @@ -53,7 +53,7 @@
"@storybook/react": "workspace:*",
"@vitejs/plugin-react": "^3.0.1",
"magic-string": "^0.30.0",
"react-docgen": "^6.0.2"
"react-docgen": "^7.0.0"
},
"devDependencies": {
"@types/node": "^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/react-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/react-webpack5",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/server-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/server-webpack5",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/svelte-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/svelte-vite",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/svelte-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/svelte-webpack5",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/sveltekit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/sveltekit",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for SvelteKit",
"keywords": [
"storybook",
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/vue-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/vue-vite",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/vue-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/vue-webpack5",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/vue3-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/vue3-vite",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/vue3-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/vue3-webpack5",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/web-components-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/web-components-vite",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/web-components-webpack5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/web-components-webpack5",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
"keywords": [
"lit",
Expand Down
2 changes: 1 addition & 1 deletion code/lib/channels/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/channels",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/lib/channels/src/postmessage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class PostMessageTransport implements ChannelTransport {

const frames = this.getFrames(target);

const query = qs.parse(location.search, { ignoreQueryPrefix: true });
const query = qs.parse(location?.search || '', { ignoreQueryPrefix: true });

const data = stringify(
{
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli-sb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sb",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook CLI",
"keywords": [
"storybook"
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "storybook",
"version": "7.6.0-alpha.1",
"version": "7.6.0-alpha.2",
"description": "Storybook CLI",
"keywords": [
"storybook"
Expand Down
Loading

0 comments on commit 99911f4

Please sign in to comment.