Skip to content

Commit

Permalink
🚀 chore: npm 배포 준비
Browse files Browse the repository at this point in the history
  • Loading branch information
kms0219kms committed Aug 28, 2024
1 parent 5a0a72a commit 91e7f27
Show file tree
Hide file tree
Showing 24 changed files with 1,387 additions and 93 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Automatically publish a package to GitHub Packages and the NPM Registry when a release is created

name: Publish Package

on:
release:
types: [published]

jobs:
publish-gpr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
registry-url: https://npm.pkg.github.com/
scope: '@waktaplay'
- run: pnpm install --frozen-lockfile
- run: echo @waktaplay:registry=https://npm.pkg.github.com >> .npmrc
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@waktaplay:registry=https://npm.pkg.github.com
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,41 @@ This repository provides a list of components commonly used by services operated
[![style: styled-components](https://img.shields.io/badge/style-%F0%9F%92%85%20styled--components-orange.svg?colorB=daa357&colorA=db748e)](https://github.com/styled-components/styled-components)

## Installation
If you are installing this library first time, please run the following command first.

You may need to issue the GitHub Personal Access Token (legacy) to run this script.

```bash
# Windows + Powershell
Invoke-WebRequest -Uri 'https://github.com/waktaplay/ui/raw/main/scripts/registry-setup.ps1' -OutFile '.\registry-setup.ps1'
Start-Process '.\registry-setup.ps1' -Wait
Remove-Item '.\registry-setup.ps1'

# macOS or Unix/Linux
curl 'https://github.com/waktaplay/ui/raw/main/scripts/registry-setup.sh' | bash
```

To install the SpaceWak Design System, you can use the following command:

```bash
# Npm
npm install @waktaplay/ui

# Yarn
yarn add @spacewak/ui
yarn add @waktaplay/ui

# pnpm
pnpm add @spacewak/ui
pnpm add @waktaplay/ui
```

We highly recommend using pnpm, as yarn has some issues while installing libraries from our registry.

## Usage

To use the SpaceWak Design System, you can import the components you need from the package:

```tsx
import { Button } from "@spacewak/ui"
import { Button } from "@waktaplay/ui"

function App() {
return <Button>Click me!</Button>
Expand Down
42 changes: 32 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
{
"name": "@spacewak/ui",
"private": true,
"version": "2.0.0",
"name": "@waktaplay/ui",
"version": "1.0.0",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "UNLICENSED",
"author": "Team Spacewak <[email protected]>",
"repository": {
"type": "git",
"url": "https://github.com/waktaplay/ui.git"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"prepublish": "tsup"
},
"dependencies": {
"normalize.css": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"styled-components": "^6.1.12",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2"
"styled-components": "^6.1.12"
},
"devDependencies": {
"normalize.css": "^8.0.1",
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^8.0.0",
Expand All @@ -30,10 +38,24 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.9",
"prettier": "^3.3.3",
"terser": "^5.31.6",
"tsup": "^8.2.4",
"typescript": "^5.5.4",
"vite": "^5.3.5"
},
"author": "Team Spacewak <[email protected]>",
"license": "UNLICENSED",
"tsup": {
"entry": [
"src/components/**/*.ts?(x)"
],
"minify": "terser",
"format": [
"esm"
],
"dts": true,
"splitting": true,
"clean": true,
"treeshake": true,
"bundle": false
},
"packageManager": "[email protected]+sha512.dc09430156b427f5ecfc79888899e1c39d2d690f004be70e05230b72cb173d96839587545d09429b55ac3c429c801b4dc3c0e002f653830a420fa2dd4e3cf9cf"
}
Loading

0 comments on commit 91e7f27

Please sign in to comment.