-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#1] 프로젝트 셋업 / TDD를 위한 deeplyCopy 테스트 코드 작성 / Dual Package 지원 #2
Changes from 59 commits
ea9f003
1304812
736d691
d8ea175
e8e38a4
21d56f3
4de26c8
e6ea7b9
9e146c0
f649e03
7ef9050
36ea769
e903d81
105697d
1acf714
a49aef7
8488cee
286a806
6d6fea8
8bc6b59
10fa9a0
5309b6a
ce8cf22
2f56ff4
0de589e
e7f5606
59f6a0c
94d663a
4acee48
bc52d64
ce5c519
0712d1f
d9930b6
5f4442e
6721aa9
57e3e51
515582b
6c2ac4c
3c5e096
c2e19af
ece442e
cfb0aa5
8290f54
3f7a41d
b65fb92
059b43a
6f43cae
268bd78
194b832
4661b1e
772cf2e
76f861d
ec7bb7f
6060781
c1ae79c
31c55fa
a8e836b
765bc20
90f1799
1a30259
00ed5cb
96456c3
79dccb5
4099d42
4195f40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Run Jest Tests on Pull Request | ||
|
||
on: | ||
# Triggers the workflow on pull request events but only for the "feature/*" branch | ||
pull_request: | ||
branches: ["main"] | ||
paths-ignore: # Ensure this is also considered to ignore certain paths if needed | ||
- '!feature/1' # Exclude the specific branch | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
if: github.head_ref != 'feature/1' # Condition to exclude the branch | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install pnpm | ||
run: npm install -g pnpm | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Run Jest tests | ||
run: pnpm test -- --coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Node.js 관련 무시 파일 | ||
node_modules/ | ||
npm-debug.log | ||
|
||
# OS별 무시 파일 | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# 특정 IDE 및 편집기 관련 무시 파일 | ||
.vscode/ | ||
.idea/ | ||
|
||
# 로그 파일 | ||
*.log | ||
|
||
# 환경 설정 파일 | ||
.env | ||
|
||
# 빌드 디렉토리 | ||
dist/ | ||
|
||
# test file | ||
src/foo.* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"semi": true, | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"arrowParens": "always", | ||
"endOfLine": "lf" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
# deeply-copy | ||
custom deep copy function to make a brand new immutable object | ||
|
||
A custom deep copy function to make a brand new immutable object. It handles copying self reference object or array. | ||
|
||
깊은 복사를 해 불변 객체로 반환한다. 모든 데이터 타입 복사가 가능하고, 객체나 배열의 순환 참조도 핸들링한다. | ||
|
||
# 프로젝트 인스톨 방법 | ||
|
||
[pnpm 설치](https://pnpm.io/installation) 후 `pnpm install` 실행 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
presets: [['@babel/preset-env', { targets: { node: 'current' } }]], | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.deeplyCopy = void 0; | ||
function deeplyCopy(target) { } | ||
exports.deeplyCopy = deeplyCopy; | ||
//# sourceMappingURL=index.js.map |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function deeplyCopy(target: any): any; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export declare function deeplyCopy(target: any): any; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "commonjs" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"module": "CommonJS", | ||
"outDir": "../build/cjs" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// @ts-check | ||
import { includeIgnoreFile } from '@eslint/compat'; | ||
import path from 'node:path'; | ||
import eslint from '@eslint/js'; | ||
import tseslint from 'typescript-eslint'; | ||
import eslintConfigPrettier from 'eslint-config-prettier'; | ||
import { fileURLToPath } from 'node:url'; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
const gitignorePath = path.resolve(__dirname, '.gitignore'); | ||
|
||
export default tseslint.config( | ||
eslint.configs.recommended, | ||
...tseslint.configs.strict, | ||
...tseslint.configs.stylistic, | ||
eslintConfigPrettier, | ||
includeIgnoreFile(gitignorePath), | ||
eslintPluginPrettierRecommended, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "module" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"module": "ES2020", | ||
"moduleResolution": "Node", | ||
"outDir": "../build/esm" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
export default { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
rootDir: './src', | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"name": "deeply-copy", | ||
"version": "1.0.1-canary.10.0", | ||
"description": "custom deep copy function to make a brand new immutable object", | ||
"type": "module", | ||
"main": "./build/esm/index.js", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./build/esm/index.d.ts", | ||
"default": "./build/esm/index.js" | ||
}, | ||
"require": { | ||
"types": "./build/cjs/index.d.js", | ||
"default": "./build/cjs/index.cjs" | ||
} | ||
} | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"build": "npm run build:cjs && npm run build:esm && npm run build:rename && npm run rename", | ||
"build:cjs": "tsc --p ./cjs/tsconfig.json", | ||
"build:esm": "tsc --p ./esm/tsconfig.json", | ||
"build:rename": "npx tsc renameFiles.ts", | ||
"build:clean": "rm -rf ./build", | ||
"rename": "node renameFiles.js", | ||
"lint": "pnpm eslint", | ||
"lint:fix": "npx eslint . --fix" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/f-lab-edu/deeply-copy.git" | ||
}, | ||
"keywords": [ | ||
"deepCopy", | ||
"deepClone" | ||
], | ||
"author": "Kangsik Kevin Lee", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/f-lab-edu/deeply-copy/issues" | ||
}, | ||
"homepage": "https://github.com/f-lab-edu/deeply-copy#readme", | ||
"devDependencies": { | ||
"@babel/core": "^7.24.7", | ||
"@babel/preset-env": "^7.24.7", | ||
"@babel/preset-typescript": "^7.24.7", | ||
"@eslint/compat": "^1.1.0", | ||
"@eslint/js": "^9.5.0", | ||
"@jest/globals": "^29.7.0", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^20.14.9", | ||
"babel-jest": "^29.7.0", | ||
"eslint": "^9.5.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"jest": "^29.7.0", | ||
"prettier": "3.3.2", | ||
"ts-jest": "^29.1.5", | ||
"typescript": "^5.4.5", | ||
"typescript-eslint": "^7.13.1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsx 혹은 ts-node 써서 하는 방식으로 수정 부탁드려요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영 완료하였습니다!