Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit451dc8f

Browse files
jakebaileyandrewbranchsandersn
authored
Convert the repo into a pnpm monorepo (#67085)
Co-authored-by: Andrew Branch <andrew@wheream.io>Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
1 parent9810ab7 commit451dc8f

File tree

27,399 files changed

+204362
-101297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

27,399 files changed

+204362
-101297
lines changed

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Please fill in this template.
55
-[ ][Add or edit tests](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#my-package-teststs) to reflect the change.
66
-[ ] Follow the advice from the[readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).
77
-[ ] Avoid[common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).
8-
-[ ][Run`npm test <package to test>`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#running-tests).
8+
-[ ][Run`pnpm test <package to test>`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#running-tests).
99

1010
Select one of these and delete the others:
1111

‎.github/workflows/CI.yml‎

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ permissions:
77
jobs:
88
test:
99
runs-on:ubuntu-latest
10+
if:github.repository == 'DefinitelyTyped/DefinitelyTyped'
1011

1112
steps:
12-
-uses:actions/checkout@v3
13+
-uses:actions/checkout@v4
14+
with:
15+
# Need this to be able to inquire about origin/master
16+
filter:blob:none# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
17+
fetch-depth:0# Default is 1; need to set to 0 to get the benefits of blob:none.
1318
-uses:actions/setup-node@v3
1419
with:
1520
node-version:'16'
@@ -22,12 +27,43 @@ jobs:
2227
printf "Aborting: symlinks found:\n%s" "$symlinks"; exit 1
2328
fi
2429
25-
# Get local dependencies
26-
-run:npm install
30+
-uses:pnpm/action-setup@v2
31+
name:Install pnpm
32+
id:pnpm-install
33+
with:
34+
version:latest
35+
run_install:false
36+
37+
# TODO(jakebailey): this won't work in PRs; we may need to once nightly
38+
# refresh a new cache based on master, and then consume it here read-only in PRs.
39+
# - name: Get pnpm cache info
40+
# id: pnpm-cache
41+
# shell: bash
42+
# run: |
43+
# echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT
44+
# echo "date=$(/bin/date -u "+%Y-%m-%d")" >> $GITHUB_OUTPUT
45+
46+
# - uses: actions/cache@v3
47+
# name: Setup pnpm cache
48+
# with:
49+
# path: ${{ steps.pnpm-cache.outputs.store }}
50+
# key: ${{ runner.os }}-pnpm-store-cache-${{ steps.pnpm-cache.outputs.date }}
51+
52+
-run:|
53+
# If we're deleting packages, pnpm won't know what other unrelated packages
54+
# need to be reinstalled that may now be sourced from npm instead of the
55+
# local repo. Just pay the cost of the full install.
56+
if git diff --diff-filter=DR --name-only origin/master | grep -q 'package.json'; then
57+
pnpm install
58+
else
59+
pnpm install --filter . --filter '...[origin/master]'
60+
fi
61+
name: pnpm install
62+
2763
-run:npm ls --all || true
2864

2965
# Run tests
30-
-run:npm run test-all
66+
-run:pnpm run test-all
3167

3268
-name:'Run Danger'
3369
env:
@@ -40,4 +76,4 @@ jobs:
4076
# and has no permission to modify this repository. See #62638 for the discussion.
4177
TOKEN='ghp_i5wtj1l2AbpFv3OU96w6R'
4278
TOKEN+='On3bHOkcV2AmVY6'
43-
DANGER_GITHUB_API_TOKEN=$TOKENyarn danger ci || $( exit 0 )
79+
DANGER_GITHUB_API_TOKEN=$TOKENpnpm danger ci || $( exit 0 )

‎.github/workflows/UpdateCodeowners.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ jobs:
2626
fetch-depth:0
2727

2828
-uses:actions/setup-node@v3
29+
-uses:pnpm/action-setup@v2
30+
name:Install pnpm
31+
with:
32+
version:latest
33+
run_install:|
34+
- args: [--filter, .]
2935
3036
-run:git config --global user.email "typescriptbot@microsoft.com"
3137
-run:git config --global user.name "TypeScript Bot"
3238

33-
-run:npm install
34-
-run:npm run update-codeowners
39+
-run:pnpm run update-codeowners
3540
env:
3641
GH_TOKEN:${{ secrets.GH_TOKEN }}

‎.github/workflows/ghostbuster.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ jobs:
2929

3030
-uses:actions/setup-node@v3
3131

32-
-run:npm install --no-package-lock
32+
-uses:pnpm/action-setup@v2
33+
name:Install pnpm
34+
with:
35+
version:latest
36+
run_install:|
37+
- args: [--filter, .]
38+
3339
-run:node ./scripts/ghostbuster.js
3440
env:
3541
GITHUB_TOKEN:${{ secrets.GH_TOKEN_API_READ }}

‎.github/workflows/lint-md.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ permissions:
99
jobs:
1010
lint-md:
1111
runs-on:ubuntu-latest
12+
if:github.repository == 'DefinitelyTyped/DefinitelyTyped'
1213
steps:
1314
-uses:actions/checkout@v3
14-
-run:npm install
15-
-run:npx remark --frail . .github
15+
-uses:pnpm/action-setup@v2
16+
name:Install pnpm
17+
with:
18+
version:latest
19+
run_install:|
20+
- args: [--filter, .]
21+
-run:pnpm remark --frail . .github

‎.github/workflows/support-window.yml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ jobs:
2626
-uses:actions/checkout@v3
2727

2828
-uses:actions/setup-node@v3
29-
#with:
30-
# cache: npm
31-
32-
-run:npm install
33-
29+
-uses:pnpm/action-setup@v2
30+
name:Install pnpm
31+
with:
32+
version:latest
33+
run_install:|
34+
- args: [--filter, .]
3435
-name:Fetch TypeScript versions and release dates from npm
3536
run:|
3637
npm view --json typescript time |

‎.npmrc‎

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,51 @@
1-
package-lock=false
2-
legacy-peer-deps=true
1+
lockfile=false
2+
3+
# If we are using a lockfile, ensure we use the newest format, which is a lot
4+
# more readable when it comes to pnpm's peer dep resolution.
5+
use-lockfile-v6=true
6+
7+
# As of pnpm v8, the default is "lowest", selecting the minimum version
8+
# available in the package graph. But, on DT, we want to test the latest of
9+
# everything.
10+
resolution-mode=highest
11+
12+
# Prevent pnpm from hoisting eslint/prettier-ish packages.
13+
# The first two are the defaults, but we don't want to also hoist packages
14+
# like @types/eslint-scope (which exist in the types dir).
15+
public-hoist-pattern[]=*eslint*
16+
public-hoist-pattern[]=*prettier*
17+
public-hoist-pattern[]=!@types/*
18+
19+
# Match npm's behavior and ensure we get all deps.
20+
auto-install-peers=true
21+
# Don't complain about peer dependencies; they're out of our control.
22+
strict-peer-dependencies=false
23+
# Don't use the top-level package.json to resolve conflicts.
24+
resolve-peers-from-workspace-root=false
25+
# https://github.com/pnpm/pnpm/issues/6300
26+
dedupe-peer-dependents=false
27+
28+
# This is a variant of ignore-scripts which only applies to external
29+
# dependencies, allowing the repo to have its own scripts if needed while still
30+
# stopping random downloaded deps from executing code.
31+
# TODO: use this once https://github.com/pnpm/pnpm/issues/7139 is fixed or we
32+
# change shared-workspace-lockfile back to true.
33+
# onlyBuiltDependencies also does not work, otherwise that'd be superior to either.
34+
# ignore-dep-scripts=true
35+
ignore-scripts=true
36+
37+
# Ensure that @types packages are resolved to this repo's packages where
38+
# available.
39+
prefer-workspace-packages=true
40+
# And also to transitive dependencies.
41+
link-workspace-packages=deep
42+
# For manual invocations of `pnpm add`, don't save deps as "workspace:...".
43+
save-workspace-protocol=false
44+
# Ignore cycles; they are out of our control.
45+
ignore-workspace-cycles=true
46+
# Don't pull symlinks up out of workspace packages.
47+
dedupe-direct-deps=false
48+
49+
# Remove once https://github.com/pnpm/pnpm/issues/6457 is fixed
50+
# and we can set a hoisting limit of "workspaces" like in Yarn.
51+
shared-workspace-lockfile=false

‎README.es.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Para un buen paquete de ejemplo, vea [base64-js](https://github.com/DefinitelyTy
151151

152152
Cuando un paquete[bundles](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) sus propios tipos, estos tipos deberán ser removidos de Definitely Typed para evitar que generen confusión.
153153

154-
Se puede remover ejecutando`npm run not-needed -- <typingsPackageName> <asOfVersion> [<libraryName>]`.
154+
Se puede remover ejecutando`pnpm run not-needed -- <typingsPackageName> <asOfVersion> [<libraryName>]`.
155155
-`<typingsPackageName>`: Este es el nombre del directorio que tienes que eliminar.
156156
-`<asOfVersion>`: Un stub será publicado a`@types/<typingsPackageName>` con esta versión. Debería ser más grande que cualquier versión publicada actualmente.
157157
-`<libraryName>`: Un nombre descriptivo de la librería, p.ej. "Angular 2" en vez de "angular2". (Si es omitido, será idéntico a`<typingsPackageName>`.)

‎README.it.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ Per l'esempio di un buon package, guarda [base64-js](https://github.com/Definite
183183
184184
Quando un package [include](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) i suoi dichiarazioni, esse dovrebbero venire rimosse da Definitely Typed per evitare di far confusione.
185185
186-
Puoi rimuoverli eseguendo`npmrunnot-needed--<nome-package> <versione> [<nome-libreria>]`.
186+
Puoi rimuoverli eseguendo`pnpmrunnot-needed--<nome-package> <versione> [<nome-libreria>]`.
187187
*`<nome-package>`: È il nome della cartella da rimuovere.
188188
*`<versione>`: Verrà pubblicato uno stab su`@types/<nome-package>` con questa versione. Dev'essere più alto della versione attualmente pubblicata e deve essere una versione di`<ome-libreria>` su npm.
189189
*`<nome-libreria>`: Nome del package npm che sostituisce il package DT. Solitamente è identioc a`<nome-package>` e puoi ometterlo.
190190
191191
Qualunque altro package di Definitely Typed che si riferisce ad un altro package DT eliminato dovrebbe venir aggiornato facendolo riferire ai tipi inclusi nel package stesso.
192-
Puoi farlo controllando gli errori che escono eseguendo`npmruntest-all`.
192+
Puoi farlo controllando gli errori che escono eseguendo`pnpmruntest-all`.
193193
Per correggere gli errori, [aggiungi un`package.json`](#packagejson) con`"dependencies": {"<nome-libreria>":"x.y.z" }`.
194194
Ad esempio:
195195
@@ -334,7 +334,7 @@ Se un file non è nè testato nè riferito nell'`index.d.ts`, aggiungilo in un f
334334
####Erroricomuni
335335

336336
*Inanzituttoseguiiconsiglinel [manuale](https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html).
337-
*Formattazione:Usa4spazi.Prettier èabilitatosuquestarepo,quindipuoieseguire`npm run prettier -- --write 'path/to/package/**/*.ts'`. [Quandousileassertion](https://github.com/SamVerschueren/tsd#assertions), aggiungi `// prettier-ignore` per marcare le linee di codice da escludere quando si fa la formattazione:
337+
*Formattazione:Usa4spazi.Prettier èabilitatosuquestarepo,quindipuoieseguire`pnpm run prettier -- --write 'path/to/package/**/*.ts'`. [Quandousileassertion](https://github.com/SamVerschueren/tsd#assertions), aggiungi `// prettier-ignore` per marcare le linee di codice da escludere quando si fa la formattazione:
338338

339339
```tsx
340340
// prettier-ignore

‎README.ja.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ Definitely Typed のメンバーは常に新しい PR をチェックしてい
184184
185185
パッケージに型定義が[バンドル](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html)されている場合、混乱を避けるために Definitely Typed 側の型定義は削除します。
186186
187-
`npmrunnot-needed--<typingsPackageName> <asOfVersion> [<libraryName>]` を実行するとパッケージを削除できます。.
187+
`pnpmrunnot-needed--<typingsPackageName> <asOfVersion> [<libraryName>]` を実行するとパッケージを削除できます。.
188188
*`<typingsPackageName>`: 削除したいディレクトリ名。
189189
*`<asOfVersion>`:`@types/<typingsPackageName>` に対してスタブ(stub)を公開したいバージョン。現在公開中のバージョンより新しく、かつ npm 上の`<libraryName>` のバージョンとあわせる必要があります。
190190
*`<libraryName>`: Definitely Typed 側の型定義の代わりとなる npm のパッケージ名。基本的に`<typingsPackageName>` と一致し、その場合は省略できます。
191191
192192
削除されたパッケージを参照していた、他の Definitely Typed 上のパッケージは全て、ライブラリにバンドルされている型定義を参照するように更新する必要があります。
193-
`npmruntest-all` を実行した際のエラーを参照することで、更新が必要なライブラリのリストが確認できます。
193+
`pnpmruntest-all` を実行した際のエラーを参照することで、更新が必要なライブラリのリストが確認できます。
194194
エラーを修正するには、 [`package.json`](#packagejson) を追加し、`"dependencies": {"<libraryName>":"x.y.z" }` と記述します。
195195
たとえば下記のようになります:
196196
@@ -354,7 +354,7 @@ DefinitelyTypedのパッケージパブリッシャーは、Definitely Typedの
354354
#### よくある間違い
355355

356356
* まず、[ハンドブック](https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html)のアドバイスに従ってください。
357-
* フォーマット:4つのスペースを使用してください。このリポジトリではPrettierが設定されているため、`npm run prettier -- --write 'path/to/package/**/*.ts'`を実行してフォーマットを適用できます。[アサーションを使用する場合](https://github.com/SamVerschueren/tsd#assertions)、フォーマットから除外するために `// prettier-ignore` を追加して、フォーマットの対象外としてマークすることができます:
357+
* フォーマット:4つのスペースを使用してください。このリポジトリではPrettierが設定されているため、`pnpm run prettier -- --write 'path/to/package/**/*.ts'`を実行してフォーマットを適用できます。[アサーションを使用する場合](https://github.com/SamVerschueren/tsd#assertions)、フォーマットから除外するために `// prettier-ignore` を追加して、フォーマットの対象外としてマークすることができます:
358358
```tsx
359359
// prettier-ignore
360360
// @ts-expect-error

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp