@mbc-cqrs-serverless/cli 0.1.36-beta.0 → 0.1.38-beta.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/README.md CHANGED
@@ -29,6 +29,70 @@ There are 3 usages for the new command:
29
29
  - If the provided version is a prefix, the CLI uses the latest version matching that prefix.
30
30
  - If no matching version is found, the CLI logs an error and provides a list of available versions for the user.
31
31
 
32
+ To change current directory
33
+
34
+ ```bash
35
+ cd [projectName]
36
+ ```
37
+
38
+ ## Run the Development Server
39
+ 1. Run npm run build to the build project using development mode.
40
+ 2. Open in other terminal session and run npm run offline:docker
41
+ 3. Open in other terminal session and run npm run migrate to migrate RDS and dynamoDB table
42
+ 4. Finally, run npm run offline:sls to start serverless offline mode.
43
+
44
+ After the server runs successfully, you can see:
45
+
46
+ ```bash
47
+ DEBUG[serverless-offline-sns][adapter]: successfully subscribed queue "http://localhost:9324/101010101010/notification-queue" to topic: "arn:aws:sns:ap-northeast-1:101010101010:MySnsTopic"
48
+ Offline Lambda Server listening on http://localhost:4000
49
+ serverless-offline-aws-eventbridge :: Plugin ready
50
+ serverless-offline-aws-eventbridge :: Mock server running at port: 4010
51
+ Starting Offline SQS at stage dev (ap-northeast-1)
52
+ Starting Offline Dynamodb Streams at stage dev (ap-northeast-1)
53
+
54
+ Starting Offline at stage dev (ap-northeast-1)
55
+
56
+ Offline [http for lambda] listening on http://localhost:3002
57
+ Function names exposed for local invocation by aws-sdk:
58
+ * main: serverless-example-dev-main
59
+ Configuring JWT Authorization: ANY /{proxy+}
60
+
61
+ ┌────────────────────────────────────────────────────────────────────────┐
62
+ │ │
63
+ │ ANY | http://localhost:3000/api/public │
64
+ │ POST | http://localhost:3000/2015-03-31/functions/main/invocations │
65
+ │ ANY | http://localhost:3000/swagger-ui/{proxy*} │
66
+ │ POST | http://localhost:3000/2015-03-31/functions/main/invocations │
67
+ │ ANY | http://localhost:3000/{proxy*} │
68
+ │ POST | http://localhost:3000/2015-03-31/functions/main/invocations │
69
+ │ │
70
+ └────────────────────────────────────────────────────────────────────────┘
71
+
72
+ Server ready: http://localhost:3000 🚀
73
+ ```
74
+
75
+ You can also use several endpoints:
76
+
77
+ - API gateway: http://localhost:3000
78
+ - Offline Lambda Server: http://localhost:4000
79
+ - HTTP for lambda: http://localhost:3002
80
+ - Step functions: http://localhost:8083
81
+ - DynamoDB: http://localhost:8000
82
+ - DynamoDB admin: http://localhost:8001
83
+ - SNS: http://localhost:4002
84
+ - SQS: http://localhost:9324
85
+ - SQS admin: http://localhost:9325
86
+ - Localstack: http://localhost:4566
87
+ - AppSync: http://localhost:4001
88
+ - Cognito: http://localhost:9229
89
+ - EventBridge: http://localhost:4010
90
+ - Simple Email Service: http://localhost:8005
91
+ - Run `npx prisma studio` to open studio web: http://localhost:5000
92
+
93
+
94
+
95
+
32
96
  ## Documentation
33
97
 
34
98
  Visit https://mbc-cqrs-serverless.mbc-net.com/ to view the full documentation.
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.exportsForTesting = void 0;
7
+ exports.default = newAction;
7
8
  const child_process_1 = require("child_process");
8
9
  const fs_1 = require("fs");
9
10
  const path_1 = __importDefault(require("path"));
@@ -53,7 +54,6 @@ async function newAction(name = '', options, command) {
53
54
  logs = (0, child_process_1.execSync)('npm i', { cwd: destDir });
54
55
  console.log(logs.toString());
55
56
  }
56
- exports.default = newAction;
57
57
  function useTemplate(destDir) {
58
58
  if (isLatestCli()) {
59
59
  (0, fs_1.cpSync)(path_1.default.join(__dirname, '../../templates'), destDir, {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = startAction;
3
4
  /* eslint-disable no-console */
4
5
  async function startAction() {
5
6
  console.log('startAction here');
6
7
  // TODO
7
8
  }
8
- exports.default = startAction;
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = uiAction;
6
7
  const child_process_1 = require("child_process");
7
8
  const fs_1 = require("fs");
8
9
  const path_1 = __importDefault(require("path"));
@@ -55,7 +56,6 @@ async function uiAction(options, command) {
55
56
  const logs = (0, child_process_1.execSync)('npm i');
56
57
  console.log(logs.toString());
57
58
  }
58
- exports.default = uiAction;
59
59
  const installTemplate = ({ auth, token, pathDir, branch, component, }) => {
60
60
  let gitUrl = repoUrl;
61
61
  if (auth === 'SSH') {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = loadCommands;
3
4
  const new_command_1 = require("./new.command");
4
5
  const start_command_1 = require("./start.command");
5
6
  const ui_command_1 = require("./ui.command");
@@ -14,4 +15,3 @@ function loadCommands(program) {
14
15
  program.outputHelp();
15
16
  });
16
17
  }
17
- exports.default = loadCommands;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.newCommand = void 0;
6
+ exports.newCommand = newCommand;
7
7
  const new_action_1 = __importDefault(require("../actions/new.action"));
8
8
  function newCommand(program) {
9
9
  program
@@ -12,4 +12,3 @@ function newCommand(program) {
12
12
  .description('Generate a new CQRS application using the MBC CQRS serverless framework')
13
13
  .action(new_action_1.default);
14
14
  }
15
- exports.newCommand = newCommand;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.startCommand = void 0;
6
+ exports.startCommand = startCommand;
7
7
  const start_action_1 = __importDefault(require("../actions/start.action"));
8
8
  function startCommand(program) {
9
9
  program
@@ -12,4 +12,3 @@ function startCommand(program) {
12
12
  .description('Start application with serverless framework')
13
13
  .action(start_action_1.default);
14
14
  }
15
- exports.startCommand = startCommand;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.uiCommand = void 0;
6
+ exports.uiCommand = uiCommand;
7
7
  const ui_action_1 = __importDefault(require("../actions/ui.action"));
8
8
  function uiCommand(program) {
9
9
  program
@@ -18,4 +18,3 @@ function uiCommand(program) {
18
18
  .option('--alias', 'The alias to common-ui')
19
19
  .action(ui_action_1.default);
20
20
  }
21
- exports.uiCommand = uiCommand;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mbc-cqrs-serverless/cli",
3
- "version": "0.1.36-beta.0",
3
+ "version": "0.1.38-beta.0",
4
4
  "description": "a CLI to get started with MBC CQRS serverless framework",
5
5
  "keywords": [
6
6
  "mbc",
@@ -49,5 +49,5 @@
49
49
  "devDependencies": {
50
50
  "@faker-js/faker": "^8.3.1"
51
51
  },
52
- "gitHead": "bfc35ea9dbac2cf0bab7a7dc73761d4a2b8af362"
52
+ "gitHead": "210ef83a47827221e8f75faa5add893a5894af38"
53
53
  }