@salesforce/source-deploy-retrieve 12.32.0 → 12.32.2
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/lib/src/client/deployMessages.d.ts +4 -4
- package/lib/src/client/deployMessages.js +8 -8
- package/lib/src/client/deployMessages.js.map +1 -1
- package/lib/src/client/metadataApiDeploy.js +6 -6
- package/lib/src/client/metadataApiDeploy.js.map +1 -1
- package/lib/src/registry/metadataRegistry.json +8 -8
- package/lib/src/registry/types.d.ts +1 -1
- package/lib/src/resolve/adapters/index.d.ts +1 -1
- package/lib/src/resolve/adapters/index.js +3 -3
- package/lib/src/resolve/adapters/index.js.map +1 -1
- package/lib/src/resolve/adapters/sourceAdapterFactory.js +3 -3
- package/lib/src/resolve/adapters/sourceAdapterFactory.js.map +1 -1
- package/lib/src/resolve/adapters/uiBundleValidation.d.ts +38 -0
- package/lib/src/resolve/adapters/{webApplicationValidation.js → uiBundleValidation.js} +75 -75
- package/lib/src/resolve/adapters/uiBundleValidation.js.map +1 -0
- package/lib/src/resolve/adapters/{webApplicationsSourceAdapter.d.ts → uiBundlesSourceAdapter.d.ts} +3 -3
- package/lib/src/resolve/adapters/{webApplicationsSourceAdapter.js → uiBundlesSourceAdapter.js} +10 -10
- package/lib/src/resolve/adapters/uiBundlesSourceAdapter.js.map +1 -0
- package/lib/src/resolve/metadataResolver.js +1 -1
- package/lib/src/resolve/metadataResolver.js.map +1 -1
- package/lib/src/utils/filePathGenerator.js +4 -7
- package/lib/src/utils/filePathGenerator.js.map +1 -1
- package/lib/src/utils/path.js +1 -1
- package/lib/src/utils/path.js.map +1 -1
- package/messages/uiBundleValidation.md +103 -0
- package/package.json +2 -2
- package/lib/src/resolve/adapters/webApplicationValidation.d.ts +0 -38
- package/lib/src/resolve/adapters/webApplicationValidation.js.map +0 -1
- package/lib/src/resolve/adapters/webApplicationsSourceAdapter.js.map +0 -1
- package/messages/webApplicationValidation.md +0 -103
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.isUiBundleConfig = isUiBundleConfig;
|
|
4
|
+
exports.validateUiBundleJson = validateUiBundleJson;
|
|
5
5
|
/*
|
|
6
6
|
* Copyright 2026, Salesforce, Inc.
|
|
7
7
|
*
|
|
@@ -21,9 +21,9 @@ const node_path_1 = require("node:path");
|
|
|
21
21
|
const messages_1 = require("@salesforce/core/messages");
|
|
22
22
|
const sfError_1 = require("@salesforce/core/sfError");
|
|
23
23
|
;
|
|
24
|
-
const msgs = new messages_1.Messages('@salesforce/source-deploy-retrieve', '
|
|
24
|
+
const msgs = new messages_1.Messages('@salesforce/source-deploy-retrieve', 'uiBundleValidation', new Map([["ui_bundle_empty_file", "ui-bundle.json must not be empty (%s)."], ["ui_bundle_empty_file.actions", "Add at least one property, e.g. { \"outputDir\": \"dist\" }"], ["ui_bundle_size_exceeded", "ui-bundle.json exceeds the maximum allowed size of %s KB (actual: %s KB)."], ["ui_bundle_size_exceeded.actions", "Reduce the file size. The descriptor should only contain configuration, not static content."], ["ui_bundle_whitespace_only", "ui-bundle.json must not be empty or contain only whitespace (%s)."], ["ui_bundle_whitespace_only.actions", "Replace the whitespace with valid JSON, e.g. { \"outputDir\": \"dist\" }"], ["ui_bundle_invalid_json", "ui-bundle.json is not valid JSON: %s"], ["ui_bundle_invalid_json.actions", "Fix the JSON syntax in ui-bundle.json. Use a JSON validator to find the exact issue."], ["ui_bundle_not_object", "ui-bundle.json must be a JSON object, but found %s."], ["ui_bundle_not_object.actions", "Wrap the content in curly braces, e.g. { \"outputDir\": \"dist\" }"], ["ui_bundle_empty_object", "ui-bundle.json must contain at least one property."], ["ui_bundle_empty_object.actions", "Add a property: outputDir, routing, or headers."], ["ui_bundle_unknown_props", "ui-bundle.json contains unknown %s: %s. Allowed: %s."], ["ui_bundle_type_mismatch", "ui-bundle.json '%s' must be %s (received %s)."], ["ui_bundle_empty_value", "ui-bundle.json '%s' must not be empty."], ["ui_bundle_invalid_enum", "ui-bundle.json '%s' must be one of: %s (received \"%s\")."], ["ui_bundle_min_items", "ui-bundle.json '%s' must contain at least one %s."], ["ui_bundle_unknown_prop", "ui-bundle.json '%s' contains unknown property '%s'. Allowed: %s."], ["ui_bundle_non_empty_string", "ui-bundle.json '%s' must be a non-empty string."], ["ui_bundle_path_unsafe", "ui-bundle.json '%s' value \"%s\" contains %s. Config paths must use forward slashes."], ["ui_bundle_path_traversal", "ui-bundle.json '%s' value \"%s\" resolves outside the application bundle. Path traversal is not allowed."], ["ui_bundle_outputdir_is_root", "ui-bundle.json 'outputDir' value \"%s\" resolves to the bundle root. It must reference a subdirectory."], ["ui_bundle_outputdir_is_root.actions", "Set outputDir to a subdirectory like \"dist\" or \"build\"."], ["ui_bundle_dir_not_found", "ui-bundle.json 'outputDir' references \"%s\", but the directory does not exist at %s."], ["ui_bundle_dir_empty", "ui-bundle.json 'outputDir' (\"%s\") exists but contains no files. It must contain at least one deployable file."], ["ui_bundle_file_not_found", "ui-bundle.json '%s' references \"%s\", but the file does not exist at %s."]]));
|
|
25
25
|
/** Basic shape check — use after field-level validation to narrow the type. */
|
|
26
|
-
function
|
|
26
|
+
function isUiBundleConfig(value) {
|
|
27
27
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
28
28
|
}
|
|
29
29
|
// Keep in sync with server-side validation (WebApplicationFileProcessor.java).
|
|
@@ -32,7 +32,7 @@ const ROUTING_ALLOWED = new Set(['rewrites', 'redirects', 'fallback', 'trailingS
|
|
|
32
32
|
const TRAILING_SLASH_VALUES = new Set(['always', 'never', 'auto']);
|
|
33
33
|
const REDIRECT_STATUS_CODES = new Set([301, 302, 307, 308]);
|
|
34
34
|
const MAX_RECURSION_DEPTH = 20;
|
|
35
|
-
const
|
|
35
|
+
const MAX_UI_BUNDLE_JSON_BYTES = 102_400; // 100 KB
|
|
36
36
|
// Matches ".." as a standalone path segment.
|
|
37
37
|
const DOT_DOT_SEGMENT = /(?:^|[/\\])\.\.[/\\]|(?:^|[/\\])\.\.$/;
|
|
38
38
|
/** Strip leading forward slashes so "/index.html" resolves relative to outputDir. Only strips '/', not backslashes. */
|
|
@@ -76,7 +76,7 @@ function containsPathTraversal(value) {
|
|
|
76
76
|
function assertSafePath(value, configKey) {
|
|
77
77
|
const reason = containsPathTraversal(value);
|
|
78
78
|
if (reason) {
|
|
79
|
-
throw createConfigError(msgs.getMessage('
|
|
79
|
+
throw createConfigError(msgs.getMessage('ui_bundle_path_unsafe', [configKey, value, reason]), [
|
|
80
80
|
`Fix "${value}": use relative paths with forward slashes only, no special characters.`,
|
|
81
81
|
]);
|
|
82
82
|
}
|
|
@@ -92,28 +92,28 @@ function describeType(value) {
|
|
|
92
92
|
return typeof value;
|
|
93
93
|
}
|
|
94
94
|
function createConfigError(message, actions) {
|
|
95
|
-
return new sfError_1.SfError(message, '
|
|
95
|
+
return new sfError_1.SfError(message, 'InvalidUiBundleConfigError', actions);
|
|
96
96
|
}
|
|
97
97
|
function createFileError(message, actions) {
|
|
98
98
|
return new sfError_1.SfError(message, 'ExpectedSourceFilesError', actions);
|
|
99
99
|
}
|
|
100
|
-
/** Validate
|
|
101
|
-
function
|
|
100
|
+
/** Validate ui-bundle.json contents. Checks structure first, then schema, then file existence. */
|
|
101
|
+
function validateUiBundleJson(raw, descriptorPath, contentPath, tree) {
|
|
102
102
|
if (!raw || raw.length === 0) {
|
|
103
|
-
throw createConfigError(msgs.getMessage('
|
|
104
|
-
msgs.getMessage('
|
|
103
|
+
throw createConfigError(msgs.getMessage('ui_bundle_empty_file', [descriptorPath]), [
|
|
104
|
+
msgs.getMessage('ui_bundle_empty_file.actions'),
|
|
105
105
|
]);
|
|
106
106
|
}
|
|
107
|
-
if (raw.length >
|
|
108
|
-
throw createConfigError(msgs.getMessage('
|
|
109
|
-
String(
|
|
107
|
+
if (raw.length > MAX_UI_BUNDLE_JSON_BYTES) {
|
|
108
|
+
throw createConfigError(msgs.getMessage('ui_bundle_size_exceeded', [
|
|
109
|
+
String(MAX_UI_BUNDLE_JSON_BYTES / 1024),
|
|
110
110
|
(raw.length / 1024).toFixed(1),
|
|
111
|
-
]), [msgs.getMessage('
|
|
111
|
+
]), [msgs.getMessage('ui_bundle_size_exceeded.actions')]);
|
|
112
112
|
}
|
|
113
113
|
const trimmed = raw.toString('utf8').trim();
|
|
114
114
|
if (trimmed.length === 0) {
|
|
115
|
-
throw createConfigError(msgs.getMessage('
|
|
116
|
-
msgs.getMessage('
|
|
115
|
+
throw createConfigError(msgs.getMessage('ui_bundle_whitespace_only', [descriptorPath]), [
|
|
116
|
+
msgs.getMessage('ui_bundle_whitespace_only.actions'),
|
|
117
117
|
]);
|
|
118
118
|
}
|
|
119
119
|
let config;
|
|
@@ -122,27 +122,29 @@ function validateWebApplicationJson(raw, descriptorPath, contentPath, tree) {
|
|
|
122
122
|
}
|
|
123
123
|
catch (e) {
|
|
124
124
|
const detail = e instanceof Error ? e.message : String(e);
|
|
125
|
-
throw createConfigError(msgs.getMessage('
|
|
126
|
-
msgs.getMessage('
|
|
125
|
+
throw createConfigError(msgs.getMessage('ui_bundle_invalid_json', [detail]), [
|
|
126
|
+
msgs.getMessage('ui_bundle_invalid_json.actions'),
|
|
127
127
|
]);
|
|
128
128
|
}
|
|
129
|
-
if (!
|
|
130
|
-
throw createConfigError(msgs.getMessage('
|
|
131
|
-
msgs.getMessage('
|
|
129
|
+
if (!isUiBundleConfig(config)) {
|
|
130
|
+
throw createConfigError(msgs.getMessage('ui_bundle_not_object', [describeType(config)]), [
|
|
131
|
+
msgs.getMessage('ui_bundle_not_object.actions'),
|
|
132
132
|
]);
|
|
133
133
|
}
|
|
134
134
|
const rawObj = config;
|
|
135
135
|
const keys = Object.keys(rawObj);
|
|
136
136
|
if (keys.length === 0) {
|
|
137
|
-
throw createConfigError(msgs.getMessage('
|
|
137
|
+
throw createConfigError(msgs.getMessage('ui_bundle_empty_object'), [
|
|
138
|
+
msgs.getMessage('ui_bundle_empty_object.actions'),
|
|
139
|
+
]);
|
|
138
140
|
}
|
|
139
141
|
// Report all unknown properties at once.
|
|
140
142
|
const disallowed = keys.filter((k) => !ALLOWED_TOP_LEVEL.has(k));
|
|
141
143
|
if (disallowed.length > 0) {
|
|
142
144
|
const list = disallowed.map((k) => `'${k}'`).join(', ');
|
|
143
145
|
const word = disallowed.length === 1 ? 'property' : 'properties';
|
|
144
|
-
throw createConfigError(msgs.getMessage('
|
|
145
|
-
`Remove ${list} from
|
|
146
|
+
throw createConfigError(msgs.getMessage('ui_bundle_unknown_props', [word, list, 'outputDir, routing, headers']), [
|
|
147
|
+
`Remove ${list} from ui-bundle.json.`,
|
|
146
148
|
]);
|
|
147
149
|
}
|
|
148
150
|
const outputDir = rawObj.outputDir !== undefined ? validateOutputDir(rawObj.outputDir) : undefined;
|
|
@@ -160,13 +162,11 @@ function validateWebApplicationJson(raw, descriptorPath, contentPath, tree) {
|
|
|
160
162
|
}
|
|
161
163
|
function validateOutputDir(value) {
|
|
162
164
|
if (typeof value !== 'string') {
|
|
163
|
-
throw createConfigError(msgs.getMessage('
|
|
164
|
-
'Set outputDir to a directory path like "dist" or "build".',
|
|
165
|
-
]);
|
|
165
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', ['outputDir', 'a string', describeType(value)]), ['Set outputDir to a directory path like "dist" or "build".']);
|
|
166
166
|
}
|
|
167
167
|
const stripped = stripLeadingSep(value);
|
|
168
168
|
if (stripped.length === 0) {
|
|
169
|
-
throw createConfigError(msgs.getMessage('
|
|
169
|
+
throw createConfigError(msgs.getMessage('ui_bundle_empty_value', ['outputDir']), [
|
|
170
170
|
'Provide a directory name, e.g. "dist".',
|
|
171
171
|
]);
|
|
172
172
|
}
|
|
@@ -175,14 +175,14 @@ function validateOutputDir(value) {
|
|
|
175
175
|
}
|
|
176
176
|
function validateRouting(value) {
|
|
177
177
|
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
178
|
-
throw createConfigError(msgs.getMessage('
|
|
178
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', ['routing', 'an object', describeType(value)]), [
|
|
179
179
|
'Set routing to an object, e.g. { "trailingSlash": "auto" }.',
|
|
180
180
|
]);
|
|
181
181
|
}
|
|
182
182
|
const routing = value;
|
|
183
183
|
const routingKeys = Object.keys(routing);
|
|
184
184
|
if (routingKeys.length === 0) {
|
|
185
|
-
throw createConfigError(msgs.getMessage('
|
|
185
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', ['routing', 'property']), [
|
|
186
186
|
'Add a routing property: rewrites, redirects, fallback, trailingSlash, or fileBasedRouting.',
|
|
187
187
|
]);
|
|
188
188
|
}
|
|
@@ -190,7 +190,7 @@ function validateRouting(value) {
|
|
|
190
190
|
if (unknownRouting.length > 0) {
|
|
191
191
|
const list = unknownRouting.map((k) => `'${k}'`).join(', ');
|
|
192
192
|
const word = unknownRouting.length === 1 ? 'property' : 'properties';
|
|
193
|
-
throw createConfigError(msgs.getMessage('
|
|
193
|
+
throw createConfigError(msgs.getMessage('ui_bundle_unknown_props', [
|
|
194
194
|
word,
|
|
195
195
|
list,
|
|
196
196
|
'rewrites, redirects, fallback, trailingSlash, fileBasedRouting',
|
|
@@ -200,7 +200,7 @@ function validateRouting(value) {
|
|
|
200
200
|
validateTrailingSlash(routing.trailingSlash);
|
|
201
201
|
}
|
|
202
202
|
if (routing.fileBasedRouting !== undefined && typeof routing.fileBasedRouting !== 'boolean') {
|
|
203
|
-
throw createConfigError(msgs.getMessage('
|
|
203
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', [
|
|
204
204
|
'routing.fileBasedRouting',
|
|
205
205
|
'a boolean',
|
|
206
206
|
describeType(routing.fileBasedRouting),
|
|
@@ -218,19 +218,19 @@ function validateRouting(value) {
|
|
|
218
218
|
}
|
|
219
219
|
function validateTrailingSlash(value) {
|
|
220
220
|
if (typeof value !== 'string') {
|
|
221
|
-
throw createConfigError(msgs.getMessage('
|
|
221
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', ['routing.trailingSlash', 'a string', describeType(value)]));
|
|
222
222
|
}
|
|
223
223
|
if (!TRAILING_SLASH_VALUES.has(value)) {
|
|
224
|
-
throw createConfigError(msgs.getMessage('
|
|
224
|
+
throw createConfigError(msgs.getMessage('ui_bundle_invalid_enum', ['routing.trailingSlash', 'always, never, auto', value]));
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
function validateFallback(value) {
|
|
228
228
|
if (typeof value !== 'string') {
|
|
229
|
-
throw createConfigError(msgs.getMessage('
|
|
229
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', ['routing.fallback', 'a string', describeType(value)]));
|
|
230
230
|
}
|
|
231
231
|
const stripped = stripLeadingSep(value);
|
|
232
232
|
if (stripped.length === 0) {
|
|
233
|
-
throw createConfigError(msgs.getMessage('
|
|
233
|
+
throw createConfigError(msgs.getMessage('ui_bundle_empty_value', ['routing.fallback']), [
|
|
234
234
|
'Provide a file path like "index.html".',
|
|
235
235
|
]);
|
|
236
236
|
}
|
|
@@ -238,10 +238,10 @@ function validateFallback(value) {
|
|
|
238
238
|
}
|
|
239
239
|
function validateRewritesList(value) {
|
|
240
240
|
if (!Array.isArray(value)) {
|
|
241
|
-
throw createConfigError(msgs.getMessage('
|
|
241
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', ['routing.rewrites', 'an array', describeType(value)]));
|
|
242
242
|
}
|
|
243
243
|
if (value.length === 0) {
|
|
244
|
-
throw createConfigError(msgs.getMessage('
|
|
244
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', ['routing.rewrites', 'item']), [
|
|
245
245
|
'Add a rewrite entry or remove the empty rewrites array.',
|
|
246
246
|
]);
|
|
247
247
|
}
|
|
@@ -251,10 +251,10 @@ function validateRewritesList(value) {
|
|
|
251
251
|
}
|
|
252
252
|
function validateRedirectsList(value) {
|
|
253
253
|
if (!Array.isArray(value)) {
|
|
254
|
-
throw createConfigError(msgs.getMessage('
|
|
254
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', ['routing.redirects', 'an array', describeType(value)]));
|
|
255
255
|
}
|
|
256
256
|
if (value.length === 0) {
|
|
257
|
-
throw createConfigError(msgs.getMessage('
|
|
257
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', ['routing.redirects', 'item']), [
|
|
258
258
|
'Add a redirect entry or remove the empty redirects array.',
|
|
259
259
|
]);
|
|
260
260
|
}
|
|
@@ -264,10 +264,10 @@ function validateRedirectsList(value) {
|
|
|
264
264
|
}
|
|
265
265
|
function validateHeaders(value) {
|
|
266
266
|
if (!Array.isArray(value)) {
|
|
267
|
-
throw createConfigError(msgs.getMessage('
|
|
267
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', ['headers', 'an array', describeType(value)]));
|
|
268
268
|
}
|
|
269
269
|
if (value.length === 0) {
|
|
270
|
-
throw createConfigError(msgs.getMessage('
|
|
270
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', ['headers', 'item']), [
|
|
271
271
|
'Add a header entry or remove the empty headers array.',
|
|
272
272
|
]);
|
|
273
273
|
}
|
|
@@ -278,28 +278,28 @@ function validateHeaders(value) {
|
|
|
278
278
|
function validateRewriteItem(item, i) {
|
|
279
279
|
const key = `routing.rewrites[${i}]`;
|
|
280
280
|
if (typeof item !== 'object' || item === null || Array.isArray(item)) {
|
|
281
|
-
throw createConfigError(msgs.getMessage('
|
|
281
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', [key, 'an object', describeType(item)]));
|
|
282
282
|
}
|
|
283
283
|
const obj = item;
|
|
284
284
|
if (Object.keys(obj).length === 0) {
|
|
285
|
-
throw createConfigError(msgs.getMessage('
|
|
285
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', [key, 'property']), [
|
|
286
286
|
'Add route and/or rewrite to this entry.',
|
|
287
287
|
]);
|
|
288
288
|
}
|
|
289
289
|
const unknown = Object.keys(obj).filter((k) => k !== 'route' && k !== 'rewrite');
|
|
290
290
|
if (unknown.length > 0) {
|
|
291
|
-
throw createConfigError(msgs.getMessage('
|
|
291
|
+
throw createConfigError(msgs.getMessage('ui_bundle_unknown_prop', [key, unknown[0], 'route, rewrite']));
|
|
292
292
|
}
|
|
293
293
|
if (obj.route !== undefined && (typeof obj.route !== 'string' || obj.route.length === 0)) {
|
|
294
|
-
throw createConfigError(msgs.getMessage('
|
|
294
|
+
throw createConfigError(msgs.getMessage('ui_bundle_non_empty_string', [`${key}.route`]));
|
|
295
295
|
}
|
|
296
296
|
if (obj.rewrite !== undefined) {
|
|
297
297
|
if (typeof obj.rewrite !== 'string' || obj.rewrite.length === 0) {
|
|
298
|
-
throw createConfigError(msgs.getMessage('
|
|
298
|
+
throw createConfigError(msgs.getMessage('ui_bundle_non_empty_string', [`${key}.rewrite`]));
|
|
299
299
|
}
|
|
300
300
|
const strippedRewrite = stripLeadingSep(obj.rewrite);
|
|
301
301
|
if (strippedRewrite.length === 0) {
|
|
302
|
-
throw createConfigError(msgs.getMessage('
|
|
302
|
+
throw createConfigError(msgs.getMessage('ui_bundle_empty_value', [`${key}.rewrite`]), [
|
|
303
303
|
'Provide a file path like "index.html".',
|
|
304
304
|
]);
|
|
305
305
|
}
|
|
@@ -309,27 +309,27 @@ function validateRewriteItem(item, i) {
|
|
|
309
309
|
function validateRedirectItem(item, i) {
|
|
310
310
|
const key = `routing.redirects[${i}]`;
|
|
311
311
|
if (typeof item !== 'object' || item === null || Array.isArray(item)) {
|
|
312
|
-
throw createConfigError(msgs.getMessage('
|
|
312
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', [key, 'an object', describeType(item)]));
|
|
313
313
|
}
|
|
314
314
|
const obj = item;
|
|
315
315
|
if (Object.keys(obj).length === 0) {
|
|
316
|
-
throw createConfigError(msgs.getMessage('
|
|
316
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', [key, 'property']), [
|
|
317
317
|
'Add route, redirect, and/or statusCode to this entry.',
|
|
318
318
|
]);
|
|
319
319
|
}
|
|
320
320
|
const unknown = Object.keys(obj).filter((k) => k !== 'route' && k !== 'redirect' && k !== 'statusCode');
|
|
321
321
|
if (unknown.length > 0) {
|
|
322
|
-
throw createConfigError(msgs.getMessage('
|
|
322
|
+
throw createConfigError(msgs.getMessage('ui_bundle_unknown_prop', [key, unknown[0], 'route, redirect, statusCode']));
|
|
323
323
|
}
|
|
324
324
|
if (obj.route !== undefined && (typeof obj.route !== 'string' || obj.route.length === 0)) {
|
|
325
|
-
throw createConfigError(msgs.getMessage('
|
|
325
|
+
throw createConfigError(msgs.getMessage('ui_bundle_non_empty_string', [`${key}.route`]));
|
|
326
326
|
}
|
|
327
327
|
if (obj.redirect !== undefined && (typeof obj.redirect !== 'string' || obj.redirect.length === 0)) {
|
|
328
|
-
throw createConfigError(msgs.getMessage('
|
|
328
|
+
throw createConfigError(msgs.getMessage('ui_bundle_non_empty_string', [`${key}.redirect`]));
|
|
329
329
|
}
|
|
330
330
|
if (obj.statusCode !== undefined) {
|
|
331
331
|
if (!Number.isInteger(obj.statusCode) || !REDIRECT_STATUS_CODES.has(obj.statusCode)) {
|
|
332
|
-
throw createConfigError(msgs.getMessage('
|
|
332
|
+
throw createConfigError(msgs.getMessage('ui_bundle_invalid_enum', [
|
|
333
333
|
`${key}.statusCode`,
|
|
334
334
|
'301, 302, 307, 308',
|
|
335
335
|
JSON.stringify(obj.statusCode),
|
|
@@ -340,27 +340,27 @@ function validateRedirectItem(item, i) {
|
|
|
340
340
|
function validateHeaderItem(item, i) {
|
|
341
341
|
const key = `headers[${i}]`;
|
|
342
342
|
if (typeof item !== 'object' || item === null || Array.isArray(item)) {
|
|
343
|
-
throw createConfigError(msgs.getMessage('
|
|
343
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', [key, 'an object', describeType(item)]));
|
|
344
344
|
}
|
|
345
345
|
const obj = item;
|
|
346
346
|
if (Object.keys(obj).length === 0) {
|
|
347
|
-
throw createConfigError(msgs.getMessage('
|
|
347
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', [key, 'property']), [
|
|
348
348
|
'Add source and/or headers to this entry.',
|
|
349
349
|
]);
|
|
350
350
|
}
|
|
351
351
|
const unknown = Object.keys(obj).filter((k) => k !== 'source' && k !== 'headers');
|
|
352
352
|
if (unknown.length > 0) {
|
|
353
|
-
throw createConfigError(msgs.getMessage('
|
|
353
|
+
throw createConfigError(msgs.getMessage('ui_bundle_unknown_prop', [key, unknown[0], 'source, headers']));
|
|
354
354
|
}
|
|
355
355
|
if (obj.source !== undefined && (typeof obj.source !== 'string' || obj.source.length === 0)) {
|
|
356
|
-
throw createConfigError(msgs.getMessage('
|
|
356
|
+
throw createConfigError(msgs.getMessage('ui_bundle_non_empty_string', [`${key}.source`]));
|
|
357
357
|
}
|
|
358
358
|
if (obj.headers !== undefined) {
|
|
359
359
|
if (!Array.isArray(obj.headers)) {
|
|
360
|
-
throw createConfigError(msgs.getMessage('
|
|
360
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', [`${key}.headers`, 'an array', describeType(obj.headers)]));
|
|
361
361
|
}
|
|
362
362
|
if (obj.headers.length === 0) {
|
|
363
|
-
throw createConfigError(msgs.getMessage('
|
|
363
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', [`${key}.headers`, 'item']), [
|
|
364
364
|
'Add a { "key": "...", "value": "..." } entry or remove the empty array.',
|
|
365
365
|
]);
|
|
366
366
|
}
|
|
@@ -372,23 +372,23 @@ function validateHeaderItem(item, i) {
|
|
|
372
372
|
function validateHeaderKeyValue(item, i, j) {
|
|
373
373
|
const key = `headers[${i}].headers[${j}]`;
|
|
374
374
|
if (typeof item !== 'object' || item === null || Array.isArray(item)) {
|
|
375
|
-
throw createConfigError(msgs.getMessage('
|
|
375
|
+
throw createConfigError(msgs.getMessage('ui_bundle_type_mismatch', [key, 'an object', describeType(item)]));
|
|
376
376
|
}
|
|
377
377
|
const obj = item;
|
|
378
378
|
if (Object.keys(obj).length === 0) {
|
|
379
|
-
throw createConfigError(msgs.getMessage('
|
|
379
|
+
throw createConfigError(msgs.getMessage('ui_bundle_min_items', [key, 'property']), [
|
|
380
380
|
'Add key and/or value to this header entry.',
|
|
381
381
|
]);
|
|
382
382
|
}
|
|
383
383
|
const unknown = Object.keys(obj).filter((k) => k !== 'key' && k !== 'value');
|
|
384
384
|
if (unknown.length > 0) {
|
|
385
|
-
throw createConfigError(msgs.getMessage('
|
|
385
|
+
throw createConfigError(msgs.getMessage('ui_bundle_unknown_prop', [key, unknown[0], 'key, value']));
|
|
386
386
|
}
|
|
387
387
|
if (obj.key !== undefined && (typeof obj.key !== 'string' || obj.key.length === 0)) {
|
|
388
|
-
throw createConfigError(msgs.getMessage('
|
|
388
|
+
throw createConfigError(msgs.getMessage('ui_bundle_non_empty_string', [`${key}.key`]));
|
|
389
389
|
}
|
|
390
390
|
if (obj.value !== undefined && (typeof obj.value !== 'string' || obj.value.length === 0)) {
|
|
391
|
-
throw createConfigError(msgs.getMessage('
|
|
391
|
+
throw createConfigError(msgs.getMessage('ui_bundle_non_empty_string', [`${key}.value`]));
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
/** Throws if the resolved path lands outside the parent directory. */
|
|
@@ -396,7 +396,7 @@ function assertNoTraversal(resolvedPath, parentDir, configKey, rawValue) {
|
|
|
396
396
|
const normalizedResolved = (0, node_path_1.resolve)(resolvedPath);
|
|
397
397
|
const normalizedParent = (0, node_path_1.resolve)(parentDir) + node_path_1.sep;
|
|
398
398
|
if (!normalizedResolved.startsWith(normalizedParent) && normalizedResolved !== (0, node_path_1.resolve)(parentDir)) {
|
|
399
|
-
throw createConfigError(msgs.getMessage('
|
|
399
|
+
throw createConfigError(msgs.getMessage('ui_bundle_path_traversal', [configKey, rawValue]), [
|
|
400
400
|
`Remove ".." segments from "${rawValue}". Paths must stay within the bundle directory.`,
|
|
401
401
|
]);
|
|
402
402
|
}
|
|
@@ -408,13 +408,13 @@ function validateFileExistence(obj, outputDir, contentPath, tree) {
|
|
|
408
408
|
const outputDirPath = (0, node_path_1.join)(contentPath, outputDir);
|
|
409
409
|
assertNoTraversal(outputDirPath, contentPath, 'outputDir', outputDir);
|
|
410
410
|
if ((0, node_path_1.resolve)(outputDirPath) === (0, node_path_1.resolve)(contentPath)) {
|
|
411
|
-
throw createConfigError(msgs.getMessage('
|
|
412
|
-
msgs.getMessage('
|
|
411
|
+
throw createConfigError(msgs.getMessage('ui_bundle_outputdir_is_root', [outputDir]), [
|
|
412
|
+
msgs.getMessage('ui_bundle_outputdir_is_root.actions'),
|
|
413
413
|
]);
|
|
414
414
|
}
|
|
415
415
|
if (!tree.exists(outputDirPath) || !tree.isDirectory(outputDirPath)) {
|
|
416
|
-
throw createFileError(msgs.getMessage('
|
|
417
|
-
`Create the directory "${outputDir}" in your
|
|
416
|
+
throw createFileError(msgs.getMessage('ui_bundle_dir_not_found', [outputDir, outputDirPath]), [
|
|
417
|
+
`Create the directory "${outputDir}" in your UI bundle, or change outputDir to an existing directory.`,
|
|
418
418
|
]);
|
|
419
419
|
}
|
|
420
420
|
const hasFileUnder = (dirPath, depth = 0) => {
|
|
@@ -438,7 +438,7 @@ function validateFileExistence(obj, outputDir, contentPath, tree) {
|
|
|
438
438
|
return false;
|
|
439
439
|
};
|
|
440
440
|
if (!hasFileUnder(outputDirPath)) {
|
|
441
|
-
throw createFileError(msgs.getMessage('
|
|
441
|
+
throw createFileError(msgs.getMessage('ui_bundle_dir_empty', [outputDir]), [
|
|
442
442
|
`Add files to "${outputDir}", e.g. an index.html.`,
|
|
443
443
|
]);
|
|
444
444
|
}
|
|
@@ -451,7 +451,7 @@ function validateFileExistence(obj, outputDir, contentPath, tree) {
|
|
|
451
451
|
const fallbackPath = (0, node_path_1.join)(basePath, stripped);
|
|
452
452
|
assertNoTraversal(fallbackPath, basePath, 'routing.fallback', routing.fallback);
|
|
453
453
|
if (!tree.exists(fallbackPath)) {
|
|
454
|
-
throw createFileError(msgs.getMessage('
|
|
454
|
+
throw createFileError(msgs.getMessage('ui_bundle_file_not_found', ['routing.fallback', routing.fallback, fallbackPath]), [`Create the file "${stripped}" inside "${baseLabel}", or update the fallback path.`]);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
if (routing?.rewrites) {
|
|
@@ -462,10 +462,10 @@ function validateFileExistence(obj, outputDir, contentPath, tree) {
|
|
|
462
462
|
const rewritePath = (0, node_path_1.join)(basePath, stripped);
|
|
463
463
|
assertNoTraversal(rewritePath, basePath, `routing.rewrites[${i}].rewrite`, target);
|
|
464
464
|
if (!tree.exists(rewritePath)) {
|
|
465
|
-
throw createFileError(msgs.getMessage('
|
|
465
|
+
throw createFileError(msgs.getMessage('ui_bundle_file_not_found', [`routing.rewrites[${i}].rewrite`, target, rewritePath]), [`Create the file "${stripped}" inside "${baseLabel}", or update the rewrite path.`]);
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
//# sourceMappingURL=
|
|
471
|
+
//# sourceMappingURL=uiBundleValidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uiBundleValidation.js","sourceRoot":"","sources":["../../../../src/resolve/adapters/uiBundleValidation.ts"],"names":[],"mappings":";;AAiEA,4CAEC;AAkFD,oDAgFC;AArOD;;;;;;;;;;;;;;GAcG;AACH,yCAA+C;AAC/C,wDAAqD;AACrD,sDAAmD;;AAKnD,MAAM,IAAI,OAAG,mBAAQ,CAAc,oCAAoC,EAAE,oBAAoB,ujFAAC,CAAC;AA0C/F,+EAA+E;AAC/E,SAAgB,gBAAgB,CAAC,KAAc;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,+EAA+E;AAC/E,MAAM,iBAAiB,G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C,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACjD,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC3C,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;gBACzC,MAAM,WAAW,GAAG,IAAA,gBAAI,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAC7C,iBAAiB,CAAC,WAAW,EAAE,QAAQ,EAAE,oBAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;gBACnF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;oBAC9B,MAAM,eAAe,CACnB,IAAI,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAC,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,EACpG,CAAC,oBAAoB,QAAQ,aAAa,SAAS,gCAAgC,CAAC,CACrF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/lib/src/resolve/adapters/{webApplicationsSourceAdapter.d.ts → uiBundlesSourceAdapter.d.ts}
RENAMED
|
@@ -2,10 +2,10 @@ import { SourcePath } from '../../common/types';
|
|
|
2
2
|
import { SourceComponent } from '../sourceComponent';
|
|
3
3
|
import { BundleSourceAdapter } from './bundleSourceAdapter';
|
|
4
4
|
/**
|
|
5
|
-
* Source adapter for
|
|
5
|
+
* Source adapter for UiBundle bundles.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* ui-bundle.json is optional; validated on deploy, skipped on retrieve.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class UiBundlesSourceAdapter extends BundleSourceAdapter {
|
|
10
10
|
protected populate(trigger: SourcePath, component?: SourceComponent, isResolvingSource?: boolean): SourceComponent | undefined;
|
|
11
11
|
}
|
package/lib/src/resolve/adapters/{webApplicationsSourceAdapter.js → uiBundlesSourceAdapter.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UiBundlesSourceAdapter = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright 2026, Salesforce, Inc.
|
|
6
6
|
*
|
|
@@ -23,15 +23,15 @@ const sourceComponent_1 = require("../sourceComponent");
|
|
|
23
23
|
const treeContainers_1 = require("../treeContainers");
|
|
24
24
|
const path_1 = require("../../utils/path");
|
|
25
25
|
const bundleSourceAdapter_1 = require("./bundleSourceAdapter");
|
|
26
|
-
const
|
|
26
|
+
const uiBundleValidation_1 = require("./uiBundleValidation");
|
|
27
27
|
;
|
|
28
28
|
const messages = new messages_1.Messages('@salesforce/source-deploy-retrieve', 'sdr', new Map([["md_request_fail", "Metadata API request failed: %s"], ["error_retry_limit_exceeded", "Exceeded maximum of %s consecutive retryable errors. Last error: %s"], ["error_could_not_infer_type", "%s: Could not infer a metadata type"], ["error_unexpected_child_type", "Unexpected child metadata [%s] found for parent type [%s]"], ["noParent", "Could not find parent type for %s (%s)"], ["error_expected_source_files", "%s: Expected source files for type '%s'"], ["error_failed_convert", "Component conversion failed: %s"], ["error_invalid_test_level", "TestLevel cannot be '%s' unless API version is %s or later"], ["error_merge_metadata_target_unsupported", "Merge convert for metadata target format currently unsupported"], ["error_missing_adapter", "Missing adapter '%s' for metadata type '%s'"], ["error_missing_transformer", "Missing transformer '%s' for metadata type '%s'"], ["error_missing_type_definition", "Missing metadata type definition in registry for id '%s'."], ["error_missing_child_type_definition", "Type %s does not have a child type definition %s."], ["noChildTypes", "No child types found in registry for %s (reading %s at %s)"], ["error_no_metadata_xml_ignore", "Metadata xml file %s is forceignored but is required for %s."], ["noSourceIgnore", "%s metadata types require source files, but %s is forceignored."], ["noSourceIgnore.actions", "- Metadata types with content are composed of two files: a content file (ie MyApexClass.cls) and a -meta.xml file (i.e MyApexClass.cls-meta.xml). You must include both files in your .forceignore file. Or try appending \u201C\\*\u201D to your existing .forceignore entry.\n\nSee <https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm> for examples"], ["error_path_not_found", "%s: File or folder not found"], ["noContentFound", "SourceComponent %s (metadata type = %s) is missing its content file."], ["noContentFound.actions", ["Ensure the content file exists in the expected location.", "If the content file is in your .forceignore file, ensure the meta-xml file is also ignored to completely exclude it."]], ["error_parsing_xml", "SourceComponent %s (metadata type = %s) does not have an associated metadata xml to parse"], ["error_expected_file_path", "%s: path is to a directory, expected a file"], ["error_expected_directory_path", "%s: path is to a file, expected a directory"], ["error_directory_not_found_or_not_directory", "%s: path is not a directory"], ["error_no_directory_stream", "%s doesn't support readable streams on directories."], ["error_no_source_to_deploy", "No source-backed components present in the package."], ["error_no_components_to_retrieve", "No components in the package to retrieve."], ["error_static_resource_expected_archive_type", "A StaticResource directory must have a content type of application/zip or application/jar - found %s for %s."], ["error_static_resource_missing_resource_file", "A StaticResource must have an associated .resource file, missing %s.resource-meta.xml"], ["error_no_job_id", "The %s operation is missing a job ID. Initialize an operation with an ID, or start a new job."], ["missingApiVersion", "Could not determine an API version to use for the generated manifest. Tried looking for sourceApiVersion in sfdx-project.json, apiVersion from config vars, and the highest apiVersion from the APEX REST endpoint. Using API version 58.0 as a last resort."], ["invalid_xml_parsing", "error parsing %s due to:\\n message: %s\\n line: %s\\n code: %s"], ["zipBufferError", "Zip buffer was not created during conversion"], ["undefinedComponentSet", "Unable to construct a componentSet. Check the logs for more information."], ["replacementsFileNotRead", "The file \"%s\" specified in the \"replacements\" property of sfdx-project.json could not be read."], ["unsupportedBundleType", "Unsupported Bundle Type: %s"], ["filePathGeneratorNoTypeSupport", "Type not supported for filepath generation: %s"], ["missingFolderType", "The registry has %s as is inFolder but it does not have a folderType"], ["tooManyFiles", "Multiple files found for path: %s."], ["cantGetName", "Unable to calculate fullName from path: %s (%s)"], ["missingMetaFileSuffix", "The metadata registry is configured incorrectly for %s. Expected a metaFileSuffix."], ["uniqueIdElementNotInRegistry", "No uniqueIdElement found in registry for %s (reading %s at %s)."], ["uniqueIdElementNotInChild", "The uniqueIdElement %s was not found the child (reading %s at %s)."], ["suggest_type_header", "A metadata type lookup for \"%s\" found the following close matches:"], ["suggest_type_did_you_mean", "-- Did you mean \".%s%s\" instead for the \"%s\" metadata type?"], ["suggest_type_more_suggestions", "Additional suggestions:\nConfirm the file name, extension, and directory names are correct. Validate against the registry at:\n<https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json>\n\nIf the type is not listed in the registry, check that it has Metadata API support via the Metadata Coverage Report:\n<https://developer.salesforce.com/docs/metadata-coverage>\n\nIf the type is available via Metadata API but not in the registry\n\n- Open an issue <https://github.com/forcedotcom/cli/issues>\n- Add the type via PR. Instructions: <https://github.com/forcedotcom/source-deploy-retrieve/blob/main/contributing/metadata.md>"], ["type_name_suggestions", "Confirm the metadata type name is correct. Validate against the registry at:\n<https://github.com/forcedotcom/source-deploy-retrieve/blob/main/src/registry/metadataRegistry.json>\n\nIf the type is not listed in the registry, check that it has Metadata API support via the Metadata Coverage Report:\n<https://developer.salesforce.com/docs/metadata-coverage>\n\nIf the type is available via Metadata API but not in the registry\n\n- Open an issue <https://github.com/forcedotcom/cli/issues>\n- Add the type via PR. Instructions: <https://github.com/forcedotcom/source-deploy-retrieve/blob/main/contributing/metadata.md>"]]));
|
|
29
29
|
/**
|
|
30
|
-
* Source adapter for
|
|
30
|
+
* Source adapter for UiBundle bundles.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
32
|
+
* ui-bundle.json is optional; validated on deploy, skipped on retrieve.
|
|
33
33
|
*/
|
|
34
|
-
class
|
|
34
|
+
class UiBundlesSourceAdapter extends bundleSourceAdapter_1.BundleSourceAdapter {
|
|
35
35
|
populate(trigger, component, isResolvingSource = true) {
|
|
36
36
|
const source = super.populate(trigger, component);
|
|
37
37
|
if (!source?.content) {
|
|
@@ -39,7 +39,7 @@ class WebApplicationsSourceAdapter extends bundleSourceAdapter_1.BundleSourceAda
|
|
|
39
39
|
}
|
|
40
40
|
const contentPath = source.content;
|
|
41
41
|
const appName = (0, path_1.baseName)(contentPath);
|
|
42
|
-
const expectedXmlPath = (0, node_path_1.join)(contentPath, `${appName}.
|
|
42
|
+
const expectedXmlPath = (0, node_path_1.join)(contentPath, `${appName}.uibundle-meta.xml`);
|
|
43
43
|
if (!this.tree.exists(expectedXmlPath)) {
|
|
44
44
|
throw new sfError_1.SfError(messages.getMessage('error_expected_source_files', [expectedXmlPath, this.type.name]), 'ExpectedSourceFilesError');
|
|
45
45
|
}
|
|
@@ -56,15 +56,15 @@ class WebApplicationsSourceAdapter extends bundleSourceAdapter_1.BundleSourceAda
|
|
|
56
56
|
}, this.tree, this.forceIgnore);
|
|
57
57
|
// Validate only on real filesystem; ZipTreeContainer (retrieve) doesn't support readFileSync.
|
|
58
58
|
if (isResolvingSource && this.tree instanceof treeContainers_1.NodeFSTreeContainer) {
|
|
59
|
-
const descriptorPath = (0, node_path_1.join)(contentPath, '
|
|
59
|
+
const descriptorPath = (0, node_path_1.join)(contentPath, 'ui-bundle.json');
|
|
60
60
|
const hasDescriptor = this.tree.exists(descriptorPath) && !this.forceIgnore.denies(descriptorPath);
|
|
61
61
|
if (hasDescriptor) {
|
|
62
62
|
const raw = this.tree.readFileSync(descriptorPath);
|
|
63
|
-
(0,
|
|
63
|
+
(0, uiBundleValidation_1.validateUiBundleJson)(raw, descriptorPath, contentPath, this.tree);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
return resolvedSource;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
exports.
|
|
70
|
-
//# sourceMappingURL=
|
|
69
|
+
exports.UiBundlesSourceAdapter = UiBundlesSourceAdapter;
|
|
70
|
+
//# sourceMappingURL=uiBundlesSourceAdapter.js.map
|
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CACjB;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,GAAG,EAAE,eAAe;gBACpB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,UAAU,EAAE,MAAM,CAAC,UAAU;aAC9B,EACD,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,WAAW,CACjB,CAAC;QAER,8FAA8F;QAC9F,IAAI,iBAAiB,IAAI,IAAI,CAAC,IAAI,YAAY,oCAAmB,EAAE,CAAC;YAClE,MAAM,cAAc,GAAG,IAAA,gBAAI,EAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;YAC3D,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAEnG,IAAI,aAAa,EAAE,CAAC;gBAClB,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;gBACnD,IAAA,yCAAoB,EAAC,GAAG,EAAE,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AAnDD,wDAmDC"}
|
|
@@ -392,7 +392,7 @@ const legacySuffixMatches = (type, fsPath) => {
|
|
|
392
392
|
};
|
|
393
393
|
const appendMetaXmlSuffix = (suffix) => `${suffix}${constants_1.META_XML_SUFFIX}`;
|
|
394
394
|
const isMixedContentOrBundle = (type) => typeof type.strategies?.adapter === 'string' &&
|
|
395
|
-
['mixedContent', 'bundle', '
|
|
395
|
+
['mixedContent', 'bundle', 'uiBundles'].includes(type.strategies.adapter);
|
|
396
396
|
/** types with folders only have folder components living at the top level.
|
|
397
397
|
* if the fsPath is a folder component, let a future strategy deal with it
|
|
398
398
|
*/
|