qcobjects-cli 2.4.31 → 2.4.34
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/.dockerignore +2 -0
- package/.eslintignore +7 -0
- package/.eslintrc.cjs +22 -0
- package/VERSION +1 -1
- package/package.json +45 -24
- package/{backend → src/backend}/com.qcobjects.backend.microservice.static.js +26 -26
- package/{backend → src/backend}/org.qcobjects.backend.php.js +45 -38
- package/{com.qcobjects.cli.commands.jira.js → src/com.qcobjects.cli.commands.jira.js} +1 -1
- package/{com.qcobjects.cli.commands.js → src/com.qcobjects.cli.commands.js} +1 -1
- package/{com.qcobjects.cli.commands.version.js → src/com.qcobjects.cli.commands.version.js} +1 -1
- package/src/index.cjs +2 -0
- package/src/index.d.ts +2 -0
- package/src/index.mjs +2 -0
- package/src/index.ts +2 -0
- package/{org.qcobjects.enterprise.commands.js → src/org.qcobjects.enterprise.commands.js} +1 -1
- package/{org.quickcorp.qcobjects.cli.js → src/org.quickcorp.qcobjects.cli.js} +265 -252
- package/src/org.quickcorp.qcobjects.defaultsettings.js +293 -0
- package/{qcobjects-cli.js → src/qcobjects-cli.js} +5 -3
- package/.eslintrc.json +0 -15
- package/org.quickcorp.qcobjects.defaultsettings.js +0 -242
- /package/{com.qcobjects.cli.commands.jira.client_services.js → src/com.qcobjects.cli.commands.jira.client_services.js} +0 -0
- /package/{org.qcobjects.common.pipelog.js → src/org.qcobjects.common.pipelog.js} +0 -0
- /package/{org.quickcorp.qcobjects.api.client_services.js → src/org.quickcorp.qcobjects.api.client_services.js} +0 -0
- /package/{org.quickcorp.qcobjects.collab.server.js → src/org.quickcorp.qcobjects.collab.server.js} +0 -0
- /package/{org.quickcorp.qcobjects.main.file.js → src/org.quickcorp.qcobjects.main.file.js} +0 -0
- /package/{org.quickcorp.qcobjects.main.http.gae.server.js → src/org.quickcorp.qcobjects.main.http.gae.server.js} +0 -0
- /package/{org.quickcorp.qcobjects.main.http.server.js → src/org.quickcorp.qcobjects.main.http.server.js} +0 -0
- /package/{org.quickcorp.qcobjects.main.http2.server.js → src/org.quickcorp.qcobjects.main.http2.server.js} +0 -0
- /package/{qcobjects-collab.js → src/qcobjects-collab.js} +0 -0
- /package/{qcobjects-createcert.js → src/qcobjects-createcert.js} +0 -0
- /package/{qcobjects-gae-http-server.js → src/qcobjects-gae-http-server.js} +0 -0
- /package/{qcobjects-http-server.js → src/qcobjects-http-server.js} +0 -0
- /package/{qcobjects-http2-server.js → src/qcobjects-http2-server.js} +0 -0
- /package/{qcobjects-shell.js → src/qcobjects-shell.js} +0 -0
- /package/{templates → src/templates}/apps/spa-local.html +0 -0
- /package/{templates → src/templates}/apps/spa-local.js +0 -0
- /package/{templates → src/templates}/pwa/sw.js +0 -0
|
@@ -34,10 +34,9 @@ const path = require("path");
|
|
|
34
34
|
const absolutePath = path.resolve( __dirname, "./" );
|
|
35
35
|
const templatePath = path.resolve( __dirname, "./templates/apps/" )+"/";
|
|
36
36
|
const templatePwaPath = path.resolve( __dirname, "./templates/pwa/" )+"/";
|
|
37
|
-
const package_config = require(absolutePath+"
|
|
37
|
+
const package_config = require(absolutePath+"/../package.json");
|
|
38
38
|
const { exec,execSync } = require("child_process");
|
|
39
39
|
|
|
40
|
-
logger.debugEnabled=false;
|
|
41
40
|
CONFIG.set("node_modules_path","./node_modules/");
|
|
42
41
|
CONFIG.set("qcobjectsnewapp_path",CONFIG.get("node_modules_path")+"/qcobjectsnewapp");
|
|
43
42
|
|
|
@@ -61,267 +60,266 @@ let ImportCustomCommand = function (commandName, commandPackage){
|
|
|
61
60
|
Package("org.quickcorp.qcobjects.cli",[
|
|
62
61
|
|
|
63
62
|
class SwitchCommander extends InheritClass {
|
|
64
|
-
constructor (){
|
|
65
|
-
super(...arguments);
|
|
66
|
-
this.program = require("commander");
|
|
67
63
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
64
|
+
choiceOption = {
|
|
65
|
+
generateSw(_appName){
|
|
66
|
+
let switchCommander = this;
|
|
67
|
+
let appName = (typeof _appName ==="undefined" || _appName === true)?("MyAppName"):(_appName);
|
|
68
|
+
switchCommander.generateServiceWorker(appName);
|
|
69
|
+
|
|
70
|
+
},
|
|
71
|
+
create(_appName, options){
|
|
72
|
+
const version = global.__get_version__();
|
|
73
|
+
let switchCommander = this;
|
|
74
|
+
let appName = (typeof _appName ==="undefined" || _appName === true)?("MyAppName"):(_appName);
|
|
75
|
+
|
|
76
|
+
const readline = require("readline");
|
|
77
|
+
|
|
78
|
+
const rl = readline.createInterface({
|
|
79
|
+
input: process.stdin,
|
|
80
|
+
output: process.stdout
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
rl.question(`Please tell me your git repository url
|
|
84
|
+
[press ENTER \u{21b5} to leave it blank or Ctrl+C to cancel]:
|
|
85
|
+
`, (answer) => {
|
|
86
|
+
logger.info(`your git repository url is ${answer}`);
|
|
87
|
+
rl.close();
|
|
88
|
+
let giturl = answer;
|
|
89
|
+
|
|
90
|
+
let createAppCommandCustom = `
|
|
91
|
+
{
|
|
92
|
+
"name": "${appName.toLowerCase()}",
|
|
93
|
+
"version": "0.0.1",
|
|
94
|
+
"repository": {
|
|
95
|
+
"type": "git",
|
|
96
|
+
"url": "${giturl}"
|
|
97
|
+
},
|
|
98
|
+
"description": "This is a custom NPM template app from ${options.createCustom} generated with QCObjects.",
|
|
99
|
+
"main": "js/init.js",
|
|
100
|
+
"license": "LGPL-3.0-or-later",
|
|
101
|
+
"scripts": {
|
|
102
|
+
"test": "(npx eslint *.js js/*.js js/packages/*.js --fix) && (npx jasmine)",
|
|
103
|
+
"sync": "git add . && git commit -am ",
|
|
104
|
+
"preversion": "npm i --upgrade && npm test",
|
|
105
|
+
"postversion": "git push && git push --tags",
|
|
106
|
+
"coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
|
|
107
|
+
"start": "node app.js",
|
|
108
|
+
"build": "exit 0"
|
|
109
|
+
},
|
|
110
|
+
"dependencies": {
|
|
111
|
+
"${options.createCustom}": "latest",
|
|
112
|
+
"qcobjects": "^${version.qcobjects}",
|
|
113
|
+
"qcobjects-sdk": "^${version.sdk}"
|
|
114
|
+
},
|
|
115
|
+
"devDependencies": {
|
|
116
|
+
"eslint": "^8.2.0",
|
|
117
|
+
"eslint-config-qcobjects": "latest",
|
|
118
|
+
"jasmine": "latest",
|
|
119
|
+
"qcobjects-cli": "^${version.cli}",
|
|
120
|
+
"grunt": "^1.4.1",
|
|
121
|
+
"grunt-contrib-jasmine": "^2.0.2",
|
|
122
|
+
"nyc": "^15.1.0"
|
|
123
|
+
}
|
|
124
|
+
}`;
|
|
125
|
+
|
|
126
|
+
let createAppCommandPWA = `
|
|
127
|
+
{
|
|
128
|
+
"name": "${appName.toLowerCase()}",
|
|
129
|
+
"version": "0.0.1",
|
|
130
|
+
"repository": {
|
|
131
|
+
"type": "git",
|
|
132
|
+
"url": "${giturl}"
|
|
133
|
+
},
|
|
134
|
+
"description": "Awesome PWA application that will help you achieve your dreams.",
|
|
135
|
+
"main": "js/init.js",
|
|
136
|
+
"license": "LGPL-3.0-or-later",
|
|
137
|
+
"scripts": {
|
|
138
|
+
"test": "(npx eslint *.js js/*.js js/packages/*.js --fix) && (npx jasmine)",
|
|
139
|
+
"sync": "git add . && git commit -am ",
|
|
140
|
+
"preversion": "npm i --upgrade && npm test",
|
|
141
|
+
"postversion": "git push && git push --tags",
|
|
142
|
+
"coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
|
|
143
|
+
"start": "node app.js",
|
|
144
|
+
"build": "exit 0"
|
|
145
|
+
},
|
|
146
|
+
"dependencies": {
|
|
147
|
+
"qcobjectsnewapp": "latest",
|
|
148
|
+
"qcobjects": "^${version.qcobjects}",
|
|
149
|
+
"qcobjects-sdk": "^${version.sdk}"
|
|
150
|
+
},
|
|
151
|
+
"devDependencies": {
|
|
152
|
+
"eslint": "^8.2.0",
|
|
153
|
+
"eslint-config-qcobjects": "latest",
|
|
154
|
+
"jasmine": "latest",
|
|
155
|
+
"qcobjects-cli": "^${version.cli}",
|
|
156
|
+
"grunt": "^1.4.1",
|
|
157
|
+
"grunt-contrib-jasmine": "^2.0.2",
|
|
158
|
+
"nyc": "^15.1.0"
|
|
159
|
+
}
|
|
160
|
+
}`;
|
|
161
|
+
|
|
162
|
+
let createAppCommandAMP = `echo
|
|
163
|
+
{
|
|
164
|
+
"name": "${appName.toLowerCase()}",
|
|
165
|
+
"version": "0.0.1",
|
|
166
|
+
"repository": {
|
|
167
|
+
"type": "git",
|
|
168
|
+
"url": "${giturl}"
|
|
169
|
+
},
|
|
170
|
+
"description": "Awesome AMP application that will help you achieve your dreams.",
|
|
171
|
+
"main": "js/init.js",
|
|
172
|
+
"license": "LGPL-3.0-or-later",
|
|
173
|
+
"scripts": {
|
|
174
|
+
"test": "(npx eslint *.js js/*.js js/packages/*.js --fix) && (npx jasmine)",
|
|
175
|
+
"sync": "git add . && git commit -am ",
|
|
176
|
+
"preversion": "npm i --upgrade && npm test",
|
|
177
|
+
"postversion": "git push && git push --tags",
|
|
178
|
+
"coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
|
|
179
|
+
"start": "node app.js",
|
|
180
|
+
"build": "exit 0"
|
|
181
|
+
},
|
|
182
|
+
"dependencies": {
|
|
183
|
+
"qcobjects-ecommerce-amp": "latest",
|
|
184
|
+
"qcobjects": "^${version.qcobjects}",
|
|
185
|
+
"qcobjects-sdk": "^${version.sdk}"
|
|
186
|
+
},
|
|
187
|
+
"devDependencies": {
|
|
188
|
+
"eslint": "^8.2.0",
|
|
189
|
+
"eslint-config-qcobjects": "latest",
|
|
190
|
+
"jasmine": "latest",
|
|
191
|
+
"qcobjects-cli": "^${version.cli}",
|
|
192
|
+
"grunt": "^1.4.1",
|
|
193
|
+
"grunt-contrib-jasmine": "^2.0.2",
|
|
194
|
+
"nyc": "^15.1.0"
|
|
195
|
+
}
|
|
196
|
+
}`;
|
|
197
|
+
|
|
198
|
+
let createAppCommandPHP = `
|
|
199
|
+
{
|
|
200
|
+
"name": "${appName.toLowerCase()}",
|
|
201
|
+
"version": "0.0.1",
|
|
202
|
+
"repository": {
|
|
171
203
|
"type": "git",
|
|
172
204
|
"url": "${giturl}"
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}`;
|
|
237
|
-
|
|
238
|
-
let createAppCommand;
|
|
239
|
-
let appTemplateName;
|
|
240
|
-
let _package_json_content;
|
|
241
|
-
|
|
242
|
-
if (options.createAmp){
|
|
243
|
-
appTemplateName = "qcobjects-ecommerce-amp";
|
|
244
|
-
_package_json_content = createAppCommandAMP;
|
|
245
|
-
} else if (options.createPwa){
|
|
246
|
-
appTemplateName = "qcobjectsnewapp";
|
|
247
|
-
_package_json_content = createAppCommandPWA;
|
|
248
|
-
} else if (options.createPhp){
|
|
249
|
-
appTemplateName = "qcobjectsnewphp";
|
|
250
|
-
_package_json_content = createAppCommandPHP;
|
|
251
|
-
} else if (options.createCustom){
|
|
252
|
-
appTemplateName = options.createCustom;
|
|
253
|
-
_package_json_content = createAppCommandCustom;
|
|
254
|
-
} else {
|
|
255
|
-
appTemplateName = "qcobjectsnewapp";
|
|
256
|
-
_package_json_content = createAppCommandPWA;
|
|
205
|
+
},
|
|
206
|
+
"description": "Awesome PHP application that will help you achieve your dreams.",
|
|
207
|
+
"main": "js/init.js",
|
|
208
|
+
"license": "LGPL-3.0-or-later",
|
|
209
|
+
"scripts": {
|
|
210
|
+
"test": "(npx eslint *.js js/*.js js/packages/*.js --fix) && (npx jasmine)",
|
|
211
|
+
"sync": "git add . && git commit -am ",
|
|
212
|
+
"preversion": "npm i --upgrade && npm test",
|
|
213
|
+
"postversion": "git push && git push --tags",
|
|
214
|
+
"coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
|
|
215
|
+
"start": "node app.js",
|
|
216
|
+
"build": "exit 0"
|
|
217
|
+
},
|
|
218
|
+
"dependencies": {
|
|
219
|
+
"qcobjectsnewphp": "latest",
|
|
220
|
+
"qcobjects": "^${version.qcobjects}",
|
|
221
|
+
"qcobjects-sdk": "^${version.sdk}"
|
|
222
|
+
},
|
|
223
|
+
"devDependencies": {
|
|
224
|
+
"eslint": "^8.2.0",
|
|
225
|
+
"eslint-config-qcobjects": "latest",
|
|
226
|
+
"jasmine": "latest",
|
|
227
|
+
"qcobjects-cli": "^${version.cli}",
|
|
228
|
+
"grunt": "^1.4.1",
|
|
229
|
+
"grunt-contrib-jasmine": "^2.0.2",
|
|
230
|
+
"nyc": "^15.1.0"
|
|
231
|
+
}
|
|
232
|
+
}`;
|
|
233
|
+
|
|
234
|
+
let createAppCommand;
|
|
235
|
+
let appTemplateName;
|
|
236
|
+
let _package_json_content;
|
|
237
|
+
|
|
238
|
+
if (options.createAmp){
|
|
239
|
+
appTemplateName = "qcobjects-ecommerce-amp";
|
|
240
|
+
_package_json_content = createAppCommandAMP;
|
|
241
|
+
} else if (options.createPwa){
|
|
242
|
+
appTemplateName = "qcobjectsnewapp";
|
|
243
|
+
_package_json_content = createAppCommandPWA;
|
|
244
|
+
} else if (options.createPhp){
|
|
245
|
+
appTemplateName = "qcobjectsnewphp";
|
|
246
|
+
_package_json_content = createAppCommandPHP;
|
|
247
|
+
} else if (options.createCustom){
|
|
248
|
+
appTemplateName = options.createCustom;
|
|
249
|
+
_package_json_content = createAppCommandCustom;
|
|
250
|
+
} else {
|
|
251
|
+
appTemplateName = "qcobjectsnewapp";
|
|
252
|
+
_package_json_content = createAppCommandPWA;
|
|
253
|
+
}
|
|
254
|
+
CONFIG.set("qcobjectsnewapp_path",CONFIG.get("node_modules_path")+"/"+appTemplateName);
|
|
255
|
+
/* if (!process.platform.toLowerCase().startsWith("win")){
|
|
256
|
+
_package_json_content = _package_json_content.replace(/(")/g, String.fromCharCode(92)+"\"");
|
|
257
|
+
}*/
|
|
258
|
+
createAppCommand = "npm init -y";
|
|
259
|
+
let _package_json_file = path.resolve(CONFIG.get("projectPath"),"./package.json");
|
|
260
|
+
logger.debug("_package_json_file: "+_package_json_file);
|
|
261
|
+
logger.debug(createAppCommand);
|
|
262
|
+
|
|
263
|
+
exec(createAppCommand, (err, stdout, stderr) => {
|
|
264
|
+
if (err) {
|
|
265
|
+
logger.warn(err);
|
|
266
|
+
process.exit(1);
|
|
267
|
+
return;
|
|
257
268
|
}
|
|
258
|
-
|
|
259
|
-
/* if (!process.platform.toLowerCase().startsWith("win")){
|
|
260
|
-
_package_json_content = _package_json_content.replace(/(")/g, String.fromCharCode(92)+"\"");
|
|
261
|
-
}*/
|
|
262
|
-
createAppCommand = "npm init -y";
|
|
263
|
-
let _package_json_file = path.resolve(CONFIG.get("projectPath"),"./package.json");
|
|
264
|
-
logger.debug("_package_json_file: "+_package_json_file);
|
|
265
|
-
logger.debug(createAppCommand);
|
|
266
|
-
|
|
267
|
-
exec(createAppCommand, (err, stdout, stderr) => {
|
|
269
|
+
fs.writeFile(_package_json_file, _package_json_content, err => {
|
|
268
270
|
if (err) {
|
|
269
271
|
logger.warn(err);
|
|
270
272
|
process.exit(1);
|
|
271
273
|
return;
|
|
272
274
|
}
|
|
273
|
-
|
|
275
|
+
|
|
276
|
+
exec("npm cache verify && npm i --save-dev --legacy-peer-deps", (err, stdout, stderr) => {
|
|
274
277
|
if (err) {
|
|
275
278
|
logger.warn(err);
|
|
276
279
|
process.exit(1);
|
|
277
280
|
return;
|
|
278
281
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
logger.info("Good! Your application is getting done. You can play with QCObjects now!");
|
|
290
|
-
logger.info("In about five seconds your server will start...");
|
|
291
|
-
exec("qcobjects-createcert",(err,stdout,stderr)=>{
|
|
292
|
-
logger.info("Test certificates generated");
|
|
293
|
-
|
|
294
|
-
exec("npm uninstall "+appTemplateName+" --save && npm cache verify",(err,stdout,stderr)=>{
|
|
295
|
-
switchCommander.generateServiceWorker(appName);
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
}).stdout.on("data", function(data) {
|
|
299
|
-
console.log(data);
|
|
282
|
+
|
|
283
|
+
Promise.resolve(switchCommander.copyTemplate())
|
|
284
|
+
.then(()=>{
|
|
285
|
+
logger.info("Good! Your application is getting done. You can play with QCObjects now!");
|
|
286
|
+
logger.info("In about five seconds your server will start...");
|
|
287
|
+
exec("qcobjects-createcert",(err,stdout,stderr)=>{
|
|
288
|
+
logger.info("Test certificates generated");
|
|
289
|
+
|
|
290
|
+
exec("npm uninstall "+appTemplateName+" --save && npm cache verify",(err,stdout,stderr)=>{
|
|
291
|
+
switchCommander.generateServiceWorker(appName);
|
|
300
292
|
});
|
|
293
|
+
|
|
294
|
+
}).stdout.on("data", function(data) {
|
|
295
|
+
console.log(data);
|
|
301
296
|
});
|
|
302
|
-
}).stdout.on("data", function(data) {
|
|
303
|
-
console.log(data);
|
|
304
297
|
});
|
|
305
|
-
|
|
298
|
+
}).stdout.on("data", function(data) {
|
|
299
|
+
console.log(data);
|
|
306
300
|
});
|
|
307
|
-
|
|
308
|
-
}).stdout.on("data", function(data) {
|
|
309
|
-
console.log("App generation started...");
|
|
301
|
+
|
|
310
302
|
});
|
|
311
|
-
|
|
303
|
+
|
|
304
|
+
}).stdout.on("data", function(data) {
|
|
305
|
+
console.log("App generation started...");
|
|
312
306
|
});
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
publish(_appName){
|
|
316
|
-
logger.debug("publish is not yet implemented");
|
|
317
|
-
},
|
|
318
|
-
upgradeToEnterprise (){
|
|
319
|
-
let switchCommander = this;
|
|
320
|
-
QCObjectsEnterprise.upgrade(switchCommander);
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
|
|
324
307
|
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
},
|
|
311
|
+
publish(_appName){
|
|
312
|
+
logger.debug("publish is not yet implemented");
|
|
313
|
+
},
|
|
314
|
+
upgradeToEnterprise (){
|
|
315
|
+
let switchCommander = this;
|
|
316
|
+
QCObjectsEnterprise.upgrade(switchCommander);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
constructor (){
|
|
321
|
+
super(...arguments);
|
|
322
|
+
this.program = require("commander");
|
|
325
323
|
}
|
|
326
324
|
|
|
327
325
|
shellCommands(_shell_commands){
|
|
@@ -492,6 +490,7 @@ Package("org.quickcorp.qcobjects.cli",[
|
|
|
492
490
|
initCommand(){
|
|
493
491
|
let switchCommander = this;
|
|
494
492
|
if (process.argv.length>1){
|
|
493
|
+
logger.debug("Installing Commands...");
|
|
495
494
|
|
|
496
495
|
switchCommander.program
|
|
497
496
|
.version(global.__get_version_string__());
|
|
@@ -506,6 +505,30 @@ Package("org.quickcorp.qcobjects.cli",[
|
|
|
506
505
|
.action(function(args, options){
|
|
507
506
|
switchCommander.choiceOption.create.call(switchCommander,args,options);
|
|
508
507
|
});
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
try {
|
|
511
|
+
logger.debug("Loading Plugin Commands...");
|
|
512
|
+
const importPluginCommands = function (switchCommander){
|
|
513
|
+
return global.ClassesList
|
|
514
|
+
.filter(c=>c.packageName.startsWith("com.qcobjects.cli.commands."))
|
|
515
|
+
.filter(p=>p.classFactory.name.endsWith("CommandHandler"))
|
|
516
|
+
.map(pluginCommand => {
|
|
517
|
+
try {
|
|
518
|
+
logger.debug(`Loading plugin ${pluginCommand.packageName}`);
|
|
519
|
+
const classFactory = pluginCommand.classFactory;
|
|
520
|
+
pluginCommand.plugin = New(classFactory,{switchCommander:switchCommander});
|
|
521
|
+
} catch (e){
|
|
522
|
+
throw Error(`Something went wrong loading ${pluginCommand.packageName}`);
|
|
523
|
+
}
|
|
524
|
+
return pluginCommand;
|
|
525
|
+
});
|
|
526
|
+
};
|
|
527
|
+
importPluginCommands(switchCommander);
|
|
528
|
+
} catch (e){
|
|
529
|
+
throw Error (`Something went wrong loading plugins: ${e.message}`);
|
|
530
|
+
}
|
|
531
|
+
|
|
509
532
|
switchCommander.program.command("publish <appname>")
|
|
510
533
|
.description("Publishes an app with <appname>")
|
|
511
534
|
.option("--pwa, --create-pwa", "Publishes the progressive web app assets")
|
|
@@ -517,16 +540,6 @@ Package("org.quickcorp.qcobjects.cli",[
|
|
|
517
540
|
switchCommander.choiceOption.publish.call(switchCommander,args,options);
|
|
518
541
|
});
|
|
519
542
|
|
|
520
|
-
|
|
521
|
-
let importPluginCommands = function (){
|
|
522
|
-
this.pluginCommandsList = [];
|
|
523
|
-
let _pluginCommandsList = global.ClassesList.filter(c=>c.packageName.startsWith("com.qcobjects.cli.commands."));
|
|
524
|
-
_pluginCommandsList.filter(p=>p.classFactory.name.endsWith("CommandHandler")).map(pluginCommand => {
|
|
525
|
-
this.pluginCommandsList.push(new pluginCommand.classFactory({switchCommander:switchCommander}));
|
|
526
|
-
});
|
|
527
|
-
};
|
|
528
|
-
importPluginCommands.call(switchCommander);
|
|
529
|
-
|
|
530
543
|
switchCommander.program.command("upgrade-to-enterprise")
|
|
531
544
|
.description("Upgrades to QCObjects Enterprise Edition")
|
|
532
545
|
.action(function(args, options){
|