aws-architect 6.7.153 → 6.7.158

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.
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- let commander = require('commander');
3
+ const { program } = require('commander');
4
4
  let fs = require('fs-extra');
5
5
  let path = require('path');
6
6
 
7
7
  let version = require(path.join(__dirname, '../package.json')).version;
8
- commander.version(version);
8
+ program.version(version);
9
9
 
10
10
  let displayHeader = () => {
11
11
  console.log('AWS Architect (%s)', version);
12
12
  console.log('---------------------------');
13
13
  };
14
14
 
15
- commander
15
+ program
16
16
  .command('init')
17
17
  .description('Setup microservice package from template.')
18
18
  .action(() => {
@@ -29,12 +29,14 @@ commander
29
29
  .catch(result => console.log(`failure: ${JSON.stringify(result, null, 2)}`));
30
30
  });
31
31
 
32
- commander.on('*', () => {
33
- if (commander.args.join(' ') === 'tests/**/*.js') { return; }
32
+ program.on('command:*', () => {
33
+ if (program.args.join(' ') === 'tests/**/*.js') { return; }
34
34
  displayHeader();
35
- console.log(`Unknown Command: ${commander.args.join(' ')}`);
36
- commander.help();
35
+ console.log(`Unknown Command: ${program.args.join(' ')}`);
36
+ program.help();
37
37
  process.exit(0);
38
38
  });
39
39
 
40
- commander.parse(process.argv[2] ? process.argv : process.argv.concat(['init']));
40
+ if (require.main === module) {
41
+ program.parse(process.argv[2] ? process.argv : process.argv.concat(['init']));
42
+ }
@@ -1,6 +1,6 @@
1
1
  require('error-object-polyfill');
2
2
  const path = require('path');
3
- const commander = require('commander');
3
+ const { program } = require('commander');
4
4
  const aws = require('aws-sdk');
5
5
  const AwsArchitect = require('aws-architect');
6
6
 
@@ -23,7 +23,7 @@ function getVersion() {
23
23
  return `${release_version}.${(build_number || '0')}.0.0.0.0`.split('.').slice(0, 3).join('.');
24
24
  }
25
25
  const version = getVersion();
26
- commander.version(version);
26
+ program.version(version);
27
27
 
28
28
  let packageMetadataFile = path.join(__dirname, 'package.json');
29
29
  let packageMetadata = require(packageMetadataFile);
@@ -39,7 +39,7 @@ let contentOptions = {
39
39
  contentDirectory: path.join(__dirname, 'content')
40
40
  };
41
41
 
42
- commander
42
+ program
43
43
  .command('run')
44
44
  .description('Run lambda web service locally.')
45
45
  .action(async () => {
@@ -60,7 +60,7 @@ commander
60
60
  }
61
61
  });
62
62
 
63
- commander
63
+ program
64
64
  .command('deploy')
65
65
  .description('Deploy to AWS.')
66
66
  .action(async () => {
@@ -110,7 +110,7 @@ commander
110
110
  }
111
111
  });
112
112
 
113
- commander
113
+ program
114
114
  .command('deploy-website')
115
115
  .description('Depling website to AWS.')
116
116
  .action(async () => {
@@ -162,7 +162,7 @@ commander
162
162
  }
163
163
  });
164
164
 
165
- commander
165
+ program
166
166
  .command('deploy-hosted-zone')
167
167
  .description('Deploy hosted zone to AWS.')
168
168
  .action(async () => {
@@ -190,7 +190,7 @@ commander
190
190
  }
191
191
  });
192
192
 
193
- commander
193
+ program
194
194
  .command('delete')
195
195
  .description('Delete Stage from AWS.')
196
196
  .action(async () => {
@@ -210,7 +210,7 @@ commander
210
210
  }
211
211
  });
212
212
 
213
- commander
213
+ program
214
214
  .command('delete-website')
215
215
  .description('Delete a website version from AWS.')
216
216
  .action(async () => {
@@ -230,10 +230,10 @@ commander
230
230
  }
231
231
  });
232
232
 
