From 7489798d45a6454cdf59e24b40b5d1696598b8d3 Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Fri, 26 Jul 2024 18:45:20 +0900 Subject: [PATCH 1/2] Rename @yorkie-ui/components to @yorkie-ui/core --- apps/storybook/.storybook/preview.ts | 2 +- apps/storybook/package.json | 4 ++-- apps/storybook/src/stories/button/Button.stories.tsx | 2 +- apps/web/package.json | 4 ++-- apps/web/src/app/layout.tsx | 2 +- apps/web/src/app/page.tsx | 2 +- packages/{components => core}/.eslintrc.cjs | 0 packages/{components => core}/.gitignore | 0 packages/{components => core}/README.md | 0 packages/{components => core}/index.html | 0 packages/{components => core}/package.json | 2 +- packages/{components => core}/panda.config.ts | 0 packages/{components => core}/panda/conditions.ts | 0 packages/{components => core}/panda/index.ts | 0 .../{components => core}/panda/theme/breakpoints.ts | 0 packages/{components => core}/panda/theme/keyframes.ts | 0 .../panda/theme/recipes/button.tsx | 0 .../{components => core}/panda/theme/recipes/index.ts | 0 .../panda/theme/semantic-tokens/index.ts | 0 .../panda/theme/semantic-tokens/shadows.ts | 0 .../{components => core}/panda/theme/text-styles.ts | 0 .../panda/theme/tokens/animations.ts | 0 .../{components => core}/panda/theme/tokens/blurs.ts | 0 .../{components => core}/panda/theme/tokens/borders.ts | 0 .../{components => core}/panda/theme/tokens/colors.ts | 0 .../panda/theme/tokens/durations.ts | 0 .../{components => core}/panda/theme/tokens/easings.ts | 0 .../{components => core}/panda/theme/tokens/index.ts | 0 .../{components => core}/panda/theme/tokens/radii.ts | 0 .../{components => core}/panda/theme/tokens/sizes.ts | 0 .../{components => core}/panda/theme/tokens/spacing.ts | 0 .../panda/theme/tokens/typography.ts | 0 .../{components => core}/panda/theme/tokens/z-index.ts | 0 packages/{components => core}/src/button/Button.tsx | 0 packages/{components => core}/src/button/index.ts | 0 packages/{components => core}/src/index.ts | 0 packages/{components => core}/src/vite-env.d.ts | 0 packages/{components => core}/tsconfig.json | 0 packages/{components => core}/tsconfig.node.json | 0 packages/{components => core}/vite.config.ts | 0 pnpm-lock.yaml | 10 +++++----- 41 files changed, 14 insertions(+), 14 deletions(-) rename packages/{components => core}/.eslintrc.cjs (100%) rename packages/{components => core}/.gitignore (100%) rename packages/{components => core}/README.md (100%) rename packages/{components => core}/index.html (100%) rename packages/{components => core}/package.json (97%) rename packages/{components => core}/panda.config.ts (100%) rename packages/{components => core}/panda/conditions.ts (100%) rename packages/{components => core}/panda/index.ts (100%) rename packages/{components => core}/panda/theme/breakpoints.ts (100%) rename packages/{components => core}/panda/theme/keyframes.ts (100%) rename packages/{components => core}/panda/theme/recipes/button.tsx (100%) rename packages/{components => core}/panda/theme/recipes/index.ts (100%) rename packages/{components => core}/panda/theme/semantic-tokens/index.ts (100%) rename packages/{components => core}/panda/theme/semantic-tokens/shadows.ts (100%) rename packages/{components => core}/panda/theme/text-styles.ts (100%) rename packages/{components => core}/panda/theme/tokens/animations.ts (100%) rename packages/{components => core}/panda/theme/tokens/blurs.ts (100%) rename packages/{components => core}/panda/theme/tokens/borders.ts (100%) rename packages/{components => core}/panda/theme/tokens/colors.ts (100%) rename packages/{components => core}/panda/theme/tokens/durations.ts (100%) rename packages/{components => core}/panda/theme/tokens/easings.ts (100%) rename packages/{components => core}/panda/theme/tokens/index.ts (100%) rename packages/{components => core}/panda/theme/tokens/radii.ts (100%) rename packages/{components => core}/panda/theme/tokens/sizes.ts (100%) rename packages/{components => core}/panda/theme/tokens/spacing.ts (100%) rename packages/{components => core}/panda/theme/tokens/typography.ts (100%) rename packages/{components => core}/panda/theme/tokens/z-index.ts (100%) rename packages/{components => core}/src/button/Button.tsx (100%) rename packages/{components => core}/src/button/index.ts (100%) rename packages/{components => core}/src/index.ts (100%) rename packages/{components => core}/src/vite-env.d.ts (100%) rename packages/{components => core}/tsconfig.json (100%) rename packages/{components => core}/tsconfig.node.json (100%) rename packages/{components => core}/vite.config.ts (100%) diff --git a/apps/storybook/.storybook/preview.ts b/apps/storybook/.storybook/preview.ts index 3abfc3b..0494972 100644 --- a/apps/storybook/.storybook/preview.ts +++ b/apps/storybook/.storybook/preview.ts @@ -1,7 +1,7 @@ import type { Preview } from '@storybook/react'; import { withThemeByClassName } from '@storybook/addon-themes'; -import '@yorkie-ui/components/dist/styles.css'; +import '@yorkie-ui/core/dist/styles.css'; import './preview.css'; const preview: Preview = { diff --git a/apps/storybook/package.json b/apps/storybook/package.json index c1ef793..8c7cd59 100644 --- a/apps/storybook/package.json +++ b/apps/storybook/package.json @@ -4,7 +4,7 @@ "version": "0.5.33", "type": "module", "scripts": { - "prebuild": "pnpm --filter @yorkie-ui/components build", + "prebuild": "pnpm --filter @yorkie-ui/core build", "build": "storybook build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "dev": "pnpm prebuild && storybook dev -p 6006" @@ -28,7 +28,7 @@ "@typescript-eslint/eslint-plugin": "^7.15.0", "@typescript-eslint/parser": "^7.15.0", "@vitejs/plugin-react": "^4.3.1", - "@yorkie-ui/components": "workspace:^", + "@yorkie-ui/core": "workspace:^", "eslint": "^8.57.0", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", diff --git a/apps/storybook/src/stories/button/Button.stories.tsx b/apps/storybook/src/stories/button/Button.stories.tsx index aa999b5..0e6aea5 100644 --- a/apps/storybook/src/stories/button/Button.stories.tsx +++ b/apps/storybook/src/stories/button/Button.stories.tsx @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { Button } from '@yorkie-ui/components'; +import { Button } from '@yorkie-ui/core'; const meta = { title: 'COMPONENTS / Button', component: Button, diff --git a/apps/web/package.json b/apps/web/package.json index 1997a07..6fc4267 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -3,7 +3,7 @@ "version": "0.5.33", "private": true, "scripts": { - "prebuild": "pnpm --filter @yorkie-ui/components build", + "prebuild": "pnpm --filter @yorkie-ui/core build", "dev": "next dev", "build": "next build", "start": "next start", @@ -15,7 +15,7 @@ "next": "14.2.5" }, "devDependencies": { - "@yorkie-ui/components": "workspace:^", + "@yorkie-ui/core": "workspace:^", "typescript": "^5", "@types/node": "^20", "@types/react": "^18", diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx index 25bb7f5..4403d7d 100644 --- a/apps/web/src/app/layout.tsx +++ b/apps/web/src/app/layout.tsx @@ -1,6 +1,6 @@ import type { Metadata } from 'next'; import { Inter } from 'next/font/google'; -import '@yorkie-ui/components/dist/styles.css'; +import '@yorkie-ui/core/dist/styles.css'; const inter = Inter({ subsets: ['latin'] }); diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx index bb205e7..d2df0c0 100644 --- a/apps/web/src/app/page.tsx +++ b/apps/web/src/app/page.tsx @@ -1,6 +1,6 @@ 'use client'; -import { Button } from '@yorkie-ui/components'; +import { Button } from '@yorkie-ui/core'; export default function Home() { return ( diff --git a/packages/components/.eslintrc.cjs b/packages/core/.eslintrc.cjs similarity index 100% rename from packages/components/.eslintrc.cjs rename to packages/core/.eslintrc.cjs diff --git a/packages/components/.gitignore b/packages/core/.gitignore similarity index 100% rename from packages/components/.gitignore rename to packages/core/.gitignore diff --git a/packages/components/README.md b/packages/core/README.md similarity index 100% rename from packages/components/README.md rename to packages/core/README.md diff --git a/packages/components/index.html b/packages/core/index.html similarity index 100% rename from packages/components/index.html rename to packages/core/index.html diff --git a/packages/components/package.json b/packages/core/package.json similarity index 97% rename from packages/components/package.json rename to packages/core/package.json index d52b1b0..fae37d7 100644 --- a/packages/components/package.json +++ b/packages/core/package.json @@ -1,5 +1,5 @@ { - "name": "@yorkie-ui/components", + "name": "@yorkie-ui/core", "version": "0.5.33", "type": "module", "main": "./src/index.ts", diff --git a/packages/components/panda.config.ts b/packages/core/panda.config.ts similarity index 100% rename from packages/components/panda.config.ts rename to packages/core/panda.config.ts diff --git a/packages/components/panda/conditions.ts b/packages/core/panda/conditions.ts similarity index 100% rename from packages/components/panda/conditions.ts rename to packages/core/panda/conditions.ts diff --git a/packages/components/panda/index.ts b/packages/core/panda/index.ts similarity index 100% rename from packages/components/panda/index.ts rename to packages/core/panda/index.ts diff --git a/packages/components/panda/theme/breakpoints.ts b/packages/core/panda/theme/breakpoints.ts similarity index 100% rename from packages/components/panda/theme/breakpoints.ts rename to packages/core/panda/theme/breakpoints.ts diff --git a/packages/components/panda/theme/keyframes.ts b/packages/core/panda/theme/keyframes.ts similarity index 100% rename from packages/components/panda/theme/keyframes.ts rename to packages/core/panda/theme/keyframes.ts diff --git a/packages/components/panda/theme/recipes/button.tsx b/packages/core/panda/theme/recipes/button.tsx similarity index 100% rename from packages/components/panda/theme/recipes/button.tsx rename to packages/core/panda/theme/recipes/button.tsx diff --git a/packages/components/panda/theme/recipes/index.ts b/packages/core/panda/theme/recipes/index.ts similarity index 100% rename from packages/components/panda/theme/recipes/index.ts rename to packages/core/panda/theme/recipes/index.ts diff --git a/packages/components/panda/theme/semantic-tokens/index.ts b/packages/core/panda/theme/semantic-tokens/index.ts similarity index 100% rename from packages/components/panda/theme/semantic-tokens/index.ts rename to packages/core/panda/theme/semantic-tokens/index.ts diff --git a/packages/components/panda/theme/semantic-tokens/shadows.ts b/packages/core/panda/theme/semantic-tokens/shadows.ts similarity index 100% rename from packages/components/panda/theme/semantic-tokens/shadows.ts rename to packages/core/panda/theme/semantic-tokens/shadows.ts diff --git a/packages/components/panda/theme/text-styles.ts b/packages/core/panda/theme/text-styles.ts similarity index 100% rename from packages/components/panda/theme/text-styles.ts rename to packages/core/panda/theme/text-styles.ts diff --git a/packages/components/panda/theme/tokens/animations.ts b/packages/core/panda/theme/tokens/animations.ts similarity index 100% rename from packages/components/panda/theme/tokens/animations.ts rename to packages/core/panda/theme/tokens/animations.ts diff --git a/packages/components/panda/theme/tokens/blurs.ts b/packages/core/panda/theme/tokens/blurs.ts similarity index 100% rename from packages/components/panda/theme/tokens/blurs.ts rename to packages/core/panda/theme/tokens/blurs.ts diff --git a/packages/components/panda/theme/tokens/borders.ts b/packages/core/panda/theme/tokens/borders.ts similarity index 100% rename from packages/components/panda/theme/tokens/borders.ts rename to packages/core/panda/theme/tokens/borders.ts diff --git a/packages/components/panda/theme/tokens/colors.ts b/packages/core/panda/theme/tokens/colors.ts similarity index 100% rename from packages/components/panda/theme/tokens/colors.ts rename to packages/core/panda/theme/tokens/colors.ts diff --git a/packages/components/panda/theme/tokens/durations.ts b/packages/core/panda/theme/tokens/durations.ts similarity index 100% rename from packages/components/panda/theme/tokens/durations.ts rename to packages/core/panda/theme/tokens/durations.ts diff --git a/packages/components/panda/theme/tokens/easings.ts b/packages/core/panda/theme/tokens/easings.ts similarity index 100% rename from packages/components/panda/theme/tokens/easings.ts rename to packages/core/panda/theme/tokens/easings.ts diff --git a/packages/components/panda/theme/tokens/index.ts b/packages/core/panda/theme/tokens/index.ts similarity index 100% rename from packages/components/panda/theme/tokens/index.ts rename to packages/core/panda/theme/tokens/index.ts diff --git a/packages/components/panda/theme/tokens/radii.ts b/packages/core/panda/theme/tokens/radii.ts similarity index 100% rename from packages/components/panda/theme/tokens/radii.ts rename to packages/core/panda/theme/tokens/radii.ts diff --git a/packages/components/panda/theme/tokens/sizes.ts b/packages/core/panda/theme/tokens/sizes.ts similarity index 100% rename from packages/components/panda/theme/tokens/sizes.ts rename to packages/core/panda/theme/tokens/sizes.ts diff --git a/packages/components/panda/theme/tokens/spacing.ts b/packages/core/panda/theme/tokens/spacing.ts similarity index 100% rename from packages/components/panda/theme/tokens/spacing.ts rename to packages/core/panda/theme/tokens/spacing.ts diff --git a/packages/components/panda/theme/tokens/typography.ts b/packages/core/panda/theme/tokens/typography.ts similarity index 100% rename from packages/components/panda/theme/tokens/typography.ts rename to packages/core/panda/theme/tokens/typography.ts diff --git a/packages/components/panda/theme/tokens/z-index.ts b/packages/core/panda/theme/tokens/z-index.ts similarity index 100% rename from packages/components/panda/theme/tokens/z-index.ts rename to packages/core/panda/theme/tokens/z-index.ts diff --git a/packages/components/src/button/Button.tsx b/packages/core/src/button/Button.tsx similarity index 100% rename from packages/components/src/button/Button.tsx rename to packages/core/src/button/Button.tsx diff --git a/packages/components/src/button/index.ts b/packages/core/src/button/index.ts similarity index 100% rename from packages/components/src/button/index.ts rename to packages/core/src/button/index.ts diff --git a/packages/components/src/index.ts b/packages/core/src/index.ts similarity index 100% rename from packages/components/src/index.ts rename to packages/core/src/index.ts diff --git a/packages/components/src/vite-env.d.ts b/packages/core/src/vite-env.d.ts similarity index 100% rename from packages/components/src/vite-env.d.ts rename to packages/core/src/vite-env.d.ts diff --git a/packages/components/tsconfig.json b/packages/core/tsconfig.json similarity index 100% rename from packages/components/tsconfig.json rename to packages/core/tsconfig.json diff --git a/packages/components/tsconfig.node.json b/packages/core/tsconfig.node.json similarity index 100% rename from packages/components/tsconfig.node.json rename to packages/core/tsconfig.node.json diff --git a/packages/components/vite.config.ts b/packages/core/vite.config.ts similarity index 100% rename from packages/components/vite.config.ts rename to packages/core/vite.config.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 78828a1..3852417 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,9 +59,9 @@ importers: '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.3.1(vite@5.3.4(@types/node@20.14.11)(lightningcss@1.25.1)) - '@yorkie-ui/components': + '@yorkie-ui/core': specifier: workspace:^ - version: link:../../packages/components + version: link:../../packages/core eslint: specifier: ^8.57.0 version: 8.57.0 @@ -105,9 +105,9 @@ importers: '@types/react-dom': specifier: ^18 version: 18.3.0 - '@yorkie-ui/components': + '@yorkie-ui/core': specifier: workspace:^ - version: link:../../packages/components + version: link:../../packages/core eslint: specifier: ^8 version: 8.57.0 @@ -118,7 +118,7 @@ importers: specifier: ^5 version: 5.5.4 - packages/components: + packages/core: dependencies: '@ark-ui/react': specifier: ^3.5.0 From 255df52dfa6c5606c47fb1cb883618d031e29a96 Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Fri, 26 Jul 2024 18:53:08 +0900 Subject: [PATCH 2/2] Add CI workflow for npm package publishing --- .github/workflows/npm-publish.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..37e1fcb --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,33 @@ +name: npm-publish + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + - name: Setup Node 🔧 + uses: actions/setup-node@v3 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + - name: Install Dependencies + run: | + npm install -g pnpm + pnpm i + + - name: Build 🔧 + run: | + pnpm run build + + - name: Deploy 🚀 + run: pnpm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}