Skip to content

Commit

Permalink
make packages peerDep on storybook package instead of `@storybook/c…
Browse files Browse the repository at this point in the history
…ore`
  • Loading branch information
ndelangen committed Jun 21, 2024
1 parent 8e2db19 commit cb5b778
Show file tree
Hide file tree
Showing 729 changed files with 2,229 additions and 1,928 deletions.
1 change: 1 addition & 0 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = {
},
plugins: ['local-rules'],
rules: {
'import/no-unresolved': 'off', // covered by typescript
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'eslint-comments/no-unused-disable': 'error',
'react-hooks/rules-of-hooks': 'off',
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@
"react-native"
]
}
}
}
4 changes: 2 additions & 2 deletions code/addons/a11y/src/a11yRunner.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Mock } from 'vitest';
import { describe, beforeEach, it, expect, vi } from 'vitest';
import { addons } from '@storybook/core/preview-api';
import { addons } from 'storybook/preview-api';
import { EVENTS } from './constants';

vi.mock('@storybook/core/preview-api');
vi.mock('storybook/preview-api');
const mockedAddons = vi.mocked(addons);

describe('a11yRunner', () => {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/a11yRunner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { global } from '@storybook/global';
import { addons } from '@storybook/core/preview-api';
import { addons } from 'storybook/preview-api';
import { EVENTS } from './constants';
import type { A11yParameters } from './params';

Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/components/A11YPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { describe, beforeEach, afterEach, it, expect, vi } from 'vitest';
import React from 'react';
import { render, waitFor, fireEvent, act, cleanup } from '@testing-library/react';

import { ThemeProvider, themes, convert } from '@storybook/core/theming';
import * as api from '@storybook/core/manager-api';
import { ThemeProvider, themes, convert } from 'storybook/theming';
import * as api from 'storybook/manager-api';

import { A11YPanel } from './A11YPanel';
import { EVENTS } from '../constants';

vi.mock('@storybook/core/manager-api');
vi.mock('storybook/manager-api');

global.ResizeObserver = require('resize-observer-polyfill');

Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/components/A11YPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useCallback, useMemo, useState } from 'react';

import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';

import { ActionBar, ScrollArea } from '@storybook/core/components';
import { ActionBar, ScrollArea } from 'storybook/components';
import { SyncIcon, CheckIcon } from '@storybook/icons';

import type { AxeResults } from 'axe-core';
Expand All @@ -11,7 +11,7 @@ import {
useParameter,
useStorybookApi,
useStorybookState,
} from '@storybook/core/manager-api';
} from 'storybook/manager-api';

import { Report } from './Report';

Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/components/A11yContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { describe, beforeEach, afterEach, it, expect, vi } from 'vitest';
import * as React from 'react';
import type { AxeResults } from 'axe-core';
import { render, act, cleanup } from '@testing-library/react';
import * as api from '@storybook/core/manager-api';
import { STORY_CHANGED } from '@storybook/core/core-events';
import * as api from 'storybook/manager-api';
import { STORY_CHANGED } from 'storybook/core-events';
import { HIGHLIGHT } from '@storybook/addon-highlight';

import { A11yContextProvider, useA11yContext } from './A11yContext';
import { EVENTS } from '../constants';

vi.mock('@storybook/core/manager-api');
vi.mock('storybook/manager-api');
const mockedApi = vi.mocked(api);

const storyId = 'jest';
Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/components/A11yContext.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { themes, convert } from '@storybook/core/theming';
import { themes, convert } from 'storybook/theming';
import type { Result } from 'axe-core';
import { useChannel, useAddonState, useStorybookApi } from '@storybook/core/manager-api';
import { STORY_CHANGED, STORY_RENDERED } from '@storybook/core/core-events';
import { useChannel, useAddonState, useStorybookApi } from 'storybook/manager-api';
import { STORY_CHANGED, STORY_RENDERED } from 'storybook/core-events';
import { HIGHLIGHT } from '@storybook/addon-highlight';
import { ADDON_ID, EVENTS } from '../constants';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/Elements.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';
import React from 'react';

import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';

import type { NodeResult } from 'axe-core';
import { Rules } from './Rules';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/HighlightToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';

import type { NodeResult } from 'axe-core';
import { useA11yContext } from '../A11yContext';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/Info.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';
import React from 'react';

import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';
import type { Result } from 'axe-core';

