Skip to content

Commit 5439f95

Browse files
authored
package: increase minimum vscode to 1.65 #3328
* refactor: remove shared/vscode/secrets.ts * refactor: remove SecretMemento * techdebt.test.ts * refactor: remove QuickPickItemKind back-compat * refactor: remove use of "workbench.action.closeAllEditors"
1 parent 7cb97a2 commit 5439f95

Some content is hidden

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

41 files changed

+187
-217
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Deprecation",
3+
"description": "Minimum required VS Code version is now 1.65"
4+
}

package-lock.json

Lines changed: 8 additions & 8 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
@@ -13,7 +13,7 @@
1313
"url": "https://github.com/aws/aws-toolkit-vscode"
1414
},
1515
"engines": {
16-
"vscode": "^1.50.1"
16+
"vscode": "^1.65.0"
1717
},
1818
"icon": "resources/marketplace/aws-icon-256x256.png",
1919
"bugs": {
@@ -3480,7 +3480,7 @@
34803480
"@types/sinonjs__fake-timers": "^8.1.2",
34813481
"@types/tcp-port-used": "^1.0.1",
34823482
"@types/uuid": "^8.3.3",
3483-
"@types/vscode": "1.50.0",
3483+
"@types/vscode": "^1.65.0",
34843484
"@types/vscode-webview": "^1.57.1",
34853485
"@types/xml2js": "^0.4.8",
34863486
"@typescript-eslint/eslint-plugin": "^5.59.0",

scripts/newChange.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as child_process from 'child_process'
77
import * as fs from 'fs-extra'
88
import { join } from 'path'
99
import * as readlineSync from 'readline-sync'
10-
import { v4 as uuid } from 'uuid'
1110

1211
const directory = join(process.cwd(), '.changes', 'next-release')
1312
const changeTypes = ['Breaking Change', 'Feature', 'Bug Fix', 'Deprecation', 'Removal', 'Test']
@@ -48,7 +47,7 @@ const contents: NewChange = {
4847
type: type,
4948
description: description,
5049
}
51-
const fileName = `${type}-${uuid()}.json`
50+
const fileName = `${type}-${crypto.randomUUID()}.json`
5251
const path = join(directory, fileName)
5352
fs.writeFileSync(path, JSON.stringify(contents, undefined, '\t'))
5453

src/apigateway/explorer/apiGatewayNodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as vscode from 'vscode'
1010

1111
import { AWSTreeNodeBase } from '../../shared/treeview/nodes/awsTreeNodeBase'
1212
import { PlaceholderNode } from '../../shared/treeview/nodes/placeholderNode'
13-
import { makeChildrenNodes } from '../../shared/treeview/utils'
13+
import { compareTreeItems, makeChildrenNodes } from '../../shared/treeview/utils'
1414
import { DefaultApiGatewayClient } from '../../shared/clients/apiGatewayClient'
1515
import { RestApi } from 'aws-sdk/clients/apigateway'
1616
import { toArrayAsync, toMap, updateInPlace } from '../../shared/utilities/collectionUtils'
@@ -43,7 +43,7 @@ export class ApiGatewayNode extends AWSTreeNodeBase {
4343
this,
4444
localize('AWS.explorerNode.apigateway.noApis', '[No API Gateway REST APIs found]')
4545
),
46-
sort: (nodeA, nodeB) => nodeA.label!.localeCompare(nodeB.label!),
46+
sort: (nodeA, nodeB) => compareTreeItems(nodeA, nodeB),
4747
})
4848
}
4949

src/apprunner/explorer/apprunnerNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
import { makeChildrenNodes } from '../../shared/treeview/utils'
5+
import { compareTreeItems, makeChildrenNodes } from '../../shared/treeview/utils'
66
import * as vscode from 'vscode'
77
import { AWSTreeNodeBase } from '../../shared/treeview/nodes/awsTreeNodeBase'
88
import { AppRunnerServiceNode } from './apprunnerServiceNode'
@@ -38,7 +38,7 @@ export class AppRunnerNode extends AWSTreeNodeBase {
3838
this,
3939
localize('AWS.explorerNode.apprunner.noServices', '[No App Runner services found]')
4040
),
41-
sort: (nodeA, nodeB) => nodeA.label!.localeCompare(nodeB.label!),
41+
sort: (nodeA, nodeB) => compareTreeItems(nodeA, nodeB),
4242
})
4343
}
4444

