Skip to content

Commit 872991e

Browse files
committed
Merge v2
2 parents 33bb8dc + 2b2eb90 commit 872991e

Some content is hidden

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

61 files changed

+1515
-590
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
2626
- uses: microsoft/playwright-github-action@v1
2727

28-
# Install, should be absically instant if cached
28+
# Install, should be basically instant if cached
2929
- run: yarn install
3030
env:
3131
YARN_CHECKSUM_BEHAVIOR: ignore

.github/workflows/deploy-prod.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
yarn install
2525
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
2626
yarn bootstrap
27+
yarn workspace typescriptlang-org setup-playground-cache-bust
2728
yarn build
2829
env:
2930
YARN_CHECKSUM_BEHAVIOR: ignore

.github/workflows/v2-merged-staging.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
yarn install
2727
yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
2828
yarn bootstrap
29+
yarn workspace typescriptlang-org setup-playground-cache-bust
30+
yarn workspace typescriptlang-org setup-staging
2931
yarn build
3032
env:
3133
YARN_CHECKSUM_BEHAVIOR: ignore
@@ -34,8 +36,6 @@ jobs:
3436
run: |
3537
yarn build-site
3638
cp -r packages/typescriptlang-org/public site
37-
env:
38-
GATSBY_TYPESCRIPT_SITE_STAGING: true
3939
4040
- name: Deploy + Publish to CDN
4141
# You can find these keys here:

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ yarn workspace tsconfig-reference run lint resolveJson
105105

106106
The docs for TypeScript. Originally ported over from [microsoft/TypeScript-Handbook](https://github.com/microsoft/TypeScript-Handbook/) then intermingled with [microsoft/TypeScript-New-Handbook](https://github.com/microsoft/TypeScript-New-Handbook), and finally updated for [Twoslash](http://www.staging-typescript.org/dev/twoslash/) and with new content.
107107

108+
## JSON Schema
109+
110+
It's a little odd, but the `tsconfig-reference` package creates the JSON schema for a TSConfig files:
111+
112+
```sh
113+
yarn workspace tsconfig-reference build
114+
```
115+
116+
Then you can find it at: [`packages/tsconfig-reference/scripts/schema/result/schema.json`](packages/tsconfig-reference/scripts/schema/result/schema.json).
117+
108118
## Playground Examples
109119

110120
The code samples used in the Playground split across many languages.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"update-test-snapshots": "CI=true yarn workspaces foreach --include gatsby-remark-shiki-twoslash --include @typescript/twoslash --include shiki-twoslash --include @typescript/vfs run test -u"
4848
},
4949
"dependencies": {
50-
"@oss-docs/sync": "^1.1.1",
50+
"@oss-docs/sync": "^1.1.3",
5151
"@types/express": "^4.17.6",
5252
"gray-matter": "4.0.2",
5353
"node-polyfill-webpack-plugin": "^1.1.0",

packages/documentation/copy/en/Nightly Builds.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ oneline: How to use a nightly build of TypeScript
66
translatable: true
77
---
88

9-
A nightly build from the [TypeScript's `master`](https://github.com/Microsoft/TypeScript/tree/master) branch is published by midnight PST to npm.
9+
A nightly build from the [TypeScript's `main`](https://github.com/Microsoft/TypeScript/tree/main) branch is published by midnight PST to npm.
1010
Here is how you can get it and use it with your tools.
1111

1212
## Using npm
@@ -49,7 +49,7 @@ More information is available at the [TypeScript Plugin for Sublime Text install
4949
5050
The nightly build currently does not include the full plugin setup, but we are working on publishing an installer on a nightly basis as well.
5151

52-
1. Download the [VSDevMode.ps1](https://github.com/Microsoft/TypeScript/blob/master/scripts/VSDevMode.ps1) script.
52+
1. Download the [VSDevMode.ps1](https://github.com/Microsoft/TypeScript/blob/main/scripts/VSDevMode.ps1) script.
5353

5454
> Also see our wiki page on [using a custom language service file](https://github.com/Microsoft/TypeScript/wiki/Dev-Mode-in-Visual-Studio#using-a-custom-language-service-file).
5555

packages/documentation/copy/en/declaration-files/Introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ oneline: "How to write a high-quality TypeScript Declaration (d.ts) file"
77

88
The Declaration Files section is designed to teach you how to write a high-quality TypeScript Declaration File. We need to assume basic familiarity with the TypeScript language in order to get started.
99

10-
If you haven't already, you should read the [TypeScript Handbook](/docs/handbook/basic-types.html)
10+
If you haven't already, you should read the [TypeScript Handbook](/docs/handbook/2/basic-types.html)
1111
to familiarize yourself with basic concepts, especially types and modules.
1212

1313
The most common case for learning how .d.ts files work is that you're typing an npm package with no types.

packages/documentation/copy/en/declaration-files/templates/module.d.ts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default pi;
7474
```
7575

7676
One style of exporting in CommonJS is to export a function.
77-
Because a function is also an object, then extra fields can be added are included in the export.
77+
Because a function is also an object, then extra fields can be added and are included in the export.
7878

7979
```js
8080
function getArrayLength(arr) {
@@ -105,7 +105,7 @@ declare namespace getArrayLength {
105105
export = getArrayLength;
106106
```
107107

108-
See [Module: Functions](module-function.d.ts.md) for details of how that works, and the [Modules reference](/docs/handbook/modules.html) page.
108+
See [Module: Functions](/docs/handbook/declaration-files/templates/module-function-d-ts.html) for details of how that works, and the [Modules reference](/docs/handbook/modules.html) page.
109109

110110
## Handling Many Consuming Import
111111

packages/documentation/copy/en/get-started/TS for JS Programmers.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,8 @@ function wrapInArray(obj: string | string[]) {
171171
if (typeof obj === "string") {
172172
return [obj];
173173
// ^?
174-
} else {
175-
return obj;
176174
}
175+
return obj;
177176
}
178177
```
179178

packages/documentation/copy/en/handbook-v2/Classes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ This means that the base class constructor saw its own value for `name` during i
516516

517517
#### Inheriting Built-in Types
518518

519-
> Note: If you don't plan to inherit from built-in types like `Array`, `Error`, `Map`, etc., you may skip this section
519+
> Note: If you don't plan to inherit from built-in types like `Array`, `Error`, `Map`, etc. or your compilation target is explicitely set to `ES6`/`ES2015` or above, you may skip this section
520520
521521
In ES2015, constructors which return an object implicitly substitute the value of `this` for any callers of `super(...)`.
522522
It is necessary for generated constructor code to capture any potential return value of `super(...)` and replace it with `this`.
@@ -661,7 +661,7 @@ Java, for example, considers this to be legal.
661661
On the other hand, C# and C++ chose that this code should be illegal.
662662

663663
TypeScript sides with C# and C++ here, because accessing `x` in `Derived2` should only be legal from `Derived2`'s subclasses, and `Derived1` isn't one of them.
664-
Moreover, if accessing `x` through a `Derived2` reference is illegal (which it certainly should be!), then accessing it through a base class reference should never improve the situation.
664+
Moreover, if accessing `x` through a `Derived1` reference is illegal (which it certainly should be!), then accessing it through a base class reference should never improve the situation.
665665

666666
See also [Why Can’t I Access A Protected Member From A Derived Class?](https://blogs.msdn.microsoft.com/ericlippert/2005/11/09/why-cant-i-access-a-protected-member-from-a-derived-class/) which explains more of C#'s reasoning.
667667

0 commit comments

Comments
 (0)