Skip to content

Commit 7f42747

Browse files
committed
Merge branch 'master' into mael/pnp
2 parents e33ced1 + 0f5ddd2 commit 7f42747

File tree

994 files changed

+78696
-24039
lines changed

Some content is hidden

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

994 files changed

+78696
-24039
lines changed

Diff for: .eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"simple-indent": "error",
5555
"debug-assert": "error",
5656
"no-keywords": "error",
57+
"one-namespace-per-file": "error",
5758

5859
// eslint-plugin-import
5960
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],

Diff for: .github/ISSUE_TEMPLATE/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ contact_links:
55
about: Please ask and answer questions here.
66
- name: TypeScript FAQ
77
url: https://github.com/microsoft/TypeScript/wiki/FAQ
8-
about: Please check the FAQ before filing new issues
8+
about: Please check the FAQ before filing new issues
9+
- name: Website
10+
url: https://github.com/microsoft/TypeScript-Website/issues/new
11+
about: Please raise issues about the site on it's own repo.

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ tests/cases/user/TypeScript-React-Native-Starter/TypeScript-React-Native-Starter
9090
tests/cases/user/TypeScript-Vue-Starter/TypeScript-Vue-Starter
9191
tests/cases/user/TypeScript-WeChat-Starter/TypeScript-WeChat-Starter
9292
tests/cases/user/create-react-app/create-react-app
93+
tests/cases/user/fp-ts/fp-ts
9394
tests/cases/user/webpack/webpack
9495
tests/cases/user/puppeteer/puppeteer
9596
tests/cases/user/axios-src/axios-src

Diff for: Gulpfile.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ task("runtests-parallel").flags = {
477477
" --workers=<number>": "The number of parallel workers to use.",
478478
" --timeout=<ms>": "Overrides the default test timeout.",
479479
" --built": "Compile using the built version of the compiler.",
480-
" --skipPercent=<number>": "Skip expensive tests with <percent> chance to miss an edit. Default 5%.",
481480
" --shards": "Total number of shards running tests (default: 1)",
482481
" --shardId": "1-based ID of this shard (default: 1)",
483482
};
@@ -588,15 +587,15 @@ task("generate-spec").description = "Generates a Markdown version of the Languag
588587
task("clean", series(parallel(cleanTasks), cleanBuilt));
589588
task("clean").description = "Cleans build outputs";
590589

591-
const configureNightly = () => exec(process.execPath, ["scripts/configurePrerelease.js", "dev", "package.json", "src/compiler/core.ts"]);
590+
const configureNightly = () => exec(process.execPath, ["scripts/configurePrerelease.js", "dev", "package.json", "src/compiler/corePublic.ts"]);
592591
task("configure-nightly", series(buildScripts, configureNightly));
593592
task("configure-nightly").description = "Runs scripts/configurePrerelease.ts to prepare a build for nightly publishing";
594593

595-
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/core.ts"]);
594+
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/corePublic.ts"]);
596595
task("configure-insiders", series(buildScripts, configureInsiders));
597596
task("configure-insiders").description = "Runs scripts/configurePrerelease.ts to prepare a build for insiders publishing";
598597

599-
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/core.ts"]);
598+
const configureExperimental = () => exec(process.execPath, ["scripts/configurePrerelease.js", "experimental", "package.json", "src/compiler/corePublic.ts"]);
600599
task("configure-experimental", series(buildScripts, configureExperimental));
601600
task("configure-experimental").description = "Runs scripts/configurePrerelease.ts to prepare a build for experimental publishing";
602601

