Skip to content

Commit ac8c19e

Browse files
committed
refactor: change import to require for certReaders and fix some linting issues
1 parent 15da1a5 commit ac8c19e

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"preversion": "npm run test",
3737
"version": "npm run compile && git add -A .",
3838
"watch": "tsc --build --watch",
39-
"lint": "eslint . --ext .ts,.tsx",
40-
"lint:fix": "eslint . --ext .ts,.tsx --fix"
39+
"lint": "eslint . --ext .ts",
40+
"lint:fix": "eslint . --ext .ts --fix"
4141
},
4242
"devDependencies": {
4343
"@commitlint/cli": "^19.8.0",
@@ -86,6 +86,7 @@
8686
"endOfLine": "lf"
8787
},
8888
"dependencies": {
89+
"mac-ca": "^3.1.1",
8990
"win-ca": "^3.5.1"
9091
}
9192
}

runtimes/runtimes/lsp/router/loggingServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export class LoggingServer {
1616
this.lspServer = new LspServer(this.lspConnection, this.encoding, this.logger)
1717
this.lspServer.setInitializeHandler((params: InitializeParams): Promise<InitializeResult> => {
1818
this.updateLoggingLevel(params.initializationOptions?.logLevel ?? ('log' as LogLevel))
19-
return {
19+
return Promise.resolve({
2020
capabilities: {},
21-
}
21+
})
2222
})
2323
this.lspServer.setDidChangeConfigurationHandler(async _params => {
2424
const logLevelConfig = await lspConnection.workspace.getConfiguration({

runtimes/runtimes/util/standalone/certificatesReaders.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
/*!
23
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
34
* SPDX-License-Identifier: Apache-2.0
@@ -6,8 +7,6 @@
67
import { readdirSync, readFileSync } from 'node:fs'
78
import path from 'node:path'
89
import { OperationalTelemetryProvider, TELEMETRY_SCOPES } from '../../operational-telemetry/operational-telemetry'
9-
import winCaReader from 'win-ca/api'
10-
import macCertsReader from 'mac-ca'
1110

1211
const UNIX_CERT_FILES = [
1312
'/etc/ssl/certs/ca-certificates.crt',
@@ -78,6 +77,7 @@ export function readLinuxCertificates(): string[] {
7877
}
7978

8079
export function readWindowsCertificates(): string[] {
80+
const winCaReader = require('win-ca')
8181
const certs: string[] = []
8282

8383
winCaReader({
@@ -90,6 +90,8 @@ export function readWindowsCertificates(): string[] {
9090
}
9191

9292
export function readMacosCertificates(): string[] {
93+
const macCertsReader = require('mac-ca')
94+
9395
const certs: string[] = macCertsReader.get({
9496
excludeBundled: false,
9597
})

runtimes/runtimes/util/telemetryLspServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ export function getTelemetryLspServer(
6767
setServerCrashTelemetryListeners()
6868
setMemoryUsageTelemetry()
6969

70-
return {
70+
return Promise.resolve({
7171
capabilities: {},
72-
}
72+
})
7373
})
7474

7575
lspServer.setDidChangeConfigurationHandler(async _params => {

0 commit comments

Comments
 (0)