@magmonium/cli 0.7.8

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.
Files changed (204) hide show
  1. package/README.md +392 -0
  2. package/bin/README.md +244 -0
  3. package/bin/cli.js +55 -0
  4. package/bin/commands/assets-wc.js +249 -0
  5. package/bin/commands/assets.js +943 -0
  6. package/bin/commands/build.js +242 -0
  7. package/bin/commands/clean.js +621 -0
  8. package/bin/commands/compile-i18n.js +91 -0
  9. package/bin/commands/config-ci.js +266 -0
  10. package/bin/commands/configure-wc.js +167 -0
  11. package/bin/commands/connect.js +188 -0
  12. package/bin/commands/create-app.js +946 -0
  13. package/bin/commands/deploy.js +100 -0
  14. package/bin/commands/fix-i18n.js +40 -0
  15. package/bin/commands/generate.js +765 -0
  16. package/bin/commands/init/config-files.js +1114 -0
  17. package/bin/commands/init/mag-assets.js +541 -0
  18. package/bin/commands/init/mag-cli-config.js +120 -0
  19. package/bin/commands/init/monorepo-structure.js +735 -0
  20. package/bin/commands/init/package-json.js +308 -0
  21. package/bin/commands/init/project-structure.js +189 -0
  22. package/bin/commands/init/pwa-files.js +204 -0
  23. package/bin/commands/init/source-files.js +2596 -0
  24. package/bin/commands/init.js +591 -0
  25. package/bin/commands/lib.js +508 -0
  26. package/bin/commands/patch-wc-env.js +136 -0
  27. package/bin/commands/refractor.js +51 -0
  28. package/bin/commands/sanitize-i18n.js +41 -0
  29. package/bin/commands/translate.js +32 -0
  30. package/bin/commands/zip.js +540 -0
  31. package/package.json +53 -0
  32. package/src/compilers/button-group-compiler.d.ts +18 -0
  33. package/src/compilers/button-group-compiler.d.ts.map +1 -0
  34. package/src/compilers/button-group-compiler.js +151 -0
  35. package/src/compilers/button-group-compiler.js.map +1 -0
  36. package/src/compilers/copy-compiler.d.ts +14 -0
  37. package/src/compilers/copy-compiler.d.ts.map +1 -0
  38. package/src/compilers/copy-compiler.js +170 -0
  39. package/src/compilers/copy-compiler.js.map +1 -0
  40. package/src/compilers/field-compiler.d.ts +15 -0
  41. package/src/compilers/field-compiler.d.ts.map +1 -0
  42. package/src/compilers/field-compiler.js +153 -0
  43. package/src/compilers/field-compiler.js.map +1 -0
  44. package/src/compilers/form-compiler.d.ts +15 -0
  45. package/src/compilers/form-compiler.d.ts.map +1 -0
  46. package/src/compilers/form-compiler.js +220 -0
  47. package/src/compilers/form-compiler.js.map +1 -0
  48. package/src/compilers/logo-compiler.d.ts +14 -0
  49. package/src/compilers/logo-compiler.d.ts.map +1 -0
  50. package/src/compilers/logo-compiler.js +114 -0
  51. package/src/compilers/logo-compiler.js.map +1 -0
  52. package/src/compilers/options-compiler.d.ts +46 -0
  53. package/src/compilers/options-compiler.d.ts.map +1 -0
  54. package/src/compilers/options-compiler.js +329 -0
  55. package/src/compilers/options-compiler.js.map +1 -0
  56. package/src/compilers/pwa-build.d.ts +7 -0
  57. package/src/compilers/pwa-build.d.ts.map +1 -0
  58. package/src/compilers/pwa-build.js +62 -0
  59. package/src/compilers/pwa-build.js.map +1 -0
  60. package/src/compilers/svg-compiler.d.ts +12 -0
  61. package/src/compilers/svg-compiler.d.ts.map +1 -0
  62. package/src/compilers/svg-compiler.js +123 -0
  63. package/src/compilers/svg-compiler.js.map +1 -0
  64. package/src/compilers/tabs-compiler.d.ts +25 -0
  65. package/src/compilers/tabs-compiler.d.ts.map +1 -0
  66. package/src/compilers/tabs-compiler.js +422 -0
  67. package/src/compilers/tabs-compiler.js.map +1 -0
  68. package/src/compilers/theme-compiler.d.ts +14 -0
  69. package/src/compilers/theme-compiler.d.ts.map +1 -0
  70. package/src/compilers/theme-compiler.js +144 -0
  71. package/src/compilers/theme-compiler.js.map +1 -0
  72. package/src/compilers/translation-compiler.d.ts +17 -0
  73. package/src/compilers/translation-compiler.d.ts.map +1 -0
  74. package/src/compilers/translation-compiler.js +232 -0
  75. package/src/compilers/translation-compiler.js.map +1 -0
  76. package/src/compilers/web-component/index.d.ts +3 -0
  77. package/src/compilers/web-component/index.d.ts.map +1 -0
  78. package/src/compilers/web-component/index.js +6 -0
  79. package/src/compilers/web-component/index.js.map +1 -0
  80. package/src/compilers/web-component/lib/builder.d.ts +45 -0
  81. package/src/compilers/web-component/lib/builder.d.ts.map +1 -0
  82. package/src/compilers/web-component/lib/builder.js +341 -0
  83. package/src/compilers/web-component/lib/builder.js.map +1 -0
  84. package/src/compilers/web-component/lib/class-name.d.ts +4 -0
  85. package/src/compilers/web-component/lib/class-name.d.ts.map +1 -0
  86. package/src/compilers/web-component/lib/class-name.js +24 -0
  87. package/src/compilers/web-component/lib/class-name.js.map +1 -0
  88. package/src/compilers/web-component/lib/config-data.d.ts +9 -0
  89. package/src/compilers/web-component/lib/config-data.d.ts.map +1 -0
  90. package/src/compilers/web-component/lib/config-data.js +14 -0
  91. package/src/compilers/web-component/lib/config-data.js.map +1 -0
  92. package/src/compilers/web-component/lib/ng-build.d.ts +8 -0
  93. package/src/compilers/web-component/lib/ng-build.d.ts.map +1 -0
  94. package/src/compilers/web-component/lib/ng-build.js +685 -0
  95. package/src/compilers/web-component/lib/ng-build.js.map +1 -0
  96. package/src/compilers/web-component/lib/resource-inliner.d.ts +9 -0
  97. package/src/compilers/web-component/lib/resource-inliner.d.ts.map +1 -0
  98. package/src/compilers/web-component/lib/resource-inliner.js +355 -0
  99. package/src/compilers/web-component/lib/resource-inliner.js.map +1 -0
  100. package/src/compilers/web-component/lib/web-component-name.d.ts +3 -0
  101. package/src/compilers/web-component/lib/web-component-name.d.ts.map +1 -0
  102. package/src/compilers/web-component/lib/web-component-name.js +47 -0
  103. package/src/compilers/web-component/lib/web-component-name.js.map +1 -0
  104. package/src/compilers/web-component/lib/web-component-wrapper.d.ts +3 -0
  105. package/src/compilers/web-component/lib/web-component-wrapper.d.ts.map +1 -0
  106. package/src/compilers/web-component/lib/web-component-wrapper.js +335 -0
  107. package/src/compilers/web-component/lib/web-component-wrapper.js.map +1 -0
  108. package/src/compilers/web-component/model/type.d.ts +29 -0
  109. package/src/compilers/web-component/model/type.d.ts.map +1 -0
  110. package/src/compilers/web-component/model/type.js +3 -0
  111. package/src/compilers/web-component/model/type.js.map +1 -0
  112. package/src/compilers/worker-compiler.d.ts +12 -0
  113. package/src/compilers/worker-compiler.d.ts.map +1 -0
  114. package/src/compilers/worker-compiler.js +123 -0
  115. package/src/compilers/worker-compiler.js.map +1 -0
  116. package/src/compilers/yaml-compiler.d.ts +18 -0
  117. package/src/compilers/yaml-compiler.d.ts.map +1 -0
  118. package/src/compilers/yaml-compiler.js +139 -0
  119. package/src/compilers/yaml-compiler.js.map +1 -0
  120. package/src/core/base-compiler.d.ts +17 -0
  121. package/src/core/base-compiler.d.ts.map +1 -0
  122. package/src/core/base-compiler.js +78 -0
  123. package/src/core/base-compiler.js.map +1 -0
  124. package/src/core/config.d.ts +640 -0
  125. package/src/core/config.d.ts.map +1 -0
  126. package/src/core/config.js +432 -0
  127. package/src/core/config.js.map +1 -0
  128. package/src/core/file-watcher.d.ts +23 -0
  129. package/src/core/file-watcher.d.ts.map +1 -0
  130. package/src/core/file-watcher.js +63 -0
  131. package/src/core/file-watcher.js.map +1 -0
  132. package/src/index.d.ts +31 -0
  133. package/src/index.d.ts.map +1 -0
  134. package/src/index.js +34 -0
  135. package/src/index.js.map +1 -0
  136. package/src/types/asset-configs.d.ts +189 -0
  137. package/src/types/asset-configs.d.ts.map +1 -0
  138. package/src/types/asset-configs.js +7 -0
  139. package/src/types/asset-configs.js.map +1 -0
  140. package/src/types/theme.d.ts +67 -0
  141. package/src/types/theme.d.ts.map +1 -0
  142. package/src/types/theme.js +3 -0
  143. package/src/types/theme.js.map +1 -0
  144. package/src/utils/file-utils.d.ts +16 -0
  145. package/src/utils/file-utils.d.ts.map +1 -0
  146. package/src/utils/file-utils.js +58 -0
  147. package/src/utils/file-utils.js.map +1 -0
  148. package/src/utils/i18n-compile-validator.d.ts +20 -0
  149. package/src/utils/i18n-compile-validator.d.ts.map +1 -0
  150. package/src/utils/i18n-compile-validator.js +198 -0
  151. package/src/utils/i18n-compile-validator.js.map +1 -0
  152. package/src/utils/i18n-fixer.d.ts +39 -0
  153. package/src/utils/i18n-fixer.d.ts.map +1 -0
  154. package/src/utils/i18n-fixer.js +396 -0
  155. package/src/utils/i18n-fixer.js.map +1 -0
  156. package/src/utils/i18n-sanitizer.d.ts +17 -0
  157. package/src/utils/i18n-sanitizer.d.ts.map +1 -0
  158. package/src/utils/i18n-sanitizer.js +101 -0
  159. package/src/utils/i18n-sanitizer.js.map +1 -0
  160. package/src/utils/i18n-utils.d.ts +21 -0
  161. package/src/utils/i18n-utils.d.ts.map +1 -0
  162. package/src/utils/i18n-utils.js +89 -0
  163. package/src/utils/i18n-utils.js.map +1 -0
  164. package/src/utils/interactive-translator.d.ts +18 -0
  165. package/src/utils/interactive-translator.d.ts.map +1 -0
  166. package/src/utils/interactive-translator.js +401 -0
  167. package/src/utils/interactive-translator.js.map +1 -0
  168. package/src/utils/llama-cpp-translator.d.ts +33 -0
  169. package/src/utils/llama-cpp-translator.d.ts.map +1 -0
  170. package/src/utils/llama-cpp-translator.js +267 -0
  171. package/src/utils/llama-cpp-translator.js.map +1 -0
  172. package/src/utils/logger.d.ts +14 -0
  173. package/src/utils/logger.d.ts.map +1 -0
  174. package/src/utils/logger.js +42 -0
  175. package/src/utils/logger.js.map +1 -0
  176. package/src/utils/ollama-translator.d.ts +38 -0
  177. package/src/utils/ollama-translator.d.ts.map +1 -0
  178. package/src/utils/ollama-translator.js +371 -0
  179. package/src/utils/ollama-translator.js.map +1 -0
  180. package/src/utils/option-utils.d.ts +58 -0
  181. package/src/utils/option-utils.d.ts.map +1 -0
  182. package/src/utils/option-utils.js +123 -0
  183. package/src/utils/option-utils.js.map +1 -0
  184. package/src/utils/platform-utils.d.ts +33 -0
  185. package/src/utils/platform-utils.d.ts.map +1 -0
  186. package/src/utils/platform-utils.js +114 -0
  187. package/src/utils/platform-utils.js.map +1 -0
  188. package/src/utils/pwa-utils.d.ts +28 -0
  189. package/src/utils/pwa-utils.d.ts.map +1 -0
  190. package/src/utils/pwa-utils.js +48 -0
  191. package/src/utils/pwa-utils.js.map +1 -0
  192. package/src/utils/translation-manager.d.ts +43 -0
  193. package/src/utils/translation-manager.d.ts.map +1 -0
  194. package/src/utils/translation-manager.js +302 -0
  195. package/src/utils/translation-manager.js.map +1 -0
  196. package/src/utils/web-translation-providers.d.ts +53 -0
  197. package/src/utils/web-translation-providers.d.ts.map +1 -0
  198. package/src/utils/web-translation-providers.js +190 -0
  199. package/src/utils/web-translation-providers.js.map +1 -0
  200. package/src/utils/yaml-utils.d.ts +9 -0
  201. package/src/utils/yaml-utils.d.ts.map +1 -0
  202. package/src/utils/yaml-utils.js +26 -0
  203. package/src/utils/yaml-utils.js.map +1 -0
  204. package/templates/mag-compile.config.js +77 -0
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FormCompiler = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const base_compiler_1 = require("../core/base-compiler");
6
+ const file_utils_1 = require("../utils/file-utils");
7
+ const file_watcher_1 = require("../core/file-watcher");
8
+ const path_1 = tslib_1.__importDefault(require("path"));
9
+ const yaml_1 = tslib_1.__importDefault(require("yaml"));
10
+ const fs_1 = require("fs");
11
+ class FormCompiler extends base_compiler_1.BaseCompiler {
12
+ constructor(config) {
13
+ super(config);
14
+ this.watcher = null;
15
+ }
16
+ async compile() {
17
+ this.logger.group('Form Compilation');
18
+ try {
19
+ const yamlFiles = await this.findYAMLFiles();
20
+ if (yamlFiles.length === 0) {
21
+ this.logger.info('No YAML files found in form input paths');
22
+ return;
23
+ }
24
+ // Load field configurations
25
+ const fieldConfigs = await this.loadFieldConfigs();
26
+ const formData = await this.processYAMLFiles(yamlFiles, fieldConfigs);
27
+ // Write individual form JSON files
28
+ for (const [formName, formConfig] of Object.entries(formData)) {
29
+ await this.writeFile(`${formName}.json`, this.formatOutput(formConfig));
30
+ }
31
+ this.logger.success(`Compiled ${yamlFiles.length} form files`);
32
+ }
33
+ catch (error) {
34
+ this.logger.error(`Form compilation failed: ${error}`);
35
+ throw error;
36
+ }
37
+ finally {
38
+ this.logger.endGroup();
39
+ }
40
+ }
41
+ async watch() {
42
+ this.watcher = new file_watcher_1.FileWatcher({
43
+ verbose: this.logger.constructor.name === 'Logger',
44
+ });
45
+ this.watcher.on('change', async (filePath) => {
46
+ if (this.isYAMLFile(filePath)) {
47
+ this.logger.info(`Form file changed: ${filePath}`);
48
+ await this.compile();
49
+ }
50
+ });
51
+ this.watcher.on('add', async (filePath) => {
52
+ if (this.isYAMLFile(filePath)) {
53
+ this.logger.info(`Form file added: ${filePath}`);
54
+ await this.compile();
55
+ }
56
+ });
57
+ this.watcher.on('unlink', async (filePath) => {
58
+ if (this.isYAMLFile(filePath)) {
59
+ this.logger.info(`Form file removed: ${filePath}`);
60
+ await this.compile();
61
+ }
62
+ });
63
+ this.watcher.watch(this.config.inputPaths);
64
+ }
65
+ async findYAMLFiles() {
66
+ const patterns = this.config.patterns || ['**/*.yml', '**/*.yaml'];
67
+ const allFiles = [];
68
+ for (const inputPath of this.config.inputPaths) {
69
+ const files = await file_utils_1.FileUtils.findFiles(patterns.map((pattern) => path_1.default.join(inputPath, pattern)), process.cwd());
70
+ allFiles.push(...files);
71
+ }
72
+ return allFiles.filter((file) => this.isYAMLFile(file));
73
+ }
74
+ async loadFieldConfigs() {
75
+ const fieldConfigs = {};
76
+ // Try to load fields from the output path
77
+ const fieldsDir = path_1.default.join(path_1.default.dirname(this.outputPath), 'fields');
78
+ try {
79
+ const fieldFiles = await fs_1.promises.readdir(fieldsDir);
80
+ for (const file of fieldFiles) {
81
+ if (file.endsWith('.json')) {
82
+ const fieldName = file.replace('.json', '');
83
+ const fieldFilePath = path_1.default.join(fieldsDir, file);
84
+ try {
85
+ const fieldContent = await fs_1.promises.readFile(fieldFilePath, 'utf8');
86
+ fieldConfigs[fieldName] = JSON.parse(fieldContent);
87
+ this.logger.debug(`Loaded field config for: ${fieldName}`);
88
+ }
89
+ catch (error) {
90
+ this.logger.warn(`Could not read field config for ${fieldName}: ${error}`);
91
+ }
92
+ }
93
+ }
94
+ }
95
+ catch (error) {
96
+ this.logger.warn(`Could not read fields directory ${fieldsDir}: ${error}`);
97
+ }
98
+ return fieldConfigs;
99
+ }
100
+ async processYAMLFiles(files, fieldConfigs) {
101
+ const formData = {};
102
+ let hasErrors = false;
103
+ for (const file of files) {
104
+ try {
105
+ const content = await this.readFile(file);
106
+ const formName = file_utils_1.FileUtils.getFileName(file);
107
+ // Parse YAML content
108
+ const formConfig = yaml_1.default.parse(content);
109
+ // Validate and compile form
110
+ const compiledForm = this.compileForm(formConfig, fieldConfigs, file);
111
+ if (compiledForm) {
112
+ formData[formName] = compiledForm;
113
+ this.logger.debug(`✓ Compiled ${path_1.default.basename(file)} → ${formName}.json`);
114
+ }
115
+ else {
116
+ hasErrors = true;
117
+ }
118
+ }
119
+ catch (error) {
120
+ this.logger.error(`Failed to process form file ${file}: ${error}`);
121
+ hasErrors = true;
122
+ }
123
+ }
124
+ if (hasErrors) {
125
+ throw new Error('Form compilation failed due to validation errors');
126
+ }
127
+ return formData;
128
+ }
129
+ compileForm(formConfig, fieldConfigs, fileName) {
130
+ // Validate fields exist
131
+ const fields = formConfig.fields || formConfig.inputs;
132
+ const missingFields = fields?.filter((field) => !fieldConfigs[field]);
133
+ if (missingFields.length > 0) {
134
+ this.logger.error(`Error in ${fileName}: Missing field definitions for: ${missingFields.join(', ')}`);
135
+ return null;
136
+ }
137
+ // Handle typo in YAML files - normalize 'mandetory' to 'mandatory'
138
+ const mandatory = formConfig.mandatory || [];
139
+ // Validate mandatory fields
140
+ if (mandatory.length > 0) {
141
+ const invalidMandatory = mandatory.filter((field) => !fields.includes(field));
142
+ if (invalidMandatory.length > 0) {
143
+ this.logger.error(`Error in ${fileName}: Mandatory fields not in fields list: ${invalidMandatory.join(', ')}`);
144
+ return null;
145
+ }
146
+ }
147
+ // Compile form with field definitions
148
+ const compiledForm = {
149
+ ...formConfig,
150
+ mandatory: undefined,
151
+ mandetory: undefined,
152
+ values: undefined,
153
+ isValid: undefined,
154
+ isTouched: undefined,
155
+ isActionDisabled: undefined,
156
+ options: undefined,
157
+ disabledOptions: undefined,
158
+ validatorMap: undefined,
159
+ isHidden: undefined,
160
+ isDisabled: undefined,
161
+ isReadOnly: undefined,
162
+ isVisible: undefined,
163
+ fields: fields.map((fieldName) => {
164
+ const field = fieldConfigs[fieldName];
165
+ const isMandatory = mandatory.includes(fieldName) ?? field.isMandatory;
166
+ return {
167
+ ...field,
168
+ model: field.model ?? fieldName,
169
+ placeholder: field.placeholder ?? fieldName,
170
+ isMandatory,
171
+ values: formConfig['values']?.[fieldName] ?? field['values'],
172
+ isValid: formConfig['isValid']?.includes(fieldName) ?? field['isValid'],
173
+ isTouched: formConfig['isTouched']?.includes(fieldName) ?? field['isTouched'],
174
+ options: formConfig['options']?.[fieldName] ?? field.options,
175
+ disabledOptions: formConfig['disabledOptions']?.[fieldName] ??
176
+ field['disabledOptions'],
177
+ validators: this.combineValidators(formConfig['validatorMap']?.[fieldName] ?? field.validators, formConfig['groupValidators']?.[fieldName] ??
178
+ field['groupValidators'], isMandatory),
179
+ isHidden: formConfig['isHidden']?.includes(fieldName) ?? field['isHidden'],
180
+ isDisabled: formConfig['isDisabled']?.includes(fieldName) ??
181
+ field['isDisabled'],
182
+ isReadOnly: formConfig['isReadOnly']?.includes(fieldName) ??
183
+ field['isReadOnly'],
184
+ isVisible: formConfig['isVisible']?.includes(fieldName) ?? field['isVisible'],
185
+ isActionDisabled: formConfig['isActionDisabled']?.includes(fieldName) ??
186
+ field['isActionDisabled'],
187
+ };
188
+ }),
189
+ };
190
+ return compiledForm;
191
+ }
192
+ combineValidators(
193
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
194
+ validators = [],
195
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
196
+ groupValidators = [], isMandatory = false
197
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
198
+ ) {
199
+ const mandatoryValidator = isMandatory
200
+ ? [
201
+ {
202
+ name: 0, // ValidatorType.REQUIRED
203
+ message: 'This field is required',
204
+ },
205
+ ]
206
+ : [];
207
+ return Object.values([...validators, ...groupValidators, ...mandatoryValidator].reduce(
208
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
209
+ (acc, validator) => ({
210
+ ...acc,
211
+ [validator.name]: validator,
212
+ }), {}));
213
+ }
214
+ isYAMLFile(filePath) {
215
+ const ext = file_utils_1.FileUtils.getFileExtension(filePath);
216
+ return ext === '.yml' || ext === '.yaml';
217
+ }
218
+ }
219
+ exports.FormCompiler = FormCompiler;
220
+ //# sourceMappingURL=form-compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-compiler.js","sourceRoot":"","sources":["../../../../../libs/cli/src/compilers/form-compiler.ts"],"names":[],"mappings":";;;;AAAA,yDAAqD;AAErD,oDAAgD;AAChD,uDAAmD;AACnD,wDAAwB;AACxB,wDAAwB;AACxB,2BAAoC;AAkDpC,MAAa,YAAa,SAAQ,4BAAY;IAG5C,YAAY,MAA0B;QACpC,KAAK,CAAC,MAAM,CAAC,CAAC;QAHR,YAAO,GAAuB,IAAI,CAAC;IAI3C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAEtC,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YAE7C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;gBAC5D,OAAO;YACT,CAAC;YAED,4BAA4B;YAC5B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAEnD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;YAEtE,mC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BACrB,SAAS,EACP,UAAU,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC;oBACpE,gBAAgB,EACd,UAAU,CAAC,kBAAkB,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;wBACnD,KAAK,CAAC,kBAAkB,CAAC;iBAC5B,CAAC;YACJ,CAAC,CAAC;SACH,CAAC;QAEF,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,iBAAiB;IACvB,8DAA8D;IAC9D,aAAoB,EAAE;IACtB,8DAA8D;IAC9D,kBAAyB,EAAE,EAC3B,WAAW,GAAG,KAAK;IACnB,8DAA8D;;QAE9D,MAAM,kBAAkB,GAAG,WAAW;YACpC,CAAC,CAAC;gBACE;oBACE,IAAI,EAAE,CAAC,EAAE,yBAAyB;oBAClC,OAAO,EAAE,wBAAwB;iBAClC;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QAEP,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,GAAG,UAAU,EAAE,GAAG,eAAe,EAAE,GAAG,kBAAkB,CAAC,CAAC,MAAM;QAC/D,8DAA8D;QAC9D,CAAC,GAAQ,EAAE,SAAc,EAAE,EAAE,CAAC,CAAC;YAC7B,GAAG,GAAG;YACN,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS;SAC5B,CAAC,EACF,EAAE,CACH,CACF,CAAC;IACJ,CAAC;IAEO,UAAU,CAAC,QAAgB;QACjC,MAAM,GAAG,GAAG,sBAAS,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACjD,OAAO,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,OAAO,CAAC;IAC3C,CAAC;CACF;AA1RD,oCA0RC"}
@@ -0,0 +1,14 @@
1
+ import { BaseCompiler } from '../core/base-compiler';
2
+ import { LogoCompilerConfig } from '../core/config';
3
+ export declare class LogoCompiler extends BaseCompiler {
4
+ private readonly defaultSizes;
5
+ private watcher;
6
+ constructor(config: LogoCompilerConfig);
7
+ private get logoConfig();
8
+ compile(): Promise<void>;
9
+ watch(): Promise<void>;
10
+ private findSourceSvg;
11
+ private ensureDirectoryExists;
12
+ private fileExists;
13
+ }
14
+ //# sourceMappingURL=logo-compiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logo-compiler.d.ts","sourceRoot":"","sources":["../../../../../libs/cli/src/compilers/logo-compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAOpD,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuB;IACpD,OAAO,CAAC,OAAO,CAA4B;gBAE/B,MAAM,EAAE,kBAAkB;IAItC,OAAO,KAAK,UAAU,GAErB;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAqDxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAsBd,aAAa;YAkBb,qBAAqB;YAQrB,UAAU;CAQzB"}
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogoCompiler = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const base_compiler_1 = require("../core/base-compiler");
6
+ const file_watcher_1 = require("../core/file-watcher");
7
+ const path_1 = tslib_1.__importDefault(require("path"));
8
+ const fs_1 = require("fs");
9
+ const sharp_1 = tslib_1.__importDefault(require("sharp"));
10
+ const png_to_ico_1 = tslib_1.__importDefault(require("png-to-ico"));
11
+ class LogoCompiler extends base_compiler_1.BaseCompiler {
12
+ constructor(config) {
13
+ super(config);
14
+ this.defaultSizes = [192, 512, 180, 32];
15
+ this.watcher = null;
16
+ }
17
+ get logoConfig() {
18
+ return this.config;
19
+ }
20
+ async compile() {
21
+ this.logger.group('Logo Compilation');
22
+ try {
23
+ const sourceSvg = await this.findSourceSvg();
24
+ if (!sourceSvg) {
25
+ this.logger.info('No .svg found in input paths, skipping logo compilation');
26
+ return;
27
+ }
28
+ const sizes = this.logoConfig.sizes || this.defaultSizes;
29
+ const outputPath = this.outputPath;
30
+ await this.ensureDirectoryExists(outputPath);
31
+ // Copy SVG
32
+ const iconSvgPath = path_1.default.join(outputPath, 'icon.svg');
33
+ await fs_1.promises.copyFile(sourceSvg, iconSvgPath);
34
+ this.logger.debug(`✓ Copied icon.svg to ${outputPath}/`);
35
+ // Generate PNGs
36
+ for (const size of sizes) {
37
+ const fileName = `${size}x${size}.png`;
38
+ const destinationPath = path_1.default.join(outputPath, fileName);
39
+ await (0, sharp_1.default)(sourceSvg).resize(size, size).png().toFile(destinationPath);
40
+ this.logger.debug(`✓ Generated ${fileName} at ${size}x${size}`);
41
+ }
42
+ // Generate favicon.ico from 32x32.png
43
+ const png32Path = path_1.default.join(outputPath, '32x32.png');
44
+ const icoPath = path_1.default.join(outputPath, 'favicon.ico');
45
+ if (await this.fileExists(png32Path)) {
46
+ const buf = await fs_1.promises.readFile(png32Path);
47
+ const icoBuf = await (0, png_to_ico_1.default)(buf);
48
+ await fs_1.promises.writeFile(icoPath, icoBuf);
49
+ this.logger.debug(`✓ Generated favicon.ico from 32x32.png`);
50
+ }
51
+ this.logger.success(`Logo compilation complete in ${outputPath}`);
52
+ }
53
+ catch (error) {
54
+ this.logger.error(`Logo compilation failed: ${error}`);
55
+ throw error;
56
+ }
57
+ finally {
58
+ this.logger.endGroup();
59
+ }
60
+ }
61
+ async watch() {
62
+ this.watcher = new file_watcher_1.FileWatcher({
63
+ verbose: this.logger.constructor.name === 'Logger',
64
+ });
65
+ this.watcher.on('change', async (filePath) => {
66
+ if (filePath.endsWith('.svg')) {
67
+ this.logger.info(`Logo source changed: ${filePath}`);
68
+ await this.compile();
69
+ }
70
+ });
71
+ this.watcher.on('add', async (filePath) => {
72
+ if (filePath.endsWith('.svg')) {
73
+ this.logger.info(`Logo source added: ${filePath}`);
74
+ await this.compile();
75
+ }
76
+ });
77
+ this.watcher.watch(this.logoConfig.inputPaths);
78
+ }
79
+ async findSourceSvg() {
80
+ for (const inputPath of this.config.inputPaths) {
81
+ let entries;
82
+ try {
83
+ entries = await fs_1.promises.readdir(inputPath);
84
+ }
85
+ catch {
86
+ continue;
87
+ }
88
+ const svgFiles = entries.filter((entry) => entry.endsWith('.svg')).sort();
89
+ if (svgFiles.length > 0) {
90
+ return path_1.default.join(inputPath, svgFiles[0]);
91
+ }
92
+ }
93
+ return null;
94
+ }
95
+ async ensureDirectoryExists(dirPath) {
96
+ try {
97
+ await fs_1.promises.access(dirPath);
98
+ }
99
+ catch {
100
+ await fs_1.promises.mkdir(dirPath, { recursive: true });
101
+ }
102
+ }
103
+ async fileExists(filePath) {
104
+ try {
105
+ await fs_1.promises.access(filePath);
106
+ return true;
107
+ }
108
+ catch {
109
+ return false;
110
+ }
111
+ }
112
+ }
113
+ exports.LogoCompiler = LogoCompiler;
114
+ //# sourceMappingURL=logo-compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logo-compiler.js","sourceRoot":"","sources":["../../../../../libs/cli/src/compilers/logo-compiler.ts"],"names":[],"mappings":";;;;AAAA,yDAAqD;AAErD,uDAAmD;AACnD,wDAAwB;AACxB,2BAAoC;AACpC,0DAA0B;AAC1B,oEAAkC;AAElC,MAAa,YAAa,SAAQ,4BAAY;IAI5C,YAAY,MAA0B;QACpC,KAAK,CAAC,MAAM,CAAC,CAAC;QAJC,iBAAY,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAC5C,YAAO,GAAuB,IAAI,CAAC;IAI3C,CAAC;IAED,IAAY,UAAU;QACpB,OAAO,IAAI,CAAC,MAA4B,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAEtC,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,IAAI,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CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AAzHD,oCAyHC"}
@@ -0,0 +1,46 @@
1
+ import { BaseCompiler } from '../core/base-compiler';
2
+ import { CompilerConfig } from '../core/config';
3
+ export declare class OptionsCompiler extends BaseCompiler {
4
+ private watcher;
5
+ constructor(config: CompilerConfig);
6
+ compile(): Promise<void>;
7
+ watch(): Promise<void>;
8
+ private findYAMLFiles;
9
+ private processYAMLFiles;
10
+ /**
11
+ * Process flexible options input and resolve all references
12
+ */
13
+ private processFlexibleOptions;
14
+ /**
15
+ * Determine if input is array of arrays
16
+ */
17
+ private isArrayOfArrays;
18
+ /**
19
+ * Resolve a group of flexible options to concrete options
20
+ */
21
+ private resolveOptionGroup;
22
+ /**
23
+ * Resolve a single flexible option (either Option object or reference string)
24
+ */
25
+ private resolveFlexibleOption;
26
+ /**
27
+ * Generate a unique option ID based on file name and indices
28
+ */
29
+ private generateOptionId;
30
+ /**
31
+ * Resolve an option reference string to a concrete Option
32
+ */
33
+ private resolveOptionReference;
34
+ /**
35
+ * Parse option reference string into file name and option ID
36
+ */
37
+ private parseOptionReference;
38
+ /**
39
+ * Find an option by ID within flexible options data
40
+ */
41
+ private findOptionInData;
42
+ private processOptionGroups;
43
+ private validateOption;
44
+ private isYAMLFile;
45
+ }
46
+ //# sourceMappingURL=options-compiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options-compiler.d.ts","sourceRoot":"","sources":["../../../../../libs/cli/src/compilers/options-compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAiBhD,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,CAAC,OAAO,CAA4B;gBAE/B,MAAM,EAAE,cAAc;IAI5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BxB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YA6Bd,aAAa;YAeb,gBAAgB;IAiE9B;;OAEG;YACW,sBAAsB;IAiCpC;;OAEG;IACH,OAAO,CAAC,eAAe;IAIvB;;OAEG;YACW,kBAAkB;IAqBhC;;OAEG;YACW,qBAAqB;IAkEnC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;OAEG;YACW,sBAAsB;IAkEpC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAsCxB,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,UAAU;CAGnB"}