@magic-xpa/cli 4.1300.0-dev4130.28 → 4.1300.0-dev4130.280

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.
Files changed (46) hide show
  1. package/package.json +1 -1
  2. package/src/schematics/magic-utils/Util.js +2 -1
  3. package/src/schematics/magic-utils/Util.js.map +1 -1
  4. package/src/schematics/magic-utils/env.js +14 -11
  5. package/src/schematics/magic-utils/env.js.map +1 -1
  6. package/src/schematics/magic-utils/env.ts +18 -15
  7. package/src/schematics/magic-utils/rules/build-control.rule.js +3 -2
  8. package/src/schematics/magic-utils/rules/build-control.rule.js.map +1 -1
  9. package/src/schematics/magic-utils/rules/component-list.rule.js +3 -2
  10. package/src/schematics/magic-utils/rules/component-list.rule.js.map +1 -1
  11. package/src/schematics/magic-utils/rules/generate.rule.js +3 -2
  12. package/src/schematics/magic-utils/rules/generate.rule.js.map +1 -1
  13. package/src/schematics/mg-add/files/src/app/app.routes.ts +2 -1
  14. package/src/schematics/mg-add/files/src/app/custom.routes.ts +23 -0
  15. package/src/schematics/mg-add/files/src/app/magic/magic.gen.lib.module.ts +6 -7
  16. package/src/schematics/mg-add/index.js +9 -74
  17. package/src/schematics/mg-add/index.js.map +1 -1
  18. package/src/schematics/mg-add/index.ts +11 -87
  19. package/src/schematics/mg-add/webModule/app.routes.ts +2 -1
  20. package/src/schematics/mg-add/webModule/custom.routes.ts +23 -0
  21. package/src/schematics/mg-routes/index.js +13 -4
  22. package/src/schematics/mg-routes/index.js.map +1 -1
  23. package/src/schematics/mg-routes/index.ts +16 -5
  24. package/src/schematics/utils/ast.js +2 -1
  25. package/src/schematics/utils/ast.js.map +1 -1
  26. package/src/schematics/utils/devkit-utils/ast-utils.js +2 -1
  27. package/src/schematics/utils/devkit-utils/ast-utils.js.map +1 -1
  28. package/src/schematics/utils/devkit-utils/ast-utils_old.js +2 -1
  29. package/src/schematics/utils/devkit-utils/ast-utils_old.js.map +1 -1
  30. package/src/schematics/utils/devkit-utils/component.js +2 -1
  31. package/src/schematics/utils/devkit-utils/component.js.map +1 -1
  32. package/src/schematics/utils/devkit-utils/ng-ast-utils.js +2 -1
  33. package/src/schematics/utils/devkit-utils/ng-ast-utils.js.map +1 -1
  34. package/src/schematics/utils/devkit-utils/route-utils.js +2 -1
  35. package/src/schematics/utils/devkit-utils/route-utils.js.map +1 -1
  36. package/src/schematics/utils/html.js +2 -1
  37. package/src/schematics/utils/html.js.map +1 -1
  38. package/templates/angular/src/app.routes.ts +2 -0
  39. package/templates/angular/src/custom.routes.ts +23 -0
  40. package/templates/component/view.component.ts +5 -56
  41. package/templates/themes/basicHTML/edit.ejs +1 -1
  42. package/templates/themes/basicHTML/radio.ejs +22 -2
  43. package/templates/themes/material/combobox.ejs +3 -0
  44. package/templates/themes/material/edit.ejs +2 -2
  45. package/templates/themes/material/radio.ejs +27 -10
  46. package/tsconfig.json +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magic-xpa/cli",
3
- "version": "4.1300.0-dev4130.28",
3
+ "version": "4.1300.0-dev4130.280",
4
4
  "license": "SEE LICENSE IN EULA.pdf",
5
5
  "description": "Magic CLI for MagicWeb applications",
6
6
  "keywords": [
@@ -5,7 +5,8 @@ exports.logErr = logErr;
5
5
  exports.LogLn = LogLn;
6
6
  exports.Log = Log;
7
7
  exports.isNullOrUndefined = isNullOrUndefined;
8
- const process = require("process");
8
+ const tslib_1 = require("tslib");
9
+ const process = tslib_1.__importStar(require("process"));
9
10
  const env_1 = require("./env");
10
11
  // @dynamic
11
12
  class Util {
@@ -1 +1 @@
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"]}
1
+ {"version":3,"file":"Util.js","sourceRoot":"","sources":["Util.ts"],"names":[],"mappings":";;;AAWA,wBAEC;AAED,sBAGC;AAED,kBAGC;AAOD,8CAEC;;AAhCD,yDAAmC;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"]}
@@ -16,25 +16,28 @@ class Idependencies {
16
16
  }
17
17
  }
18
18
  exports.Idependencies = Idependencies;
19
+ // NOTE: zone.js is intentionally absent. Magic applications run zoneless, which is the
20
+ // Angular default since v21. Do not re-add it - see MagicChangeDetectionService in
21
+ // @magic-xpa/angular for how change detection is triggered instead.
19
22
  exports.dependencies = [
20
23
  // material dependencies
21
- { name: "@angular/material", version: '^21.1.4' },
22
- { name: "@angular/cdk", version: '^21.1.4' },
23
- { name: "@angular/animations", version: '^21.1.4' },
24
+ { name: "@angular/material", version: "^22.1.1" },
25
+ { name: "@angular/cdk", version: "^22.1.1" },
26
+ { name: "@angular/animations", version: '^22.1.1' },
24
27
  { name: "font-awesome", version: '^4.7.0' },
25
28
  { name: "hammerjs", version: '^2.0.8' },
26
- { name: "ngx-infinite-scroll", version: '^21.0.0' },
27
- { name: "ng-dynamic-component", version: '~10.8.2' },
28
- { name: "ngx-currency", version: "^19.0.0" },
29
- { name: "ngx-mask", version: "^13.1.15" },
29
+ { name: "ngx-infinite-scroll", version: '^22.0.0' },
30
+ { name: "ng-dynamic-component", version: '^11.0.0' },
31
+ { name: "@dintecom/ngx-currency", version: "^22.0.0" },
32
+ { name: "ngx-mask", version: "^22.1.0" },
30
33
  { name: "crypto-js", version: "^4.2.0" },
31
34
  // Time masking dependencies (hh:mm, hh:mm:ss, hh:mm:ss:mss)
32
- { name: "@maskito/angular", version: "^1.4.0" },
33
- { name: "@maskito/core", version: "^1.4.0" },
34
- { name: "@maskito/kit", version: "^1.4.0" }
35
+ { name: "@maskito/angular", version: "^5.3.1" },
36
+ { name: "@maskito/core", version: "^5.3.1" },
37
+ { name: "@maskito/kit", version: "^5.3.1" }
35
38
  ];
