@unifylib/ui-lib 1.2.16 → 1.2.18
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/cli/client-app-component-guide.md +166 -166
- package/cli/generators/dashboard.js +147 -147
- package/cli/generators/form-screen.js +95 -95
- package/cli/generators/line-editor.js +110 -110
- package/cli/generators/permission-matrix.js +115 -115
- package/cli/generators/section-form.js +103 -103
- package/cli/generators/table-screen.js +181 -181
- package/cli/index.js +185 -185
- package/cli/utils.js +228 -228
- package/esm2022/iq-ui-lib.mjs +5 -0
- package/esm2022/lib/base-model/SearchStrConfig.mjs +1 -1
- package/esm2022/lib/base-model/api-response.mjs +1 -1
- package/esm2022/lib/base-model/audit-log-entry.mjs +1 -1
- package/esm2022/lib/base-model/button-action-settings.mjs +1 -1
- package/esm2022/lib/base-model/column-def.model.mjs +1 -1
- package/esm2022/lib/base-model/do-action-request.mjs +1 -1
- package/esm2022/lib/base-model/field-action.mjs +1 -1
- package/esm2022/lib/base-model/field-filter.model.mjs +1 -1
- package/esm2022/lib/base-model/field-info.mjs +1 -1
- package/esm2022/lib/base-model/field-predicate.model.mjs +1 -1
- package/esm2022/lib/base-model/filter-request.mjs +1 -1
- package/esm2022/lib/base-model/filter.model.mjs +1 -1
- package/esm2022/lib/base-model/get-items-list.mjs +1 -1
- package/esm2022/lib/base-model/index.mjs +1 -1
- package/esm2022/lib/base-model/items-total.model.mjs +1 -1
- package/esm2022/lib/base-model/line-item.model.mjs +1 -1
- package/esm2022/lib/base-model/lookupItem.mjs +1 -1
- package/esm2022/lib/base-model/page-info.mjs +1 -1
- package/esm2022/lib/base-model/permission-matrix.model.mjs +1 -1
- package/esm2022/lib/base-model/report-request.model.mjs +1 -1
- package/esm2022/lib/base-model/response-envelop.model.mjs +1 -1
- package/esm2022/lib/base-model/snack-message.model.mjs +1 -1
- package/esm2022/lib/base-model/table-column.interface.mjs +1 -1
- package/esm2022/lib/base-model/table-page-user-action.interface.mjs +1 -1
- package/esm2022/lib/base-model/workflow/workflow-steps.model.mjs +1 -1
- package/esm2022/lib/base-model/workflow/workflow.model.mjs +1 -1
- package/esm2022/lib/components/action-comment/action-comment.component.mjs +3 -3
- package/esm2022/lib/components/action-confirmation/action-confirmation.component.mjs +3 -3
- package/esm2022/lib/components/activity-report-form/activity-report-form.component.mjs +3 -3
- package/esm2022/lib/components/advanced-filter/field-filter/field-filter.component.mjs +3 -3
- package/esm2022/lib/components/advanced-filter/filter-builder/filter-builder.component.mjs +3 -3
- package/esm2022/lib/components/audit-log-details-dialog/audit-log-details-dialog.component.mjs +3 -3
- package/esm2022/lib/components/auto-complete/auto-complete.component.mjs +3 -3
- package/esm2022/lib/components/base-form/base-form.component.mjs +3 -3
- package/esm2022/lib/components/base-form-canvas/MaxDigitsDirective.mjs +1 -1
- package/esm2022/lib/components/base-form-canvas/NumbersOnlyDirective.mjs +1 -1
- package/esm2022/lib/components/base-form-canvas/base-form-canvas.component.mjs +5 -5
- package/esm2022/lib/components/base-input-dialog/base-input-dialog.component.mjs +3 -3
- package/esm2022/lib/components/base-table/base-table.component.mjs +3 -3
- package/esm2022/lib/components/button-actions/button-actions.component.mjs +3 -3
- package/esm2022/lib/components/editable-base-table/editable-base-table.component.mjs +3 -3
- package/esm2022/lib/components/equation-builder/equation-builder.component.mjs +3 -3
- package/esm2022/lib/components/item-line-editor/item-line-editor.component.mjs +3 -3
- package/esm2022/lib/components/multi-auto-complete/multi-auto-complete.component.mjs +11 -10
- package/esm2022/lib/components/paginator/paginator.component.mjs +3 -3
- package/esm2022/lib/components/permission-matrix/permission-matrix.component.mjs +3 -3
- package/esm2022/lib/components/report-details-dialog/report-details-dialog.component.mjs +3 -3
- package/esm2022/lib/components/report-form/report-form.component.mjs +3 -3
- package/esm2022/lib/components/search-bar/search-bar.component.mjs +3 -3
- package/esm2022/lib/components/section-form-canvas/section-form-canvas.component.mjs +3 -3
- package/esm2022/lib/components/shared/action-button/action-button.component.mjs +3 -3
- package/esm2022/lib/components/shared/action-card/action-card.component.mjs +3 -3
- package/esm2022/lib/components/shared/attachment-uploader/attachment-uploader.component.mjs +3 -3
- package/esm2022/lib/components/shared-list/shared-list.component.mjs +3 -3
- package/esm2022/lib/components/snackbar-static/snackbar-static.component.mjs +3 -3
- package/esm2022/lib/components/title-bar/title-bar.component.mjs +3 -3
- package/esm2022/lib/directives/phone-number-only.directive.mjs +1 -1
- package/esm2022/lib/services/backend-service.mjs +1 -1
- package/esm2022/lib/services/index.mjs +1 -1
- package/esm2022/lib/services/top-panel.mjs +1 -1
- package/esm2022/lib/services/trigger-form.service.mjs +1 -1
- package/esm2022/lib/utils/base-utils.mjs +1 -1
- package/esm2022/lib/validators/date-range-validator.mjs +1 -1
- package/esm2022/lib/validators/index.mjs +1 -1
- package/esm2022/lib/validators/match-list.validator.mjs +1 -1
- package/esm2022/lib/validators/multi-email-validator.mjs +1 -1
- package/esm2022/public-api.mjs +1 -1
- package/fesm2022/iq-ui-lib.mjs +7060 -0
- package/fesm2022/iq-ui-lib.mjs.map +1 -0
- package/index.d.ts +1 -1
- package/package.json +14 -6
- package/esm2022/unifylib-ui-lib.mjs +0 -5
- package/fesm2022/unifylib-ui-lib.mjs +0 -7059
- package/fesm2022/unifylib-ui-lib.mjs.map +0 -1
package/cli/index.js
CHANGED
|
@@ -1,185 +1,185 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
const path = require("path");
|
|
5
|
-
const {
|
|
6
|
-
kebabCase,
|
|
7
|
-
pascalCase,
|
|
8
|
-
upperSnakeFromKebab,
|
|
9
|
-
lastPathSegment,
|
|
10
|
-
writeFiles,
|
|
11
|
-
upsertI18nEntries,
|
|
12
|
-
} = require("./utils");
|
|
13
|
-
|
|
14
|
-
const GENERATORS = {
|
|
15
|
-
"form-screen": require("./generators/form-screen.js"),
|
|
16
|
-
"table-screen": require("./generators/table-screen.js"),
|
|
17
|
-
"section-form": require("./generators/section-form.js"),
|
|
18
|
-
"line-editor": require("./generators/line-editor.js"),
|
|
19
|
-
dashboard: require("./generators/dashboard.js"),
|
|
20
|
-
"permission-matrix": require("./generators/permission-matrix.js"),
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
function printHelp() {
|
|
24
|
-
console.log(`
|
|
25
|
-
iq-ui — scaffold Angular screens that use @unifylib/ui-lib
|
|
26
|
-
|
|
27
|
-
Usage:
|
|
28
|
-
iq-ui -g <type> <destination> [options]
|
|
29
|
-
|
|
30
|
-
Types:
|
|
31
|
-
form-screen app-base-form-canvas + settings
|
|
32
|
-
table-screen app-base-table + settings
|
|
33
|
-
section-form lib-section-form-canvas + settings
|
|
34
|
-
line-editor app-item-line-editor + settings
|
|
35
|
-
dashboard lib-action-card grid (no settings file)
|
|
36
|
-
permission-matrix lib-permission-matrix + settings
|
|
37
|
-
|
|
38
|
-
Options:
|
|
39
|
-
--name <n> File/class base name (default: last segment of destination)
|
|
40
|
-
--labels-section <s> i18n labelsSection (default: UPPER_SNAKE from name)
|
|
41
|
-
--api-uri <u> API path for PageInfo.apiUri (default: /<name>)
|
|
42
|
-
--fields-count <n> Placeholder fields (default: 6; form-screen, section-form, line-editor)
|
|
43
|
-
--import-path <p> Library import (default: @iq/ui-lib)
|
|
44
|
-
--i18n-path <p> Optional translation file/folder (example: src/assets/en.json or src/assets)
|
|
45
|
-
--dry-run Print files that would be written
|
|
46
|
-
-h, --help Show this help
|
|
47
|
-
|
|
48
|
-
Examples (after npm install @unifylib/ui-lib, use the package binary; do not run \`npx iq-ui\`, which looks up a wrong package on npm):
|
|
49
|
-
npx -p @unifylib/ui-lib iq-ui -g form-screen src/app/registration --i18n-path src/assets/en.json
|
|
50
|
-
npx -p @unifylib/ui-lib iq-ui -g table-screen src/app/devices --labels-section DEVICE --api-uri /devices/list
|
|
51
|
-
npx -p @unifylib/ui-lib iq-ui -g dashboard src/app/home --import-path @unifylib/ui-lib
|
|
52
|
-
|
|
53
|
-
Local dev / linked build:
|
|
54
|
-
node node_modules/@unifylib/ui-lib/cli/index.js -g form-screen src/app/registration
|
|
55
|
-
`);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @returns {{
|
|
60
|
-
* type?: string,
|
|
61
|
-
* destination?: string,
|
|
62
|
-
* name?: string,
|
|
63
|
-
* labelsSection?: string,
|
|
64
|
-
* apiUri?: string,
|
|
65
|
-
* fieldsCount: number,
|
|
66
|
-
* importPath: string,
|
|
67
|
-
* i18nPath?: string,
|
|
68
|
-
* dryRun: boolean,
|
|
69
|
-
* help: boolean,
|
|
70
|
-
* }}
|
|
71
|
-
*/
|
|
72
|
-
function parseArgs(argv) {
|
|
73
|
-
const out = {
|
|
74
|
-
fieldsCount: 6,
|
|
75
|
-
importPath: "@iq/ui-lib",
|
|
76
|
-
dryRun: false,
|
|
77
|
-
help: false,
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
for (let i = 2; i < argv.length; i++) {
|
|
81
|
-
const a = argv[i];
|
|
82
|
-
if (a === "-h" || a === "--help") {
|
|
83
|
-
out.help = true;
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
if (a === "--dry-run") {
|
|
87
|
-
out.dryRun = true;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (a === "-g" || a === "--generate") {
|
|
91
|
-
out.type = argv[++i];
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
if (a === "--name") {
|
|
95
|
-
out.name = argv[++i];
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
if (a === "--labels-section") {
|
|
99
|
-
out.labelsSection = argv[++i];
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
if (a === "--api-uri") {
|
|
103
|
-
out.apiUri = argv[++i];
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
if (a === "--fields-count") {
|
|
107
|
-
out.fieldsCount = parseInt(argv[++i], 10) || 6;
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
if (a === "--import-path") {
|
|
111
|
-
out.importPath = argv[++i];
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
if (a === "--i18n-path") {
|
|
115
|
-
out.i18nPath = argv[++i];
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (a.startsWith("-")) {
|
|
119
|
-
console.error("Unknown option:", a);
|
|
120
|
-
process.exitCode = 1;
|
|
121
|
-
out.help = true;
|
|
122
|
-
return out;
|
|
123
|
-
}
|
|
124
|
-
if (!out.destination) {
|
|
125
|
-
out.destination = a;
|
|
126
|
-
} else {
|
|
127
|
-
console.error("Unexpected argument:", a);
|
|
128
|
-
process.exitCode = 1;
|
|
129
|
-
out.help = true;
|
|
130
|
-
return out;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return out;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function main() {
|
|
137
|
-
const args = parseArgs(process.argv);
|
|
138
|
-
if (args.help) {
|
|
139
|
-
printHelp();
|
|
140
|
-
process.exit(process.exitCode || 0);
|
|
141
|
-
}
|
|
142
|
-
if (!args.type || !args.destination) {
|
|
143
|
-
console.error("Missing required: -g <type> and <destination>\n");
|
|
144
|
-
printHelp();
|
|
145
|
-
process.exit(1);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const gen = GENERATORS[args.type];
|
|
149
|
-
if (!gen || typeof gen.generate !== "function") {
|
|
150
|
-
console.error("Unknown generator type:", args.type);
|
|
151
|
-
printHelp();
|
|
152
|
-
process.exit(1);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const rawName = args.name || lastPathSegment(args.destination);
|
|
156
|
-
const kebab = kebabCase(rawName);
|
|
157
|
-
const pascal = pascalCase(rawName);
|
|
158
|
-
const labelsSection = args.labelsSection || upperSnakeFromKebab(kebab);
|
|
159
|
-
const apiUri = args.apiUri != null ? args.apiUri : `/${kebab}`;
|
|
160
|
-
|
|
161
|
-
const destDir = path.isAbsolute(args.destination)
|
|
162
|
-
? args.destination
|
|
163
|
-
: path.join(process.cwd(), args.destination);
|
|
164
|
-
|
|
165
|
-
const ctx = {
|
|
166
|
-
kebab,
|
|
167
|
-
pascal,
|
|
168
|
-
labelsSection,
|
|
169
|
-
apiUri,
|
|
170
|
-
importPath: args.importPath,
|
|
171
|
-
fieldsCount: args.fieldsCount,
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
const files = gen.generate(ctx);
|
|
175
|
-
writeFiles({ destDir, dryRun: args.dryRun }, files);
|
|
176
|
-
|
|
177
|
-
if (args.i18nPath && typeof gen.getTranslations === "function") {
|
|
178
|
-
const translations = gen.getTranslations(ctx);
|
|
179
|
-
if (translations && Object.keys(translations).length > 0) {
|
|
180
|
-
upsertI18nEntries(args.i18nPath, translations, args.dryRun);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
main();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const {
|
|
6
|
+
kebabCase,
|
|
7
|
+
pascalCase,
|
|
8
|
+
upperSnakeFromKebab,
|
|
9
|
+
lastPathSegment,
|
|
10
|
+
writeFiles,
|
|
11
|
+
upsertI18nEntries,
|
|
12
|
+
} = require("./utils");
|
|
13
|
+
|
|
14
|
+
const GENERATORS = {
|
|
15
|
+
"form-screen": require("./generators/form-screen.js"),
|
|
16
|
+
"table-screen": require("./generators/table-screen.js"),
|
|
17
|
+
"section-form": require("./generators/section-form.js"),
|
|
18
|
+
"line-editor": require("./generators/line-editor.js"),
|
|
19
|
+
dashboard: require("./generators/dashboard.js"),
|
|
20
|
+
"permission-matrix": require("./generators/permission-matrix.js"),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function printHelp() {
|
|
24
|
+
console.log(`
|
|
25
|
+
iq-ui — scaffold Angular screens that use @unifylib/ui-lib
|
|
26
|
+
|
|
27
|
+
Usage:
|
|
28
|
+
iq-ui -g <type> <destination> [options]
|
|
29
|
+
|
|
30
|
+
Types:
|
|
31
|
+
form-screen app-base-form-canvas + settings
|
|
32
|
+
table-screen app-base-table + settings
|
|
33
|
+
section-form lib-section-form-canvas + settings
|
|
34
|
+
line-editor app-item-line-editor + settings
|
|
35
|
+
dashboard lib-action-card grid (no settings file)
|
|
36
|
+
permission-matrix lib-permission-matrix + settings
|
|
37
|
+
|
|
38
|
+
Options:
|
|
39
|
+
--name <n> File/class base name (default: last segment of destination)
|
|
40
|
+
--labels-section <s> i18n labelsSection (default: UPPER_SNAKE from name)
|
|
41
|
+
--api-uri <u> API path for PageInfo.apiUri (default: /<name>)
|
|
42
|
+
--fields-count <n> Placeholder fields (default: 6; form-screen, section-form, line-editor)
|
|
43
|
+
--import-path <p> Library import (default: @iq/ui-lib)
|
|
44
|
+
--i18n-path <p> Optional translation file/folder (example: src/assets/en.json or src/assets)
|
|
45
|
+
--dry-run Print files that would be written
|
|
46
|
+
-h, --help Show this help
|
|
47
|
+
|
|
48
|
+
Examples (after npm install @unifylib/ui-lib, use the package binary; do not run \`npx iq-ui\`, which looks up a wrong package on npm):
|
|
49
|
+
npx -p @unifylib/ui-lib iq-ui -g form-screen src/app/registration --i18n-path src/assets/en.json
|
|
50
|
+
npx -p @unifylib/ui-lib iq-ui -g table-screen src/app/devices --labels-section DEVICE --api-uri /devices/list
|
|
51
|
+
npx -p @unifylib/ui-lib iq-ui -g dashboard src/app/home --import-path @unifylib/ui-lib
|
|
52
|
+
|
|
53
|
+
Local dev / linked build:
|
|
54
|
+
node node_modules/@unifylib/ui-lib/cli/index.js -g form-screen src/app/registration
|
|
55
|
+
`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @returns {{
|
|
60
|
+
* type?: string,
|
|
61
|
+
* destination?: string,
|
|
62
|
+
* name?: string,
|
|
63
|
+
* labelsSection?: string,
|
|
64
|
+
* apiUri?: string,
|
|
65
|
+
* fieldsCount: number,
|
|
66
|
+
* importPath: string,
|
|
67
|
+
* i18nPath?: string,
|
|
68
|
+
* dryRun: boolean,
|
|
69
|
+
* help: boolean,
|
|
70
|
+
* }}
|
|
71
|
+
*/
|
|
72
|
+
function parseArgs(argv) {
|
|
73
|
+
const out = {
|
|
74
|
+
fieldsCount: 6,
|
|
75
|
+
importPath: "@iq/ui-lib",
|
|
76
|
+
dryRun: false,
|
|
77
|
+
help: false,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
for (let i = 2; i < argv.length; i++) {
|
|
81
|
+
const a = argv[i];
|
|
82
|
+
if (a === "-h" || a === "--help") {
|
|
83
|
+
out.help = true;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (a === "--dry-run") {
|
|
87
|
+
out.dryRun = true;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (a === "-g" || a === "--generate") {
|
|
91
|
+
out.type = argv[++i];
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (a === "--name") {
|
|
95
|
+
out.name = argv[++i];
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (a === "--labels-section") {
|
|
99
|
+
out.labelsSection = argv[++i];
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (a === "--api-uri") {
|
|
103
|
+
out.apiUri = argv[++i];
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (a === "--fields-count") {
|
|
107
|
+
out.fieldsCount = parseInt(argv[++i], 10) || 6;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (a === "--import-path") {
|
|
111
|
+
out.importPath = argv[++i];
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (a === "--i18n-path") {
|
|
115
|
+
out.i18nPath = argv[++i];
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (a.startsWith("-")) {
|
|
119
|
+
console.error("Unknown option:", a);
|
|
120
|
+
process.exitCode = 1;
|
|
121
|
+
out.help = true;
|
|
122
|
+
return out;
|
|
123
|
+
}
|
|
124
|
+
if (!out.destination) {
|
|
125
|
+
out.destination = a;
|
|
126
|
+
} else {
|
|
127
|
+
console.error("Unexpected argument:", a);
|
|
128
|
+
process.exitCode = 1;
|
|
129
|
+
out.help = true;
|
|
130
|
+
return out;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function main() {
|
|
137
|
+
const args = parseArgs(process.argv);
|
|
138
|
+
if (args.help) {
|
|
139
|
+
printHelp();
|
|
140
|
+
process.exit(process.exitCode || 0);
|
|
141
|
+
}
|
|
142
|
+
if (!args.type || !args.destination) {
|
|
143
|
+
console.error("Missing required: -g <type> and <destination>\n");
|
|
144
|
+
printHelp();
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const gen = GENERATORS[args.type];
|
|
149
|
+
if (!gen || typeof gen.generate !== "function") {
|
|
150
|
+
console.error("Unknown generator type:", args.type);
|
|
151
|
+
printHelp();
|
|
152
|
+
process.exit(1);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const rawName = args.name || lastPathSegment(args.destination);
|
|
156
|
+
const kebab = kebabCase(rawName);
|
|
157
|
+
const pascal = pascalCase(rawName);
|
|
158
|
+
const labelsSection = args.labelsSection || upperSnakeFromKebab(kebab);
|
|
159
|
+
const apiUri = args.apiUri != null ? args.apiUri : `/${kebab}`;
|
|
160
|
+
|
|
161
|
+
const destDir = path.isAbsolute(args.destination)
|
|
162
|
+
? args.destination
|
|
163
|
+
: path.join(process.cwd(), args.destination);
|
|
164
|
+
|
|
165
|
+
const ctx = {
|
|
166
|
+
kebab,
|
|
167
|
+
pascal,
|
|
168
|
+
labelsSection,
|
|
169
|
+
apiUri,
|
|
170
|
+
importPath: args.importPath,
|
|
171
|
+
fieldsCount: args.fieldsCount,
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const files = gen.generate(ctx);
|
|
175
|
+
writeFiles({ destDir, dryRun: args.dryRun }, files);
|
|
176
|
+
|
|
177
|
+
if (args.i18nPath && typeof gen.getTranslations === "function") {
|
|
178
|
+
const translations = gen.getTranslations(ctx);
|
|
179
|
+
if (translations && Object.keys(translations).length > 0) {
|
|
180
|
+
upsertI18nEntries(args.i18nPath, translations, args.dryRun);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
main();
|