Skip to content

Commit d2cd76d

Browse files
committed
fix(tools): exception in test runner config
1 parent 94b9680 commit d2cd76d

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.changeset/silver-trains-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/pfe-tools": patch
3+
---
4+
5+
**Test Runner**: prevent config exception when lightdom shims are present

tools/pfe-tools/dev-server/plugins/dev-server-router.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ export function pfeDevServerRouterMiddleware(
9494
): Router.Middleware {
9595
const { elementsDir, site: { componentSubpath } } = config;
9696
const router = new Router();
97+
const shim = lightdomShimMiddleware(config);
98+
const demo = demoSubresourceMiddleware(config);
9799
return router
98-
.get('/tools/pfe-tools/environment.js(.js)?',
99-
environmentMiddleware(config))
100-
.get(`/core/pfe-core/:splatPath*.js`,
101-
coreMiddleware(config))
102-
.get(`/${elementsDir}/:tagName/:splat.(css|html|js)`,
103-
cacheBustingMiddleware(config))
104-
.get(`/${componentSubpath}/:unprefixedElementSlug/:moduleName*.js`,
105-
elementDeclarationTypeScriptMiddleware(config))
106-
.get(`/${componentSubpath}/:unprefixedElementSlug/{demo/}?:sheetName-lightdom{:suffix}?.css`,
107-
lightdomShimMiddleware(config))
108-
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/{:demoName/}?:fileName.:ext`,
109-
demoSubresourceMiddleware(config))
100+
.get('/tools/pfe-tools/environment.js(.js)?', environmentMiddleware(config))
101+
.get(`/core/pfe-core/:splatPath*.js`, coreMiddleware(config))
102+
.get(`/${elementsDir}/:tagName/:splat.(css|html|js)`, cacheBustingMiddleware(config))
103+
.get(`/${componentSubpath}/:unprefixedElementSlug/:moduleName*.js`, elementDeclarationTypeScriptMiddleware(config))
104+
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/:sheetName-lightdom:suffix.css`, shim)
105+
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/:sheetName-lightdom.css`, shim)
106+
.get(`/${componentSubpath}/:unprefixedElementSlug/:sheetName-lightdom:suffix.css`, shim)
107+
.get(`/${componentSubpath}/:unprefixedElementSlug/:sheetName-lightdom.css`, shim)
108+
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/:demoName/:fileName.:ext`, demo)
109+
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/:fileName.:ext`, demo)
110110
.routes();
111111
}

0 commit comments

Comments
 (0)