ember-cli-deploy-s3-index 3.0.0 → 4.0.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Change Log
2
2
 
3
3
 
4
+ ## 4.0.0-0 (2023-08-28)
5
+
4
6
  ## 3.0.0 (2023-05-16)
5
7
 
6
8
  #### :boom: Breaking Change
@@ -17,6 +19,8 @@
17
19
  - Kelvin Luck ([@vitch](https://github.com/vitch))
18
20
  - Luke Melia ([@lukemelia](https://github.com/lukemelia))
19
21
 
22
+ ## 2.0.0 There was no 2.0
23
+
20
24
  ## [v1.0.1](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index/tree/v1.0.1)
21
25
  [Full Changelog](https://github.com/ember-cli-deploy/ember-cli-deploy-s3-index/compare/v1.0.0...v1.0.1)
22
26
 
package/README.md CHANGED
@@ -140,9 +140,9 @@ A flag to specify whether the revision should be overwritten if it already exist
140
140
 
141
141
  The underlying S3 library used to upload the files to S3. This allows the user to use the default upload client provided by this plugin but switch out the underlying library that is used to actually send the files.
142
142
 
143
- The client specified MUST implement functions called `getObject` and `putObject`.
143
+ The client specified MUST implement functions called `getObject` and `putObject`. See [Using V2 API] (https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html#using_v2_commands).
144
144
 
145
- *Default:* the default S3 library is `aws-sdk`
145
+ *Default:* the default S3 library is `@aws-sdk/s3-client` (AWS JS SDK v3). Please use this addon version < 3.0.0 if you want to use AWS JS SDK 2.0
146
146
 
147
147
  ### endpoint
148
148
 
@@ -334,4 +334,4 @@ If you'd like to be able to preview a deployed revision before activation, you'l
334
334
  [4]: https://github.com/ember-cli-deploy/ember-cli-deploy-build "ember-cli-deploy-build"
335
335
  [5]: https://github.com/ember-cli/ember-cli-deploy "ember-cli-deploy"
336
336
  [6]: https://github.com/ember-cli-deploy/ember-cli-deploy-revision-data "ember-cli-deploy-revision-data"
337
- [7]: https://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Setting_AWS_Credentials "Setting AWS Credentials"
337
+ [7]: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html "Setting AWS Credentials"
package/lib/s3.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var AWS = require('aws-sdk');
3
+ var { fromIni } = require('@aws-sdk/credential-providers');
4
+ var { S3 } = require('@aws-sdk/client-s3');
4
5
  var CoreObject = require('core-object');
5
6
  var RSVP = require('rsvp');
6
7
  var fs = require('fs');
@@ -31,20 +32,31 @@ module.exports = CoreObject.extend({
31
32
  var config = plugin.pluginConfig;
32
33
  var profile = plugin.readConfig('profile');
33
34
  var endpoint = plugin.readConfig('endpoint');
35
+ var credentials;
34
36
 
35
37
  this._plugin = plugin;
36
38
 
37
- if (profile && !this._plugin.readConfig('s3Client')) {
38
- this._plugin.log('Using AWS profile from config', { verbose: true });
39
- AWS.config.credentials = new AWS.SharedIniFileCredentials({ profile: profile });
39
+ var providedS3Client = plugin.readConfig("s3Client");
40
+
41
+
42
+ if (profile && !providedS3Client) {
43
+ this._plugin.log("Using AWS profile from config", { verbose: true });
44
+ credentials = fromIni({ profile: profile });
40
45
  }
41
46
 
42
47
  if (endpoint) {
43
- this._plugin.log('Using endpoint from config', { verbose: true });
44
- AWS.config.endpoint = new AWS.Endpoint(endpoint);
48
+ this._plugin.log('Using endpoint from config', { verbose: true });
45
49
  }
46
50
 
47
- this._client = plugin.readConfig('s3Client') || new AWS.S3(config);
51
+ this._client = providedS3Client || new S3(config);
52
+
53
+ if (endpoint) {
54
+ this._client.config.endpoint = endpoint;
55
+ }
56
+ if (credentials) {
57
+ this._client.config.credentials = credentials;
58
+ }
59
+
48
60
  },
49
61
 
50
62
  upload: function(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-cli-deploy-s3-index",
3
- "version": "3.0.0",
3
+ "version": "4.0.0-0",
4
4
  "description": "Ember CLI Deploy plugin to deploy ember-cli's bootstrap index file to S3.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -18,7 +18,8 @@
18
18
  "test": "node tests/runner.js && ./node_modules/.bin/eslint index.js lib/* tests/**/*.js"
19
19
  },
20
20
  "dependencies": {
21
- "aws-sdk": "^2.667.0",
21
+ "@aws-sdk/client-s3": "^3.385.0",
22
+ "@aws-sdk/credential-providers": "^3.391.0",
22
23
  "core-object": "^3.0.0",
23
24
  "ember-cli-deploy-plugin": "^0.2.9",
24
25
  "mime-types": "^2.1.27",