@stechquick/symphony-cli 0.4.2 → 0.4.4
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 +17 -17
- package/lib/commands/qui-build.js +1 -1
- package/lib/commands/qui-start.js +1 -1
- package/lib/helpers/ui/quiBuilder.d.ts +1 -14
- package/lib/helpers/ui/quiBuilder.js +25 -203
- package/lib/predeploy/src/predeployCommon.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +2 -1
- package/templates/addModule/{{ModuleName}}/{{remove}}package.json +1 -1
- package/templates/addfunc/functions/{{FuncName}}/{{FuncName}}.ts +1 -1
- package/templates/createui/{{UIName}}/settings/settings.yaml +2 -0
- package/templates/createui/{{UIName}}/static/js/containerServices.ts +14 -0
- package/templates/createui/{{UIName}}/{{remove}}package.json +2 -2
- package/templates/init/{{AppName}}/functions/samplefunc/samplefunc.ts +1 -1
- package/templates/init/{{AppName}}/{{remove}}package.json +2 -2
- package/templates/nc-create/{{ProjectName}}/{{remove}}package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ $ npm install -g @stechquick/symphony-cli
|
|
|
19
19
|
$ symphony-cli COMMAND
|
|
20
20
|
running command...
|
|
21
21
|
$ symphony-cli (-v|--version|version)
|
|
22
|
-
@stechquick/symphony-cli/0.4.
|
|
22
|
+
@stechquick/symphony-cli/0.4.4 linux-x64 node-v16.19.0
|
|
23
23
|
$ symphony-cli --help [COMMAND]
|
|
24
24
|
USAGE
|
|
25
25
|
$ symphony-cli COMMAND
|
|
@@ -81,7 +81,7 @@ EXAMPLE
|
|
|
81
81
|
symphony-cli mui-create myUI -d="My Micro UI project"
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
_See code: [src/commands/mui-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
84
|
+
_See code: [src/commands/mui-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/mui-create.ts)_
|
|
85
85
|
|
|
86
86
|
## `symphony-cli nc-addcomp NAME`
|
|
87
87
|
|
|
@@ -98,7 +98,7 @@ EXAMPLE
|
|
|
98
98
|
symphony-cli nc-addcomp my_comp_name
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
_See code: [src/commands/nc-addcomp.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
101
|
+
_See code: [src/commands/nc-addcomp.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/nc-addcomp.ts)_
|
|
102
102
|
|
|
103
103
|
## `symphony-cli nc-build`
|
|
104
104
|
|
|
@@ -116,7 +116,7 @@ EXAMPLES
|
|
|
116
116
|
$ symphony-cli nc-build -w
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
_See code: [src/commands/nc-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
119
|
+
_See code: [src/commands/nc-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/nc-build.ts)_
|
|
120
120
|
|
|
121
121
|
## `symphony-cli nc-create NAME`
|
|
122
122
|
|
|
@@ -136,7 +136,7 @@ EXAMPLE
|
|
|
136
136
|
symphony-cli nc-create nc_example -d="my named component example"
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
_See code: [src/commands/nc-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
139
|
+
_See code: [src/commands/nc-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/nc-create.ts)_
|
|
140
140
|
|
|
141
141
|
## `symphony-cli qui-build`
|
|
142
142
|
|
|
@@ -150,7 +150,7 @@ EXAMPLE
|
|
|
150
150
|
$ symphony-cli qui-build -w
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
_See code: [src/commands/qui-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
153
|
+
_See code: [src/commands/qui-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/qui-build.ts)_
|
|
154
154
|
|
|
155
155
|
## `symphony-cli qui-create NAME`
|
|
156
156
|
|
|
@@ -172,7 +172,7 @@ EXAMPLES
|
|
|
172
172
|
symphony-cli qui-create myUI -t=TOKEN -d="My Quick UI project"
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
_See code: [src/commands/qui-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
175
|
+
_See code: [src/commands/qui-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/qui-create.ts)_
|
|
176
176
|
|
|
177
177
|
## `symphony-cli qui-start`
|
|
178
178
|
|
|
@@ -189,7 +189,7 @@ EXAMPLE
|
|
|
189
189
|
$ symphony-cli qui-start -b
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
_See code: [src/commands/qui-start.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
192
|
+
_See code: [src/commands/qui-start.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/qui-start.ts)_
|
|
193
193
|
|
|
194
194
|
## `symphony-cli quick-serve`
|
|
195
195
|
|
|
@@ -212,7 +212,7 @@ EXAMPLES
|
|
|
212
212
|
$ symphony-cli quick-serve -g -r C:/MyPathToServe
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
_See code: [src/commands/quick-serve.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
215
|
+
_See code: [src/commands/quick-serve.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/quick-serve.ts)_
|
|
216
216
|
|
|
217
217
|
## `symphony-cli sym-addfunc FUNCNAME`
|
|
218
218
|
|
|
@@ -229,7 +229,7 @@ EXAMPLE
|
|
|
229
229
|
symphony-cli sym-addfunc havalemenu
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
_See code: [src/commands/sym-addfunc.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
232
|
+
_See code: [src/commands/sym-addfunc.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/sym-addfunc.ts)_
|
|
233
233
|
|
|
234
234
|
## `symphony-cli sym-build`
|
|
235
235
|
|
|
@@ -252,7 +252,7 @@ EXAMPLES
|
|
|
252
252
|
$ symphony-cli sym-build --swagger -i
|
|
253
253
|
```
|
|
254
254
|
|
|
255
|
-
_See code: [src/commands/sym-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
255
|
+
_See code: [src/commands/sym-build.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/sym-build.ts)_
|
|
256
256
|
|
|
257
257
|
## `symphony-cli sym-create NAME`
|
|
258
258
|
|
|
@@ -273,7 +273,7 @@ EXAMPLE
|
|
|
273
273
|
symphony-cli sym-create havale -d="Kanallardan yapılan havale işlemi"
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
-
_See code: [src/commands/sym-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
276
|
+
_See code: [src/commands/sym-create.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/sym-create.ts)_
|
|
277
277
|
|
|
278
278
|
## `symphony-cli sym-create-module NAME`
|
|
279
279
|
|
|
@@ -293,7 +293,7 @@ EXAMPLE
|
|
|
293
293
|
symphony-cli sym-create-module abm -d="abm module description"
|
|
294
294
|
```
|
|
295
295
|
|
|
296
|
-
_See code: [src/commands/sym-create-module.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
296
|
+
_See code: [src/commands/sym-create-module.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/sym-create-module.ts)_
|
|
297
297
|
|
|
298
298
|
## `symphony-cli sym-fn-deploy ENVIRONMENT`
|
|
299
299
|
|
|
@@ -327,7 +327,7 @@ EXAMPLES
|
|
|
327
327
|
--f_url="MyFnApiUrl"
|
|
328
328
|
```
|
|
329
329
|
|
|
330
|
-
_See code: [src/commands/sym-fn-deploy.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
330
|
+
_See code: [src/commands/sym-fn-deploy.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/sym-fn-deploy.ts)_
|
|
331
331
|
|
|
332
332
|
## `symphony-cli sym-nano-deploy`
|
|
333
333
|
|
|
@@ -345,7 +345,7 @@ EXAMPLE
|
|
|
345
345
|
symphony-cli sym-nano-deploy
|
|
346
346
|
```
|
|
347
347
|
|
|
348
|
-
_See code: [src/commands/sym-nano-deploy.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
348
|
+
_See code: [src/commands/sym-nano-deploy.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/sym-nano-deploy.ts)_
|
|
349
349
|
|
|
350
350
|
## `symphony-cli sym-start`
|
|
351
351
|
|
|
@@ -367,7 +367,7 @@ EXAMPLE
|
|
|
367
367
|
$ symphony-cli sym-start -b -d
|
|
368
368
|
```
|
|
369
369
|
|
|
370
|
-
_See code: [src/commands/sym-start.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
370
|
+
_See code: [src/commands/sym-start.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/sym-start.ts)_
|
|
371
371
|
|
|
372
372
|
## `symphony-cli sym-test`
|
|
373
373
|
|
|
@@ -384,5 +384,5 @@ EXAMPLE
|
|
|
384
384
|
$ symphony-cli sym-test
|
|
385
385
|
```
|
|
386
386
|
|
|
387
|
-
_See code: [src/commands/sym-test.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.
|
|
387
|
+
_See code: [src/commands/sym-test.ts](https://github.com/alper-batioglu/symphony-cli/blob/v0.4.4/src/commands/sym-test.ts)_
|
|
388
388
|
<!-- commandsstop -->
|
|
@@ -7,7 +7,7 @@ const styling_1 = require("@stechquick/symphony-common/lib/styling");
|
|
|
7
7
|
class BuildUI extends command_1.Command {
|
|
8
8
|
async run() {
|
|
9
9
|
log_1.Logger.log({ message: styling_1.Chalk.create("green.bold", "Build started..."), timeFormat: "datetime" });
|
|
10
|
-
new quiBuilder_1.FolderCopier().Execute();
|
|
10
|
+
await new quiBuilder_1.FolderCopier().Execute();
|
|
11
11
|
log_1.Logger.log({ message: styling_1.Chalk.create("green.bold", "Build completed successfully."), timeFormat: "datetime" });
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -12,7 +12,7 @@ class StartUI extends command_1.Command {
|
|
|
12
12
|
log_1.Logger.log({ message: styling_1.Chalk.create("green.bold", "Quick starting. Please wait..."), timeFormat: "datetime" });
|
|
13
13
|
const { flags } = this.parse(StartUI);
|
|
14
14
|
if (flags.build) {
|
|
15
|
-
new quiBuilder_1.FolderCopier().Execute();
|
|
15
|
+
await new quiBuilder_1.FolderCopier().Execute();
|
|
16
16
|
}
|
|
17
17
|
const args = ['./dist/server/server.js']; // try server adaptor first, then fallback to nanoserver
|
|
18
18
|
if (!fs_1.default.existsSync(args[0])) {
|
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
export declare class FolderCopier {
|
|
2
|
-
|
|
3
|
-
CopyFolder(source: string, destination: string, except?: Array<string>): void;
|
|
4
|
-
CopyFile(source: string, destination: string, options?: {
|
|
5
|
-
copyIfExists?: boolean;
|
|
6
|
-
}): void;
|
|
7
|
-
DeleteFolder(target: string): void;
|
|
8
|
-
private qJsonMediumDecider;
|
|
9
|
-
private ParseQJsonContent;
|
|
10
|
-
private deleteSourceMapping;
|
|
11
|
-
private ReplaceFile;
|
|
12
|
-
private substringBetween;
|
|
13
|
-
private getReplaceFiles;
|
|
14
|
-
private convertYamlstoJS;
|
|
15
|
-
Execute(): void;
|
|
2
|
+
Execute(): Promise<void>;
|
|
16
3
|
}
|
|
@@ -7,212 +7,34 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
7
7
|
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
|
8
8
|
const log_1 = require("@stechquick/symphony-common/lib/log");
|
|
9
9
|
const styling_1 = require("@stechquick/symphony-common/lib/styling");
|
|
10
|
-
;
|
|
10
|
+
const fileHelper_1 = require("@stechquick/algae/lib/helpers/fileHelper");
|
|
11
|
+
const fileSystemImpl_1 = require("@stechquick/algae/lib/clean/infrastructure/fileSystemImpl");
|
|
12
|
+
const qJsonParser_1 = require("@stechquick/algae/lib/helpers/qJsonParser");
|
|
13
|
+
const quickSettingsBundleImpl_1 = require("@stechquick/algae/lib/clean/useCases/quickSettingsBundleImpl");
|
|
11
14
|
class FolderCopier {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
fs.readdirSync(folder).forEach(item => {
|
|
15
|
-
const curItemPath = path.join(folder, item);
|
|
16
|
-
const isDirectory = fs.statSync(curItemPath).isDirectory();
|
|
17
|
-
if (isDirectory) {
|
|
18
|
-
if (!willIterateFolder || (willIterateFolder === null || willIterateFolder === void 0 ? void 0 : willIterateFolder(folder, item, curRelative))) {
|
|
19
|
-
forEachItemInFoderInternal(curItemPath, curRelative + "/" + item);
|
|
20
|
-
iterator(folder, item, curRelative, true);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
iterator(folder, item, curRelative, false);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
forEachItemInFoderInternal(folder, "");
|
|
29
|
-
}
|
|
30
|
-
;
|
|
31
|
-
CopyFolder(source, destination, except) {
|
|
32
|
-
const exceptDict = (except === null || except === void 0 ? void 0 : except.length) ? except.reduce((prev, current) => { prev[current] = true; return prev; }, {}) : undefined;
|
|
33
|
-
this.ForEachItemInFolder(source, (folder, item, relativeFolder, isDirectory) => {
|
|
34
|
-
if (isDirectory) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (exceptDict) {
|
|
38
|
-
const relativeItemPath = path.join(relativeFolder, item);
|
|
39
|
-
if (exceptDict[relativeItemPath]) {
|
|
40
|
-
console.log("Skip: " + relativeItemPath);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const srcPath = path.resolve(path.join(folder, item));
|
|
45
|
-
const destPath = path.resolve(path.join(destination, relativeFolder));
|
|
46
|
-
if (!fs.existsSync(destPath)) {
|
|
47
|
-
fs.mkdirSync(destPath, { recursive: true });
|
|
48
|
-
}
|
|
49
|
-
//console.log(`Dir: ${srcPath}-->${destPath}`);
|
|
50
|
-
if (path.extname(item) === '.qjson') {
|
|
51
|
-
let loadQjson = fs.readFileSync(srcPath, { encoding: 'utf8' });
|
|
52
|
-
let jsonString = this.qJsonMediumDecider(loadQjson);
|
|
53
|
-
let settingsPath = './settings/settings.yaml';
|
|
54
|
-
if (fs.existsSync(settingsPath)) {
|
|
55
|
-
let buildYml = fs.readFileSync(settingsPath, 'utf8');
|
|
56
|
-
let loadYaml = js_yaml_1.default.load(buildYml);
|
|
57
|
-
if (!(loadYaml && loadYaml.environment && loadYaml.environment.keepSourceMappingURL)) {
|
|
58
|
-
jsonString = this.deleteSourceMapping(jsonString);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
let qjson = this.ParseQJsonContent(jsonString);
|
|
62
|
-
qjson === null || qjson === void 0 ? true : delete qjson.pJson;
|
|
63
|
-
qjson === null || qjson === void 0 ? true : delete qjson.lrids;
|
|
64
|
-
fs.writeFileSync(path.join(destPath, item), "let pjson = " + JSON.stringify(qjson) + ";\nexport default pjson");
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
fs.copyFileSync(srcPath, path.join(destPath, item));
|
|
68
|
-
}
|
|
69
|
-
}, (folder, item, relativeFolder) => {
|
|
70
|
-
const relativeItemPath = path.join(relativeFolder, item);
|
|
71
|
-
if (exceptDict === null || exceptDict === void 0 ? void 0 : exceptDict[relativeItemPath]) {
|
|
72
|
-
console.log("Skip: " + relativeItemPath);
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
CopyFile(source, destination, options = {}) {
|
|
79
|
-
const pathParsed = path.parse(source);
|
|
80
|
-
const srcFile = path.resolve(source);
|
|
81
|
-
if (options.copyIfExists && !fs.existsSync(srcFile)) {
|
|
82
|
-
log_1.Logger.log({ message: "Skipping copy: " + srcFile });
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const destPath = path.resolve(destination);
|
|
86
|
-
if (!fs.existsSync(destPath)) {
|
|
87
|
-
fs.mkdirSync(destPath, { recursive: true });
|
|
88
|
-
}
|
|
89
|
-
const destFile = path.join(destPath, pathParsed.base);
|
|
90
|
-
console.log(`File: ${srcFile}-->${destFile}`);
|
|
91
|
-
fs.copyFileSync(srcFile, destFile);
|
|
92
|
-
}
|
|
93
|
-
DeleteFolder(target) {
|
|
94
|
-
if (!fs.existsSync(target)) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
this.ForEachItemInFolder(target, (folder, item, relativeFolder, isDirectory) => {
|
|
98
|
-
const curPath = path.join(folder, item);
|
|
99
|
-
if (isDirectory) {
|
|
100
|
-
fs.rmdirSync(curPath);
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
fs.unlinkSync(path.join(folder, item));
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
qJsonMediumDecider(qjsonData) {
|
|
108
|
-
if (typeof qjsonData == "string") {
|
|
109
|
-
return qjsonData.startsWith('{"qjson":"') ? JSON.parse(qjsonData).qjson : qjsonData;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
const qjsonString = JSON.stringify(qjsonData);
|
|
113
|
-
return qjsonData.qjson || qjsonString;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
ParseQJsonContent(jsonString) {
|
|
117
|
-
let json = jsonString;
|
|
118
|
-
if (jsonString.indexOf("let pjson =") > -1) {
|
|
119
|
-
let jsonSplitted = jsonString.split("let pjson =");
|
|
120
|
-
jsonSplitted = jsonSplitted[1].split(';\nexport')[0].split(';\r\nexport');
|
|
121
|
-
json = jsonSplitted[0];
|
|
122
|
-
}
|
|
123
|
-
else if (json.indexOf("rally_microUI") > -1) {
|
|
124
|
-
const registerIndex = json.indexOf("registerQJson");
|
|
125
|
-
const jsonStartIndex = json.indexOf(",", registerIndex) + 1;
|
|
126
|
-
json = json.substring(jsonStartIndex, json.length - 2);
|
|
127
|
-
}
|
|
128
|
-
return JSON.parse(json);
|
|
129
|
-
}
|
|
130
|
-
deleteSourceMapping(jsonString) {
|
|
131
|
-
let searchValue = '//# sourceMappingURL=data:application/json;base64';
|
|
132
|
-
let regex = new RegExp(`(${searchValue}+)`, 'gi');
|
|
133
|
-
let regexCount = jsonString.match(regex);
|
|
134
|
-
regexCount === null || regexCount === void 0 ? void 0 : regexCount.forEach(() => {
|
|
135
|
-
let indexStart = jsonString.indexOf(searchValue);
|
|
136
|
-
let indexEnd = jsonString.substring(indexStart).indexOf('"');
|
|
137
|
-
jsonString = jsonString.substring(0, indexStart) + jsonString.substring(indexStart + indexEnd);
|
|
138
|
-
});
|
|
139
|
-
return jsonString;
|
|
140
|
-
}
|
|
141
|
-
ReplaceFile(source, skipIfNone, cb) {
|
|
142
|
-
const srcFile = path.resolve(source);
|
|
143
|
-
if (!fs.existsSync(srcFile)) {
|
|
144
|
-
console.log(`${srcFile} does not exists skip: ${skipIfNone}`);
|
|
145
|
-
if (skipIfNone) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
const fileBody = fs.readFileSync(srcFile, { encoding: "utf-8" });
|
|
150
|
-
const fileName = path.parse(srcFile).base;
|
|
151
|
-
const newFileData = cb({ fileBody, fileName });
|
|
152
|
-
fs.unlinkSync(srcFile);
|
|
153
|
-
fs.writeFileSync(srcFile.replace(fileName, newFileData.fileName), newFileData.fileBody, { encoding: "utf-8" });
|
|
154
|
-
}
|
|
155
|
-
substringBetween(sourceString, start, end) {
|
|
156
|
-
let startIndex = sourceString.indexOf(start);
|
|
157
|
-
if (startIndex < 0) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
startIndex = startIndex + start.length;
|
|
161
|
-
let endIndex = sourceString.length;
|
|
162
|
-
if (end) {
|
|
163
|
-
endIndex = sourceString.indexOf(end, startIndex);
|
|
164
|
-
if (endIndex < 0) {
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return sourceString.substring(startIndex, endIndex);
|
|
169
|
-
}
|
|
170
|
-
getReplaceFiles() {
|
|
171
|
-
return [{
|
|
172
|
-
fileName: "./dist/client/static/js/componentList.ts",
|
|
173
|
-
fileReplacer: (fileData) => {
|
|
174
|
-
const retVal = { fileName: fileData.fileName.replace(".ts", ".js"), fileBody: "" };
|
|
175
|
-
let fileBody = this.substringBetween(fileData.fileBody, "//#region JS Section");
|
|
176
|
-
if (!fileBody) {
|
|
177
|
-
return retVal;
|
|
178
|
-
}
|
|
179
|
-
retVal.fileBody = fileBody.replace(": ComponentOptions =", " =");
|
|
180
|
-
retVal.fileBody = retVal.fileBody.replace('window["QEditorComponentOptions"]', 'window["plateauUIComponentOptions"]'); // for old versions of qui
|
|
181
|
-
return retVal;
|
|
182
|
-
}
|
|
183
|
-
}];
|
|
184
|
-
}
|
|
185
|
-
convertYamlstoJS() {
|
|
186
|
-
const yamlPaths = ["settings", "localProxy"];
|
|
187
|
-
let arrangedJSON = Object.create({ settings: {}, proxy: {} });
|
|
188
|
-
let resolvedPath = "";
|
|
189
|
-
let fileName = "";
|
|
190
|
-
yamlPaths.forEach(item => {
|
|
191
|
-
let tempPath = `./settings/${item}.yaml`;
|
|
192
|
-
resolvedPath = path.resolve(tempPath);
|
|
193
|
-
fileName = path.parse(resolvedPath).base;
|
|
194
|
-
let fileContent = fs.readFileSync(tempPath, "utf8");
|
|
195
|
-
arrangedJSON[item] = js_yaml_1.default.safeLoad(fileContent);
|
|
196
|
-
});
|
|
197
|
-
let concattedYamlString = "const yamlObject = "
|
|
198
|
-
+ JSON.stringify(arrangedJSON, null, '\t')
|
|
199
|
-
+ "\nif (typeof exports === 'object' && typeof module === 'object'){\n \tmodule.exports = yamlObject;\n}else{ \n\twindow['plateauUISettings'] = yamlObject;\n}";
|
|
200
|
-
fs.writeFileSync(resolvedPath.replace(fileName, "settings-proxy.js"), concattedYamlString, { encoding: "utf-8" });
|
|
201
|
-
}
|
|
202
|
-
Execute() {
|
|
203
|
-
this.DeleteFolder("./dist");
|
|
15
|
+
async Execute() {
|
|
16
|
+
fileHelper_1.DeleteFolder("./dist"); //deletes dist folder of project
|
|
204
17
|
log_1.Logger.log({ message: styling_1.Chalk.create("green.bold", "Folders copying..."), timeFormat: "datetime" });
|
|
205
|
-
|
|
206
|
-
let
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
18
|
+
fileHelper_1.CopyFolder("./node_modules/@stechquick/qui/dist", "./dist", ["build"]); // copies /node_modules/@stechquick/qui/dist folder to dist
|
|
19
|
+
let settingsContent = fs.readFileSync(path.resolve("./settings/settings.yaml"), { encoding: "utf-8" }); // reads settings.yaml
|
|
20
|
+
const settings = js_yaml_1.default.load(settingsContent); // converts yaml file content to js
|
|
21
|
+
fileHelper_1.CopyFolder("./static", "./dist/client/static", undefined, {
|
|
22
|
+
distinctFileExtensions: [".qjson"],
|
|
23
|
+
distinctFilesCb: (srcPath) => {
|
|
24
|
+
let jsonBody = fs.readFileSync(srcPath, { encoding: "utf-8" });
|
|
25
|
+
jsonBody = new qJsonParser_1.QJsonParser().minifyQjson(jsonBody, settings.keepSourceMappingURL === true);
|
|
26
|
+
return { success: true, value: jsonBody };
|
|
27
|
+
},
|
|
28
|
+
context: this
|
|
29
|
+
}); // copies static folder. if encountered any file with ".qjson" extension, calls minifyQjson
|
|
30
|
+
fileHelper_1.CopyFolder("./settings", "./dist/client/settings", ["server"]); // copies settings folder to dist/client/settings
|
|
31
|
+
fileHelper_1.CopyFolder("./settings", "./dist/server/settings", ["localProxy.yaml"]); // copies settings folder to dist/server/settings
|
|
32
|
+
fileHelper_1.CopyFile("./worker/a9e657cbf4abb977edda.worker.js", "./dist/client", { copyIfExists: true }); // copies worker.js file to dist/client
|
|
33
|
+
await new quickSettingsBundleImpl_1.QuickSettingsBundleImpl().bundleSettings("./dist", {
|
|
34
|
+
fileSystem: new fileSystemImpl_1.FileSystemImpl(),
|
|
35
|
+
yaml: { load: yamlContent => js_yaml_1.default.load(yamlContent) }
|
|
36
|
+
});
|
|
214
37
|
log_1.Logger.log({ message: styling_1.Chalk.create("green.bold", "Folders copied successfully."), timeFormat: "datetime" });
|
|
215
|
-
this.getReplaceFiles().forEach(item => this.ReplaceFile(item.fileName, true, item.fileReplacer));
|
|
216
38
|
}
|
|
217
39
|
}
|
|
218
40
|
exports.FolderCopier = FolderCopier;
|
|
@@ -7,7 +7,7 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
7
7
|
const yaml = tslib_1.__importStar(require("js-yaml"));
|
|
8
8
|
const fileHelper_1 = require("@stechquick/symphony-common/lib/helpers/fileHelper");
|
|
9
9
|
const paramReplacer_1 = require("./paramReplacer");
|
|
10
|
-
const
|
|
10
|
+
const fileHelper_2 = require("@stechquick/algae/lib/helpers/fileHelper");
|
|
11
11
|
class PredeployCommon {
|
|
12
12
|
constructor() {
|
|
13
13
|
this.config = {};
|
|
@@ -70,7 +70,7 @@ class PredeployCommon {
|
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
72
|
if (fileHelper_1.FileHelper.isDirectory(copyItem.path)) {
|
|
73
|
-
|
|
73
|
+
fileHelper_2.CopyFolder(copyItem.path, targetItem);
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
76
|
fs.copyFileSync(copyItem.path, targetItem);
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.4.
|
|
1
|
+
{"version":"0.4.4","commands":{"mui-create":{"id":"mui-create","description":"MicroUI command to create a new Micro UI project","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli mui-create myUI -d=\"My Micro UI project\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to project","hidden":false,"required":false,"default":""}},"args":[{"name":"name","description":"input microui name","required":true}]},"nc-addcomp":{"id":"nc-addcomp","description":"Command for add a named component to nc project.","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli nc-addcomp my_comp_name"],"flags":{},"args":[{"name":"name","description":"input component name","required":true}]},"nc-build":{"id":"nc-build","description":"Command for build your named component project.","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli nc-build","$ symphony-cli nc-build -w"],"flags":{"watch":{"name":"watch","type":"boolean","char":"w","description":"for watch","allowNo":false}},"args":[]},"nc-create":{"id":"nc-create","description":"Command for create a named component template project.","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli nc-create nc_example -d=\"my named component example\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to named component","hidden":false,"required":false,"default":""}},"args":[{"name":"name","description":"input project name","required":true}]},"qui-build":{"id":"qui-build","description":"Plateau-QUI command to build your Quick ui project","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli qui-build -w"],"flags":{},"args":[]},"qui-create":{"id":"qui-create","description":"Plateau-QUI command to create a new Quick ui project","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli qui-create myUI -t=TOKEN","symphony-cli qui-create myUI -t=TOKEN -d=\"My Quick UI project\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to project","hidden":false,"required":false,"default":""},"token":{"name":"token","type":"option","char":"t","description":"npm token for @stechquick","hidden":false,"required":true}},"args":[{"name":"name","description":"input quick ui name","required":true}]},"qui-start":{"id":"qui-start","description":"Plateau-QUI command for start your Quick ui project with/without build","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli qui-start -b"],"flags":{"build":{"name":"build","type":"boolean","char":"b","description":"for build","allowNo":false}},"args":[]},"quick-serve":{"id":"quick-serve","description":"QUICK command for serving your path","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli quick-serve","$ symphony-cli quick-serve -p 3000","$ symphony-cli quick-serve -g","$ symphony-cli quick-serve -r C:/MyPathToServe","$ symphony-cli quick-serve -g -r C:/MyPathToServe"],"flags":{"path":{"name":"path","type":"option","char":"r","description":"Change path to serve"},"httpPort":{"name":"httpPort","type":"option","char":"p","description":"HTTP port to serve"},"global":{"name":"global","type":"boolean","char":"g","description":"Host/visible for everyone.","allowNo":false}},"args":[]},"sym-addfunc":{"id":"sym-addfunc","description":"Plateau-Symphony command to create a new function","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-addfunc havalemenu"],"flags":{},"args":[{"name":"funcname","description":"input function name","required":true,"hidden":false}]},"sym-build":{"id":"sym-build","description":"Plateau-Symphony command to build the app with/without watch","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli sym-build","$ symphony-cli sym-build -w","$ symphony-cli sym-build --swagger","$ symphony-cli sym-build --swagger -i"],"flags":{"watch":{"name":"watch","type":"boolean","char":"w","description":"for watch","allowNo":false},"skipversion":{"name":"skipversion","type":"boolean","char":"s","description":"skip version checking. Used for Deployment","allowNo":false},"swagger":{"name":"swagger","type":"boolean","description":"for swagger generation, this parameter must be given","allowNo":false},"swaggerInclusive":{"name":"swaggerInclusive","type":"boolean","char":"i","description":"to make swagger schema inclusive","allowNo":false}},"args":[]},"sym-create-module":{"id":"sym-create-module","description":"Plateau-Symphony command to create a Symphony Library (Module)","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-create-module abm -d=\"abm module description\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to module","hidden":false,"required":false,"default":""}},"args":[{"name":"name","description":"input module name","required":true}]},"sym-create":{"id":"sym-create","description":"Plateau-Symphony command to create a Symphony App","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-create havale -d=\"Kanallardan yapılan havale işlemi\""],"flags":{"desc":{"name":"desc","type":"option","char":"d","description":"description to application","hidden":false,"required":false,"default":""},"token":{"name":"token","type":"option","char":"t","description":"npm token for @stechquick","hidden":false,"required":true}},"args":[{"name":"name","description":"input application name","required":true}]},"sym-fn-deploy":{"id":"sym-fn-deploy","description":"Plateau-Symphony fn command to deploy the all functions in your app","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-fn-deploy local","symphony-cli sym-fn-deploy play","symphony-cli sym-fn-deploy remote","symphony-cli sym-fn-deploy remote -d MyDockerUrl -u MyDockerUser -p MyDockerPassword -f MyFnApiUrl","symphony-cli sym-fn-deploy remote --d_url MyDockerUrl --d_user MyDockerUser --d_pass MyDockerPassword --f_url MyFnApiUrl","symphony-cli sym-fn-deploy remote --d_url=\"MyDockerUrl\" --d_user=\"MyDockerUser\" --d_pass=\"MyDockerPassword\" --f_url=\"MyFnApiUrl\""],"flags":{"d_url":{"name":"d_url","type":"option","char":"d","description":"docker url to deploy","hidden":false,"required":false,"default":""},"d_user":{"name":"d_user","type":"option","char":"u","description":"docker username to deploy","hidden":false,"required":false,"default":""},"d_pass":{"name":"d_pass","type":"option","char":"p","description":"docker password for this username to deploy","hidden":false,"required":false,"default":""},"f_url":{"name":"f_url","type":"option","char":"f","description":"fn api url to deploy","hidden":false,"required":false,"default":""},"node_env":{"name":"node_env","type":"option","char":"e","description":"symphony environment name","hidden":false,"required":false}},"args":[{"name":"environment","description":"deploy environment: \n [local: your local] \n [play: playground environment] \n [remote: remote server]","required":true,"options":["local","play","remote"],"hidden":false}]},"sym-nano-deploy":{"id":"sym-nano-deploy","description":"Plateau-Symphony nano command to deploy the all functions in your app","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["symphony-cli sym-nano-deploy"],"flags":{"node_env":{"name":"node_env","type":"option","char":"e","description":"symphony environment name","hidden":false,"required":false},"imagename":{"name":"imagename","type":"option","char":"i","description":"image name for docker","hidden":false,"required":true}},"args":[]},"sym-start":{"id":"sym-start","description":"Plateau-Symphony command to start your functions with/without debug","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli sym-start -b -d"],"flags":{"debug":{"name":"debug","type":"boolean","char":"d","description":"for debug","allowNo":false},"build":{"name":"build","type":"boolean","char":"b","description":"for build","allowNo":false},"http_port":{"name":"http_port","type":"option","char":"p","description":"port to HTTP server"},"https_port":{"name":"https_port","type":"option","char":"h","description":"port to HTTPS server"},"environment":{"name":"environment","type":"option","char":"e","description":"environment variable","hidden":false,"required":false},"hosted_path":{"name":"hosted_path","type":"option","description":"application hosted sub path","required":false}},"args":[]},"sym-test":{"id":"sym-test","description":"Plateau-Symphony command to run your all test functions with coverage","pluginName":"@stechquick/symphony-cli","pluginType":"core","aliases":[],"examples":["$ symphony-cli sym-test"],"flags":{"func":{"name":"func","type":"option","char":"f","description":"funtion name to test particular file"}},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stechquick/symphony-cli",
|
|
3
3
|
"description": "quick symphony server cli tools",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.4",
|
|
5
5
|
"bin": {
|
|
6
6
|
"symphony-cli": "./bin/run"
|
|
7
7
|
},
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@stechquick/symphony-common": "^0.1.16",
|
|
26
26
|
"@stechquick/symphony-nanoserver": "^0.2.8",
|
|
27
27
|
"@stechquick/symphony-nanoserver-wsplugin": "^0.2.4",
|
|
28
|
+
"@stechquick/algae": "^1.0.151",
|
|
28
29
|
"@types/js-yaml": "^3.12.5",
|
|
29
30
|
"cli-ux": "^5.4.6",
|
|
30
31
|
"compare-versions": "^3.6.0",
|
|
@@ -6,7 +6,7 @@ symphony.registerFunc({
|
|
|
6
6
|
funcName: "{{FuncName}}",
|
|
7
7
|
keepBag: false,
|
|
8
8
|
requireFunc: require,
|
|
9
|
-
func:
|
|
9
|
+
func: {{FuncName}}Func,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export interface IRequest extends TReqDefault { };
|
|
@@ -14,6 +14,8 @@ alertqjson: "/settings/qjson/alert.qjson"
|
|
|
14
14
|
pipelineqjson: "/settings/qjson/pipeline.qjson"
|
|
15
15
|
loadingqjson: "/settings/qjson/loading.qjson"
|
|
16
16
|
globalLocalizationqjson: "/settings/qjson/globalLocalization.qjson"
|
|
17
|
+
containerServicesPath: "/static/js/containerServices.ts"
|
|
18
|
+
componentListPath: "/static/js/componentList.ts"
|
|
17
19
|
# Qjsons in QUI -> /static/qjsons/first.qjson
|
|
18
20
|
# Qjsons in MicroUI -> /microui/<<microUI name>>/qjson/first.js
|
|
19
21
|
# Qjsons in Symphony -> /<<Symphony service name>>/qjsonfunc?qjsonpath=first.qjson
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare var exports, module;
|
|
2
|
+
//#region JS Section
|
|
3
|
+
var containerServices = {
|
|
4
|
+
extensions: {
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
if (typeof exports === 'object' && typeof module === 'object') {
|
|
10
|
+
module.exports = containerServices;
|
|
11
|
+
} else {
|
|
12
|
+
window["plateauUIContainerServices"] = containerServices;
|
|
13
|
+
}
|
|
14
|
+
//#region JS Section
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"quick:serve": "symphony-cli quick-serve"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@stechquick/qui": "^1.2.
|
|
14
|
-
"@stechquick/symphony-cli": "^0.4.
|
|
13
|
+
"@stechquick/qui": "^1.2.118",
|
|
14
|
+
"@stechquick/symphony-cli": "^0.4.4"
|
|
15
15
|
},
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "ISC",
|
|
@@ -6,7 +6,7 @@ symphony.registerFunc({
|
|
|
6
6
|
funcName: "samplefunc",
|
|
7
7
|
keepBag: false,
|
|
8
8
|
requireFunc: require,
|
|
9
|
-
func:
|
|
9
|
+
func: samplefunc,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export interface IRequest extends TReqDefault { };
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@types/node": "^12.12.39",
|
|
16
16
|
"@types/jest": "^26.0.4",
|
|
17
|
-
"@stechquick/symphony": "^0.0.
|
|
18
|
-
"@stechquick/symphony-cli": "^0.4.
|
|
17
|
+
"@stechquick/symphony": "^0.0.15",
|
|
18
|
+
"@stechquick/symphony-cli": "^0.4.4",
|
|
19
19
|
"jest": "^26.1.0",
|
|
20
20
|
"ts-jest": "^26.1.1",
|
|
21
21
|
"typescript": "^4.9.4"
|