@coolon/angular-ui-powerups 16.0.0 → 16.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/interaction/interaction.module.mjs +1 -8
- package/esm2022/lib/place/components/list-place-nav/list-place-nav.component.mjs +3 -4
- package/esm2022/lib/place/place.module.mjs +1 -5
- package/fesm2022/coolon-angular-ui-powerups.mjs +1 -12
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/interaction.module.d.ts +6 -7
- package/lib/place/place.module.d.ts +3 -4
- package/package.json +2 -2
- package/schematics/activity/index.d.ts +3 -0
- package/schematics/activity/index.js +32 -0
- package/schematics/activity/index.js.map +1 -0
- package/schematics/activity/index.spec.d.ts +1 -0
- package/schematics/activity/index.spec.js +364 -0
- package/schematics/activity/index.spec.js.map +1 -0
- package/schematics/activity/schema.d.ts +4 -0
- package/schematics/activity/schema.js +3 -0
- package/schematics/activity/schema.js.map +1 -0
- package/schematics/activity/schema.json +27 -0
- package/schematics/activity/templates/component/__name@dasherize__.component.html.template +5 -0
- package/schematics/activity/templates/component/__name@dasherize__.component.scss.template +4 -0
- package/schematics/activity/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
- package/schematics/activity/templates/component/__name@dasherize__.component.ts.template +40 -0
- package/schematics/activity/templates/component/__name@dasherize__.i18n.yml.template +9 -0
- package/schematics/aup-i18n/index.d.ts +4 -0
- package/schematics/aup-i18n/index.js +86 -0
- package/schematics/aup-i18n/index.js.map +1 -0
- package/schematics/aup-i18n/schema.d.ts +3 -0
- package/schematics/aup-i18n/schema.js +3 -0
- package/schematics/aup-i18n/schema.js.map +1 -0
- package/schematics/aup-i18n/schema.json +18 -0
- package/schematics/aup-i18n/templates/app/aup.i18n.yml.template +80 -0
- package/schematics/bootstrap-app/index.d.ts +4 -0
- package/schematics/bootstrap-app/index.js +109 -0
- package/schematics/bootstrap-app/index.js.map +1 -0
- package/schematics/bootstrap-app/schema.d.ts +3 -0
- package/schematics/bootstrap-app/schema.js +3 -0
- package/schematics/bootstrap-app/schema.js.map +1 -0
- package/schematics/bootstrap-app/schema.json +18 -0
- package/schematics/bootstrap-app/templates/i18n.config.json.template +11 -0
- package/schematics/bootstrap-app/templates/src/app/app-routing.module.ts.template +23 -0
- package/schematics/bootstrap-app/templates/src/app/app.component.html.template +7 -0
- package/schematics/bootstrap-app/templates/src/app/app.component.scss.template +12 -0
- package/schematics/bootstrap-app/templates/src/app/app.component.ts.template +19 -0
- package/schematics/bootstrap-app/templates/src/app/app.module.ts.template +74 -0
- package/schematics/bootstrap-app/templates/src/app/components/components.module.ts.template +16 -0
- package/schematics/bootstrap-app/templates/src/app/i18n.ts.template +9 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.eot +0 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.ijmap +1 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.svg +2373 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.ttf +0 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.woff +0 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/MaterialIcons-Regular.woff2 +0 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/README.md +9 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/codepoints +932 -0
- package/schematics/bootstrap-app/templates/src/assets/fonts/material-design-icons/material-icons.css +36 -0
- package/schematics/bootstrap-app/templates/src/index.html.template +13 -0
- package/schematics/bootstrap-app/templates/src/styles/global-variables.scss.template +13 -0
- package/schematics/bootstrap-app/templates/src/styles.scss.template +85 -0
- package/schematics/collection.json +48 -0
- package/schematics/component/index.d.ts +3 -0
- package/schematics/component/index.js +36 -0
- package/schematics/component/index.js.map +1 -0
- package/schematics/component/index.spec.d.ts +1 -0
- package/schematics/component/index.spec.js +364 -0
- package/schematics/component/index.spec.js.map +1 -0
- package/schematics/component/schema.d.ts +5 -0
- package/schematics/component/schema.js +3 -0
- package/schematics/component/schema.js.map +1 -0
- package/schematics/component/schema.json +39 -0
- package/schematics/component/templates/component/__name@dasherize__.component.html.template +1 -0
- package/schematics/component/templates/component/__name@dasherize__.component.scss.template +4 -0
- package/schematics/component/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
- package/schematics/component/templates/component/__name@dasherize__.component.ts.template +24 -0
- package/schematics/component/templates/component/__name@dasherize__.i18n.yml.template +1 -0
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +37 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/package-util.d.ts +13 -0
- package/schematics/package-util.js +61 -0
- package/schematics/package-util.js.map +1 -0
- package/schematics/place-add/index.d.ts +3 -0
- package/schematics/place-add/index.js +45 -0
- package/schematics/place-add/index.js.map +1 -0
- package/schematics/place-add/index.spec.d.ts +1 -0
- package/schematics/place-add/index.spec.js +364 -0
- package/schematics/place-add/index.spec.js.map +1 -0
- package/schematics/place-add/schema.d.ts +4 -0
- package/schematics/place-add/schema.js +3 -0
- package/schematics/place-add/schema.js.map +1 -0
- package/schematics/place-add/schema.json +27 -0
- package/schematics/place-add/templates/component/__name@dasherize__.component.html.template +1 -0
- package/schematics/place-add/templates/component/__name@dasherize__.component.scss.template +4 -0
- package/schematics/place-add/templates/component/__name@dasherize__.component.spec.ts.template +25 -0
- package/schematics/place-add/templates/component/__name@dasherize__.component.ts.template +35 -0
- package/schematics/place-add/templates/component/__name@dasherize__.i18n.yml.template +5 -0
- package/schematics/place-bootstrap/index.d.ts +3 -0
- package/schematics/place-bootstrap/index.js +21 -0
- package/schematics/place-bootstrap/index.js.map +1 -0
- package/schematics/place-bootstrap/schema.d.ts +4 -0
- package/schematics/place-bootstrap/schema.js +3 -0
- package/schematics/place-bootstrap/schema.js.map +1 -0
- package/schematics/place-bootstrap/schema.json +28 -0
- package/schematics/place-bootstrap/templates/__name@dasherize__/place-routes.ts.template +3 -0
- package/schematics/place-bootstrap/templates/__name@dasherize__/places.module.ts.template +16 -0
- package/schematics/place-routes/index.d.ts +3 -0
- package/schematics/place-routes/index.js +24 -0
- package/schematics/place-routes/index.js.map +1 -0
- package/schematics/place-routes/place-builder.d.ts +18 -0
- package/schematics/place-routes/place-builder.js +123 -0
- package/schematics/place-routes/place-builder.js.map +1 -0
- package/schematics/place-routes/place-class-scanner.d.ts +47 -0
- package/schematics/place-routes/place-class-scanner.js +223 -0
- package/schematics/place-routes/place-class-scanner.js.map +1 -0
- package/schematics/place-routes/place-def.d.ts +62 -0
- package/schematics/place-routes/place-def.js +195 -0
- package/schematics/place-routes/place-def.js.map +1 -0
- package/schematics/place-routes/schema.d.ts +4 -0
- package/schematics/place-routes/schema.js +3 -0
- package/schematics/place-routes/schema.js.map +1 -0
- package/schematics/place-routes/schema.json +26 -0
- package/schematics/place-routes/templates/place-routes.ts.template +15 -0
- package/schematics/utils/build-context.d.ts +74 -0
- package/schematics/utils/build-context.js +189 -0
- package/schematics/utils/build-context.js.map +1 -0
- package/schematics/utils/decorators/decorated-class.d.ts +13 -0
- package/schematics/utils/decorators/decorated-class.js +28 -0
- package/schematics/utils/decorators/decorated-class.js.map +1 -0
- package/schematics/utils/decorators/decorated-source-file.d.ts +15 -0
- package/schematics/utils/decorators/decorated-source-file.js +27 -0
- package/schematics/utils/decorators/decorated-source-file.js.map +1 -0
- package/schematics/utils/import-def.d.ts +30 -0
- package/schematics/utils/import-def.js +97 -0
- package/schematics/utils/import-def.js.map +1 -0
- package/schematics/utils/method-scanner.d.ts +16 -0
- package/schematics/utils/method-scanner.js +70 -0
- package/schematics/utils/method-scanner.js.map +1 -0
- package/schematics/utils/mixin.d.ts +11 -0
- package/schematics/utils/mixin.js +27 -0
- package/schematics/utils/mixin.js.map +1 -0
- package/schematics/utils/parameter-def.d.ts +5 -0
- package/schematics/utils/parameter-def.js +3 -0
- package/schematics/utils/parameter-def.js.map +1 -0
- package/schematics/utils/path-helper.d.ts +14 -0
- package/schematics/utils/path-helper.js +30 -0
- package/schematics/utils/path-helper.js.map +1 -0
- package/schematics/utils/schematic-tree-file-system.d.ts +30 -0
- package/schematics/utils/schematic-tree-file-system.js +113 -0
- package/schematics/utils/schematic-tree-file-system.js.map +1 -0
- package/schematics/utils/source-file-scanner.d.ts +14 -0
- package/schematics/utils/source-file-scanner.js +89 -0
- package/schematics/utils/source-file-scanner.js.map +1 -0
- package/schematics/utils/source-file-utilities.d.ts +6 -0
- package/schematics/utils/source-file-utilities.js +36 -0
- package/schematics/utils/source-file-utilities.js.map +1 -0
- package/schematics/utils/stringy.d.ts +15 -0
- package/schematics/utils/stringy.js +50 -0
- package/schematics/utils/stringy.js.map +1 -0
- package/schematics/utils/template-utilities.d.ts +2 -0
- package/schematics/utils/template-utilities.js +24 -0
- package/schematics/utils/template-utilities.js.map +1 -0
- package/schematics/utils/workspace.d.ts +15 -0
- package/schematics/utils/workspace.js +59 -0
- package/schematics/utils/workspace.js.map +1 -0
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
"useModules": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"description": "Create a module based component",
|
|
26
|
+
"$default": false,
|
|
27
|
+
"x-prompt": "Should this component use modules?"
|
|
28
|
+
},
|
|
29
|
+
"export": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"description": "Export component",
|
|
32
|
+
"$default": true,
|
|
33
|
+
"x-prompt": "Should this component be exported?"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": [
|
|
37
|
+
"name"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<p><%=name%> works!</p>
|
package/schematics/component/templates/component/__name@dasherize__.component.spec.ts.template
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { <%=i18nClassName%> } from '<%=pathToRoot%>/<%=dasherize(i18nClassName)%>';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: '<%=selectorPrefix%>-<%=dasherize(name)%>',
|
|
8
|
+
templateUrl: './<%=dasherize(name)%>.component.html',
|
|
9
|
+
styleUrls: ['./<%=dasherize(name)%>.component.scss'],
|
|
10
|
+
<%= standalone %>
|
|
11
|
+
})
|
|
12
|
+
export class <%=capitalize(camelize(name))%>Component extends DisposableComponent implements OnInit {
|
|
13
|
+
|
|
14
|
+
readonly i18n = <%=i18nClassName%>.<%=i18nNamespace%>;
|
|
15
|
+
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
const {chain} = Dsl.disposeWith(this);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
ngOnInit() {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
name: "<%=capitalize(camelize(name))%>"
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/sch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rB,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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;
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
context.logger.info(`options: ${JSON.stringify(_options)}`);
|
|
13
|
+
const nameParts = _options.name.split('/');
|
|
14
|
+
const componentName = nameParts[nameParts.length - 1];
|
|
15
|
+
const componentPathParts = nameParts.slice(0, nameParts.length - 1);
|
|
16
|
+
const pathToSourceRoot = [buildContext.sourceCodeRoot].concat(componentPathParts);
|
|
17
|
+
// we'll let angular do it by just create a default component then we'll clobber it with our real templates later.
|
|
18
|
+
const options = {
|
|
19
|
+
project: _options.project,
|
|
20
|
+
name: _options.name,
|
|
21
|
+
// standalone: !_options.useModules, can't do this until router is updated.
|
|
22
|
+
module: undefined
|
|
23
|
+
};
|
|
24
|
+
// if (_options.useModules) {
|
|
25
|
+
const placeModulePath = buildContext.findFileInAncestorPath(pathToSourceRoot, 'places.module.ts');
|
|
26
|
+
if (!placeModulePath) {
|
|
27
|
+
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`);
|
|
28
|
+
}
|
|
29
|
+
options.module = placeModulePath.slice(buildContext.sourceCodeRoot.length);
|
|
30
|
+
// }
|
|
31
|
+
const updateModule = (0, schematics_1.externalSchematic)('@schematics/angular', 'component', options);
|
|
32
|
+
const i18nNamespace = componentPathParts.concat(componentName).map(p => stringy_1.Stringy.from(p).camelizeLower().toString()).join(".");
|
|
33
|
+
const componentFiles = (0, template_utilities_1.applyTemplatesWithOverwrite)(tree, 'templates/component', {
|
|
34
|
+
name: componentName,
|
|
35
|
+
// standalone: !_options.useModules ? "standalone: true" : undefined,
|
|
36
|
+
selectorPrefix: buildContext.selectorPrefix,
|
|
37
|
+
pathToRoot: pathToSourceRoot.map(p => '..').join('/'),
|
|
38
|
+
i18nClassName: buildContext.getI18nClasName(),
|
|
39
|
+
i18nNamespace,
|
|
40
|
+
}, `${(pathToSourceRoot.join('/'))}/${componentName}`);
|
|
41
|
+
return (0, schematics_1.chain)([updateModule, componentFiles])(tree, context);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
exports.addPlace = addPlace;
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/angular-ui-powerups/schematics/place-add/index.ts"],"names":[],"mappings":";;;AACA,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,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAE3D,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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