36
39
  exports.devDependencies = [
37
- { name: "@types/stacktrace-js", version: '^0.0.32' }
40
+ { name: "@types/stacktrace-js", version: "^0.0.33" }
38
41
  ];
39
42
  exports.env = {};
40
43
  //# sourceMappingURL=env.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["env.ts"],"names":[],"mappings":";;;AAKa,QAAA,YAAY,GAAW,gBAAgB,CAAC;AACxC,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAC5C,QAAA,mBAAmB,GAAI,kBAAkB,CAAC;AAC1C,QAAA,UAAU,GAAa,OAAO,CAAC;AAC/B,QAAA,gBAAgB,GAAO,+BAA+B,CAAC;AACvD,QAAA,2BAA2B,GAAI,oBAAoB,CAAC;AACpD,QAAA,aAAa,GAAI,KAAK,oBAAY,gBAAgB,CAAC;AACnD,QAAA,WAAW,GAAM,KAAK,oBAAY,cAAc,CAAC;AAE9D,MAAa,aAAa;IACxB,YAAY,OAAc,EAAE,UAAiB;QAC3C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC;IAC5B,CAAC;CAGF;AAPD,sCAOC;AAEU,QAAA,YAAY,GAAG;IAExB,wBAAwB;IACxB,EAAC,IAAI,EAAE,mBAAmB,EAAI,OAAO,EAAE,SAAS,EAAC;IACjD,EAAC,IAAI,EAAE,cAAc,EAAS,OAAO,EAAE,SAAS,EAAC;IACjD,EAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,SAAS,EAAC;IACjD,EAAC,IAAI,EAAE,cAAc,EAAS,OAAO,EAAE,QAAQ,EAAC;IAChD,EAAC,IAAI,EAAE,UAAU,EAAa,OAAO,EAAE,QAAQ,EAAC;IAEhD,EAAC,IAAI,EAAE,qBAAqB,EAAG,OAAO,EAAE,SAAS,EAAC;IAClD,EAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,SAAS,EAAC;IAClD,EAAC,IAAI,EAAE,cAAc,EAAU,OAAO,EAAE,SAAS,EAAC;IAClD,EAAC,IAAI,EAAE,UAAU,EAAc,OAAO,EAAE,UAAU,EAAC;IACnD,EAAC,IAAI,EAAE,WAAW,EAAa,OAAO,EAAE,QAAQ,EAAC;IAEjD,4DAA4D;IAC5D,EAAC,IAAI,EAAE,kBAAkB,EAAO,OAAO,EAAE,QAAQ,EAAC;IAClD,EAAC,IAAI,EAAE,eAAe,EAAU,OAAO,EAAE,QAAQ,EAAC;IAClD,EAAC,IAAI,EAAE,cAAc,EAAW,OAAO,EAAE,QAAQ,EAAC;CAEnD,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,EAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,SAAS,EAAC;CACnD,CAAC;AACW,QAAA,GAAG,GAAU,EAAS,CAAC","sourcesContent":["// TODO(PK): hard-code for now, will query npm repo\n// to get this info in the future\nimport { MagicMetadata } from \"./metadata.class\";\nimport { IEnv } from \"../../types/interfaces/env.interface\";\n\nexport const METADATA_DIR = `magic-metadata`;\nexport const GEN_COMPONENTS_ARRAY = 'magicGenComponents';\nexport const GEN_COMPONENTS_HASH = 'magicGenCmpsHash';\nexport const GEN_FOLDER = 'magic';\nexport const MAGIC_CLI_FOLDER = './node_modules/@magic-xpa/cli';\nexport const GEN_LAZY_LOAD_MODULES_ARRAY = 'LazyLoadModulesMap';\nexport const manifest_path = `./${METADATA_DIR}/manifest.json`;\nexport const config_path = `./${METADATA_DIR}/config.json`;\n\nexport class Idependencies {\n constructor(setName:string, setVersion:string){\n this.name = setName;\n this.version = setVersion;\n }\n name:string;\n version:string;\n}\n\nexport var dependencies = [\n\n // material dependencies\n {name: \"@angular/material\" , version: '^21.1.4'},\n {name: \"@angular/cdk\" , version: '^21.1.4'},\n {name: \"@angular/animations\", version: '^21.1.4'},\n {name: \"font-awesome\" , version: '^4.7.0'},\n {name: \"hammerjs\" , version: '^2.0.8'},\n\n {name: \"ngx-infinite-scroll\" , version: '^21.0.0'},\n {name: \"ng-dynamic-component\", version: '~10.8.2'},\n {name: \"ngx-currency\" , version: \"^19.0.0\"},\n {name: \"ngx-mask\" , version: \"^13.1.15\"},\n {name: \"crypto-js\" , version: \"^4.2.0\"},\n\n // Time masking dependencies (hh:mm, hh:mm:ss, hh:mm:ss:mss)\n {name: \"@maskito/angular\" , version: \"^1.4.0\"},\n {name: \"@maskito/core\" , version: \"^1.4.0\"},\n {name: \"@maskito/kit\" , version: \"^1.4.0\"}\n\n];\n\nexport const devDependencies = [\n {name: \"@types/stacktrace-js\", version: '^0.0.32'}\n];\nexport const env : IEnv = {} as any;\n\n"]}
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["env.ts"],"names":[],"mappings":";;;AAKa,QAAA,YAAY,GAAW,gBAAgB,CAAC;AACxC,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAC5C,QAAA,mBAAmB,GAAI,kBAAkB,CAAC;AAC1C,QAAA,UAAU,GAAa,OAAO,CAAC;AAC/B,QAAA,gBAAgB,GAAO,+BAA+B,CAAC;AACvD,QAAA,2BAA2B,GAAI,oBAAoB,CAAC;AACpD,QAAA,aAAa,GAAI,KAAK,oBAAY,gBAAgB,CAAC;AACnD,QAAA,WAAW,GAAM,KAAK,oBAAY,cAAc,CAAC;AAE9D,MAAa,aAAa;IACxB,YAAY,OAAc,EAAE,UAAiB;QAC3C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC;IAC5B,CAAC;CAGF;AAPD,sCAOC;AAED,uFAAuF;AACvF,mFAAmF;AACnF,oEAAoE;AACzD,QAAA,YAAY,GAAG;IAExB,wBAAwB;IACxB,EAAC,IAAI,EAAE,mBAAmB,EAAQ,OAAO,EAAE,SAAS,EAAC;IACrD,EAAC,IAAI,EAAE,cAAc,EAAa,OAAO,EAAE,SAAS,EAAC;IACrD,EAAC,IAAI,EAAE,qBAAqB,EAAM,OAAO,EAAE,SAAS,EAAC;IACrD,EAAC,IAAI,EAAE,cAAc,EAAa,OAAO,EAAE,QAAQ,EAAC;IACpD,EAAC,IAAI,EAAE,UAAU,EAAiB,OAAO,EAAE,QAAQ,EAAC;IAEpD,EAAC,IAAI,EAAE,qBAAqB,EAAM,OAAO,EAAE,SAAS,EAAC;IACrD,EAAC,IAAI,EAAE,sBAAsB,EAAK,OAAO,EAAE,SAAS,EAAC;IACrD,EAAC,IAAI,EAAE,wBAAwB,EAAG,OAAO,EAAE,SAAS,EAAC;IACrD,EAAC,IAAI,EAAE,UAAU,EAAiB,OAAO,EAAE,SAAS,EAAC;IACrD,EAAC,IAAI,EAAE,WAAW,EAAgB,OAAO,EAAE,QAAQ,EAAC;IAEpD,4DAA4D;IAC5D,EAAC,IAAI,EAAE,kBAAkB,EAAS,OAAO,EAAE,QAAQ,EAAC;IACpD,EAAC,IAAI,EAAE,eAAe,EAAY,OAAO,EAAE,QAAQ,EAAC;IACpD,EAAC,IAAI,EAAE,cAAc,EAAa,OAAO,EAAE,QAAQ,EAAC;CAErD,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,EAAC,IAAI,EAAE,sBAAsB,EAAG,OAAO,EAAE,SAAS,EAAC;CACpD,CAAC;AACW,QAAA,GAAG,GAAU,EAAS,CAAC","sourcesContent":["// TODO(PK): hard-code for now, will query npm repo\n// to get this info in the future\nimport { MagicMetadata } from \"./metadata.class\";\nimport { IEnv } from \"../../types/interfaces/env.interface\";\n\nexport const METADATA_DIR = `magic-metadata`;\nexport const GEN_COMPONENTS_ARRAY = 'magicGenComponents';\nexport const GEN_COMPONENTS_HASH = 'magicGenCmpsHash';\nexport const GEN_FOLDER = 'magic';\nexport const MAGIC_CLI_FOLDER = './node_modules/@magic-xpa/cli';\nexport const GEN_LAZY_LOAD_MODULES_ARRAY = 'LazyLoadModulesMap';\nexport const manifest_path = `./${METADATA_DIR}/manifest.json`;\nexport const config_path = `./${METADATA_DIR}/config.json`;\n\nexport class Idependencies {\n constructor(setName:string, setVersion:string){\n this.name = setName;\n this.version = setVersion;\n }\n name:string;\n version:string;\n}\n\n// NOTE: zone.js is intentionally absent. Magic applications run zoneless, which is the\n// Angular default since v21. Do not re-add it - see MagicChangeDetectionService in\n// @magic-xpa/angular for how change detection is triggered instead.\nexport var dependencies = [\n\n // material dependencies\n {name: \"@angular/material\" , version: \"^22.1.1\"},\n {name: \"@angular/cdk\" , version: \"^22.1.1\"},\n {name: \"@angular/animations\" , version: '^22.1.1'},\n {name: \"font-awesome\" , version: '^4.7.0'},\n {name: \"hammerjs\" , version: '^2.0.8'},\n\n {name: \"ngx-infinite-scroll\" , version: '^22.0.0'},\n {name: \"ng-dynamic-component\" , version: '^11.0.0'},\n {name: \"@dintecom/ngx-currency\" , version: \"^22.0.0\"},\n {name: \"ngx-mask\" , version: \"^22.1.0\"},\n {name: \"crypto-js\" , version: \"^4.2.0\"},\n\n // Time masking dependencies (hh:mm, hh:mm:ss, hh:mm:ss:mss)\n {name: \"@maskito/angular\" , version: \"^5.3.1\"},\n {name: \"@maskito/core\" , version: \"^5.3.1\"},\n {name: \"@maskito/kit\" , version: \"^5.3.1\"}\n\n];\n\nexport const devDependencies = [\n {name: \"@types/stacktrace-js\" , version: \"^0.0.33\"}\n];\nexport const env : IEnv = {} as any;\n\n"]}
@@ -21,30 +21,33 @@ export class Idependencies {
21
21
  version:string;
22
22
  }
