Skip to content

Commit

Permalink
[README] Replace NPM -> npm (DefinitelyTyped#50241)
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko authored Dec 22, 2020
1 parent c9d3302 commit d9f8779
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Auto detect text files and perform LF normalization
* text=auto

# Checkout NPM package files with forced LF lineendings
# Checkout npm package files with forced LF lineendings
# to prevent git conflicts when running npm commands
package.json text eol=lf
package-lock.json text eol=lf
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Select one of these and delete the others:

If adding a new definition:
- [ ] The package does not already provide its own types, or cannot have its `.d.ts` files generated via `--declaration`
- [ ] If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
- [ ] If this is for an npm package, match the name. If not, do not conflict with the name of an npm package.
- [ ] Create it with `dts-gen --dt`, not by basing it on an existing project.
- [ ] Represents shape of module/library [correctly](https://www.typescriptlang.org/docs/handbook/declaration-files/library-structures.html)
- [ ] `tslint.json` [should contain](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#linter-tslintjson) `{ "extends": "dtslint/dt.json" }`, and no additional rules.
Expand Down
20 changes: 10 additions & 10 deletions README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ npm install --save-dev @types/node
编译器中会自动包含这些类型。
可以在 [手册](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html) 中查看更多信息。

对于 NPM 包 "foo",它的类型将是 "@types/foo"。
对于 npm 包 "foo",它的类型将是 "@types/foo"。
如果没有找到你的包,请在 [TypeSearch](https://microsoft.github.io/TypeSearch/) 查询。

如果你仍然没有找到它,请检查它是否 [捆绑](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) 了自己的类型。
Expand Down Expand Up @@ -171,8 +171,8 @@ Version | Released | End of Support

如果你是库作者并且你的包是用 TypeScript 编写的,那么请在你的包里 [捆绑自动生成的声明文件](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) 而不是发布到 Definitely Typed.

如果你要为 NPM 包添加类型,请创建具有相同名字的目录。
如果你要添加类型的包不再 NPM 上,请确保为它选择的名字不会与 NPM 上面的包名冲突。
如果你要为 npm 包添加类型,请创建具有相同名字的目录。
如果你要添加类型的包不再 npm 上,请确保为它选择的名字不会与 npm 上面的包名冲突。
(你可以使用 `npm info foo` 来检查 `foo` 包是否存在。)

你的包应该具有这样的结构:
Expand Down Expand Up @@ -348,17 +348,17 @@ Once a week the Definition Owners are synced to the file [.github/CODEOWNERS](ht

## FAQ

#### 这个仓库和 NPM 上的 `@types` 包究竟有什么关系?
#### 这个仓库和 npm 上的 `@types` 包究竟有什么关系?

`master` 分支会通过 [DefinitelyTyped-tools](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher) 自动发布到 NPM 上的 `@types`.
`master` 分支会通过 [DefinitelyTyped-tools](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher) 自动发布到 npm 上的 `@types`.

#### 我已经发起了 PR, 它多久会被合并?

这得看情况,但是大多数的 PR 会在一周内被合并。已经由定义包头部中的作者同意的 PR 通常会更快被合并。新定义类型的 PR 需要更多时间,因为它们需要维护人员花更多的时间去审核。每一个 PR 在合并之前都会由 TypeScriptDefinitely Typed 的团队成员进行审核,所以请耐心等待这些因为人为因素导致的延迟。通过查看 [New Pull Request Status Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/5),可以看到维护人员在开放 PRs 的工作进度。

#### 我的 PR 被合并了,什么时候 `@types`NPM 包会被更新?
#### 我的 PR 被合并了,什么时候 `@types`npm 包会被更新?

NPM 包应该会在几分钟内更新。如果已经超过了一小时,请在 [the Definitely Typed channel on the TypeScript Community Discord server](https://discord.gg/typescript) 上提及 PR 的编号,当前维护者会让团队成员去调查。
npm 包应该会在几分钟内更新。如果已经超过了一小时,请在 [the Definitely Typed channel on the TypeScript Community Discord server](https://discord.gg/typescript) 上提及 PR 的编号,当前维护者会让团队成员去调查。

#### 我正在编写一个依赖其他类型定义的类型定义。我应该使用 `<reference types="" />` 还是导入?

Expand Down Expand Up @@ -400,7 +400,7 @@ NPM 包应该会在几分钟内更新。如果已经超过了一小时,请在
的编译器选项。

请不要更改准确的类型定义。
对于一个 NPM 包,如果使用 `node -p 'require("foo")'` 去导入模块,那么 `export =` 是准确的。如果使用 `node -p 'require("foo").default'` 去导入模块,那么 `export default` 是准确的。
对于一个 npm 包,如果使用 `node -p 'require("foo")'` 去导入模块,那么 `export =` 是准确的。如果使用 `node -p 'require("foo").default'` 去导入模块,那么 `export default` 是准确的。

#### 我想使用 TypeScript 3.3 或更高版本的功能。

Expand Down Expand Up @@ -447,7 +447,7 @@ NPM 包应该会在几分钟内更新。如果已经超过了一小时,请在

_注意:本节中的讨论假定你熟悉 [语义版本控制](https://semver.org/)_

每个 Definitely Typed 包在发布到 NPM 时都会进行版本控制。
每个 Definitely Typed 包在发布到 npm 时都会进行版本控制。
[DefinitelyTyped-tools](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher) (将 `@types` 包发布到 npm 的工具) 会通过将 `major.minor` 版本号写在 `index.d.ts` 文件的第一行来设置定义包的版本号。
例如,以下是 `10.12.x` 版本的 [Node 的类型声明](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1253faabf5e0d2c5470db6ea87795d7f96fef7e2/types/node/index.d.ts) 的前几行:

Expand All @@ -462,7 +462,7 @@ _注意:本节中的讨论假定你熟悉 [语义版本控制](https://semver.
因为 `10.12` 在第一行的末尾,所以 `@types/node` 包的版本号也是 `10.12.x`.
注意在 `index.d.ts` 文件的第一行注释中应该只包含 `major.minor` 的版本号(比如 `10.12`),不应该包含补丁版本(例如 `10.12.4`)。
这是因为只有主要版本号和次要版本号在库包和类型声明包之间相对齐。
类型声明包的补丁版本号(比如 `10.12.0` 中的 `.0`)是由 Definitely Typed 初始化为 0,每次将新的 `@types/node` 包发布到对应库的同一主/次版本的 NPM 是,他都会递增。
类型声明包的补丁版本号(比如 `10.12.0` 中的 `.0`)是由 Definitely Typed 初始化为 0,每次将新的 `@types/node` 包发布到对应库的同一主/次版本的 npm 是,他都会递增。

有时候,类型声明包的版本号和库包的版本号可能会不同步。
以下是一些常见的原因,是按照给库的用户带来不便的顺序排序的。
Expand Down
16 changes: 8 additions & 8 deletions README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ npm install --save-dev @types/node
Los types deberían ser incluidos automáticamente por el compilador.
Vea más en el [manual](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html).

Para un paquete NPM "foo", estos `typings` estarán en "@types/foo".
Para un paquete npm "foo", estos `typings` estarán en "@types/foo".
Si no puedes encontrar tu paquete, búscalo en [TypeSearch](https://microsoft.github.io/TypeSearch/).

Si aún no puedes encontrarlo, comprueba si el paquete ya [incluye](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) los typings.
Expand Down Expand Up @@ -159,8 +159,8 @@ Si no lo hace, puedes hacerlo en el comentario asociado con el PR.

Si eres el autor de la librería, o puedes hacer un pull request a la biblioteca, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) en vez de publicarlo en Definitely Typed.

Si estás agregando typings para un paquete NPM, crea un directorio con el mismo nombre.
Si el paquete al que le estás agregando typings no es para NPM, asegúrate de que el nombre que escojas no genere problemas con el nombre del paquete en NPM.
Si estás agregando typings para un paquete npm, crea un directorio con el mismo nombre.
Si el paquete al que le estás agregando typings no es para npm, asegúrate de que el nombre que escojas no genere problemas con el nombre del paquete en npm.
(Puedes usar `npm info foo` para verificar la existencia del paquete `foo`.)

Tu paquete debería tener esta estructura:
Expand Down Expand Up @@ -312,17 +312,17 @@ Once a week the Definition Owners are synced to the file [.github/CODEOWNERS](ht

## FAQ

#### ¿Cuál es exactamente la relación entre este repositorio y los paquetes de `@types` en NPM?
#### ¿Cuál es exactamente la relación entre este repositorio y los paquetes de `@types` en npm?

La `master` branch es automáticamente publicada en el alcance de los `@types` en NPM gracias a los [DefinitelyTyped-tools](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher).
La `master` branch es automáticamente publicada en el alcance de los `@types` en npm gracias a los [DefinitelyTyped-tools](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher).

#### He enviado un pull request. ¿Cuánto tardará en ser merged?

Esto depende, pero la mayoría de los pull requests serán merged en alrededor de una semana. PRs que hayan sido aprobados por un autor listado en el encabezado de las definiciones usualmente son merged más rápidamente; PRs para nuevas definiciones tomarán más tiempo ya que requieren más revisiones de los mantenedores. Cada PR es revisado por un miembro de TypeScript o Definitely Typed antes de ser merged, por favor sé paciente debido a que factores humanos pueden causar retrasos. Revisa el [New Pull Request Status Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/5) para ver el progreso mientras los mantenedores trabajan en los PRs abiertos.

#### Mi PR ha sido merged; ¿cuándo será actualizado el paquete de `@types` NPM?
#### Mi PR ha sido merged; ¿cuándo será actualizado el paquete de `@types` npm?

Los paquetes NPM deberán ser actualizados en unas cuantas horas. Si ha pasado más de 24 horas, menciona a @RyanCavanaugh y/o a @andy-ms en el PR para investigar.
Los paquetes npm deberán ser actualizados en unas cuantas horas. Si ha pasado más de 24 horas, menciona a @RyanCavanaugh y/o a @andy-ms en el PR para investigar.

#### Estoy escribiendo una definición que depende de otra definición. Debería utilizar `<reference types="" />` o una import?

Expand All @@ -345,7 +345,7 @@ Si las types son parte de los estándares web, estas deberán ser contribuidas a

Si la import predeterminada trabaja en tu ambiente, considera hacer un cambio en la opción de compilación [`--allowSyntheticDefaultImports`](http://www.typescriptlang.org/docs/handbook/compiler-options.html) opción compilar.
No cambies la type definition si es preciso.
Para un paquete NPM, `export =` es exacto si `node -p 'require("foo")'` es la export, y `export default` es exacto si `node -p 'require("foo").default'` es el export.
Para un paquete npm, `export =` es exacto si `node -p 'require("foo")'` es la export, y `export default` es exacto si `node -p 'require("foo").default'` es el export.

#### Quiero usar las características de TypeScript 3.3 o superior.

Expand Down
20 changes: 10 additions & 10 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ npm install --save-dev @types/node

詳しくは[ハンドブック](http://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)を参照してください。

「foo」という名前の NPM モジュール用の型定義は「@types/foo」になります。
「foo」という名前の npm モジュール用の型定義は「@types/foo」になります。
パッケージが見つからない場合は [TypeSearch](https://microsoft.github.io/TypeSearch/) で検索してください。

検索しても見つからない場合は、パッケージ内に型定義が[含まれている](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)かどうか確認してください。
Expand Down Expand Up @@ -169,8 +169,8 @@ DefinitelyTyped への大量の PR を全てセルフサービス方式で処理

もし、あなたがライブラリの作者で、そのライブラリが TypeScript で書かれている場合は、 Definitely Typed で型定義を公開するのではなく、ライブラリのパッケージ自体に[自動生成された型定義ファイルをバンドル](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)してください。

NPM のパッケージに型定義を追加する場合は、パッケージと同名でディレクトリを作成してください。
NPM 上にないパッケージの型定義を追加したい場合は、その名前が NPM 上のパッケージを競合しないか確認してください。
npm のパッケージに型定義を追加する場合は、パッケージと同名でディレクトリを作成してください。
npm 上にないパッケージの型定義を追加したい場合は、その名前が npm 上のパッケージを競合しないか確認してください。
`npm info foo` コマンドで、 `foo` パッケージが存在するかどうか確認できます。)

型定義パッケージは次のような構造にする必要があります:
Expand Down Expand Up @@ -344,9 +344,9 @@ DefinitelyTyped では、ある特定のモジュールの型定義の品質を

## よくある質問

#### 厳密には、このレポジトリと NPM 上の `@types` パッケージはどう関係していますか?
#### 厳密には、このレポジトリと npm 上の `@types` パッケージはどう関係していますか?

[DefinitelyTyped-tools](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher) が、`master` ブランチの内容を自動的に、 NPM の `@types` スコープに公開してくれています。
[DefinitelyTyped-tools](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher) が、`master` ブランチの内容を自動的に、 npm の `@types` スコープに公開してくれています。

#### PR を送りましたが、どれぐらいでマージされますか?

Expand All @@ -358,9 +358,9 @@ DefinitelyTyped では、ある特定のモジュールの型定義の品質を

通例、型定義ファイルのヘッダーに載っている著者が承認した PR はより早くマージされます。新しい型定義の PR は、 DefinitelyTyped のメンテナーからのレビューも必要になるので時間がかかります。各 PRTypeScriptDefinitelyTyped のチームメンバーがマージ前にレビューします。人為的要因で遅れが発生する場合があるので、しばらくお待ちください。メンテナーがオープンな PR を処理している間は、 [New Pull Request Status Board](https://github.com/DefinitelyTyped/DefinitelyTyped/projects/5) で進捗を確認できます。

#### PR はマージされましたが、 `@types` NPM パッケージはいつ更新されますか?
#### PR はマージされましたが、 `@types` npm パッケージはいつ更新されますか?

NPM パッケージは数分で更新されます。もし1時間以上かかっている場合は、 [TypeScript コミュニティの Discord サーバーの Definitely Typed のチャンネル](https://discord.gg/typescript) に PR 番号を連絡してください。当番のメンテナーが適切なチームメンバーに調査を依頼します。
npm パッケージは数分で更新されます。もし1時間以上かかっている場合は、 [TypeScript コミュニティの Discord サーバーの Definitely Typed のチャンネル](https://discord.gg/typescript) に PR 番号を連絡してください。当番のメンテナーが適切なチームメンバーに調査を依頼します。

#### 作成中の型定義が別の型定義に依存しています。 `<reference types="" />` を使うかインポートするか、どちらがよいですか?

Expand Down Expand Up @@ -402,7 +402,7 @@ NPM パッケージは数分で更新されます。もし1時間以上かかっ
コンパイラー オプションを確認してください。

型定義が正確に記述されているときは変更しないでください。
NPM パッケージでは、モジュールを `node -p 'require("foo")'` でインポートできるときは `export =` が、 `node -p 'require("foo").default'` でインポートできるときは `export default` がそれぞれ正しい表記です。
npm パッケージでは、モジュールを `node -p 'require("foo")'` でインポートできるときは `export =` が、 `node -p 'require("foo").default'` でインポートできるときは `export default` がそれぞれ正しい表記です。

#### TypeScript 3.3 以上にある機能を使いたいです。

Expand Down Expand Up @@ -456,7 +456,7 @@ NPM パッケージでは、モジュールを `node -p 'require("foo")'` でイ

*注意: このセクションを読むには[セマンティック バージョニング](https://semver.org/)の知識が必要です。*

Definitely Typed の各パッケージは NPM に公開される際にバージョン番号が付されます。
Definitely Typed の各パッケージは npm に公開される際にバージョン番号が付されます。
[DefinitelyTyped-tools](https://github.com/microsoft/DefinitelyTyped-tools/tree/master/packages/publisher) (`@types` パッケージを npm に公開するツール)は、パッケージの `index.d.ts` の1行目に載っている `メジャー.マイナー` バージョン番号を使って、型定義パッケージのバージョンを付けます。
たとえば、下記は執筆時点<small>(訳注: 英語版執筆当時)</small>の [Node の型定義](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/1253faabf5e0d2c5470db6ea87795d7f96fef7e2/types/node/index.d.ts)(バージョン `10.12.x` 用)の最初の数行です:

Expand All @@ -471,7 +471,7 @@ Definitely Typed の各パッケージは NPM に公開される際にバージ
1行目の終わりが `10.12` なので、 `@types/node` パッケージの npm でのバージョン番号も `10.12.x` になります。
`index.d.ts`1行目には `メジャー.マイナー` バージョンのみ(例: `10.12`)を含めます。パッチバージョンは含めないでください(`10.12.4` のようにはしない)。
これは、メジャーバージョンとマイナーバージョンの番号のみを、ライブラリ本体と型定義パッケージで揃えるためです。
型定義パッケージのパッチバージョン番号(`10.12.0` なら `.0` の部分)は、 Definitely Typed 側で0に初期化され、対応するライブラリの同じメジャー・マイナーバージョン用の `@types/node` パッケージが NPM に公開されるたびに増えていきます。
型定義パッケージのパッチバージョン番号(`10.12.0` なら `.0` の部分)は、 Definitely Typed 側で0に初期化され、対応するライブラリの同じメジャー・マイナーバージョン用の `@types/node` パッケージが npm に公開されるたびに増えていきます。

ときどき、型定義パッケージとライブラリ本体のバージョンが揃わなくなることがあります。
考えられる原因を、ライブラリ使用者にとって不便に思う順に下記に列挙します<small>(訳注: 一番困るものが一番下)</small>
Expand Down
Loading

0 comments on commit d9f8779

Please sign in to comment.