Skip to content

Commit

Permalink
Merge pull request #51387 from jakebailey/typeformer-2
Browse files Browse the repository at this point in the history
Closes #35210
Closes #39247
Closes #49037
Closes #49332
Closes #50758
  • Loading branch information
jakebailey committed Nov 7, 2022
2 parents d83a5e1 + da6f067 commit 1d96eb4
Show file tree
Hide file tree
Showing 656 changed files with 282,700 additions and 284,842 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Expand Up @@ -4,4 +4,4 @@
ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

RUN sudo -u node npm install -g gulp-cli
RUN sudo -u node npm install -g hereby
2 changes: 1 addition & 1 deletion .eslintignore
@@ -1,5 +1,5 @@
**/node_modules/**
/built/local/**
/built/**
/tests/**
/lib/**
/src/lib/*.generated.d.ts
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -87,7 +87,7 @@
"local/simple-indent": "error",
"local/debug-assert": "error",
"local/no-keywords": "error",
"local/one-namespace-per-file": "error",
"local/jsdoc-format": "error",

// eslint-plugin-import
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
Expand Down
8 changes: 8 additions & 0 deletions .git-blame-ignore-revs
@@ -0,0 +1,8 @@
# Generated module conversion step - inlineImports
07758c08ab72481885e662c98d67a0e3a071b032
# Generated module conversion step - stripNamespaces
b6c053882696af8ddd94a600429f30584d303d7f
# Generated module conversion step - explicitify
9a0b85ce2a3f85f498ab2c05474b4c0b96b111c9
# Generated module conversion step - unindent
94724a8c2e68a4c7e267072ca79971f317c45e4a
26 changes: 26 additions & 0 deletions .github/codeql/codeql-configuration.yml
Expand Up @@ -6,3 +6,29 @@ paths:
- Gulpfile.mjs
paths-ignore:
- src/lib

# These queries appear to time out after the module conversion.
# https://github.com/github/codeql/issues/10937
query-filters:
- exclude:
id: js/path-injection # TaintedPath.ql
- exclude:
id: js/command-line-injection # CommandInjection.ql
- exclude:
id: js/code-injection # CodeInjection.ql
- exclude:
id: js/bad-code-sanitization # ImproperCodeSanitization.ql
- exclude:
id: js/unsafe-dynamic-method-access # UnsafeDynamicMethodAccess.ql
- exclude:
id: js/clear-text-logging # CleartextLogging.ql
- exclude:
id: js/regex-injection # RegExpInjection.ql
- exclude:
id: js/unvalidated-dynamic-method-call # UnvalidatedDynamicMethodCall.ql
- exclude:
id: js/insecure-download # InsecureDownload.ql
- exclude:
id: js/prototype-polluting-assignment # PrototypePollutingAssignment.ql
- exclude:
id: js/request-forgery # RequestForgery.ql
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Expand Up @@ -4,7 +4,7 @@ Thank you for submitting a pull request!
Please verify that:
* [ ] There is an associated issue in the `Backlog` milestone (**required**)
* [ ] Code is up-to-date with the `main` branch
* [ ] You've successfully run `gulp runtests` locally
* [ ] You've successfully run `hereby runtests` locally
* [ ] There are new or updated unit tests validating the change
Refer to CONTRIBUTING.MD for more details.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/accept-baselines-fix-lints.yaml
Expand Up @@ -17,8 +17,8 @@ jobs:
git config user.name "TypeScript Bot"
npm install
git rm -r --quiet tests/baselines/reference :^tests/baselines/reference/docker :^tests/baselines/reference/user
gulp runtests-parallel --ci --fix || true
gulp baseline-accept
npx hereby runtests-parallel --ci --fix || true
npx hereby baseline-accept
git add ./src
git add ./tests/baselines/reference
git diff --cached
Expand Down
53 changes: 46 additions & 7 deletions .github/workflows/ci.yml
Expand Up @@ -21,6 +21,13 @@ jobs:
- "*"
- lts/*
- lts/-1
bundle:
- "true"
include:
- node-version: "*"
bundle: "false"

name: Test Node ${{ matrix.node-version }} with --bundle=${{ matrix.bundle }}

steps:
- uses: actions/checkout@v3
Expand All @@ -32,7 +39,7 @@ jobs:
- run: npm ci

- name: Tests
run: npm test
run: npm run test -- --bundle=${{ matrix.bundle }}

lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -62,11 +69,23 @@ jobs:
- name: Adding playwright
run: npm install --no-save --no-package-lock playwright

- name: Build local
run: gulp local

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

typecheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "*"
check-latest: true
- run: npm ci

- name: Build src
run: npx hereby build-src


misc:
runs-on: ubuntu-latest
Expand All @@ -80,7 +99,27 @@ jobs:
- run: npm ci

- name: Build scripts
run: gulp scripts
run: npx hereby scripts

- name: ESLint tests
run: gulp run-eslint-rules-tests
run: npx hereby run-eslint-rules-tests

self-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "*"
check-latest: true
- run: npm ci

- name: Build tsc
run: npx hereby tsc

- name: Clean
run: npx hereby clean-src

- name: Self build
run: npx hereby build-src --built
2 changes: 1 addition & 1 deletion .github/workflows/new-release-branch.yaml
Expand Up @@ -21,7 +21,7 @@ jobs:
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\(: string\)\{0,1\} = `${versionMajorMinor}.0-.*`/const version = `${versionMajorMinor}.0-${{ github.event.client_payload.core_tag || 'dev' }}`/g' src/compiler/corePublic.ts
npm ci
gulp LKG
npx hereby LKG
npm test
git diff
git add package.json
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly.yaml
Expand Up @@ -23,10 +23,10 @@ jobs:
run: |
npm whoami
npm ci
gulp configure-nightly
gulp LKG
gulp runtests-parallel
gulp clean
npx hereby configure-nightly
npx hereby LKG
npx hereby runtests-parallel
npx hereby clean
npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
6 changes: 3 additions & 3 deletions .github/workflows/release-branch-artifact.yaml
Expand Up @@ -19,11 +19,11 @@ jobs:
- name: Adding playwright
run: npm install --no-save --no-package-lock playwright
- name: Validate the browser can import TypeScript
run: gulp test-browser-integration
run: npx hereby test-browser-integration
- name: LKG, clean, and pack
run: |
gulp LKG
gulp clean
npx hereby LKG
npx hereby clean
npm pack ./
mv typescript-*.tgz typescript.tgz
- name: Upload built tarfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/set-version.yaml
Expand Up @@ -27,7 +27,7 @@ jobs:
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\(: string\)\{0,1\} = .*;/const version = "${{ github.event.client_payload.package_version }}" as string;/g' src/compiler/corePublic.ts
npm ci
gulp LKG
npx hereby LKG
npm test
git diff
git add package.json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-lkg.yml
Expand Up @@ -16,7 +16,7 @@ jobs:
git config user.email "typescriptbot@microsoft.com"
git config user.name "TypeScript Bot"
npm ci
gulp LKG
npx hereby LKG
npm test
git diff
git add ./lib
Expand Down
19 changes: 19 additions & 0 deletions .gulp.js
@@ -0,0 +1,19 @@
const cp = require("child_process");
const path = require("path");
const chalk = require("chalk");

const argv = process.argv.slice(2);

// --tasks-simple is used by VS Code to infer a task list; try and keep that working.
if (!argv.includes("--tasks-simple")) {
console.error(chalk.yellowBright("Warning: using gulp shim; please consider running hereby directly."));
}

const args = [
...process.execArgv,
path.join(__dirname, "node_modules", "hereby", "bin", "hereby.js"),
...argv,
];

const { status } = cp.spawnSync(process.execPath, args, { stdio: "inherit" });
process.exit(status ?? 1);
10 changes: 3 additions & 7 deletions .vscode/launch.template.json
Expand Up @@ -20,7 +20,6 @@
"configurations": [
{
"type": "node",
"protocol": "inspector",
"request": "launch",
"name": "Mocha Tests (currently opened test)",
"runtimeArgs": ["--nolazy"],
Expand All @@ -43,20 +42,17 @@
},
"sourceMaps": true,
"smartStep": true,
"preLaunchTask": "gulp: tests",
"preLaunchTask": "npm: build:tests",
"console": "integratedTerminal",
"outFiles": [
"${workspaceRoot}/built/local/run.js"
],
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue",
"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}",
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue",
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue"
}
]
}
14 changes: 14 additions & 0 deletions .vscode/settings.template.json
Expand Up @@ -6,4 +6,18 @@

// To use the locally built compiler, after 'npm run build':
// "typescript.tsdk": "built/local"

// To ignore commits listed in .git-blame-ignore-revs in GitLens:
// "gitlens.advanced.blame.customArguments": [
// "--ignore-revs-file",
// ".git-blame-ignore-revs"
// ]

// These options search the repo recursively and slow down
// the build task menu. We define our own in tasks.json.
"typescript.tsc.autoDetect": "off",
"npm.autoDetect": "off",
"grunt.autoDetect": "off",
"jake.autoDetect": "off",
"gulp.autoDetect": "off"
}
49 changes: 29 additions & 20 deletions .vscode/tasks.json
Expand Up @@ -4,42 +4,51 @@
"version": "2.0.0",
"tasks": [
{
"type": "gulp",
"label": "gulp: local",
"task": "local",
"group": {
"kind": "build",
"isDefault": true
},
// Kept for backwards compat for old launch.json files so it's
// less annoying if moving up to the new build or going back to
// the old build.
//
// This is first because the acutal "npm: build:tests" task
// below has the same script value, and VS Code ignores labels
// and deduplicates them.
// https://github.com/microsoft/vscode/issues/93001
"label": "gulp: tests",
"type": "npm",
"script": "build:tests",
"group": "build",
"hide": true,
"problemMatcher": [
"$tsc"
]
},
{
"type": "gulp",
"label": "gulp: tsc",
"task": "tsc",
"label": "tsc: watch ./src",
"type": "shell",
"command": "node",
"args": ["${workspaceFolder}/lib/tsc.js", "--build", "${workspaceFolder}/src", "--watch"],
"group": "build",
"isBackground": true,
"problemMatcher": [
"$tsc"
"$tsc-watch"
]
},
{
"type": "gulp",
"label": "gulp: tests",
"task": "tests",
"label": "npm: build:compiler",
"type": "npm",
"script": "build:compiler",
"group": "build",
"problemMatcher": [
"$tsc"
]
},
{
"type": "gulp",
"task": "services",
"label": "gulp: services",
"label": "npm: build:tests",
"type": "npm",
"script": "build:tests",
"group": "build",
"problemMatcher": [
"$tsc"
],
}
]
},
]
}
}

0 comments on commit 1d96eb4

Please sign in to comment.