Skip to content

Commit

Permalink
Add CI workflow for npm package publishing (#144)
Browse files Browse the repository at this point in the history
* Rename @yorkie-ui/components to @yorkie-ui/core

* Add CI workflow for npm package publishing
  • Loading branch information
hackerwins committed Jul 26, 2024
1 parent 2d29c7a commit 4eb3aa7
Show file tree
Hide file tree
Showing 45 changed files with 57 additions and 24 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -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 --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ UI components are written in React. It requires react: ^18.
Install Yorkie UI to your project.

```
npm install --save yorkie-ui
npm install --save @yorkie-ui/core
```

Add styles imports to the root of your project.

```
import 'yorkie-ui/styles.css';
import '@yorkie-ui/core/dist/styles.css';
```

### **Use**

Import components you want into your UI

```jsx
import { Button } from 'yorkie-ui';
import { Button } from '@yorkie-ui/core';
```

and use them like so
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
6 changes: 3 additions & 3 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@yorkie-ui/storybook",
"private": true,
"version": "0.5.33",
"version": "0.5.33-rc",
"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"
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions apps/storybook/src/stories/Introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ UI components are written in React. It requires react: ^18.
Install Yorkie UI to your project.

```
npm install --save yorkie-ui
npm install --save @yorkie-ui/core
```

Add styles imports to the root of your project.

```
import 'yorkie-ui/styles.css';
import '@yorkie-ui/core/dist/styles.css';
```

Expand All @@ -28,7 +28,7 @@ import 'yorkie-ui/styles.css';
Import components you want into your UI

```jsx
import { Button } from 'yorkie-ui';
import { Button } from '@yorkie-ui/core';
```

and use them like so
Expand Down
2 changes: 1 addition & 1 deletion apps/storybook/src/stories/button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 3 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@yorkie-ui/web",
"version": "0.5.33",
"version": "0.5.33-rc",
"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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -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'] });

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Button } from '@yorkie-ui/components';
import { Button } from '@yorkie-ui/core';

export default function Home() {
return (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yorkie-ui",
"version": "0.5.33",
"version": "0.5.33-rc",
"description": "",
"packageManager": "[email protected]",
"scripts": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yorkie-ui/components",
"version": "0.5.33",
"name": "@yorkie-ui/core",
"version": "0.5.33-rc",
"type": "module",
"main": "./src/index.ts",
"publishConfig": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4eb3aa7

Please sign in to comment.