23
23
 
24
+ // NOTE: zone.js is intentionally absent. Magic applications run zoneless, which is the
25
+ // Angular default since v21. Do not re-add it - see MagicChangeDetectionService in
26
+ // @magic-xpa/angular for how change detection is triggered instead.
24
27
  export var dependencies = [
25
28
 
26
29
  // material dependencies
27
- {name: "@angular/material" , version: '^21.1.4'},
28
- {name: "@angular/cdk" , version: '^21.1.4'},
29
- {name: "@angular/animations", version: '^21.1.4'},
30
- {name: "font-awesome" , version: '^4.7.0'},
31
- {name: "hammerjs" , version: '^2.0.8'},
32
-
33
- {name: "ngx-infinite-scroll" , version: '^21.0.0'},
34
- {name: "ng-dynamic-component", version: '~10.8.2'},
35
- {name: "ngx-currency" , version: "^19.0.0"},
36
- {name: "ngx-mask" , version: "^13.1.15"},
37
- {name: "crypto-js" , version: "^4.2.0"},
30
+ {name: "@angular/material" , version: "^22.1.1"},
31
+ {name: "@angular/cdk" , version: "^22.1.1"},
32
+ {name: "@angular/animations" , version: '^22.1.1'},
33
+ {name: "font-awesome" , version: '^4.7.0'},
34
+ {name: "hammerjs" , version: '^2.0.8'},
35
+
36
+ {name: "ngx-infinite-scroll" , version: '^22.0.0'},
37
+ {name: "ng-dynamic-component" , version: '^11.0.0'},
38
+ {name: "@dintecom/ngx-currency" , version: "^22.0.0"},
39
+ {name: "ngx-mask" , version: "^22.1.0"},
40
+ {name: "crypto-js" , version: "^4.2.0"},
38
41
 
39
42
  // Time masking dependencies (hh:mm, hh:mm:ss, hh:mm:ss:mss)
40
- {name: "@maskito/angular" , version: "^1.4.0"},
41
- {name: "@maskito/core" , version: "^1.4.0"},
42
- {name: "@maskito/kit" , version: "^1.4.0"}
43
+ {name: "@maskito/angular" , version: "^5.3.1"},
44
+ {name: "@maskito/core" , version: "^5.3.1"},
45
+ {name: "@maskito/kit" , version: "^5.3.1"}
43
46
 
44
47
  ];
