@uipath/packager-tool-webapp 1.204.0-preview.255 → 1.205.0-preview.256
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/dist/action-schema/index.js +198 -85
- package/dist/constants.d.ts +13 -0
- package/dist/constants.js +1023 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +231 -118
- package/dist/models/webapp-manifest.d.ts +8 -0
- package/dist/strategies/coded-app-strategy.d.ts +35 -0
- package/dist/utils/bundle-path.d.ts +10 -0
- package/dist/webapp-tool-factory.d.ts +3 -2
- package/dist/webapp-tool.d.ts +7 -1
- package/package.json +5 -4
|
@@ -0,0 +1,1023 @@
|
|
|
1
|
+
// src/models/webapp-manifest.ts
|
|
2
|
+
var WEBAPP_MANIFEST_FILE_NAME = "webAppManifest.json";
|
|
3
|
+
|
|
4
|
+
// ../packager-core/src/filesystem/path.ts
|
|
5
|
+
class Path {
|
|
6
|
+
static normalize(path) {
|
|
7
|
+
return path.replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
8
|
+
}
|
|
9
|
+
static join(...segments) {
|
|
10
|
+
return Path.normalize(segments.filter((s) => s.length > 0).join("/"));
|
|
11
|
+
}
|
|
12
|
+
static dirname(path) {
|
|
13
|
+
const normalized = Path.normalize(path).replace(/\/$/, "");
|
|
14
|
+
if (normalized === "")
|
|
15
|
+
return ".";
|
|
16
|
+
const lastSlash = normalized.lastIndexOf("/");
|
|
17
|
+
if (lastSlash === -1)
|
|
18
|
+
return ".";
|
|
19
|
+
if (lastSlash === 0)
|
|
20
|
+
return "/";
|
|
21
|
+
return normalized.substring(0, lastSlash);
|
|
22
|
+
}
|
|
23
|
+
static basename(path) {
|
|
24
|
+
const normalized = Path.normalize(path).replace(/\/$/, "");
|
|
25
|
+
if (normalized === "")
|
|
26
|
+
return "";
|
|
27
|
+
const lastSlash = normalized.lastIndexOf("/");
|
|
28
|
+
return lastSlash >= 0 ? normalized.substring(lastSlash + 1) : normalized;
|
|
29
|
+
}
|
|
30
|
+
static extname(path) {
|
|
31
|
+
const base = Path.basename(path);
|
|
32
|
+
const lastDot = base.lastIndexOf(".");
|
|
33
|
+
if (lastDot === -1 || lastDot === 0 || lastDot === base.length - 1) {
|
|
34
|
+
return "";
|
|
35
|
+
}
|
|
36
|
+
return base.substring(lastDot);
|
|
37
|
+
}
|
|
38
|
+
static async walkDirectory(fs, rootPath, currentRelativePath = "") {
|
|
39
|
+
const entries = [];
|
|
40
|
+
const absolutePath = currentRelativePath ? Path.join(rootPath, currentRelativePath) : rootPath;
|
|
41
|
+
const items = await fs.readdir(absolutePath);
|
|
42
|
+
for (const item of items) {
|
|
43
|
+
const itemRelativePath = currentRelativePath ? Path.join(currentRelativePath, item) : item;
|
|
44
|
+
const itemAbsolutePath = Path.join(rootPath, itemRelativePath);
|
|
45
|
+
const stat = await fs.stat(itemAbsolutePath);
|
|
46
|
+
if (stat?.isDirectory()) {
|
|
47
|
+
const subEntries = await Path.walkDirectory(fs, rootPath, itemRelativePath);
|
|
48
|
+
entries.push(...subEntries);
|
|
49
|
+
} else if (stat?.isFile()) {
|
|
50
|
+
entries.push({
|
|
51
|
+
relativePath: Path.normalize(itemRelativePath),
|
|
52
|
+
absolutePath: Path.normalize(itemAbsolutePath)
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return entries;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// ../packager-core/src/i18n/types.ts
|
|
60
|
+
function isPluralForm(value) {
|
|
61
|
+
return typeof value === "object" && value !== null && "other" in value;
|
|
62
|
+
}
|
|
63
|
+
function selectPluralForm(forms, count) {
|
|
64
|
+
if (count === 0 && forms.zero !== undefined) {
|
|
65
|
+
return forms.zero;
|
|
66
|
+
}
|
|
67
|
+
if (count === 1 && forms.one !== undefined) {
|
|
68
|
+
return forms.one;
|
|
69
|
+
}
|
|
70
|
+
if (count === 2 && forms.two !== undefined) {
|
|
71
|
+
return forms.two;
|
|
72
|
+
}
|
|
73
|
+
if (forms.few !== undefined) {
|
|
74
|
+
const mod10 = count % 10;
|
|
75
|
+
const mod100 = count % 100;
|
|
76
|
+
if (mod10 >= 2 && mod10 <= 4 && (mod100 < 10 || mod100 >= 20)) {
|
|
77
|
+
return forms.few;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (forms.many !== undefined) {
|
|
81
|
+
const mod10 = count % 10;
|
|
82
|
+
const mod100 = count % 100;
|
|
83
|
+
if (count === 0 || mod10 === 0 && mod100 !== 0 || mod10 >= 5 && mod10 <= 9 || mod100 >= 11 && mod100 <= 14) {
|
|
84
|
+
return forms.many;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return forms.other;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ../packager-core/src/i18n/i18n-manager.ts
|
|
91
|
+
class I18nManager {
|
|
92
|
+
static translations = {};
|
|
93
|
+
static currentLocale = "en";
|
|
94
|
+
static fallbackLocale = "en";
|
|
95
|
+
static registerTranslations(locale, catalog) {
|
|
96
|
+
if (!I18nManager.translations[locale]) {
|
|
97
|
+
I18nManager.translations[locale] = {};
|
|
98
|
+
}
|
|
99
|
+
I18nManager.translations[locale] = I18nManager.deepMerge(I18nManager.translations[locale], catalog);
|
|
100
|
+
}
|
|
101
|
+
static setLocale(locale) {
|
|
102
|
+
const normalized = I18nManager.normalizeLocale(locale);
|
|
103
|
+
if (I18nManager.translations[normalized]) {
|
|
104
|
+
I18nManager.currentLocale = normalized;
|
|
105
|
+
return normalized;
|
|
106
|
+
}
|
|
107
|
+
const baseLocale = normalized.split("-")[0];
|
|
108
|
+
if (baseLocale !== normalized && I18nManager.translations[baseLocale]) {
|
|
109
|
+
I18nManager.currentLocale = baseLocale;
|
|
110
|
+
return baseLocale;
|
|
111
|
+
}
|
|
112
|
+
return I18nManager.currentLocale;
|
|
113
|
+
}
|
|
114
|
+
static getLocale() {
|
|
115
|
+
return I18nManager.currentLocale;
|
|
116
|
+
}
|
|
117
|
+
static setFallbackLocale(locale) {
|
|
118
|
+
I18nManager.fallbackLocale = I18nManager.normalizeLocale(locale);
|
|
119
|
+
}
|
|
120
|
+
static t(key, params, locale) {
|
|
121
|
+
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
122
|
+
let value = I18nManager.getTranslationValue(key, targetLocale);
|
|
123
|
+
if (value === undefined && targetLocale !== I18nManager.fallbackLocale) {
|
|
124
|
+
value = I18nManager.getTranslationValue(key, I18nManager.fallbackLocale);
|
|
125
|
+
}
|
|
126
|
+
if (value === undefined) {
|
|
127
|
+
return key;
|
|
128
|
+
}
|
|
129
|
+
if (isPluralForm(value) && params && "count" in params) {
|
|
130
|
+
const count = typeof params.count === "number" ? params.count : Number(params.count);
|
|
131
|
+
value = selectPluralForm(value, count);
|
|
132
|
+
} else if (isPluralForm(value)) {
|
|
133
|
+
value = value.other;
|
|
134
|
+
}
|
|
135
|
+
if (typeof value !== "string") {
|
|
136
|
+
return key;
|
|
137
|
+
}
|
|
138
|
+
return params ? I18nManager.interpolate(value, params) : value;
|
|
139
|
+
}
|
|
140
|
+
static has(key, locale) {
|
|
141
|
+
const targetLocale = locale ? I18nManager.normalizeLocale(locale) : I18nManager.currentLocale;
|
|
142
|
+
const value = I18nManager.getTranslationValue(key, targetLocale);
|
|
143
|
+
if (value !== undefined) {
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
if (targetLocale !== I18nManager.fallbackLocale) {
|
|
147
|
+
return I18nManager.getTranslationValue(key, I18nManager.fallbackLocale) !== undefined;
|
|
148
|
+
}
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
static getAvailableLocales() {
|
|
152
|
+
return Object.keys(I18nManager.translations);
|
|
153
|
+
}
|
|
154
|
+
static clearTranslations() {
|
|
155
|
+
I18nManager.translations = {};
|
|
156
|
+
I18nManager.currentLocale = "en";
|
|
157
|
+
}
|
|
158
|
+
static getTranslationValue(key, locale) {
|
|
159
|
+
const catalog = I18nManager.translations[locale];
|
|
160
|
+
if (!catalog) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const keys = key.split(".");
|
|
164
|
+
let value = catalog;
|
|
165
|
+
for (const k of keys) {
|
|
166
|
+
if (value && typeof value === "object" && k in value) {
|
|
167
|
+
value = value[k];
|
|
168
|
+
} else {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return value;
|
|
173
|
+
}
|
|
174
|
+
static interpolate(template, params) {
|
|
175
|
+
return template.replace(/\{(\w+)\}/g, (_, key) => {
|
|
176
|
+
const value = params[key];
|
|
177
|
+
return value !== undefined ? String(value) : `{${key}}`;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
static normalizeLocale(locale) {
|
|
181
|
+
const normalized = locale.toLowerCase().replace(/_/g, "-");
|
|
182
|
+
const specialLocales = ["es-mx", "pt-br", "zh-cn", "zh-tw"];
|
|
183
|
+
if (specialLocales.includes(normalized)) {
|
|
184
|
+
return normalized;
|
|
185
|
+
}
|
|
186
|
+
return normalized.split("-")[0];
|
|
187
|
+
}
|
|
188
|
+
static deepMerge(target, source) {
|
|
189
|
+
const result = { ...target };
|
|
190
|
+
for (const key of Object.keys(source)) {
|
|
191
|
+
const sourceValue = source[key];
|
|
192
|
+
const targetValue = result[key];
|
|
193
|
+
if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
|
|
194
|
+
result[key] = I18nManager.deepMerge(targetValue, sourceValue);
|
|
195
|
+
} else {
|
|
196
|
+
result[key] = sourceValue;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return result;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ../packager-core/src/i18n/locales/de.ts
|
|
204
|
+
var de = {
|
|
205
|
+
toolCore: {
|
|
206
|
+
errors: {
|
|
207
|
+
internal: "Internal error: {message}",
|
|
208
|
+
fileNotFound: "File not found: {path}",
|
|
209
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
210
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
211
|
+
directoryNotFound: "Directory not found: {path}",
|
|
212
|
+
invalidPath: "{path} is not a valid path",
|
|
213
|
+
operationCanceled: "Operation was canceled",
|
|
214
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
215
|
+
},
|
|
216
|
+
progress: {
|
|
217
|
+
copying: "Copying files...",
|
|
218
|
+
building: "Building project...",
|
|
219
|
+
packaging: "Creating package...",
|
|
220
|
+
validating: "Validating...",
|
|
221
|
+
analyzing: "Analyzing...",
|
|
222
|
+
restoring: "Restoring dependencies..."
|
|
223
|
+
},
|
|
224
|
+
validation: {
|
|
225
|
+
requiredField: "{field} is required",
|
|
226
|
+
invalidValue: "Invalid value for {field}",
|
|
227
|
+
pathNotFound: "Path not found: {path}",
|
|
228
|
+
fileRequired: "File is required: {path}",
|
|
229
|
+
directoryRequired: "Directory is required: {path}"
|
|
230
|
+
},
|
|
231
|
+
warnings: {
|
|
232
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
233
|
+
},
|
|
234
|
+
info: {
|
|
235
|
+
operationComplete: "Operation completed successfully",
|
|
236
|
+
filesProcessed: {
|
|
237
|
+
zero: "No files processed",
|
|
238
|
+
one: "{count} file processed",
|
|
239
|
+
other: "{count} files processed"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// ../packager-core/src/i18n/locales/en.ts
|
|
246
|
+
var en = {
|
|
247
|
+
toolCore: {
|
|
248
|
+
errors: {
|
|
249
|
+
internal: "Internal error: {message}",
|
|
250
|
+
fileNotFound: "File not found: {path}",
|
|
251
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
252
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
253
|
+
directoryNotFound: "Directory not found: {path}",
|
|
254
|
+
invalidPath: "{path} is not a valid path",
|
|
255
|
+
operationCanceled: "Operation was canceled",
|
|
256
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
257
|
+
},
|
|
258
|
+
progress: {
|
|
259
|
+
copying: "Copying files...",
|
|
260
|
+
building: "Building project...",
|
|
261
|
+
packaging: "Creating package...",
|
|
262
|
+
validating: "Validating...",
|
|
263
|
+
analyzing: "Analyzing...",
|
|
264
|
+
restoring: "Restoring dependencies..."
|
|
265
|
+
},
|
|
266
|
+
validation: {
|
|
267
|
+
requiredField: "{field} is required",
|
|
268
|
+
invalidValue: "Invalid value for {field}",
|
|
269
|
+
pathNotFound: "Path not found: {path}",
|
|
270
|
+
fileRequired: "File is required: {path}",
|
|
271
|
+
directoryRequired: "Directory is required: {path}"
|
|
272
|
+
},
|
|
273
|
+
warnings: {
|
|
274
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
275
|
+
},
|
|
276
|
+
info: {
|
|
277
|
+
operationComplete: "Operation completed successfully",
|
|
278
|
+
filesProcessed: {
|
|
279
|
+
zero: "No files processed",
|
|
280
|
+
one: "{count} file processed",
|
|
281
|
+
other: "{count} files processed"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
// ../packager-core/src/i18n/locales/es.ts
|
|
288
|
+
var es = {
|
|
289
|
+
toolCore: {
|
|
290
|
+
errors: {
|
|
291
|
+
internal: "Internal error: {message}",
|
|
292
|
+
fileNotFound: "File not found: {path}",
|
|
293
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
294
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
295
|
+
directoryNotFound: "Directory not found: {path}",
|
|
296
|
+
invalidPath: "{path} is not a valid path",
|
|
297
|
+
operationCanceled: "Operation was canceled",
|
|
298
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
299
|
+
},
|
|
300
|
+
progress: {
|
|
301
|
+
copying: "Copying files...",
|
|
302
|
+
building: "Building project...",
|
|
303
|
+
packaging: "Creating package...",
|
|
304
|
+
validating: "Validating...",
|
|
305
|
+
analyzing: "Analyzing...",
|
|
306
|
+
restoring: "Restoring dependencies..."
|
|
307
|
+
},
|
|
308
|
+
validation: {
|
|
309
|
+
requiredField: "{field} is required",
|
|
310
|
+
invalidValue: "Invalid value for {field}",
|
|
311
|
+
pathNotFound: "Path not found: {path}",
|
|
312
|
+
fileRequired: "File is required: {path}",
|
|
313
|
+
directoryRequired: "Directory is required: {path}"
|
|
314
|
+
},
|
|
315
|
+
warnings: {
|
|
316
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
317
|
+
},
|
|
318
|
+
info: {
|
|
319
|
+
operationComplete: "Operation completed successfully",
|
|
320
|
+
filesProcessed: {
|
|
321
|
+
zero: "No files processed",
|
|
322
|
+
one: "{count} file processed",
|
|
323
|
+
other: "{count} files processed"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
// ../packager-core/src/i18n/locales/es-MX.ts
|
|
330
|
+
var es_MX = {
|
|
331
|
+
toolCore: {
|
|
332
|
+
errors: {
|
|
333
|
+
internal: "Internal error: {message}",
|
|
334
|
+
fileNotFound: "File not found: {path}",
|
|
335
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
336
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
337
|
+
directoryNotFound: "Directory not found: {path}",
|
|
338
|
+
invalidPath: "{path} is not a valid path",
|
|
339
|
+
operationCanceled: "Operation was canceled",
|
|
340
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
341
|
+
},
|
|
342
|
+
progress: {
|
|
343
|
+
copying: "Copying files...",
|
|
344
|
+
building: "Building project...",
|
|
345
|
+
packaging: "Creating package...",
|
|
346
|
+
validating: "Validating...",
|
|
347
|
+
analyzing: "Analyzing...",
|
|
348
|
+
restoring: "Restoring dependencies..."
|
|
349
|
+
},
|
|
350
|
+
validation: {
|
|
351
|
+
requiredField: "{field} is required",
|
|
352
|
+
invalidValue: "Invalid value for {field}",
|
|
353
|
+
pathNotFound: "Path not found: {path}",
|
|
354
|
+
fileRequired: "File is required: {path}",
|
|
355
|
+
directoryRequired: "Directory is required: {path}"
|
|
356
|
+
},
|
|
357
|
+
warnings: {
|
|
358
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
359
|
+
},
|
|
360
|
+
info: {
|
|
361
|
+
operationComplete: "Operation completed successfully",
|
|
362
|
+
filesProcessed: {
|
|
363
|
+
zero: "No files processed",
|
|
364
|
+
one: "{count} file processed",
|
|
365
|
+
other: "{count} files processed"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
// ../packager-core/src/i18n/locales/fr.ts
|
|
372
|
+
var fr = {
|
|
373
|
+
toolCore: {
|
|
374
|
+
errors: {
|
|
375
|
+
internal: "Internal error: {message}",
|
|
376
|
+
fileNotFound: "File not found: {path}",
|
|
377
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
378
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
379
|
+
directoryNotFound: "Directory not found: {path}",
|
|
380
|
+
invalidPath: "{path} is not a valid path",
|
|
381
|
+
operationCanceled: "Operation was canceled",
|
|
382
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
383
|
+
},
|
|
384
|
+
progress: {
|
|
385
|
+
copying: "Copying files...",
|
|
386
|
+
building: "Building project...",
|
|
387
|
+
packaging: "Creating package...",
|
|
388
|
+
validating: "Validating...",
|
|
389
|
+
analyzing: "Analyzing...",
|
|
390
|
+
restoring: "Restoring dependencies..."
|
|
391
|
+
},
|
|
392
|
+
validation: {
|
|
393
|
+
requiredField: "{field} is required",
|
|
394
|
+
invalidValue: "Invalid value for {field}",
|
|
395
|
+
pathNotFound: "Path not found: {path}",
|
|
396
|
+
fileRequired: "File is required: {path}",
|
|
397
|
+
directoryRequired: "Directory is required: {path}"
|
|
398
|
+
},
|
|
399
|
+
warnings: {
|
|
400
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
401
|
+
},
|
|
402
|
+
info: {
|
|
403
|
+
operationComplete: "Operation completed successfully",
|
|
404
|
+
filesProcessed: {
|
|
405
|
+
zero: "No files processed",
|
|
406
|
+
one: "{count} file processed",
|
|
407
|
+
other: "{count} files processed"
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
// ../packager-core/src/i18n/locales/ja.ts
|
|
414
|
+
var ja = {
|
|
415
|
+
toolCore: {
|
|
416
|
+
errors: {
|
|
417
|
+
internal: "Internal error: {message}",
|
|
418
|
+
fileNotFound: "File not found: {path}",
|
|
419
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
420
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
421
|
+
directoryNotFound: "Directory not found: {path}",
|
|
422
|
+
invalidPath: "{path} is not a valid path",
|
|
423
|
+
operationCanceled: "Operation was canceled",
|
|
424
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
425
|
+
},
|
|
426
|
+
progress: {
|
|
427
|
+
copying: "Copying files...",
|
|
428
|
+
building: "Building project...",
|
|
429
|
+
packaging: "Creating package...",
|
|
430
|
+
validating: "Validating...",
|
|
431
|
+
analyzing: "Analyzing...",
|
|
432
|
+
restoring: "Restoring dependencies..."
|
|
433
|
+
},
|
|
434
|
+
validation: {
|
|
435
|
+
requiredField: "{field} is required",
|
|
436
|
+
invalidValue: "Invalid value for {field}",
|
|
437
|
+
pathNotFound: "Path not found: {path}",
|
|
438
|
+
fileRequired: "File is required: {path}",
|
|
439
|
+
directoryRequired: "Directory is required: {path}"
|
|
440
|
+
},
|
|
441
|
+
warnings: {
|
|
442
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
443
|
+
},
|
|
444
|
+
info: {
|
|
445
|
+
operationComplete: "Operation completed successfully",
|
|
446
|
+
filesProcessed: {
|
|
447
|
+
zero: "No files processed",
|
|
448
|
+
one: "{count} file processed",
|
|
449
|
+
other: "{count} files processed"
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
// ../packager-core/src/i18n/locales/ko.ts
|
|
456
|
+
var ko = {
|
|
457
|
+
toolCore: {
|
|
458
|
+
errors: {
|
|
459
|
+
internal: "Internal error: {message}",
|
|
460
|
+
fileNotFound: "File not found: {path}",
|
|
461
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
462
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
463
|
+
directoryNotFound: "Directory not found: {path}",
|
|
464
|
+
invalidPath: "{path} is not a valid path",
|
|
465
|
+
operationCanceled: "Operation was canceled",
|
|
466
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
467
|
+
},
|
|
468
|
+
progress: {
|
|
469
|
+
copying: "Copying files...",
|
|
470
|
+
building: "Building project...",
|
|
471
|
+
packaging: "Creating package...",
|
|
472
|
+
validating: "Validating...",
|
|
473
|
+
analyzing: "Analyzing...",
|
|
474
|
+
restoring: "Restoring dependencies..."
|
|
475
|
+
},
|
|
476
|
+
validation: {
|
|
477
|
+
requiredField: "{field} is required",
|
|
478
|
+
invalidValue: "Invalid value for {field}",
|
|
479
|
+
pathNotFound: "Path not found: {path}",
|
|
480
|
+
fileRequired: "File is required: {path}",
|
|
481
|
+
directoryRequired: "Directory is required: {path}"
|
|
482
|
+
},
|
|
483
|
+
warnings: {
|
|
484
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
485
|
+
},
|
|
486
|
+
info: {
|
|
487
|
+
operationComplete: "Operation completed successfully",
|
|
488
|
+
filesProcessed: {
|
|
489
|
+
zero: "No files processed",
|
|
490
|
+
one: "{count} file processed",
|
|
491
|
+
other: "{count} files processed"
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
// ../packager-core/src/i18n/locales/pt.ts
|
|
498
|
+
var pt = {
|
|
499
|
+
toolCore: {
|
|
500
|
+
errors: {
|
|
501
|
+
internal: "Internal error: {message}",
|
|
502
|
+
fileNotFound: "File not found: {path}",
|
|
503
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
504
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
505
|
+
directoryNotFound: "Directory not found: {path}",
|
|
506
|
+
invalidPath: "{path} is not a valid path",
|
|
507
|
+
operationCanceled: "Operation was canceled",
|
|
508
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
509
|
+
},
|
|
510
|
+
progress: {
|
|
511
|
+
copying: "Copying files...",
|
|
512
|
+
building: "Building project...",
|
|
513
|
+
packaging: "Creating package...",
|
|
514
|
+
validating: "Validating...",
|
|
515
|
+
analyzing: "Analyzing...",
|
|
516
|
+
restoring: "Restoring dependencies..."
|
|
517
|
+
},
|
|
518
|
+
validation: {
|
|
519
|
+
requiredField: "{field} is required",
|
|
520
|
+
invalidValue: "Invalid value for {field}",
|
|
521
|
+
pathNotFound: "Path not found: {path}",
|
|
522
|
+
fileRequired: "File is required: {path}",
|
|
523
|
+
directoryRequired: "Directory is required: {path}"
|
|
524
|
+
},
|
|
525
|
+
warnings: {
|
|
526
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
527
|
+
},
|
|
528
|
+
info: {
|
|
529
|
+
operationComplete: "Operation completed successfully",
|
|
530
|
+
filesProcessed: {
|
|
531
|
+
zero: "No files processed",
|
|
532
|
+
one: "{count} file processed",
|
|
533
|
+
other: "{count} files processed"
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
// ../packager-core/src/i18n/locales/pt-BR.ts
|
|
540
|
+
var pt_BR = {
|
|
541
|
+
toolCore: {
|
|
542
|
+
errors: {
|
|
543
|
+
internal: "Internal error: {message}",
|
|
544
|
+
fileNotFound: "File not found: {path}",
|
|
545
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
546
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
547
|
+
directoryNotFound: "Directory not found: {path}",
|
|
548
|
+
invalidPath: "{path} is not a valid path",
|
|
549
|
+
operationCanceled: "Operation was canceled",
|
|
550
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
551
|
+
},
|
|
552
|
+
progress: {
|
|
553
|
+
copying: "Copying files...",
|
|
554
|
+
building: "Building project...",
|
|
555
|
+
packaging: "Creating package...",
|
|
556
|
+
validating: "Validating...",
|
|
557
|
+
analyzing: "Analyzing...",
|
|
558
|
+
restoring: "Restoring dependencies..."
|
|
559
|
+
},
|
|
560
|
+
validation: {
|
|
561
|
+
requiredField: "{field} is required",
|
|
562
|
+
invalidValue: "Invalid value for {field}",
|
|
563
|
+
pathNotFound: "Path not found: {path}",
|
|
564
|
+
fileRequired: "File is required: {path}",
|
|
565
|
+
directoryRequired: "Directory is required: {path}"
|
|
566
|
+
},
|
|
567
|
+
warnings: {
|
|
568
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
569
|
+
},
|
|
570
|
+
info: {
|
|
571
|
+
operationComplete: "Operation completed successfully",
|
|
572
|
+
filesProcessed: {
|
|
573
|
+
zero: "No files processed",
|
|
574
|
+
one: "{count} file processed",
|
|
575
|
+
other: "{count} files processed"
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
// ../packager-core/src/i18n/locales/ro.ts
|
|
582
|
+
var ro = {
|
|
583
|
+
toolCore: {
|
|
584
|
+
errors: {
|
|
585
|
+
internal: "Internal error: {message}",
|
|
586
|
+
fileNotFound: "File not found: {path}",
|
|
587
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
588
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
589
|
+
directoryNotFound: "Directory not found: {path}",
|
|
590
|
+
invalidPath: "{path} is not a valid path",
|
|
591
|
+
operationCanceled: "Operation was canceled",
|
|
592
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
593
|
+
},
|
|
594
|
+
progress: {
|
|
595
|
+
copying: "Copying files...",
|
|
596
|
+
building: "Building project...",
|
|
597
|
+
packaging: "Creating package...",
|
|
598
|
+
validating: "Validating...",
|
|
599
|
+
analyzing: "Analyzing...",
|
|
600
|
+
restoring: "Restoring dependencies..."
|
|
601
|
+
},
|
|
602
|
+
validation: {
|
|
603
|
+
requiredField: "{field} is required",
|
|
604
|
+
invalidValue: "Invalid value for {field}",
|
|
605
|
+
pathNotFound: "Path not found: {path}",
|
|
606
|
+
fileRequired: "File is required: {path}",
|
|
607
|
+
directoryRequired: "Directory is required: {path}"
|
|
608
|
+
},
|
|
609
|
+
warnings: {
|
|
610
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
611
|
+
},
|
|
612
|
+
info: {
|
|
613
|
+
operationComplete: "Operation completed successfully",
|
|
614
|
+
filesProcessed: {
|
|
615
|
+
zero: "No files processed",
|
|
616
|
+
one: "{count} file processed",
|
|
617
|
+
other: "{count} files processed"
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
// ../packager-core/src/i18n/locales/ru.ts
|
|
624
|
+
var ru = {
|
|
625
|
+
toolCore: {
|
|
626
|
+
errors: {
|
|
627
|
+
internal: "Internal error: {message}",
|
|
628
|
+
fileNotFound: "File not found: {path}",
|
|
629
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
630
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
631
|
+
directoryNotFound: "Directory not found: {path}",
|
|
632
|
+
invalidPath: "{path} is not a valid path",
|
|
633
|
+
operationCanceled: "Operation was canceled",
|
|
634
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
635
|
+
},
|
|
636
|
+
progress: {
|
|
637
|
+
copying: "Copying files...",
|
|
638
|
+
building: "Building project...",
|
|
639
|
+
packaging: "Creating package...",
|
|
640
|
+
validating: "Validating...",
|
|
641
|
+
analyzing: "Analyzing...",
|
|
642
|
+
restoring: "Restoring dependencies..."
|
|
643
|
+
},
|
|
644
|
+
validation: {
|
|
645
|
+
requiredField: "{field} is required",
|
|
646
|
+
invalidValue: "Invalid value for {field}",
|
|
647
|
+
pathNotFound: "Path not found: {path}",
|
|
648
|
+
fileRequired: "File is required: {path}",
|
|
649
|
+
directoryRequired: "Directory is required: {path}"
|
|
650
|
+
},
|
|
651
|
+
warnings: {
|
|
652
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
653
|
+
},
|
|
654
|
+
info: {
|
|
655
|
+
operationComplete: "Operation completed successfully",
|
|
656
|
+
filesProcessed: {
|
|
657
|
+
zero: "No files processed",
|
|
658
|
+
one: "{count} file processed",
|
|
659
|
+
other: "{count} files processed"
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
// ../packager-core/src/i18n/locales/tr.ts
|
|
666
|
+
var tr = {
|
|
667
|
+
toolCore: {
|
|
668
|
+
errors: {
|
|
669
|
+
internal: "Internal error: {message}",
|
|
670
|
+
fileNotFound: "File not found: {path}",
|
|
671
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
672
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
673
|
+
directoryNotFound: "Directory not found: {path}",
|
|
674
|
+
invalidPath: "{path} is not a valid path",
|
|
675
|
+
operationCanceled: "Operation was canceled",
|
|
676
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
677
|
+
},
|
|
678
|
+
progress: {
|
|
679
|
+
copying: "Copying files...",
|
|
680
|
+
building: "Building project...",
|
|
681
|
+
packaging: "Creating package...",
|
|
682
|
+
validating: "Validating...",
|
|
683
|
+
analyzing: "Analyzing...",
|
|
684
|
+
restoring: "Restoring dependencies..."
|
|
685
|
+
},
|
|
686
|
+
validation: {
|
|
687
|
+
requiredField: "{field} is required",
|
|
688
|
+
invalidValue: "Invalid value for {field}",
|
|
689
|
+
pathNotFound: "Path not found: {path}",
|
|
690
|
+
fileRequired: "File is required: {path}",
|
|
691
|
+
directoryRequired: "Directory is required: {path}"
|
|
692
|
+
},
|
|
693
|
+
warnings: {
|
|
694
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
695
|
+
},
|
|
696
|
+
info: {
|
|
697
|
+
operationComplete: "Operation completed successfully",
|
|
698
|
+
filesProcessed: {
|
|
699
|
+
zero: "No files processed",
|
|
700
|
+
one: "{count} file processed",
|
|
701
|
+
other: "{count} files processed"
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
// ../packager-core/src/i18n/locales/zh-CN.ts
|
|
708
|
+
var zh_CN = {
|
|
709
|
+
toolCore: {
|
|
710
|
+
errors: {
|
|
711
|
+
internal: "Internal error: {message}",
|
|
712
|
+
fileNotFound: "File not found: {path}",
|
|
713
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
714
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
715
|
+
directoryNotFound: "Directory not found: {path}",
|
|
716
|
+
invalidPath: "{path} is not a valid path",
|
|
717
|
+
operationCanceled: "Operation was canceled",
|
|
718
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
719
|
+
},
|
|
720
|
+
progress: {
|
|
721
|
+
copying: "Copying files...",
|
|
722
|
+
building: "Building project...",
|
|
723
|
+
packaging: "Creating package...",
|
|
724
|
+
validating: "Validating...",
|
|
725
|
+
analyzing: "Analyzing...",
|
|
726
|
+
restoring: "Restoring dependencies..."
|
|
727
|
+
},
|
|
728
|
+
validation: {
|
|
729
|
+
requiredField: "{field} is required",
|
|
730
|
+
invalidValue: "Invalid value for {field}",
|
|
731
|
+
pathNotFound: "Path not found: {path}",
|
|
732
|
+
fileRequired: "File is required: {path}",
|
|
733
|
+
directoryRequired: "Directory is required: {path}"
|
|
734
|
+
},
|
|
735
|
+
warnings: {
|
|
736
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
737
|
+
},
|
|
738
|
+
info: {
|
|
739
|
+
operationComplete: "Operation completed successfully",
|
|
740
|
+
filesProcessed: {
|
|
741
|
+
zero: "No files processed",
|
|
742
|
+
one: "{count} file processed",
|
|
743
|
+
other: "{count} files processed"
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
|
|
749
|
+
// ../packager-core/src/i18n/locales/zh-TW.ts
|
|
750
|
+
var zh_TW = {
|
|
751
|
+
toolCore: {
|
|
752
|
+
errors: {
|
|
753
|
+
internal: "Internal error: {message}",
|
|
754
|
+
fileNotFound: "File not found: {path}",
|
|
755
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
756
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
757
|
+
directoryNotFound: "Directory not found: {path}",
|
|
758
|
+
invalidPath: "{path} is not a valid path",
|
|
759
|
+
operationCanceled: "Operation was canceled",
|
|
760
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
761
|
+
},
|
|
762
|
+
progress: {
|
|
763
|
+
copying: "Copying files...",
|
|
764
|
+
building: "Building project...",
|
|
765
|
+
packaging: "Creating package...",
|
|
766
|
+
validating: "Validating...",
|
|
767
|
+
analyzing: "Analyzing...",
|
|
768
|
+
restoring: "Restoring dependencies..."
|
|
769
|
+
},
|
|
770
|
+
validation: {
|
|
771
|
+
requiredField: "{field} is required",
|
|
772
|
+
invalidValue: "Invalid value for {field}",
|
|
773
|
+
pathNotFound: "Path not found: {path}",
|
|
774
|
+
fileRequired: "File is required: {path}",
|
|
775
|
+
directoryRequired: "Directory is required: {path}"
|
|
776
|
+
},
|
|
777
|
+
warnings: {
|
|
778
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
779
|
+
},
|
|
780
|
+
info: {
|
|
781
|
+
operationComplete: "Operation completed successfully",
|
|
782
|
+
filesProcessed: {
|
|
783
|
+
zero: "No files processed",
|
|
784
|
+
one: "{count} file processed",
|
|
785
|
+
other: "{count} files processed"
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
// ../packager-core/src/i18n/locales/zu.ts
|
|
792
|
+
var zu = {
|
|
793
|
+
toolCore: {
|
|
794
|
+
errors: {
|
|
795
|
+
internal: "Internal error: {message}",
|
|
796
|
+
fileNotFound: "File not found: {path}",
|
|
797
|
+
fileReadFailed: "Failed to read file: {path}",
|
|
798
|
+
fileWriteFailed: "Failed to write file: {path}",
|
|
799
|
+
directoryNotFound: "Directory not found: {path}",
|
|
800
|
+
invalidPath: "{path} is not a valid path",
|
|
801
|
+
operationCanceled: "Operation was canceled",
|
|
802
|
+
invalidParameter: "Invalid parameter: {parameter}"
|
|
803
|
+
},
|
|
804
|
+
progress: {
|
|
805
|
+
copying: "Copying files...",
|
|
806
|
+
building: "Building project...",
|
|
807
|
+
packaging: "Creating package...",
|
|
808
|
+
validating: "Validating...",
|
|
809
|
+
analyzing: "Analyzing...",
|
|
810
|
+
restoring: "Restoring dependencies..."
|
|
811
|
+
},
|
|
812
|
+
validation: {
|
|
813
|
+
requiredField: "{field} is required",
|
|
814
|
+
invalidValue: "Invalid value for {field}",
|
|
815
|
+
pathNotFound: "Path not found: {path}",
|
|
816
|
+
fileRequired: "File is required: {path}",
|
|
817
|
+
directoryRequired: "Directory is required: {path}"
|
|
818
|
+
},
|
|
819
|
+
warnings: {
|
|
820
|
+
factoryAlreadyRegistered: "A factory is already registered for project type '{type}'. Skipping duplicate registration."
|
|
821
|
+
},
|
|
822
|
+
info: {
|
|
823
|
+
operationComplete: "Operation completed successfully",
|
|
824
|
+
filesProcessed: {
|
|
825
|
+
zero: "No files processed",
|
|
826
|
+
one: "{count} file processed",
|
|
827
|
+
other: "{count} files processed"
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
// ../packager-core/src/i18n/translation-service.ts
|
|
834
|
+
class TranslationService {
|
|
835
|
+
static instance;
|
|
836
|
+
currentLocale = "en";
|
|
837
|
+
constructor() {}
|
|
838
|
+
static getInstance() {
|
|
839
|
+
if (!TranslationService.instance) {
|
|
840
|
+
TranslationService.instance = new TranslationService;
|
|
841
|
+
}
|
|
842
|
+
return TranslationService.instance;
|
|
843
|
+
}
|
|
844
|
+
setLocale(locale) {
|
|
845
|
+
this.currentLocale = I18nManager.setLocale(locale);
|
|
846
|
+
}
|
|
847
|
+
getLocale() {
|
|
848
|
+
return this.currentLocale;
|
|
849
|
+
}
|
|
850
|
+
t(key, params) {
|
|
851
|
+
return I18nManager.t(key, params, this.currentLocale);
|
|
852
|
+
}
|
|
853
|
+
tLocale(key, locale, params) {
|
|
854
|
+
return I18nManager.t(key, params, locale);
|
|
855
|
+
}
|
|
856
|
+
has(key) {
|
|
857
|
+
return I18nManager.has(key, this.currentLocale);
|
|
858
|
+
}
|
|
859
|
+
getAvailableLocales() {
|
|
860
|
+
return I18nManager.getAvailableLocales();
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
var translate = TranslationService.getInstance();
|
|
864
|
+
|
|
865
|
+
// ../packager-core/src/i18n/index.ts
|
|
866
|
+
I18nManager.registerTranslations("en", en);
|
|
867
|
+
I18nManager.registerTranslations("de", de);
|
|
868
|
+
I18nManager.registerTranslations("es", es);
|
|
869
|
+
I18nManager.registerTranslations("es-mx", es_MX);
|
|
870
|
+
I18nManager.registerTranslations("fr", fr);
|
|
871
|
+
I18nManager.registerTranslations("ja", ja);
|
|
872
|
+
I18nManager.registerTranslations("ko", ko);
|
|
873
|
+
I18nManager.registerTranslations("pt", pt);
|
|
874
|
+
I18nManager.registerTranslations("pt-br", pt_BR);
|
|
875
|
+
I18nManager.registerTranslations("ro", ro);
|
|
876
|
+
I18nManager.registerTranslations("ru", ru);
|
|
877
|
+
I18nManager.registerTranslations("tr", tr);
|
|
878
|
+
I18nManager.registerTranslations("zh-cn", zh_CN);
|
|
879
|
+
I18nManager.registerTranslations("zh-tw", zh_TW);
|
|
880
|
+
I18nManager.registerTranslations("zu", zu);
|
|
881
|
+
I18nManager.setLocale("en");
|
|
882
|
+
// ../packager-core/src/services/tools-factory-repository.ts
|
|
883
|
+
class ToolsFactoryRepository {
|
|
884
|
+
projectFactoryMap = new Map;
|
|
885
|
+
solutionFactory = null;
|
|
886
|
+
registerProjectToolFactory(factory) {
|
|
887
|
+
for (const type of factory.supportedTypes) {
|
|
888
|
+
const existing = this.projectFactoryMap.get(type);
|
|
889
|
+
if (existing) {
|
|
890
|
+
if (existing.constructor?.name !== factory.constructor?.name) {
|
|
891
|
+
console.warn(`Tool factory conflict for project type '${type}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
|
|
892
|
+
}
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
this.projectFactoryMap.set(type, factory);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
registerSolutionToolFactory(factory) {
|
|
899
|
+
this.solutionFactory = factory;
|
|
900
|
+
}
|
|
901
|
+
getSolutionToolFactory() {
|
|
902
|
+
if (!this.solutionFactory) {
|
|
903
|
+
throw new Error("No solution tool factory is registered");
|
|
904
|
+
}
|
|
905
|
+
return this.solutionFactory;
|
|
906
|
+
}
|
|
907
|
+
canHandleProject(projectType) {
|
|
908
|
+
return this.projectFactoryMap.has(projectType);
|
|
909
|
+
}
|
|
910
|
+
getProjectToolFactory(projectType) {
|
|
911
|
+
const factory = this.projectFactoryMap.get(projectType);
|
|
912
|
+
if (!factory) {
|
|
913
|
+
throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
|
|
914
|
+
}
|
|
915
|
+
return factory;
|
|
916
|
+
}
|
|
917
|
+
reset() {
|
|
918
|
+
this.projectFactoryMap.clear();
|
|
919
|
+
this.solutionFactory = null;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
var REGISTRY_KEY = Symbol.for("@uipath/solutionpackager-tool-core/toolsFactoryRepository");
|
|
923
|
+
var _global = globalThis;
|
|
924
|
+
if (!_global[REGISTRY_KEY]) {
|
|
925
|
+
_global[REGISTRY_KEY] = new ToolsFactoryRepository;
|
|
926
|
+
}
|
|
927
|
+
var toolsFactoryRepository = _global[REGISTRY_KEY];
|
|
928
|
+
// src/utils/bundle-path.ts
|
|
929
|
+
function normalizeBundlePath(path) {
|
|
930
|
+
return path.replace(/\\/g, "/");
|
|
931
|
+
}
|
|
932
|
+
function isBundleRelativePath(path) {
|
|
933
|
+
const normalized = normalizeBundlePath(path);
|
|
934
|
+
const segments = normalized.split("/");
|
|
935
|
+
return !normalized.startsWith("/") && !/^[a-zA-Z]:/.test(normalized) && !segments.includes("..") && segments.some((segment) => segment !== "" && segment !== ".");
|
|
936
|
+
}
|
|
937
|
+
async function isCanonicalBundleChild(fileSystem, projectPath, bundlePath) {
|
|
938
|
+
const project = normalizeBundlePath(await fileSystem.realpath(projectPath)).replace(/\/+$/, "") || "/";
|
|
939
|
+
let bundle = project;
|
|
940
|
+
for (const segment of normalizeBundlePath(bundlePath).split("/")) {
|
|
941
|
+
if (!segment || segment === ".")
|
|
942
|
+
continue;
|
|
943
|
+
bundle = normalizeBundlePath(await fileSystem.realpath(Path.join(bundle, segment))).replace(/\/+$/, "") || "/";
|
|
944
|
+
}
|
|
945
|
+
return bundle !== project && bundle.startsWith(project === "/" ? "/" : `${project}/`);
|
|
946
|
+
}
|
|
947
|
+
function isHtmlEntryPointPath(path) {
|
|
948
|
+
return typeof path === "string" && isBundleRelativePath(path) && /\.html?$/i.test(path);
|
|
949
|
+
}
|
|
950
|
+
async function resolveHtmlEntryPoint(fileSystem, folder, declaredPath) {
|
|
951
|
+
if (!isHtmlEntryPointPath(declaredPath))
|
|
952
|
+
return null;
|
|
953
|
+
const segments = normalizeBundlePath(declaredPath).split("/").filter((part) => part !== "" && part !== ".");
|
|
954
|
+
if (!(await fileSystem.stat(Path.join(folder, ...segments)))?.isFile())
|
|
955
|
+
return null;
|
|
956
|
+
const actual = [];
|
|
957
|
+
for (const segment of segments) {
|
|
958
|
+
const entries = await fileSystem.readdir(Path.join(folder, ...actual));
|
|
959
|
+
if (entries.includes(segment)) {
|
|
960
|
+
actual.push(segment);
|
|
961
|
+
continue;
|
|
962
|
+
}
|
|
963
|
+
const matches = entries.filter((entry) => entry.toLowerCase() === segment.toLowerCase());
|
|
964
|
+
if (matches.length !== 1)
|
|
965
|
+
return null;
|
|
966
|
+
actual.push(matches[0]);
|
|
967
|
+
}
|
|
968
|
+
return actual.join("/");
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
// src/constants.ts
|
|
972
|
+
var PROJECT_JSON_FILE = "project.json";
|
|
973
|
+
var DEFAULT_BUNDLE_PATH = "source/dist";
|
|
974
|
+
var APP_FOLDER_NAME = ".app";
|
|
975
|
+
var CONTENT_APP_FOLDER_NAME = "app";
|
|
976
|
+
var TARGET_RUNTIME = "Coded";
|
|
977
|
+
var TARGET_JS_RUNTIME = "JS";
|
|
978
|
+
var DEFAULT_ENTRY_POINT_TYPE = "api";
|
|
979
|
+
var HTML_ENTRY_POINT_CANDIDATES = [
|
|
980
|
+
"index.html",
|
|
981
|
+
"main.html",
|
|
982
|
+
"app.html"
|
|
983
|
+
];
|
|
984
|
+
var ERROR_MESSAGES = {
|
|
985
|
+
MANIFEST_NOT_FOUND: (file) => `WebApp manifest not found: ${file}. This file is required for WebApp projects.`,
|
|
986
|
+
PROJECT_JSON_FOUND: "project.json found in WebApp project. The WebApp tool only supports Coded web apps without project.json.",
|
|
987
|
+
MANIFEST_LOAD_FAILED: (file) => `Failed to load or parse ${file}`,
|
|
988
|
+
BUNDLE_NOT_FOUND: (path) => `Compiled bundle not found at ${path}. Ensure the project is built before packing.`,
|
|
989
|
+
BUNDLE_NOT_DIRECTORY: (path) => `Bundle path ${path} exists but is not a directory.`,
|
|
990
|
+
BUNDLE_OUTSIDE_PROJECT: (path) => `Bundle path ${path} resolves to the project root or outside the project. Use a child build output folder inside the project.`,
|
|
991
|
+
BUNDLE_NO_ENTRY_POINT: (path) => `Bundle at ${path} has no HTML entry point (${HTML_ENTRY_POINT_CANDIDATES.join(", ")}). Build the app before packing, or point config.bundlePath in webAppManifest.json at its build output.`,
|
|
992
|
+
MAIN_FILE_INVALID_TYPE: "Invalid webAppManifest.json: config.mainFile must be a string naming an HTML file, or be omitted.",
|
|
993
|
+
MAIN_FILE_NOT_IN_BUNDLE: (path, mainFile) => `${WEBAPP_MANIFEST_FILE_NAME} asks for "${mainFile}" as the app's main file, but the bundle at ${path} does not hold it. Name an HTML file inside the bundle in config.mainFile, or remove it to use the first of ${HTML_ENTRY_POINT_CANDIDATES.join(", ")} the bundle holds.`,
|
|
994
|
+
MAIN_FILE_LOST: (path, mainFile) => `Bundle at ${path} held "${mainFile}" when the pack started, but the copy taken for the package has not. Something changed the folder mid-pack — usually a build or watch process. Stop it and pack again.`,
|
|
995
|
+
BUNDLE_ENTRY_POINT_LOST: (path) => `Bundle at ${path} had an HTML entry point (${HTML_ENTRY_POINT_CANDIDATES.join(", ")}) when the pack started, but the copy taken for the package has none. Something changed the folder mid-pack — usually a build or watch process. Stop it and pack again.`,
|
|
996
|
+
APP_FOLDER_NOT_FOUND: (path) => `.app folder not found at ${path}. Ensure the project contains a .app folder.`,
|
|
997
|
+
APP_FOLDER_NOT_DIRECTORY: (path) => `.app path ${path} exists but is not a directory.`,
|
|
998
|
+
BUILD_NOT_SUPPORTED: "Build execution (isCompiled=false) is not yet supported. Please build the project manually and set isCompiled=true.",
|
|
999
|
+
VALIDATION_FAILED: (context) => `Validation failed: ${context}`,
|
|
1000
|
+
PACKING_FAILED: (context) => `An error occurred while packing WebApp project: ${context}`,
|
|
1001
|
+
PACKAGE_NAME_REQUIRED: "Package name is required",
|
|
1002
|
+
PACKAGE_VERSION_REQUIRED: "Package version is required",
|
|
1003
|
+
PROJECT_PATH_REQUIRED: "Project path is required",
|
|
1004
|
+
OUTPUT_PATH_REQUIRED: "Output path is required"
|
|
1005
|
+
};
|
|
1006
|
+
export {
|
|
1007
|
+
APP_FOLDER_NAME,
|
|
1008
|
+
CONTENT_APP_FOLDER_NAME,
|
|
1009
|
+
DEFAULT_BUNDLE_PATH,
|
|
1010
|
+
DEFAULT_ENTRY_POINT_TYPE,
|
|
1011
|
+
ERROR_MESSAGES,
|
|
1012
|
+
HTML_ENTRY_POINT_CANDIDATES,
|
|
1013
|
+
PROJECT_JSON_FILE,
|
|
1014
|
+
TARGET_JS_RUNTIME,
|
|
1015
|
+
TARGET_RUNTIME,
|
|
1016
|
+
isBundleRelativePath,
|
|
1017
|
+
isCanonicalBundleChild,
|
|
1018
|
+
isHtmlEntryPointPath,
|
|
1019
|
+
normalizeBundlePath,
|
|
1020
|
+
resolveHtmlEntryPoint
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
//# debugId=15722B8E9A8BBE6F64756E2164756E21
|