Skip to content

Commit

Permalink
build(scripts): clean things up, improve usability and consistency (#…
Browse files Browse the repository at this point in the history
…2528)

* Clean up scripts and main entry point file
* Combine test-scripts and build-scripts into just scripts
* Update tasks and launch configurations
* Remove redundant scripts
* Add `isAutomation` function
  • Loading branch information
JadenSimon authored Mar 18, 2022
1 parent d79deae commit 489a9b0
Show file tree
Hide file tree
Showing 37 changed files with 223 additions and 314 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ third-party
src/shared/telemetry/clienttelemetry.d.ts
**/*.gen.ts
src/testFixtures/workspaceFolder/ts-plain-sam-app/
dist/**
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ node_modules
.coverage/
.vscode-test/
*.vsix
*.bk
**/.DS_Store
.idea
telemetryCache
quickStart*.html
README.quickstart.cloud9.md
README.quickstart.vscode.md
.gitcommit
media/libs/
resources/debugger/__pycache__

# Auto generated definitions
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ third-party/**
CHANGELOG.md
src/shared/telemetry/service-2.json
.changes
media/libs/vue.min.js
src/testFixtures/**
17 changes: 8 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"env": {
"AWS_TOOLKIT_IGNORE_WEBPACK_BUNDLE": "true",
"SSMDOCUMENT_LANGUAGESERVER_PORT": "6010",
"WEBPACK_DEVELOPER_SERVER": "http://localhost:8080"
},
Expand Down Expand Up @@ -63,8 +62,8 @@
"env": {
"TEST_REPORT_DIR": "${workspaceFolder}/.test-reports",
"TEST_FILE": "null",
"AWS_TOOLKIT_IGNORE_WEBPACK_BUNDLE": "true",
"NO_COVERAGE": "true"
"NO_COVERAGE": "true",
"AWS_TOOLKIT_AUTOMATION": "LOCAL_TESTS"
},
"outFiles": ["${workspaceFolder}/dist/src/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
Expand All @@ -83,8 +82,8 @@
"env": {
"TEST_REPORT_DIR": "${workspaceFolder}/.test-reports",
"TEST_FILE": "${relativeFileDirname}/${fileBasenameNoExtension}",
"AWS_TOOLKIT_IGNORE_WEBPACK_BUNDLE": "true",
"NO_COVERAGE": "true"
"NO_COVERAGE": "true",
"AWS_TOOLKIT_AUTOMATION": "LOCAL_TESTS"
},
"outFiles": ["${workspaceFolder}/dist/.vscode/*", "${workspaceFolder}/dist/src/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
Expand All @@ -102,8 +101,8 @@
"env": {
"TEST_REPORT_DIR": "${workspaceFolder}/.test-reports",
"TEST_FILE": "null",
"AWS_TOOLKIT_IGNORE_WEBPACK_BUNDLE": "true",
"NO_COVERAGE": "true"
"NO_COVERAGE": "true",
"AWS_TOOLKIT_AUTOMATION": "LOCAL_TESTS"
},
"outFiles": ["${workspaceFolder}/dist/src/integrationTest/**/*.js"],
"preLaunchTask": "npm: testCompile"
Expand All @@ -121,8 +120,8 @@
"env": {
"TEST_REPORT_DIR": "${workspaceFolder}/.test-reports",
"TEST_FILE": "${relativeFileDirname}/${fileBasenameNoExtension}",
"AWS_TOOLKIT_IGNORE_WEBPACK_BUNDLE": "true",
"NO_COVERAGE": "true"
"NO_COVERAGE": "true",
"AWS_TOOLKIT_AUTOMATION": "LOCAL_TESTS"
},
"outFiles": ["${workspaceFolder}/dist/src/integrationTest/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
Expand Down
17 changes: 16 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,27 @@
{
"type": "npm",
"script": "compile",
"problemMatcher": "$tsc"
"problemMatcher": "$tsc",
"dependsOn": ["Kill Tasks"]
},
{
"type": "npm",
"script": "clean",
"problemMatcher": []
},
{
"label": "Kill Tasks",
"type": "process",
"command": "${input:killTasks}",
"problemMatcher": []
}
],
"inputs": [
{
"id": "killTasks",
"type": "command",
"command": "workbench.action.tasks.terminate",
"args": "terminateAll"
}
]
}
4 changes: 1 addition & 3 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
.vscode/**
.vscode-test/**
.changes/**
build-scripts/**
scripts/**
buildspec/**
dist/src/test/**
dist/src/integrationTest/**
dist/src/testFixtures/**
dist/test/**
dist/integrationTest/**
dist/third-party/test/**
dist/extension.js.map
dist/**/*.map
src/**
out/**
third-party/test/**
test-scripts/**
webpack.config.js
.gitignore
coverconfig.json
Expand Down
17 changes: 9 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,12 @@ Toolkit for testing and development purposes. To use a setting just add it to
your `settings.json`. At runtime if the Toolkit reads any of these settings,
the "AWS" statusbar item will [change its color](https://github.com/aws/aws-toolkit-vscode/blob/d52416408aca7e68ff685137f0fe263581f44cfc/src/credentials/awsCredentialsStatusBarItem.ts#L58).
### Telemetry in prerelease builds
### Telemetry and Automation
Normally, a non-release VSIX of AWS Toolkit will not send telemetry. Sometimes
you might want to override this, when sharing a build with a beta-tester
audience. To enable telemetry to in a non-release build, set [forceTelemetry = true]().
Metrics are only emitted if the extension is assumed to be ran from an actual user rather than automation scripts.
This condition is checked through an environment variable `AWS_TOOLKIT_AUTOMATION` which is set by test entry points.
If any truthy value is present, telemetry will be dropped if the current build is not a release version. Utility functions,
such as `assertTelemetry`, can be used to test specific telemetry emits even in automation.
### AWS SDK generator
Expand All @@ -255,10 +256,10 @@ requests just from the model/types.
1. Add an entry to the list in `generateServiceClient.ts`:
```diff
diff --git a/build-scripts/generateServiceClient.ts b/build-scripts/generateServiceClient.ts
diff --git a/src/scripts/build/generateServiceClient.ts b/src/scripts/build/generateServiceClient.ts
index 8bb278972d29..6c6914ec8812 100644
--- a/build-scripts/generateServiceClient.ts
+++ b/build-scripts/generateServiceClient.ts
--- a/src/scripts/build/generateServiceClient.ts
+++ b/src/scripts/build/generateServiceClient.ts
@@ -199,6 +199,10 @@ ${fileContents}
;(async () => {
const serviceClientDefinitions: ServiceClientDefinition[] = [
Expand All @@ -272,7 +273,7 @@ requests just from the model/types.
```
2. Run the script:
```
./node_modules/.bin/ts-node ./build-scripts/generateServiceClient.ts
./node_modules/.bin/ts-node ./scripts/build/generateServiceClient.ts
```
3. The script produces a `*.d.ts` file (used only for IDE
code-completion, not required to actually make requests):
Expand Down
41 changes: 0 additions & 41 deletions build-scripts/bundleDeps.js

This file was deleted.

44 changes: 0 additions & 44 deletions build-scripts/copyDistFiles.ts

This file was deleted.

18 changes: 0 additions & 18 deletions build-scripts/copyExtensionMain.js

This file was deleted.

29 changes: 0 additions & 29 deletions build-scripts/copyNonCodeFiles.js

This file was deleted.

40 changes: 0 additions & 40 deletions extensionMain.js

This file was deleted.

Loading

0 comments on commit 489a9b0

Please sign in to comment.