Skip to content

Commit 9b3b23f

Browse files
authored
Merge pull request #14199 from microsoft/main
Merge for 1.31.0 (pre-release)
2 parents e9bf244 + 5bbac4e commit 9b3b23f

Some content is hidden

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

60 files changed

+2290
-2041
lines changed

.github/actions/package-lock.json

Lines changed: 1286 additions & 1122 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
"keywords": [],
1111
"author": "",
1212
"dependencies": {
13-
"@actions/core": "^1.9.1",
14-
"@actions/github": "^6.0.0",
13+
"@actions/core": "^2.0.3",
14+
"@actions/github": "^8.0.1",
1515
"@octokit/rest": "^21.1.1",
1616
"@slack/web-api": "^6.9.1",
1717
"applicationinsights": "^2.5.1",
18-
"axios": "^1.12.1",
18+
"axios": "^1.13.5",
1919
"uuid": "^8.3.2"
2020
},
2121
"devDependencies": {

Extension/.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

Extension/.eslintrc.js

Lines changed: 0 additions & 155 deletions
This file was deleted.

Extension/.scripts/clean.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,28 @@ export async function main() {
1818
}
1919

2020
export async function all() {
21-
await rimraf(...(await getModifiedIgnoredFiles()).filter(each => !each.includes('node_modules')));
21+
await rimraf(...(await getModifiedIgnoredFiles()).filter((each): each is string => each !== undefined && !each.includes('node_modules')));
2222
}
2323

2424
export async function reset() {
2525
verbose(`Resetting all .gitignored files in extension`);
26-
await rimraf(...await getModifiedIgnoredFiles());
26+
await rimraf(...(await getModifiedIgnoredFiles()).filter((each): each is string => each !== undefined));
2727
}
2828

2929
async function details(files: string[]) {
30-
let all = await Promise.all(files.filter(each => each).map(async (each) => {
31-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
32-
const [filename, stats ] = await filepath.stats(each);
30+
const results = await Promise.all(files.filter(each => each).map(async (each) => {
31+
const [, stats] = await filepath.stats(each);
32+
if (!stats) {
33+
return null;
34+
}
3335
return {
3436
filename: stats.isDirectory() ? cyan(`${each}${sep}**`) : brightGreen(`${each}`),
3537
date: stats.mtime.toLocaleDateString().replace(/\b(\d)\//g, '0$1\/'),
3638
time: stats.mtime.toLocaleTimeString().replace(/^(\d)\:/g, '0$1:'),
3739
modified: stats.mtime
3840
};
3941
}));
42+
let all = results.filter((each): each is NonNullable<typeof each> => each !== null);
4043
all = all.sort((a, b) => a.modified.getTime() - b.modified.getTime());
4144
// print a formatted table so the date and time are aligned
4245
const max = all.reduce((max, each) => Math.max(max, each.filename.length), 0);
@@ -56,7 +59,7 @@ export async function show(opt?: string) {
5659
case 'ignored':
5760
case 'untracked':
5861
console.log(cyan('\n\nUntracked+Ignored files:'));
59-
return details(await getModifiedIgnoredFiles());
62+
return details((await getModifiedIgnoredFiles()).filter((each): each is string => each !== undefined));
6063

6164
default:
6265
return error(`Unknown option '${opt}'`);

Extension/.scripts/common.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ export async function getModifiedIgnoredFiles() {
5454
}
5555

5656
// return the full path of files that would be removed.
57+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
5758
return Promise.all(stdio.filter("Would remove").map((s) => filepath.exists(s.replace(/^Would remove /, ''), $root)).filter(p => p));
5859
}
5960

6061
export async function rimraf(...paths: string[]) {
61-
const all = [];
62+
const all: Promise<void>[] = [];
6263
for (const each of paths) {
6364
if (!each) {
6465
continue;
@@ -82,6 +83,9 @@ export async function mkdir(filePath: string) {
8283
}
8384
throw new Error(`Cannot create directory '${filePath}' because there is a file there.`);
8485
}
86+
if (!fullPath) {
87+
throw new Error(`Cannot create directory '${filePath}' because the path is invalid.`);
88+
}
8589

8690
await md(fullPath, { recursive: true });
8791
return fullPath;
@@ -258,7 +262,7 @@ export function position(text: string) {
258262
return gray(`${text}`);
259263
}
260264

261-
export async function assertAnyFolder(oneOrMoreFolders: string | string[], errorMessage?: string): Promise<string> {
265+
export async function assertAnyFolder(oneOrMoreFolders: string | string[], errorMessage?: string): Promise<string | undefined> {
262266
oneOrMoreFolders = is.array(oneOrMoreFolders) ? oneOrMoreFolders : [oneOrMoreFolders];
263267
for (const each of oneOrMoreFolders) {
264268
const result = await filepath.isFolder(each, $root);
@@ -275,7 +279,7 @@ export async function assertAnyFolder(oneOrMoreFolders: string | string[], error
275279
}
276280
}
277281

278-
export async function assertAnyFile(oneOrMoreFiles: string | string[], errorMessage?: string): Promise<string> {
282+
export async function assertAnyFile(oneOrMoreFiles: string | string[], errorMessage?: string): Promise<string | undefined> {
279283
oneOrMoreFiles = is.array(oneOrMoreFiles) ? oneOrMoreFiles : [oneOrMoreFiles];
280284
for (const each of oneOrMoreFiles) {
281285
const result = await filepath.isFile(each, $root);
@@ -325,7 +329,6 @@ export async function checkDTS() {
325329
let failing = false;
326330
failing = !await assertAnyFile('vscode.d.ts') && (quiet || warn(`The VSCode import file '${$root}/dist/src/vscode.d.ts is missing.`)) || failing;
327331
failing = !await assertAnyFile('vscode.proposed.terminalDataWriteEvent.d.ts') && (quiet || warn(`The VSCode import file '${$root}/dist/src/vscode.proposed.terminalDataWriteEvent.d.ts is missing.`)) || failing;
328-
failing = !await assertAnyFile('vscode.proposed.lmTools.d.ts') && (quiet || warn(`The VSCode import file '${$root}/dist/src/vscode.proposed.lmTools.d.ts is missing.`)) || failing;
329332

330333
if (!failing) {
331334
verbose('VSCode d.ts files appear to be in place.');

Extension/.scripts/copyWalkthruMedia.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function watch() {
1919
verbose(`Watching ${source} folder for changes.`);
2020
console.log('Press Ctrl+C to exit.');
2121
// eslint-disable-next-line @typescript-eslint/no-unused-vars
22-
for await (const event of watchFiles(source, {recursive: true })) {
22+
for await (const event of watchFiles(source, { recursive: true })) {
2323
await main();
2424
}
2525
}

Extension/.scripts/generateOptionsSchema.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* See 'LICENSE' in the project root for license information.
44
* ------------------------------------------------------------------------------------------ */
55

6-
/* eslint-disable no-prototype-builtins */
7-
86
import { resolve } from 'path';
97
import { $root, read, write } from './common';
108

Extension/.scripts/test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ filterStdio();
7575
async function unitTests() {
7676
await assertAnyFolder('dist/test/unit', `The folder '${$root}/dist/test/unit is missing. You should run ${brightGreen("yarn compile")}\n\n`);
7777
const mocha = await assertAnyFile(["node_modules/.bin/mocha.cmd", "node_modules/.bin/mocha"], `Can't find the mocha testrunner. You might need to run ${brightGreen("yarn install")}\n\n`);
78-
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio:'inherit', shell: true });
78+
const result = spawnSync(mocha, [`${$root}/dist/test/unit/**/*.test.js`, '--timeout', '30000'], { stdio: 'inherit', shell: true });
7979
verbose(`\n${green("NOTE:")} If you want to run a scenario test (end-to-end) use ${cmdSwitch('scenario=<NAME>')} \n\n`);
8080
return result.status;
8181
}
@@ -161,23 +161,24 @@ interface Input {
161161
id: string;
162162
type: string;
163163
description: string;
164-
options: CommentArray<{label: string; value: string}>;
164+
options: CommentArray<{ label: string; value: string }>;
165165
}
166166

167167
export async function getScenarioNames() {
168168
return (await readdir(`${$root}/test/scenarios`).catch(returns.none)).filter(each => each !== 'Debugger');
169169
}
170170

171-
export async function getScenarioFolder(scenarioName: string) {
171+
export async function getScenarioFolder(scenarioName: string | undefined) {
172172
return scenarioName ? resolve(`${$root}/test/scenarios/${(await getScenarioNames()).find(each => each.toLowerCase() === scenarioName.toLowerCase())}`) : undefined;
173173
}
174174

175175
export async function list() {
176176
console.log(`\n${cyan("Scenarios: ")}\n`);
177177
const names = await getScenarioNames();
178-
const max = names.reduce((max, each) => Math.max(max, each), 0);
178+
const max = names.reduce((max, each) => Math.max(max, each.length), 0);
179179
for (const each of names) {
180-
console.log(` ${green(each.padEnd(max))}: ${gray(await getScenarioFolder(each))}`);
180+
const folder = await getScenarioFolder(each);
181+
console.log(` ${green(each.padEnd(max))}: ${gray(folder || '')}`);
181182
}
182183
}
183184

Extension/.scripts/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"experimentalDecorators": true,
88
"allowSyntheticDefaultImports": true,
99
"sourceMap": true,
10-
"esModuleInterop": true
10+
"esModuleInterop": true,
11+
"strictNullChecks": true
1112
}
1213
}

0 commit comments

Comments
 (0)