@coolon/angular-ui-powerups 14.35.0 → 14.35.1

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 (166) hide show
  1. package/esm2020/lib/interaction/activity.mjs +2 -1
  2. package/esm2020/lib/interaction/components/activity-container/activity-container.component.mjs +43 -19
  3. package/esm2020/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.mjs +30 -4
  4. package/esm2020/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.mjs +2 -1
  5. package/fesm2015/coolon-angular-ui-powerups.mjs +71 -21
  6. package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
  7. package/fesm2020/coolon-angular-ui-powerups.mjs +71 -21
  8. package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
  9. package/lib/interaction/components/activity-container/activity-container.component.d.ts +10 -1
  10. package/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.d.ts +3 -1
  11. package/lib/interaction/services/mat-dialog-interaction/dialog-interaction-context.d.ts +2 -2
  12. package/package.json +1 -1
  13. package/schematics/activity/index.d.ts +0 -3
  14. package/schematics/activity/index.js +0 -32
  15. package/schematics/activity/index.js.map +0 -1
  16. package/schematics/activity/index.spec.d.ts +0 -1
  17. package/schematics/activity/index.spec.js +0 -364
  18. package/schematics/activity/index.spec.js.map +0 -1
  19. package/schematics/activity/schema.d.ts +0 -4
  20. package/schematics/activity/schema.js +0 -3
  21. package/schematics/activity/schema.js.map +0 -1
  22. package/schematics/activity/schema.json +0 -27
  23. package/schematics/activity/templates/component/__name@dasherize__.component.html.template +0 -5
  24. package/schematics/activity/templates/component/__name@dasherize__.component.scss.template +0 -4
  25. package/schematics/activity/templates/component/__name@dasherize__.component.spec.ts.template +0 -25
  26. package/schematics/activity/templates/component/__name@dasherize__.component.ts.template +0 -40
  27. package/schematics/activity/templates/component/__name@dasherize__.i18n.yml.template +0 -9
  28. package/schematics/aup-i18n/index.d.ts +0 -4
  29. package/schematics/aup-i18n/index.js +0 -86
  30. package/schematics/aup-i18n/index.js.map +0 -1
  31. package/schematics/aup-i18n/schema.d.ts +0 -3
  32. package/schematics/aup-i18n/schema.js +0 -3
  33. package/schematics/aup-i18n/schema.js.map +0 -1
  34. package/schematics/aup-i18n/schema.json +0 -18
  35. package/schematics/aup-i18n/templates/app/aup.i18n.yml.template +0 -80
  36. package/schematics/bootstrap-app/index.d.ts +0 -4
  37. package/schematics/bootstrap-app/index.js +0 -109
  38. package/schematics/bootstrap-app/index.js.map +0 -1
  39. package/schematics/bootstrap-app/schema.d.ts +0 -3
  40. package/schematics/bootstrap-app/schema.js +0 -3
  41. package/schematics/bootstrap-app/schema.js.map +0 -1
  42. package/schematics/bootstrap-app/schema.json +0 -18
  43. package/schematics/bootstrap-app/templates/i18n.config.json.template +0 -11
  44. package/schematics/bootstrap-app/templates/src/app/app-routing.module.ts.template +0 -23
  45. package/schematics/bootstrap-app/templates/src/app/app.component.html.template +0 -7
  46. package/schematics/bootstrap-app/templates/src/app/app.component.scss.template +0 -12
  47. package/schematics/bootstrap-app/templates/src/app/app.component.ts.template +0 -19
  48. package/schematics/bootstrap-app/templates/src/app/app.module.ts.template +0 -74
  49. package/schematics/bootstrap-app/templates/src/app/components/components.module.ts.template +0 -16
  50. package/schematics/bootstrap-app/templates/src/app/i18n.ts.template +0 -9
  51. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.eot +0 -0
  52. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.ijmap +0 -1
  53. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.svg +0 -2373
  54. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.ttf +0 -0
  55. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.woff +0 -0
  56. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.woff2 +0 -0
  57. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/codepoints +0 -932
  58. package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/material-icons.css +0 -36
  59. package/schematics/bootstrap-app/templates/src/index.html.template +0 -13
  60. package/schematics/bootstrap-app/templates/src/styles/global-variables.scss.template +0 -13
  61. package/schematics/bootstrap-app/templates/src/styles.scss.template +0 -85
  62. package/schematics/collection.json +0 -48
  63. package/schematics/component/index.d.ts +0 -3
  64. package/schematics/component/index.js +0 -32
  65. package/schematics/component/index.js.map +0 -1
  66. package/schematics/component/index.spec.d.ts +0 -1
  67. package/schematics/component/index.spec.js +0 -364
  68. package/schematics/component/index.spec.js.map +0 -1
  69. package/schematics/component/schema.d.ts +0 -4
  70. package/schematics/component/schema.js +0 -3
  71. package/schematics/component/schema.js.map +0 -1
  72. package/schematics/component/schema.json +0 -27
  73. package/schematics/component/templates/component/__name@dasherize__.component.html.template +0 -1
  74. package/schematics/component/templates/component/__name@dasherize__.component.scss.template +0 -4
  75. package/schematics/component/templates/component/__name@dasherize__.component.spec.ts.template +0 -25
  76. package/schematics/component/templates/component/__name@dasherize__.component.ts.template +0 -23
  77. package/schematics/component/templates/component/__name@dasherize__.i18n.yml.template +0 -1
  78. package/schematics/ng-add/index.d.ts +0 -3
  79. package/schematics/ng-add/index.js +0 -37
  80. package/schematics/ng-add/index.js.map +0 -1
  81. package/schematics/package-util.d.ts +0 -13
  82. package/schematics/package-util.js +0 -61
  83. package/schematics/package-util.js.map +0 -1
  84. package/schematics/place-add/index.d.ts +0 -3
  85. package/schematics/place-add/index.js +0 -37
  86. package/schematics/place-add/index.js.map +0 -1
  87. package/schematics/place-add/index.spec.d.ts +0 -1
  88. package/schematics/place-add/index.spec.js +0 -364
  89. package/schematics/place-add/index.spec.js.map +0 -1
  90. package/schematics/place-add/schema.d.ts +0 -4
  91. package/schematics/place-add/schema.js +0 -3
  92. package/schematics/place-add/schema.js.map +0 -1
  93. package/schematics/place-add/schema.json +0 -27
  94. package/schematics/place-add/templates/component/__name@dasherize__.component.html.template +0 -1
  95. package/schematics/place-add/templates/component/__name@dasherize__.component.scss.template +0 -5
  96. package/schematics/place-add/templates/component/__name@dasherize__.component.spec.ts.template +0 -25
  97. package/schematics/place-add/templates/component/__name@dasherize__.component.ts.template +0 -33
  98. package/schematics/place-add/templates/component/__name@dasherize__.i18n.yml.template +0 -5
  99. package/schematics/place-bootstrap/index.d.ts +0 -3
  100. package/schematics/place-bootstrap/index.js +0 -21
  101. package/schematics/place-bootstrap/index.js.map +0 -1
  102. package/schematics/place-bootstrap/schema.d.ts +0 -4
  103. package/schematics/place-bootstrap/schema.js +0 -3
  104. package/schematics/place-bootstrap/schema.js.map +0 -1
  105. package/schematics/place-bootstrap/schema.json +0 -28
  106. package/schematics/place-bootstrap/templates/__name@dasherize__/place-routes.ts.template +0 -3
  107. package/schematics/place-bootstrap/templates/__name@dasherize__/places.module.ts.template +0 -16
  108. package/schematics/place-routes/index.d.ts +0 -3
  109. package/schematics/place-routes/index.js +0 -24
  110. package/schematics/place-routes/index.js.map +0 -1
  111. package/schematics/place-routes/place-builder.d.ts +0 -18
  112. package/schematics/place-routes/place-builder.js +0 -123
  113. package/schematics/place-routes/place-builder.js.map +0 -1
  114. package/schematics/place-routes/place-class-scanner.d.ts +0 -47
  115. package/schematics/place-routes/place-class-scanner.js +0 -223
  116. package/schematics/place-routes/place-class-scanner.js.map +0 -1
  117. package/schematics/place-routes/place-def.d.ts +0 -62
  118. package/schematics/place-routes/place-def.js +0 -195
  119. package/schematics/place-routes/place-def.js.map +0 -1
  120. package/schematics/place-routes/schema.d.ts +0 -4
  121. package/schematics/place-routes/schema.js +0 -3
  122. package/schematics/place-routes/schema.js.map +0 -1
  123. package/schematics/place-routes/schema.json +0 -25
  124. package/schematics/place-routes/templates/place-routes.ts.template +0 -14
  125. package/schematics/utils/build-context.d.ts +0 -73
  126. package/schematics/utils/build-context.js +0 -184
  127. package/schematics/utils/build-context.js.map +0 -1
  128. package/schematics/utils/decorators/decorated-class.d.ts +0 -13
  129. package/schematics/utils/decorators/decorated-class.js +0 -28
  130. package/schematics/utils/decorators/decorated-class.js.map +0 -1
  131. package/schematics/utils/decorators/decorated-source-file.d.ts +0 -15
  132. package/schematics/utils/decorators/decorated-source-file.js +0 -27
  133. package/schematics/utils/decorators/decorated-source-file.js.map +0 -1
  134. package/schematics/utils/import-def.d.ts +0 -30
  135. package/schematics/utils/import-def.js +0 -97
  136. package/schematics/utils/import-def.js.map +0 -1
  137. package/schematics/utils/method-scanner.d.ts +0 -16
  138. package/schematics/utils/method-scanner.js +0 -70
  139. package/schematics/utils/method-scanner.js.map +0 -1
  140. package/schematics/utils/mixin.d.ts +0 -11
  141. package/schematics/utils/mixin.js +0 -27
  142. package/schematics/utils/mixin.js.map +0 -1
  143. package/schematics/utils/parameter-def.d.ts +0 -5
  144. package/schematics/utils/parameter-def.js +0 -3
  145. package/schematics/utils/parameter-def.js.map +0 -1
  146. package/schematics/utils/path-helper.d.ts +0 -14
  147. package/schematics/utils/path-helper.js +0 -30
  148. package/schematics/utils/path-helper.js.map +0 -1
  149. package/schematics/utils/schematic-tree-file-system.d.ts +0 -30
  150. package/schematics/utils/schematic-tree-file-system.js +0 -113
  151. package/schematics/utils/schematic-tree-file-system.js.map +0 -1
  152. package/schematics/utils/source-file-scanner.d.ts +0 -14
  153. package/schematics/utils/source-file-scanner.js +0 -89
  154. package/schematics/utils/source-file-scanner.js.map +0 -1
  155. package/schematics/utils/source-file-utilities.d.ts +0 -6
  156. package/schematics/utils/source-file-utilities.js +0 -35
  157. package/schematics/utils/source-file-utilities.js.map +0 -1
  158. package/schematics/utils/stringy.d.ts +0 -15
  159. package/schematics/utils/stringy.js +0 -50
  160. package/schematics/utils/stringy.js.map +0 -1
  161. package/schematics/utils/template-utilities.d.ts +0 -2
  162. package/schematics/utils/template-utilities.js +0 -24
  163. package/schematics/utils/template-utilities.js.map +0 -1
  164. package/schematics/utils/workspace.d.ts +0 -15
  165. package/schematics/utils/workspace.js +0 -59
  166. package/schematics/utils/workspace.js.map +0 -1
