qcobjects-cli 2.3.44 → 2.3.47
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/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.3.
|
|
1
|
+
2.3.47
|
|
@@ -132,10 +132,15 @@ try {
|
|
|
132
132
|
/* Auto Discover dependencies (lib, handlers, commands) */
|
|
133
133
|
const path = require("path");
|
|
134
134
|
const projectPath = CONFIG.get("projectPath", `${process.cwd()}/`);
|
|
135
|
+
const hasKeyword = (p,keyword) => {
|
|
136
|
+
const {keywords} = require(`${findPackageNodePath(p)}/${p}/package.json`);
|
|
137
|
+
return typeof keywords !== "undefined" && keywords.includes(keyword);
|
|
138
|
+
};
|
|
139
|
+
|
|
135
140
|
const loadLibs = async () => {
|
|
136
141
|
let _ret_;
|
|
137
142
|
if (CONFIG.get("autodiscover", false) || CONFIG.get("autodiscover_libs",false)){
|
|
138
|
-
_ret_ = Promise.all(Object.keys(require(`${projectPath}/package.json`).dependencies).filter((p)=>
|
|
143
|
+
_ret_ = Promise.all(Object.keys(require(`${projectPath}/package.json`).dependencies).filter((p)=>hasKeyword(p,"qcobjects-lib")).map((p)=>Import(p))).then(()=>logger.info("Libs loaded"));
|
|
139
144
|
} else {
|
|
140
145
|
_ret_ = Promise.resolve();
|
|
141
146
|
logger.debug("To load libs, set autodiscover_libs to true in your config.json");
|
|
@@ -145,7 +150,7 @@ try {
|
|
|
145
150
|
const loadHandlers = async () => {
|
|
146
151
|
let _ret_;
|
|
147
152
|
if (CONFIG.get("autodiscover", false) || CONFIG.get("autodiscover_handlers",false)){
|
|
148
|
-
_ret_ = Promise.all(Object.keys(require(`${projectPath}/package.json`).dependencies).filter((p)=>
|
|
153
|
+
_ret_ = Promise.all(Object.keys(require(`${projectPath}/package.json`).dependencies).filter((p)=>hasKeyword(p,"qcobjects-handler")).map((p)=>Import(p))).then(()=>logger.info("Handlers loaded"));
|
|
149
154
|
} else {
|
|
150
155
|
_ret_ = Promise.resolve();
|
|
151
156
|
logger.debug("To load handlers, set autodiscover_handlers to true in your config.json");
|
|
@@ -155,7 +160,7 @@ try {
|
|
|
155
160
|
const loadCommands = async () => {
|
|
156
161
|
let _ret_;
|
|
157
162
|
if (CONFIG.get("autodiscover", false) || CONFIG.get("autodiscover_commands",false)){
|
|
158
|
-
_ret_ = Promise.all(Object.keys(require(`${projectPath}/package.json`).dependencies).filter((p)=>
|
|
163
|
+
_ret_ = Promise.all(Object.keys(require(`${projectPath}/package.json`).dependencies).filter((p)=>hasKeyword(p,"qcobjects-command")).map((p)=>Import(p))).then(()=>logger.info("Commands loaded"));
|
|
159
164
|
} else {
|
|
160
165
|
_ret_ = Promise.resolve();
|
|
161
166
|
logger.debug("To load commands, set autodiscover_commands to true in your config.json");
|