From bc6280c39eaf2f533e0e6591fc9260609e310a38 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Fri, 6 Mar 2020 22:58:01 +0100 Subject: [PATCH] Update README.ko.md (#42958) --- README.ko.md | 117 ++++++++++++++++++++++++++++++++++++++++----------- README.md | 14 +++--- 2 files changed, 100 insertions(+), 31 deletions(-) diff --git a/README.ko.md b/README.ko.md index 44134b2285..2bd480dc7c 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1,63 +1,129 @@ -# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) - -[![깃터(https://gitter.im/borisyankov/DefinitelyTyped)에서 대화에 참여해보세요](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +# DefinitelyTyped > 이 저장소는 고품질의 타입스크립트(TypeScript) 자료형 정의(Type definition)를 위한 저장소입니다. -이 문서가 가장 최신 내용을 담고있긴 하지만, [공식 사이트(definitelytyped.org)](http://definitelytyped.org)도 확인해보시면 좋습니다. +*이 도움말은 [영어](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md), [스페인어](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md), [러시아어](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ru.md), 그리고 [중국어](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.cn.md)로도 읽으실 수 있습니다!* + +*[관리자 설명서](./docs/admin.md) 링크* + +## 목차 + +* [현재 상태](#현재-상태) +* [어떻게 기여하나요?](#어떻게-기여하나요) + * [테스트](#테스트) + * [풀 리퀘스트 만들기](#풀-리퀘스트pull-request-만들기) + * [이미 존재하는 패키지를 수정하기](#이미-존재하는-패키지를-수정하기) + * [새 패키지를 만들기](#새-패키지를-만들기) + * [많이 저지르는 실수들](#많이-저지르는-실수들) + * [패키지 삭제하기](#패키지-삭제하기) + * [린터](#린터) + * [검증하기](#검증하기) +* [자주 하는 질문들](#자주-하는-질문들) + +## 현재 상태 + +저장소 및 퍼블리싱 과정의 상태를 표시합니다. +기여자분들이 작성한 PR 또는 패키지에 문제가 발생했을 경우 이 표시를 보면 도움이 될 수 있습니다. + +* 최신 빌드가 [타입 체크/린트](https://github.com/Microsoft/dtslint) 과정을 깔끔하게 통과했습니다: [![Build Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.DefinitelyTyped?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=1&branchName=master) +* 모든 패키지가 typescript@next상에서 타입 체크/린트 과정을 깔끔하게 통과합니다: [![Build Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.dtslint-runner?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=2&branchName=master) +* 모든 패키지가 1시간 내에 [npm에 배포](https://github.com/microsoft/types-publisher)되었습니다: [![Publish Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.types-publisher-watchdog?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=5&branchName=master) +* [typescript-bot](https://github.com/typescript-bot)이 DefinitelyTyped에서 잘 돌고 있습니다 [![Activity Status](https://dev.azure.com/definitelytyped/DefinitelyTyped/_apis/build/status/DefinitelyTyped.typescript-bot-watchdog?branchName=master)](https://dev.azure.com/definitelytyped/DefinitelyTyped/_build/latest?definitionId=6&branchName=master) + +상태 표시가 비정상이거나 고장 표시가 발생하면 [DefinitelyTyped Gitter 채널](https://gitter.im/DefinitelyTyped/DefinitelyTyped)에서 이 문제를 알려주세요. + +[![https://gitter.im/DefinitelyTyped/DefinitelyTyped 에서 대화에 참여해보세요](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/DefinitelyTyped/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ## 선언 파일(Declaration file)이 뭔가요? [타입스크립트 안내서(TypeScript handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html)를 읽어보세요. -## 선언 파일(Declaration file)을 어떻게 받을 수 있나요?? +## 어떻게 받을 수 있나요? -### npm 사용하기 +### npm -아래 방법은 타입스크립트(TypeScript) 2.0+ 이상의 버전을 사용하는 사람들만 사용할 수 있는 방법이기는 합니다만, 이 방법을 사용하기를 장려합니다. +이 방법을 사용하기를 추천합니다. 아래는 예시입니다: ```sh npm install --save-dev @types/node ``` `node` 를 위한 자료형(Typing)이 컴파일 과정에 자동으로 포함될 겁니다. +모듈을 사용하지 않는 경우 `types` 참조를 추가해 주어야 할 수 있습니다. + +```ts +/// +``` + 더 자세한 내용은 [안내서(Handbook)](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)에서 확인해보실 수 있습니다. NPM 의 "foo" 패키지에 대응되는 자료형 패키지는 "@types/foo" 입니다. 원하시는 패키지를 찾을 수 없는 경우, [타입서치(TypeSearch)](https://microsoft.github.io/TypeSearch/) 사이트에서 한 번 찾아보세요. -타입서치(TypeSearch)에서도 찾을 수 없는 경우, 찾고 있는 패키지가 자료형(Typing)을 +그래도 찾을 수 없는 경우, 찾고 있는 패키지가 자료형(Typing)을 [함께 제공](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)하고 있지는 않은지 확인해보세요. -패키지에 포함된 자료형(Typing)은 주로 `package.json` 파일의 `"types"` 나 `"typings"` 필드(Field)를 통해 제공되지만, +이 경우 주로 `package.json` 파일의 `"types"` 나 `"typings"` 필드(Field)를 통해 제공되지만, `/// ` 같은 주석을 사용하여 패키지 안의 ".d.ts" 파일들을 직접 가져와야 할 수도 있습니다. +#### 이전 버전 TypeScript (2.7 또는 그 이전) -### 그 외의 방법들 +Definitely Typed는 2년이 지나지 않은 TypeScript 버전만을 대상으로 패키지를 테스트합니다. +현재 버전 2.8 및 그 이상만을 테스트하고 있습니다. +TypeScript 2.0에서 2.7 버전을 사용하는 경우, 그래도 `@types` 패키지를 한번 설치해 보셔도 무방합니다. 최신 TypeScript 기능을 사용하는 패키지는 그리 많지 않으니까요. +그러나 작동 여부를 보장하지는 못합니다. +지원 기간은 다음과 같습니다: -타입스크립트(TypeScript) 1.0 버전에서 사용할 수 있는 방법은 다음과 같습니다. +버전 | 출시일 | 지원 종료 +-- | -- | -- +2.8 | 2018년 3월 | 2020년 3월 +2.9 | 2018년 5월 | 2020년 5월 +3.0 | 2018년 7월 | 2020년 7월 +3.1 | 2018년 9월 | 2020년 9월 +3.2 | 2018년 11월 | 2020년 11월 +3.3 | 2019년 1월 | 2021년 1월 +3.4 | 2019년 3월 | 2021년 3월 +3.5 | 2019년 5월 | 2021년 5월 +3.6 | 2019년 8월 | 2021년 8월 +3.7 | 2019년 11월 | 2021년 11월 +3.8 | 2020년 2월 | 2022년 2월 -* [Typings](https://github.com/typings/typings) 을 사용하기 -* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped) 을 사용하기~~ (다른 방법을 사용해주세요. NuGet 은 더 이상 DT 자료형(Typing)을 제공하지 않습니다.) -* 이 저장소의 `master` 브랜치를 직접 내려받기 +`@types` 패키지 안에는 패키지가 확실하게 지원하는 TypeScript 버전이 태그로 쓰여 있으므로, 2년 지원 기간이 지난 오래된 패키지도 보통 찾아보실 수 있습니다. +예를 들어, `npm dist-tags @types/react` 명령어를 입력하면 TypeScript 2.5는 react@16.0용 타입을, TypeScript 2.6 및 2.7은 react@16.4용 타입을 사용할 수 있는 것을 확인하실 수 있습니다: + +|태그 | 버전| +|----|---------| +|latest| 16.9.23| +|ts2.0| 15.0.1| +| ... | ... | +|ts2.5| 16.0.36| +|ts2.6| 16.4.7| +|ts2.7| 16.4.7| +| ... | ... | + +#### TypeScript 1.* + +* 이 저장소의 `master` 브랜치에서 직접 다운로드해 프로젝트에 삽입하기 +* ~~[Typings](https://github.com/typings/typings)를 사용하기~~ (다른 방법을 사용해주세요. typings는 더이상 추천하지 않습니다) +* ~~[NuGet](http://nuget.org/packages?q=DefinitelyTyped) 을 사용하기~~ (다른 방법을 사용해주세요. NuGet은 더 이상 DT 자료형(Typing)을 제공하지 않습니다.) 위 방법을 사용할 경우 수동으로 [참조(Reference)](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html)를 추가해주어야 할 수 있습니다. -## 어떻게 이곳에 기여할 수 있나요? +## 어떻게 기여하나요? -여러분과 같은 많은 기여자들의 도움 덕분에 이 저장소가 돌아가고 있습니다. 감사합니다. +Definitely Typed는 여러분과 같은 많은 기여자들의 도움 덕분에 돌아가고 있습니다! ### 테스트 -여러분이 만든 자료형 선언(Type declation)을 세상에 공유하기에 앞서, 여러분이 스스로 여러분의 자료형 선언(Type declation)을 사용하고 확인해주세요. +개선한 부분을 세상에 공유하기 전에 먼저 직접 사용해 보세요. -#### 이미 존재하는 자료형 패키지를 임시로 수정하기 +#### 이미 존재하는 패키지를 수정하고 테스트하기 -이미 존재하는 패키지의 자료형 선언(Type declaration)에 새로운 기능을 추가하려면 [모듈 증강(module augmentation)](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)를 사용할 수 있습니다. +새로운 기능을 추가하려면 [모듈 증강(module augmentation)](http://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation)를 사용할 수 있습니다. 물론 `node_modules/@types/foo/index.d.ts` 를 직접 수정하실 수도 있으며, 이 파일을 복사한 다음 아래의 과정을 따라하실 수도 있습니다. -#### 새 자료형 패키지를 임시로 추가하기 +#### 새 패키지를 테스트하기 사용하고 계신 `tsconfig.json` 에 다음 내용을 추가해주세요. @@ -76,7 +142,7 @@ NPM 의 "foo" 패키지에 대응되는 자료형 패키지는 "@types/foo" 입 ### 풀 리퀘스트(Pull request) 만들기 -여러분의 자료형 선언이 잘 작동하는지 확인하셨다면, DefinitelyTyped 에 공유해주세요. +패키지가 잘 작동하는지 확인하셨다면, Definitely Typed에 공유해주세요. 우선, 이 저장소를 [포크(fork)](https://guides.github.com/activities/forking/)해 주시고, [node](https://nodejs.org/) 를 설치하신 뒤, `npm install` 명령을 실행해주세요. @@ -167,7 +233,7 @@ DefinitelyTyped 의 다른 패키지들이 삭제된 자료형(Typing) 패키지 DefinitelyTyped 에 한 번도 올라온 적 없는 패키지가 형(Type)을 포함하게 되었다면, `notNeededPackages.json` 파일에 추가할 필요도 없습니다. -#### 린트(Lint)하기 +#### 린터 자료형(Typing) 패키지를 린트(Lint)하려면, 패키지 디렉토리에 `{ "extends": "dtslint/dt.json" }` 를 포함하고 있는 `tslint.json` 파일을 추가해주시면 됩니다. 모든 새 패키지는 해당 파일을 가지고 있어야 합니다. 고쳐야 하지만 아직 고쳐지지 않은 린트(Lint) 결과가 있을 때에만 `tslint.json` 에서 린트 규칙(Lint rule)을 사용하지 않도록 설정할 수 있습니다. 예를 들어, @@ -196,8 +262,11 @@ f("one"); [dtslint](https://github.com/Microsoft/dtslint#write-tests) 저장소의 README 파일에서 더 자세한 내용을 확인하실 수 있습니다. -이런 테스트들은 `npm run lint package-name` 명령으로 실행해볼 수 있습니다. 이 때, `package-name` 은 테스트하고 싶은 패키지의 이름입니다. -테스트 스크립트는 [dtslint](https://github.com/Microsoft/dtslint) 를 사용하고 있습니다. +## 검증하기 + +`npm run lint package-name` 명령을 통해 변경점을 테스트할 수 있습니다. 이 때, `package-name`은 테스트하고 싶은 패키지의 이름입니다. + +작성한 dts 파일을 타입스크립트 컴파일러로 돌려보기 위해 테스트 스크립트 내부적으로 [dtslint](https://github.com/Microsoft/dtslint)를 사용합니다. ## 자주 하는 질문들 diff --git a/README.md b/README.md index 92d3798bb0..936d70245b 100644 --- a/README.md +++ b/README.md @@ -64,11 +64,11 @@ If you still can't find it, check if it [bundles](http://www.typescriptlang.org/ This is usually provided in a `"types"` or `"typings"` field in the `package.json`, or just look for any ".d.ts" files in the package and manually include them with a `/// `. -#### Older versions of Typescript (2.7 and earlier) +#### Older versions of TypeScript (2.7 and earlier) -Definitely Typed only tests packages on versions of Typescript that are less than 2 years old. +Definitely Typed only tests packages on versions of TypeScript that are less than 2 years old. Currently versions 2.8 and above are tested. -If you're using Typescript 2.0 to 2.7, you can still try installing `@types` packages — the majority of packages don't use fancy new Typescript features. +If you're using TypeScript 2.0 to 2.7, you can still try installing `@types` packages — the majority of packages don't use fancy new TypeScript features. But there's no guarantee that they'll work. Here is the support window: @@ -86,8 +86,8 @@ Version | Released | End of Support 3.7 | November 2019 | November 2021 3.8 | February 2020 | February 2022 -`@types` packages have tags for versions of Typescript that they explicitly support, so you can usually get older versions of packages that predate the 2-year window. -For example, if you run `npm dist-tags @types/react`, you'll see that Typescript 2.5 can use types for react@16.0, whereas Typescript 2.6 and 2.7 can use types for react@16.4: +`@types` packages have tags for versions of TypeScript that they explicitly support, so you can usually get older versions of packages that predate the 2-year window. +For example, if you run `npm dist-tags @types/react`, you'll see that TypeScript 2.5 can use types for react@16.0, whereas TypeScript 2.6 and 2.7 can use types for react@16.4: |Tag | Version| |----|---------| @@ -100,7 +100,7 @@ For example, if you run `npm dist-tags @types/react`, you'll see that Typescript | ... | ... | -#### Typescript 1.* +#### TypeScript 1.* * Manually download from the `master` branch of this repository and place them in your project * ~~[Typings](https://github.com/typings/typings)~~ (use preferred alternatives, typings is deprecated) @@ -350,7 +350,7 @@ This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/quest It is more appropriate to import the module using the `import foo = require("foo");` syntax. Nevertheless, if you want to use a default import like `import foo from "foo";` you have two options: - you can use the [`--allowSyntheticDefaultImports` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#support-for-default-import-interop-with-systemjs) if your module runtime supports an interop scheme for non-ECMAScript modules, i.e. if default imports work in your environment (e.g. Webpack, SystemJS, esm). -- you can use the [`--esModuleInterop` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop) if you want TypeScript to take care of non-ECMAScript interop (since Typescript 2.7). +- you can use the [`--esModuleInterop` compiler option](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop) if you want TypeScript to take care of non-ECMAScript interop (since TypeScript 2.7). #### A package uses `export =`, but I prefer to use default imports. Can I change `export =` to `export default`?