Skip to content

Commit 3e3b7ae

Browse files
authored
feature(q): add Amazon Q + CodeWhisperer subproject files (#4424)
Initial commit to add the subproject to packages/. This includes: - Extending tsconfigs for subprojects - .vscode settings to start the extension sandbox in vscode - barebones activation functions and package.json, package.nls.json Coming work: - webpack configs - more npm scripts (`serve` is a placeholder) - Get the extension to show up in the side bar. - Package to .vsix ## Problem ## Solution <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Update the changelog using `npm run newChange`. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: aws-toolkit-automation <>
1 parent 8da9daa commit 3e3b7ae

17 files changed

+306
-91
lines changed

docs/ARCHITECTURE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ functionality of that subproject.
1414

1515
Current quirks of the current monorepo status that should be resolved/evaluated in later versions (TODO):
1616

17+
- [**Running the test suites in VSCode has changed**](../CONTRIBUTING.md#test)
1718
- The [root package.json](../package.json) contains common dependencies for subprojects, and workspace
1819
entries for each of the subprojects.
1920
- This package contains shortcuts to some of the `npm` scripts found in the subproject(s).
@@ -32,7 +33,7 @@ Current quirks of the current monorepo status that should be resolved/evaluated
3233
- LICENSE, README.md, and other non-code artifacts that must be packaged into the .vsix are currently
3334
being copied into the packaging subproject directory from the root project directory as part of the `copyFiles` task.
3435
- Pre-release only publishes packages/toolkit extension directly. It should be extended to other added extensions. See [`release.yml`](../.github/workflows/release.yml)
35-
- [**Running the test suites in VSCode has changed**](../CONTRIBUTING.md#test)
36+
- VSCode does not support inheriting/extending `.vscode/` settings: https://github.com/microsoft/vscode/issues/15909
3637

3738
## Commands
3839

package-lock.json

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

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,9 @@
6262
"husky": "^9.0.7",
6363
"typescript": "^5.0.4",
6464
"ts-node": "^10.9.1"
65+
},
66+
"dependencies": {
67+
"vscode-nls": "^5.2.0",
68+
"vscode-nls-dev": "^4.0.4"
6569
}
6670
}

packages/.tsconfig.packages.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"compilerOptions": {
3+
"paths": {
4+
"*": ["types/*"],
5+
"@sinonjs/fake-timers": ["node_modules/@types/sinonjs__fake-timers"]
6+
},
7+
"incremental": true,
8+
"module": "commonjs",
9+
"target": "es2021",
10+
"sourceMap": true,
11+
"moduleResolution": "node",
12+
"resolveJsonModule": true,
13+
"strict": true,
14+
"noUnusedLocals": true,
15+
"noImplicitOverride": true,
16+
"lib": ["dom", "es2021"],
17+
"skipLibCheck": true,
18+
"forceConsistentCasingInFileNames": true,
19+
"jsx": "preserve",
20+
"esModuleInterop": true
21+
}
22+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": ["dbaeumer.vscode-eslint"]
5+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"debugWebviews": true,
13+
"rendererDebugOptions": {
14+
"urlFilter": "*amazonwebservices.aws-toolkit-vscode*",
15+
"webRoot": "${workspaceFolder}"
16+
},
17+
"runtimeExecutable": "${execPath}",
18+
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
19+
"env": {
20+
"SSMDOCUMENT_LANGUAGESERVER_PORT": "6010",
21+
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080"
22+
},
23+
"envFile": "${workspaceFolder}/.local.env",
24+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
25+
"preLaunchTask": "watch"
26+
}
27+
]
28+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"files.exclude": {},
3+
"search.exclude": {
4+
"dist": true,
5+
"node_modules": true
6+
},
7+
"files.watcherExclude": {},
8+
"typescript.preferences.importModuleSpecifier": "relative",
9+
"javascript.preferences.importModuleSpecifier": "relative",
10+
"typescript.tsdk": "../../node_modules/typescript/lib",
11+
"npm.packageManager": "npm"
12+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "watch",
8+
"type": "npm",
9+
"script": "watch",
10+
"problemMatcher": "$tsc-watch",
11+
"isBackground": true,
12+
"group": {
13+
"kind": "build",
14+
"isDefault": true
15+
},
16+
"dependsOn": ["serve"]
17+
},
18+
{
19+
"label": "serve",
20+
"type": "npm",
21+
"script": "serve",
22+
"group": "build",
23+
"isBackground": true,
24+
"problemMatcher": {
25+
"owner": "custom",
26+
"pattern": {
27+
"regexp": ".",
28+
"file": 1,
29+
"location": 2,
30+
"message": 3
31+
},
32+
"background": {
33+
"activeOnStart": true,
34+
"beginsPattern": "Project is running at",
35+
"endsPattern": "compiled successfully"
36+
}
37+
}
38+
},
39+
{
40+
"type": "npm",
41+
"script": "compile",
42+
"dependsOn": ["Kill Tasks"],
43+
"problemMatcher": "$tsc"
44+
},
45+
{
46+
"type": "npm",
47+
"script": "clean",
48+
"dependsOn": ["Kill Tasks"],
49+
"problemMatcher": []
50+
},
51+
{
52+
"label": "Kill Tasks",
53+
"type": "process",
54+
"command": "${input:killTasks}",
55+
"problemMatcher": []
56+
}
57+
],
58+
"inputs": [
59+
{
60+
"id": "killTasks",
61+
"type": "command",
62+
"command": "workbench.action.tasks.terminate",
63+
"args": "terminateAll"
64+
}
65+
]
66+
}