Diff for: package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
"prex": "^0.4.3",
9393
"q": "latest",
9494
"remove-internal": "^2.9.2",
95-
"simple-git": "^1.113.0",
9695
"source-map-support": "latest",
9796
"through2": "latest",
9897
"travis-fold": "latest",
@@ -117,8 +116,7 @@
117116
"lint:ci": "gulp lint --ci",
118117
"lint:compiler": "gulp lint-compiler",
119118
"lint:scripts": "gulp lint-scripts",
120-
"setup-hooks": "node scripts/link-hooks.js",
121-
"update-costly-tests": "node scripts/costly-tests.js"
119+
"setup-hooks": "node scripts/link-hooks.js"
122120
},
123121
"browser": {
124122
"fs": false,

Diff for: scripts/build/options.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const os = require("os");
44

55
/** @type {CommandLineOptions} */
66
module.exports = minimist(process.argv.slice(2), {
7-
boolean: ["debug", "dirty", "inspect", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
8-
string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
7+
boolean: ["debug", "dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
8+
string: ["browser", "tests", "inspect", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
99
alias: {
1010
"b": "browser",
1111
"d": "debug", "debug-brk": "debug",
@@ -14,7 +14,6 @@ module.exports = minimist(process.argv.slice(2), {
1414
"ru": "runners", "runner": "runners",
1515
"r": "reporter",
1616
"c": "colors", "color": "colors",
17-
"skip-percent": "skipPercent",
1817
"skippercent": "skipPercent",
1918
"w": "workers",
2019
"f": "fix"
@@ -50,7 +49,6 @@ if (module.exports.built) {
5049
* @typedef TypedOptions
5150
* @property {boolean} debug
5251
* @property {boolean} dirty
53-
* @property {boolean} inspect
5452
* @property {boolean} light
5553
* @property {boolean} colors
5654
* @property {boolean} lint
@@ -60,6 +58,7 @@ if (module.exports.built) {
6058
* @property {boolean} fix
6159
* @property {string} browser
6260
* @property {string} tests
61+
* @property {string} inspect
6362
* @property {string} runners
6463
* @property {string|number} workers
6564
* @property {string} host

Diff for: scripts/build/tests.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
3131
const inspect = cmdLineOptions.inspect;
3232
const runners = cmdLineOptions.runners;
3333
const light = cmdLineOptions.light;
34-
const skipPercent = process.env.CI === "true" ? 0 : cmdLineOptions.skipPercent;
3534
const stackTraceLimit = cmdLineOptions.stackTraceLimit;
3635
const testConfigFile = "test.config";
3736
const failed = cmdLineOptions.failed;
@@ -65,8 +64,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
6564
testTimeout = 400000;
6665
}
6766

68-
if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined || shards || shardId) {
69-
writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId);
67+
if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || shards || shardId) {
68+
writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId);
7069
}
7170

7271
const colors = cmdLineOptions.colors;
@@ -90,8 +89,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
9089
else {
9190
args.push("--no-colors");
9291
}
93-
if (inspect) {
94-
args.unshift("--inspect-brk");
92+
if (inspect !== undefined) {
93+
args.unshift(inspect == "" ? "--inspect-brk" : "--inspect-brk="+inspect);
9594
}
9695
else if (debug) {
9796
args.unshift("--debug-brk");
@@ -161,7 +160,6 @@ exports.cleanTestDirs = cleanTestDirs;
161160
* @param {string} tests
162161
* @param {string} runners
163162
* @param {boolean} light
164-
* @param {string} skipPercent
165163
* @param {string} [taskConfigsFolder]
166164
* @param {string | number} [workerCount]
167165
* @param {string} [stackTraceLimit]
@@ -170,12 +168,11 @@ exports.cleanTestDirs = cleanTestDirs;
170168
* @param {number | undefined} [shards]
171169
* @param {number | undefined} [shardId]
172170
*/
173-
function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) {
171+
function writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) {
174172
const testConfigContents = JSON.stringify({
175173
test: tests ? [tests] : undefined,
176174
runners: runners ? runners.split(",") : undefined,
177175
light,
178-
skipPercent,
179176
workerCount,
180177
stackTraceLimit,
181178
taskConfigsFolder,

Diff for: scripts/costly-tests.js

-103
This file was deleted.

Diff for: scripts/eslint/rules/one-namespace-per-file.ts

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/experimental-utils";
2+
import { createRule } from "./utils";
3+
4+
export = createRule({
5+
name: "one-namespace-per-file",
6+
meta: {
7+
docs: {
8+
description: `Limits each file to having at most one top-level namespace declaration`,
9+
category: "Possible Errors",
10+
recommended: "error",
11+
},
12+
messages: {
13+
excessNamespaceError: `All but one of these namespaces should be moved into seperate files.`,
14+
},
15+
schema: [],
16+
type: "problem",
17+
},
18+
defaultOptions: [],
19+
20+
create(context) {
21+
const isNamespaceDeclaration = (node: TSESTree.Node): node is TSESTree.TSModuleDeclaration => node.type === AST_NODE_TYPES.TSModuleDeclaration;
22+
23+
const checkSourceFile = (node: TSESTree.Program) => {
24+
if (context.getFilename().endsWith(".d.ts")) {
25+
return;
26+
}
27+
const members = node.body;
28+
const namespaces = members.filter(isNamespaceDeclaration);
29+
if (namespaces.length <= 1) {
30+
return;
31+
}
32+
33+
namespaces.forEach(n => {
34+
context.report({
35+
messageId: "excessNamespaceError", node: n
36+
});
37+
});
38+
};
39+
40+
return {
41+
Program: checkSourceFile,
42+
};
43+
},
44+
});

Diff for: scripts/hooks/post-checkout

100644100755
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#!/bin/sh
2-
npm run gulp -- generate-diagnostics
1+
#!/bin/sh
2+
npm run gulp -- generate-diagnostics

0 commit comments

Comments
 (0)