From bc47cc4ff1b05115360d0b0a7d0c69a5079c2b04 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 9 Nov 2022 15:27:38 +0100 Subject: [PATCH 01/14] convert addon-docs to use ts-up --- code/addons/docs/package.json | 45 ++++++++++++++----- code/addons/docs/preset.js | 2 +- code/addons/docs/preview.js | 2 +- code/addons/docs/src/DocsRenderer.tsx | 1 + code/addons/docs/src/blocks.ts | 1 - code/addons/docs/src/index.ts | 2 +- code/addons/docs/src/shared.ts | 28 ------------ code/addons/essentials/package.json | 38 ---------------- code/ui/blocks/package.json | 22 +++++---- code/ui/blocks/src/blocks/Heading.tsx | 2 +- code/ui/blocks/src/blocks/Subheading.tsx | 2 +- code/ui/blocks/src/blocks/enhanceSource.ts | 5 +-- .../src/blocks/external/ExternalPreview.ts | 2 +- code/ui/blocks/src/blocks/mdx.tsx | 2 +- .../src/components/ArgsTable/ArgJsDoc.tsx | 2 +- .../src/components/ArgsTable/ArgRow.tsx | 6 +-- .../src/components/ArgsTable/ArgValue.tsx | 2 +- .../src/components/ArgsTable/ArgsTable.tsx | 4 +- .../ArgsTable/NoControlsWarning.tsx | 2 +- .../src/components/ArgsTable/SectionRow.tsx | 4 +- .../components/ArgsTable/TabbedArgsTable.tsx | 2 +- .../ui/blocks/src/components/ColorPalette.tsx | 4 +- code/ui/blocks/src/components/Description.tsx | 4 +- code/ui/blocks/src/components/DocsPage.tsx | 4 +- code/ui/blocks/src/components/EmptyBlock.tsx | 4 +- code/ui/blocks/src/components/IconGallery.tsx | 2 +- code/ui/blocks/src/components/Preview.tsx | 6 +-- code/ui/blocks/src/components/Source.tsx | 2 +- code/ui/blocks/src/components/Story.tsx | 2 +- code/ui/blocks/src/components/Title.tsx | 2 +- code/ui/blocks/src/components/Toolbar.tsx | 1 + code/ui/blocks/src/components/Typeset.tsx | 4 +- code/ui/blocks/src/controls/Boolean.tsx | 4 +- code/ui/blocks/src/controls/Color.tsx | 6 +-- code/ui/blocks/src/controls/Date.tsx | 2 +- code/ui/blocks/src/controls/Files.tsx | 2 +- code/ui/blocks/src/controls/Number.tsx | 2 +- code/ui/blocks/src/controls/Object.tsx | 2 +- code/ui/blocks/src/controls/Range.tsx | 2 +- code/ui/blocks/src/controls/Text.tsx | 2 +- .../ui/blocks/src/controls/options/Select.tsx | 2 +- .../react-editable-json-tree/JsonNodes.tsx | 6 --- 42 files changed, 94 insertions(+), 147 deletions(-) delete mode 100644 code/addons/docs/src/blocks.ts delete mode 100644 code/addons/docs/src/shared.ts diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 912874857cd0..4f927a07d114 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -24,9 +24,31 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "types": "dist/types/index.d.ts", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./preview": { + "require": "./dist/preview.js", + "import": "./dist/preview.mjs", + "types": "./dist/preview.d.ts" + }, + "./preset": { + "require": "./dist/preset.js", + "import": "./dist/preset.mjs", + "types": "./dist/preset.d.ts" + }, + "./svelte/HOC.svelte": "./svelte/HOC.svelte", + "./ember/index.js": "./ember/index.js", + "./web-components/index.js": "./web-components/index.js", + "./jest-transform-mdx.js": "./jest-transform-mdx.js", + "./package.json": "./package.json" + }, + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", "files": [ "dist/**/*", "angular/**/*", @@ -46,29 +68,21 @@ ], "scripts": { "check": "../../../scripts/node_modules/.bin/tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@babel/plugin-transform-react-jsx": "^7.12.12", "@jest/transform": "^26.6.2", "@mdx-js/react": "^2.1.5", - "@storybook/addons": "7.0.0-alpha.48", - "@storybook/api": "7.0.0-alpha.48", "@storybook/blocks": "7.0.0-alpha.48", "@storybook/components": "7.0.0-alpha.48", - "@storybook/core-common": "7.0.0-alpha.48", - "@storybook/core-events": "7.0.0-alpha.48", "@storybook/csf-plugin": "7.0.0-alpha.48", "@storybook/csf-tools": "7.0.0-alpha.48", - "@storybook/docs-tools": "7.0.0-alpha.48", "@storybook/mdx2-csf": "next", "@storybook/node-logger": "7.0.0-alpha.48", "@storybook/postinstall": "7.0.0-alpha.48", "@storybook/preview-web": "7.0.0-alpha.48", - "@storybook/store": "7.0.0-alpha.48", - "@storybook/theming": "7.0.0-alpha.48", "@storybook/types": "7.0.0-alpha.48", - "dequal": "^2.0.2", "fs-extra": "^9.0.1", "global": "^4.4.0", "remark-external-links": "^8.0.0", @@ -94,6 +108,13 @@ "publishConfig": { "access": "public" }, + "bundler": { + "entries": [ + "./src/index.ts", + "./src/preset.ts", + "./src/preview.ts" + ] + }, "gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd", "storybook": { "displayName": "Docs", diff --git a/code/addons/docs/preset.js b/code/addons/docs/preset.js index e45ac5b4cec0..a83f95279e7f 100644 --- a/code/addons/docs/preset.js +++ b/code/addons/docs/preset.js @@ -1 +1 @@ -module.exports = require('./dist/cjs/preset'); +module.exports = require('./dist/preset'); diff --git a/code/addons/docs/preview.js b/code/addons/docs/preview.js index e726cab5a1b6..49ad602f79f4 100644 --- a/code/addons/docs/preview.js +++ b/code/addons/docs/preview.js @@ -1 +1 @@ -export * from './dist/esm/preview'; +export * from './dist/preview'; diff --git a/code/addons/docs/src/DocsRenderer.tsx b/code/addons/docs/src/DocsRenderer.tsx index fb55fcb33f06..7da390037fc1 100644 --- a/code/addons/docs/src/DocsRenderer.tsx +++ b/code/addons/docs/src/DocsRenderer.tsx @@ -33,6 +33,7 @@ export class DocsRenderer { ...defaultComponents, ...docsParameter?.components, }; + ReactDOM.render( diff --git a/code/addons/docs/src/blocks.ts b/code/addons/docs/src/blocks.ts deleted file mode 100644 index 119f7ce62757..000000000000 --- a/code/addons/docs/src/blocks.ts +++ /dev/null @@ -1 +0,0 @@ -export * from '@storybook/blocks'; diff --git a/code/addons/docs/src/index.ts b/code/addons/docs/src/index.ts index 807e2656e5b8..b74399955f12 100644 --- a/code/addons/docs/src/index.ts +++ b/code/addons/docs/src/index.ts @@ -1,2 +1,2 @@ -export * from './blocks'; +export * from '@storybook/blocks'; export { DocsRenderer } from './DocsRenderer'; diff --git a/code/addons/docs/src/shared.ts b/code/addons/docs/src/shared.ts deleted file mode 100644 index 178bf46ca387..000000000000 --- a/code/addons/docs/src/shared.ts +++ /dev/null @@ -1,28 +0,0 @@ -export const ADDON_ID = 'storybook/docs'; -export const PANEL_ID = `${ADDON_ID}/panel`; -export const PARAM_KEY = `docs`; - -export const SNIPPET_RENDERED = `${ADDON_ID}/snippet-rendered`; - -export enum SourceType { - /** - * AUTO is the default - * - * Use the CODE logic if: - * - the user has set a custom source snippet in `docs.source.code` story parameter - * - the story is not an args-based story - * - * Use the DYNAMIC rendered snippet if the story is an args story - */ - AUTO = 'auto', - - /** - * Render the code extracted by source-loader - */ - CODE = 'code', - - /** - * Render dynamically-rendered source snippet from the story's virtual DOM (currently React only) - */ - DYNAMIC = 'dynamic', -} diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 7445ad9c83d3..8fbdf1b5fda0 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -65,44 +65,6 @@ "peerDependencies": { "@babel/core": "^7.9.6" }, - "peerDependenciesMeta": { - "@storybook/angular": { - "optional": true - }, - "@storybook/html": { - "optional": true - }, - "@storybook/vue": { - "optional": true - }, - "@storybook/vue3": { - "optional": true - }, - "@storybook/web-components": { - "optional": true - }, - "lit": { - "optional": true - }, - "lit-html": { - "optional": true - }, - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "svelte": { - "optional": true - }, - "sveltedoc-parser": { - "optional": true - }, - "vue": { - "optional": true - } - }, "publishConfig": { "access": "public" }, diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index cc047e6a9a3e..fbab6e9ef3ad 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -38,13 +38,12 @@ "*.d.ts" ], "scripts": { + "check": "../../../scripts/node_modules/.bin/tsc --noEmit", "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/api": "7.0.0-alpha.48", "@storybook/channels": "7.0.0-alpha.48", "@storybook/client-logger": "7.0.0-alpha.48", - "@storybook/components": "7.0.0-alpha.48", "@storybook/core-events": "7.0.0-alpha.48", "@storybook/csf": "next", "@storybook/docs-tools": "7.0.0-alpha.48", @@ -53,24 +52,23 @@ "@storybook/theming": "7.0.0-alpha.48", "@storybook/types": "7.0.0-alpha.48", "@types/lodash": "^4.14.167", - "color-convert": "^2.0.1", "dequal": "^2.0.2", "global": "^4.4.0", "lodash": "^4.17.21", - "markdown-to-jsx": "^7.1.3", - "memoizerific": "^1.11.3", - "polished": "^4.2.2", - "react-colorful": "^5.1.2", - "ts-dedent": "^2.0.0", - "util-deprecate": "^1.0.2" + "memoizerific": "^1.11.3" }, "devDependencies": { "@storybook/addon-actions": "7.0.0-alpha.48", - "@storybook/addons": "7.0.0-alpha.48", - "@types/color-convert": "^2.0.0" + "@storybook/components": "7.0.0-alpha.48", + "@types/color-convert": "^2.0.0", + "color-convert": "^2.0.1", + "markdown-to-jsx": "^7.1.3", + "polished": "^4.2.2", + "react-colorful": "^5.1.2" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" }, "publishConfig": { "access": "public" diff --git a/code/ui/blocks/src/blocks/Heading.tsx b/code/ui/blocks/src/blocks/Heading.tsx index 8f2535fc3d44..351680e53c57 100644 --- a/code/ui/blocks/src/blocks/Heading.tsx +++ b/code/ui/blocks/src/blocks/Heading.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import React from 'react'; -import { H2 } from '@storybook/components'; +import { H2 } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { HeaderMdx } from './mdx'; export interface HeadingProps { diff --git a/code/ui/blocks/src/blocks/Subheading.tsx b/code/ui/blocks/src/blocks/Subheading.tsx index 857facdda25f..026d92244905 100644 --- a/code/ui/blocks/src/blocks/Subheading.tsx +++ b/code/ui/blocks/src/blocks/Subheading.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import React from 'react'; -import { H3 } from '@storybook/components'; +import { H3 } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { HeaderMdx } from './mdx'; import type { HeadingProps } from './Heading'; diff --git a/code/ui/blocks/src/blocks/enhanceSource.ts b/code/ui/blocks/src/blocks/enhanceSource.ts index 704d36abdba9..05d912f8e81e 100644 --- a/code/ui/blocks/src/blocks/enhanceSource.ts +++ b/code/ui/blocks/src/blocks/enhanceSource.ts @@ -1,5 +1,4 @@ -import type { Parameters } from '@storybook/types'; -import type { Story } from '@storybook/store'; +import type { Parameters, Store_Story } from '@storybook/types'; import { combineParameters } from '@storybook/store'; // ============================================================ @@ -77,7 +76,7 @@ const extract = (targetId: string, { source, locationsMap }: StorySource) => { return extractSource(location, lines); }; -export const enhanceSource = (story: Story): Parameters => { +export const enhanceSource = (story: Store_Story): Parameters => { const { id, parameters } = story; const { storySource, docs = {} } = parameters; const { transformSource } = docs; diff --git a/code/ui/blocks/src/blocks/external/ExternalPreview.ts b/code/ui/blocks/src/blocks/external/ExternalPreview.ts index 3f11aa9bdf46..2c9955af00d4 100644 --- a/code/ui/blocks/src/blocks/external/ExternalPreview.ts +++ b/code/ui/blocks/src/blocks/external/ExternalPreview.ts @@ -36,7 +36,7 @@ export class ExternalPreview extends P private moduleExportsByImportPath: Record = {}; - constructor(public projectAnnotations: ProjectAnnotations) { + constructor(public projectAnnotations: ProjectAnnotations) { super(new Channel()); this.initialize({ diff --git a/code/ui/blocks/src/blocks/mdx.tsx b/code/ui/blocks/src/blocks/mdx.tsx index c7e14328a6ac..a0f66b528465 100644 --- a/code/ui/blocks/src/blocks/mdx.tsx +++ b/code/ui/blocks/src/blocks/mdx.tsx @@ -1,7 +1,7 @@ import type { FC, SyntheticEvent } from 'react'; import React, { useContext } from 'react'; import { NAVIGATE_URL } from '@storybook/core-events'; -import { Code, components } from '@storybook/components'; +import { Code, components } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import global from 'global'; import { styled } from '@storybook/theming'; import { Source } from '../components'; diff --git a/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx b/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx index 2533f06842aa..1609bf8616d3 100644 --- a/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx +++ b/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React from 'react'; import { styled } from '@storybook/theming'; -import { codeCommon } from '@storybook/components'; +import { codeCommon } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { JsDocTags } from './types'; interface ArgJsDocArgs { diff --git a/code/ui/blocks/src/components/ArgsTable/ArgRow.tsx b/code/ui/blocks/src/components/ArgsTable/ArgRow.tsx index ea5f856c0027..1bc6a19ac0a5 100644 --- a/code/ui/blocks/src/components/ArgsTable/ArgRow.tsx +++ b/code/ui/blocks/src/components/ArgsTable/ArgRow.tsx @@ -1,9 +1,9 @@ import type { FC } from 'react'; import React from 'react'; -import Markdown from 'markdown-to-jsx'; -import { transparentize } from 'polished'; +import Markdown from 'markdown-to-jsx'; // eslint-disable-line import/no-extraneous-dependencies +import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { styled } from '@storybook/theming'; -import { codeCommon } from '@storybook/components'; +import { codeCommon } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { ArgType, Args, TableAnnotation } from './types'; import { ArgJsDoc } from './ArgJsDoc'; import { ArgValue } from './ArgValue'; diff --git a/code/ui/blocks/src/components/ArgsTable/ArgValue.tsx b/code/ui/blocks/src/components/ArgsTable/ArgValue.tsx index 2a101f5c71e0..96c978f24723 100644 --- a/code/ui/blocks/src/components/ArgsTable/ArgValue.tsx +++ b/code/ui/blocks/src/components/ArgsTable/ArgValue.tsx @@ -3,7 +3,7 @@ import React, { useState } from 'react'; import memoize from 'memoizerific'; import uniq from 'lodash/uniq'; import { styled } from '@storybook/theming'; -import { WithTooltipPure, Icons, SyntaxHighlighter, codeCommon } from '@storybook/components'; +import { WithTooltipPure, Icons, SyntaxHighlighter, codeCommon } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { PropSummaryValue } from './types'; interface ArgValueProps { diff --git a/code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx b/code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx index d950828b2e74..15e8e7588c82 100644 --- a/code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx +++ b/code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx @@ -2,10 +2,10 @@ import type { FC } from 'react'; import React from 'react'; import pickBy from 'lodash/pickBy'; import { styled } from '@storybook/theming'; -import { opacify, transparentize, darken, lighten } from 'polished'; +import { opacify, transparentize, darken, lighten } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { includeConditionalArg } from '@storybook/csf'; import { once } from '@storybook/client-logger'; -import { IconButton, Icons, Link, ResetWrapper } from '@storybook/components'; +import { IconButton, Icons, Link, ResetWrapper } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { ArgRow } from './ArgRow'; import { SectionRow } from './SectionRow'; diff --git a/code/ui/blocks/src/components/ArgsTable/NoControlsWarning.tsx b/code/ui/blocks/src/components/ArgsTable/NoControlsWarning.tsx index 5347cad17d42..19eaec60a3ba 100644 --- a/code/ui/blocks/src/components/ArgsTable/NoControlsWarning.tsx +++ b/code/ui/blocks/src/components/ArgsTable/NoControlsWarning.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { styled } from '@storybook/theming'; -import { Link } from '@storybook/components'; +import { Link } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies const NoControlsWrapper = styled.div(({ theme }) => ({ background: theme.background.warning, diff --git a/code/ui/blocks/src/components/ArgsTable/SectionRow.tsx b/code/ui/blocks/src/components/ArgsTable/SectionRow.tsx index 5504c9411da1..2dbe5f70545e 100644 --- a/code/ui/blocks/src/components/ArgsTable/SectionRow.tsx +++ b/code/ui/blocks/src/components/ArgsTable/SectionRow.tsx @@ -1,8 +1,8 @@ import type { FC } from 'react'; import React, { useState } from 'react'; -import { transparentize } from 'polished'; +import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { styled } from '@storybook/theming'; -import { Icons } from '@storybook/components'; +import { Icons } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies type Level = 'section' | 'subsection'; diff --git a/code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx b/code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx index 99a1b46f902c..50f4871b81f8 100644 --- a/code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx +++ b/code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import React from 'react'; -import { TabsState } from '@storybook/components'; +import { TabsState } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { ArgsTableProps, SortType } from './ArgsTable'; // eslint-disable-next-line import/no-cycle diff --git a/code/ui/blocks/src/components/ColorPalette.tsx b/code/ui/blocks/src/components/ColorPalette.tsx index 5e018b24388e..488c71b04ad9 100644 --- a/code/ui/blocks/src/components/ColorPalette.tsx +++ b/code/ui/blocks/src/components/ColorPalette.tsx @@ -1,8 +1,8 @@ import type { FunctionComponent } from 'react'; import React from 'react'; -import { transparentize } from 'polished'; +import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { styled } from '@storybook/theming'; -import { ResetWrapper } from '@storybook/components'; +import { ResetWrapper } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { getBlockBackgroundStyle } from './BlockBackgroundStyles'; diff --git a/code/ui/blocks/src/components/Description.tsx b/code/ui/blocks/src/components/Description.tsx index fa8d5fff5ae5..fc6f07dc8139 100644 --- a/code/ui/blocks/src/components/Description.tsx +++ b/code/ui/blocks/src/components/Description.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React from 'react'; -import Markdown from 'markdown-to-jsx'; -import { components, ResetWrapper } from '@storybook/components'; +import Markdown from 'markdown-to-jsx'; // eslint-disable-line import/no-extraneous-dependencies +import { components, ResetWrapper } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies export interface DescriptionProps { markdown: string; diff --git a/code/ui/blocks/src/components/DocsPage.tsx b/code/ui/blocks/src/components/DocsPage.tsx index 651c8c9c6a4f..089a02ecbd62 100644 --- a/code/ui/blocks/src/components/DocsPage.tsx +++ b/code/ui/blocks/src/components/DocsPage.tsx @@ -1,6 +1,6 @@ -import { withReset } from '@storybook/components'; +import { withReset } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { styled } from '@storybook/theming'; -import { transparentize } from 'polished'; +import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import type { FC } from 'react'; import React from 'react'; diff --git a/code/ui/blocks/src/components/EmptyBlock.tsx b/code/ui/blocks/src/components/EmptyBlock.tsx index 41e84c48070b..47f7bb15b434 100644 --- a/code/ui/blocks/src/components/EmptyBlock.tsx +++ b/code/ui/blocks/src/components/EmptyBlock.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { transparentize } from 'polished'; +import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { styled } from '@storybook/theming'; -import { withReset } from '@storybook/components'; +import { withReset } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies const Wrapper = styled.div(withReset, ({ theme }) => ({ backgroundColor: theme.base === 'light' ? 'rgba(0,0,0,.01)' : 'rgba(255,255,255,.01)', diff --git a/code/ui/blocks/src/components/IconGallery.tsx b/code/ui/blocks/src/components/IconGallery.tsx index 22456d889ae2..cf27be34a3eb 100644 --- a/code/ui/blocks/src/components/IconGallery.tsx +++ b/code/ui/blocks/src/components/IconGallery.tsx @@ -1,7 +1,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { styled } from '@storybook/theming'; -import { ResetWrapper } from '@storybook/components'; +import { ResetWrapper } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { getBlockBackgroundStyle } from './BlockBackgroundStyles'; diff --git a/code/ui/blocks/src/components/Preview.tsx b/code/ui/blocks/src/components/Preview.tsx index f93ba28cdf2f..96865be5dd46 100644 --- a/code/ui/blocks/src/components/Preview.tsx +++ b/code/ui/blocks/src/components/Preview.tsx @@ -1,10 +1,10 @@ import type { ClipboardEvent, FC, ReactElement, ReactNode } from 'react'; import React, { Children, useCallback, useState } from 'react'; -import { darken } from 'polished'; +import { darken } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { styled } from '@storybook/theming'; import global from 'global'; -import { ActionBar, Zoom } from '@storybook/components'; +import { ActionBar, Zoom } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { ActionItem } from '@storybook/components'; import type { SourceProps } from '.'; @@ -218,7 +218,7 @@ export const Preview: FC = ({ const { window: globalWindow } = global; const copyToClipboard = useCallback(async (text: string) => { - const { createCopyToClipboardFunction } = await import('@storybook/components'); + const { createCopyToClipboardFunction } = await import('@storybook/components'); // eslint-disable-line import/no-extraneous-dependencies createCopyToClipboardFunction(); }, []); diff --git a/code/ui/blocks/src/components/Source.tsx b/code/ui/blocks/src/components/Source.tsx index 26dc904b1b18..730dfc6c24a9 100644 --- a/code/ui/blocks/src/components/Source.tsx +++ b/code/ui/blocks/src/components/Source.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FunctionComponent } from 'react'; import React from 'react'; import { styled, ThemeProvider, convert, themes } from '@storybook/theming'; -import { SyntaxHighlighter } from '@storybook/components'; +import { SyntaxHighlighter } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { EmptyBlock } from './EmptyBlock'; diff --git a/code/ui/blocks/src/components/Story.tsx b/code/ui/blocks/src/components/Story.tsx index 4719a8ab6f4f..11570922cc1f 100644 --- a/code/ui/blocks/src/components/Story.tsx +++ b/code/ui/blocks/src/components/Story.tsx @@ -2,7 +2,7 @@ import global from 'global'; import type { ElementType, FunctionComponent } from 'react'; import React, { createElement, Fragment } from 'react'; import type { Parameters } from '@storybook/types'; -import { Loader, getStoryHref } from '@storybook/components'; +import { Loader, getStoryHref } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies // eslint-disable-next-line import/no-cycle import { EmptyBlock } from '.'; import { IFrame } from './IFrame'; diff --git a/code/ui/blocks/src/components/Title.tsx b/code/ui/blocks/src/components/Title.tsx index bbff95701d41..20e1db72310d 100644 --- a/code/ui/blocks/src/components/Title.tsx +++ b/code/ui/blocks/src/components/Title.tsx @@ -1,6 +1,6 @@ import type { Theme } from '@storybook/theming'; import { styled } from '@storybook/theming'; -import { withReset } from '@storybook/components'; +import { withReset } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies const breakpoint = 600; diff --git a/code/ui/blocks/src/components/Toolbar.tsx b/code/ui/blocks/src/components/Toolbar.tsx index 0838f19f1818..df1c70dff877 100644 --- a/code/ui/blocks/src/components/Toolbar.tsx +++ b/code/ui/blocks/src/components/Toolbar.tsx @@ -1,6 +1,7 @@ import type { FC, MouseEvent } from 'react'; import React, { Fragment } from 'react'; import { styled } from '@storybook/theming'; +// eslint-disable-next-line import/no-extraneous-dependencies import { FlexBar, Icons, diff --git a/code/ui/blocks/src/components/Typeset.tsx b/code/ui/blocks/src/components/Typeset.tsx index 35f0dda5f31d..4ecf8ab70929 100644 --- a/code/ui/blocks/src/components/Typeset.tsx +++ b/code/ui/blocks/src/components/Typeset.tsx @@ -1,8 +1,8 @@ import type { FC } from 'react'; import React from 'react'; -import { transparentize } from 'polished'; +import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { styled } from '@storybook/theming'; -import { withReset } from '@storybook/components'; +import { withReset } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { getBlockBackgroundStyle } from './BlockBackgroundStyles'; const Label = styled.div(({ theme }) => ({ diff --git a/code/ui/blocks/src/controls/Boolean.tsx b/code/ui/blocks/src/controls/Boolean.tsx index 8abec1e34902..8bd205b8373c 100644 --- a/code/ui/blocks/src/controls/Boolean.tsx +++ b/code/ui/blocks/src/controls/Boolean.tsx @@ -1,10 +1,10 @@ import type { FC } from 'react'; import React, { useCallback } from 'react'; -import { opacify, transparentize } from 'polished'; +import { opacify, transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; +import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { getControlId, getControlSetterButtonId } from './helpers'; import type { ControlProps, BooleanValue, BooleanConfig } from './types'; diff --git a/code/ui/blocks/src/controls/Color.tsx b/code/ui/blocks/src/controls/Color.tsx index 3fa5a655e224..995c4d1152b1 100644 --- a/code/ui/blocks/src/controls/Color.tsx +++ b/code/ui/blocks/src/controls/Color.tsx @@ -1,10 +1,10 @@ import type { FC, ChangeEvent, FocusEvent } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { HexColorPicker, HslaStringColorPicker, RgbaStringColorPicker } from 'react-colorful'; -import convert from 'color-convert'; +import { HexColorPicker, HslaStringColorPicker, RgbaStringColorPicker } from 'react-colorful'; // eslint-disable-line import/no-extraneous-dependencies +import convert from 'color-convert'; // eslint-disable-line import/no-extraneous-dependencies import throttle from 'lodash/throttle'; import { styled } from '@storybook/theming'; -import { TooltipNote, WithTooltip, Form, Icons } from '@storybook/components'; +import { TooltipNote, WithTooltip, Form, Icons } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { ControlProps, ColorValue, ColorConfig, PresetColor } from './types'; import { getControlId } from './helpers'; diff --git a/code/ui/blocks/src/controls/Date.tsx b/code/ui/blocks/src/controls/Date.tsx index 0baf920593db..a850fff46b13 100644 --- a/code/ui/blocks/src/controls/Date.tsx +++ b/code/ui/blocks/src/controls/Date.tsx @@ -1,7 +1,7 @@ import type { FC, ChangeEvent, RefObject } from 'react'; import React, { useState, useRef, useEffect } from 'react'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; +import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { ControlProps, DateValue, DateConfig } from './types'; import { getControlId } from './helpers'; diff --git a/code/ui/blocks/src/controls/Files.tsx b/code/ui/blocks/src/controls/Files.tsx index 2354703c2917..eb80b40fe8d1 100644 --- a/code/ui/blocks/src/controls/Files.tsx +++ b/code/ui/blocks/src/controls/Files.tsx @@ -1,7 +1,7 @@ import type { ChangeEvent, FC } from 'react'; import React from 'react'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; +import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { ControlProps } from './types'; import { getControlId } from './helpers'; diff --git a/code/ui/blocks/src/controls/Number.tsx b/code/ui/blocks/src/controls/Number.tsx index 551d5fb7417e..42a8ae2129dd 100644 --- a/code/ui/blocks/src/controls/Number.tsx +++ b/code/ui/blocks/src/controls/Number.tsx @@ -1,7 +1,7 @@ import type { FC, ChangeEvent } from 'react'; import React, { useState, useCallback, useEffect, useRef } from 'react'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; +import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { getControlId, getControlSetterButtonId } from './helpers'; import type { ControlProps, NumberValue, NumberConfig } from './types'; diff --git a/code/ui/blocks/src/controls/Object.tsx b/code/ui/blocks/src/controls/Object.tsx index fbd0a91ab9ad..e628afee6ec6 100644 --- a/code/ui/blocks/src/controls/Object.tsx +++ b/code/ui/blocks/src/controls/Object.tsx @@ -3,7 +3,7 @@ import cloneDeep from 'lodash/cloneDeep'; import type { ComponentProps, SyntheticEvent, FC, FocusEvent } from 'react'; import React, { useCallback, useMemo, useState, useEffect, useRef } from 'react'; import { styled, useTheme, type Theme } from '@storybook/theming'; -import { Form, Icons, type IconsProps, IconButton } from '@storybook/components'; +import { Form, Icons, type IconsProps, IconButton } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { JsonTree, getObjectType } from './react-editable-json-tree'; import { getControlId, getControlSetterButtonId } from './helpers'; import type { ControlProps, ObjectValue, ObjectConfig } from './types'; diff --git a/code/ui/blocks/src/controls/Range.tsx b/code/ui/blocks/src/controls/Range.tsx index adf0aafd11f8..0c5459ca6f06 100644 --- a/code/ui/blocks/src/controls/Range.tsx +++ b/code/ui/blocks/src/controls/Range.tsx @@ -2,7 +2,7 @@ import type { FC, ChangeEvent } from 'react'; import React, { useMemo } from 'react'; import { styled } from '@storybook/theming'; -import { lighten, darken, rgba } from 'polished'; +import { lighten, darken, rgba } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies import { getControlId } from './helpers'; import type { ControlProps, NumberValue, RangeConfig } from './types'; diff --git a/code/ui/blocks/src/controls/Text.tsx b/code/ui/blocks/src/controls/Text.tsx index d7a1e312784d..ec7d45643abe 100644 --- a/code/ui/blocks/src/controls/Text.tsx +++ b/code/ui/blocks/src/controls/Text.tsx @@ -1,7 +1,7 @@ import type { FC, ChangeEvent } from 'react'; import React, { useCallback, useState } from 'react'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; +import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import { getControlId, getControlSetterButtonId } from './helpers'; import type { ControlProps, TextValue, TextConfig } from './types'; diff --git a/code/ui/blocks/src/controls/options/Select.tsx b/code/ui/blocks/src/controls/options/Select.tsx index f033c131bd71..ffca796a50eb 100644 --- a/code/ui/blocks/src/controls/options/Select.tsx +++ b/code/ui/blocks/src/controls/options/Select.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { styled } from '@storybook/theming'; import type { CSSObject } from '@storybook/theming'; import { logger } from '@storybook/client-logger'; -import { Icons } from '@storybook/components'; +import { Icons } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies import type { ControlProps, OptionsSelection, NormalizedOptionsConfig } from '../types'; diff --git a/code/ui/blocks/src/controls/react-editable-json-tree/JsonNodes.tsx b/code/ui/blocks/src/controls/react-editable-json-tree/JsonNodes.tsx index c78738a2aff0..541a2423d6d1 100644 --- a/code/ui/blocks/src/controls/react-editable-json-tree/JsonNodes.tsx +++ b/code/ui/blocks/src/controls/react-editable-json-tree/JsonNodes.tsx @@ -1086,7 +1086,6 @@ export class JsonObject extends Component { onChildUpdate(childKey: string, childData: any) { const { data, keyPath } = this.state; // Update data - // @ts-expect-error (Converted from ts-ignore) data[childKey] = childData; // Put new data this.setState({ @@ -1117,7 +1116,6 @@ export class JsonObject extends Component { beforeAddAction(key, keyPath, deep, newValue) .then(() => { // Update data - // @ts-expect-error (Converted from ts-ignore) data[key] = newValue; this.setState({ data, @@ -1143,7 +1141,6 @@ export class JsonObject extends Component { return () => { const { beforeRemoveAction, logger } = this.props; const { data, keyPath, nextDeep: deep } = this.state; - // @ts-expect-error (Converted from ts-ignore) const oldValue = data[key]; // Before Remove Action beforeRemoveAction(key, keyPath, deep, oldValue) @@ -1156,7 +1153,6 @@ export class JsonObject extends Component { type: deltaTypes.REMOVE_DELTA_TYPE, }; - // @ts-expect-error (Converted from ts-ignore) delete data[key]; this.setState({ data }); @@ -1182,14 +1178,12 @@ export class JsonObject extends Component { const { data, keyPath, nextDeep: deep } = this.state; // Old value - // @ts-expect-error (Converted from ts-ignore) const oldValue = data[key]; // Before update action beforeUpdateAction(key, keyPath, deep, oldValue, value) .then(() => { // Update value - // @ts-expect-error (Converted from ts-ignore) data[key] = value; // Set state this.setState({ From 68a1520b34a2cb7832cd58f1aa236768ff2a6b0f Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 9 Nov 2022 15:59:35 +0100 Subject: [PATCH 02/14] fix lockfile --- code/yarn.lock | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/code/yarn.lock b/code/yarn.lock index 94bd1fa12d23..59716c2a898e 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5501,23 +5501,15 @@ __metadata: "@babel/plugin-transform-react-jsx": ^7.12.12 "@jest/transform": ^26.6.2 "@mdx-js/react": ^2.1.5 - "@storybook/addons": 7.0.0-alpha.48 - "@storybook/api": 7.0.0-alpha.48 "@storybook/blocks": 7.0.0-alpha.48 "@storybook/components": 7.0.0-alpha.48 - "@storybook/core-common": 7.0.0-alpha.48 - "@storybook/core-events": 7.0.0-alpha.48 "@storybook/csf-plugin": 7.0.0-alpha.48 "@storybook/csf-tools": 7.0.0-alpha.48 - "@storybook/docs-tools": 7.0.0-alpha.48 "@storybook/mdx2-csf": next "@storybook/node-logger": 7.0.0-alpha.48 "@storybook/postinstall": 7.0.0-alpha.48 "@storybook/preview-web": 7.0.0-alpha.48 - "@storybook/store": 7.0.0-alpha.48 - "@storybook/theming": 7.0.0-alpha.48 "@storybook/types": 7.0.0-alpha.48 - dequal: ^2.0.2 fs-extra: ^9.0.1 global: ^4.4.0 remark-external-links: ^8.0.0 @@ -5559,31 +5551,6 @@ __metadata: typescript: ~4.6.3 peerDependencies: "@babel/core": ^7.9.6 - peerDependenciesMeta: - "@storybook/angular": - optional: true - "@storybook/html": - optional: true - "@storybook/vue": - optional: true - "@storybook/vue3": - optional: true - "@storybook/web-components": - optional: true - lit: - optional: true - lit-html: - optional: true - react: - optional: true - react-dom: - optional: true - svelte: - optional: true - sveltedoc-parser: - optional: true - vue: - optional: true languageName: unknown linkType: soft @@ -6124,8 +6091,6 @@ __metadata: resolution: "@storybook/blocks@workspace:ui/blocks" dependencies: "@storybook/addon-actions": 7.0.0-alpha.48 - "@storybook/addons": 7.0.0-alpha.48 - "@storybook/api": 7.0.0-alpha.48 "@storybook/channels": 7.0.0-alpha.48 "@storybook/client-logger": 7.0.0-alpha.48 "@storybook/components": 7.0.0-alpha.48 @@ -6146,10 +6111,9 @@ __metadata: memoizerific: ^1.11.3 polished: ^4.2.2 react-colorful: ^5.1.2 - ts-dedent: ^2.0.0 - util-deprecate: ^1.0.2 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 languageName: unknown linkType: soft From 5033b32fe1c6f79ffb401bec0398cc53fc81c1bd Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 9 Nov 2022 16:20:24 +0100 Subject: [PATCH 03/14] add extra export --- code/addons/docs/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 4f927a07d114..09505e3ae536 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -42,6 +42,7 @@ }, "./svelte/HOC.svelte": "./svelte/HOC.svelte", "./ember/index.js": "./ember/index.js", + "./angular/index.js": "./angular/index.js", "./web-components/index.js": "./web-components/index.js", "./jest-transform-mdx.js": "./jest-transform-mdx.js", "./package.json": "./package.json" From 10cfd908665560fe0642652ef57e11b9de0fd175 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 9 Nov 2022 17:00:09 +0100 Subject: [PATCH 04/14] fixes --- code/addons/docs/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 09505e3ae536..0d04b9bd0431 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -41,7 +41,9 @@ "types": "./dist/preset.d.ts" }, "./svelte/HOC.svelte": "./svelte/HOC.svelte", + "./ember": "./ember/index.js", "./ember/index.js": "./ember/index.js", + "./angular": "./angular/index.js", "./angular/index.js": "./angular/index.js", "./web-components/index.js": "./web-components/index.js", "./jest-transform-mdx.js": "./jest-transform-mdx.js", From 7f1d82bf62a4f7eefeb75f8eca10827df54be162 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 9 Nov 2022 17:17:35 +0100 Subject: [PATCH 05/14] bump it to a bigger runner --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ef32f6fb4984..22621bd9b616 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -378,7 +378,7 @@ jobs: yarn coverage chromatic-internal-storybooks: executor: - class: medium + class: medium+ name: sb_node_16_browsers steps: # switched this to the CircleCI helper to get the full git history for TurboSnap From bca3cba0e87918dd7054783860e84de2bf984155 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 10 Nov 2022 10:22:07 +0100 Subject: [PATCH 06/14] fix --- code/addons/docs/package.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/addons/docs/package.json b/code/addons/docs/package.json index 0d04b9bd0431..cc68b2b3873e 100644 --- a/code/addons/docs/package.json +++ b/code/addons/docs/package.json @@ -40,6 +40,16 @@ "import": "./dist/preset.mjs", "types": "./dist/preset.d.ts" }, + "./dist/preview": { + "require": "./dist/preview.js", + "import": "./dist/preview.mjs", + "types": "./dist/preview.d.ts" + }, + "./dist/preset": { + "require": "./dist/preset.js", + "import": "./dist/preset.mjs", + "types": "./dist/preset.d.ts" + }, "./svelte/HOC.svelte": "./svelte/HOC.svelte", "./ember": "./ember/index.js", "./ember/index.js": "./ember/index.js", From a255e097f92821066bf2516fb43fa0a8a43dfe8c Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 10 Nov 2022 10:28:16 +0100 Subject: [PATCH 07/14] oops --- code/addons/docs/src/preset.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/addons/docs/src/preset.ts b/code/addons/docs/src/preset.ts index ea530d2ae670..4172b8be14cf 100644 --- a/code/addons/docs/src/preset.ts +++ b/code/addons/docs/src/preset.ts @@ -190,7 +190,7 @@ const docs = (docsOptions: DocsOptions) => { * something down the dependency chain is using typescript namespaces, which are not supported by rollup-plugin-dts */ const webpackX = webpack as any; -const storyIndexersX = webpack as any; +const storyIndexersX = storyIndexers as any; const docsX = docs as any; export { webpackX as webpack, storyIndexersX as storyIndexers, docsX as docs }; From 6b7c45b61fc34d83b9d97b24b57d2693a17a3762 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 10 Nov 2022 10:43:59 +0100 Subject: [PATCH 08/14] fix linting --- code/addons/essentials/src/docs/preset.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/code/addons/essentials/src/docs/preset.ts b/code/addons/essentials/src/docs/preset.ts index 2f73e99c7e58..dca808a37dd7 100644 --- a/code/addons/essentials/src/docs/preset.ts +++ b/code/addons/essentials/src/docs/preset.ts @@ -1 +1,2 @@ +/* eslint-disable import/export */ export * from '@storybook/addon-docs/dist/preset'; From 9fc90597d9445e852b3324ccc39f7c8b47ea1758 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 10 Nov 2022 17:00:44 +0100 Subject: [PATCH 09/14] revert bundling in components into blocks --- code/ui/blocks/package.json | 18 +++++++++++------- scripts/prepare/bundle.ts | 12 +++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index fbab6e9ef3ad..72c46be00fa6 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -42,8 +42,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { + "@storybook/api": "7.0.0-alpha.48", "@storybook/channels": "7.0.0-alpha.48", "@storybook/client-logger": "7.0.0-alpha.48", + "@storybook/components": "7.0.0-alpha.48", "@storybook/core-events": "7.0.0-alpha.48", "@storybook/csf": "next", "@storybook/docs-tools": "7.0.0-alpha.48", @@ -52,19 +54,21 @@ "@storybook/theming": "7.0.0-alpha.48", "@storybook/types": "7.0.0-alpha.48", "@types/lodash": "^4.14.167", + "color-convert": "^2.0.1", "dequal": "^2.0.2", "global": "^4.4.0", "lodash": "^4.17.21", - "memoizerific": "^1.11.3" + "markdown-to-jsx": "^7.1.3", + "memoizerific": "^1.11.3", + "polished": "^4.2.2", + "react-colorful": "^5.1.2", + "ts-dedent": "^2.0.0", + "util-deprecate": "^1.0.2" }, "devDependencies": { "@storybook/addon-actions": "7.0.0-alpha.48", - "@storybook/components": "7.0.0-alpha.48", - "@types/color-convert": "^2.0.0", - "color-convert": "^2.0.1", - "markdown-to-jsx": "^7.1.3", - "polished": "^4.2.2", - "react-colorful": "^5.1.2" + "@storybook/addons": "7.0.0-alpha.48", + "@types/color-convert": "^2.0.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/scripts/prepare/bundle.ts b/scripts/prepare/bundle.ts index b5dd30121603..b75f6a55e1b6 100755 --- a/scripts/prepare/bundle.ts +++ b/scripts/prepare/bundle.ts @@ -37,12 +37,14 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { entries.map(async (file: string) => { console.log(`skipping generating types for ${file}`); const { name: entryName, dir } = path.parse(file); - + const pathName = join(process.cwd(), dir.replace('./src', 'dist'), `${entryName}.d.ts`); const srcName = join(process.cwd(), file); - - const rel = relative(dirname(pathName), dirname(srcName)).split(path.sep).join(path.posix.sep); - + + const rel = relative(dirname(pathName), dirname(srcName)) + .split(path.sep) + .join(path.posix.sep); + await fs.ensureFile(pathName); await fs.writeFile( pathName, @@ -54,7 +56,7 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => { }) ); } - + const tsConfigPath = join(cwd, 'tsconfig.json'); const tsConfigExists = await fs.pathExists(tsConfigPath); await Promise.all([ From c761a0a984cb8a76e8a4daf3b5b6b4f4762aa338 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 10 Nov 2022 17:05:03 +0100 Subject: [PATCH 10/14] fix lockfile --- code/yarn.lock | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/yarn.lock b/code/yarn.lock index 59716c2a898e..23f0dcdb2b89 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6091,6 +6091,8 @@ __metadata: resolution: "@storybook/blocks@workspace:ui/blocks" dependencies: "@storybook/addon-actions": 7.0.0-alpha.48 + "@storybook/addons": 7.0.0-alpha.48 + "@storybook/api": 7.0.0-alpha.48 "@storybook/channels": 7.0.0-alpha.48 "@storybook/client-logger": 7.0.0-alpha.48 "@storybook/components": 7.0.0-alpha.48 @@ -6111,6 +6113,8 @@ __metadata: memoizerific: ^1.11.3 polished: ^4.2.2 react-colorful: ^5.1.2 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 From bd15d4ea78be59ee56aac3e78c86d7c46e33b895 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 11 Nov 2022 09:03:19 +0100 Subject: [PATCH 11/14] linting --- code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx | 4 ++-- code/ui/blocks/src/components/Preview.tsx | 6 +++--- code/ui/blocks/src/controls/Color.tsx | 6 +++--- code/ui/blocks/src/controls/Date.tsx | 2 +- code/ui/blocks/src/controls/Number.tsx | 2 +- code/ui/blocks/src/controls/Object.tsx | 2 +- code/ui/blocks/src/controls/Text.tsx | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx b/code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx index 15e8e7588c82..d950828b2e74 100644 --- a/code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx +++ b/code/ui/blocks/src/components/ArgsTable/ArgsTable.tsx @@ -2,10 +2,10 @@ import type { FC } from 'react'; import React from 'react'; import pickBy from 'lodash/pickBy'; import { styled } from '@storybook/theming'; -import { opacify, transparentize, darken, lighten } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { opacify, transparentize, darken, lighten } from 'polished'; import { includeConditionalArg } from '@storybook/csf'; import { once } from '@storybook/client-logger'; -import { IconButton, Icons, Link, ResetWrapper } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { IconButton, Icons, Link, ResetWrapper } from '@storybook/components'; import { ArgRow } from './ArgRow'; import { SectionRow } from './SectionRow'; diff --git a/code/ui/blocks/src/components/Preview.tsx b/code/ui/blocks/src/components/Preview.tsx index 96865be5dd46..f93ba28cdf2f 100644 --- a/code/ui/blocks/src/components/Preview.tsx +++ b/code/ui/blocks/src/components/Preview.tsx @@ -1,10 +1,10 @@ import type { ClipboardEvent, FC, ReactElement, ReactNode } from 'react'; import React, { Children, useCallback, useState } from 'react'; -import { darken } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { darken } from 'polished'; import { styled } from '@storybook/theming'; import global from 'global'; -import { ActionBar, Zoom } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { ActionBar, Zoom } from '@storybook/components'; import type { ActionItem } from '@storybook/components'; import type { SourceProps } from '.'; @@ -218,7 +218,7 @@ export const Preview: FC = ({ const { window: globalWindow } = global; const copyToClipboard = useCallback(async (text: string) => { - const { createCopyToClipboardFunction } = await import('@storybook/components'); // eslint-disable-line import/no-extraneous-dependencies + const { createCopyToClipboardFunction } = await import('@storybook/components'); createCopyToClipboardFunction(); }, []); diff --git a/code/ui/blocks/src/controls/Color.tsx b/code/ui/blocks/src/controls/Color.tsx index 995c4d1152b1..3fa5a655e224 100644 --- a/code/ui/blocks/src/controls/Color.tsx +++ b/code/ui/blocks/src/controls/Color.tsx @@ -1,10 +1,10 @@ import type { FC, ChangeEvent, FocusEvent } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { HexColorPicker, HslaStringColorPicker, RgbaStringColorPicker } from 'react-colorful'; // eslint-disable-line import/no-extraneous-dependencies -import convert from 'color-convert'; // eslint-disable-line import/no-extraneous-dependencies +import { HexColorPicker, HslaStringColorPicker, RgbaStringColorPicker } from 'react-colorful'; +import convert from 'color-convert'; import throttle from 'lodash/throttle'; import { styled } from '@storybook/theming'; -import { TooltipNote, WithTooltip, Form, Icons } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { TooltipNote, WithTooltip, Form, Icons } from '@storybook/components'; import type { ControlProps, ColorValue, ColorConfig, PresetColor } from './types'; import { getControlId } from './helpers'; diff --git a/code/ui/blocks/src/controls/Date.tsx b/code/ui/blocks/src/controls/Date.tsx index a850fff46b13..0baf920593db 100644 --- a/code/ui/blocks/src/controls/Date.tsx +++ b/code/ui/blocks/src/controls/Date.tsx @@ -1,7 +1,7 @@ import type { FC, ChangeEvent, RefObject } from 'react'; import React, { useState, useRef, useEffect } from 'react'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Form } from '@storybook/components'; import type { ControlProps, DateValue, DateConfig } from './types'; import { getControlId } from './helpers'; diff --git a/code/ui/blocks/src/controls/Number.tsx b/code/ui/blocks/src/controls/Number.tsx index 42a8ae2129dd..551d5fb7417e 100644 --- a/code/ui/blocks/src/controls/Number.tsx +++ b/code/ui/blocks/src/controls/Number.tsx @@ -1,7 +1,7 @@ import type { FC, ChangeEvent } from 'react'; import React, { useState, useCallback, useEffect, useRef } from 'react'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Form } from '@storybook/components'; import { getControlId, getControlSetterButtonId } from './helpers'; import type { ControlProps, NumberValue, NumberConfig } from './types'; diff --git a/code/ui/blocks/src/controls/Object.tsx b/code/ui/blocks/src/controls/Object.tsx index e628afee6ec6..fbd0a91ab9ad 100644 --- a/code/ui/blocks/src/controls/Object.tsx +++ b/code/ui/blocks/src/controls/Object.tsx @@ -3,7 +3,7 @@ import cloneDeep from 'lodash/cloneDeep'; import type { ComponentProps, SyntheticEvent, FC, FocusEvent } from 'react'; import React, { useCallback, useMemo, useState, useEffect, useRef } from 'react'; import { styled, useTheme, type Theme } from '@storybook/theming'; -import { Form, Icons, type IconsProps, IconButton } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Form, Icons, type IconsProps, IconButton } from '@storybook/components'; import { JsonTree, getObjectType } from './react-editable-json-tree'; import { getControlId, getControlSetterButtonId } from './helpers'; import type { ControlProps, ObjectValue, ObjectConfig } from './types'; diff --git a/code/ui/blocks/src/controls/Text.tsx b/code/ui/blocks/src/controls/Text.tsx index ec7d45643abe..d7a1e312784d 100644 --- a/code/ui/blocks/src/controls/Text.tsx +++ b/code/ui/blocks/src/controls/Text.tsx @@ -1,7 +1,7 @@ import type { FC, ChangeEvent } from 'react'; import React, { useCallback, useState } from 'react'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Form } from '@storybook/components'; import { getControlId, getControlSetterButtonId } from './helpers'; import type { ControlProps, TextValue, TextConfig } from './types'; From 0db63b1ba5b8491e30053543527e578022aee0f3 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 11 Nov 2022 09:36:51 +0100 Subject: [PATCH 12/14] fix linting --- code/ui/blocks/src/blocks/Heading.tsx | 2 +- code/ui/blocks/src/blocks/Subheading.tsx | 2 +- code/ui/blocks/src/blocks/mdx.tsx | 2 +- code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx | 2 +- code/ui/blocks/src/components/ArgsTable/ArgRow.tsx | 6 +++--- code/ui/blocks/src/components/ArgsTable/ArgValue.tsx | 2 +- .../blocks/src/components/ArgsTable/NoControlsWarning.tsx | 2 +- code/ui/blocks/src/components/ArgsTable/SectionRow.tsx | 4 ++-- code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx | 2 +- code/ui/blocks/src/components/ColorPalette.tsx | 4 ++-- code/ui/blocks/src/components/Description.tsx | 4 ++-- code/ui/blocks/src/components/DocsPage.tsx | 4 ++-- code/ui/blocks/src/components/EmptyBlock.tsx | 4 ++-- code/ui/blocks/src/components/IconGallery.tsx | 2 +- code/ui/blocks/src/components/Source.tsx | 2 +- code/ui/blocks/src/components/Story.tsx | 2 +- code/ui/blocks/src/components/Title.tsx | 2 +- code/ui/blocks/src/components/Typeset.tsx | 4 ++-- code/ui/blocks/src/controls/Boolean.tsx | 4 ++-- code/ui/blocks/src/controls/Files.tsx | 2 +- code/ui/blocks/src/controls/options/Select.tsx | 2 +- 21 files changed, 30 insertions(+), 30 deletions(-) diff --git a/code/ui/blocks/src/blocks/Heading.tsx b/code/ui/blocks/src/blocks/Heading.tsx index 351680e53c57..8f2535fc3d44 100644 --- a/code/ui/blocks/src/blocks/Heading.tsx +++ b/code/ui/blocks/src/blocks/Heading.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import React from 'react'; -import { H2 } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { H2 } from '@storybook/components'; import { HeaderMdx } from './mdx'; export interface HeadingProps { diff --git a/code/ui/blocks/src/blocks/Subheading.tsx b/code/ui/blocks/src/blocks/Subheading.tsx index 026d92244905..857facdda25f 100644 --- a/code/ui/blocks/src/blocks/Subheading.tsx +++ b/code/ui/blocks/src/blocks/Subheading.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import React from 'react'; -import { H3 } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { H3 } from '@storybook/components'; import { HeaderMdx } from './mdx'; import type { HeadingProps } from './Heading'; diff --git a/code/ui/blocks/src/blocks/mdx.tsx b/code/ui/blocks/src/blocks/mdx.tsx index a0f66b528465..c7e14328a6ac 100644 --- a/code/ui/blocks/src/blocks/mdx.tsx +++ b/code/ui/blocks/src/blocks/mdx.tsx @@ -1,7 +1,7 @@ import type { FC, SyntheticEvent } from 'react'; import React, { useContext } from 'react'; import { NAVIGATE_URL } from '@storybook/core-events'; -import { Code, components } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Code, components } from '@storybook/components'; import global from 'global'; import { styled } from '@storybook/theming'; import { Source } from '../components'; diff --git a/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx b/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx index 1609bf8616d3..2533f06842aa 100644 --- a/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx +++ b/code/ui/blocks/src/components/ArgsTable/ArgJsDoc.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React from 'react'; import { styled } from '@storybook/theming'; -import { codeCommon } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { codeCommon } from '@storybook/components'; import type { JsDocTags } from './types'; interface ArgJsDocArgs { diff --git a/code/ui/blocks/src/components/ArgsTable/ArgRow.tsx b/code/ui/blocks/src/components/ArgsTable/ArgRow.tsx index 1bc6a19ac0a5..ea5f856c0027 100644 --- a/code/ui/blocks/src/components/ArgsTable/ArgRow.tsx +++ b/code/ui/blocks/src/components/ArgsTable/ArgRow.tsx @@ -1,9 +1,9 @@ import type { FC } from 'react'; import React from 'react'; -import Markdown from 'markdown-to-jsx'; // eslint-disable-line import/no-extraneous-dependencies -import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import Markdown from 'markdown-to-jsx'; +import { transparentize } from 'polished'; import { styled } from '@storybook/theming'; -import { codeCommon } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { codeCommon } from '@storybook/components'; import type { ArgType, Args, TableAnnotation } from './types'; import { ArgJsDoc } from './ArgJsDoc'; import { ArgValue } from './ArgValue'; diff --git a/code/ui/blocks/src/components/ArgsTable/ArgValue.tsx b/code/ui/blocks/src/components/ArgsTable/ArgValue.tsx index 96c978f24723..2a101f5c71e0 100644 --- a/code/ui/blocks/src/components/ArgsTable/ArgValue.tsx +++ b/code/ui/blocks/src/components/ArgsTable/ArgValue.tsx @@ -3,7 +3,7 @@ import React, { useState } from 'react'; import memoize from 'memoizerific'; import uniq from 'lodash/uniq'; import { styled } from '@storybook/theming'; -import { WithTooltipPure, Icons, SyntaxHighlighter, codeCommon } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { WithTooltipPure, Icons, SyntaxHighlighter, codeCommon } from '@storybook/components'; import type { PropSummaryValue } from './types'; interface ArgValueProps { diff --git a/code/ui/blocks/src/components/ArgsTable/NoControlsWarning.tsx b/code/ui/blocks/src/components/ArgsTable/NoControlsWarning.tsx index 19eaec60a3ba..5347cad17d42 100644 --- a/code/ui/blocks/src/components/ArgsTable/NoControlsWarning.tsx +++ b/code/ui/blocks/src/components/ArgsTable/NoControlsWarning.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { styled } from '@storybook/theming'; -import { Link } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Link } from '@storybook/components'; const NoControlsWrapper = styled.div(({ theme }) => ({ background: theme.background.warning, diff --git a/code/ui/blocks/src/components/ArgsTable/SectionRow.tsx b/code/ui/blocks/src/components/ArgsTable/SectionRow.tsx index 2dbe5f70545e..5504c9411da1 100644 --- a/code/ui/blocks/src/components/ArgsTable/SectionRow.tsx +++ b/code/ui/blocks/src/components/ArgsTable/SectionRow.tsx @@ -1,8 +1,8 @@ import type { FC } from 'react'; import React, { useState } from 'react'; -import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { transparentize } from 'polished'; import { styled } from '@storybook/theming'; -import { Icons } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Icons } from '@storybook/components'; type Level = 'section' | 'subsection'; diff --git a/code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx b/code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx index 50f4871b81f8..99a1b46f902c 100644 --- a/code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx +++ b/code/ui/blocks/src/components/ArgsTable/TabbedArgsTable.tsx @@ -1,6 +1,6 @@ import type { FC } from 'react'; import React from 'react'; -import { TabsState } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { TabsState } from '@storybook/components'; import type { ArgsTableProps, SortType } from './ArgsTable'; // eslint-disable-next-line import/no-cycle diff --git a/code/ui/blocks/src/components/ColorPalette.tsx b/code/ui/blocks/src/components/ColorPalette.tsx index 488c71b04ad9..5e018b24388e 100644 --- a/code/ui/blocks/src/components/ColorPalette.tsx +++ b/code/ui/blocks/src/components/ColorPalette.tsx @@ -1,8 +1,8 @@ import type { FunctionComponent } from 'react'; import React from 'react'; -import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { transparentize } from 'polished'; import { styled } from '@storybook/theming'; -import { ResetWrapper } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { ResetWrapper } from '@storybook/components'; import { getBlockBackgroundStyle } from './BlockBackgroundStyles'; diff --git a/code/ui/blocks/src/components/Description.tsx b/code/ui/blocks/src/components/Description.tsx index fc6f07dc8139..fa8d5fff5ae5 100644 --- a/code/ui/blocks/src/components/Description.tsx +++ b/code/ui/blocks/src/components/Description.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import React from 'react'; -import Markdown from 'markdown-to-jsx'; // eslint-disable-line import/no-extraneous-dependencies -import { components, ResetWrapper } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import Markdown from 'markdown-to-jsx'; +import { components, ResetWrapper } from '@storybook/components'; export interface DescriptionProps { markdown: string; diff --git a/code/ui/blocks/src/components/DocsPage.tsx b/code/ui/blocks/src/components/DocsPage.tsx index 089a02ecbd62..651c8c9c6a4f 100644 --- a/code/ui/blocks/src/components/DocsPage.tsx +++ b/code/ui/blocks/src/components/DocsPage.tsx @@ -1,6 +1,6 @@ -import { withReset } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { withReset } from '@storybook/components'; import { styled } from '@storybook/theming'; -import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { transparentize } from 'polished'; import type { FC } from 'react'; import React from 'react'; diff --git a/code/ui/blocks/src/components/EmptyBlock.tsx b/code/ui/blocks/src/components/EmptyBlock.tsx index 47f7bb15b434..41e84c48070b 100644 --- a/code/ui/blocks/src/components/EmptyBlock.tsx +++ b/code/ui/blocks/src/components/EmptyBlock.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { transparentize } from 'polished'; import { styled } from '@storybook/theming'; -import { withReset } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { withReset } from '@storybook/components'; const Wrapper = styled.div(withReset, ({ theme }) => ({ backgroundColor: theme.base === 'light' ? 'rgba(0,0,0,.01)' : 'rgba(255,255,255,.01)', diff --git a/code/ui/blocks/src/components/IconGallery.tsx b/code/ui/blocks/src/components/IconGallery.tsx index cf27be34a3eb..22456d889ae2 100644 --- a/code/ui/blocks/src/components/IconGallery.tsx +++ b/code/ui/blocks/src/components/IconGallery.tsx @@ -1,7 +1,7 @@ import type { FunctionComponent } from 'react'; import React from 'react'; import { styled } from '@storybook/theming'; -import { ResetWrapper } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { ResetWrapper } from '@storybook/components'; import { getBlockBackgroundStyle } from './BlockBackgroundStyles'; diff --git a/code/ui/blocks/src/components/Source.tsx b/code/ui/blocks/src/components/Source.tsx index 730dfc6c24a9..26dc904b1b18 100644 --- a/code/ui/blocks/src/components/Source.tsx +++ b/code/ui/blocks/src/components/Source.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FunctionComponent } from 'react'; import React from 'react'; import { styled, ThemeProvider, convert, themes } from '@storybook/theming'; -import { SyntaxHighlighter } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { SyntaxHighlighter } from '@storybook/components'; import { EmptyBlock } from './EmptyBlock'; diff --git a/code/ui/blocks/src/components/Story.tsx b/code/ui/blocks/src/components/Story.tsx index 11570922cc1f..4719a8ab6f4f 100644 --- a/code/ui/blocks/src/components/Story.tsx +++ b/code/ui/blocks/src/components/Story.tsx @@ -2,7 +2,7 @@ import global from 'global'; import type { ElementType, FunctionComponent } from 'react'; import React, { createElement, Fragment } from 'react'; import type { Parameters } from '@storybook/types'; -import { Loader, getStoryHref } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Loader, getStoryHref } from '@storybook/components'; // eslint-disable-next-line import/no-cycle import { EmptyBlock } from '.'; import { IFrame } from './IFrame'; diff --git a/code/ui/blocks/src/components/Title.tsx b/code/ui/blocks/src/components/Title.tsx index 20e1db72310d..bbff95701d41 100644 --- a/code/ui/blocks/src/components/Title.tsx +++ b/code/ui/blocks/src/components/Title.tsx @@ -1,6 +1,6 @@ import type { Theme } from '@storybook/theming'; import { styled } from '@storybook/theming'; -import { withReset } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { withReset } from '@storybook/components'; const breakpoint = 600; diff --git a/code/ui/blocks/src/components/Typeset.tsx b/code/ui/blocks/src/components/Typeset.tsx index 4ecf8ab70929..35f0dda5f31d 100644 --- a/code/ui/blocks/src/components/Typeset.tsx +++ b/code/ui/blocks/src/components/Typeset.tsx @@ -1,8 +1,8 @@ import type { FC } from 'react'; import React from 'react'; -import { transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { transparentize } from 'polished'; import { styled } from '@storybook/theming'; -import { withReset } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { withReset } from '@storybook/components'; import { getBlockBackgroundStyle } from './BlockBackgroundStyles'; const Label = styled.div(({ theme }) => ({ diff --git a/code/ui/blocks/src/controls/Boolean.tsx b/code/ui/blocks/src/controls/Boolean.tsx index 8bd205b8373c..8abec1e34902 100644 --- a/code/ui/blocks/src/controls/Boolean.tsx +++ b/code/ui/blocks/src/controls/Boolean.tsx @@ -1,10 +1,10 @@ import type { FC } from 'react'; import React, { useCallback } from 'react'; -import { opacify, transparentize } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { opacify, transparentize } from 'polished'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Form } from '@storybook/components'; import { getControlId, getControlSetterButtonId } from './helpers'; import type { ControlProps, BooleanValue, BooleanConfig } from './types'; diff --git a/code/ui/blocks/src/controls/Files.tsx b/code/ui/blocks/src/controls/Files.tsx index eb80b40fe8d1..2354703c2917 100644 --- a/code/ui/blocks/src/controls/Files.tsx +++ b/code/ui/blocks/src/controls/Files.tsx @@ -1,7 +1,7 @@ import type { ChangeEvent, FC } from 'react'; import React from 'react'; import { styled } from '@storybook/theming'; -import { Form } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Form } from '@storybook/components'; import type { ControlProps } from './types'; import { getControlId } from './helpers'; diff --git a/code/ui/blocks/src/controls/options/Select.tsx b/code/ui/blocks/src/controls/options/Select.tsx index ffca796a50eb..f033c131bd71 100644 --- a/code/ui/blocks/src/controls/options/Select.tsx +++ b/code/ui/blocks/src/controls/options/Select.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { styled } from '@storybook/theming'; import type { CSSObject } from '@storybook/theming'; import { logger } from '@storybook/client-logger'; -import { Icons } from '@storybook/components'; // eslint-disable-line import/no-extraneous-dependencies +import { Icons } from '@storybook/components'; import type { ControlProps, OptionsSelection, NormalizedOptionsConfig } from '../types'; From 43871bc1622eca57dfdb69b8a53bd1f0ac14f67b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 11 Nov 2022 09:45:17 +0100 Subject: [PATCH 13/14] fixes --- code/ui/blocks/src/components/Toolbar.tsx | 1 - code/ui/blocks/src/controls/Range.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/code/ui/blocks/src/components/Toolbar.tsx b/code/ui/blocks/src/components/Toolbar.tsx index df1c70dff877..0838f19f1818 100644 --- a/code/ui/blocks/src/components/Toolbar.tsx +++ b/code/ui/blocks/src/components/Toolbar.tsx @@ -1,7 +1,6 @@ import type { FC, MouseEvent } from 'react'; import React, { Fragment } from 'react'; import { styled } from '@storybook/theming'; -// eslint-disable-next-line import/no-extraneous-dependencies import { FlexBar, Icons, diff --git a/code/ui/blocks/src/controls/Range.tsx b/code/ui/blocks/src/controls/Range.tsx index 0c5459ca6f06..adf0aafd11f8 100644 --- a/code/ui/blocks/src/controls/Range.tsx +++ b/code/ui/blocks/src/controls/Range.tsx @@ -2,7 +2,7 @@ import type { FC, ChangeEvent } from 'react'; import React, { useMemo } from 'react'; import { styled } from '@storybook/theming'; -import { lighten, darken, rgba } from 'polished'; // eslint-disable-line import/no-extraneous-dependencies +import { lighten, darken, rgba } from 'polished'; import { getControlId } from './helpers'; import type { ControlProps, NumberValue, RangeConfig } from './types'; From 40f48ebaac15e6e85c769c911b2caa5b0846d35e Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 11 Nov 2022 09:46:58 +0100 Subject: [PATCH 14/14] Update .circleci/config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 17151b19d323..4bed5dc41544 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -378,7 +378,7 @@ jobs: yarn coverage chromatic-internal-storybooks: executor: - class: medium+ + class: medium name: sb_node_16_browsers steps: # switched this to the CircleCI helper to get the full git history for TurboSnap