Skip to content

Commit e426ef8

Browse files
committed
Merge branch 'master' into pTests/registerNewFiles
2 parents 92c6df2 + 65fac13 commit e426ef8

File tree

105 files changed

+575
-392
lines changed

Some content is hidden

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

105 files changed

+575
-392
lines changed

.eslintrc.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,15 @@ module.exports = {
173173
"Avoid importing from the core lib's dist/ folders; please use directly from the core lib defined exports.",
174174
},
175175
],
176+
// The following will place an error on the `fs-extra` import since we do not want it to be used for browser compatibility reasons.
177+
paths: [
178+
{
179+
name: 'fs-extra',
180+
message:
181+
'Avoid fs-extra, use shared/fs/fs.ts. Notify the Toolkit team if your required functionality is not available.',
182+
},
183+
],
176184
},
177-
// The following will place an error on the `fs-extra` import since we do not want it to be used for browser compatibility reasons.
178-
// {
179-
// name: 'fs-extra',
180-
// message:
181-
// 'Avoid fs-extra, use shared/fs/fs.ts. Notify the Toolkit team if your required functionality is not available.',
182-
// },
183185
],
184186
},
185187
}

docs/vscode_behaviors.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ for each extension.
1212
- The Extension Host process has at most 5 seconds to shut down, after which it will exit. [1]
1313
- The vscode API will be unreliable at deactivation time. So certain VSC APIs like the filesystem may not work. [1]
1414
- The VSC Filesystem API has been confirmed to not work
15-
- In `Run & Debug` mode, closing the Debug IDE instance behaves differently depending on how it is closed
16-
- The regular close button in the Debug IDE instance results in a graceful shutdown
17-
- The red square in the root IDE instance to stop the debugging session results on a non-graceful shutdown, meaning `deactivate()` is not run.
18-
- `Reload Window` triggers `deactivate()`
15+
- In `Run & Debug` mode, closing the Debug IDE instance behaves differently depending on how it is closed
16+
- The regular close button in the Debug IDE instance results in a graceful shutdown
17+
- The red square in the root IDE instance to stop the debugging session results on a non-graceful shutdown, meaning `deactivate()` is not run.
18+
- `Reload Window` triggers `deactivate()`
1919

2020
Sources:
2121

@@ -25,8 +25,7 @@ Sources:
2525
## State (`globalState`, `Memento`)
2626

2727
TODO:
28-
- How it behaves between remote (ssh) and local
29-
- How it is not completely reliable. Reads/writes have no guarantee to work (though we are fine in most cases)
30-
- How it can break as observed with crash monitoring work. At a certain point writes were seemingly succeeding, but did not actually propagate to all IDE instances.
31-
3228

29+
- How it behaves between remote (ssh) and local
30+
- How it is not completely reliable. Reads/writes have no guarantee to work (though we are fine in most cases)
31+
- How it can break as observed with crash monitoring work. At a certain point writes were seemingly succeeding, but did not actually propagate to all IDE instances.

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": "Bug Fix",
3+
"description": "Amazon Q extension may fail to start if AWS Toolkit extension fails to start"
4+
}
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/amazonq/scripts/build/copyFiles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
/* eslint-disable no-restricted-imports */
67
import * as fs from 'fs-extra'
78
import * as path from 'path'
89

packages/amazonq/test/unit/amazonqGumby/humanInTheLoopManager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('HumanInTheLoopManager', async function () {
3636
)
3737
const outputPathResult = path.join(outputDirectoryPath, 'pom.xml')
3838
assertEqualPaths(newPomFilePath.fsPath, outputPathResult)
39-
const newPomFileContents = await fs.readFileAsString(newPomFilePath.path)
39+
const newPomFileContents = await fs.readFileText(newPomFilePath.path)
4040
assert.strictEqual(
4141
stripStringWhitespace(newPomFileContents),
4242
stripStringWhitespace(`<?xml version="1.0" encoding="UTF-8"?>

packages/amazonq/test/unit/amazonqGumby/transformationResultsHandler.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
*/
55
import assert from 'assert'
66
import sinon from 'sinon'
7-
import fs from 'fs-extra'
87
import os from 'os'
98
import { DiffModel, AddedChangeNode, ModifiedChangeNode } from 'aws-core-vscode/codewhisperer/node'
109
import path from 'path'
1110
import { getTestResourceFilePath } from './amazonQGumbyUtil'
11+
import { fs } from 'aws-core-vscode/shared'
1212

1313
describe('DiffModel', function () {
1414
afterEach(() => {
@@ -20,7 +20,7 @@ describe('DiffModel', function () {
2020

2121
const workspacePath = 'workspace'
2222

23-
sinon.replace(fs, 'existsSync', (path) => {
23+
sinon.replace(fs, 'exists', async (path) => {
2424
const pathStr = path.toString()
2525
if (pathStr.includes(workspacePath)) {
2626
return false
@@ -42,9 +42,9 @@ describe('DiffModel', function () {
4242

4343
const workspacePath = os.tmpdir()
4444

45-
sinon.replace(fs, 'existsSync', (path) => true)
45+
sinon.replace(fs, 'exists', async (path) => true)
4646

47-
fs.writeFileSync(
47+
await fs.writeFile(
4848
path.join(workspacePath, 'README.md'),
4949
'This guide walks you through using Gradle to build a simple Java project.'
5050
)
@@ -56,6 +56,6 @@ describe('DiffModel', function () {
5656

5757
assert.strictEqual(change instanceof ModifiedChangeNode, true)
5858

59-
fs.rmSync(path.join(workspacePath, 'README.md'))
59+
await fs.delete(path.join(workspacePath, 'README.md'), { recursive: true })
6060
})
6161
})

packages/amazonq/test/unit/validation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('package validations', function () {
2323
*/
2424
it('has synced contributes.icons with core/package.json', async function () {
2525
const corePackageJson = JSON.parse(
26-
await fs.readFileAsString(path.resolve(__dirname, '../../../../core/package.json'))
26+
await fs.readFileText(path.resolve(__dirname, '../../../../core/package.json'))
2727
)
2828
assert.deepStrictEqual(packageJson.contributes.icons, corePackageJson.contributes.icons)
2929
})

0 commit comments

Comments
 (0)