45
48
 
46
49
  export const devDependencies = [
47
- {name: "@types/stacktrace-js", version: '^0.0.32'}
50
+ {name: "@types/stacktrace-js" , version: "^0.0.33"}
48
51
  ];
49
52
  export const env : IEnv = {} as any;
50
53
 
@@ -2,13 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildControl = buildControl;
4
4
  exports.generate = generate;
5
+ const tslib_1 = require("tslib");
5
6
  const schematics_1 = require("@angular-devkit/schematics");
6
7
  const index_1 = require("../../../types/index");
7
8
  const Util_1 = require("../Util");
8
9
  const env_1 = require("../env");
9
- const EJS = require("ejs");
10
+ const EJS = tslib_1.__importStar(require("ejs"));
10
11
  const Util_2 = require("../Util");
11
- const jsbeautify = require("js-beautify");
12
+ const jsbeautify = tslib_1.__importStar(require("js-beautify"));
12
13
  const generate_rule_1 = require("./generate.rule");
13
14
  const htmlBeautify = jsbeautify.html;
14
15
  //
@@ -1 +1 @@
1
- {"version":3,"file":"build-control.rule.js","sourceRoot":"","sources":["build-control.rule.ts"],"names":[],"mappings":";;AA0BA,oCAuCC;AAKD,4BAmBC;AAxFD,2DAAiF;AACjF,gDAW8B;AAC9B,kCAA+B;AAC/B,gCAA2D;AAC3D,2BAA2B;AAC3B,kCAAsC;AACtC,0CAA0C;AAC1C,mDAAiD;AAEjD,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC;AAErC,EAAE;AACF,qCAAqC;AACrC,EAAE;AACF,SAAgB,YAAY,CAAC,OAAyB,EAAE,WAAkB;IACxE,OAAO,CAAC,IAAS,EAAE,OAAyB,EAAC,EAAE;QAC7C,MAAM,QAAQ,GAAG,SAAG,CAAC,QAAQ,CAAC;QAC9B,MAAM,IAAI,GAAM,SAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,KAAK,GAAU,EAAE,CAAC;QAEpB,MAAM,MAAM,GAAK,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAO,QAAQ,CAAC,KAAK,CAAC,uBAAuB,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAChG,MAAM,IAAI,GAAO;YACf,aAAa,EAAO,qBAAa;YACjC,KAAK,EAAe,QAAQ,CAAC,KAAK;YAClC,iBAAiB,EAAG,yBAAiB;YACrC,QAAQ,EAAY,gBAAQ;YAC5B,oBAAoB,EAAE,4BAAoB;YAC1C,aAAa,EAAO,qBAAa;YACjC,eAAe,EAAK,uBAAe;YACnC,UAAU,EAAU,kBAAU;YAC9B,cAAc,EAAM,sBAAc;YAClC,IAAI,EAAgB,WAAI;YACxB,KAAK,EAAe,IAAI;YACxB,IAAI,EAAgB,IAAI;YACxB,GAAG,EAAiB,SAAG,CA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Rule, SchematicContext, Tree } from \"@angular-devkit/schematics\";\r\nimport {\r\n CtrlButtonTypeGui,\r\n GeneratedFileTypes,\r\n MgControlType,\r\n SideType,\r\n StorageAttributeType,\r\n TableWebStyle,\r\n RowEditingTypes,\r\n TemplateConfig,\r\n WindowPosition,\r\n WindowType\r\n} from \"../../../types/index\";\r\nimport { Util } from \"../Util\";\r\nimport { env, GEN_FOLDER, MAGIC_CLI_FOLDER } from \"../env\";\r\nimport * as EJS from 'ejs';\r\nimport { logErr, Log } from \"../Util\";\r\nimport * as jsbeautify from 'js-beautify';\r\nimport { createGenFuncs } from \"./generate.rule\";\r\n\r\nconst htmlBeautify = jsbeautify.html;\r\n\r\n//\r\n// build the HTML of a single control\r\n//\r\nexport function buildControl(options:MagicOptionScheme, module_name:string) : Rule {\r\n return (host:Tree, context: SchematicContext)=>{\r\n const metadata = env.metadata;\r\n const view = env.app.views[0];\r\n let rules:Rule[] = [];\r\n\r\n const viewId = view.props.id;\r\n const dest = metadata.paths.getDestPathForComponent(module_name, view.props.component_path);\r\n const data = {\r\n MgControlType : MgControlType,\r\n theme : metadata.theme,\r\n CtrlButtonTypeGui : CtrlButtonTypeGui,\r\n SideType : SideType,\r\n StorageAttributeType: StorageAttributeType,\r\n TableWebStyle : TableWebStyle,\r\n RowEditingTypes : RowEditingTypes,\r\n WindowType : WindowType,\r\n WindowPosition : WindowPosition,\r\n Util : Util,\r\n child : view,\r\n ctrl : view,\r\n app : env.app,\r\n magicConfig : metadata.config,\r\n };\r\n const componentFiles: TemplateConfig[] = [\r\n {\r\n type: GeneratedFileTypes.HTML,\r\n template: './templates/themes/control.ejs',\r\n destination: dest,\r\n name: `${viewId}.component.html`,\r\n data: data\r\n },\r\n ];\r\n componentFiles.forEach( templateConfig => {\r\n rules.push(generate(templateConfig, options));\r\n });\r\n\r\n return chain(rules)(host,context);\r\n }\r\n}\r\n\r\n//\r\n// Call EJS to generate HTML and write the result to stdout\r\n//\r\nexport function generate(file: TemplateConfig,options:MagicOptionScheme) :Rule{\r\n return (host:Tree, context: SchematicContext) => {\r\n EJS.renderFile(\r\n `${MAGIC_CLI_FOLDER}/${file.template}`,\r\n file.data,\r\n {},\r\n (err, output) => {\r\n try {\r\n output = createGenFuncs(output, file.type);\r\n }\r\n catch (err) {\r\n logErr(output);\r\n logErr(err);\r\n }\r\n // send the output directly to the stdout, so the calling app will get it\r\n console.log(output);\r\n });\r\n return host;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"build-control.rule.js","sourceRoot":"","sources":["build-control.rule.ts"],"names":[],"mappings":";;AA0BA,oCAuCC;AAKD,4BAmBC;;AAxFD,2DAAiF;AACjF,gDAW8B;AAC9B,kCAA+B;AAC/B,gCAA2D;AAC3D,iDAA2B;AAC3B,kCAAsC;AACtC,gEAA0C;AAC1C,mDAAiD;AAEjD,MAAM,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC;AAErC,EAAE;AACF,qCAAqC;AACrC,EAAE;AACF,SAAgB,YAAY,CAAC,OAAyB,EAAE,WAAkB;IACxE,OAAO,CAAC,IAAS,EAAE,OAAyB,EAAC,EAAE;QAC7C,MAAM,QAAQ,GAAG,SAAG,CAAC,QAAQ,CAAC;QAC9B,MAAM,IAAI,GAAM,SAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjC,IAAI,KAAK,GAAU,EAAE,CAAC;QAEpB,MAAM,MAAM,GAAK,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAO,QAAQ,CAAC,KAAK,CAAC,uBAAuB,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAChG,MAAM,IAAI,GAAO;YACf,aAAa,EAAO,qBAAa;YACjC,KAAK,EAAe,QAAQ,CAAC,KAAK;YAClC,iBAAiB,EAAG,yBAAiB;YACrC,QAAQ,EAAY,gBAAQ;YAC5B,oBAAoB,EAAE,4BAAoB;YAC1C,aAAa,EAAO,qBAA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AAyE;YACzE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QACL,OAAO,IAAI,CAAC;IACd,CAAC,CAAA;AACH,CAAC","sourcesContent":["import { MagicOptionScheme } from \"./magic-option.scheme\";\r\nimport { chain, Rule, SchematicContext, Tree } from \"@angular-devkit/schematics\";\r\nimport {\r\n CtrlButtonTypeGui,\r\n GeneratedFileTypes,\r\n MgControlType,\r\n SideType,\r\n StorageAttributeType,\r\n TableWebStyle,\r\n RowEditingTypes,\r\n TemplateConfig,\r\n WindowPosition,\r\n WindowType\r\n} from \"../../../types/index\";\r\nimport { Util } from \"../Util\";\r\nimport { env, GEN_FOLDER, MAGIC_CLI_FOLDER } from \"../env\";\r\nimport * as EJS from 'ejs';\r\nimport { logErr, Log } from \"../Util\";\r\nimport * as jsbeautify from 'js-beautify';\r\nimport { createGenFuncs } from \"./generate.rule\";\r\n\r\nconst htmlBeautify = jsbeautify.html;\r\n\r\n//\r\n// build the HTML of a single control\r\n//\r\nexport function buildControl(options:MagicOptionScheme, module_name:string) : Rule {\r\n return (host:Tree, context: SchematicContext)=>{\r\n const metadata = env.metadata;\r\n const view = env.app.views[0];\r\n let rules:Rule[] = [];\r\n\r\n const viewId = view.props.id;\r\n const dest = metadata.paths.getDestPathForComponent(module_name, view.props.component_path);\r\n const data = {\r\n MgControlType : MgControlType,\r\n theme : metadata.theme,\r\n CtrlButtonTypeGui : CtrlButtonTypeGui,\r\n SideType : SideType,\r\n StorageAttributeType: StorageAttributeType,\r\n TableWebStyle : TableWebStyle,\r\n RowEditingTypes : RowEditingTypes,\r\n WindowType : WindowType,\r\n WindowPosition : WindowPosition,\r\n Util : Util,\r\n child : view,\r\n ctrl : view,\r\n app : env.app,\r\n magicConfig : metadata.config,\r\n };\r\n const componentFiles: TemplateConfig[] = [\r\n {\r\n type: GeneratedFileTypes.HTML,\r\n template: './templates/themes/control.ejs',\r\n destination: dest,\r\n name: `${viewId}.component.html`,\r\n data: data\r\n },\r\n ];\r\n componentFiles.forEach( templateConfig => {\r\n rules.push(generate(templateConfig, options));\r\n });\r\n\r\n return chain(rules)(host,context);\r\n }\r\n}\r\n\r\n//\r\n// Call EJS to generate HTML and write the result to stdout\r\n//\r\nexport function generate(file: TemplateConfig,options:MagicOptionScheme) :Rule{\r\n return (host:Tree, context: SchematicContext) => {\r\n EJS.renderFile(\r\n `${MAGIC_CLI_FOLDER}/${file.template}`,\r\n file.data,\r\n {},\r\n (err, output) => {\r\n try {\r\n output = createGenFuncs(output, file.type);\r\n }\r\n catch (err) {\r\n logErr(output);\r\n logErr(err);\r\n }\r\n // send the output directly to the stdout, so the calling app will get it\r\n console.log(output);\r\n });\r\n return host;\r\n }\r\n}\r\n"]}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.componentlistGen = componentlistGen;
4
- const ts = require("typescript");
5
- const EJS = require("ejs");
4
+ const tslib_1 = require("tslib");
5
+ const ts = tslib_1.__importStar(require("typescript"));
6
+ const EJS = tslib_1.__importStar(require("ejs"));
6
7
  const schematics_1 = require("@angular-devkit/schematics");
