@barcidev/ngx-autogen 0.1.54 → 0.1.55

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barcidev/ngx-autogen",
3
- "version": "0.1.54",
3
+ "version": "0.1.55",
4
4
  "description": "A collection of Angular schematics for essential functionalities.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,18 +1,18 @@
1
1
  <div
2
- <% if (i18n === 'yes') { %>
2
+ <% if (i18n === 'Yes') { %>
3
3
  *typedTransloco="let t; prefix:'<%= camelize(name) %>'"
4
4
  <% } %>
5
5
  >
6
6
  <h1>
7
- <% if (i18n === 'yes') { %>
7
+ <% if (i18n === 'Yes') { %>
8
8
  {{ t('title') }}
9
9
  <% }
10
10
  else { %>
11
- <%= classify(name) %> Works! i18n = <%= i18n %> - store = <%= store %>
11
+ <%= classify(name) %> Works!
12
12
  <% } %>
13
13
  </h1>
14
14
 
15
- <% if (store === 'yes') { %>
15
+ <% if (store === 'Yes') { %>
16
16
 
17
17
  <pre>{{ data$() | json }}</pre>
18
18
 
@@ -1,6 +1,6 @@
1
1
  import { ComponentFixture, TestBed } from '@angular/core/testing';
2
2
  import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
3
- <% if (store === 'yes') { %>import { <%= classify(name) %>Store } from './state';<% } %>
3
+ <% if (store === 'Yes') { %>import { <%= classify(name) %>Store } from './state';<% } %>
4
4
 
5
5
  describe('<%= classify(name) %>Component', () => {
6
6
  let component: <%= classify(name) %>Component;
@@ -10,7 +10,7 @@ describe('<%= classify(name) %>Component', () => {
10
10
  await TestBed.configureTestingModule({
11
11
  imports: [<%= classify(name) %>Component],
12
12
  providers: [
13
- <% if (store === 'yes') { %><%= classify(name) %>Store,<% } %>
13
+ <% if (store === 'Yes') { %><%= classify(name) %>Store,<% } %>
14
14
  ]
15
15
  }).compileComponents();
16
16
 
@@ -1,18 +1,18 @@
1
1
  import { Component, inject } from '@angular/core';
2
2
  import { JsonPipe } from '@angular/common';
3
- <% if (i18n === 'yes') { %>import { provideTranslocoScopeWrapper } from '@barcidev/typed-transloco';
3
+ <% if (i18n === 'Yes') { %>import { provideTranslocoScopeWrapper } from '@barcidev/typed-transloco';
4
4
  import { <%= camelize(name) %>I18n } from './<%= dasherize(name) %>.i18n';
5
5
  import { AppTypedTranslocoDirective } from '@i18n/app-typed-transloco.directive';<% } %>
6
- <% if (store === 'yes') { %>import { <%= classify(name) %>Store } from './state';<% } %>
6
+ <% if (store === 'Yes') { %>import { <%= classify(name) %>Store } from './state';<% } %>
7
7
 
8
8
  @Component({
9
- imports: [<% if (i18n === 'yes') { %>AppTypedTranslocoDirective, JsonPipe<% } %>],
9
+ imports: [<% if (i18n === 'Yes') { %>AppTypedTranslocoDirective, JsonPipe<% } %>],
10
10
  selector: 'app-<%= dasherize(name) %>',
11
- <% if (i18n === 'yes') { %>providers: [provideTranslocoScopeWrapper(<%= camelize(name) %>I18n)],<% } %>
11
+ <% if (i18n === 'Yes') { %>providers: [provideTranslocoScopeWrapper(<%= camelize(name) %>I18n)],<% } %>
12
12
  styleUrls: ['./<%= dasherize(name) %>.component.scss'],
13
13
  templateUrl: './<%= dasherize(name) %>.component.html',
14
14
  })
15
15
  export class <%= classify(name) %>Component {
16
- <% if (store === 'yes') { %> private _<%= camelize(name) %>Store = inject(<%= classify(name) %>Store);
16
+ <% if (store === 'Yes') { %> private _<%= camelize(name) %>Store = inject(<%= classify(name) %>Store);
17
17
  data$ = this._<%= camelize(name) %>Store.entities();<% } %>
18
18
  }
@@ -22,13 +22,13 @@ function component(options) {
22
22
  // Aquí podrías agregar más reglas para otras funcionalidades, como NgRx
23
23
  return (0, schematics_1.chain)([
24
24
  generateComponentFiles(context),
25
- options.i18n.toLowerCase() === "yes"
25
+ options.i18n === "Yes"
26
26
  ? (0, schematics_1.schematic)("app-i18n", {
27
27
  name: context.options.name,
28
28
  path: (0, path_1.join)(context.movePath, context.nameDash),
29
29
  })
30
30
  : (0, schematics_1.noop)(),
31
- options.store.toLowerCase() === "yes"
31
+ options.store === "Yes"
32
32
  ? (0, schematics_1.schematic)("app-store", {
33
33
  name: context.options.name,
34
34
  path: (0, path_1.join)(context.movePath, context.nameDash),
@@ -8,8 +8,8 @@ export interface ComponentContext {
8
8
  export interface ComponentSchemaOptions {
9
9
  name: string;
10
10
  project?: string;
11
- store: "Y" | "N" | "y" | "n";
12
- i18n: "Y" | "N" | "y" | "n";
11
+ store: "Yes" | "No";
12
+ i18n: "Yes" | "No";
13
13
  path?: string;
14
14
  lang?: "en" | "es";
15
15
  }