@contrail/cli 2.1.1 → 2.1.2

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
@@ -15,7 +15,7 @@ $ npm install -g @contrail/cli
15
15
  $ contrail COMMAND
16
16
  running command...
17
17
  $ contrail (--version)
18
- @contrail/cli/2.1.1 darwin-arm64 node-v18.13.0
18
+ @contrail/cli/2.1.2 darwin-arm64 node-v18.13.0
19
19
  $ contrail --help [COMMAND]
20
20
  USAGE
21
21
  $ contrail COMMAND
@@ -12,8 +12,8 @@
12
12
  },
13
13
  "scripts": {
14
14
  "build": "tsc",
15
- "start": "nodemon --watch \"src/**/*.ts\" --exec ts-node src/module.ts",
16
- "debug": "nodemon -r ts-node/register --inspect=127.0.0.1:60002 --watch 'actions/**/*.ts' --exec node src/module.ts",
15
+ "start": "nodemon --watch \"src/**/*.ts\" --exec ts-node src/main.ts",
16
+ "debug": "nodemon -r ts-node/register --inspect=127.0.0.1:60002 --watch 'actions/**/*.ts' --exec node src/main.ts",
17
17
  "lint": "eslint . --fix",
18
18
  "test": "jest",
19
19
  "test-watch": "jest --watch"
@@ -22,7 +22,7 @@
22
22
  "author": "",
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
- "@contrail/app-framework": "^1.0.7",
25
+ "@contrail/app-framework": "^1.0.9",
26
26
  "@contrail/sdk": "^1.1.54",
27
27
  "chalk": "^4.0.0",
28
28
  "js-yaml": "^4.1.0"
@@ -1,4 +1,4 @@
1
- import { ContrailAppModule, loadAppConfig, registerAppInfo, runMockServer, AppActionRequest, AppActionResponse, ActionDispatcher } from '@contrail/app-framework';
1
+ import { ContrailAppModule, loadAppConfig, registerAppInfo, runMockServer, AppActionRequest, AppActionResponse, ActionDispatcher, GLOBAL_ACTION_REGISTRY } from '@contrail/app-framework';
2
2
 
3
3
  // we can't use static import here. Require only
4
4
  import fs from 'fs';
@@ -18,11 +18,18 @@ export class AppModule extends ContrailAppModule {
18
18
 
19
19
  // register app's actions
20
20
  for (const file of fs.readdirSync(path.join(__dirname, 'actions'))) {
21
- if (!file.endsWith('.js')) {
22
- continue;
21
+ // only parse js and ts file, avoid property files
22
+ if (
23
+ file.endsWith('.js') ||
24
+ (file.endsWith('.ts') && !file.endsWith('.d.ts'))
25
+ ) {
26
+ require(path.join(__dirname, 'actions', file));
23
27
  }
24
- console.log('reading file', file);
25
- require(path.join(__dirname, 'actions', file));
28
+ }
29
+
30
+ console.log(`Registered ${Object.keys(GLOBAL_ACTION_REGISTRY).length} action(s):`);
31
+ for(const key of Object.keys(GLOBAL_ACTION_REGISTRY)) {
32
+ console.log(`\t- ${appConfig.appIdentifier}:${key}`);
26
33
  }
27
34
  }
28
35
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.1",
2
+ "version": "2.1.2",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",