7
8
  const env_1 = require("../env");
8
9
  const types_1 = require("../../../types");
@@ -1 +1 @@
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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;4DAEwD;AAC1D,CAAC;AAED,wCAAwC;AACxC,SAAS,uBAAuB,CAAC,MAAc,EAAE,IAA0B,EAAE,SAAiB,EAAE,WAAmB;IACjH,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,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, 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,uDAAiC;AACjC,iDAA2B;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,CA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,SAAiB,EAAE,WAAmB;IACjH,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,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, 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"]}
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createGenFuncs = createGenFuncs;
4
4
  exports.generate = generate;
5
- const EJS = require("ejs");
5
+ const tslib_1 = require("tslib");
6
+ const EJS = tslib_1.__importStar(require("ejs"));
6
7
  //import * as prettier from "prettier";
7
- const jsbeautify = require("js-beautify");
8
+ const jsbeautify = tslib_1.__importStar(require("js-beautify"));
8
9
  const Util_1 = require("../Util");
9
10
  const env_1 = require("../env");
10
11
  const types_1 = require("../../../types");
@@ -1 +1 @@
1
- {"version":3,"file":"generate.rule.js","sourceRoot":"","sources":["generate.rule.ts"],"names":[],"mappings":";;AAYA,wCAiBC;AAED,4BA6BC;AA5DD,2BAAmC;AACnC,0CAA0C;AAC1C,0CAA2C;AAI3C,kCAAiC;AACjC,gCAA0C;AAC1C,0CAAoE;AAIpE,SAAgB,cAAc,CAAC,MAAe,EAAC,IAAwB;IACrE,MAAM,MAAM,GAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CA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WAAW,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBAE9C,IAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAC,CAAC;oBACpB,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAA;gBAC5D,CAAC;qBAAK,CAAC;oBACL,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;gBAC1D,CAAC;YACH,CAAC;YACD,OAAO,GAAG,EAAE,CAAC;gBACX,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC;gBACf,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;QACL,OAAO,IAAI,CAAC;IACd,CAAC,CAAA;AACH,CAAC","sourcesContent":["import * as EJS from \"ejs\";\n//import * as prettier from \"prettier\";\nimport * as jsbeautify from \"js-beautify\";\n\nimport { Rule, SchematicContext, Tree } from \"@angular-devkit/schematics\";\n\nimport { logErr } from \"../Util\";\nimport { MAGIC_CLI_FOLDER } from \"../env\";\nimport { GeneratedFileTypes, TemplateConfig } from \"../../../types\";\nimport { MagicOptionScheme } from \"./magic-option.scheme\";\nimport { prettierConfig } from \"../config\";\n\nexport function createGenFuncs(output : string,type: GeneratedFileTypes ) {\n const htmlFn = jsbeautify.html.bind(this, output, {\n \"max_preserve_newlines\": 0,\n \"wrap_line_length\" : 0,\n \"wrap_attributes\" : \"force-expand-multiline\",\n \"brace_style\" : 'collapse,preserve-inline'\n });\n\n const fnMap = {\n [GeneratedFileTypes.HTML]: htmlFn,\n //[GeneratedFileTypes.TS] : prettier.format.bind(this, output, prettierConfig),\n [GeneratedFileTypes.TS] : jsbeautify.js.bind(this, output, {\"brace_style\" : 'collapse,preserve-inline'}),\n [GeneratedFileTypes.HELPER] : jsbeautify.js.bind(this, output, {}),\n [GeneratedFileTypes.CSS] : jsbeautify.css.bind(this, output, { })\n };\n\n return fnMap[type]();\n}\n\nexport function generate(file: TemplateConfig,options:MagicOptionScheme) :Rule{\n return (host:Tree, context: SchematicContext) => {\n EJS.renderFile(\n `${MAGIC_CLI_FOLDER}/${file.template}`,\n file.data,\n {\"rmWhitespace\" : true},\n (err, output) => {\n if (err) { logErr(err); return }\n\n try {\n //if(file.type != GeneratedFileTypes.TS) {\n output = createGenFuncs(output, file.type);\n //}\n\n let path = `${file.destination}/${file.name}`;\n\n if(host.exists(path)){\n host.overwrite(`${file.destination}/${file.name}`, output)\n } else{\n host.create(`${file.destination}/${file.name}`, output);\n }\n }\n catch (err) {\n logErr(output);\n logErr(err);\n }\n });\n return host;\n }\n}\n"]}
1
+ {"version":3,"file":"generate.rule.js","sourceRoot":"","sources":["generate.rule.ts"],"names":[],"mappings":";;AAYA,wCAiBC;AAED,4BA6BC;;AA5DD,iDAAmC;AACnC,0CAA0C;AAC1C,gEAA2C;AAI3C,kCAAiC;AACjC,gCAA0C;AAC1C,0CAAoE;AAIpE,SAAgB,cAAc,CAAC,MAAe,EAAC,IAAwB;IACrE,MAAM,MAAM,GAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE;QACjD,uBAAuB,EAAE,CAAC;QAC1B,kBAAkB,EAAO,CAAC;QAC1B,iBAAiB,EAAQ,wBAAwB;QAChD,aAAa,EAAG,0BAA0B;KAC5C,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG;QACZ,CAAC,0BAAkB,CAAC,IAAI,CAAC,EAAE,MAAM;QACjC,gFAAgF;QAChF,CAAC,0BAAkB,CAAC,EAAE,CAAC,EAAI,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAC,aAAa,EAAG,0BAA0B,EAAC,CAAC;QACzG,CAAC,0BAAkB,CAAC,MAAM,CAAC,EAAI,UAAU,CAAC,EAAE,CAAC,IAAI,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AAC,GAAG,CAAC,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;QACL,OAAO,IAAI,CAAC;IACd,CAAC,CAAA;AACH,CAAC","sourcesContent":["import * as EJS from \"ejs\";\n//import * as prettier from \"prettier\";\nimport * as jsbeautify from \"js-beautify\";\n\nimport { Rule, SchematicContext, Tree } from \"@angular-devkit/schematics\";\n\nimport { logErr } from \"../Util\";\nimport { MAGIC_CLI_FOLDER } from \"../env\";\nimport { GeneratedFileTypes, TemplateConfig } from \"../../../types\";\nimport { MagicOptionScheme } from \"./magic-option.scheme\";\nimport { prettierConfig } from \"../config\";\n\nexport function createGenFuncs(output : string,type: GeneratedFileTypes ) {\n const htmlFn = jsbeautify.html.bind(this, output, {\n \"max_preserve_newlines\": 0,\n \"wrap_line_length\" : 0,\n \"wrap_attributes\" : \"force-expand-multiline\",\n \"brace_style\" : 'collapse,preserve-inline'\n });\n\n const fnMap = {\n [GeneratedFileTypes.HTML]: htmlFn,\n //[GeneratedFileTypes.TS] : prettier.format.bind(this, output, prettierConfig),\n [GeneratedFileTypes.TS] : jsbeautify.js.bind(this, output, {\"brace_style\" : 'collapse,preserve-inline'}),\n [GeneratedFileTypes.HELPER] : jsbeautify.js.bind(this, output, {}),\n [GeneratedFileTypes.CSS] : jsbeautify.css.bind(this, output, { })\n };\n\n return fnMap[type]();\n}\n\nexport function generate(file: TemplateConfig,options:MagicOptionScheme) :Rule{\n return (host:Tree, context: SchematicContext) => {\n EJS.renderFile(\n `${MAGIC_CLI_FOLDER}/${file.template}`,\n file.data,\n {\"rmWhitespace\" : true},\n (err, output) => {\n if (err) { logErr(err); return }\n\n try {\n //if(file.type != GeneratedFileTypes.TS) {\n output = createGenFuncs(output, file.type);\n //}\n\n let path = `${file.destination}/${file.name}`;\n\n if(host.exists(path)){\n host.overwrite(`${file.destination}/${file.name}`, output)\n } else{\n host.create(`${file.destination}/${file.name}`, output);\n }\n }\n catch (err) {\n logErr(output);\n logErr(err);\n }\n });\n return host;\n }\n}\n"]}
@@ -1,9 +1,10 @@
1
1
  import {Routes, RouterModule} from '@angular/router';
