Skip to content

Commit 98892a8

Browse files
authored
Merge pull request #2191 from Hyperkid123/automated-path-interceptor
fix(config): add missing CDN path mapping to module interceptor
2 parents 03409e1 + 2230ef3 commit 98892a8

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

packages/config-utils/src/feo/feo-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type ChromeModuleAnalytics = {
3434

3535
export type ChromeModule = {
3636
manifestLocation: string;
37+
cdnPath?: string;
3738
defaultDocumentTitle?: string;
3839
/**
3940
* @deprecated

packages/config-utils/src/feo/module-interceptor.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ describe('module-interceptor', () => {
66
const moduleName = 'module-name';
77
const newEntry: ChromeModule = {
88
manifestLocation: 'new-location',
9+
cdnPath: '/',
910
};
1011
const frontendCRD: FrontendCRD = {
1112
objects: [
@@ -39,6 +40,7 @@ describe('module-interceptor', () => {
3940
const moduleName = 'module-name';
4041
const newEntry: ChromeModule = {
4142
manifestLocation: 'new-location',
43+
cdnPath: '/',
4244
};
4345
const frontendCRD: FrontendCRD = {
4446
objects: [

packages/config-utils/src/feo/module-interceptor.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ import { ChromeModuleRegistry, FrontendCRD } from './feo-types';
22

33
function moduleInterceptor(moduleRegistry: ChromeModuleRegistry, frontendCRD: FrontendCRD): ChromeModuleRegistry {
44
const moduleName = frontendCRD.objects[0].metadata.name;
5+
const cdnPath = frontendCRD.objects[0].spec.frontend.paths[0];
56
return {
67
...moduleRegistry,
7-
[moduleName]: frontendCRD.objects[0].spec.module,
8+
[moduleName]: {
9+
...frontendCRD.objects[0].spec.module,
10+
cdnPath,
11+
},
812
};
913
}
1014

0 commit comments

Comments
 (0)