Skip to content

Commit 08a3719

Browse files
authored
deps: Upgrade dependencies to address vurnabilities. (#125)
1 parent fd0882a commit 08a3719

15 files changed

+775
-592
lines changed

build/conda-nonconda-test-requirements.txt

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

build/venv-smoke-test-requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/venv-test-ipywidgets7-requirements.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# List of requirements for ipython tests
2-
numpy
2+
numpy>=1.22.2
33
pandas
44
# Install jupyter itself so we end up with a kernel
55
jupyter
@@ -8,3 +8,17 @@ ipywidgets
88
anywidget
99
matplotlib
1010
ipympl
11+
12+
# Security updates for transitive dependencies
13+
pillow>=10.2.0
14+
setuptools>=78.1.1
15+
zipp>=3.19.1
16+
tornado>=6.4.1
17+
anyio>=4.4.0
18+
requests>=2.32.4
19+
fonttools>=4.43.0
20+
jupyter-server>=2.14.1
21+
jupyter-core>=5.8.0
22+
ipython>=8.10.0
23+
urllib3>=2.2.2
24+
jupyterlab>=4.4.8

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@
21962196
"fast-deep-equal": "^2.0.1",
21972197
"format-util": "^1.0.5",
21982198
"fs-extra": "^4.0.3",
2199-
"glob": "^7.1.2",
2199+
"glob": "^9.3.5",
22002200
"iconv-lite": "^0.6.3",
22012201
"immer": "^10.1.3",
22022202
"inversify": "^6.0.1",
@@ -2230,7 +2230,6 @@
22302230
"slickgrid": "^2.4.17",
22312231
"stack-trace": "0.0.10",
22322232
"strip-comments": "^2.0.1",
2233-
"styled-components": "^5.2.1",
22342233
"svg-to-pdfkit": "^0.1.8",
22352234
"tailwind-merge": "^3.3.1",
22362235
"tcp-port-used": "^1.0.1",
@@ -2309,6 +2308,7 @@
23092308
"@vscode/zeromq": "^0.2.3",
23102309
"acorn": "^8.9.0",
23112310
"autoprefixer": "^10.4.21",
2311+
"bare-events": "^2.8.1",
23122312
"buffer": "^6.0.3",
23132313
"bufferutil": "^4.0.6",
23142314
"chai": "^4.3.10",

src/platform/common/platform/fileSystem.node.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
import * as path from '../../../platform/vscode-path/path';
55
import * as fs from 'fs-extra';
6-
import glob from 'glob';
6+
import { glob } from 'glob';
77
import { injectable } from 'inversify';
88
import * as tmp from 'tmp';
9-
import { promisify } from 'util';
109
import { TemporaryFile } from './types';
1110
import { IFileSystemNode } from './types.node';
1211
import { ENCODING, FileSystem as FileSystemBase } from './fileSystem';
@@ -19,10 +18,8 @@ import { getFilePath } from './fs-paths';
1918
*/
2019
@injectable()
2120
export class FileSystem extends FileSystemBase implements IFileSystemNode {
22-
private globFiles: (pat: string, options?: { cwd: string; dot?: boolean }) => Promise<string[]>;
23-
constructor() {
24-
super();
25-
this.globFiles = promisify(glob);
21+
private async globFiles(pat: string, options?: { cwd: string; dot?: boolean }): Promise<string[]> {
22+
return glob(pat, options || {});
2623
}
2724

2825
public createLocalWriteStream(path: string): fs.WriteStream {
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
import { assert } from 'chai';
5+
import * as fs from 'fs-extra';
6+
import * as path from '../../../platform/vscode-path/path';
7+
import * as os from 'os';
8+
import { FileSystem } from './fileSystem.node';
9+
10+
suite('FileSystem - glob functionality', () => {
11+
let fileSystem: FileSystem;
12+
let tempDir: string;
13+
14+
setup(async () => {
15+
fileSystem = new FileSystem();
16+
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'vscode-deepnote-test-'));
17+
});
18+
19+
teardown(async () => {
20+
await fs.remove(tempDir);
21+
});
22+
23+
test('searchLocal should find files matching pattern', async () => {
24+
// Create test files
25+
await fs.writeFile(path.join(tempDir, 'test1.ts'), 'content');
26+
await fs.writeFile(path.join(tempDir, 'test2.ts'), 'content');
27+
await fs.writeFile(path.join(tempDir, 'test.js'), 'content');
28+
29+
const results = await fileSystem.searchLocal('*.ts', tempDir);
30+
31+
assert.strictEqual(results.length, 2);
32+
assert.ok(results.some((f) => f.endsWith('test1.ts')));
33+
assert.ok(results.some((f) => f.endsWith('test2.ts')));
34+
});
35+
36+
test('searchLocal should find files in subdirectories with ** pattern', async () => {
37+
// Create test files in subdirectories
38+
await fs.ensureDir(path.join(tempDir, 'sub1'));
39+
await fs.ensureDir(path.join(tempDir, 'sub2'));
40+
await fs.writeFile(path.join(tempDir, 'sub1', 'test1.ts'), 'content');
41+
await fs.writeFile(path.join(tempDir, 'sub2', 'test2.ts'), 'content');
42+
43+
const results = await fileSystem.searchLocal('**/*.ts', tempDir);
44+
45+
assert.strictEqual(results.length, 2);
46+
assert.ok(results.some((f) => f.includes('sub1') && f.endsWith('test1.ts')));
47+
assert.ok(results.some((f) => f.includes('sub2') && f.endsWith('test2.ts')));
48+
});
49+
50+
test('searchLocal should find hidden files when dot option is true', async () => {
51+
// Create hidden file
52+
await fs.writeFile(path.join(tempDir, '.hidden.ts'), 'content');
53+
await fs.writeFile(path.join(tempDir, 'visible.ts'), 'content');
54+
55+
const results = await fileSystem.searchLocal('*.ts', tempDir, true);
56+
57+
assert.ok(results.length >= 2);
58+
assert.ok(results.some((f) => f.endsWith('.hidden.ts')));
59+
assert.ok(results.some((f) => f.endsWith('visible.ts')));
60+
});
61+
62+
test('searchLocal should not find hidden files when dot option is false', async () => {
63+
// Create hidden file
64+
await fs.writeFile(path.join(tempDir, '.hidden.ts'), 'content');
65+
await fs.writeFile(path.join(tempDir, 'visible.ts'), 'content');
66+
67+
const results = await fileSystem.searchLocal('*.ts', tempDir, false);
68+
69+
assert.strictEqual(results.length, 1);
70+
assert.ok(results.some((f) => f.endsWith('visible.ts')));
71+
assert.ok(!results.some((f) => f.endsWith('.hidden.ts')));
72+
});
73+
74+
test('searchLocal should return empty array when no files match', async () => {
75+
const results = await fileSystem.searchLocal('*.nonexistent', tempDir);
76+
77+
assert.strictEqual(results.length, 0);
78+
});
79+
80+
test('searchLocal should handle patterns with multiple extensions', async () => {
81+
await fs.writeFile(path.join(tempDir, 'test.ts'), 'content');
82+
await fs.writeFile(path.join(tempDir, 'test.js'), 'content');
83+
await fs.writeFile(path.join(tempDir, 'test.py'), 'content');
84+
85+
const results = await fileSystem.searchLocal('*.{ts,js}', tempDir);
86+
87+
assert.strictEqual(results.length, 2);
88+
assert.ok(results.some((f) => f.endsWith('.ts')));
89+
assert.ok(results.some((f) => f.endsWith('.js')));
90+
assert.ok(!results.some((f) => f.endsWith('.py')));
91+
});
92+
});

src/telemetryGenerator.node.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -771,15 +771,7 @@ function generateTelemetryGdpr(output: TelemetryEntry[]) {
771771
}
772772

773773
async function generateTelemetryOutput() {
774-
const files = await new Promise<string[]>((resolve, reject) => {
775-
glob(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src/**/*.ts'), (ex, res) => {
776-
if (ex) {
777-
reject(ex);
778-
} else {
779-
resolve(res);
780-
}
781-
});
782-
});
774+
const files = await glob(path.join(EXTENSION_ROOT_DIR_FOR_TESTS, 'src/**/*.ts'));
783775
// Print out the source tree
784776
return generateDocumentation(files);
785777
}

src/test/extension.serviceRegistry.vscode.test.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,8 @@ async function getInjectableClasses(fileNames: string[], options: ts.CompilerOpt
114114
}
115115

116116
async function getSourceFiles() {
117-
const files = await new Promise<string[]>((resolve, reject) => {
118-
const globPattern = path.join(__dirname, '..', '..', 'src', '**', '*.ts').replace(/\\/g, '/');
119-
glob(globPattern, (ex, res) => {
120-
if (ex) {
121-
reject(ex);
122-
} else {
123-
resolve(res);
124-
}
125-
});
126-
});
117+
const globPattern = path.join(__dirname, '..', '..', 'src', '**', '*.ts').replace(/\\/g, '/');
118+
const files = await glob(globPattern);
127119
return files;
128120
}
129121

0 commit comments

Comments
 (0)