@magic-xpa/cli 4.801.0-dev481.391 → 4.801.0-dev481.430

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 (187) hide show
  1. package/README.md +28 -28
  2. package/index.js.map +1 -1
  3. package/index.ts +1 -1
  4. package/package.json +1 -1
  5. package/src/collection.json +68 -68
  6. package/src/public_api.js.map +1 -1
  7. package/src/public_api.ts +5 -5
  8. package/src/schematics/magic-utils/config.js.map +1 -1
  9. package/src/schematics/magic-utils/config.ts +68 -68
  10. package/src/schematics/magic-utils/env.js.map +1 -1
  11. package/src/schematics/magic-utils/env.ts +43 -43
  12. package/src/schematics/magic-utils/manifest.js.map +1 -1
  13. package/src/schematics/magic-utils/manifest.ts +46 -46
  14. package/src/schematics/magic-utils/metadata.class.js +9 -9
  15. package/src/schematics/magic-utils/metadata.class.js.map +1 -1
  16. package/src/schematics/magic-utils/metadata.class.ts +145 -145
  17. package/src/schematics/magic-utils/rules/generate.rule.js.map +1 -1
  18. package/src/schematics/magic-utils/rules/generate.rule.ts +61 -61
  19. package/src/schematics/magic-utils/rules/init-add-modules.rule.js.map +1 -1
  20. package/src/schematics/magic-utils/rules/init-add-modules.rule.ts +343 -343
  21. package/src/schematics/magic-utils/rules/init-magic-metadata.rule.js.map +1 -1
  22. package/src/schematics/magic-utils/rules/init-magic-metadata.rule.ts +18 -18
  23. package/src/schematics/magic-utils/rules/magic-option.scheme.js.map +1 -1
  24. package/src/schematics/magic-utils/rules/magic-option.scheme.ts +22 -22
  25. package/src/schematics/magic-utils/utils.js.map +1 -1
  26. package/src/schematics/magic-utils/utils.ts +134 -134
  27. package/src/schematics/mg-Install-prerequisites/index.js.map +1 -1
  28. package/src/schematics/mg-Install-prerequisites/index.ts +30 -30
  29. package/src/schematics/mg-Install-prerequisites/schema.json +14 -14
  30. package/src/schematics/mg-add/files/src/app/app.component.html +17 -17
  31. package/src/schematics/mg-add/files/src/app/app.routes.ts +14 -14
  32. package/src/schematics/mg-add/files/src/app/magic/component-list.g.ts +9 -9
  33. package/src/schematics/mg-add/files/src/magic-styles.css +131 -131
  34. package/src/schematics/mg-add/schema.json +29 -29
  35. package/src/schematics/mg-add/utils/add-declaration-to-root-module.js.map +1 -1
  36. package/src/schematics/mg-add/utils/add-declaration-to-root-module.ts +12 -12
  37. package/src/schematics/mg-add/webModule/app.routes.ts +14 -14
  38. package/src/schematics/mg-add-tasks/index.js.map +1 -1
  39. package/src/schematics/mg-add-tasks/index.ts +53 -53
  40. package/src/schematics/mg-add-tasks/schema.json +41 -41
  41. package/src/schematics/mg-delete-files/index.js.map +1 -1
  42. package/src/schematics/mg-delete-files/index.ts +12 -12
  43. package/src/schematics/mg-delete-files/schema.json +14 -14
  44. package/src/schematics/mg-gen-module/index.js.map +1 -1
  45. package/src/schematics/mg-gen-module/index.ts +14 -14
  46. package/src/schematics/mg-gen-module/schema.json +24 -24
  47. package/src/schematics/mg-generate/index.js.map +1 -1
  48. package/src/schematics/mg-generate/index.ts +12 -12
  49. package/src/schematics/mg-generate/schema.json +34 -34
  50. package/src/schematics/mg-install/index.js.map +1 -1
  51. package/src/schematics/mg-install/index.ts +37 -37
  52. package/src/schematics/mg-install/schema.json +24 -24
  53. package/src/schematics/mg-routes/schema.json +14 -14
  54. package/src/schematics/mg-single-control/schema.json +24 -24
  55. package/src/schematics/utils/ast.js.map +1 -1
  56. package/src/schematics/utils/ast.ts +103 -103
  57. package/src/schematics/utils/devkit-utils/README.md +1 -1
  58. package/src/schematics/utils/devkit-utils/ast-utils.js.map +1 -1
  59. package/src/schematics/utils/devkit-utils/ast-utils.ts +570 -570
  60. package/src/schematics/utils/devkit-utils/ast-utils_old.js.map +1 -1
  61. package/src/schematics/utils/devkit-utils/ast-utils_old.ts +478 -478
  62. package/src/schematics/utils/devkit-utils/change.js.map +1 -1
  63. package/src/schematics/utils/devkit-utils/change.ts +127 -127
  64. package/src/schematics/utils/devkit-utils/component.js.map +1 -1
  65. package/src/schematics/utils/devkit-utils/component.ts +136 -136
  66. package/src/schematics/utils/devkit-utils/config.js.map +1 -1
  67. package/src/schematics/utils/devkit-utils/config.ts +120 -120
  68. package/src/schematics/utils/devkit-utils/find-module.js.map +1 -1
  69. package/src/schematics/utils/devkit-utils/find-module.ts +108 -108
  70. package/src/schematics/utils/devkit-utils/ng-ast-utils.js.map +1 -1
  71. package/src/schematics/utils/devkit-utils/ng-ast-utils.ts +84 -84
  72. package/src/schematics/utils/devkit-utils/parse-name.js.map +1 -1
  73. package/src/schematics/utils/devkit-utils/parse-name.ts +24 -24
  74. package/src/schematics/utils/devkit-utils/route-utils.js.map +1 -1
  75. package/src/schematics/utils/devkit-utils/route-utils.ts +180 -180
  76. package/src/schematics/utils/devkit-utils/validation.js +1 -1
  77. package/src/schematics/utils/devkit-utils/validation.js.map +1 -1
  78. package/src/schematics/utils/devkit-utils/validation.ts +16 -16
  79. package/src/schematics/utils/html.js.map +1 -1
  80. package/src/schematics/utils/html.ts +63 -63
  81. package/src/schematics/utils/lib-versions.js.map +1 -1
  82. package/src/schematics/utils/lib-versions.ts +3 -3
  83. package/src/schematics/utils/package.js.map +1 -1
  84. package/src/schematics/utils/package.ts +22 -22
  85. package/src/schematics/utils/testing.js.map +1 -1
  86. package/src/schematics/utils/testing.ts +25 -25
  87. package/src/types/enums/Enums.js.map +1 -1
  88. package/src/types/enums/Enums.ts +2063 -2063
  89. package/src/types/enums/generated-file-types.enum.js.map +1 -1
  90. package/src/types/enums/generated-file-types.enum.ts +6 -6
  91. package/src/types/enums/horizontal-alignments.enum.js.map +1 -1
  92. package/src/types/enums/horizontal-alignments.enum.ts +6 -6
  93. package/src/types/enums/themes.enum.js.map +1 -1
  94. package/src/types/enums/themes.enum.ts +6 -6
  95. package/src/types/index.js.map +1 -1
  96. package/src/types/index.ts +8 -8
  97. package/src/types/interfaces/app.js.map +1 -1
  98. package/src/types/interfaces/app.ts +89 -89
  99. package/src/types/interfaces/control.js.map +1 -1
  100. package/src/types/interfaces/control.ts +105 -105
  101. package/src/types/interfaces/template.config.js.map +1 -1
  102. package/src/types/interfaces/template.config.ts +11 -11
  103. package/templates/angular/src/app/app.component.html.ejs +17 -17
  104. package/templates/angular/src/app/cmp-array.ejs +3 -3
  105. package/templates/angular/src/app/cmp-hash.ejs +3 -3
  106. package/templates/angular/src/app/component-list.g.ts +21 -21
  107. package/templates/angular/src/app.component.ts +14 -14
  108. package/templates/angular/src/app.module.ts +72 -72
  109. package/templates/angular/src/app.routes.ts +73 -73
  110. package/templates/angular/src/styles/app.css +5 -5
  111. package/templates/attributes/button_attributes.ejs +2 -2
  112. package/templates/attributes/common/base/class.ejs +6 -6
  113. package/templates/attributes/common/base/control_type.ejs +53 -53
  114. package/templates/attributes/common/base/enabled.ejs +9 -9
  115. package/templates/attributes/common/base/imageFileName.ejs +3 -3
  116. package/templates/attributes/common/base/no_control_class.ejs +3 -3
  117. package/templates/attributes/common/base/rtol.ejs +3 -3
  118. package/templates/attributes/common/base/tabindex.ejs +11 -11
  119. package/templates/attributes/common/base/testingId.ejs +8 -8
  120. package/templates/attributes/common/base/tooltip.ejs +7 -7
  121. package/templates/attributes/common/base/visible.ejs +6 -6
  122. package/templates/attributes/common/base/wallpaper.ejs +3 -3
  123. package/templates/attributes/common/base_attributes.ejs +10 -10
  124. package/templates/attributes/common/container_attributes.ejs +6 -6
  125. package/templates/attributes/common/control_attributes.ejs +3 -3
  126. package/templates/attributes/common/format.ejs +5 -5
  127. package/templates/attributes/common/input/hint.ejs +13 -13
  128. package/templates/attributes/common/input/multiline_edit.ejs +3 -3
  129. package/templates/attributes/common/input/must_input.ejs +8 -8
  130. package/templates/attributes/common/input/password_edit.ejs +7 -7
  131. package/templates/attributes/common/input/row_editing_input_attributes.ejs +6 -6
  132. package/templates/attributes/common/input/validation.ejs +5 -5
  133. package/templates/attributes/common/input_attributes.ejs +4 -4
  134. package/templates/attributes/common/no_control_base_attributes.ejs +4 -4
  135. package/templates/attributes/common/row_editing_button_attributes.ejs +10 -10
  136. package/templates/component/view.component.html +14 -14
  137. package/templates/component/view.component.ts +122 -122
  138. package/templates/themes/basicHTML/Code/theme.module.ts +10 -10
  139. package/templates/themes/basicHTML/combobox.ejs +37 -37
  140. package/templates/themes/basicHTML/edit.ejs +165 -165
  141. package/templates/themes/basicHTML/form.ejs +4 -4
  142. package/templates/themes/basicHTML/group.ejs +4 -4
  143. package/templates/themes/basicHTML/image.ejs +6 -6
  144. package/templates/themes/basicHTML/label.ejs +11 -11
  145. package/templates/themes/basicHTML/listbox.ejs +21 -21
  146. package/templates/themes/basicHTML/push-button.ejs +28 -28
  147. package/templates/themes/basicHTML/radio.ejs +20 -20
  148. package/templates/themes/basicHTML/subform.ejs +6 -6
  149. package/templates/themes/basicHTML/tab.ejs +31 -31
  150. package/templates/themes/basicHTML/tabpage.ejs +5 -5
  151. package/templates/themes/basicHiddenHTML/Code/theme.module.ts +10 -10
  152. package/templates/themes/basicHiddenHTML/combobox.ejs +5 -5
  153. package/templates/themes/basicHiddenHTML/form.ejs +3 -3
  154. package/templates/themes/basicHiddenHTML/group.ejs +2 -2
  155. package/templates/themes/basicHiddenHTML/image.ejs +4 -4
  156. package/templates/themes/basicHiddenHTML/label.ejs +1 -1
  157. package/templates/themes/basicHiddenHTML/listbox.ejs +8 -8
  158. package/templates/themes/basicHiddenHTML/push-button.ejs +26 -26
  159. package/templates/themes/basicHiddenHTML/radio.ejs +17 -17
  160. package/templates/themes/basicHiddenHTML/tab.ejs +13 -13
  161. package/templates/themes/basicHiddenHTML/table.ejs +18 -18
  162. package/templates/themes/basicHiddenHTML/tabpage.ejs +2 -2
  163. package/templates/themes/container.ejs +26 -26
  164. package/templates/themes/control.ejs +52 -52
  165. package/templates/themes/editTypeSelector.ejs +1 -1
  166. package/templates/themes/material/Code/theme.module.ts +68 -68
  167. package/templates/themes/material/base_attributes_date.ejs +8 -8
  168. package/templates/themes/material/combobox.ejs +43 -43
  169. package/templates/themes/material/edit.ejs +200 -200
  170. package/templates/themes/material/group.ejs +3 -3
  171. package/templates/themes/material/listbox.ejs +23 -23
  172. package/templates/themes/material/push-button.ejs +28 -28
  173. package/templates/themes/material/radio.ejs +22 -22
  174. package/templates/themes/material/subform.ejs +8 -8
  175. package/templates/themes/material/tab.ejs +19 -19
  176. package/templates/themes/router_outlet.ejs +5 -5
  177. package/templates/themes/table/HTMLTable/table.ejs +37 -37
  178. package/templates/themes/table/TextEditDialog/textedit.dialog.css +16 -16
  179. package/templates/themes/table/TextEditDialog/textedit.dialog.html +28 -28
  180. package/templates/themes/table/TextEditDialog/textedit.dialog.ts +29 -29
  181. package/templates/themes/table/grid/additionalComponentCode.ejs +26 -26
  182. package/templates/themes/table/grid/additionalIncludes.ejs +1 -1
  183. package/templates/themes/table/grid/table.ejs +37 -37
  184. package/templates/themes/table/repeatable/column.ejs +11 -11
  185. package/templates/themes/table/repeatable/table.ejs +28 -28
  186. package/templates/themes/tableTypeSelector.ejs +21 -21
  187. package/tsconfig.json +36 -36
