ngssm-schematics 15.1.2 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/schematics/collection.json +0 -1
- package/schematics/component/files/__name@dasherize__.component.ts.template +5 -2
- package/schematics/component/index.d.ts +2 -2
- package/schematics/component/index.js +1 -12
- package/schematics/component/index.js.map +1 -1
- package/schematics/component/schema.json +6 -0
- package/schematics/component/component-options.d.ts +0 -19
- package/schematics/component/component-options.js +0 -3
- package/schematics/component/component-options.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { Component, ChangeDetectionStrategy } from '@angular/core'
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';<% if(standalone) {%>
|
|
2
|
+
import { CommonModule } from '@angular/common';<% } %>
|
|
2
3
|
|
|
3
4
|
import { NgSsmComponent, Store } from 'ngssm-store';
|
|
4
5
|
|
|
5
6
|
@Component({<% if(!skipSelector) {%>
|
|
6
|
-
selector: '<%= selector %>',<%}%><% if(
|
|
7
|
+
selector: '<%= selector %>',<%}%><% if(standalone) {%>
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [CommonModule],<%}%><% if(inlineTemplate) { %>
|
|
7
10
|
template: `
|
|
8
11
|
<p>
|
|
9
12
|
<%= dasherize(name) %> works!
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
import {
|
|
3
|
-
export declare function component(options:
|
|
2
|
+
import { AngularComponentOptionsSchema } from '@angular/cli/lib/config/workspace-schema';
|
|
3
|
+
export declare function component(options: AngularComponentOptionsSchema): Rule;
|
|
@@ -44,18 +44,7 @@ function component(options) {
|
|
|
44
44
|
angularComponentOptions.selector || buildSelector(angularComponentOptions, (project && project.prefix) || '');
|
|
45
45
|
const componentPath = `/${angularComponentOptions.path}/` + (angularComponentOptions.flat ? '' : core_1.strings.dasherize(angularComponentOptions.name) + '/');
|
|
46
46
|
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
47
|
-
(0, schematics_1.applyTemplates)({
|
|
48
|
-
classify: core_1.strings.classify,
|
|
49
|
-
dasherize: core_1.strings.dasherize,
|
|
50
|
-
name: angularComponentOptions.name,
|
|
51
|
-
skipSelector: angularComponentOptions.skipSelector,
|
|
52
|
-
inlineTemplate: angularComponentOptions.inlineTemplate,
|
|
53
|
-
inlineStyle: angularComponentOptions.inlineStyle,
|
|
54
|
-
displayBlock: angularComponentOptions.displayBlock,
|
|
55
|
-
selector: angularComponentOptions.selector,
|
|
56
|
-
type: angularComponentOptions.type,
|
|
57
|
-
style: angularComponentOptions.style
|
|
58
|
-
}),
|
|
47
|
+
(0, schematics_1.applyTemplates)(Object.assign({ classify: core_1.strings.classify, dasherize: core_1.strings.dasherize }, angularComponentOptions)),
|
|
59
48
|
(0, schematics_1.move)((0, core_1.normalize)(componentPath))
|
|
60
49
|
]);
|
|
61
50
|
return (0, schematics_1.chain)([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/component/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAWoC;AACpC,+CAA0D;AAC1D,qEAAqE;AACrE,uEAAmE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/component/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAWoC;AACpC,+CAA0D;AAC1D,qEAAqE;AACrE,uEAAmE;AAGnE,SAAS,aAAa,CAAC,OAAsC,EAAE,aAAqB;IAClF,IAAI,QAAQ,GAAG,cAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,sCAAsC;QACtC,QAAQ,GAAG,GAAG,OAAO,CAAC,MAAM,IAAI,QAAQ,EAAE,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M,aAAa,GACjB,IAAI,uBAAuB,CAAC,IAAI,GAAG,GAAG,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAO,CAAC,SAAS,CAAC,uBAAuB,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QAEpI,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;YAC3C,IAAA,2BAAc,kBACZ,QAAQ,EAAE,cAAO,CAAC,QAAQ,EAC1B,SAAS,EAAE,cAAO,CAAC,SAAS,IACzB,uBAAuB,EAC1B;YACF,IAAA,iBAAI,EAAC,IAAA,gBAAS,EAAC,aAAa,CAAC,CAAC;SAC/B,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,8BAAiB,EAAC,qBAAqB,EAAE,WAAW,EAAE,uBAAuB,CAAC;YAC9E,IAAA,sBAAS,EAAC,cAAc,EAAE,0BAAa,CAAC,SAAS,CAAC;SACnD,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AApCD,8BAoCC"}
|
|
@@ -51,6 +51,12 @@
|
|
|
51
51
|
"alias": "t",
|
|
52
52
|
"x-user-analytics": 10
|
|
53
53
|
},
|
|
54
|
+
"standalone": {
|
|
55
|
+
"description": "Whether the generated component is standalone.",
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"default": false,
|
|
58
|
+
"x-user-analytics": "ep.ng_standalone"
|
|
59
|
+
},
|
|
54
60
|
"viewEncapsulation": {
|
|
55
61
|
"description": "The view encapsulation strategy to use in the new component.",
|
|
56
62
|
"enum": ["Emulated", "None", "ShadowDom"],
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { BaseOptions } from '../utilities';
|
|
2
|
-
export interface ComponentOptions extends BaseOptions {
|
|
3
|
-
project?: string;
|
|
4
|
-
displayBlock?: boolean;
|
|
5
|
-
inlineStyle?: boolean;
|
|
6
|
-
inlineTemplate?: boolean;
|
|
7
|
-
viewEncapsulation?: string;
|
|
8
|
-
changeDetection?: string;
|
|
9
|
-
prefix?: string;
|
|
10
|
-
style?: string;
|
|
11
|
-
type?: string;
|
|
12
|
-
skipTests?: boolean;
|
|
13
|
-
flat?: boolean;
|
|
14
|
-
skipImport?: boolean;
|
|
15
|
-
selector?: string;
|
|
16
|
-
skipSelector?: string;
|
|
17
|
-
module?: string;
|
|
18
|
-
export?: boolean;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-options.js","sourceRoot":"","sources":["../../../../projects/ngssm-schematics/schematics/component/component-options.ts"],"names":[],"mappings":""}
|