2
+ import {customRoutes} from './custom.routes';
2
3
  import { NgModule } from "@angular/core";
3
4
  import { CommonModule } from "@angular/common";
4
5
 
5
6
  export const routes: Routes= [
6
-
7
+ ...customRoutes,
7
8
  ];
8
9
 
9
10
 
@@ -0,0 +1,23 @@
1
+ import { Routes } from '@angular/router';
2
+ import { RouterContainerMagicComponent } from "@magic-xpa/angular";
3
+
4
+ /**
5
+ * Custom Routes
6
+ * =============
7
+ * Add your custom/manual routes in this file.
8
+ *
9
+ * IMPORTANT: This file is NOT affected by CLI route regeneration.
10
+ * The generated app.routes.ts automatically imports these routes.
11
+ *
12
+ * Custom routes are placed BEFORE generated routes in the final
13
+ * routes array, so they take PRIORITY when paths conflict.
14
+ *
15
+ * Example:
16
+ * {
17
+ * path: 'callPublic/:name',
18
+ * component: RouterContainerMagicComponent,
19
+ * },
20
+ */
21
+ export const customRoutes: Routes = [
22
+
23
+ ];
@@ -26,10 +26,8 @@ import {MatTabsModule} from "@angular/material/tabs";
26
26
  import {MatTooltipModule} from "@angular/material/tooltip";
