Skip to content

Commit 2ef5cc0

Browse files
authored
Merge pull request #740 from intersystems-community/dependabot-fixes
package updates to resolve security issues
2 parents f92afbe + 2047c60 commit 2ef5cc0

File tree

9 files changed

+4942
-3471
lines changed

9 files changed

+4942
-3471
lines changed

package-lock.json

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

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,12 +1109,12 @@
11091109
"@types/request": "^2.48.5",
11101110
"@types/ws": "^7.2.5",
11111111
"@types/xmldom": "^0.1.29",
1112-
"@typescript-eslint/eslint-plugin": "^3.4.0",
1113-
"@typescript-eslint/parser": "^3.4.0",
1114-
"eslint": "^7.3.1",
1115-
"eslint-config-airbnb": "^18.2.0",
1112+
"@typescript-eslint/eslint-plugin": "^4.32.0",
1113+
"@typescript-eslint/parser": "^4.32.0",
1114+
"eslint": "^7.32.0",
1115+
"eslint-config-airbnb-base": "^14.2.1",
11161116
"eslint-config-prettier": "^6.11.0",
1117-
"eslint-plugin-import": "^2.21.2",
1117+
"eslint-plugin-import": "^2.24.2",
11181118
"eslint-plugin-jsx-a11y": "^6.3.1",
11191119
"eslint-plugin-node": "^11.1.0",
11201120
"eslint-plugin-prettier": "^3.1.4",
@@ -1127,7 +1127,7 @@
11271127
"prettier": "^2.0.5",
11281128
"tape": "^5.0.1",
11291129
"ts-loader": "^7.0.5",
1130-
"typescript": "^3.9.5",
1130+
"typescript": "^4.4.3",
11311131
"vsce": "^1.93.0",
11321132
"vscode-debugadapter-testsupport": "^1.41.0",
11331133
"vscode-dts": "^0.3.1",
@@ -1136,19 +1136,19 @@
11361136
"webpack-cli": "^4.5.0"
11371137
},
11381138
"dependencies": {
1139+
"@xmldom/xmldom": "^0.7.5",
11391140
"await-notify": "^1.0.1",
11401141
"core-js": "^3.6.5",
11411142
"domexception": "^2.0.1",
11421143
"glob": "^7.1.6",
11431144
"iconv-lite": "^0.6.0",
11441145
"mkdirp": "^1.0.4",
1145-
"node-fetch": "^3.0.0-beta.9",
1146+
"node-fetch": "^3.0.0",
11461147
"request": "^2.88.2",
11471148
"vscode-cache": "^0.3.0",
11481149
"vscode-debugadapter": "^1.41.0",
11491150
"vscode-debugprotocol": "^1.41.0",
11501151
"vscode-extension-telemetry": "^0.1.6",
1151-
"ws": "^7.4.6",
1152-
"xmldom": "^0.5.0"
1152+
"ws": "^7.4.6"
11531153
}
11541154
}

src/api/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import fetch from "node-fetch";
1+
// import fetch from "node-fetch";
2+
// mod.cjs
3+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
4+
// @ts-ignore
5+
const fetch = (...args) => import("node-fetch").then(({ default: fetch }) => fetch(...args));
26
import * as httpModule from "http";
37
import * as httpsModule from "https";
48
import * as url from "url";

src/debug/dbgp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { EventEmitter } from "events";
22
import * as WebSocket from "ws";
33
import * as iconv from "iconv-lite";
4-
import { DOMParser } from "xmldom";
4+
import { DOMParser } from "@xmldom/xmldom";
55

66
/** The encoding all XDebug messages are encoded with */
77
export const ENCODING = "iso-8859-1";

src/debug/debugAdapterFactory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import vscode = require("vscode");
33
import { ObjectScriptDebugSession } from "./debugSession";
44