const Wrapper = styled.div({
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/Item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Fragment, useState } from 'react';

import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';

import type { Result } from 'axe-core';
import { Info } from './Info';
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/components/Report/Rules.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';
import React from 'react';
import { styled } from '@storybook/core/theming';
import { Badge } from '@storybook/core/components';
import { styled } from 'storybook/theming';
import { Badge } from 'storybook/components';
import type { CheckResult } from 'axe-core';
import { useResizeDetector } from 'react-resize-detector';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/Tags.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { FC } from 'react';
import React from 'react';

import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';
import type { TagValue } from 'axe-core';

const Wrapper = styled.div({
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Report/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC } from 'react';
import React, { Fragment } from 'react';
import { EmptyTabContent } from '@storybook/core/components';
import { EmptyTabContent } from 'storybook/components';
import type { Result } from 'axe-core';

import { Item } from './Item';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';
import type { NodeResult, Result } from 'axe-core';
import { useResizeDetector } from 'react-resize-detector';
import HighlightToggle from './Report/HighlightToggle';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/VisionSimulator.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { describe, it, expect } from 'vitest';
import React from 'react';
import { render, fireEvent, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { ThemeProvider, themes, convert } from '@storybook/core/theming';
import { ThemeProvider, themes, convert } from 'storybook/theming';
import { VisionSimulator, baseList } from './VisionSimulator';

const getOptionByNameAndPercentage = (option: string, percentage?: number) =>
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/components/VisionSimulator.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ReactNode } from 'react';
import React, { useState } from 'react';
import { Global, styled } from '@storybook/core/theming';
import { IconButton, WithTooltip, TooltipLinkList } from '@storybook/core/components';
import { Global, styled } from 'storybook/theming';
import { IconButton, WithTooltip, TooltipLinkList } from 'storybook/components';

import { AccessibilityIcon } from '@storybook/icons';
import { Filters } from './ColorFilters';
Expand Down
6 changes: 3 additions & 3 deletions code/addons/a11y/src/manager.test.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @vitest-environment happy-dom

import { describe, it, expect, vi } from 'vitest';
import * as api from '@storybook/core/manager-api';
import type { Addon_BaseType } from '@storybook/core/types';
import * as api from 'storybook/manager-api';
import type { Addon_BaseType } from 'storybook/types';
import { PANEL_ID } from './constants';
import './manager';

vi.mock('@storybook/core/manager-api');
vi.mock('storybook/manager-api');
const mockedApi = vi.mocked<api.API>(api as any);
mockedApi.useAddonState = vi.fn();
const mockedAddons = vi.mocked(api.addons);
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { addons, types, useAddonState } from '@storybook/core/manager-api';
import { Badge, Spaced } from '@storybook/core/components';
import { addons, types, useAddonState } from 'storybook/manager-api';
import { Badge, Spaced } from 'storybook/components';
import { ADDON_ID, PANEL_ID, PARAM_KEY } from './constants';
import { VisionSimulator } from './components/VisionSimulator';
import { A11YPanel } from './components/A11YPanel';
Expand Down
6 changes: 3 additions & 3 deletions code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
"typescript": "^5.3.2"
},
"peerDependencies": {
"storybook": "workspace:^",
"@storybook/test": "workspace:*"
"@storybook/test": "workspace:*",
"storybook": "workspace:^"
},
"publishConfig": {
"access": "public"
Expand All @@ -108,4 +108,4 @@
],
"icon": "https://user-images.githubusercontent.com/263385/101991666-479cc600-3c7c-11eb-837b-be4e5ffa1bb8.png"
}
}
}
2 changes: 1 addition & 1 deletion code/addons/actions/src/addArgs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ArgsEnhancer } from '@storybook/core/types';
import type { ArgsEnhancer } from 'storybook/types';
import { addActionsFromArgTypes, inferActionsFromArgTypesRegex } from './addArgsHelpers';

