首先要註冊 npm 帳號
註冊完後,登入你的帳號
npm login
成功後會顯示
logged in as {account} on https://registry.npmjs.org/.
npm version major // 修改主版號
npm version minor // 修改次版本號
npm version patch // 修改最小版號
{
...
"private": false,
"author": { "name": "edmond"},
"repository": { "url": "https://github.com/teraui41/teraui-v0" },
"keywords": [ "react", "ui"],
...
}
yarn publish --tag beta
會要輸入 New version
結果如下:
yarn add tera-ui
import React from 'react';
import './App.css';
import { Button, ThemeProvider, theme } from 'tera-ui';
function App() {
return (
<div className="App">
<ThemeProvider theme={theme}>
<Button>Import From TERA UI</Button>
</ThemeProvider>
</div>
);
}
export default App;
結果如下