Skip to content

Commit 9e60035

Browse files
committed
aws sdk for javascript V3. Refactor using async/await functions.
1 parent 8e0efef commit 9e60035

9 files changed

+1987
-147
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
lib/aws-sdk/build/node_modules/
3+
lib/aws-sdk/lib/aws-js-sdk-bundle.js.LICENSE.txt

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The Chrome Extension can be downloaded here:
1010
* [Why this Chrome Extension?](#why)
1111
* [Getting Started](#gettingstarted)
1212
* [Create a symlink to your .aws directory (for Windows users)](#symlink)
13+
* [Plugin Development Notes](#development)
1314
* [Frequently Asked Question](#faq)
1415

1516
## <a name="why"></a>Why this Chrome Extension?
@@ -25,6 +26,23 @@ TODO
2526
## <a name="symlink"></a>Create a symlink to your .aws directory (for Windows users)
2627
TODO
2728

29+
## <a name="development"></a>Plugin Development Notes
30+
Here are some important notes for development of this plugin.
31+
32+
### AWS SDK with webpack
33+
The AWS SDK for Javascript is packaged with webpack. npm and webpack configuration is located in `lib/aws-sdk/build`.
34+
35+
To install a specific version of an AWS SDK module, go into the build directory and run:
36+
```
37+
npm install --save --save-exact @aws-sdk/[email protected]
38+
```
39+
40+
To simply install the required node modules and build the sdk library required for the plugin:
41+
```
42+
npm install
43+
npm run build
44+
```
45+
2846
## <a name="faq"></a>FAQ: Frequently Asked Question
2947
1. Why can I not save file somewhere else?
3048
TODO

background/script.js

+176-106
Large diffs are not rendered by default.

lib/aws-sdk-2.7.5.min.js

-41
This file was deleted.

lib/aws-sdk/build/package-lock.json

+1,747
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/aws-sdk/build/package.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "aws-sdk-webpack",
3+
"version": "1.0.0",
4+
"main": "script.js",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1",
7+
"build": "webpack"
8+
},
9+
"dependencies": {
10+
"@aws-sdk/client-sts": "3.209.0"
11+
},
12+
"devDependencies": {
13+
"path-browserify": "^1.0.1",
14+
"webpack": "^5.0.0",
15+
"webpack-cli": "^4.10.0"
16+
}
17+
}

lib/aws-sdk/build/script.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { STSClient, AssumeRoleCommand } = require("@aws-sdk/client-sts");
2+
3+
export const AWSSTSClient = STSClient
4+
export const AWSAssumeRoleCommand = AssumeRoleCommand

lib/aws-sdk/build/webpack.config.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Import path for resolving file paths
2+
var path = require("path");
3+
module.exports = {
4+
// Specify the entry point for our app.
5+
entry: [path.join(__dirname, "script.js")],
6+
// Specify the output file containing our bundled code.
7+
output: {
8+
path: path.resolve(__dirname, '../lib'),
9+
filename: 'aws-js-sdk-bundle.js',
10+
library: {
11+
name: 'webpacksts',
12+
type: 'var',
13+
}
14+
},
15+
mode: 'production',
16+
// Enable WebPack to use the 'path' package.
17+
resolve: {
18+
fallback: { path: require.resolve("path-browserify") }
19+
}
20+
};

lib/aws-sdk/lib/aws-js-sdk-bundle.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)