@magic-xpa/cli 4.1201.0-dev4121.301 → 4.1201.0-dev4121.302
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/package.json +1 -1
- package/src/schematics/magic-utils/Util.d.ts +6 -0
- package/src/schematics/magic-utils/Util.js +9 -0
- package/src/schematics/magic-utils/Util.js.map +1 -1
- package/src/schematics/magic-utils/Util.ts +9 -0
- package/src/schematics/magic-utils/process-json.js +3 -4
- package/src/schematics/magic-utils/process-json.js.map +1 -1
- package/src/schematics/magic-utils/process-json.ts +1 -2
- package/src/schematics/magic-utils/rules/component-list.rule.js +1 -2
- package/src/schematics/magic-utils/rules/component-list.rule.js.map +1 -1
- package/src/schematics/magic-utils/rules/component-list.rule.ts +1 -2
package/package.json
CHANGED
|
@@ -4,3 +4,9 @@ export declare class Util {
|
|
|
4
4
|
export declare function logErr(err: any): void;
|
|
5
5
|
export declare function LogLn(msg: any): void;
|
|
6
6
|
export declare function Log(msg: any): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the given value is null or undefined.
|
|
9
|
+
* @param value The value to check.
|
|
10
|
+
* @returns true if the value is null or undefined, false otherwise.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isNullOrUndefined(value: any): boolean;
|
|
@@ -4,6 +4,7 @@ exports.Util = void 0;
|
|
|
4
4
|
exports.logErr = logErr;
|
|
5
5
|
exports.LogLn = LogLn;
|
|
6
6
|
exports.Log = Log;
|
|
7
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
7
8
|
const process = require("process");
|
|
8
9
|
const env_1 = require("./env");
|
|
9
10
|
// @dynamic
|
|
@@ -24,4 +25,12 @@ function Log(msg) {
|
|
|
24
25
|
if (!env_1.env.prevent_log)
|
|
25
26
|
return process.stdout.write(msg);
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Checks if the given value is null or undefined.
|
|
30
|
+
* @param value The value to check.
|
|
31
|
+
* @returns true if the value is null or undefined, false otherwise.
|
|
32
|
+
*/
|
|
33
|
+
function isNullOrUndefined(value) {
|
|
34
|
+
return value === null || value === undefined;
|
|
35
|
+
}
|
|
27
36
|
//# sourceMappingURL=Util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.js","sourceRoot":"","sources":["Util.ts"],"names":[],"mappings":";;;AAWA,wBAEC;AAED,sBAGC;AAED,kBAGC;
|
|
1
|
+
{"version":3,"file":"Util.js","sourceRoot":"","sources":["Util.ts"],"names":[],"mappings":";;;AAWA,wBAEC;AAED,sBAGC;AAED,kBAGC;AAOD,8CAEC;AAhCD,mCAAmC;AACnC,+BAA4B;AAE5B,WAAW;AACX,MAAa,IAAI;IAChB,MAAM,CAAC,aAAa,CAAC,KAAU,EAAE,GAAQ;QACxC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC3D,CAAC;CAED;AALD,oBAKC;AAED,SAAgB,MAAM,CAAC,GAAG;IACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,KAAK,CAAC,GAAG;IACvB,IAAG,CAAC,SAAG,CAAC,WAAW;QAClB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,CAAA;AACrC,CAAC;AAED,SAAgB,GAAG,CAAC,GAAG;IACrB,IAAG,CAAC,SAAG,CAAC,WAAW;QACjB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;AACpC,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,KAAU;IAC1C,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC","sourcesContent":["import * as process from 'process';\r\nimport { env } from \"./env\";\r\n\r\n// @dynamic\r\nexport class Util {\r\n\tstatic enumNameByVal(enumm: any, val: any) {\r\n\t\treturn Object.keys(enumm).find(key => enumm[key] === val);\r\n\t}\r\n\r\n}\r\n\r\nexport function logErr(err) {\r\n process.stderr.write('ERR' + err + '\\r\\n');\r\n}\r\n\r\nexport function LogLn(msg){\r\n if(!env.prevent_log)\r\n\t process.stdout.write(msg + '\\r\\n')\r\n}\r\n\r\nexport function Log(msg){\r\n if(!env.prevent_log)\r\n return process.stdout.write(msg)\r\n}\r\n\r\n/**\r\n * Checks if the given value is null or undefined.\r\n * @param value The value to check.\r\n * @returns true if the value is null or undefined, false otherwise.\r\n */\r\nexport function isNullOrUndefined(value: any): boolean {\r\n return value === null || value === undefined;\r\n}\r\n"]}
|
|
@@ -22,3 +22,12 @@ export function Log(msg){
|
|
|
22
22
|
if(!env.prevent_log)
|
|
23
23
|
return process.stdout.write(msg)
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the given value is null or undefined.
|
|
28
|
+
* @param value The value to check.
|
|
29
|
+
* @returns true if the value is null or undefined, false otherwise.
|
|
30
|
+
*/
|
|
31
|
+
export function isNullOrUndefined(value: any): boolean {
|
|
32
|
+
return value === null || value === undefined;
|
|
33
|
+
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processJson = processJson;
|
|
4
4
|
const Util_1 = require("./Util");
|
|
5
|
-
const util_1 = require("util");
|
|
6
5
|
const Enums_1 = require("../../../src/types/enums/Enums");
|
|
7
6
|
// mapping for properties which are implemented using a class
|
|
8
7
|
const Map = {
|
|
@@ -126,16 +125,16 @@ function processControl(control) {
|
|
|
126
125
|
else {
|
|
127
126
|
return;
|
|
128
127
|
}
|
|
129
|
-
if ((0,
|
|
128
|
+
if ((0, Util_1.isNullOrUndefined)(ruleSet$))
|
|
130
129
|
return;
|
|
131
130
|
// ... or turn on the has-expession flag
|
|
132
|
-
if (!(0,
|
|
131
|
+
if (!(0, Util_1.isNullOrUndefined)(ruleSet$.has_exp) && ruleSet$.has_exp) {
|
|
133
132
|
control.hasClassExpression = true;
|
|
134
133
|
}
|
|
135
134
|
// find and keep the class name...
|
|
136
135
|
else {
|
|
137
136
|
if (Map[catName] && Map[catName][i] && Map[catName][i] && Map[catName][i]['options']) {
|
|
138
|
-
if (!(0,
|
|
137
|
+
if (!(0, Util_1.isNullOrUndefined)(Map[catName][i]['options'][String(ruleSet$)]))
|
|
139
138
|
controlClasses.push(Map[catName][i]['options'][String(ruleSet$)]);
|
|
140
139
|
}
|
|
141
140
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-json.js","sourceRoot":"","sources":["process-json.ts"],"names":[],"mappings":";;AAsDA,kCAcC;AAnED,iCAA+C;AAC/C,+BAAyC;AACzC,0DAAkF;AAElF,6DAA6D;AAC7D,MAAM,GAAG,GAAqG;IAC1G,KAAK,EAAE;QACH;YACI,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,cAAc;SACzB;QAED;YACI,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,eAAe;SAC1B;QACD;YACI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACL,OAAO,EAAE,eAAe;aAC3B;SACJ;QACD;YACI,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE;gBACL,GAAG,EAAE,aAAa;gBAClB,GAAG,EAAE,eAAe;gBACpB,GAAG,EAAE,qBAAqB;gBAC1B,GAAG,EAAE,gBAAgB;gBACrB,GAAG,EAAE,gBAAgB;gBACrB,GAAG,EAAE,eAAe;gBACpB,GAAG,EAAE,eAAe;aACvB;SACJ;QACD;YACI,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE;gBACL,MAAM,EAAE,WAAW;aAEtB;SACJ;KACJ;IACD,KAAK,E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wBAChE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAC1E,CAAC;qBACI,CAAC;oBACF,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC;gBACpH,CAAC;YACL,CAAC;QAEL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,yDAAyD;IAEzD,6BAA6B;IAC7B,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,wCAAwC;QACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAc,EAAE,EAAE;YACxC,cAAc,CAAC,KAAK,CAAC,CAAA;QACzB,CAAC,CAAC,CAAC;QACH,sCAAsC;IAC1C,CAAC;AAEL,CAAC","sourcesContent":["import {AppJson, View,Control} from '../../types/index';\r\nimport {LogLn,} from \"./Util\";\r\nimport { isNullOrUndefined } from \"util\";\r\nimport { MgControlType, CtrlButtonTypeGui } from \"../../../src/types/enums/Enums\";\r\n\r\n// mapping for properties which are implemented using a class\r\nconst Map: { [category: string]: { name: string, suffix?: string, options?: { [val: string]: string } }[] } = {\r\n style: [\r\n {\r\n name: 'font',\r\n suffix: 'mgFont'\r\n },\r\n {\r\n name: 'focus_color',\r\n suffix: 'mgFocusColor'\r\n },\r\n\r\n {\r\n name: 'border_color',\r\n suffix: 'mgBorderColor'\r\n },\r\n {\r\n name: 'border',\r\n options: {\r\n \"false\": 'hidden_border'\r\n }\r\n },\r\n {\r\n name: 'border_style',\r\n options: {\r\n \"1\": 'twod_border',\r\n \"2\": 'threed_border',\r\n \"3\": 'threedsunken_border',\r\n \"4\": 'windows_border',\r\n \"5\": 'windows_border',\r\n \"6\": 'emboss_border',\r\n \"7\": 'hidden_border'\r\n }\r\n },\r\n {\r\n name: 'multiline_edit',\r\n options: {\r\n \"true\": 'multiline',\r\n\r\n }\r\n }\r\n ],\r\n props: [],\r\n hint: []\r\n};\r\n\r\n//////////////////////////////////////////////////////////////////\r\n// process the views' json, find the classes used for each control\r\n//////////////////////////////////////////////////////////////////\r\nexport function processJson(appJson: AppJson) :AppJson {\r\n\r\n const views$: View[] = Object.assign([], appJson.views);\r\n appJson.views.length = 0;\r\n\r\n // loop on all views\r\n views$.forEach( view$ => {\r\n if(view$){\r\n LogLn(`[>] Processing JSON file for component ${view$.props.id}`);\r\n processControl(view$);\r\n appJson.views.push(view$);\r\n }\r\n });\r\n return appJson;\r\n}\r\n\r\nfunction CalcClassForControl(control: Control, controlClasses: string[] ){\r\n if (control.controlType != MgControlType.CTRL_TYPE_TABPAGE){\r\n\r\n if (control.controlType === MgControlType.CTRL_TYPE_BUTTON && control.props.button_style === CtrlButtonTypeGui.Image) {\r\n controlClasses.push(\"button_image_background_size\");\r\n }\r\n\r\n if (control.controlType === MgControlType.CTRL_TYPE_LABEL) {\r\n controlClasses.push(\"lable_overflow\");\r\n }\r\n\r\n\r\n if (control.controlType === MgControlType.CTRL_TYPE_COLUMN ) {\r\n controlClasses.push(\"table_row\");\r\n }\r\n\r\n if (control.controlType === MgControlType.CTRL_TYPE_TABLE){\r\n\r\n if (control.props.scroll_bar) {\r\n controlClasses.push(\"table_scrollBar\");\r\n }\r\n }\r\n\r\n if(control.controlType === MgControlType.CTRL_TYPE_TABLE || control.controlType === MgControlType.CTRL_TYPE_GROUP) {\r\n controlClasses.push(\"container_border\");\r\n }\r\n\r\n // if (control.children) {\r\n // control.children.forEach((ctrl$: Control) => {\r\n // CalcClassForControl(ctrl$, controlClasses)\r\n // });\r\n // }\r\n }\r\n}\r\n///////////////////////////////////////////////////////////////////////////////////////////////////\r\n// for each special chars we will add \"\\\" before the special char.\r\n// For example : control name \"Blabla?\" the class name will be \"Blabla\\?\"\r\n///////////////////////////////////////////////////////////////////////////////////////////////////\r\nfunction getControlClassNameInCss(controlNameStr: string): string {\r\n var controlName = controlNameStr;\r\n\r\n //The following chars are created problem in css = [\"!\" \",\" \"+\", \":\", \",\", \"~\", \";\", \"\\\"\" \"{\" \"}\" \">\" \" \"];\r\n //TODO:need to be check with Rotem let specialCharsForRotem = [\"!\"];\r\n\r\n // replace all special chars\r\n let specialCharsWork = [\"\\\\\", \"#\", \"$\", \"%\", \"&\", \"(\", \")\", \"*\", \"-\", \".\", \"/\", \"<\", \"=\", \"?\", \"@\", \"[\", \"]\", \"^\", \"`\", \"|\"];\r\n for (let i = 0; i < specialCharsWork.length; i++) {\r\n controlName = controlName.split(specialCharsWork[i]).join(\"\\\\\" + specialCharsWork[i]);\r\n }\r\n\r\n return controlName;\r\n}\r\n\r\n//////////////////////////////////////////////////////////////////\r\n// recursively process the controls' properties, find the classes used for the control\r\n//////////////////////////////////////////////////////////////////\r\nfunction processControl(control: Control) {\r\n\r\n const categoryNames: string[] = Object.keys(Map);\r\n\r\n //LogLn(\">> Generating CSS class list for \\\"\" + control.props.id + \"\\\"\");\r\n\r\n const controlClasses: string[] = [];\r\n\r\n // use the control's id as a class\r\n //control[\"class_name_in_css\"] = getControlClassNameInCss(control.props.id);\r\n //controlClasses.push(control.props.id + \"Props\");\r\n CalcClassForControl(control, controlClasses);\r\n\r\n // loop on all item names from the \"Map\" object\r\n categoryNames.forEach((catName) => {\r\n let catRuleArray: { name: string, suffix?: string, options?: { [val: string]: string } }[] = Map[catName];\r\n\r\n catRuleArray.forEach((rule, i) => {\r\n\r\n let ruleSet$;\r\n if (control[catName]) {\r\n ruleSet$ = control[catName][rule.name];\r\n }\r\n else {\r\n return;\r\n }\r\n if (isNullOrUndefined(ruleSet$)) return;\r\n\r\n // ... or turn on the has-expession flag\r\n if (!isNullOrUndefined(ruleSet$.has_exp) && ruleSet$.has_exp) {\r\n control.hasClassExpression = true;\r\n }\r\n // find and keep the class name...\r\n else {\r\n if (Map[catName] && Map[catName][i] && Map[catName][i] && Map[catName][i]['options']) {\r\n if (!isNullOrUndefined(Map[catName][i]['options'][String(ruleSet$)]))\r\n controlClasses.push(Map[catName][i]['options'][String(ruleSet$)]);\r\n }\r\n else {\r\n controlClasses.push(Map[catName] && Map[catName][i] && Map[catName][i] && Map[catName][i]['suffix'] + ruleSet$);\r\n }\r\n }\r\n\r\n });\r\n\r\n control.classes = controlClasses.join(' ');\r\n });\r\n\r\n //LogLn(\"generated classes \\\"\" + control.classes + \"\\\"\");\r\n\r\n // go over control's children\r\n if (control.children) {\r\n //LogLn(\"processing child controls...\");\r\n control.children.forEach((ctrl$: Control) => {\r\n processControl(ctrl$)\r\n });\r\n //LogLn(\"...children processing done\")\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"process-json.js","sourceRoot":"","sources":["process-json.ts"],"names":[],"mappings":";;AAqDA,kCAcC;AAlED,iCAAgD;AAChD,0DAAkF;AAElF,6DAA6D;AAC7D,MAAM,GAAG,GAAqG;IAC1G,KAAK,EAAE;QACH;YACI,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,cAAc;SACzB;QAED;YACI,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,eAAe;SAC1B;QACD;YACI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACL,OAAO,EAAE,eAAe;aAC3B;SACJ;QACD;YACI,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE;gBACL,GAAG,EAAE,aAAa;gBAClB,GAAG,EAAE,eAAe;gBACpB,GAAG,EAAE,qBAAqB;gBAC1B,GAAG,EAAE,gBAAgB;gBACrB,G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CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;oBACnF,IAAI,CAAC,IAAA,wBAAiB,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;wBAChE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAC1E,CAAC;qBACI,CAAC;oBACF,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC;gBACpH,CAAC;YACL,CAAC;QAEL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,yDAAyD;IAEzD,6BAA6B;IAC7B,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACnB,wCAAwC;QACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAc,EAAE,EAAE;YACxC,cAAc,CAAC,KAAK,CAAC,CAAA;QACzB,CAAC,CAAC,CAAC;QACH,sCAAsC;IAC1C,CAAC;AAEL,CAAC","sourcesContent":["import {AppJson, View,Control} from '../../types/index';\r\nimport {LogLn, isNullOrUndefined} from \"./Util\";\r\nimport { MgControlType, CtrlButtonTypeGui } from \"../../../src/types/enums/Enums\";\r\n\r\n// mapping for properties which are implemented using a class\r\nconst Map: { [category: string]: { name: string, suffix?: string, options?: { [val: string]: string } }[] } = {\r\n style: [\r\n {\r\n name: 'font',\r\n suffix: 'mgFont'\r\n },\r\n {\r\n name: 'focus_color',\r\n suffix: 'mgFocusColor'\r\n },\r\n\r\n {\r\n name: 'border_color',\r\n suffix: 'mgBorderColor'\r\n },\r\n {\r\n name: 'border',\r\n options: {\r\n \"false\": 'hidden_border'\r\n }\r\n },\r\n {\r\n name: 'border_style',\r\n options: {\r\n \"1\": 'twod_border',\r\n \"2\": 'threed_border',\r\n \"3\": 'threedsunken_border',\r\n \"4\": 'windows_border',\r\n \"5\": 'windows_border',\r\n \"6\": 'emboss_border',\r\n \"7\": 'hidden_border'\r\n }\r\n },\r\n {\r\n name: 'multiline_edit',\r\n options: {\r\n \"true\": 'multiline',\r\n\r\n }\r\n }\r\n ],\r\n props: [],\r\n hint: []\r\n};\r\n\r\n//////////////////////////////////////////////////////////////////\r\n// process the views' json, find the classes used for each control\r\n//////////////////////////////////////////////////////////////////\r\nexport function processJson(appJson: AppJson) :AppJson {\r\n\r\n const views$: View[] = Object.assign([], appJson.views);\r\n appJson.views.length = 0;\r\n\r\n // loop on all views\r\n views$.forEach( view$ => {\r\n if(view$){\r\n LogLn(`[>] Processing JSON file for component ${view$.props.id}`);\r\n processControl(view$);\r\n appJson.views.push(view$);\r\n }\r\n });\r\n return appJson;\r\n}\r\n\r\nfunction CalcClassForControl(control: Control, controlClasses: string[] ){\r\n if (control.controlType != MgControlType.CTRL_TYPE_TABPAGE){\r\n\r\n if (control.controlType === MgControlType.CTRL_TYPE_BUTTON && control.props.button_style === CtrlButtonTypeGui.Image) {\r\n controlClasses.push(\"button_image_background_size\");\r\n }\r\n\r\n if (control.controlType === MgControlType.CTRL_TYPE_LABEL) {\r\n controlClasses.push(\"lable_overflow\");\r\n }\r\n\r\n\r\n if (control.controlType === MgControlType.CTRL_TYPE_COLUMN ) {\r\n controlClasses.push(\"table_row\");\r\n }\r\n\r\n if (control.controlType === MgControlType.CTRL_TYPE_TABLE){\r\n\r\n if (control.props.scroll_bar) {\r\n controlClasses.push(\"table_scrollBar\");\r\n }\r\n }\r\n\r\n if(control.controlType === MgControlType.CTRL_TYPE_TABLE || control.controlType === MgControlType.CTRL_TYPE_GROUP) {\r\n controlClasses.push(\"container_border\");\r\n }\r\n\r\n // if (control.children) {\r\n // control.children.forEach((ctrl$: Control) => {\r\n // CalcClassForControl(ctrl$, controlClasses)\r\n // });\r\n // }\r\n }\r\n}\r\n///////////////////////////////////////////////////////////////////////////////////////////////////\r\n// for each special chars we will add \"\\\" before the special char.\r\n// For example : control name \"Blabla?\" the class name will be \"Blabla\\?\"\r\n///////////////////////////////////////////////////////////////////////////////////////////////////\r\nfunction getControlClassNameInCss(controlNameStr: string): string {\r\n var controlName = controlNameStr;\r\n\r\n //The following chars are created problem in css = [\"!\" \",\" \"+\", \":\", \",\", \"~\", \";\", \"\\\"\" \"{\" \"}\" \">\" \" \"];\r\n //TODO:need to be check with Rotem let specialCharsForRotem = [\"!\"];\r\n\r\n // replace all special chars\r\n let specialCharsWork = [\"\\\\\", \"#\", \"$\", \"%\", \"&\", \"(\", \")\", \"*\", \"-\", \".\", \"/\", \"<\", \"=\", \"?\", \"@\", \"[\", \"]\", \"^\", \"`\", \"|\"];\r\n for (let i = 0; i < specialCharsWork.length; i++) {\r\n controlName = controlName.split(specialCharsWork[i]).join(\"\\\\\" + specialCharsWork[i]);\r\n }\r\n\r\n return controlName;\r\n}\r\n\r\n//////////////////////////////////////////////////////////////////\r\n// recursively process the controls' properties, find the classes used for the control\r\n//////////////////////////////////////////////////////////////////\r\nfunction processControl(control: Control) {\r\n\r\n const categoryNames: string[] = Object.keys(Map);\r\n\r\n //LogLn(\">> Generating CSS class list for \\\"\" + control.props.id + \"\\\"\");\r\n\r\n const controlClasses: string[] = [];\r\n\r\n // use the control's id as a class\r\n //control[\"class_name_in_css\"] = getControlClassNameInCss(control.props.id);\r\n //controlClasses.push(control.props.id + \"Props\");\r\n CalcClassForControl(control, controlClasses);\r\n\r\n // loop on all item names from the \"Map\" object\r\n categoryNames.forEach((catName) => {\r\n let catRuleArray: { name: string, suffix?: string, options?: { [val: string]: string } }[] = Map[catName];\r\n\r\n catRuleArray.forEach((rule, i) => {\r\n\r\n let ruleSet$;\r\n if (control[catName]) {\r\n ruleSet$ = control[catName][rule.name];\r\n }\r\n else {\r\n return;\r\n }\r\n if (isNullOrUndefined(ruleSet$)) return;\r\n\r\n // ... or turn on the has-expession flag\r\n if (!isNullOrUndefined(ruleSet$.has_exp) && ruleSet$.has_exp) {\r\n control.hasClassExpression = true;\r\n }\r\n // find and keep the class name...\r\n else {\r\n if (Map[catName] && Map[catName][i] && Map[catName][i] && Map[catName][i]['options']) {\r\n if (!isNullOrUndefined(Map[catName][i]['options'][String(ruleSet$)]))\r\n controlClasses.push(Map[catName][i]['options'][String(ruleSet$)]);\r\n }\r\n else {\r\n controlClasses.push(Map[catName] && Map[catName][i] && Map[catName][i] && Map[catName][i]['suffix'] + ruleSet$);\r\n }\r\n }\r\n\r\n });\r\n\r\n control.classes = controlClasses.join(' ');\r\n });\r\n\r\n //LogLn(\"generated classes \\\"\" + control.classes + \"\\\"\");\r\n\r\n // go over control's children\r\n if (control.children) {\r\n //LogLn(\"processing child controls...\");\r\n control.children.forEach((ctrl$: Control) => {\r\n processControl(ctrl$)\r\n });\r\n //LogLn(\"...children processing done\")\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {AppJson, View,Control} from '../../types/index';
|
|
2
|
-
import {LogLn,}
|
|
3
|
-
import { isNullOrUndefined } from "util";
|
|
2
|
+
import {LogLn, isNullOrUndefined} from "./Util";
|
|
4
3
|
import { MgControlType, CtrlButtonTypeGui } from "../../../src/types/enums/Enums";
|
|
5
4
|
|
|
6
5
|
// mapping for properties which are implemented using a class
|
|
@@ -11,7 +11,6 @@ const ast_1 = require("../../utils/ast");
|
|
|
11
11
|
const route_utils_1 = require("../../utils/devkit-utils/route-utils");
|
|
12
12
|
const ast_utils_1 = require("../../utils/devkit-utils/ast-utils");
|
|
13
13
|
const Util_1 = require("../Util");
|
|
14
|
-
const util_1 = require("util");
|
|
15
14
|
let existCmpListSet;
|
|
16
15
|
let newCmpListSet = new Set();
|
|
17
16
|
let toAddImports = true;
|
|
@@ -57,7 +56,7 @@ function addLazyLoadComponentList(options, module_name, loadOnDemand) {
|
|
|
57
56
|
let cmpListTs = getLazyLoadCompoenentsInfo(cmpListSource, env_1.GEN_LAZY_LOAD_MODULES_ARRAY);
|
|
58
57
|
let sourceStep1 = host.read(cmpListPath).toString("utf-8");
|
|
59
58
|
env_1.env.app.views.forEach(view => {
|
|
60
|
-
if ((0,
|
|
59
|
+
if ((0, Util_1.isNullOrUndefined)(cmpListTs.components) || !(cmpListTs.components.includes(view.props.component_uniquename))) {
|
|
61
60
|
lazyLoadedComponents.push(view); // if component does not exist add it to list
|
|
62
61
|
(0, Util_1.LogLn)(`[>] Add ${view.props.component_uniquename} component to LazyLoadModulesMap`);
|
|
63
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-list.rule.js","sourceRoot":"","sources":["component-list.rule.ts"],"names":[],"mappings":";;AAqBA,4CAYC;AAjCD,iCAAiC;AACjC,2BAA2B;AAC3B,2DAAoG;AACpG,gCAAmG;AAEnG,0CAAoF;AACpF,mDAAyC;AACzC,yCAA8C;AAC9C,sEAAiF;AAEjF,kEAA6D;AAC7D,kCAA8B;AAC9B,+BAAuC;AAGvC,IAAI,eAA4B,CAAC;AACjC,IAAI,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AAC9B,IAAI,YAAY,GAAY,IAAI,CAAC;AACjC,IAAI,aAAa,GAAG,SAAG,CAAC,WAAW,CAAC;AAGpC,SAAgB,gBAAgB,CAAC,OAA0B,EAAE,WAAmB,EAAE,YAAqB;IACrG,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,IAAA,YAAK,EAAC,8BAA8B,CAAC,CAAC;QACtC,OAAO,IAAA,kBAAK,EAAC;YACX,2BAA2B,CAAC,OAAO,EAA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CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE7C,sBAAsB;IACtB,IAAI,iBAAiB,GAAG,SAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAE9E,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC;;;SAGvB,EAAE,EAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAC,CAAC,CAAC;IAE1F,IAAI,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;IACpE,gBAAgB;IAChB,OAAO,GAAG,MAAM,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC;AACxC,CAAC;AAED,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import * as ts from 'typescript';\r\nimport * as EJS from \"ejs\";\r\nimport {chain, Rule, SchematicContext, SchematicsException, Tree} from \"@angular-devkit/schematics\";\r\nimport {env, GEN_COMPONENTS_ARRAY, GEN_COMPONENTS_HASH, GEN_LAZY_LOAD_MODULES_ARRAY} from \"../env\";\r\nimport {MagicOptionScheme} from \"./magic-option.scheme\";\r\nimport {GeneratedFileTypes, TemplateConfig, View, WindowType} from \"../../../types\";\r\nimport {generate} from \"./generate.rule\";\r\nimport {getSourceFile} from \"../../utils/ast\";\r\nimport {insertImport, insertImport2} from \"../../utils/devkit-utils/route-utils\";\r\nimport {InsertChange} from \"../../utils/devkit-utils/change\";\r\nimport {findNodes} from \"../../utils/devkit-utils/ast-utils\";\r\nimport {LogLn} from \"../Util\";\r\nimport {isNullOrUndefined} from \"util\";\r\n\r\n\r\nlet existCmpListSet: Set<string>;\r\nlet newCmpListSet = new Set();\r\nlet toAddImports: boolean = true;\r\nlet orgPreventLog = env.prevent_log;\r\n\r\n\r\nexport function componentlistGen(options: MagicOptionScheme, module_name: string, loadOnDemand: boolean): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n LogLn(`[>] Step 4: components-list.`);\r\n return chain([\r\n addNewCmpsToCmpListOrGenAll(options, module_name),\r\n addCmpsImportsToCmpList(options, module_name),\r\n createLazyModuleMap(options, module_name),\r\n addLazyLoadComponentList(options, module_name, loadOnDemand),\r\n addLazyModuleToMagicGen(options),\r\n addImportForLazyModule(options)\r\n ])(host, context);\r\n }\r\n}\r\n\r\n// create the lazy load map if it does not exist\r\nfunction createLazyModuleMap(options: MagicOptionScheme, module_name: string) {\r\n return (host: Tree, context: SchematicContext) => {\r\n const cmpListPath = env.metadata.paths.componentListPath(\"\");\r\n env.prevent_log = false;\r\n const source = host.read(cmpListPath).toString(\"utf-8\")\r\n\r\n const LazyModuleArrayStart = 'export const ' + GEN_LAZY_LOAD_MODULES_ARRAY + ' = {';\r\n const LazyMOduleArrayEnd = '};';\r\n // create lazy load component array if it does not exist\r\n if (source.indexOf(LazyModuleArrayStart) < 0) {\r\n LogLn(`[>] Creating LazyLoadModulesMap `);\r\n // add the code of creating map in file\r\n host.overwrite(cmpListPath, source + \"\\r\\n\" + LazyModuleArrayStart + LazyMOduleArrayEnd);\r\n }\r\n\r\n }\r\n}\r\n\r\n// add the lazy load components\r\nfunction addLazyLoadComponentList(options: MagicOptionScheme, module_name: string, loadOnDemand: boolean): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n if (loadOnDemand) {\r\n let lazyLoadedComponents: Array<View> = new Array<View>();\r\n const cmpListPath = env.metadata.paths.componentListPath(\"\");\r\n\r\n const source = host.read(cmpListPath);\r\n if (source) {\r\n let cmpListSource = getSourceFile(host, cmpListPath);\r\n\r\n let cmpListTs = getLazyLoadCompoenentsInfo(cmpListSource, GEN_LAZY_LOAD_MODULES_ARRAY);\r\n let sourceStep1 = host.read(cmpListPath).toString(\"utf-8\");\r\n\r\n env.app.views.forEach(view => {\r\n if( isNullOrUndefined(cmpListTs.components) || !(cmpListTs.components.includes(view.props.component_uniquename))) {\r\n lazyLoadedComponents.push(view); // if component does not exist add it to list\r\n LogLn(`[>] Add ${view.props.component_uniquename} component to LazyLoadModulesMap`, );\r\n }\r\n });\r\n\r\n // add components to map\r\n if (lazyLoadedComponents.length > 0) {\r\n let sourceStep2 = addComponentsToLazyLoad(sourceStep1, cmpListTs, lazyLoadedComponents, module_name);\r\n host.overwrite(cmpListPath, sourceStep2);\r\n }\r\n }\r\n env.prevent_log = orgPreventLog;\r\n }\r\n return host;\r\n }\r\n}\r\n\r\nfunction addImportForLazyModule(options) {\r\n return (tree: Tree, context: SchematicContext) => {\r\n\r\n let genLibPath= env.metadata.paths.rootMagicGenFolder + '/magic/magic.gen.lib.module.ts';\r\n const recorder = tree.beginUpdate(genLibPath);\r\n let genLibSource = getSourceFile(tree, genLibPath);\r\n\r\n const importChange = insertImport(genLibSource, genLibPath, GEN_LAZY_LOAD_MODULES_ARRAY, './component-list.g') as InsertChange;\r\n if (importChange.toAdd) {\r\n recorder.insertLeft(importChange.pos, importChange.toAdd);\r\n }\r\n tree.commitUpdate(recorder);\r\n }\r\n}\r\n\r\n// add the lazy load module to magic.gen.lib\r\nfunction addLazyModuleToMagicGen(options) {\r\n return (tree: Tree, context: SchematicContext) => {\r\n\r\n let origModuleFileName= env.metadata.paths.rootMagicGenFolder + '/magic/magic.gen.lib.module.ts';\r\n if(!tree.exists(origModuleFileName)){\r\n LogLn(` [>Error] File cannot be overwrite, The file is not exist !!! : ${origModuleFileName}`);\r\n }\r\n const text = tree.read(origModuleFileName);\r\n\r\n if (text === null) {\r\n throw new SchematicsException(`File ${origModuleFileName} does not exist.`);\r\n }\r\n let sourceText = text.toString('utf-8');\r\n const lazyModuleStatement = '\\r\\n componentList.lazyLoadModulesMap = '+ GEN_LAZY_LOAD_MODULES_ARRAY+';';\r\n if (sourceText !== \"\" && sourceText.indexOf(lazyModuleStatement)== -1) {\r\n let genLibSource = getSourceFile(tree, origModuleFileName);\r\n let newLazyModuleText: string = sourceText.replace(lazyModuleStatement, '').trim();\r\n const constNode: ts.FunctionLikeDeclarationBase = findNodes(genLibSource, ts.SyntaxKind.Constructor)[0] as ts.FunctionLikeDeclarationBase;\r\n\r\n let lastStatementEnd = (<ts.Block>constNode.body).statements.end;\r\n\r\n const prefix = sourceText.substring(0, lastStatementEnd);\r\n const suffix = sourceText.substring(lastStatementEnd );\r\n tree.overwrite(origModuleFileName, `${prefix} ${lazyModuleStatement} ${suffix}` );\r\n\r\n }\r\n return tree;\r\n }\r\n}\r\n\r\n/*\r\n* Add new component to component-list.g file (Array and Hash).\r\n* If the file not exist new file will create by componentListGenIfNotExist function.\r\n* */\r\nfunction addNewCmpsToCmpListOrGenAll(options: MagicOptionScheme, module_name: string): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n const metadata = env.metadata;\r\n const cmpsToGen = env.app.views;\r\n const cmpListPath = env.metadata.paths.componentListPath(module_name);\r\n const source = host.read(cmpListPath);\r\n if (source) {\r\n let cmpToGenNum = 0;\r\n let sourceStep1 = source.toString(\"utf-8\");\r\n let cmpListSource = getSourceFile(host, cmpListPath);\r\n\r\n let cmpListTs = getComponentsArrayInfo(cmpListSource, GEN_COMPONENTS_ARRAY);\r\n existCmpListSet = new Set(cmpListTs.components);\r\n newCmpListSet = new Set<string>();\r\n\r\n // merge between components in the file and new component to gen\r\n cmpsToGen.forEach(newCmpGen => {\r\n if (!existCmpListSet.has(newCmpGen.props.component_uniquename)) {\r\n newCmpListSet.add(newCmpGen.props.component_uniquename);\r\n }\r\n });\r\n const newCmpListArray: string[] = <string[]>Array.from(newCmpListSet);\r\n if (newCmpListArray && newCmpListArray.length > 0) {\r\n let sourceStep2 = addComponentsToArray(sourceStep1, cmpListTs, newCmpListArray);\r\n\r\n let cmpListHashTs = getComponentsHashInfo(cmpListSource, GEN_COMPONENTS_HASH);\r\n let sourceStep3 = addComponentsToHash(sourceStep2, cmpListHashTs, newCmpListArray);\r\n\r\n LogLn(` Total old components: ${existCmpListSet.size}, added components: ${newCmpListSet.size}. `);\r\n\r\n host.overwrite(cmpListPath, sourceStep3);\r\n }\r\n } else {\r\n // If component-list.g.ts doesn't exist.\r\n toAddImports = false; // We generate the entire file with imports.\r\n return componentListGenIfNotExist(options)(host, context);\r\n }\r\n\r\n return host;\r\n }\r\n}\r\n\r\n/*\r\n* Create new component-list.g file.\r\n* */\r\nfunction componentListGenIfNotExist(options: MagicOptionScheme): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n\r\n console.log(\"creating component-list\");\r\n const metadata = env.metadata;\r\n const cmpList = new Set<string>();\r\n const data: any = {\r\n app: env.app,\r\n cmpList: env.app.views\r\n };\r\n\r\n const componentFile: TemplateConfig = {\r\n template: `./templates/angular/src/app/component-list.g.ts`,\r\n name: 'component-list.g.ts',\r\n destination: metadata.paths.magicGenFolderPath,\r\n type: GeneratedFileTypes.TS,\r\n data: data\r\n };\r\n\r\n return chain([\r\n generate(componentFile, options)\r\n ])(host, context);\r\n }\r\n}\r\n\r\n/*\r\n* Add new imports to component-list.g file.\r\n* */\r\nfunction addCmpsImportsToCmpList(options: MagicOptionScheme, module_name: string): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n if (toAddImports) {\r\n const cmpsToGen = env.app.views;\r\n let cmpListSource = getSourceFile(host, env.metadata.paths.componentListPath(module_name));\r\n\r\n const recorder = host.beginUpdate(env.metadata.paths.componentListPath(module_name));\r\n\r\n cmpsToGen.forEach(cmp => {\r\n let name = cmp.props.id;\r\n let uniqueName = cmp.props.component_uniquename;\r\n let cmpPath = cmp.props.component_path;\r\n\r\n if (newCmpListSet.has(uniqueName)) {\r\n const importsChange =\r\n insertImport2(\r\n cmpListSource,\r\n env.metadata.paths.componentListPath(module_name),\r\n name,\r\n uniqueName,\r\n `./${cmpPath}${name}.component`\r\n ) as InsertChange;\r\n\r\n if (importsChange.toAdd) {\r\n recorder.insertLeft(importsChange.pos, importsChange.toAdd);\r\n }\r\n }\r\n });\r\n\r\n host.commitUpdate(recorder);\r\n }\r\n return host;\r\n }\r\n}\r\n\r\n\r\n// //-------------------------------------------------------------------------------------------------\r\n// //\r\n// //-------------------------------------------------------------------------------------------------\r\n// function checkIfTheComponentNeedToBeRemoveFromGeneralMagicModule\r\n// (options: MagicOptionScheme, modulePath:string, moduleName:string, srcModuleName:string) : Rule {\r\n// return (tree: Tree , context : SchematicContext)=>{\r\n// const project = env.project;\r\n//\r\n// if (env.metadata.paths.generateCompForModuleName != \"\") {\r\n// LogLn(` [>] checking component name [${moduleName}]\r\n// from ${srcModuleName}]\r\n// To App Module : [${modulePath}]`);\r\n// const moduleSourceFile = getSourceFile(tree, modulePath);\r\n// if (isImported(moduleSourceFile, moduleName, srcModuleName)) {\r\n//\r\n// }\r\n// }\r\n//\r\n// return tree;\r\n// }\r\n// }\r\n\r\n/**************************\r\n * Helper Functions\r\n ***************************/\r\n\r\ninterface IComponentListParser {\r\n components: string[];\r\n endPos: number;\r\n isEmpty: boolean;\r\n}\r\n\r\nfunction getComponentsHashInfo(source: ts.SourceFile, variable: string): IComponentListParser {\r\n\r\n const rootNode = source;\r\n const cmpListVars: ts.Node[] = findNodes(rootNode, ts.SyntaxKind.VariableDeclaration);\r\n let endPos = -1;\r\n let isEmpty = true;\r\n\r\n let magicGenCmpsInfo = cmpListVars.filter(\r\n (node: any) => node.name.escapedText === variable);\r\n\r\n if (magicGenCmpsInfo && magicGenCmpsInfo.length > 0) {\r\n const firstPunctuation: ts.Node[] = findNodes(magicGenCmpsInfo[0], ts.SyntaxKind.FirstPunctuation);\r\n if (!(firstPunctuation && firstPunctuation.length > 0)) {\r\n throw new Error('magicGenCmpsHash variable has no open bracket ( { )');\r\n }\r\n endPos = firstPunctuation[0].end;\r\n const propertyAssignment = findNodes(firstPunctuation[0].parent, ts.SyntaxKind.PropertyAssignment);\r\n if (propertyAssignment && propertyAssignment.length > 0) {\r\n isEmpty = false;\r\n }\r\n }\r\n return {\r\n components: null,\r\n endPos,\r\n isEmpty\r\n };\r\n}\r\n\r\nfunction getComponentsArrayInfo(source: ts.SourceFile, variable: string): IComponentListParser {\r\n\r\n const rootNode = source;\r\n const cmpListVars: ts.Node[] = findNodes(rootNode, ts.SyntaxKind.VariableDeclaration);\r\n let endPos = -1;\r\n let cmpListArray;\r\n let isEmpty = true;\r\n let magicGenCmpsInfo = cmpListVars.filter(\r\n (node: any) => node.name.escapedText === variable);\r\n\r\n if (magicGenCmpsInfo && magicGenCmpsInfo.length > 0) {\r\n const openBracketToken: ts.Node[] = findNodes(magicGenCmpsInfo[0], ts.SyntaxKind.OpenBracketToken);\r\n if (!(openBracketToken && openBracketToken.length > 0)) {\r\n throw new Error('magicGenComponents variable has no open bracket ([)');\r\n }\r\n endPos = openBracketToken[0].end;\r\n const identifiers = findNodes(openBracketToken[0].parent, ts.SyntaxKind.Identifier);\r\n\r\n\r\n // Array with items\r\n if (identifiers && identifiers.length > 0) {\r\n isEmpty = false;\r\n //endPos = identifiers[identifiers.length - 1].end;\r\n cmpListArray = identifiers.map((i: any) => i.escapedText) as string[];\r\n }\r\n // Array with no items\r\n // else{\r\n // endPos = openBracketToken[0].end;\r\n // }\r\n }\r\n return {\r\n components: cmpListArray,\r\n endPos,\r\n isEmpty\r\n };\r\n}\r\n\r\n\r\nfunction getLazyLoadCompoenentsInfo(source: ts.SourceFile, variable: string): IComponentListParser {\r\n\r\n const cmpListVars: ts.Node[] = findNodes(source, ts.SyntaxKind.VariableDeclaration);\r\n let endPos = -1;\r\n let cmpListArray;\r\n let isEmpty = true;\r\n let magicGenCmpsInfo = cmpListVars.filter(\r\n (node: any) => node.name.escapedText === variable);\r\n\r\n if (magicGenCmpsInfo && magicGenCmpsInfo.length > 0) {\r\n const openBracketToken: ts.Node[] = findNodes(magicGenCmpsInfo[0], ts.SyntaxKind.FirstPunctuation);\r\n if (!(openBracketToken && openBracketToken.length > 0)) {\r\n throw new Error('FirstPunctuation variable has no open bracket ([)');\r\n }\r\n endPos = openBracketToken[0].end;\r\n const identifiers = findNodes(openBracketToken[0].parent, ts.SyntaxKind.PropertyAssignment);\r\n const identifiers1 = findNodes(openBracketToken[0].parent, ts.SyntaxKind.Identifier);\r\n\r\n // Array with items\r\n if (identifiers && identifiers.length > 0) {\r\n isEmpty = false;\r\n cmpListArray = identifiers.map((i: any) => i.name.escapedText ).filter(id => id !== \"moduleName\" && id !== \"modulePath\");\r\n }\r\n }\r\n return {\r\n components: cmpListArray,\r\n endPos,\r\n isEmpty\r\n };\r\n}\r\n\r\nfunction addComponentsToArray(source: string, info: IComponentListParser, cmpsToAdd: string[]): string {\r\n const prefix = source.substring(0, info.endPos);\r\n const suffix = source.substring(info.endPos);\r\n let toAdd = `${cmpsToAdd}`;\r\n toAdd = `${toAdd.replace(/,/g, \",\\n\\t\")}`;\r\n\r\n return info.isEmpty ?\r\n`${prefix}\r\n\\t${toAdd} ${suffix}` :\r\n`${prefix}\r\n\\t${toAdd},${suffix}` ;\r\n}\r\n\r\nfunction addComponentsToHash(source: string, info: IComponentListParser, cmpsToAdd: string[]): string {\r\n const prefix = source.substring(0, info.endPos);\r\n const suffix = source.substring(info.endPos);\r\n const cmpHashStr = EJS.render(`\r\n <% components.forEach(componentUniqueName => { %>\r\n <%= componentUniqueName %>:<%- componentUniqueName %>,\r\n <%})%>`, {components: cmpsToAdd});\r\n let toAdd = `${cmpHashStr.replace(/\\n/g, '').replace(/,/g, \",\\n\")}`;\r\n // update source\r\n return `${prefix} ${toAdd} ${suffix}`;\r\n /*return info.isEmpty ?\r\n `${prefix} ${delLastComma(cmpHashStr)} ${suffix}` :\r\n `${prefix} ${delLastComma(cmpHashStr)}, ${suffix}` ;*/\r\n}\r\n\r\n// add the lazy loaded components to map\r\nfunction addComponentsToLazyLoad(source: string, info: IComponentListParser, cmpsToAdd: View[], module_name: string): string {\r\n const prefix = source.substring(0, info.endPos);\r\n const suffix = source.substring(info.endPos);\r\n\r\n // get the module path\r\n let currentModulePath = env.metadata.paths.magicGenLibModulePath(module_name);\r\n\r\n const cmpHashStr = EJS.render(`\r\n<%{components.forEach(view =>{-%>\r\n<%=view.props.component_uniquename %> : { moduleName : 'Magic<%=moduleName%>Module'},\r\n<%})}-%>`, {components: cmpsToAdd, moduleName: module_name, modulePath: currentModulePath});\r\n\r\n let toAdd = `${cmpHashStr.replace(/\\n/g, '').replace(/,/g, \",\\n\")}`;\r\n // update source\r\n return `${prefix} ${toAdd} ${suffix}`;\r\n}\r\n\r\nfunction delLastComma(source: string) {\r\n let index = source.lastIndexOf(',');\r\n return source.substring(0, index);\r\n}\r\n\r\n\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"component-list.rule.js","sourceRoot":"","sources":["component-list.rule.ts"],"names":[],"mappings":";;AAoBA,4CAYC;AAhCD,iCAAiC;AACjC,2BAA2B;AAC3B,2DAAoG;AACpG,gCAAmG;AAEnG,0CAAoF;AACpF,mDAAyC;AACzC,yCAA8C;AAC9C,sEAAiF;AAEjF,kEAA6D;AAC7D,kCAAiD;AAGjD,IAAI,eAA4B,CAAC;AACjC,IAAI,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AAC9B,IAAI,YAAY,GAAY,IAAI,CAAC;AACjC,IAAI,aAAa,GAAG,SAAG,CAAC,WAAW,CAAC;AAGpC,SAAgB,gBAAgB,CAAC,OAA0B,EAAE,WAAmB,EAAE,YAAqB;IACrG,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,IAAA,YAAK,EAAC,8BAA8B,CAAC,CAAC;QACtC,OAAO,IAAA,kBAAK,EAAC;YACX,2BAA2B,CAAC,OAAO,EAAE,WAAW,CAAC;YACjD,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC;YAC7C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,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE7C,sBAAsB;IACtB,IAAI,iBAAiB,GAAG,SAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAE9E,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC;;;SAGvB,EAAE,EAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAC,CAAC,CAAC;IAE1F,IAAI,KAAK,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;IACpE,gBAAgB;IAChB,OAAO,GAAG,MAAM,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC;AACxC,CAAC;AAED,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import * as ts from 'typescript';\r\nimport * as EJS from \"ejs\";\r\nimport {chain, Rule, SchematicContext, SchematicsException, Tree} from \"@angular-devkit/schematics\";\r\nimport {env, GEN_COMPONENTS_ARRAY, GEN_COMPONENTS_HASH, GEN_LAZY_LOAD_MODULES_ARRAY} from \"../env\";\r\nimport {MagicOptionScheme} from \"./magic-option.scheme\";\r\nimport {GeneratedFileTypes, TemplateConfig, View, WindowType} from \"../../../types\";\r\nimport {generate} from \"./generate.rule\";\r\nimport {getSourceFile} from \"../../utils/ast\";\r\nimport {insertImport, insertImport2} from \"../../utils/devkit-utils/route-utils\";\r\nimport {InsertChange} from \"../../utils/devkit-utils/change\";\r\nimport {findNodes} from \"../../utils/devkit-utils/ast-utils\";\r\nimport {LogLn, isNullOrUndefined} from \"../Util\";\r\n\r\n\r\nlet existCmpListSet: Set<string>;\r\nlet newCmpListSet = new Set();\r\nlet toAddImports: boolean = true;\r\nlet orgPreventLog = env.prevent_log;\r\n\r\n\r\nexport function componentlistGen(options: MagicOptionScheme, module_name: string, loadOnDemand: boolean): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n LogLn(`[>] Step 4: components-list.`);\r\n return chain([\r\n addNewCmpsToCmpListOrGenAll(options, module_name),\r\n addCmpsImportsToCmpList(options, module_name),\r\n createLazyModuleMap(options, module_name),\r\n addLazyLoadComponentList(options, module_name, loadOnDemand),\r\n addLazyModuleToMagicGen(options),\r\n addImportForLazyModule(options)\r\n ])(host, context);\r\n }\r\n}\r\n\r\n// create the lazy load map if it does not exist\r\nfunction createLazyModuleMap(options: MagicOptionScheme, module_name: string) {\r\n return (host: Tree, context: SchematicContext) => {\r\n const cmpListPath = env.metadata.paths.componentListPath(\"\");\r\n env.prevent_log = false;\r\n const source = host.read(cmpListPath).toString(\"utf-8\")\r\n\r\n const LazyModuleArrayStart = 'export const ' + GEN_LAZY_LOAD_MODULES_ARRAY + ' = {';\r\n const LazyMOduleArrayEnd = '};';\r\n // create lazy load component array if it does not exist\r\n if (source.indexOf(LazyModuleArrayStart) < 0) {\r\n LogLn(`[>] Creating LazyLoadModulesMap `);\r\n // add the code of creating map in file\r\n host.overwrite(cmpListPath, source + \"\\r\\n\" + LazyModuleArrayStart + LazyMOduleArrayEnd);\r\n }\r\n\r\n }\r\n}\r\n\r\n// add the lazy load components\r\nfunction addLazyLoadComponentList(options: MagicOptionScheme, module_name: string, loadOnDemand: boolean): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n if (loadOnDemand) {\r\n let lazyLoadedComponents: Array<View> = new Array<View>();\r\n const cmpListPath = env.metadata.paths.componentListPath(\"\");\r\n\r\n const source = host.read(cmpListPath);\r\n if (source) {\r\n let cmpListSource = getSourceFile(host, cmpListPath);\r\n\r\n let cmpListTs = getLazyLoadCompoenentsInfo(cmpListSource, GEN_LAZY_LOAD_MODULES_ARRAY);\r\n let sourceStep1 = host.read(cmpListPath).toString(\"utf-8\");\r\n\r\n env.app.views.forEach(view => {\r\n if( isNullOrUndefined(cmpListTs.components) || !(cmpListTs.components.includes(view.props.component_uniquename))) {\r\n lazyLoadedComponents.push(view); // if component does not exist add it to list\r\n LogLn(`[>] Add ${view.props.component_uniquename} component to LazyLoadModulesMap`, );\r\n }\r\n });\r\n\r\n // add components to map\r\n if (lazyLoadedComponents.length > 0) {\r\n let sourceStep2 = addComponentsToLazyLoad(sourceStep1, cmpListTs, lazyLoadedComponents, module_name);\r\n host.overwrite(cmpListPath, sourceStep2);\r\n }\r\n }\r\n env.prevent_log = orgPreventLog;\r\n }\r\n return host;\r\n }\r\n}\r\n\r\nfunction addImportForLazyModule(options) {\r\n return (tree: Tree, context: SchematicContext) => {\r\n\r\n let genLibPath= env.metadata.paths.rootMagicGenFolder + '/magic/magic.gen.lib.module.ts';\r\n const recorder = tree.beginUpdate(genLibPath);\r\n let genLibSource = getSourceFile(tree, genLibPath);\r\n\r\n const importChange = insertImport(genLibSource, genLibPath, GEN_LAZY_LOAD_MODULES_ARRAY, './component-list.g') as InsertChange;\r\n if (importChange.toAdd) {\r\n recorder.insertLeft(importChange.pos, importChange.toAdd);\r\n }\r\n tree.commitUpdate(recorder);\r\n }\r\n}\r\n\r\n// add the lazy load module to magic.gen.lib\r\nfunction addLazyModuleToMagicGen(options) {\r\n return (tree: Tree, context: SchematicContext) => {\r\n\r\n let origModuleFileName= env.metadata.paths.rootMagicGenFolder + '/magic/magic.gen.lib.module.ts';\r\n if(!tree.exists(origModuleFileName)){\r\n LogLn(` [>Error] File cannot be overwrite, The file is not exist !!! : ${origModuleFileName}`);\r\n }\r\n const text = tree.read(origModuleFileName);\r\n\r\n if (text === null) {\r\n throw new SchematicsException(`File ${origModuleFileName} does not exist.`);\r\n }\r\n let sourceText = text.toString('utf-8');\r\n const lazyModuleStatement = '\\r\\n componentList.lazyLoadModulesMap = '+ GEN_LAZY_LOAD_MODULES_ARRAY+';';\r\n if (sourceText !== \"\" && sourceText.indexOf(lazyModuleStatement)== -1) {\r\n let genLibSource = getSourceFile(tree, origModuleFileName);\r\n let newLazyModuleText: string = sourceText.replace(lazyModuleStatement, '').trim();\r\n const constNode: ts.FunctionLikeDeclarationBase = findNodes(genLibSource, ts.SyntaxKind.Constructor)[0] as ts.FunctionLikeDeclarationBase;\r\n\r\n let lastStatementEnd = (<ts.Block>constNode.body).statements.end;\r\n\r\n const prefix = sourceText.substring(0, lastStatementEnd);\r\n const suffix = sourceText.substring(lastStatementEnd );\r\n tree.overwrite(origModuleFileName, `${prefix} ${lazyModuleStatement} ${suffix}` );\r\n\r\n }\r\n return tree;\r\n }\r\n}\r\n\r\n/*\r\n* Add new component to component-list.g file (Array and Hash).\r\n* If the file not exist new file will create by componentListGenIfNotExist function.\r\n* */\r\nfunction addNewCmpsToCmpListOrGenAll(options: MagicOptionScheme, module_name: string): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n const metadata = env.metadata;\r\n const cmpsToGen = env.app.views;\r\n const cmpListPath = env.metadata.paths.componentListPath(module_name);\r\n const source = host.read(cmpListPath);\r\n if (source) {\r\n let cmpToGenNum = 0;\r\n let sourceStep1 = source.toString(\"utf-8\");\r\n let cmpListSource = getSourceFile(host, cmpListPath);\r\n\r\n let cmpListTs = getComponentsArrayInfo(cmpListSource, GEN_COMPONENTS_ARRAY);\r\n existCmpListSet = new Set(cmpListTs.components);\r\n newCmpListSet = new Set<string>();\r\n\r\n // merge between components in the file and new component to gen\r\n cmpsToGen.forEach(newCmpGen => {\r\n if (!existCmpListSet.has(newCmpGen.props.component_uniquename)) {\r\n newCmpListSet.add(newCmpGen.props.component_uniquename);\r\n }\r\n });\r\n const newCmpListArray: string[] = <string[]>Array.from(newCmpListSet);\r\n if (newCmpListArray && newCmpListArray.length > 0) {\r\n let sourceStep2 = addComponentsToArray(sourceStep1, cmpListTs, newCmpListArray);\r\n\r\n let cmpListHashTs = getComponentsHashInfo(cmpListSource, GEN_COMPONENTS_HASH);\r\n let sourceStep3 = addComponentsToHash(sourceStep2, cmpListHashTs, newCmpListArray);\r\n\r\n LogLn(` Total old components: ${existCmpListSet.size}, added components: ${newCmpListSet.size}. `);\r\n\r\n host.overwrite(cmpListPath, sourceStep3);\r\n }\r\n } else {\r\n // If component-list.g.ts doesn't exist.\r\n toAddImports = false; // We generate the entire file with imports.\r\n return componentListGenIfNotExist(options)(host, context);\r\n }\r\n\r\n return host;\r\n }\r\n}\r\n\r\n/*\r\n* Create new component-list.g file.\r\n* */\r\nfunction componentListGenIfNotExist(options: MagicOptionScheme): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n\r\n console.log(\"creating component-list\");\r\n const metadata = env.metadata;\r\n const cmpList = new Set<string>();\r\n const data: any = {\r\n app: env.app,\r\n cmpList: env.app.views\r\n };\r\n\r\n const componentFile: TemplateConfig = {\r\n template: `./templates/angular/src/app/component-list.g.ts`,\r\n name: 'component-list.g.ts',\r\n destination: metadata.paths.magicGenFolderPath,\r\n type: GeneratedFileTypes.TS,\r\n data: data\r\n };\r\n\r\n return chain([\r\n generate(componentFile, options)\r\n ])(host, context);\r\n }\r\n}\r\n\r\n/*\r\n* Add new imports to component-list.g file.\r\n* */\r\nfunction addCmpsImportsToCmpList(options: MagicOptionScheme, module_name: string): Rule {\r\n return (host: Tree, context: SchematicContext) => {\r\n if (toAddImports) {\r\n const cmpsToGen = env.app.views;\r\n let cmpListSource = getSourceFile(host, env.metadata.paths.componentListPath(module_name));\r\n\r\n const recorder = host.beginUpdate(env.metadata.paths.componentListPath(module_name));\r\n\r\n cmpsToGen.forEach(cmp => {\r\n let name = cmp.props.id;\r\n let uniqueName = cmp.props.component_uniquename;\r\n let cmpPath = cmp.props.component_path;\r\n\r\n if (newCmpListSet.has(uniqueName)) {\r\n const importsChange =\r\n insertImport2(\r\n cmpListSource,\r\n env.metadata.paths.componentListPath(module_name),\r\n name,\r\n uniqueName,\r\n `./${cmpPath}${name}.component`\r\n ) as InsertChange;\r\n\r\n if (importsChange.toAdd) {\r\n recorder.insertLeft(importsChange.pos, importsChange.toAdd);\r\n }\r\n }\r\n });\r\n\r\n host.commitUpdate(recorder);\r\n }\r\n return host;\r\n }\r\n}\r\n\r\n\r\n// //-------------------------------------------------------------------------------------------------\r\n// //\r\n// //-------------------------------------------------------------------------------------------------\r\n// function checkIfTheComponentNeedToBeRemoveFromGeneralMagicModule\r\n// (options: MagicOptionScheme, modulePath:string, moduleName:string, srcModuleName:string) : Rule {\r\n// return (tree: Tree , context : SchematicContext)=>{\r\n// const project = env.project;\r\n//\r\n// if (env.metadata.paths.generateCompForModuleName != \"\") {\r\n// LogLn(` [>] checking component name [${moduleName}]\r\n// from ${srcModuleName}]\r\n// To App Module : [${modulePath}]`);\r\n// const moduleSourceFile = getSourceFile(tree, modulePath);\r\n// if (isImported(moduleSourceFile, moduleName, srcModuleName)) {\r\n//\r\n// }\r\n// }\r\n//\r\n// return tree;\r\n// }\r\n// }\r\n\r\n/**************************\r\n * Helper Functions\r\n ***************************/\r\n\r\ninterface IComponentListParser {\r\n components: string[];\r\n endPos: number;\r\n isEmpty: boolean;\r\n}\r\n\r\nfunction getComponentsHashInfo(source: ts.SourceFile, variable: string): IComponentListParser {\r\n\r\n const rootNode = source;\r\n const cmpListVars: ts.Node[] = findNodes(rootNode, ts.SyntaxKind.VariableDeclaration);\r\n let endPos = -1;\r\n let isEmpty = true;\r\n\r\n let magicGenCmpsInfo = cmpListVars.filter(\r\n (node: any) => node.name.escapedText === variable);\r\n\r\n if (magicGenCmpsInfo && magicGenCmpsInfo.length > 0) {\r\n const firstPunctuation: ts.Node[] = findNodes(magicGenCmpsInfo[0], ts.SyntaxKind.FirstPunctuation);\r\n if (!(firstPunctuation && firstPunctuation.length > 0)) {\r\n throw new Error('magicGenCmpsHash variable has no open bracket ( { )');\r\n }\r\n endPos = firstPunctuation[0].end;\r\n const propertyAssignment = findNodes(firstPunctuation[0].parent, ts.SyntaxKind.PropertyAssignment);\r\n if (propertyAssignment && propertyAssignment.length > 0) {\r\n isEmpty = false;\r\n }\r\n }\r\n return {\r\n components: null,\r\n endPos,\r\n isEmpty\r\n };\r\n}\r\n\r\nfunction getComponentsArrayInfo(source: ts.SourceFile, variable: string): IComponentListParser {\r\n\r\n const rootNode = source;\r\n const cmpListVars: ts.Node[] = findNodes(rootNode, ts.SyntaxKind.VariableDeclaration);\r\n let endPos = -1;\r\n let cmpListArray;\r\n let isEmpty = true;\r\n let magicGenCmpsInfo = cmpListVars.filter(\r\n (node: any) => node.name.escapedText === variable);\r\n\r\n if (magicGenCmpsInfo && magicGenCmpsInfo.length > 0) {\r\n const openBracketToken: ts.Node[] = findNodes(magicGenCmpsInfo[0], ts.SyntaxKind.OpenBracketToken);\r\n if (!(openBracketToken && openBracketToken.length > 0)) {\r\n throw new Error('magicGenComponents variable has no open bracket ([)');\r\n }\r\n endPos = openBracketToken[0].end;\r\n const identifiers = findNodes(openBracketToken[0].parent, ts.SyntaxKind.Identifier);\r\n\r\n\r\n // Array with items\r\n if (identifiers && identifiers.length > 0) {\r\n isEmpty = false;\r\n //endPos = identifiers[identifiers.length - 1].end;\r\n cmpListArray = identifiers.map((i: any) => i.escapedText) as string[];\r\n }\r\n // Array with no items\r\n // else{\r\n // endPos = openBracketToken[0].end;\r\n // }\r\n }\r\n return {\r\n components: cmpListArray,\r\n endPos,\r\n isEmpty\r\n };\r\n}\r\n\r\n\r\nfunction getLazyLoadCompoenentsInfo(source: ts.SourceFile, variable: string): IComponentListParser {\r\n\r\n const cmpListVars: ts.Node[] = findNodes(source, ts.SyntaxKind.VariableDeclaration);\r\n let endPos = -1;\r\n let cmpListArray;\r\n let isEmpty = true;\r\n let magicGenCmpsInfo = cmpListVars.filter(\r\n (node: any) => node.name.escapedText === variable);\r\n\r\n if (magicGenCmpsInfo && magicGenCmpsInfo.length > 0) {\r\n const openBracketToken: ts.Node[] = findNodes(magicGenCmpsInfo[0], ts.SyntaxKind.FirstPunctuation);\r\n if (!(openBracketToken && openBracketToken.length > 0)) {\r\n throw new Error('FirstPunctuation variable has no open bracket ([)');\r\n }\r\n endPos = openBracketToken[0].end;\r\n const identifiers = findNodes(openBracketToken[0].parent, ts.SyntaxKind.PropertyAssignment);\r\n const identifiers1 = findNodes(openBracketToken[0].parent, ts.SyntaxKind.Identifier);\r\n\r\n // Array with items\r\n if (identifiers && identifiers.length > 0) {\r\n isEmpty = false;\r\n cmpListArray = identifiers.map((i: any) => i.name.escapedText ).filter(id => id !== \"moduleName\" && id !== \"modulePath\");\r\n }\r\n }\r\n return {\r\n components: cmpListArray,\r\n endPos,\r\n isEmpty\r\n };\r\n}\r\n\r\nfunction addComponentsToArray(source: string, info: IComponentListParser, cmpsToAdd: string[]): string {\r\n const prefix = source.substring(0, info.endPos);\r\n const suffix = source.substring(info.endPos);\r\n let toAdd = `${cmpsToAdd}`;\r\n toAdd = `${toAdd.replace(/,/g, \",\\n\\t\")}`;\r\n\r\n return info.isEmpty ?\r\n`${prefix}\r\n\\t${toAdd} ${suffix}` :\r\n`${prefix}\r\n\\t${toAdd},${suffix}` ;\r\n}\r\n\r\nfunction addComponentsToHash(source: string, info: IComponentListParser, cmpsToAdd: string[]): string {\r\n const prefix = source.substring(0, info.endPos);\r\n const suffix = source.substring(info.endPos);\r\n const cmpHashStr = EJS.render(`\r\n <% components.forEach(componentUniqueName => { %>\r\n <%= componentUniqueName %>:<%- componentUniqueName %>,\r\n <%})%>`, {components: cmpsToAdd});\r\n let toAdd = `${cmpHashStr.replace(/\\n/g, '').replace(/,/g, \",\\n\")}`;\r\n // update source\r\n return `${prefix} ${toAdd} ${suffix}`;\r\n /*return info.isEmpty ?\r\n `${prefix} ${delLastComma(cmpHashStr)} ${suffix}` :\r\n `${prefix} ${delLastComma(cmpHashStr)}, ${suffix}` ;*/\r\n}\r\n\r\n// add the lazy loaded components to map\r\nfunction addComponentsToLazyLoad(source: string, info: IComponentListParser, cmpsToAdd: View[], module_name: string): string {\r\n const prefix = source.substring(0, info.endPos);\r\n const suffix = source.substring(info.endPos);\r\n\r\n // get the module path\r\n let currentModulePath = env.metadata.paths.magicGenLibModulePath(module_name);\r\n\r\n const cmpHashStr = EJS.render(`\r\n<%{components.forEach(view =>{-%>\r\n<%=view.props.component_uniquename %> : { moduleName : 'Magic<%=moduleName%>Module'},\r\n<%})}-%>`, {components: cmpsToAdd, moduleName: module_name, modulePath: currentModulePath});\r\n\r\n let toAdd = `${cmpHashStr.replace(/\\n/g, '').replace(/,/g, \",\\n\")}`;\r\n // update source\r\n return `${prefix} ${toAdd} ${suffix}`;\r\n}\r\n\r\nfunction delLastComma(source: string) {\r\n let index = source.lastIndexOf(',');\r\n return source.substring(0, index);\r\n}\r\n\r\n\r\n\r\n"]}
|
|
@@ -9,8 +9,7 @@ import {getSourceFile} from "../../utils/ast";
|
|
|
9
9
|
import {insertImport, insertImport2} from "../../utils/devkit-utils/route-utils";
|
|
10
10
|
import {InsertChange} from "../../utils/devkit-utils/change";
|
|
11
11
|
import {findNodes} from "../../utils/devkit-utils/ast-utils";
|
|
12
|
-
import {LogLn} from "../Util";
|
|
13
|
-
import {isNullOrUndefined} from "util";
|
|
12
|
+
import {LogLn, isNullOrUndefined} from "../Util";
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
let existCmpListSet: Set<string>;
|