-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
3,469 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: '@kiwi-lib/eslint-config', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main, develop ] | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# Install | ||
- name: Install | ||
run: | | ||
yarn | ||
# Test | ||
- name: Test | ||
run: | | ||
yarn run test | ||
# yarn run test:cov | ||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v1 | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# compiled output | ||
/lib | ||
/node_modules | ||
|
||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
|
||
# OS | ||
.DS_Store | ||
|
||
# Tests | ||
/coverage | ||
/.nyc_output | ||
|
||
# IDEs and editors | ||
/.idea | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# Yarn2 | ||
.yarn/* | ||
!.yarn/cache | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { publish } from './publish'; | ||
|
||
const scripts: Record<string, (...args: string[]) => Promise<void>> = { | ||
publish, | ||
}; | ||
|
||
async function run(scriptName: string) { | ||
const script = scripts[scriptName]; | ||
if (!script) { | ||
console.error('스크립트 이름을 확인해주세요'); | ||
return; | ||
} | ||
|
||
const args = process.argv.slice(3); | ||
await script(...args); | ||
process.exit(); | ||
} | ||
|
||
run(process.argv[2]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { cmd } from './utils'; | ||
|
||
export async function publish() { | ||
await cmd('yarn run build'); | ||
await cmd('yarn npm publish --access=public'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { exec as _exec } from 'child_process'; | ||
import { promisify } from 'util'; | ||
|
||
const exec = promisify(_exec); | ||
export async function cmd(command: string): Promise<string> { | ||
console.log(`$ ${command}`); | ||
const { stdout, stderr } = await exec(command); | ||
if (stderr) throw new Error(stderr); | ||
console.log(stdout); | ||
return stderr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './cmd'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
moduleFileExtensions: ['js', 'json', 'ts'], | ||
rootDir: 'src', | ||
testRegex: '.*\\.spec\\.ts$', | ||
transform: { | ||
'^.+\\.(t|j)s$': 'ts-jest', | ||
}, | ||
collectCoverageFrom: ['**/*.(t|j)s', '!**/index.ts'], | ||
coveragePathIgnorePatterns: ['<rootDir>/index.ts'], | ||
moduleNameMapper: { | ||
'^@core/(.*)$': '<rootDir>/core/$1', | ||
}, | ||
coverageDirectory: '../coverage', | ||
testEnvironment: 'node', | ||
testTimeout: 60000, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "the-camp", | ||
"version": "0.0.1", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"repository": "[email protected]:whitekiwi/the-camp.git", | ||
"author": "Whitekiwi <[email protected]>", | ||
"scripts": { | ||
"lint": "eslint \"{{src}/**/*.ts,**.js}\" --fix", | ||
"test": "jest --forceExit", | ||
"test:watch": "jest --watch", | ||
"test:cov": "jest --coverage --forceExit", | ||
"prebuild": "rimraf ./lib", | ||
"build": "yarn run prebuild && tsc --project tsconfig.build.json", | ||
"script": "ts-node .scripts/index.ts" | ||
}, | ||
"devDependencies": { | ||
"@kiwi-lib/eslint-config": "^1", | ||
"@types/jest": "^27.4.1", | ||
"@types/node": "^17.0.21", | ||
"jest": "^27.5.1", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^27.1.3", | ||
"ts-node": "^10.5.0", | ||
"tsconfig-paths": "^3.12.0", | ||
"typescript": "^4.6.2" | ||
}, | ||
"license": "MIT", | ||
"homepage": "https://github.com/whitekiwi/the-camp", | ||
"bugs": { | ||
"url": "https://github.com/whitekiwi/the-camp/issues", | ||
"email": "[email protected]" | ||
}, | ||
"keywords": [ | ||
"kiwi-lib" | ||
], | ||
"files": [ | ||
"lib" | ||
], | ||
"prettier": "@kiwi-lib/eslint-config/prettier.config", | ||
"dependencies": { | ||
"axios": "^0.26.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
async function main() { | ||
console.log('test'); | ||
} | ||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": ["src"], | ||
"exclude": ["lib", "test", ".scripts", "**/*spec.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": ["src", "test", ".scripts", "**/*spec.ts", "**.js", "**.json"], | ||
"exclude": ["lib"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"declaration": true, | ||
"removeComments": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true, | ||
"allowSyntheticDefaultImports": true, | ||
"target": "es2021", | ||
"sourceMap": true, | ||
"inlineSources": true, | ||
"outDir": "./lib", | ||
"baseUrl": "./", | ||
"incremental": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"strict": true, | ||
"noImplicitAny": true, | ||
"noUnusedLocals": true, | ||
"paths": { | ||
"@core/*": ["./src/core/*"] | ||
} | ||
} | ||
} |
Oops, something went wrong.