src/apprunner/explorer/apprunnerServiceNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class AppRunnerServiceNode extends CloudWatchLogsBase implements AWSResou
8787
this.lock.acquire(this._info.ServiceId, done => {
8888
const lastLabel = this.label
8989
this.updateInfo(info)
90-
this.updateStatus(lastLabel)
90+
this.updateStatus(typeof lastLabel === 'string' ? lastLabel : lastLabel?.label)
9191
done()
9292
})
9393
}

src/awsexplorer/regionNode.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { DefaultIotClient } from '../shared/clients/iotClient'
2525
import { DefaultS3Client } from '../shared/clients/s3Client'
2626
import { DefaultSchemaClient } from '../shared/clients/schemaClient'
2727
import { getEcsRootNode } from '../ecs/model'
28-
import { TreeShim } from '../shared/treeview/utils'
28+
import { compareTreeItems, TreeShim } from '../shared/treeview/utils'
2929

3030
const serviceCandidates = [
3131
{
@@ -122,11 +122,7 @@ export class RegionNode extends AWSTreeNodeBase {
122122
private sortNodes(nodes: AWSTreeNodeBase[]) {
123123
return nodes.sort((a, b) => {
124124
// Always sort `ResourcesNode` at the bottom
125-
return a instanceof ResourcesNode
126-
? 1
127-
: b instanceof ResourcesNode
128-
? -1
129-
: (a.label ?? '').localeCompare(b.label ?? '')
125+
return a instanceof ResourcesNode ? 1 : b instanceof ResourcesNode ? -1 : compareTreeItems(a, b)
130126
})
131127
}
132128
public update(region: Region): void {

src/codecatalyst/auth.ts

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as vscode from 'vscode'
77
import { CodeCatalystClient } from '../shared/clients/codecatalystClient'
8-
import { getIdeProperties, isCloud9 } from '../shared/extensionUtilities'
8+
import { getIdeProperties } from '../shared/extensionUtilities'
99
import {
1010
Auth,
1111
isBuilderIdConnection,
@@ -174,41 +174,6 @@ export class CodeCatalystAuthenticationProvider {
174174
private static instance: CodeCatalystAuthenticationProvider
175175

176176
public static fromContext(ctx: Pick<vscode.ExtensionContext, 'secrets' | 'globalState'>) {
177-
const secrets = isCloud9() ? new SecretMemento(ctx.globalState) : ctx.secrets
178-
179-
return (this.instance ??= new this(new CodeCatalystAuthStorage(secrets), ctx.globalState))
180-
}
181-
}
182-
183-
/**
184-
* `secrets` API polyfill for C9.
185-
*
186-
* For development only. Do NOT use this for anything else.
187-
*/
188-
class SecretMemento implements vscode.SecretStorage {
189-
private readonly onDidChangeEmitter = new vscode.EventEmitter<vscode.SecretStorageChangeEvent>()
190-
public readonly onDidChange = this.onDidChangeEmitter.event
191-
192-
public constructor(private readonly memento: vscode.Memento) {}
193-
194-
public async get(key: string): Promise<string | undefined> {
195-
return this.getSecrets()[key]
196-
}
197-
198-
public async store(key: string, value: string): Promise<void> {
199-
const current = this.getSecrets()
200-
await this.memento.update('__secrets', { ...current, [key]: value })
201-
this.onDidChangeEmitter.fire({ key })
202-
}
203-
204-
public async delete(key: string): Promise<void> {
205-
const current = this.getSecrets()
206-
delete current[key]
207-
await this.memento.update('__secrets', current)
208-
this.onDidChangeEmitter.fire({ key })
209-
}
210-
211-
private getSecrets(): Record<string, string | undefined> {
212-
return this.memento.get('__secrets', {})
177+
return (this.instance ??= new this(new CodeCatalystAuthStorage(ctx.secrets), ctx.globalState))
213178
}
214179
}

src/integrationTest/shared/codelens/samTemplateCodeLensProvider.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ describe('SamTemplateCodeLensProvider', async function () {
3131
})
3232

3333
it('provides a CodeLens for a file with a new resource', async function () {
34-
// redhat.vscode-yaml requires vscode 1.52
35-
// https://github.com/redhat-developer/vscode-yaml/blob/main/package.json
36-
if (semver.lt(vscode.version, '1.52.0')) {
34+
// - redhat.vscode-yaml requires vscode 1.63: https://github.com/redhat-developer/vscode-yaml/blob/main/package.json
35+
// - the codelens behavior changed with the vscode 1.66 release
36+
if (semver.lt(vscode.version, '1.66.0')) {
3737
this.skip()
3838
}
3939
await activateExtension(VSCODE_EXTENSION_ID.yaml, false)

0 commit comments

Comments
 (0)