233
- commander.on('*', () => {
234
- if (commander.args.join(' ') === 'tests/**/*.js') { return; }
235
- console.log(`Unknown Command: ${commander.args.join(' ')}`);
236
- commander.help();
233
+ program.on('command:*', () => {
234
+ if (program.args.join(' ') === 'tests/**/*.js') { return; }
235
+ console.log(`Unknown Command: ${program.args.join(' ')}`);
236
+ program.help();
237
237
  process.exit(0);
238
238
  });
239
- commander.parse(process.argv[2] ? process.argv : process.argv.concat(['build']));
239
+ program.parse(process.argv[2] ? process.argv : process.argv.concat(['build']));
package/index.js CHANGED
@@ -60,7 +60,7 @@ class AwsArchitect {
60
60
  let zipStream = fs.createWriteStream(zipArchivePath);
61
61
  zipStream.on('close', () => resolve());
62
62
 
63
- let archive = archiver.create('zip', {});
63
+ let archive = archiver('zip', {});
64
64
  archive.on('error', e => reject({ Error: e }));
65
65
  archive.pipe(zipStream);
66
66
  archive.glob('**', { dot: true, cwd: tmpDir, ignore: options.zipFileName });
@@ -99,7 +99,6 @@ class AwsArchitect {
99
99
 
100
100
  let cmd = lockFile.command;
101
101
  await new Promise((resolve, reject) => {
102
- /* eslint-disable-next-line no-unused-vars */
103
102
  exec(cmd, { cwd: tmpDir }, (error, stdout, stderr) => {
104
103
  if (error) { return reject({ Error: 'Failed installing production npm modules.', Details: error }); }
105
104
  return resolve(tmpDir);
@@ -112,7 +111,7 @@ class AwsArchitect {
112
111
  let zipStream = fs.createWriteStream(zipArchivePath);
113
112
  zipStream.on('close', () => resolve({ Archive: zipArchivePath }));
114
113
 
115
- let archive = archiver.create('zip', {});
114
+ let archive = archiver('zip', {});
116
115
  archive.on('error', e => reject({ Error: e }));
117
116
  archive.pipe(zipStream);
118
117
  archive.glob('**', { dot: true, cwd: tmpDir, ignore: lambdaZip });
package/lib/server.js CHANGED
@@ -98,7 +98,6 @@ function Server(contentDirectory, lambdaApi, logger) {
98
98
  api.use(bodyParser.text({ type: ['application/x-www-form-urlencoded', 'text/css', 'text/csv', 'text/html', 'text/plain', 'text/html'] }));
99
99
  api.use(bodyParser.raw({ type: ['application/octet-stream', 'application/binary', 'image/*', 'audio/*', 'video/*', 'application/pdf', 'application/x-tar', 'application/zip'], limit: '6mb' }));
100
100
  api.use(bodyParser.json({ type: '*/*', limit: '6mb' }));
101
- /* eslint-disable-next-line no-unused-vars */
102
101
  api.use((error, req, res, next) => {
103
102
  this.logger(stringify({ title: 'Failed to parse the body', error }));
104
103
  res.status(400).send({ title: 'Invalid body parsing, it can be due to the default parsing types that are set up in AWS Architect Server configuration' });
@@ -246,7 +245,6 @@ function Server(contentDirectory, lambdaApi, logger) {
246
245
  });
247
246
  });
248
247
 
249
- /* eslint-disable-next-line no-unused-vars */
250
248
  api.all(/.*/, (req, res, next) => {
251
249
  res.status(404).json({
252
250
  statusCode: 404,
@@ -254,7 +252,6 @@ function Server(contentDirectory, lambdaApi, logger) {
254
252
  });
255
253
  });
256
254
 
257
- /* eslint-disable-next-line no-unused-vars */
258
255
  api.use((error, req, res, next) => {
259
256
  console.error(`Catch-all Error: ${error.stack || error} - ${stringify(error, null, 2)}`);
260
257
  res.status(500).json({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-architect",
3
- "version": "6.7.153",
3
+ "version": "6.7.158",
4
4
  "description": "AWS Architect is a node based tool to configure and deploy AWS-based microservices.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,12 +18,12 @@
18
18
  "aws-architect": "./bin/aws-architect.js"
19
19
  },
20
20
  "dependencies": {
21
- "@aws-sdk/client-cloudformation": "^3.1000.0",
22
- "@aws-sdk/client-s3": "^3.1000",
23
- "@aws-sdk/client-sts": "^3.1000",
24
- "archiver": "^5.3.0",
21
+ "@aws-sdk/client-cloudformation": "^3.1045.0",
22
+ "@aws-sdk/client-s3": "^3.1045.0",
23
+ "@aws-sdk/client-sts": "^3.1045.0",
24
+ "archiver": "^7.0.0",
25
25
  "body-parser": "^1.18.2",
26
- "commander": "^2.5.0",
26
+ "commander": "^14.0.0",
27
27
  "cookie-parser": "^1.4.7",
28
28
  "express": "^5",
29
29
  "fs-extra": "^6.0.1",
@@ -43,7 +43,7 @@
43
43
  "@authress/eslint-config": "^1.0.2",
44
44
  "aws-sdk": "*",
45
45
  "error-object-polyfill": "^1.1.14",
46
- "eslint": "~8.35.0",
46
+ "eslint": "^10.2.0",
47
47
  "eslint-config-cimpress-atsquad": "^1.0.67",
48
48
  "eslint-plugin-import": "^2.22.1",
49
49
  "eslint-plugin-node": "^11.1.0",