@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.
|
|
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/
|
|
16
|
-
"debug": "nodemon -r ts-node/register --inspect=127.0.0.1:60002 --watch 'actions/**/*.ts' --exec node src/
|
|
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.
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
|
|
25
|
-
|
|
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
|
}
|
package/oclif.manifest.json
CHANGED