@@ -12,7 +12,7 @@ const core_1 = require("@angular-devkit/core");
12
12
  const schematics_1 = require("@angular-devkit/schematics");
13
13
  function validateName(name) {
14
14
  if (name && /^\d/.test(name)) {
15
- throw new schematics_1.SchematicsException(core_1.tags.oneLine `name (${name})
15
+ throw new schematics_1.SchematicsException(core_1.tags.oneLine `name (${name})
16
16
  can not start with a digit.`);
17
17
  }
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+CAA4C;AAC5C,2DAAiE;AAEjE,SAAgB,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC5B,MAAM,IAAI,gCAAmB,CAAC,WAAI,CAAC,OAAO,CAAA,SAAS,IAAI;oCACvB,CAAC,CAAC;KACnC;AACH,CAAC;AALD,oCAKC","sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { tags } from '@angular-devkit/core';\nimport { SchematicsException } from '@angular-devkit/schematics';\n\nexport function validateName(name: string): void {\n if (name && /^\\d/.test(name)) {\n throw new SchematicsException(tags.oneLine`name (${name})\n can not start with a digit.`);\n }\n}\n"]}
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+CAA4C;AAC5C,2DAAiE;AAEjE,SAAgB,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC5B,MAAM,IAAI,gCAAmB,CAAC,WAAI,CAAC,OAAO,CAAA,SAAS,IAAI;oCACvB,CAAC,CAAC;KACnC;AACH,CAAC;AALD,oCAKC","sourcesContent":["/**\r\n * @license\r\n * Copyright Google Inc. All Rights Reserved.\r\n *\r\n * Use of this source code is governed by an MIT-style license that can be\r\n * found in the LICENSE file at https://angular.io/license\r\n */\r\nimport { tags } from '@angular-devkit/core';\r\nimport { SchematicsException } from '@angular-devkit/schematics';\r\n\r\nexport function validateName(name: string): void {\r\n if (name && /^\\d/.test(name)) {\r\n throw new SchematicsException(tags.oneLine`name (${name})\r\n can not start with a digit.`);\r\n }\r\n}\r\n"]}
@@ -1,16 +1,16 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- import { tags } from '@angular-devkit/core';
9
- import { SchematicsException } from '@angular-devkit/schematics';
10
-
11
- export function validateName(name: string): void {
12
- if (name && /^\d/.test(name)) {
13
- throw new SchematicsException(tags.oneLine`name (${name})
14
- can not start with a digit.`);
15
- }
16
- }
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { tags } from '@angular-devkit/core';
9
+ import { SchematicsException } from '@angular-devkit/schematics';
10
+
11
+ export function validateName(name: string): void {
12
+ if (name && /^\d/.test(name)) {
13
+ throw new SchematicsException(tags.oneLine`name (${name})
14
+ can not start with a digit.`);
15
+ }
16
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"html.js","sourceRoot":"","sources":["html.ts"],"names":[],"mappings":";;;AAAA,2DAAqE;AACrE,iCAAiC;AACjC,+BAAuC;AACvC,kDAAmD;AAGnD;;;;GAIG;AACH,SAAgB,UAAU,CAAC,IAAU,EAAE,GAAW;IAChD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAC/B,EAAC,YAAY,EAAE,IAAI,EAAC,CAAgC,CAAC;IAEvD,IAAI,IAAI,CAAC;IACT,MAAM,KAAK,GAAG,CAAC,KAAgC,EAAE,EAAE;QACjD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnB,MAAM,OAAO,GAA+B,IAAI,CAAC;YACjD,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM,EAAE;gBAC9B,IAAI,GAAG,OAAO,CAAC;aAChB;iBAAM;gBACL,IAAI,OAAO,CAAC,UAAU,EAAE;oBACtB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;iBAC3B;aACF;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE3B,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,gCAAmB,CAAC,yBAAyB,CAAC,CAAC;KAC1D;IAED,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS;KAC7C,CAAC;AACJ,CAAC;AA3BD,gCA2BC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,IAAU,EAAE,OAAgB,EAAE,IAAY;IACpE,MAAM,SAAS,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,gCAAmB,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;KAC7E;IAED,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC9B,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;QAC5B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACnC,MAAM,SAAS,GAAG,IAAI,qBAAY,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC7C,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;KAC7B;AACH,CAAC;AAfD,kCAeC","sourcesContent":["import {Tree, SchematicsException} from '@angular-devkit/schematics';\nimport * as parse5 from 'parse5';\nimport {getIndexHtmlPath} from './ast';\nimport {InsertChange} from './devkit-utils/change';\nimport {Project} from './devkit-utils/config';\n\n/**\n * Parses the index.html file to get the HEAD tag position.\n * @param host the tree we are traversing\n * @param src the src path of the html file to parse\n */\nexport function getHeadTag(host: Tree, src: string) {\n const document = parse5.parse(src,\n {locationInfo: true}) as parse5.AST.Default.Document;\n\n let head;\n const visit = (nodes: parse5.AST.Default.Node[]) => {\n nodes.forEach(node => {\n const element = <parse5.AST.Default.Element>node;\n if (element.tagName === 'head') {\n head = element;\n } else {\n if (element.childNodes) {\n visit(element.childNodes);\n }\n }\n });\n };\n\n visit(document.childNodes);\n\n if (!head) {\n throw new SchematicsException('Head element not found!');\n }\n\n return {\n position: head.__location.startTag.endOffset\n };\n}\n\n/**\n * Adds a link to the index.html head tag Example:\n * `<link href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500\" rel=\"stylesheet\">`\n * @param host The tree we are updating\n * @param project The project we're targeting.\n * @param link html element string we are inserting.\n */\nexport function addHeadLink(host: Tree, project: Project, link: string) {\n const indexPath = getIndexHtmlPath(host, project);\n const buffer = host.read(indexPath);\n if (!buffer) {\n throw new SchematicsException(`Could not find file for path: ${indexPath}`);\n }\n\n const src = buffer.toString();\n if (src.indexOf(link) === -1) {\n const node = getHeadTag(host, src);\n const insertion = new InsertChange(indexPath, node.position, link);\n const recorder = host.beginUpdate(indexPath);\n recorder.insertLeft(insertion.pos, insertion.toAdd);\n host.commitUpdate(recorder);\n }\n}\n"]}
1
+ {"version":3,"file":"html.js","sourceRoot":"","sources":["html.ts"],"names":[],"mappings":";;;AAAA,2DAAqE;AACrE,iCAAiC;AACjC,+BAAuC;AACvC,kDAAmD;AAGnD;;;;GAIG;AACH,SAAgB,UAAU,CAAC,IAAU,EAAE,GAAW;IAChD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAC/B,EAAC,YAAY,EAAE,IAAI,EAAC,CAAgC,CAAC;IAEvD,IAAI,IAAI,CAAC;IACT,MAAM,KAAK,GAAG,CAAC,KAAgC,EAAE,EAAE;QACjD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnB,MAAM,OAAO,GAA+B,IAAI,CAAC;YACjD,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM,EAAE;gBAC9B,IAAI,GAAG,OAAO,CAAC;aAChB;iBAAM;gBACL,IAAI,OAAO,CAAC,UAAU,EAAE;oBACtB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;iBAC3B;aACF;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE3B,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,gCAAmB,CAAC,yBAAyB,CAAC,CAAC;KAC1D;IAED,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS;KAC7C,CAAC;AACJ,CAAC;AA3BD,gCA2BC;AAED;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,IAAU,EAAE,OAAgB,EAAE,IAAY;IACpE,MAAM,SAAS,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,gCAAmB,CAAC,iCAAiC,SAAS,EAAE,CAAC,CAAC;KAC7E;IAED,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC9B,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;QAC5B,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACnC,MAAM,SAAS,GAAG,IAAI,qBAAY,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC7C,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;KAC7B;AACH,CAAC;AAfD,kCAeC","sourcesContent":["import {Tree, SchematicsException} from '@angular-devkit/schematics';\r\nimport * as parse5 from 'parse5';\r\nimport {getIndexHtmlPath} from './ast';\r\nimport {InsertChange} from './devkit-utils/change';\r\nimport {Project} from './devkit-utils/config';\r\n\r\n/**\r\n * Parses the index.html file to get the HEAD tag position.\r\n * @param host the tree we are traversing\r\n * @param src the src path of the html file to parse\r\n */\r\nexport function getHeadTag(host: Tree, src: string) {\r\n const document = parse5.parse(src,\r\n {locationInfo: true}) as parse5.AST.Default.Document;\r\n\r\n let head;\r\n const visit = (nodes: parse5.AST.Default.Node[]) => {\r\n nodes.forEach(node => {\r\n const element = <parse5.AST.Default.Element>node;\r\n if (element.tagName === 'head') {\r\n head = element;\r\n } else {\r\n if (element.childNodes) {\r\n visit(element.childNodes);\r\n }\r\n }\r\n });\r\n };\r\n\r\n visit(document.childNodes);\r\n\r\n if (!head) {\r\n throw new SchematicsException('Head element not found!');\r\n }\r\n\r\n return {\r\n position: head.__location.startTag.endOffset\r\n };\r\n}\r\n\r\n/**\r\n * Adds a link to the index.html head tag Example:\r\n * `<link href=\"https://fonts.googleapis.com/css?family=Roboto:300,400,500\" rel=\"stylesheet\">`\r\n * @param host The tree we are updating\r\n * @param project The project we're targeting.\r\n * @param link html element string we are inserting.\r\n */\r\nexport function addHeadLink(host: Tree, project: Project, link: string) {\r\n const indexPath = getIndexHtmlPath(host, project);\r\n const buffer = host.read(indexPath);\r\n if (!buffer) {\r\n throw new SchematicsException(`Could not find file for path: ${indexPath}`);\r\n }\r\n\r\n const src = buffer.toString();\r\n if (src.indexOf(link) === -1) {\r\n const node = getHeadTag(host, src);\r\n const insertion = new InsertChange(indexPath, node.position, link);\r\n const recorder = host.beginUpdate(indexPath);\r\n recorder.insertLeft(insertion.pos, insertion.toAdd);\r\n host.commitUpdate(recorder);\r\n }\r\n}\r\n"]}
@@ -1,63 +1,63 @@
1
- import {Tree, SchematicsException} from '@angular-devkit/schematics';
2
- import * as parse5 from 'parse5';
3
- import {getIndexHtmlPath} from './ast';
4
- import {InsertChange} from './devkit-utils/change';
5
- import {Project} from './devkit-utils/config';
6
-
7
- /**
8
- * Parses the index.html file to get the HEAD tag position.
9
- * @param host the tree we are traversing
10
- * @param src the src path of the html file to parse
11
- */
12
- export function getHeadTag(host: Tree, src: string) {
13
- const document = parse5.parse(src,
14
- {locationInfo: true}) as parse5.AST.Default.Document;
15
-
16
- let head;
17
- const visit = (nodes: parse5.AST.Default.Node[]) => {
18
- nodes.forEach(node => {
19
- const element = <parse5.AST.Default.Element>node;
20
- if (element.tagName === 'head') {
21
- head = element;
22
- } else {
23
- if (element.childNodes) {
24
- visit(element.childNodes);
25
- }
26
- }
27
- });
28
- };
29
-
30
- visit(document.childNodes);
31
-
32
- if (!head) {
33
- throw new SchematicsException('Head element not found!');
34
- }
35
-
36
- return {
37
- position: head.__location.startTag.endOffset
38
- };
39
- }
40
-
41
- /**
42
- * Adds a link to the index.html head tag Example:
43
- * `<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">`
44
- * @param host The tree we are updating
45
- * @param project The project we're targeting.
46
- * @param link html element string we are inserting.
47
- */
48
- export function addHeadLink(host: Tree, project: Project, link: string) {
49
- const indexPath = getIndexHtmlPath(host, project);
50
- const buffer = host.read(indexPath);
51
- if (!buffer) {
52
- throw new SchematicsException(`Could not find file for path: ${indexPath}`);
53
- }
54
-
55
- const src = buffer.toString();
56
- if (src.indexOf(link) === -1) {
57
- const node = getHeadTag(host, src);
58
- const insertion = new InsertChange(indexPath, node.position, link);
59
- const recorder = host.beginUpdate(indexPath);
60
- recorder.insertLeft(insertion.pos, insertion.toAdd);
61
- host.commitUpdate(recorder);
62
- }
63
- }
1
+ import {Tree, SchematicsException} from '@angular-devkit/schematics';
2
+ import * as parse5 from 'parse5';
3
+ import {getIndexHtmlPath} from './ast';
4
+ import {InsertChange} from './devkit-utils/change';
5
+ import {Project} from './devkit-utils/config';
6
+
7
+ /**
8
+ * Parses the index.html file to get the HEAD tag position.
9
+ * @param host the tree we are traversing
10
+ * @param src the src path of the html file to parse
11
+ */
12
+ export function getHeadTag(host: Tree, src: string) {
13
+ const document = parse5.parse(src,
14
+ {locationInfo: true}) as parse5.AST.Default.Document;
15
+
16
+ let head;
17
+ const visit = (nodes: parse5.AST.Default.Node[]) => {
18
+ nodes.forEach(node => {
19
+ const element = <parse5.AST.Default.Element>node;
20
+ if (element.tagName === 'head') {
21
+ head = element;
22
+ } else {
23
+ if (element.childNodes) {
24
+ visit(element.childNodes);
25
+ }
26
+ }
27
+ });
28
+ };
29
+
30
+ visit(document.childNodes);
31
+
32
+ if (!head) {
33
+ throw new SchematicsException('Head element not found!');
34
+ }
35
+
36
+ return {
37
+ position: head.__location.startTag.endOffset
38
+ };
39
+ }
40
+
41
+ /**
42
+ * Adds a link to the index.html head tag Example:
43
+ * `<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">`
44
+ * @param host The tree we are updating
45
+ * @param project The project we're targeting.
46
+ * @param link html element string we are inserting.
47
+ */
48
+ export function addHeadLink(host: Tree, project: Project, link: string) {
49
+ const indexPath = getIndexHtmlPath(host, project);
50
+ const buffer = host.read(indexPath);
51
+ if (!buffer) {
52
+ throw new SchematicsException(`Could not find file for path: ${indexPath}`);
53
+ }
54
+
55
+ const src = buffer.toString();
56
+ if (src.indexOf(link) === -1) {
57
+ const node = getHeadTag(host, src);
58
+ const insertion = new InsertChange(indexPath, node.position, link);
59
+ const recorder = host.beginUpdate(indexPath);
60
+ recorder.insertLeft(insertion.pos, insertion.toAdd);
61
+ host.commitUpdate(recorder);
62
+ }
63
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"lib-versions.js","sourceRoot":"","sources":["lib-versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,cAAc,GAAG,QAAQ,CAAC","sourcesContent":["export const materialVersion = '^6.0.0';\nexport const cdkVersion = '^6.0.0';\nexport const angularVersion = '^6.0.0';\n"]}
1
+ {"version":3,"file":"lib-versions.js","sourceRoot":"","sources":["lib-versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,cAAc,GAAG,QAAQ,CAAC","sourcesContent":["export const materialVersion = '^6.0.0';\r\nexport const cdkVersion = '^6.0.0';\r\nexport const angularVersion = '^6.0.0';\r\n"]}
@@ -1,3 +1,3 @@
1
- export const materialVersion = '^6.0.0';
2
- export const cdkVersion = '^6.0.0';
3
- export const angularVersion = '^6.0.0';
1
+ export const materialVersion = '^6.0.0';
2
+ export const cdkVersion = '^6.0.0';
3
+ export const angularVersion = '^6.0.0';
@@ -1 +1 @@
1
- {"version":3,"file":"package.js","sourceRoot":"","sources":["package.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,uBAAuB,CAAC,IAAU,EAAE,IAAY,EAAE,GAAW,EAAE,OAAe;IAC5F,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACf,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;SACjB;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;SAC3B;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;KAC/D;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAhBD,0DAgBC","sourcesContent":["import {Tree} from '@angular-devkit/schematics';\n\n/**\n * Adds a package to the package.json\n */\nexport function addPackageToPackageJson(host: Tree, type: string, pkg: string, version: string): Tree {\n if (host.exists('package.json')) {\n const sourceText = host.read('package.json')!.toString('utf-8');\n const json = JSON.parse(sourceText);\n if (!json[type]) {\n json[type] = {};\n }\n\n if (!json[type][pkg]) {\n json[type][pkg] = version;\n }\n\n host.overwrite('package.json', JSON.stringify(json, null, 2));\n }\n\n return host;\n}\n"]}
1
+ {"version":3,"file":"package.js","sourceRoot":"","sources":["package.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,SAAgB,uBAAuB,CAAC,IAAU,EAAE,IAAY,EAAE,GAAW,EAAE,OAAe;IAC5F,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACpC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACf,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;SACjB;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE;YACpB,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;SAC3B;QAED,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;KAC/D;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAhBD,0DAgBC","sourcesContent":["import {Tree} from '@angular-devkit/schematics';\r\n\r\n/**\r\n * Adds a package to the package.json\r\n */\r\nexport function addPackageToPackageJson(host: Tree, type: string, pkg: string, version: string): Tree {\r\n if (host.exists('package.json')) {\r\n const sourceText = host.read('package.json')!.toString('utf-8');\r\n const json = JSON.parse(sourceText);\r\n if (!json[type]) {\r\n json[type] = {};\r\n }\r\n\r\n if (!json[type][pkg]) {\r\n json[type][pkg] = version;\r\n }\r\n\r\n host.overwrite('package.json', JSON.stringify(json, null, 2));\r\n }\r\n\r\n return host;\r\n}\r\n"]}
@@ -1,22 +1,22 @@
1
- import {Tree} from '@angular-devkit/schematics';
2
-
3
- /**
4
- * Adds a package to the package.json
5
- */
6
- export function addPackageToPackageJson(host: Tree, type: string, pkg: string, version: string): Tree {
7
- if (host.exists('package.json')) {
8
- const sourceText = host.read('package.json')!.toString('utf-8');
9
- const json = JSON.parse(sourceText);
10
- if (!json[type]) {
11
- json[type] = {};
12
- }
13
-
14
- if (!json[type][pkg]) {
15
- json[type][pkg] = version;
16
- }
17
-
18
- host.overwrite('package.json', JSON.stringify(json, null, 2));
19
- }
20
-
21
- return host;
22
- }
1
+ import {Tree} from '@angular-devkit/schematics';
2
+
3
+ /**
4
+ * Adds a package to the package.json
5
+ */
6
+ export function addPackageToPackageJson(host: Tree, type: string, pkg: string, version: string): Tree {
7
+ if (host.exists('package.json')) {
8
+ const sourceText = host.read('package.json')!.toString('utf-8');
9
+ const json = JSON.parse(sourceText);
10
+ if (!json[type]) {
11
+ json[type] = {};
12
+ }
13
+
14
+ if (!json[type][pkg]) {
15
+ json[type][pkg] = version;
16
+ }
17
+
18
+ host.overwrite('package.json', JSON.stringify(json, null, 2));
19
+ }
20
+
21
+ return host;
22
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"testing.js","sourceRoot":"","sources":["testing.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAC1B,gEAAqF;AAErF,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,oDAAoD,CAAC,CAAC;AAElF;;GAEG;AACH,SAAgB,aAAa;IAC3B,MAAM,UAAU,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IACzE,OAAO,UAAU,CAAC,iBAAiB,CAAC,aAAa,EAAE;QACjD,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE,KAAK;QACrB,iBAAiB,EAAE,MAAM;QACzB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;KACf,CAAC,CAAC,SAAS,EAAE,CAAC;AACjB,CAAC;AAhBD,sCAgBC","sourcesContent":["import {join} from 'path';\nimport {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';\n\nconst collectionPath = join('./node_modules/@schematics/angular/collection.json');\n\n/**\n * Create a base app used for testing.\n */\nexport function createTestApp() {\n const baseRunner = new SchematicTestRunner('schematics', collectionPath);\n return baseRunner.runSchematicAsync('application', {\n directory: '',\n name: 'app',\n prefix: 'app',\n sourceDir: 'src',\n inlineStyle: false,\n inlineTemplate: false,\n viewEncapsulation: 'None',\n version: '1.2.3',\n routing: true,\n style: 'scss',\n skipTests: false,\n minimal: false,\n }).toPromise();\n}\n"]}
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["testing.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAC1B,gEAAqF;AAErF,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,oDAAoD,CAAC,CAAC;AAElF;;GAEG;AACH,SAAgB,aAAa;IAC3B,MAAM,UAAU,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IACzE,OAAO,UAAU,CAAC,iBAAiB,CAAC,aAAa,EAAE;QACjD,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,KAAK;QAClB,cAAc,EAAE,KAAK;QACrB,iBAAiB,EAAE,MAAM;QACzB,OAAO,EAAE,OAAO;QAChB,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;KACf,CAAC,CAAC,SAAS,EAAE,CAAC;AACjB,CAAC;AAhBD,sCAgBC","sourcesContent":["import {join} from 'path';\r\nimport {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';\r\n\r\nconst collectionPath = join('./node_modules/@schematics/angular/collection.json');\r\n\r\n/**\r\n * Create a base app used for testing.\r\n */\r\nexport function createTestApp() {\r\n const baseRunner = new SchematicTestRunner('schematics', collectionPath);\r\n return baseRunner.runSchematicAsync('application', {\r\n directory: '',\r\n name: 'app',\r\n prefix: 'app',\r\n sourceDir: 'src',\r\n inlineStyle: false,\r\n inlineTemplate: false,\r\n viewEncapsulation: 'None',\r\n version: '1.2.3',\r\n routing: true,\r\n style: 'scss',\r\n skipTests: false,\r\n minimal: false,\r\n }).toPromise();\r\n}\r\n"]}
@@ -1,25 +1,25 @@
1
- import {join} from 'path';
2
- import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';
3
-
4
- const collectionPath = join('./node_modules/@schematics/angular/collection.json');
5
-
6
- /**
7
- * Create a base app used for testing.
8
- */
9
- export function createTestApp() {
10
- const baseRunner = new SchematicTestRunner('schematics', collectionPath);
11
- return baseRunner.runSchematicAsync('application', {
12
- directory: '',
13
- name: 'app',
14
- prefix: 'app',
15
- sourceDir: 'src',
16
- inlineStyle: false,
17
- inlineTemplate: false,
18
- viewEncapsulation: 'None',
19
- version: '1.2.3',
20
- routing: true,
21
- style: 'scss',
22
- skipTests: false,
23
- minimal: false,
24
- }).toPromise();
25
- }
1
+ import {join} from 'path';
2
+ import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';
3
+
4
+ const collectionPath = join('./node_modules/@schematics/angular/collection.json');
5
+
6
+ /**
7
+ * Create a base app used for testing.
8
+ */
9
+ export function createTestApp() {
10
+ const baseRunner = new SchematicTestRunner('schematics', collectionPath);
11
+ return baseRunner.runSchematicAsync('application', {
12
+ directory: '',
13
+ name: 'app',
14
+ prefix: 'app',
15
+ sourceDir: 'src',
16
+ inlineStyle: false,
17
+ inlineTemplate: false,
18
+ viewEncapsulation: 'None',
19
+ version: '1.2.3',
20
+ routing: true,
21
+ style: 'scss',
22
+ skipTests: false,
23
+ minimal: false,
24
+ }).toPromise();
25
+ }