export const argsEnhancers: ArgsEnhancer[] = [
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/addArgsHelpers.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import type { StoryContext } from '@storybook/core/types';
import type { StoryContext } from 'storybook/types';
import { inferActionsFromArgTypesRegex, addActionsFromArgTypes } from './addArgsHelpers';

describe('actions parameter enhancers', () => {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/addArgsHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Args, Renderer, ArgsEnhancer } from '@storybook/core/types';
import type { Args, Renderer, ArgsEnhancer } from 'storybook/types';
import { action } from './runtime/action';

// interface ActionsParameter {
Expand Down
6 changes: 3 additions & 3 deletions code/addons/actions/src/components/ActionLogger/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ElementRef, ReactNode } from 'react';
import React, { forwardRef, Fragment, useEffect, useRef } from 'react';
import type { Theme } from '@storybook/core/theming';
import { styled, withTheme } from '@storybook/core/theming';
import type { Theme } from 'storybook/theming';
import { styled, withTheme } from 'storybook/theming';

import { Inspector } from 'react-inspector';
import { ActionBar, ScrollArea } from '@storybook/core/components';
import { ActionBar, ScrollArea } from 'storybook/components';

import { Action, Counter, InspectorContainer } from './style';
import type { ActionDisplay } from '../../models';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/components/ActionLogger/style.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';
import { opacify } from 'polished';

export const Action = styled.div({
Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/containers/ActionLogger/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import { dequal as deepEqual } from 'dequal';

import type { API } from '@storybook/core/manager-api';
import { STORY_CHANGED } from '@storybook/core/core-events';
import type { API } from 'storybook/manager-api';
import { STORY_CHANGED } from 'storybook/core-events';

import { ActionLogger as ActionLoggerComponent } from '../../components/ActionLogger';
import type { ActionDisplay } from '../../models';
Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/decorator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { global } from '@storybook/global';
import { useEffect, makeDecorator } from '@storybook/core/preview-api';
import type { PartialStoryFn, Renderer } from '@storybook/core/types';
import { useEffect, makeDecorator } from 'storybook/preview-api';
import type { PartialStoryFn, Renderer } from 'storybook/types';
import { actions } from './runtime/actions';

import { PARAM_KEY } from './constants';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/loaders.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-underscore-dangle */
import type { LoaderFunction } from '@storybook/core/types';
import type { LoaderFunction } from 'storybook/types';
import { global } from '@storybook/global';
import type { onMockCall as onMockCallType } from '@storybook/test';
import { action } from './runtime';
Expand Down
6 changes: 3 additions & 3 deletions code/addons/actions/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { addons, types, useAddonState, useChannel } from '@storybook/core/manager-api';
import { STORY_CHANGED } from '@storybook/core/core-events';
import { Badge, Spaced } from '@storybook/core/components';
import { addons, types, useAddonState, useChannel } from 'storybook/manager-api';
import { STORY_CHANGED } from 'storybook/core-events';
import { Badge, Spaced } from 'storybook/components';
import ActionLogger from './containers/ActionLogger';
import { ADDON_ID, CLEAR_ID, EVENT_ID, PANEL_ID, PARAM_KEY } from './constants';

Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/runtime/__tests__/action.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, it, expect, vi } from 'vitest';
import { addons } from '@storybook/core/preview-api';
import { addons } from 'storybook/preview-api';
import { action, configureActions } from '../..';

vi.mock('@storybook/core/preview-api');
vi.mock('storybook/preview-api');

const createChannel = () => {
const channel = { emit: vi.fn() };
Expand Down
4 changes: 2 additions & 2 deletions code/addons/actions/src/runtime/__tests__/actions.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, it, expect, vi } from 'vitest';
import { addons } from '@storybook/core/preview-api';
import { addons } from 'storybook/preview-api';
import { actions } from '../..';

vi.mock('@storybook/core/preview-api');
vi.mock('storybook/preview-api');

const createChannel = () => {
const channel = { emit: vi.fn() };
Expand Down
8 changes: 4 additions & 4 deletions code/addons/actions/src/runtime/action.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { v4 as uuidv4 } from 'uuid';
import type { PreviewWeb } from '@storybook/core/preview-api';
import { addons } from '@storybook/core/preview-api';
import type { Renderer } from '@storybook/core/types';
import type { PreviewWeb } from 'storybook/preview-api';
import { addons } from 'storybook/preview-api';
import type { Renderer } from 'storybook/types';
import { global } from '@storybook/global';
import { ImplicitActionsDuringRendering } from '@storybook/core/preview-errors';
import { ImplicitActionsDuringRendering } from 'storybook/preview-errors';
import { EVENT_ID } from '../constants';
import type { ActionDisplay, ActionOptions, HandlerFunction } from '../models';
import { config } from './configureActions';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
declare var FEATURES: import('@storybook/core/types').StorybookConfigRaw['features'];
declare var FEATURES: import('storybook/types').StorybookConfigRaw['features'];
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
"react-native"
]
}
}
}
2 changes: 1 addition & 1 deletion code/addons/backgrounds/src/components/ColorIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { styled } from '@storybook/core/theming';
import { styled } from 'storybook/theming';

export const ColorIcon = styled.span(
({ background }: { background: string }) => ({
Expand Down
6 changes: 3 additions & 3 deletions code/addons/backgrounds/src/containers/BackgroundSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { FC } from 'react';
import React, { useState, Fragment, useCallback, useMemo, memo } from 'react';
import memoize from 'memoizerific';

import { useParameter, useGlobals } from '@storybook/core/manager-api';
import { logger } from '@storybook/core/client-logger';
import { IconButton, WithTooltip, TooltipLinkList } from '@storybook/core/components';
import { useParameter, useGlobals } from 'storybook/manager-api';
import { logger } from 'storybook/client-logger';
import { IconButton, WithTooltip, TooltipLinkList } from 'storybook/components';

import { PhotoIcon } from '@storybook/icons';
import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
Expand Down
4 changes: 2 additions & 2 deletions code/addons/backgrounds/src/containers/GridSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { FC } from 'react';
import React, { memo } from 'react';

import { useGlobals, useParameter } from '@storybook/core/manager-api';
import { IconButton } from '@storybook/core/components';
import { useGlobals, useParameter } from 'storybook/manager-api';
import { IconButton } from 'storybook/components';

import { GridIcon } from '@storybook/icons';
import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
Expand Down
8 changes: 2 additions & 6 deletions code/addons/backgrounds/src/decorators/withBackground.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { useMemo, useEffect } from '@storybook/core/preview-api';
import type {
Renderer,
PartialStoryFn as StoryFunction,
StoryContext,
} from '@storybook/core/types';
import { useMemo, useEffect } from 'storybook/preview-api';
import type { Renderer, PartialStoryFn as StoryFunction, StoryContext } from 'storybook/types';

import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
import {
Expand Down
Loading

0 comments on commit cb5b778

Please sign in to comment.