Skip to content

Commit a7256e5

Browse files
authored
build: bump minimum vscode to 1.83 aws#5704
Problem: Minimum vscode version is very old and new features require node 16. Solution: - Increase minimum vscode to 1.83 - Update techdebt tests.
1 parent 0650ff4 commit a7256e5

File tree

12 files changed

+27
-65
lines changed

12 files changed

+27
-65
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Removal",
3+
"description": "Minimum required VSCode version is now 1.83"
4+
}

packages/amazonq/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,6 @@
10461046
},
10471047
"engines": {
10481048
"npm": "^10.1.0",
1049-
"vscode": "^1.68.0"
1049+
"vscode": "^1.83.0"
10501050
}
10511051
}

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "Apache-2.0",
66
"engines": {
77
"npm": "^10.1.0",
8-
"vscode": "^1.68.0"
8+
"vscode": "^1.83.0"
99
},
1010
"exports": {
1111
".": "./dist/src/extension.js",

packages/core/src/lambda/commands/uploadLambda.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import AdmZip from 'adm-zip'
1212
import * as path from 'path'
1313
import { fs } from '../../shared'
1414
import { showConfirmationMessage, showViewLogsMessage } from '../../shared/utilities/messages'
15-
import { cloud9Findfile, makeTemporaryToolkitFolder, tryRemoveFolder } from '../../shared/filesystemUtilities'
15+
import { makeTemporaryToolkitFolder, tryRemoveFolder } from '../../shared/filesystemUtilities'
1616
import * as localizedText from '../../shared/localizedText'
1717
import { getLogger } from '../../shared/logger'
1818
import { SamCliBuildInvocation } from '../../shared/sam/cli/samCliBuild'
@@ -494,17 +494,15 @@ export async function findApplicationJsonFile(
494494
}
495495
const isdir = await fs.existsDir(startPath.fsPath)
496496
const parentDir = isdir ? startPath.fsPath : path.dirname(startPath.fsPath)
497-
const found = cloud9
498-
? await cloud9Findfile(parentDir, '.application.json')
499-
: await vscode.workspace.findFiles(
500-
new vscode.RelativePattern(parentDir, '**/.application.json'),
501-
// exclude:
502-
// - null = NO excludes apply
503-
// - undefined = default excludes apply (e.g. the `files.exclude` setting but not `search.exclude`).
504-
// eslint-disable-next-line unicorn/no-null
505-
null,
506-
1
507-
)
497+
const found = await vscode.workspace.findFiles(
498+
new vscode.RelativePattern(parentDir, '**/.application.json'),
499+
// exclude:
500+
// - null = NO excludes apply
501+
// - undefined = default excludes apply (e.g. the `files.exclude` setting but not `search.exclude`).
502+
// eslint-disable-next-line unicorn/no-null
503+
null,
504+
1
505+
)
508506
if (!found || found.length === 0) {
509507
getLogger().debug('uploadLambda: .application.json not found in: "%s"', parentDir)
510508
}

packages/core/src/shared/filesystemUtilities.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -221,35 +221,6 @@ export async function hasFileWithSuffix(dir: string, suffix: string, exclude?: v
221221
return matchedFiles.length > 0
222222
}
223223

224-
/**
225-
* TEMPORARY SHIM for vscode.workspace.findFiles() on Cloud9.
226-
*
227-
* @param dir Directory to search
228-
* @param fileName Name of file to locate
229-
* @returns List of one or zero Uris (for compat with vscode.workspace.findFiles())
230-
*/
231-
export async function cloud9Findfile(dir: string, fileName: string): Promise<vscode.Uri[]> {
232-
getLogger().debug('cloud9Findfile: %s', dir)
233-
const files = await fs.readdir(dir)
234-
const subDirs: vscode.Uri[] = []
235-
for (const file of files) {
236-
const [currentFileName] = file
237-
const filePath = path.join(dir, currentFileName)
238-
if (filePath === path.join(dir, fileName)) {
239-
return [vscode.Uri.file(filePath)]
240-
}
241-
if (await fs.existsDir(filePath)) {
242-
subDirs.push(vscode.Uri.file(filePath))
243-
}
244-
}
245-
for (const d of subDirs) {
246-
const found = await cloud9Findfile(d.fsPath, fileName)
247-
if (found.length > 0) {
248-
return found
249-
}
250-
}
251-
return []
252-
}
253224
/**
254225
* @returns A string path to the last locally stored download location. If none, returns the users 'Downloads' directory path.
255226
*/

packages/core/src/test/credentials/auth.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { UserCredentialsUtils } from '../../shared/credentials/userCredentialsUt
1919
import { getCredentialsFilename } from '../../auth/credentials/sharedCredentialsFile'
2020
import { Connection, isIamConnection, isSsoConnection, scopesSsoAccountAccess } from '../../auth/connection'
2121
import { AuthNode, createDeleteConnectionButton, promptForConnection } from '../../auth/utils'
22-
import { isMinVscode } from '../../shared/vscode/env'
2322

2423
const ssoProfile = createSsoProfile()
2524
const scopedSsoProfile = createSsoProfile({ scopes: ['foo'] })
@@ -586,10 +585,6 @@ describe('Auth', function () {
586585
})
587586

588587
it('reauthenticates a connection if the user selects an expired one', async function () {
589-
if (isMinVscode('1.83.0')) {
590-
this.skip()
591-
}
592-
593588
getTestWindow().onDidShowQuickPick(async (picker) => {
594589
await picker.untilReady()
595590
const connItem = picker.findItemOrThrow(/IAM Identity Center/)

packages/core/src/test/shared/vscode/runCommand.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { assertTelemetry, getMetrics, installFakeClock } from '../../testUtil'
1717
import { getTestWindow } from '../../shared/vscode/window'
1818
import { makeTemporaryToolkitFolder } from '../../../shared'
1919
import path from 'path'
20-
import * as env from '../../../shared/vscode/env'
2120
import { fakeErrorChain, getAwsServiceError } from '../errors.test'
2221

2322
async function throwMe(errorOrFn?: Error | (() => Promise<never>)): Promise<void | never> {
@@ -104,10 +103,6 @@ describe('runCommand', function () {
104103
}
105104

106105
it('vscode ISDIR', async function () {
107-
if (env.isMinVscode('1.83.0')) {
108-
this.skip()
109-
}
110-
111106
const pat = (() => {
112107
switch (os.platform()) {
113108
case 'win32':

packages/core/src/test/techdebt.test.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,7 @@ describe('tech debt', function () {
1818

1919
it('vscode minimum version', async function () {
2020
const minVscode = env.getMinVscodeVersion()
21-
22-
assert.ok(
23-
semver.lt(minVscode, '1.75.0'),
24-
'remove filesystemUtilities.findFile(), use vscode.workspace.findFiles() instead (after Cloud9 VFS fixes bug)'
25-
)
26-
27-
assert.ok(
28-
semver.lt(minVscode, '1.75.0'),
29-
'remove AsyncLocalStorage polyfill used in `spans.ts` if Cloud9 is on node 14+'
30-
)
21+
assert.ok(semver.lt(minVscode, '1.84.0'))
3122

3223
// see https://github.com/microsoft/vscode/issues/173861
3324
assert.ok(
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Breaking Change",
3+
"description": "Bumping VS Code minimum version to 1.83.0"
4+
}

0 commit comments

Comments
 (0)