55
export class ObjectScriptDebugAdapterDescriptorFactory
6-
implements vscode.DebugAdapterDescriptorFactory, vscode.Disposable {
6+
implements vscode.DebugAdapterDescriptorFactory, vscode.Disposable
7+
{
78
private server?: net.Server;
89

910
public createDebugAdapterDescriptor(

src/debug/debugSession.ts

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -406,44 +406,42 @@ export class ObjectScriptDebugSession extends LoggingDebugSession {
406406
const stack = await this._connection.sendStackGetCommand();
407407

408408
const stackFrames = await Promise.all(
409-
stack.stack.map(
410-
async (stackFrame: xdebug.StackFrame, index): Promise<StackFrame> => {
411-
const [, namespace, name] = decodeURI(stackFrame.fileUri).match(/^dbgp:\/\/\|([^|]+)\|(.*)$/);
412-
const routine = name;
413-
// const routine = name.includes(".") ? name : name + ".int";
414-
const fileUri = DocumentContentProvider.getUri(routine, this._workspace, namespace).toString();
415-
const source = new Source(routine, fileUri);
416-
let line = stackFrame.line + 1;
417-
const place = `${stackFrame.method}+${stackFrame.methodOffset}`;
418-
const stackFrameId = this._stackFrameIdCounter++;
419-
let noSource = false;
420-
try {
421-
const document = await vscode.workspace.openTextDocument(vscode.Uri.parse(source.path));
422-
if (source.name.endsWith(".cls") && stackFrame.method !== "") {
423-
const methodMatchPattern = new RegExp(`^(Class)?Method ${stackFrame.method}(?=[( ])`, "i");
424-
for (let i = 0; i < document.lineCount; i++) {
425-
const codeLine = document.lineAt(i);
426-
427-
const methodMatch = codeLine.text.match(methodMatchPattern);
428-
if (methodMatch) {
429-
line = i + 2 + stackFrame.methodOffset;
430-
break;
431-
}
409+
stack.stack.map(async (stackFrame: xdebug.StackFrame, index): Promise<StackFrame> => {
410+
const [, namespace, name] = decodeURI(stackFrame.fileUri).match(/^dbgp:\/\/\|([^|]+)\|(.*)$/);
411+
const routine = name;
412+
// const routine = name.includes(".") ? name : name + ".int";
413+
const fileUri = DocumentContentProvider.getUri(routine, this._workspace, namespace).toString();
414+
const source = new Source(routine, fileUri);
415+
let line = stackFrame.line + 1;
416+
const place = `${stackFrame.method}+${stackFrame.methodOffset}`;
417+
const stackFrameId = this._stackFrameIdCounter++;
418+
let noSource = false;
419+
try {
420+
const document = await vscode.workspace.openTextDocument(vscode.Uri.parse(source.path));
421+
if (source.name.endsWith(".cls") && stackFrame.method !== "") {
422+
const methodMatchPattern = new RegExp(`^(Class)?Method ${stackFrame.method}(?=[( ])`, "i");
423+
for (let i = 0; i < document.lineCount; i++) {
424+
const codeLine = document.lineAt(i);
425+
426+
const methodMatch = codeLine.text.match(methodMatchPattern);
427+
if (methodMatch) {
428+
line = i + 2 + stackFrame.methodOffset;
429+
break;
432430
}
433431
}
434-
this._stackFrames.set(stackFrameId, stackFrame);
435-
} catch (ex) {
436-
noSource = true;
437432
}
438-
return {
439-
id: stackFrameId,
440-
name: place,
441-
source: noSource ? null : source,
442-
line,
443-
column: 1,
444-
};
433+
this._stackFrames.set(stackFrameId, stackFrame);
434+
} catch (ex) {
435+
noSource = true;
445436
}
446-
)
437+
return {
438+
id: stackFrameId,
439+
name: place,
440+
source: noSource ? null : source,
441+
line,
442+
column: 1,
443+
};
444+
})
447445
);
448446

449447
response.body = {

src/languageConfiguration.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { IndentAction, LanguageConfiguration } from "vscode";
22

3-
export const WORD_PATTERN = /((?<=(class|extends|as|of) )(%?\b[a-z0-9]+(\.[a-z0-9]+)*\b))|(\^[a-z0-9]+(\.[a-z0-9]+)*)|((\${1,3}|[irm]?%|\^|#)?[a-z0-9]+)/i;
3+
export const WORD_PATTERN =
4+
/((?<=(class|extends|as|of) )(%?\b[a-z0-9]+(\.[a-z0-9]+)*\b))|(\^[a-z0-9]+(\.[a-z0-9]+)*)|((\${1,3}|[irm]?%|\^|#)?[a-z0-9]+)/i;
45

56
export function getLanguageConfiguration(lang: string): LanguageConfiguration {
67
return {

src/providers/ObjectScriptCompletionItemProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ export class ObjectScriptCompletionItemProvider implements vscode.CompletionItem
341341
className = text.split(" ").pop();
342342
}
343343
// tslint:disable-next-line: max-line-length
344-
pattern = /(?:(Extends |CompileAfter *=|DependsOn *=|PropertyClass *=) *\(? *)((%?[a-zA-Z0-9]*(?:\.[a-zA-Z0-9]*)*)(, *%?[a-zA-Z0-9]*(?:\.[a-zA-Z0-9]*)*|, *)*.?)?/i;
344+
pattern =
345+
/(?:(Extends |CompileAfter *=|DependsOn *=|PropertyClass *=) *\(? *)((%?[a-zA-Z0-9]*(?:\.[a-zA-Z0-9]*)*)(, *%?[a-zA-Z0-9]*(?:\.[a-zA-Z0-9]*)*|, *)*.?)?/i;
345346
if (
346347
!range &&
347348
// && (!document.getWordRangeAtPosition(position, /\bExtends\b\s*/i))

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "./tsconfig.base.json",
33
"compilerOptions": {
44
"module": "commonjs",
5-
"target": "es6",
5+
"target": "es2019",
66
"outDir": "out",
77
"moduleResolution": "node",
88
"lib": ["esnext", "dom"],

0 commit comments

Comments
 (0)