rn-tokript
v0.9.6
Published
CLI to help tok's working
Downloads
46
Readme
RN-Tokript
Getting Started
똑똑한 개발자의 프론트 개발 업무를 도와줄 스크립트 입니다.
스크립트를 사용해 더 효율적으로 개발해보세요!
Install
Install with npm:
npm install rn-tokript -g
Install with yarn:
yarn global add rn-tokript
Usage
Usage: rn-tokript [options] [resolver]
CLI to help tok's working
Arguments:
resolver script resolver (choices: "gen:source", "gen:img", "gen:font", "gen:icon",
"w:start", "commit")
Options:
-V, --version output the version number
-h, --help display help for command
Overview
- gen:source:
api 와 page 에 관련하여 똑개 컨벤션에 맞춰진 소스 코드를 제공합니다
- gen:img
특정 경로(assets)의 특정확장자(jpg,svg,png ...)를 가진 파일의 경로를 Javascript Object 로 만들어 줍니다.
- gen:font
특정 경로(assets)의 특정확장자(otf,ttf,woff,woff2 ...)를 가진 파일을 native-base font theme rule 에 맞게끔 정의해줍니다.
- w:start
config 파일의 정의된 github-repo 에 issue 를 생성하고 해당 issue 넘버로 브런치 생성 후 해당 브런치로 이동합니다
- commit
commit 을 컨벤션에 맞게 작성하게 도와주고, 현재 브런치가 이슈넘버를 포함 하고 있다면 해당 이슈에 커밋이 참조 되도록 커밋메시지를 작성합니다
Example
rn-tokript // select resolver by cli
rn-tokript commit // pass resolver by argument
rn-tokript -h // option
configuration
// tokript.config.js
require('dotenv').config();
exports.module = {
'gen:img': {
/** 조회할 img 파일들이 포함되어있는 폴더 입니다. */
inputPath: 'src/assets/images',
/** 생성될 파일이 위치할 경로입니다.*/
outputPath: 'src/generated/path/images.ts',
/** 생성될 image 객체의 이름입니다 */
displayName: 'MY_IMAGES',
/** 생성될 객체의 value 에 할당될 경로의 base-path 입니다 */
basePath: '',
/** 생성될 이미지 파일을 판별하는 패턴으로써, 파일이름이 패턴과 일치할 경우에만 객체에 포함됩니다. */
includingPattern: ['*.jpg', '*.png', '*.svg', '*.jpeg'],
/** 제외 될 이미지 파일을 판별하는 패턴으로써, 파일이름이 패턴과 일치할 경우에 객체에서 제외 됩니다. */
ignoredPattern: ['*node_module*'],
/** key 값을 결정할 포멧함수입니다. 기본적으로, SNAKE_UPPER_CASE 로 생성됩니다. */
// formatKey: (filename) => str
},
'gen:source': {
page: {
/** 컴포넌트 생성시 Next Head 의 <title> 태그에 들어가게될 앱 이름입니다. */
appName: process.env.NEXT_PUBLIC_APP_NAME || '똑똑한 개발자',
},
},
'w:start': {
/** 이슈 생성 권한을 가진 github 토큰입니다. 개인 계정 에서 발급가능합니다 */
token: process.env.GITHUB_TOKEN,
/** 해당 프로젝트의 github repository 이름입니다. 이슈 생성시 해당 이름으로 접근하기에, 정확히 기입해야 합니다 */
repoName: process.env.GITHUB_REPO,
/** 해당 프로젝트 repository 의 owner 로써. 똑개의 경우, organization 이름입니다 */
owner: 'TOKTOKHAN-DEV',
/** 이슈 생성시 이슈를 추적할 맴버의 아이디 목록 입니다 */
assignees: ['ldu1020'],
/** 이슈 생성시 이슈에 달릴 수 있는 이슈 label 의 목록입니다 */
labels: ['bug', 'feature'],
},
'gen:font': {
/** 조회할 font 파일들이 포함되어있는 폴더 입니다. */
inputPath: 'src/assets/fonts',
/** 생성될 파일이 위치할 경로입니다.*/
outputPath: 'src/generated/fonts/fonts.tsx',
/** 생성될 font 객체의 이름입니다 */
displayName: 'FONTS',
/** 생성될 객체의 value 에 할당될 경로의 base-path 입니다 */
basePath: '',
/** 생성될 폰트 파일을 판별하는 패턴으로써, 파일이름이 패턴과 일치할 경우에만 객체에 포함됩니다.
* (default: ['*.otf', '*.ttf', '*.woff', '*.woff2'])
*/
includingPattern: ['*.otf', '*.ttf', '*.woff', '*.woff2'],
/** 제외 될 폰트 파일을 판별하는 패턴으로써, 파일이름이 패턴과 일치할 경우에 객체에서 제외 됩니다.
* (default: ['*node_module*'])
*/
ignoredPattern: ['*node_module*'],
},
};