27
27
  import {MatButtonModule} from "@angular/material/button";
28
28
  import {MatAutocompleteModule} from "@angular/material/autocomplete";
29
- import {NgxCurrencyDirective, NgxCurrencyInputMode, provideEnvironmentNgxCurrency} from "ngx-currency";
30
- import {NgxMaskModule, IConfig} from "ngx-mask";
31
-
32
- export const options: Partial<IConfig> | (() => Partial<IConfig>) = {};
29
+ import {NgxCurrency, NgxCurrencyInputMode, provideEnvironmentNgxCurrency} from "@dintecom/ngx-currency";
30
+ import {NgxMaskDirective, provideNgxMask} from "ngx-mask";
33
31
 
34
32
  @NgModule({
35
33
  declarations: [
@@ -49,8 +47,8 @@ export const options: Partial<IConfig> | (() => Partial<IConfig>) = {};
49
47
  MagicModule,
50
48
  DynamicModule,
51
49
  InfiniteScrollDirective,
52
- NgxCurrencyDirective,
53
- NgxMaskModule.forRoot(),
50
+ NgxCurrency,
51
+ NgxMaskDirective,
54
52
 
55
53
  // Material Modules
56
54
  MatTableModule,
@@ -72,6 +70,7 @@ export const options: Partial<IConfig> | (() => Partial<IConfig>) = {};
72
70
  MatAutocompleteModule
73
71
  ],
74
72
  providers: [ExitMagicService,
73
+ provideNgxMask(),
75
74
  provideEnvironmentNgxCurrency({
76
75
  align: "right",
77
76
  allowNegative: true,
@@ -84,7 +83,7 @@ export const options: Partial<IConfig> | (() => Partial<IConfig>) = {};
84
83
  nullable: true,
85
84
  min: undefined,
86
85
  max: undefined,
87
- inputMode: NgxCurrencyInputMode.Financial
86
+ inputMode: NgxCurrencyInputMode.Natural
88
87
  }),
89
88
  ],
90
89
  })
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mgAdd = mgAdd;
4
+ const tslib_1 = require("tslib");
4
5
  const schematics_1 = require("@angular-devkit/schematics");
5
6
  const tasks_1 = require("@angular-devkit/schematics/tasks");
6
7
  const package_1 = require("./../utils/package");
@@ -12,7 +13,7 @@ const Util_1 = require("../magic-utils/Util");
12
13
  const generate_rule_1 = require("../magic-utils/rules/generate.rule");
13
14
  const generated_file_types_enum_1 = require("../../types/enums/generated-file-types.enum");
14
15
  const ast_utils_1 = require("../utils/devkit-utils/ast-utils");
