Skip to content

Commit

Permalink
Merge branch 'master' into abstractConstructSignatures
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/compiler/parser.ts
#	src/compiler/types.ts
  • Loading branch information
rbuckton committed Sep 8, 2020
2 parents 65a49a7 + 1508446 commit 2e77e93
Show file tree
Hide file tree
Showing 2,840 changed files with 467,999 additions and 340,337 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ yarn-error.log
.parallelperf.*
.failed-tests
TEST-results.xml
package-lock.json
tests
.vscode
.git
15 changes: 12 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@
"@typescript-eslint/array-type": "error",

"camelcase": "off",
"@typescript-eslint/camelcase": ["error", { "properties": "never", "allow": ["^[A-Za-z][a-zA-Za-z]+_[A-Za-z]+$"] }],
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
{ "selector": "interface", "format": ["PascalCase"], "custom": { "regex": "^I[A-Z]", "match": false }, "filter": { "regex": "^I(Arguments|TextWriter|O([A-Z][a-z]+[A-Za-z]*)?)$", "match": false } },
{ "selector": "variable", "format": ["camelCase", "PascalCase", "UPPER_CASE"], "leadingUnderscore": "allow", "filter": { "regex": "^(_{1,2}filename|_{1,2}dirname|_+|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
{ "selector": "function", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
{ "selector": "parameter", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^(_+|[A-Za-z]+_[A-Z][a-z]+)$", "match": false } },
{ "selector": "method", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
{ "selector": "memberLike", "format": ["camelCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
{ "selector": "enumMember", "format": ["camelCase", "PascalCase"], "leadingUnderscore": "allow", "filter": { "regex": "^[A-Za-z]+_[A-Za-z]+$", "match": false } },
{ "selector": "property", "format": null }
],

"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/interface-name-prefix": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-this-alias": "error",
Expand Down
4 changes: 4 additions & 0 deletions .github/codeql/codeql-configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name : CodeQL Configuration

paths:
- './src'
18 changes: 18 additions & 0 deletions .github/tsc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "tsc",
"pattern": [
{
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),(\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}
24 changes: 15 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 13.x]
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Use node version ${{ matrix.node-version }}
Expand All @@ -30,12 +30,18 @@ jobs:
run: |
npm uninstall typescript --no-save
npm uninstall tslint --no-save
- name: npm install and test
run: |
npm install
npm update
npm test
- run: npm ci

# Re: https://github.com/actions/setup-node/pull/125
- name: Register Problem Matcher for TSC
run: echo "##[add-matcher].github/tsc.json"

- name: Tests
run: npm test -- --no-lint

- name: Linter
run: npm run lint:ci

- name: Validate the browser can import TypeScript
run: gulp test-browser-integration

54 changes: 54 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Code scanning - action"

on:
push:
pull_request:
schedule:
- cron: '0 19 * * 0'

jobs:
CodeQL-Build:

# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
config-file: ./.github/codeql/codeql-configuration.yml
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
4 changes: 2 additions & 2 deletions .github/workflows/new-release-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
sed -i -e 's/const version = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts
npm install
npm ci
gulp LKG
npm test
git diff
Expand All @@ -32,7 +32,7 @@ jobs:
git add tests/baselines/reference/api/typescript.d.ts
git add tests/baselines/reference/api/tsserverlibrary.d.ts
git add ./lib
git config user.email "ts_bot@rcavanaugh.com"
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
git push --set-upstream origin ${{ github.event.client_payload.branch_name }}
2 changes: 2 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Publish Nightly
on:
schedule:
- cron: '0 7 * * *'
# enable users to manually trigger with workflow_dispatch
workflow_dispatch: {}
repository_dispatch:
types: publish-nightly

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release-branch-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
npm uninstall tslint --no-save
- name: npm install and test
run: |
npm install
npm update
npm ci
npm test
env:
CI: true
Expand All @@ -41,4 +40,3 @@ jobs:
with:
name: tgz
path: typescript.tgz

4 changes: 2 additions & 2 deletions .github/workflows/set-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/typescript.d.ts
sed -i -e 's/const versionMajorMinor = ".*"/const versionMajorMinor = "${{ github.event.client_payload.core_major_minor }}"/g' tests/baselines/reference/api/tsserverlibrary.d.ts
sed -i -e 's/const version = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts
npm install
npm ci
gulp LKG
npm test
git diff
Expand All @@ -38,7 +38,7 @@ jobs:
git add tests/baselines/reference/api/typescript.d.ts
git add tests/baselines/reference/api/tsserverlibrary.d.ts
git add ./lib
git config user.email "ts_bot@rcavanaugh.com"
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
git commit -m 'Bump version to ${{ github.event.client_payload.package_version }} and LKG'
git push
13 changes: 9 additions & 4 deletions .github/workflows/sync-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Sync branch with master
on:
repository_dispatch:
types: sync-branch
workflow_dispatch:
inputs:
branch_name:
description: 'Target Branch Name'
required: true

jobs:
build:
Expand All @@ -15,15 +20,15 @@ jobs:
node-version: 12.x
- uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.branch_name }}
ref: ${{ github.event.inputs.branch_name || github.event.client_payload.branch_name }}
# This does a test post-merge and only pushes the result if the test succeeds
# required client_payload members:
# branch_name - the target branch
- run: |
git config user.email "ts_bot@rcavanaugh.com"
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
git fetch origin master
git merge master --no-ff
npm install
git merge origin/master --no-ff
npm ci
npm test
git push
23 changes: 23 additions & 0 deletions .github/workflows/twoslash-repros.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Twoslash Code Sample Repros

on:
push:
branches:
- orta-twoslash-repros
schedule:
- cron: '0 8 * * *'
repository_dispatch:
types: run-twoslash-repros

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Use node
uses: actions/setup-node@v1
- run: |
npm init -y
npm install --save typescript@next
- uses: microsoft/TypeScript-Twoslash-Repro-Action@master
with:
github-token: ${{ secrets.TS_BOT_GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/update-lkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Update LKG

on:
workflow_dispatch: {}

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use node version 12
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Configure Git and Update LKG
run: |
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
npm ci
gulp LKG
npm test
git diff
git add ./lib
git commit -m "Update LKG"
git push
28 changes: 28 additions & 0 deletions .github/workflows/update-package-lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Update package-lock.json

on:
schedule:
# This is probably 6am UTC, which is 10pm PST or 11pm PDT
# Alternatively, 6am local is also fine
- cron: '0 6 * * *'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Configure git and update package-lock.json
run: |
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
npm install --package-lock-only
git add -f package-lock.json
if git commit -m "Update package-lock.json"; then
git push
fi
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ language: node_js

node_js:
- 'node'
- '12'
- '10'
- '8'

env:
- workerCount=3 timeout=600000
Expand All @@ -18,7 +18,7 @@ branches:

install:
- npm uninstall typescript --no-save
- npm install
- npm ci

cache:
directories:
Expand Down
14 changes: 12 additions & 2 deletions .vscode/launch.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,24 @@
"console": "integratedTerminal",
"outFiles": [
"${workspaceRoot}/built/local/run.js"
]
],

// NOTE: To use this, you must switch the "type" above to "pwa-node". You may also need to follow the instructions
// here: https://github.com/microsoft/vscode-js-debug#nightly-extension to use the js-debug nightly until
// this feature is shipping in insiders or to a release:
// "customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
},
{
// See: https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code
"type": "node",
"request": "attach",
"name": "Attach to VS Code TS Server via Port",
"processId": "${command:PickProcess}"
"processId": "${command:PickProcess}",

// NOTE: To use this, you must switch the "type" above to "pwa-node". You may also need to follow the instructions
// here: https://github.com/microsoft/vscode-js-debug#nightly-extension to use the js-debug nightly until
// this feature is shipping in insiders or to a release:
// "customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
}
]
}
Loading

0 comments on commit 2e77e93

Please sign in to comment.