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

Tech: rename api to manager-api #19944

Merged
merged 8 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion code/addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
"dependencies": {
"@storybook/addon-highlight": "7.0.0-alpha.52",
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/channels": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52",
"@storybook/types": "7.0.0-alpha.52",
Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/components/A11YPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from 'react';
import { render, waitFor, fireEvent, act } from '@testing-library/react';

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

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

jest.mock('@storybook/api');
jest.mock('@storybook/manager-api');
const mockedApi = api as jest.Mocked<typeof api>;

const axeResult = {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/A11YPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { styled } from '@storybook/theming';
import { ActionBar, Icons, ScrollArea } from '@storybook/components';

import type { AxeResults } from 'axe-core';
import { useChannel, useParameter, useStorybookState } from '@storybook/api';
import { useChannel, useParameter, useStorybookState } from '@storybook/manager-api';

import { Report } from './Report';

Expand Down
4 changes: 2 additions & 2 deletions code/addons/a11y/src/components/A11yContext.test.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as React from 'react';
import type { AxeResults } from 'axe-core';
import { render, act } from '@testing-library/react';
import * as api from '@storybook/api';
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';

jest.mock('@storybook/api');
jest.mock('@storybook/manager-api');
const mockedApi = api as jest.Mocked<typeof api>;

const storyId = 'jest';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/a11y/src/components/A11yContext.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { themes, convert } from '@storybook/theming';
import type { Result } from 'axe-core';
import { useChannel, useAddonState, useStorybookApi } from '@storybook/api';
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
4 changes: 2 additions & 2 deletions code/addons/a11y/src/manager.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { addons } from '@storybook/addons';
import * as api from '@storybook/api';
import * as api from '@storybook/manager-api';
import { PANEL_ID } from './constants';
import './manager';

jest.mock('@storybook/api');
jest.mock('@storybook/manager-api');
jest.mock('@storybook/addons');
const mockedApi = api as unknown as jest.Mocked<api.API>;
mockedApi.getAddonState = jest.fn();
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52",
"@storybook/types": "7.0.0-alpha.52",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/actions/src/containers/ActionLogger/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { dequal as deepEqual } from 'dequal';

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

import { ActionLogger as ActionLoggerComponent } from '../../components/ActionLogger';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/backgrounds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52",
"@storybook/types": "7.0.0-alpha.52",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { FC } from 'react';
import React, { Fragment, useCallback, useMemo, memo } from 'react';
import memoize from 'memoizerific';

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

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

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

import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/blocks": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-common": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/node-logger": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52",
Expand Down
8 changes: 7 additions & 1 deletion code/addons/controls/src/ControlsPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import type { FC } from 'react';
import React from 'react';
import { useArgs, useGlobals, useArgTypes, useParameter, useStorybookState } from '@storybook/api';
import {
useArgs,
useGlobals,
useArgTypes,
useParameter,
useStorybookState,
} from '@storybook/manager-api';
import {
PureArgsTable as ArgsTable,
NoControlsWarning,
Expand Down
2 changes: 1 addition & 1 deletion code/addons/controls/src/manager.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { addons, types } from '@storybook/addons';
import { AddonPanel } from '@storybook/components';
import { type API, useArgTypes } from '@storybook/api';
import { type API, useArgTypes } from '@storybook/manager-api';
import { ControlsPanel } from './ControlsPanel';
import { ADDON_ID, PARAM_KEY } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
"@storybook/addon-toolbars": "7.0.0-alpha.52",
"@storybook/addon-viewport": "7.0.0-alpha.52",
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/core-common": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/node-logger": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"ts-dedent": "^2.0.0"
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 @@ -73,12 +73,12 @@
"dependencies": {
"@devtools-ds/object-inspector": "^1.1.2",
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-common": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/instrumenter": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52",
"@storybook/types": "7.0.0-alpha.52",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/src/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import global from 'global';
import * as React from 'react';
import { useChannel, useParameter } from '@storybook/api';
import { useChannel, useParameter } from '@storybook/manager-api';
import {
FORCE_REMOUNT,
IGNORED_EXCEPTION,
Expand Down
2 changes: 1 addition & 1 deletion code/addons/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52",
"global": "^4.4.0",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/jest/src/hoc/provideJestResult.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ComponentType } from 'react';
import React, { Component as ReactComponent } from 'react';
import { STORY_CHANGED } from '@storybook/core-events';
import type { API } from '@storybook/api';
import type { API } from '@storybook/manager-api';
import { ADD_TESTS } from '../shared';

// TODO: import type from @types/jest
Expand Down
2 changes: 1 addition & 1 deletion code/addons/measure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/types": "7.0.0-alpha.52",
"global": "^4.4.0"
Expand Down
2 changes: 1 addition & 1 deletion code/addons/measure/src/Tool.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect } from 'react';
import { useGlobals, useStorybookApi } from '@storybook/api';
import { useGlobals, useStorybookApi } from '@storybook/manager-api';
import { Icons, IconButton } from '@storybook/components';
import { TOOL_ID, ADDON_ID } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/outline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/types": "7.0.0-alpha.52",
"global": "^4.4.0",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/outline/src/OutlineSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { memo, useCallback, useEffect } from 'react';
import { useGlobals, useStorybookApi } from '@storybook/api';
import { useGlobals, useStorybookApi } from '@storybook/manager-api';
import { Icons, IconButton } from '@storybook/components';
import { ADDON_ID, PARAM_KEY } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/storysource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/router": "7.0.0-alpha.52",
"@storybook/source-loader": "7.0.0-alpha.52",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/storysource/src/StoryPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { type API, useParameter } from '@storybook/api';
import { type API, useParameter } from '@storybook/manager-api';
import { styled } from '@storybook/theming';
import { Link } from '@storybook/router';
import {
Expand Down
2 changes: 1 addition & 1 deletion code/addons/toolbars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52"
},
Expand Down
2 changes: 1 addition & 1 deletion code/addons/toolbars/src/components/ToolbarManager.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC } from 'react';
import React from 'react';
import { useGlobalTypes } from '@storybook/api';
import { useGlobalTypes } from '@storybook/manager-api';
import { Separator } from '@storybook/components';
import { ToolbarMenuList } from './ToolbarMenuList';
import { normalizeArgType } from '../utils/normalize-toolbar-arg-type';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/toolbars/src/components/ToolbarMenuList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FC, ReactNode } from 'react';
import React, { useCallback } from 'react';
import { useGlobals } from '@storybook/api';
import { useGlobals } from '@storybook/manager-api';
import { deprecate } from '@storybook/client-logger';
import { WithTooltip, TooltipLinkList } from '@storybook/components';
import { ToolbarMenuButton } from './ToolbarMenuButton';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/toolbars/src/hoc/withKeyboardCycle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useRef, useEffect, useCallback } from 'react';
import { useGlobals, useStorybookApi } from '@storybook/api';
import { useGlobals, useStorybookApi } from '@storybook/manager-api';
import { createCycleValueArray } from '../utils/create-cycle-value-array';
import { registerShortcuts } from '../utils/register-shortcuts';
import type { ToolbarMenuProps } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/toolbars/src/utils/register-shortcuts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { API } from '@storybook/api';
import type { API } from '@storybook/manager-api';
import { ADDON_ID } from '../constants';
import type { ToolbarShortcutConfig } from '../types';

