Skip to content

Commit

Permalink
Merge pull request #28410 from storybookjs/norbert/cpc-followup
Browse files Browse the repository at this point in the history
CPC: Remove externalization of `memoizerific` and remove need for `util-deprecate`
  • Loading branch information
ndelangen authored Jul 1, 2024
2 parents 453f933 + e9bc1e2 commit 4931b38
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@
"@types/react-syntax-highlighter": "11.0.5",
"@types/react-transition-group": "^4",
"@types/semver": "^7.3.4",
"@types/util-deprecate": "^1.0.0",
"@types/ws": "^8",
"@vitest/utils": "^1.3.1",
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
Expand Down Expand Up @@ -384,7 +383,6 @@
"unique-string": "^3.0.0",
"use-resize-observer": "^9.1.0",
"util": "^0.12.4",
"util-deprecate": "^1.0.2",
"watchpack": "^2.2.0"
},
"publishConfig": {
Expand Down
2 changes: 0 additions & 2 deletions code/core/scripts/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export const getEntries = (cwd: string) => {
'react-dom',
'@storybook/csf',
'@storybook/global',
'memoizerific',
'util-deprecate',
]),
define('src/theming/index.ts', ['browser', 'node'], true, ['react']),
define('src/theming/create.ts', ['browser', 'node'], true, ['react']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import type { Renderer, StoryAnnotationsOrFn } from '@storybook/core/types';

import { normalizeStory } from './normalizeStory';

vi.mock('@storybook/core/client-logger');

describe('normalizeStory', () => {
describe('id generation', () => {
it('respects component id', () => {
Expand Down
7 changes: 2 additions & 5 deletions code/core/src/preview-api/modules/store/csf/normalizeStory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import type {
} from '@storybook/core/types';
import { storyNameFromExport, toId } from '@storybook/csf';
import { dedent } from 'ts-dedent';
import { logger } from '@storybook/core/client-logger';
import deprecate from 'util-deprecate';
import { logger, deprecate } from '@storybook/core/client-logger';
import { normalizeInputTypes } from './normalizeInputTypes';
import { normalizeArrays } from './normalizeArrays';
import type {
Expand All @@ -24,8 +23,6 @@ CSF .story annotations deprecated; annotate story functions directly:
See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
`;

const deprecatedStoryAnnotationWarning = deprecate(() => {}, deprecatedStoryAnnotation);

export function normalizeStory<TRenderer extends Renderer>(
key: StoryId,
storyAnnotations: LegacyStoryAnnotationsOrFn<TRenderer>,
Expand All @@ -38,7 +35,7 @@ export function normalizeStory<TRenderer extends Renderer>(
const { story } = storyObject;
if (story) {
logger.debug('deprecated story', story);
deprecatedStoryAnnotationWarning();
deprecate(deprecatedStoryAnnotation);
}

const exportName = storyNameFromExport(key);
Expand Down
2 changes: 0 additions & 2 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5764,7 +5764,6 @@ __metadata:
"@types/react-syntax-highlighter": "npm:11.0.5"
"@types/react-transition-group": "npm:^4"
"@types/semver": "npm:^7.3.4"
"@types/util-deprecate": "npm:^1.0.0"
"@types/ws": "npm:^8"
"@vitest/utils": "npm:^1.3.1"
"@yarnpkg/esbuild-plugin-pnp": "npm:^3.0.0-rc.10"
Expand Down Expand Up @@ -5852,7 +5851,6 @@ __metadata:
unique-string: "npm:^3.0.0"
use-resize-observer: "npm:^9.1.0"
util: "npm:^0.12.4"
util-deprecate: "npm:^1.0.2"
watchpack: "npm:^2.2.0"
ws: "npm:^8.2.3"
languageName: unknown
Expand Down

0 comments on commit 4931b38

Please sign in to comment.