@barcidev/ngx-autogen 0.1.51 → 0.1.53
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,9 +1,20 @@
|
|
|
1
|
-
<div
|
|
1
|
+
<div
|
|
2
|
+
<% if (i18n === 'yes') { %>
|
|
3
|
+
*typedTransloco="let t; prefix:'<%= camelize(name) %>'"
|
|
4
|
+
<% } %>
|
|
5
|
+
>
|
|
2
6
|
<h1>
|
|
3
|
-
<% if (i18n === 'yes') { %>
|
|
7
|
+
<% if (i18n === 'yes') { %>
|
|
8
|
+
{{ t('title') }}
|
|
9
|
+
<% }
|
|
10
|
+
else { %>
|
|
11
|
+
<%= classify(name) %> Works!
|
|
12
|
+
<% } %>
|
|
4
13
|
</h1>
|
|
5
14
|
|
|
6
15
|
<% if (store === 'yes') { %>
|
|
16
|
+
|
|
7
17
|
<pre>{{ data$() | json }}</pre>
|
|
18
|
+
|
|
8
19
|
<% } %>
|
|
9
20
|
</div>
|
package/src/ngrx/store/index.js
CHANGED
|
@@ -25,7 +25,9 @@ function signalStore(options) {
|
|
|
25
25
|
const workspace = yield (0, workspace_1.getWorkspace)(tree);
|
|
26
26
|
// 1. Preparar contexto y opciones enriquecidas
|
|
27
27
|
const context = resolveStoreContext(workspace, options);
|
|
28
|
-
const project = workspace.projects.get(context.projectName);
|
|
28
|
+
const project = workspace.projects.get(options.project || context.projectName);
|
|
29
|
+
if (!project)
|
|
30
|
+
throw new schematics_1.SchematicsException(`El proyecto "${options.project || context.projectName}" no existe.`);
|
|
29
31
|
const projectRoot = (project === null || project === void 0 ? void 0 : project.sourceRoot) || "src";
|
|
30
32
|
const { angularVersion } = (0, project_metadata_1.getProjectMetadata)(tree);
|
|
31
33
|
// 2. Orquestar la ejecución
|
|
@@ -55,9 +57,10 @@ function resolveStoreContext(workspace, options) {
|
|
|
55
57
|
// Resolución de Rutas (Lógica de Directorio Actual)
|
|
56
58
|
const fullPath = process.cwd();
|
|
57
59
|
const srcIndex = fullPath.lastIndexOf("src");
|
|
58
|
-
let relativePath = options.path ||
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
let relativePath = options.path ||
|
|
61
|
+
(srcIndex !== -1
|
|
62
|
+
? fullPath.substring(srcIndex)
|
|
63
|
+
: (0, core_1.join)((0, core_1.normalize)("src"), "app"));
|
|
61
64
|
let movePath = (0, core_1.normalize)(relativePath);
|
|
62
65
|
if (!movePath.endsWith("state"))
|
|
63
66
|
movePath = (0, core_1.join)(movePath, "state");
|
package/src/transloco/index.js
CHANGED
|
@@ -29,7 +29,7 @@ function transloco(options) {
|
|
|
29
29
|
throw new schematics_1.SchematicsException(`El proyecto "${projectName}" no existe.`);
|
|
30
30
|
const projectRoot = project.sourceRoot || "src";
|
|
31
31
|
// 2. Resolución de Contexto (Path y Componente)
|
|
32
|
-
const { path, componentFile, componentName } =
|
|
32
|
+
const { path, componentFile, componentName } = resolveTranslocoContext(tree, options);
|
|
33
33
|
// Sincronizamos las opciones normalizadas
|
|
34
34
|
const finalOptions = Object.assign(Object.assign({}, options), { name: componentName, path: path, project: projectName, projectRoot: projectRoot });
|
|
35
35
|
return (0, schematics_1.chain)([
|
|
@@ -66,7 +66,7 @@ function ensureExternalConfig() {
|
|
|
66
66
|
function generateI18nFiles(options) {
|
|
67
67
|
return (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)("./files/component"), [
|
|
68
68
|
(0, schematics_1.applyTemplates)(Object.assign(Object.assign(Object.assign({}, schematics_1.strings), options), { pluralize: (word) => options.lang === "es" ? (0, pluralize_1.pluralizeEs)(word) : (0, pluralize_1.pluralizeEn)(word) })),
|
|
69
|
-
(0, schematics_1.move)(options.path),
|
|
69
|
+
(0, schematics_1.move)(options.path || "src/app"),
|
|
70
70
|
]));
|
|
71
71
|
}
|
|
72
72
|
// Actualización del archivo de tipos global
|
|
@@ -135,7 +135,7 @@ function registerProviderInComponent(options, componentFile) {
|
|
|
135
135
|
/**
|
|
136
136
|
* --- HELPERS ---
|
|
137
137
|
*/
|
|
138
|
-
function
|
|
138
|
+
function resolveTranslocoContext(tree, options) {
|
|
139
139
|
const fullPath = process.cwd();
|
|
140
140
|
const srcIndex = fullPath.lastIndexOf("src");
|
|
141
141
|
const path = options.path ||
|