15
- const ts = require("typescript");
16
+ const ts = tslib_1.__importStar(require("typescript"));
16
17
  const change_1 = require("../utils/devkit-utils/change");
17
18
  function mgAdd(options) {
18
19
  return (0, schematics_1.chain)([
@@ -24,7 +25,6 @@ function mgAdd(options) {
24
25
  updateAngularJsonWithMagicStyle(options),
25
26
  updateTsConfigAppJson(options),
26
27
  addLazyLoadProvider(),
27
- addZoneChangeDetectionProviderRule(),
28
28
  //handel app.html
29
29
  //updateAppComponentHtmlFiles (options),
30
30
  //handel package.Json
@@ -57,6 +57,9 @@ function updateAngularJsonWithMagicStyle(options) {
57
57
  project.architect.build.options.styles.push(fullPathmagicStylePath);
58
58
  isDirty = true;
59
59
  }
60
+ // No zone.js polyfill is added here: Magic applications run zoneless, which is the
61
+ // Angular default since v21. Change detection is driven by MagicChangeDetectionService
62
+ // in @magic-xpa/angular instead.
60
63
  if (isDirty) {
61
64
  let fullPath = env_1.env.metadata.paths.angularJsonPath;
62
65
  host.overwrite(fullPath, JSON.stringify(env_1.env.workspace, null, 2));
@@ -79,6 +82,10 @@ function updateTsConfigAppJson(option) {
79
82
  //Add module files for compilation
80
83
  if (!config['include'].includes('src/**/*module.ts'))
81
84
  config['include'].push('src/**/*module.ts');
85
+ if (!config['compilerOptions'])
86
+ config['compilerOptions'] = {};
87
+ // Ensures forceConsistentCasingInFileNames is set to false inorder to avoid path casing differences while compilation
88
+ config['compilerOptions']['forceConsistentCasingInFileNames'] = false;
82
89
  // append the comment again and write the file
83
90
  host.overwrite(tsConfigPath, comment + "\n" + JSON.stringify(config, null, 2));
84
91
  return host;
@@ -155,76 +162,4 @@ function addLazyLoadProvider() {
155
162
  host.commitUpdate(magicImportChangesRecorder);
156
163
  };
157
164
  }
158
- function addZoneChangeDetectionProviderRule() {
159
- return (host) => {
160
- // Resolve the generated root module path (src/app/app-module.ts in this project layout).
161
- const appmodule = env_1.env.metadata.paths.rootMagicGenFolder + '/app-module.ts';
162
- // Append provideZoneChangeDetection() to NgModule.providers if it does not already exist.
163
- addZoneChangeDetectionProvider(host, appmodule);
164
- // Re-parse from disk after provider update so import insertion uses fresh AST positions.
165
- const sourceText = host.read(appmodule).toString('utf-8');
166
- const source = ts.createSourceFile(appmodule, sourceText, ts.ScriptTarget.Latest, true);
167
- // Ensure the symbol import exists; insertImport is idempotent and avoids duplicates.
168
- const zoneChangeDetectionImport = (0, ast_utils_1.insertImport)(source, appmodule, 'provideZoneChangeDetection', '@angular/core', false);
169
- const zoneChangeDetectionImportChangesRecorder = host.beginUpdate(appmodule);
170
- if (zoneChangeDetectionImport instanceof change_1.InsertChange)
171
- zoneChangeDetectionImportChangesRecorder.insertLeft(zoneChangeDetectionImport.pos, zoneChangeDetectionImport.toAdd);
172
- host.commitUpdate(zoneChangeDetectionImportChangesRecorder);
173
- };
174
- }
175
- function addZoneChangeDetectionProvider(host, appmodule) {
176
- const zoneProvider = 'provideZoneChangeDetection()';
177
- const sourceText = host.read(appmodule).toString('utf-8');
178
- const source = ts.createSourceFile(appmodule, sourceText, ts.ScriptTarget.Latest, true);
179
- // Locate the first @NgModule({...}) metadata object in app-module.ts.
180
- const ngModules = (0, ast_utils_1.getDecoratorMetadata)(source, 'NgModule', '@angular/core');
181
- if (!ngModules.length) {
182
- return;
183
- }
184
- const ngModuleMetadata = ngModules[0];
185
- // Find the `providers` property assignment inside @NgModule metadata.
186
- const providersProperty = ngModuleMetadata.properties
187
- .filter(ts.isPropertyAssignment)
188
- .find((prop) => {
189
- if (ts.isIdentifier(prop.name)) {
190
- return prop.name.text === 'providers';
191
- }
192
- return ts.isStringLiteral(prop.name) && prop.name.text === 'providers';
193
- });
194
- if (!providersProperty || !ts.isArrayLiteralExpression(providersProperty.initializer)) {
195
- return;
196
- }
197
- const providersArray = providersProperty.initializer;
198
- // Keep this operation idempotent: do nothing if provider already exists.
199
- const hasZoneProvider = providersArray.elements.some((el) => {
200
- return el.getText(source).replace(/\s+/g, '') === zoneProvider;
201
- });
202
- if (hasZoneProvider) {
203
- return;
204
- }
205
- let insertPos;
206
- let toAdd;
207
- if (providersArray.elements.length === 0) {
208
- // Empty providers: inject the item directly between [].
209
- insertPos = providersArray.getEnd() - 1;
210
- toAdd = zoneProvider;
211
- }
212
- else {
213
- // Non-empty providers: append after last provider, preserving line formatting when possible.
214
- const lastProvider = providersArray.elements[providersArray.elements.length - 1];
215
- insertPos = lastProvider.getEnd();
216
- const lastProviderText = lastProvider.getFullText(source);
217
- const newLineMatch = lastProviderText.match(/^\r?\n(\r?)\s+/);
218
- if (newLineMatch) {
219
- toAdd = `,${newLineMatch[0]}${zoneProvider}`;
220
- }
221
- else {
222
- toAdd = `, ${zoneProvider}`;
223
- }
224
- }
225
- // Apply the computed insertion at the exact Abstract Syntax Tree-derived position.
226
- const recorder = host.beginUpdate(appmodule);
227
- recorder.insertLeft(insertPos, toAdd);
228
- host.commitUpdate(recorder);
229
- }
230
165
  //# sourceMappingURL=index.js.map