packages/amazonq/.vscodeignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Ignore everything by default. #1899
2+
*
3+
*/**
4+
5+
# Ignore outside dirs up to the root package.json, otherwise those will be collected as well
6+
# (until vsce officially supports workspaces: https://github.com/microsoft/vscode-vsce/issues/580)
7+
../**
8+
../../**
9+
10+
# Allowlist
11+
# ---------
12+
!dist/*
13+
!dist/*/!(*.*.map)
14+
!package.json
15+
!package.nls.json

packages/amazonq/package.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "amazonq",
3+
"displayName": "Amazon Q (Preview) + CodeWhisperer",
4+
"description": "Amazon Q (Preview) + CodeWhisperer",
5+
"version": "1.0.0-SNAPSHOT",
6+
"extensionKind": [
7+
"workspace"
8+
],
9+
"publisher": "amazonwebservices",
10+
"license": "Apache-2.0",
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/aws/aws-toolkit-vscode"
14+
},
15+
"engines": {
16+
"npm": "^10.1.0",
17+
"vscode": "^1.68.0"
18+
},
19+
"bugs": {
20+
"url": "https://github.com/aws/aws-toolkit-vscode/issues"
21+
},
22+
"galleryBanner": {
23+
"color": "#FF9900",
24+
"theme": "light"
25+
},
26+
"categories": [
27+
"Debuggers",
28+
"Linters",
29+
"Visualization",
30+
"Other"
31+
],
32+
"keywords": [
33+
"CodeWhisperer",
34+
"Code",
35+
"Whisperer"
36+
],
37+
"preview": false,
38+
"qna": "https://github.com/aws/aws-toolkit-vscode/issues",
39+
"activationEvents": [
40+
"onStartupFinished",
41+
"onUri"
42+
],
43+
"main": "./dist/src/main.js",
44+
"scripts": {
45+
"clean": "ts-node ../../scripts/clean.ts dist/",
46+
"compile": "tsc -p ./",
47+
"testCompile": "npm run compile",
48+
"watch": "npm run clean && tsc -watch -p ./",
49+
"serve": "echo 1"
50+
},
51+
"dependencies": {},
52+
"devDependencies": {},
53+
"contributes": {}
54+
}

0 commit comments

Comments
 (0)