Skip to content

Commit 51477dd

Browse files
committed
fix: rename WebApplicationResource to UIBundleResource in deploy messages and tests
1 parent 9c46209 commit 51477dd

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/client/deployMessages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const getDeployMessages = (result: MetadataApiDeployStatus): Map<string,
147147
return messageMap;
148148
};
149149

150-
export const UI_BUNDLE_RESOURCE_TYPE = 'WebApplicationResource';
150+
export const UI_BUNDLE_RESOURCE_TYPE = 'UIBundleResource';
151151

152152
/** Server-generated internal files that should not appear in per-file deploy results. */
153153
export const isUiBundleInternalPath = (resourceFullName: string): boolean =>

src/client/metadataApiDeploy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,9 @@ const warnIfUnmatchedServerResult =
468468
[...messageMap.keys()].flatMap((key) => {
469469
const [type, fullName] = key.split('#');
470470

471-
// WebApplicationResource messages are already handled by the parent WebApplication component
471+
// UIBundleResource messages are already handled by the parent UIBundle component
472472
const consumedByWebApp =
473-
(type === 'WebApplicationResource' || type === 'UIBundleResource') &&
473+
type === 'UIBundleResource' &&
474474
fr.some((c) => c.type === 'UIBundle' && fullName.startsWith(`${c.fullName}/`));
475475

476476
if (
@@ -524,12 +524,12 @@ const buildFileResponsesFromComponentSet =
524524

525525
const fileResponses: FileResponse[] = (cs.getSourceComponents().toArray() ?? [])
526526
.flatMap((deployedComponent): FileResponse[] => {
527-
// WebApplication bundles get per-file status via WebApplicationResource messages
527+
// UIBundle bundles get per-file status via UIBundleResource messages
528528
if (
529529
deployedComponent.type.name === 'UIBundle' &&
530530
deployedComponent.content &&
531531
Array.from(responseMessages.entries()).some(
532-
([key]) => key.startsWith('WebApplicationResource#') && key.includes(`${deployedComponent.fullName}/`)
532+
([key]) => key.startsWith('UIBundleResource#') && key.includes(`${deployedComponent.fullName}/`)
533533
)
534534
) {
535535
const base = {
@@ -542,7 +542,7 @@ const buildFileResponsesFromComponentSet =
542542
const perFileResponses = Array.from(responseMessages.entries())
543543
.filter(
544544
([key, msgs]) =>
545-
key.startsWith('WebApplicationResource#') &&
545+
key.startsWith('UIBundleResource#') &&
546546
key.includes(`${deployedComponent.fullName}/`) &&
547547
msgs.length > 0
548548
)

test/client/deployMessages.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ function createDeployMessage(overrides: Partial<DeployMessage>): DeployMessage {
4141

4242
describe('deployMessages', () => {
4343
describe('UI_BUNDLE_RESOURCE_TYPE', () => {
44-
it('should equal "WebApplicationResource"', () => {
45-
expect(UI_BUNDLE_RESOURCE_TYPE).to.equal('WebApplicationResource');
44+
it('should equal "UIBundleResource"', () => {
45+
expect(UI_BUNDLE_RESOURCE_TYPE).to.equal('UIBundleResource');
4646
});
4747
});
4848

@@ -77,8 +77,8 @@ describe('deployMessages', () => {
7777
});
7878

7979
describe('isUiBundleResourceMessage', () => {
80-
it('should return true when componentType is WebApplicationResource', () => {
81-
const msg = createDeployMessage({ componentType: 'WebApplicationResource' });
80+
it('should return true when componentType is UIBundleResource', () => {
81+
const msg = createDeployMessage({ componentType: 'UIBundleResource' });
8282
assert.isTrue(isUiBundleResourceMessage(msg));
8383
});
8484

test/client/metadataApiDeploy.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,12 +1376,12 @@ describe('MetadataApiDeploy', () => {
13761376
deleted: 'false',
13771377
success: 'true',
13781378
fullName: `MyApp/${relativePath}`,
1379-
componentType: 'WebApplicationResource',
1380-
fileName: `webapplications/MyApp/${relativePath}`,
1379+
componentType: 'UIBundleResource',
1380+
fileName: `uiBundles/MyApp/${relativePath}`,
13811381
...overrides,
13821382
} as DeployMessage);
13831383

1384-
it('should build per-file responses for each WebApplicationResource message', () => {
1384+
it('should build per-file responses for each UIBundleResource message', () => {
13851385
const component = makeWebAppComponent();
13861386
const deployedSet = new ComponentSet([component]);
13871387
const apiStatus: Partial<MetadataApiDeployStatus> = {
@@ -1476,7 +1476,7 @@ describe('MetadataApiDeploy', () => {
14761476
expect(deletedFile!.state).to.equal(ComponentStatus.Deleted);
14771477
});
14781478

1479-
it('should include error and problemType for failed WebApplicationResource messages', () => {
1479+
it('should include error and problemType for failed UIBundleResource messages', () => {
14801480
const component = makeWebAppComponent();
14811481
const deployedSet = new ComponentSet([component]);
14821482
const problem = 'Invalid markup in index.html';
@@ -1492,8 +1492,8 @@ describe('MetadataApiDeploy', () => {
14921492
problem,
14931493
problemType,
14941494
fullName: 'MyApp/dist/index.html',
1495-
componentType: 'WebApplicationResource',
1496-
fileName: 'webapplications/MyApp/dist/index.html',
1495+
componentType: 'UIBundleResource',
1496+
fileName: 'uiBundles/MyApp/dist/index.html',
14971497
} as DeployMessage,
14981498
},
14991499
};
@@ -1533,7 +1533,7 @@ describe('MetadataApiDeploy', () => {
15331533
expect(filePaths).to.not.include(join(bundlePath, 'languages', 'en_US.json'));
15341534
});
15351535

1536-
it('should NOT warn for consumed WebApplicationResource messages', () => {
1536+
it('should NOT warn for consumed UIBundleResource messages', () => {
15371537
const warnSpy = $$.SANDBOX.stub(Lifecycle.prototype, 'emitWarning');
15381538
const emitSpy = $$.SANDBOX.stub(Lifecycle.prototype, 'emit');
15391539

0 commit comments

Comments
 (0)