@@ -1,27 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "AddComponentSchematic",
4
- "type": "object",
5
- "description": "Add a new component",
6
- "properties": {
7
- "project": {
8
- "type": "string",
9
- "description": "The name of the project.",
10
- "$default": {
11
- "$source": "projectName"
12
- }
13
- },
14
- "name": {
15
- "type": "string",
16
- "description": "The name of the component.",
17
- "$default": {
18
- "$source": "argv",
19
- "index": 0
20
- },
21
- "x-prompt": "What name would you like to use for the component?"
22
- }
23
- },
24
- "required": [
25
- "name"
26
- ]
27
- }
@@ -1,4 +0,0 @@
1
- :host {
2
- display: flex;
3
- flex-direction: column;
4
- }
@@ -1,25 +0,0 @@
1
- import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { <%=capitalize(camelize(name))%>Component } from './<%=dasherize(name)%>.component';
4
-
5
- describe('<%=capitalize(camelize(name))%>Component', () => {
6
- let component: <%=capitalize(camelize(name))%>Component;
7
- let fixture: ComponentFixture<<%=capitalize(camelize(name))%>Component>;
8
-
9
- beforeEach(async(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [ <%=capitalize(camelize(name))%>Component ]
12
- })
13
- .compileComponents();
14
- }));
15
-
16
- beforeEach(() => {
17
- fixture = TestBed.createComponent(<%=capitalize(camelize(name))%>Component);
18
- component = fixture.componentInstance;
19
- fixture.detectChanges();
20
- });
21
-
22
- it('should create', () => {
23
- expect(component).toBeTruthy();
24
- });
25
- });
@@ -1,23 +0,0 @@
1
- import { Component, OnInit } from '@angular/core';
2
- import {Dsl, Command, StoreInValueModel, TrackExternal, ValueModel} from '@coolon/pectin';
3
- import { DisposableComponent } from '@coolon/angular-ui-powerups';
4
- import { I18n } from '<%=pathToRoot%>/i18n';
5
-
6
- @Component({
7
- selector: '<%=selectorPrefix%>-<%=dasherize(name)%>',
8
- templateUrl: './<%=dasherize(name)%>.component.html',
9
- styleUrls: ['./<%=dasherize(name)%>.component.scss'],
10
- })
11
- export class <%=capitalize(camelize(name))%>Component extends DisposableComponent implements OnInit {
12
-
13
- readonly i18n = <%=i18nNamespace%>;
14
-
15
- constructor() {
16
- super();
17
- const {chain} = Dsl.disposeWith(this);
18
- }
19
-
20
- ngOnInit() {
21
- }
22
-
23
- }
@@ -1 +0,0 @@
1
- name: "<%=capitalize(camelize(name))%>"
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export declare function ngAdd(_options: any): Rule;
3
- export declare function installDependencies(_options: any): Rule;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installDependencies = exports.ngAdd = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const tasks_1 = require("@angular-devkit/schematics/tasks");
6
- const package_util_1 = require("../package-util");
7
- // Just return the tree
8
- function ngAdd(_options) {
9
- return (0, schematics_1.chain)([
10
- (tree, _context) => {
11
- _context.addTask(new tasks_1.NodePackageInstallTask());
12
- return tree;
13
- },
14
- installDependencies(_options)
15
- ]);
16
- }
17
- exports.ngAdd = ngAdd;
18
- function installDependencies(_options) {
19
- return (tree, _) => {
20
- return (0, package_util_1.updatePackageJson)(tree, draft => {
21
- draft.scripts = Object.assign(Object.assign({}, draft.scripts), { "place-routes": "run-s place-routes:**", "i18n": "run-s i18n:**", "watch": "npm-watch" });
22
- draft.dependencies = Object.assign(Object.assign({}, draft.dependencies), { "@coolon/i18n-resource-generator": "^3.0.2", "@coolon/pectin": "3.11.1", "@coolon/typescript-utilities": "^2.2.0", "@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/fontawesome-free": "5.15.3", "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-solid-svg-icons": "^5.15.3", "@js-joda/core": "^3.2.0", "@js-joda/locale": "^3.2.0", "@js-joda/timezone": "^2.3.0", "immer": "^7.0.5", "typescript-string-enums": "^1.0.0", "format-message-interpret": "^6.2.3", "moment": "^2.18.1" });
23
- draft.devDependencies = Object.assign(Object.assign({}, draft.devDependencies), { "husky": "^4.2.0", "cypress-wait-until": "^1.6.1", "barrelsby": "^2.1.1", "dotenv": "6.2.0", "cz-conventional-changelog": "^3.1.0", "@commitlint/cli": "^8.3.5", "git-is-clean": "^3.0.1", "shx": "^0.3.2", 'standard-version': '^8.0.0', "npm-watch": "^0.7.0" });
24
- draft.watch = Object.assign({}, draft.watch);
25
- draft.config = Object.assign(Object.assign({}, draft.config), { commitizen: {
26
- path: './node_modules/cz-conventional-changelog'
27
- } });
28
- draft.husky = {
29
- "hooks": {
30
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
31
- }
32
- };
33
- });
34
- };
35
- }
36
- exports.installDependencies = installDependencies;
37
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,4DAA0E;AAC1E,kDAAoD;AAEpD,uBAAuB;AACvB,SAAgB,KAAK,CAAC,QAAa;IACjC,OAAO,IAAA,kBAAK,EAAC;QACX,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;YACzC,QAAQ,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;YAC/C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,mBAAmB,CAAC,QAAQ,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC;AARD,sBAQC;AAED,SAAgB,mBAAmB,CAAC,QAAa;IAC/C,OAAO,CAAC,IAAU,EAAE,CAAmB,EAAQ,EAAE;QAC/C,OAAO,IAAA,gCAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,EAAE;YACrC,KAAK,CAAC,OAAO,mCACR,KAAK,CAAC,OAAO,KAChB,cAAc,EAAE,uBAAuB,EACvC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,WAAW,GACrB,CAAC;YAEF,KAAK,CAAC,YAAY,mCACb,KAAK,CAAC,YAAY,KACrB,iCAAiC,EAAE,QAAQ,EAC3C,gBAAgB,EAAE,QAAQ,EAC1B,8BAA8B,EAAE,QAAQ,EACxC,kCAAkC,EAAE,QAAQ,EAC5C,+BAA+B,EAAE,QAAQ,EACzC,mCAAmC,EAAE,SAAS,EAC9C,mCAAmC,EAAE,SAAS,EAC9C,eAAe,EAAE,QAAQ,EACzB,iBAAiB,EAAE,QAAQ,EAC3B,mBAAmB,EAAE,QAAQ,EAC7B,OAAO,EAAE,QAAQ,EACjB,yBAAyB,EAAE,QAAQ,EACnC,0BAA0B,EAAE,QAAQ,EACpC,QAAQ,EAAE,SAAS,GACpB,CAAC;YAEF,KAAK,CAAC,eAAe,mCAChB,KAAK,CAAC,eAAe,KACxB,OAAO,EAAE,QAAQ,EACjB,oBAAoB,EAAE,QAAQ,EAC9B,WAAW,EAAE,QAAQ,EACrB,QAAQ,EAAE,OAAO,EACjB,2BAA2B,EAAE,QAAQ,EACrC,iBAAiB,EAAE,QAAQ,EAC3B,cAAc,EAAE,QAAQ,EACxB,KAAK,EAAE,QAAQ,EACf,kBAAkB,EAAE,QAAQ,EAC5B,WAAW,EAAE,QAAQ,GACtB,CAAC;YAEF,KAAK,CAAC,KAAK,qBACN,KAAK,CAAC,KAAK,CACf,CAAA;YAED,KAAK,CAAC,MAAM,mCACP,KAAK,CAAC,MAAM,KACf,UAAU,EAAE;oBACV,IAAI,EAAE,0CAA0C;iBACjD,GACF,CAAC;YAEF,KAAK,CAAC,KAAK,GAAG;gBACZ,OAAO,EAAE;oBACP,YAAY,EAAE,gCAAgC;iBAC/C;aACF,CAAC;QAEJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA7DD,kDA6DC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright Google LLC 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 { Tree } from '@angular-devkit/schematics';
9
- /**
10
- * Sorts the keys of the given object.
11
- * @returns A new object instance with sorted keys
12
- */
13
- export declare function updatePackageJson(host: Tree, callback: (draft: any) => void): Tree;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google LLC All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.updatePackageJson = void 0;
11
- /**
12
- * Sorts the keys of the given object.
13
- * @returns A new object instance with sorted keys
14
- */
15
- // function sortObjectByKeys(obj: object) {
16
- // return Object.keys(obj).sort().reduce((result, key) => (result[key] = obj[key]) && result, {});
17
- // }
18
- function updatePackageJson(host, callback) {
19
- const sourceText = host.read('package.json').toString('utf-8');
20
- const json = JSON.parse(sourceText);
21
- callback(json);
22
- host.overwrite('package.json', JSON.stringify(json, null, 2));
23
- return host;
24
- }
25
- exports.updatePackageJson = updatePackageJson;
26
- // /** Adds a package to the package.json in the given host tree. */
27
- // export function addPackageToPackageJson(host: Tree, pkg: string, version: string): Tree {
28
- //
29
- // if (host.exists('package.json')) {
30
- // const sourceText = host.read('package.json').toString('utf-8');
31
- // const json = JSON.parse(sourceText);
32
- //
33
- // if (!json.dependencies) {
34
- // json.dependencies = {};
35
- // }
36
- //
37
- // if (!json.dependencies[pkg]) {
38
- // json.dependencies[pkg] = version;
39
- // json.dependencies = sortObjectByKeys(json.dependencies);
40
- // }
41
- //
42
- // host.overwrite('package.json', JSON.stringify(json, null, 2));
43
- // }
44
- //
45
- // return host;
46
- // }
47
- // /** Gets the version of the specified package by looking at the package.json in the given tree. */
48
- // export function getPackageVersionFromPackageJson(tree: Tree, name: string): string | null {
49
- // if (!tree.exists('package.json')) {
50
- // return null;
51
- // }
52
- //
53
- // const packageJson = JSON.parse(tree.read('package.json')!.toString('utf8'));
54
- //
55
- // if (packageJson.dependencies && packageJson.dependencies[name]) {
56
- // return packageJson.dependencies[name];
57
- // }
58
- //
59
- // return null;
60
- // }
61
- //# sourceMappingURL=package-util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-util.js","sourceRoot":"","sources":["../../../../libs/angular-ui-powerups/schematics/package-util.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAIH;;;GAGG;AACH,2CAA2C;AAC3C,oGAAoG;AACpG,IAAI;AAGJ,SAAgB,iBAAiB,CAAC,IAAU,EAAE,QAA6B;IACzE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAEpC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEf,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,OAAO,IAAI,CAAC;AACd,CAAC;AARD,8CAQC;AAED,oEAAoE;AACpE,4FAA4F;AAC5F,EAAE;AACF,uCAAuC;AACvC,sEAAsE;AACtE,2CAA2C;AAC3C,EAAE;AACF,gCAAgC;AAChC,gCAAgC;AAChC,QAAQ;AACR,EAAE;AACF,qCAAqC;AACrC,0CAA0C;AAC1C,iEAAiE;AACjE,QAAQ;AACR,EAAE;AACF,qEAAqE;AACrE,MAAM;AACN,EAAE;AACF,iBAAiB;AACjB,IAAI;AAEJ,qGAAqG;AACrG,8FAA8F;AAC9F,wCAAwC;AACxC,mBAAmB;AACnB,MAAM;AACN,EAAE;AACF,iFAAiF;AACjF,EAAE;AACF,sEAAsE;AACtE,6CAA6C;AAC7C,MAAM;AACN,EAAE;AACF,iBAAiB;AACjB,IAAI"}
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { Schema } from './schema';
3
- export declare function addPlace(_options: Schema): Rule;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addPlace = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const stringy_1 = require("../utils/stringy");
6
- const template_utilities_1 = require("../utils/template-utilities");
7
- const workspace_1 = require("../utils/workspace");
8
- function addPlace(_options) {
9
- return (tree, context) => {
10
- const workspace = workspace_1.Workspace.load(tree, context);
11
- const buildContext = workspace.getApplication(_options.project);
12
- const nameParts = _options.name.split('/');
13
- const componentName = nameParts[nameParts.length - 1];
14
- const componentPathParts = nameParts.slice(0, nameParts.length - 1);
15
- const pathToSourceRoot = [buildContext.sourceCodeRoot].concat(componentPathParts);
16
- const placeModulePath = buildContext.findFileInAncestorPath(pathToSourceRoot, 'places.module.ts');
17
- if (!placeModulePath) {
18
- throw new Error(`Places must be created in or under a directory containing a 'places.module.ts'. I couldn't find one in ${pathToSourceRoot.join('/')} or in any ancestor of it. You can run ng g @coolon/angular-ui-powerups:place-bootstrap --dir=<directory> to initialise one`);
19
- }
20
- // we'll let angular do it by just create a default component then we'll clobber it with our real templates later.
21
- const updateModule = (0, schematics_1.externalSchematic)('@schematics/angular', 'component', {
22
- project: _options.project,
23
- name: _options.name,
24
- module: placeModulePath.slice(buildContext.sourceCodeRoot.length)
25
- });
26
- const i18nNamespace = `I18n.${componentPathParts.concat(componentName).map(p => stringy_1.Stringy.from(p).camelizeLower().toString()).join('.')}`;
27
- const componentFiles = (0, template_utilities_1.applyTemplatesWithOverwrite)(tree, 'templates/component', {
28
- name: componentName,
29
- selectorPrefix: buildContext.selectorPrefix,
30
- pathToRoot: pathToSourceRoot.map(p => '..').join('/'),
31
- i18nNamespace
32
- }, `${(pathToSourceRoot.join('/'))}/${componentName}`);
33
- return (0, schematics_1.chain)([updateModule, componentFiles])(tree, context);
34
- };
35
- }
36
- exports.addPlace = addPlace;
37
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAAoG;AACpG,8CAA2C;AAC3C,oEAA0E;AAC1E,kDAA+C;AAI/C,SAAgB,QAAQ,CAAC,QAAgB;IAEvC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAE/C,MAAM,SAAS,GAAG,qBAAS,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,YAAY,GAAG,SAAS,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEhE,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC3C,MAAM,aAAa,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACtD,MAAM,kBAAkB,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpE,MAAM,gBAAgB,GAAG,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAClF,MAAM,eAAe,GAAG,YAAY,CAAC,sBAAsB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;QAClG,IAAI,CAAC,eAAe,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,2GAA2G,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,6HAA6H,CAAC,CAAC;SACrR;QACD,kHAAkH;QAClH,MAAM,YAAY,GAAG,IAAA,8BAAiB,EAAC,qBAAqB,EAAE,WAAW,EAAE;YACzE,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC;SAClE,CAAC,CAAC;QAEH,MAAM,aAAa,GAAG,QAAQ,kBAAkB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,iBAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAExI,MAAM,cAAc,GAAG,IAAA,gDAA2B,EAChD,IAAI,EACJ,qBAAqB,EACrB;YACE,IAAI,EAAE,aAAa;YACnB,cAAc,EAAE,YAAY,CAAC,cAAc;YAC3C,UAAU,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;YACrD,aAAa;SACd,EACD,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,aAAa,EAAE,CACnD,CAAC;QAGF,OAAO,IAAA,kBAAK,EAAC,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE9D,CAAC,CAAC;AAEJ,CAAC;AAzCD,4BAyCC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,364 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- /**
13
- * @license
14
- * Copyright Google Inc. All Rights Reserved.
15
- *
16
- * Use of this source code is governed by an MIT-style license that can be
17
- * found in the LICENSE file at https://angular.io/license
18
- */
19
- // tslint:disable:no-big-function
20
- const testing_1 = require("@angular-devkit/schematics/testing");
21
- // import { Schema as ApplicationOptions } from '../application/schema';
22
- // import { createAppModule } from '../utility/test';
23
- // import { Schema as WorkspaceOptions } from '../workspace/schema';
24
- // import { ChangeDetection, Schema as ComponentOptions, Style } from './schema';
25
- describe('Add Place Schematic', () => {
26
- const schematicRunner = new testing_1.SchematicTestRunner('@coolon/angular-ui-powerups', require.resolve('../collection.json'));
27
- const workspaceOptions = {
28
- name: 'testWorkspace',
29
- newProjectRoot: 'apps',
30
- version: '10.1.1'
31
- };
32
- // const appOptions: ApplicationOptions = {
33
- const appOptions = {
34
- name: 'bar',
35
- routing: true,
36
- prefix: 'the-prefix',
37
- };
38
- const defaultOptions = {
39
- project: appOptions.name,
40
- name: 'places/new-place'
41
- };
42
- let appTree;
43
- beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
44
- appTree = yield schematicRunner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise();
45
- appTree = yield schematicRunner.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree).toPromise();
46
- appTree = yield schematicRunner
47
- .runSchematicAsync('bootstrap-app', {
48
- project: appOptions.name,
49
- initialPlaceName: undefined // need to disable this for the test as bootstrap will invoke us if specified
50
- }, appTree)
51
- .toPromise();
52
- }));
53
- it('should create a component', () => __awaiter(void 0, void 0, void 0, function* () {
54
- const options = Object.assign({}, defaultOptions);
55
- const tree = yield schematicRunner.runSchematicAsync('place-add', options, appTree).toPromise();
56
- const files = tree.files;
57
- expect(files).toEqual(jasmine.arrayContaining([
58
- '/apps/bar/src/app/places/new-place/new-place.component.scss',
59
- '/apps/bar/src/app/places/new-place/new-place.component.html',
60
- '/apps/bar/src/app/places/new-place/new-place.component.spec.ts',
61
- '/apps/bar/src/app/places/new-place/new-place.component.ts'
62
- ]));
63
- const moduleContent = tree.readContent('/apps/bar/src/app/places/new-place/new-place.component.ts');
64
- expect(moduleContent).toMatch(/export class NewPlaceComponent extends PlaceComponent/);
65
- expect(moduleContent).toMatch(/path: 'new-place'/);
66
- expect(moduleContent).toMatch(/nav: I18n.places.newPlace.nav/);
67
- expect(moduleContent).toMatch(/selector: 'the-prefix-new-place'/);
68
- expect(moduleContent).toMatch(/import.*I18n.*from '\.\.\/\.\.\/i18n'/);
69
- }));
70
- it('should add it to the place module', () => __awaiter(void 0, void 0, void 0, function* () {
71
- const options = Object.assign({}, defaultOptions);
72
- const tree = yield schematicRunner.runSchematicAsync('place-add', options, appTree).toPromise();
73
- // const moduleContent = tree.readContent('/projects/bar/src/app/app.module.ts');
74
- // expect(moduleContent).toMatch(/import.*Foo.*from '.\/foo\/foo.component'/);
75
- // expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+FooComponent\r?\n/m);
76
- }));
77
- it('should create an i18n file', () => __awaiter(void 0, void 0, void 0, function* () {
78
- const options = Object.assign({}, defaultOptions);
79
- const tree = yield schematicRunner.runSchematicAsync('place-add', options, appTree).toPromise();
80
- const files = tree.files;
81
- expect(files).toEqual(jasmine.arrayContaining([
82
- '/apps/bar/src/i18n/places/new-place.yml',
83
- ]));
84
- }));
85
- // it('should set change detection to OnPush', async () => {
86
- // const options = { ...defaultOptions, changeDetection: 'OnPush' };
87
- //
88
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
89
- // const tsContent = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
90
- // expect(tsContent).toMatch(/changeDetection: ChangeDetectionStrategy.OnPush/);
91
- // });
92
- // it('should not set view encapsulation', async () => {
93
- // const options = { ...defaultOptions };
94
- //
95
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
96
- // const tsContent = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
97
- // expect(tsContent).not.toMatch(/encapsulation: ViewEncapsulation/);
98
- // });
99
- //
100
- // it('should set view encapsulation to Emulated', async () => {
101
- // const options = { ...defaultOptions, viewEncapsulation: 'Emulated' };
102
- //
103
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
104
- // const tsContent = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
105
- // expect(tsContent).toMatch(/encapsulation: ViewEncapsulation.Emulated/);
106
- // });
107
- //
108
- // it('should set view encapsulation to None', async () => {
109
- // const options = { ...defaultOptions, viewEncapsulation: 'None' };
110
- //
111
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
112
- // const tsContent = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
113
- // expect(tsContent).toMatch(/encapsulation: ViewEncapsulation.None/);
114
- // });
115
- // it('should create a flat component', async () => {
116
- // const options = { ...defaultOptions, flat: true };
117
- //
118
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
119
- // const files = tree.files;
120
- // expect(files).toEqual(
121
- // jasmine.arrayContaining([
122
- // '/projects/bar/src/app/foo.component.css',
123
- // '/projects/bar/src/app/foo.component.html',
124
- // '/projects/bar/src/app/foo.component.spec.ts',
125
- // '/projects/bar/src/app/foo.component.ts',
126
- // ]),
127
- // );
128
- // });
129
- // it('should find the closest module', async () => {
130
- // const options = { ...defaultOptions };
131
- // const fooModule = '/projects/bar/src/app/foo/foo.module.ts';
132
- // appTree.create(
133
- // fooModule,
134
- // `
135
- // import { NgModule } from '@angular/core';
136
- // @NgModule({
137
- // imports: [],
138
- // declarations: []
139
- // })
140
- // export class FooModule { }
141
- // `
142
- // );
143
- //
144
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
145
- // const fooModuleContent = tree.readContent(fooModule);
146
- // expect(fooModuleContent).toMatch(/import { FooComponent } from '.\/foo.component'/);
147
- // });
148
- // it('should export the component', async () => {
149
- // const options = { ...defaultOptions, export: true };
150
- //
151
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
152
- // const appModuleContent = tree.readContent('/projects/bar/src/app/app.module.ts');
153
- // expect(appModuleContent).toMatch(/exports: \[FooComponent\]/);
154
- // });
155
- // it('should set the entry component', async () => {
156
- // const options = { ...defaultOptions, entryComponent: true };
157
- //
158
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
159
- // const appModuleContent = tree.readContent('/projects/bar/src/app/app.module.ts');
160
- // expect(appModuleContent).toMatch(/entryComponents: \[FooComponent\]/);
161
- // });
162
- // it('should import into a specified module', async () => {
163
- // const options = { ...defaultOptions, module: 'app.module.ts' };
164
- //
165
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
166
- // const appModule = tree.readContent('/projects/bar/src/app/app.module.ts');
167
- //
168
- // expect(appModule).toMatch(/import { FooComponent } from '.\/foo\/foo.component'/);
169
- // });
170
- // it('should fail if specified module does not exist', async () => {
171
- // const options = { ...defaultOptions, module: '/projects/bar/src/app.moduleXXX.ts' };
172
- // let thrownError: Error | null = null;
173
- // try {
174
- // await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
175
- // } catch (err) {
176
- // thrownError = err;
177
- // }
178
- // expect(thrownError).toBeDefined();
179
- // });
180
- // it('should handle upper case paths', async () => {
181
- // const pathOption = 'projects/bar/src/app/SOME/UPPER/DIR';
182
- // const options = { ...defaultOptions, path: pathOption };
183
- //
184
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
185
- // let files = tree.files;
186
- // let root = `/${pathOption}/foo/foo.component`;
187
- // expect(files).toEqual(
188
- // jasmine.arrayContaining([`${root}.css`, `${root}.html`, `${root}.spec.ts`, `${root}.ts`])
189
- // );
190
- //
191
- // const options2 = { ...options, name: 'BAR' };
192
- // const tree2 = await schematicRunner.runSchematicAsync('component', options2, tree).toPromise();
193
- // files = tree2.files;
194
- // root = `/${pathOption}/bar/bar.component`;
195
- // expect(files).toEqual(
196
- // jasmine.arrayContaining([`${root}.css`, `${root}.html`, `${root}.spec.ts`, `${root}.ts`])
197
- // );
198
- // });
199
- // it('should create a component in a sub-directory', async () => {
200
- // const options = { ...defaultOptions, path: 'projects/bar/src/app/a/b/c' };
201
- //
202
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
203
- // const files = tree.files;
204
- // const root = `/${options.path}/foo/foo.component`;
205
- // expect(files).toEqual(
206
- // jasmine.arrayContaining([`${root}.css`, `${root}.html`, `${root}.spec.ts`, `${root}.ts`])
207
- // );
208
- // });
209
- // it('should use the prefix', async () => {
210
- // const options = { ...defaultOptions, prefix: 'pre' };
211
- //
212
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
213
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
214
- // expect(content).toMatch(/selector: 'pre-foo'/);
215
- // });
216
- // it('should use the default project prefix if none is passed', async () => {
217
- // const options = { ...defaultOptions, prefix: undefined };
218
- //
219
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
220
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
221
- // expect(content).toMatch(/selector: 'app-foo'/);
222
- // });
223
- // it('should use the supplied prefix if it is ""', async () => {
224
- // const options = { ...defaultOptions, prefix: '' };
225
- //
226
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
227
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
228
- // expect(content).toMatch(/selector: 'foo'/);
229
- // });
230
- // it('should respect the inlineTemplate option', async () => {
231
- // const options = { ...defaultOptions, inlineTemplate: true };
232
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
233
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
234
- // expect(content).toMatch(/template: /);
235
- // expect(content).not.toMatch(/templateUrl: /);
236
- // expect(tree.files).not.toContain('/projects/bar/src/app/foo/foo.component.html');
237
- // });
238
- //
239
- // it('should respect the inlineStyle option', async () => {
240
- // const options = { ...defaultOptions, inlineStyle: true };
241
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
242
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
243
- // expect(content).toMatch(/styles: \[/);
244
- // expect(content).not.toMatch(/styleUrls: /);
245
- // expect(tree.files).not.toContain('/projects/bar/src/app/foo/foo.component.css');
246
- // });
247
- //
248
- // it('should respect the displayBlock option when inlineStyle is `false`', async () => {
249
- // const options = { ...defaultOptions, displayBlock: true };
250
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
251
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.css');
252
- // expect(content).toMatch(/:host {\r?\n display: block;\r?\n}/);
253
- // });
254
- //
255
- // it('should respect the displayBlock option when inlineStyle is `false` and use correct syntax for `scss`', async () => {
256
- // const options = { ...defaultOptions, displayBlock: true, style: 'scss' };
257
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
258
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.scss');
259
- // expect(content).toMatch(/:host {\r?\n display: block;\r?\n}/);
260
- // });
261
- //
262
- // it('should respect the displayBlock option when inlineStyle is `false` and use correct syntax for `sass', async () => {
263
- // const options = { ...defaultOptions, displayBlock: true, style: 'sass' };
264
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
265
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.sass');
266
- // expect(content).toMatch(/\\:host\r?\n display: block;\r?\n/);
267
- // });
268
- //
269
- // it('should respect the displayBlock option when inlineStyle is `true`', async () => {
270
- // const options = { ...defaultOptions, displayBlock: true, inlineStyle: true };
271
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
272
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
273
- // expect(content).toMatch(/:host {\r?\n(\s*)display: block;(\s*)}\r?\n/);
274
- // });
275
- // it('should respect the style option', async () => {
276
- // const options = { ...defaultOptions, style: Style.Sass };
277
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
278
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.component.ts');
279
- // expect(content).toMatch(/styleUrls: \['.\/foo.component.sass/);
280
- // expect(tree.files).toContain('/projects/bar/src/app/foo/foo.component.sass');
281
- // expect(tree.files).not.toContain('/projects/bar/src/app/foo/foo.component.css');
282
- // });
283
- // it('should respect the type option', async () => {
284
- // const options = { ...defaultOptions, type: 'Route' };
285
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
286
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.route.ts');
287
- // const testContent = tree.readContent('/projects/bar/src/app/foo/foo.route.spec.ts');
288
- // expect(content).toContain('export class FooRoute implements OnInit');
289
- // expect(testContent).toContain("describe('FooRoute'");
290
- // expect(tree.files).toContain('/projects/bar/src/app/foo/foo.route.css');
291
- // expect(tree.files).toContain('/projects/bar/src/app/foo/foo.route.html');
292
- // });
293
- // it('should allow empty string in the type option', async () => {
294
- // const options = { ...defaultOptions, type: '' };
295
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
296
- // const content = tree.readContent('/projects/bar/src/app/foo/foo.ts');
297
- // const testContent = tree.readContent('/projects/bar/src/app/foo/foo.spec.ts');
298
- // expect(content).toContain('export class Foo implements OnInit');
299
- // expect(testContent).toContain("describe('Foo'");
300
- // expect(tree.files).toContain('/projects/bar/src/app/foo/foo.css');
301
- // expect(tree.files).toContain('/projects/bar/src/app/foo/foo.html');
302
- // });
303
- // it('should use the module flag even if the module is a routing module', async () => {
304
- // const routingFileName = 'app-routing.module.ts';
305
- // const routingModulePath = `/projects/bar/src/app/${routingFileName}`;
306
- // const newTree = createAppModule(appTree, routingModulePath);
307
- // const options = { ...defaultOptions, module: routingFileName };
308
- // const tree = await schematicRunner.runSchematicAsync('component', options, newTree).toPromise();
309
- // const content = tree.readContent(routingModulePath);
310
- // expect(content).toMatch(/import { FooComponent } from '.\/foo\/foo.component/);
311
- // });
312
- // it('should handle a path in the name option', async () => {
313
- // const options = { ...defaultOptions, name: 'dir/test-component' };
314
- //
315
- // const tree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
316
- // const content = tree.readContent('/projects/bar/src/app/app.module.ts');
317
- // expect(content).toMatch(
318
- // /import { TestComponentComponent } from '\.\/dir\/test-component\/test-component.component'/
319
- // );
320
- // });
321
- // it('should handle a path in the name and module options', async () => {
322
- // appTree = await schematicRunner
323
- // .runSchematicAsync('module', { name: 'admin/module', project: 'bar' }, appTree)
324
- // .toPromise();
325
- //
326
- // const options = { ...defaultOptions, name: 'other/test-component', module: 'admin/module' };
327
- // appTree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
328
- //
329
- // const content = appTree.readContent('/projects/bar/src/app/admin/module/module.module.ts');
330
- // expect(content).toMatch(
331
- // /import { TestComponentComponent } from '..\/..\/other\/test-component\/test-component.component'/
332
- // );
333
- // });
334
- // it('should create the right selector with a path in the name', async () => {
335
- // const options = { ...defaultOptions, name: 'sub/test' };
336
- // appTree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
337
- // const content = appTree.readContent('/projects/bar/src/app/sub/test/test.component.ts');
338
- // expect(content).toMatch(/selector: 'app-test'/);
339
- // });
340
- // it('should respect the skipSelector option', async () => {
341
- // const options = { ...defaultOptions, name: 'sub/test', skipSelector: true };
342
- // appTree = await schematicRunner.runSchematicAsync('component', options, appTree).toPromise();
343
- // const content = appTree.readContent('/projects/bar/src/app/sub/test/test.component.ts');
344
- // expect(content).not.toMatch(/selector: 'app-test'/);
345
- // });
346
- // it('should respect the sourceRoot value', async () => {
347
- // const config = JSON.parse(appTree.readContent('/angular.json'));
348
- // config.projects.bar.sourceRoot = 'projects/bar/custom';
349
- // appTree.overwrite('/angular.json', JSON.stringify(config, null, 2));
350
- //
351
- // // should fail without a module in that dir
352
- // await expectAsync(
353
- // schematicRunner.runSchematicAsync('component', defaultOptions, appTree).toPromise(),
354
- // ).toBeRejected();
355
- //
356
- // // move the module
357
- // appTree.rename('/projects/bar/src/app/app.module.ts', '/projects/bar/custom/app/app.module.ts');
358
- // appTree = await schematicRunner
359
- // .runSchematicAsync('component', defaultOptions, appTree)
360
- // .toPromise();
361
- // expect(appTree.files).toContain('/projects/bar/custom/app/foo/foo.component.ts');
362
- // });
363
- });
364
- //# sourceMappingURL=index.spec.js.map