Expand Down
2 changes: 1 addition & 1 deletion code/addons/viewport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/components": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52",
"global": "^4.4.0",
Expand Down
2 changes: 1 addition & 1 deletion code/addons/viewport/src/Tool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { styled, Global, type Theme, withTheme } from '@storybook/theming';

import { Icons, IconButton, WithTooltip, TooltipLinkList } from '@storybook/components';

import { useStorybookApi, useParameter, useAddonState } from '@storybook/api';
import { useStorybookApi, useParameter, useAddonState } from '@storybook/manager-api';
import { registerShortcuts } from './shortcuts';
import { PARAM_KEY, ADDON_ID } from './constants';
import { MINIMAL_VIEWPORTS } from './defaults';
Expand Down
2 changes: 1 addition & 1 deletion code/addons/viewport/src/shortcuts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { API } from '@storybook/api';
import type { API } from '@storybook/manager-api';
import { ADDON_ID } from './constants';

type State = {
Expand Down
2 changes: 1 addition & 1 deletion code/frameworks/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.52",
"@storybook/api": "7.0.0-alpha.52",
"@storybook/builder-webpack5": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/core-client": "7.0.0-alpha.52",
Expand All @@ -44,6 +43,7 @@
"@storybook/core-server": "7.0.0-alpha.52",
"@storybook/core-webpack": "7.0.0-alpha.52",
"@storybook/docs-tools": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/node-logger": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
"@storybook/types": "7.0.0-alpha.52",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ const newWebpackConfiguration = (
mainFields: ['browser', 'main'],
alias: {
'@storybook/preview-api': '/Users/joe/storybook/lib/addons',
'@storybook/api': '/Users/joe/storybook/lib/api',
'@storybook/manager-api': '/Users/joe/storybook/lib/api',
'@storybook/channels': '/Users/joe/storybook/lib/channels',
'@storybook/channel-postmessage': '/Users/joe/storybook/lib/channel-postmessage',
'@storybook/components': '/Users/joe/storybook/ui/components',
Expand Down
2 changes: 1 addition & 1 deletion code/lib/addons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/api": "7.0.0-alpha.52",
"@storybook/channels": "7.0.0-alpha.52",
"@storybook/client-logger": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/router": "7.0.0-alpha.52",
"@storybook/theming": "7.0.0-alpha.52",
"@storybook/types": "7.0.0-alpha.52",
Expand Down
2 changes: 1 addition & 1 deletion code/lib/addons/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import global from 'global';

import type { Channel } from '@storybook/channels';
import { SET_CONFIG } from '@storybook/core-events';
import type { API } from '@storybook/api';
import type { API } from '@storybook/manager-api';
import type {
Addon_Collection,
Addon_Config,
Expand Down
1 change: 1 addition & 0 deletions code/lib/builder-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@storybook/core-common": "7.0.0-alpha.52",
"@storybook/core-events": "7.0.0-alpha.52",
"@storybook/core-webpack": "7.0.0-alpha.52",
"@storybook/manager-api": "7.0.0-alpha.52",
"@storybook/node-logger": "7.0.0-alpha.52",
"@storybook/preview": "7.0.0-alpha.52",
"@storybook/preview-api": "7.0.0-alpha.52",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const storybookPaths: Record<string, string> = {
...[
// these packages are not pre-bundled because of react dependencies
'api',
'manager-api',
'components',
'router',
'theming',
Expand Down
Loading