From e20f3ffba9a6f8e4a54cfd5a1ca1bac0e0d52305 Mon Sep 17 00:00:00 2001 From: Alexandre Philibeaux Date: Fri, 5 Apr 2024 12:16:35 +0000 Subject: [PATCH] chore(illustations): migrate banner to illustations package --- .changeset/tender-windows-yawn.md | 6 + package.json | 4 +- packages/illustrations/package.json | 4 +- .../illustrations/src/__stories__/List.tsx | 9 +- .../various/banner/default-image-small.svg | 88 ++++++++++ .../src/various/banner/default-image.svg | 148 +++++++++++++++++ .../illustrations/src/various/banner/index.ts | 4 + packages/illustrations/src/various/index.ts | 3 +- packages/illustrations/tsconfig.json | 6 +- packages/ui/package.json | 1 + .../Banner/assets/default-image-small.svg | 93 ----------- .../Banner/assets/default-image.svg | 153 ------------------ packages/ui/src/components/Banner/index.tsx | 6 +- pnpm-lock.yaml | 7 +- 14 files changed, 273 insertions(+), 259 deletions(-) create mode 100644 .changeset/tender-windows-yawn.md create mode 100644 packages/illustrations/src/various/banner/default-image-small.svg create mode 100644 packages/illustrations/src/various/banner/default-image.svg create mode 100644 packages/illustrations/src/various/banner/index.ts delete mode 100644 packages/ui/src/components/Banner/assets/default-image-small.svg delete mode 100644 packages/ui/src/components/Banner/assets/default-image.svg diff --git a/.changeset/tender-windows-yawn.md b/.changeset/tender-windows-yawn.md new file mode 100644 index 0000000000..df619a420c --- /dev/null +++ b/.changeset/tender-windows-yawn.md @@ -0,0 +1,6 @@ +--- +"@ultraviolet/illustrations": patch +"@ultraviolet/ui": patch +--- + +migration banner illustrations diff --git a/package.json b/package.json index d333d91862..e64a68c52d 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "linux" ], "scripts": { - "build": "pnpm --filter '@ultraviolet/*' recursive run build", + "build": "pnpm -r --filter '@ultraviolet/*' run build ", "build:profile": "cross-env PROFILE=true pnpm run build", "build:storybook": "pnpm run build && STORYBOOK_ENVIRONMENT=production storybook build", "build:storybook:stats": "pnpm run build:storybook --webpack-stats-json", @@ -25,7 +25,7 @@ "start": "STORYBOOK_ENVIRONMENT=development storybook dev -p 6006", "start:production": "STORYBOOK_ENVIRONMENT=production storybook dev -p 6006", "format": "prettier --write '**/*.{ts,tsx,js,json,md,mdx}'", - "lint:fix": "pnpm run lint --fix", + "lint:fix": "pnpm run linnrt --fix", "lint": "eslint --report-unused-disable-directives --cache --ext js,mjs,ts,tsx .", "prebuild": "shx rm -rf dist", "test:unit": "LC_ALL=en_US.UTF-8 jest --config .jest/unit.config.ts", diff --git a/packages/illustrations/package.json b/packages/illustrations/package.json index 7146c08c48..be8b0c48a2 100644 --- a/packages/illustrations/package.json +++ b/packages/illustrations/package.json @@ -57,7 +57,7 @@ } }, "devDependencies": { - "@ultraviolet/ui": "workspace:^", - "@ultraviolet/themes": "workspace:^" + "@ultraviolet/ui": "workspace:*", + "@ultraviolet/themes": "workspace:*" } } diff --git a/packages/illustrations/src/__stories__/List.tsx b/packages/illustrations/src/__stories__/List.tsx index c9b8f2dc38..8332ac4d20 100644 --- a/packages/illustrations/src/__stories__/List.tsx +++ b/packages/illustrations/src/__stories__/List.tsx @@ -1,6 +1,13 @@ import styled from '@emotion/styled' -import { Button, Expandable, Snippet, Stack, Text } from '@ultraviolet/ui' import { useReducer } from 'react' +import { + Button, + Expandable, + Snippet, + Stack, + Text, + // eslint-disable-next-line import/no-relative-packages +} from '../../../ui/src/components' import * as assets from '../index' type AssetsModule = Record>> diff --git a/packages/illustrations/src/various/banner/default-image-small.svg b/packages/illustrations/src/various/banner/default-image-small.svg new file mode 100644 index 0000000000..7f433df1f2 --- /dev/null +++ b/packages/illustrations/src/various/banner/default-image-small.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/illustrations/src/various/banner/default-image.svg b/packages/illustrations/src/various/banner/default-image.svg new file mode 100644 index 0000000000..b67518ade2 --- /dev/null +++ b/packages/illustrations/src/various/banner/default-image.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/illustrations/src/various/banner/index.ts b/packages/illustrations/src/various/banner/index.ts new file mode 100644 index 0000000000..67fc54e646 --- /dev/null +++ b/packages/illustrations/src/various/banner/index.ts @@ -0,0 +1,4 @@ +import defaultIllustrationSmall from './default-image-small.svg' +import defaultIllustration from './default-image.svg' + +export { defaultIllustrationSmall, defaultIllustration } diff --git a/packages/illustrations/src/various/index.ts b/packages/illustrations/src/various/index.ts index 6de846af3a..025a9a9c01 100644 --- a/packages/illustrations/src/various/index.ts +++ b/packages/illustrations/src/various/index.ts @@ -1,6 +1,7 @@ +import * as banner from './banner' import * as documentation from './documentation' import * as empty from './empty' import * as feedback from './feedback' import * as onboarding from './onboarding' -export { onboarding, feedback, empty, documentation } +export { banner, documentation, empty, feedback, onboarding } diff --git a/packages/illustrations/tsconfig.json b/packages/illustrations/tsconfig.json index d768d13df6..50f3102585 100644 --- a/packages/illustrations/tsconfig.json +++ b/packages/illustrations/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "baseUrl": ".", + "baseUrl": "." }, - "include": ["src", "../../global.d.ts"], - "exclude": ["node_modules", "coverage", "dist"], + "include": ["src", "../../global.d.ts", "src/emotion.d.ts"], + "exclude": ["node_modules", "coverage", "dist"] } diff --git a/packages/ui/package.json b/packages/ui/package.json index 57f38d6b36..25c383fc4a 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -63,6 +63,7 @@ "@scaleway/random-name": "5.0.0", "@ultraviolet/themes": "workspace:*", "@ultraviolet/icons": "workspace:*", + "@ultraviolet/illustrations": "workspace:*", "@scaleway/use-media": "3.0.0", "deepmerge": "4.3.1", "react-datepicker": "4.25.0", diff --git a/packages/ui/src/components/Banner/assets/default-image-small.svg b/packages/ui/src/components/Banner/assets/default-image-small.svg deleted file mode 100644 index 35d2ea6907..0000000000 --- a/packages/ui/src/components/Banner/assets/default-image-small.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/ui/src/components/Banner/assets/default-image.svg b/packages/ui/src/components/Banner/assets/default-image.svg deleted file mode 100644 index 2849d1d673..0000000000 --- a/packages/ui/src/components/Banner/assets/default-image.svg +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/ui/src/components/Banner/index.tsx b/packages/ui/src/components/Banner/index.tsx index d9938733bc..0c92e03d70 100644 --- a/packages/ui/src/components/Banner/index.tsx +++ b/packages/ui/src/components/Banner/index.tsx @@ -1,14 +1,16 @@ import type { Theme } from '@emotion/react' import { css, useTheme } from '@emotion/react' import styled from '@emotion/styled' +import { + defaultIllustration, + defaultIllustrationSmall, +} from '@ultraviolet/illustrations/various/banner' import type { ComponentProps, ReactNode } from 'react' import { useState } from 'react' import { Button } from '../Button' import { Link } from '../Link' import { Stack } from '../Stack' import { Text } from '../Text' -import defaultIllustrationSmall from './assets/default-image-small.svg' -import defaultIllustration from './assets/default-image.svg' type Variant = 'intro' | 'promotional' type Size = 'small' | 'medium' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 38927d9b56..4448ec591a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -541,10 +541,10 @@ importers: packages/illustrations: devDependencies: '@ultraviolet/themes': - specifier: workspace:^ + specifier: workspace:* version: link:../themes '@ultraviolet/ui': - specifier: workspace:^ + specifier: workspace:* version: link:../ui packages/plus: @@ -634,6 +634,9 @@ importers: '@ultraviolet/icons': specifier: workspace:* version: link:../icons + '@ultraviolet/illustrations': + specifier: workspace:* + version: link:../illustrations '@ultraviolet/themes': specifier: workspace:* version: link:../themes