Skip to content

Commit

Permalink
fix(tools): exception in test runner config
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Oct 13, 2024
1 parent 94b9680 commit d2cd76d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-trains-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@patternfly/pfe-tools": patch
---

**Test Runner**: prevent config exception when lightdom shims are present
24 changes: 12 additions & 12 deletions tools/pfe-tools/dev-server/plugins/dev-server-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ export function pfeDevServerRouterMiddleware(
): Router.Middleware {
const { elementsDir, site: { componentSubpath } } = config;
const router = new Router();
const shim = lightdomShimMiddleware(config);
const demo = demoSubresourceMiddleware(config);
return router
.get('/tools/pfe-tools/environment.js(.js)?',
environmentMiddleware(config))
.get(`/core/pfe-core/:splatPath*.js`,
coreMiddleware(config))
.get(`/${elementsDir}/:tagName/:splat.(css|html|js)`,
cacheBustingMiddleware(config))
.get(`/${componentSubpath}/:unprefixedElementSlug/:moduleName*.js`,
elementDeclarationTypeScriptMiddleware(config))
.get(`/${componentSubpath}/:unprefixedElementSlug/{demo/}?:sheetName-lightdom{:suffix}?.css`,
lightdomShimMiddleware(config))
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/{:demoName/}?:fileName.:ext`,
demoSubresourceMiddleware(config))
.get('/tools/pfe-tools/environment.js(.js)?', environmentMiddleware(config))
.get(`/core/pfe-core/:splatPath*.js`, coreMiddleware(config))
.get(`/${elementsDir}/:tagName/:splat.(css|html|js)`, cacheBustingMiddleware(config))
.get(`/${componentSubpath}/:unprefixedElementSlug/:moduleName*.js`, elementDeclarationTypeScriptMiddleware(config))
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/:sheetName-lightdom:suffix.css`, shim)
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/:sheetName-lightdom.css`, shim)
.get(`/${componentSubpath}/:unprefixedElementSlug/:sheetName-lightdom:suffix.css`, shim)
.get(`/${componentSubpath}/:unprefixedElementSlug/:sheetName-lightdom.css`, shim)
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/:demoName/:fileName.:ext`, demo)
.get(`/${componentSubpath}/:unprefixedElementSlug/demo/:fileName.:ext`, demo)
.routes();
}

0 comments on commit d2cd76d

Please sign in to comment.