Closed bennypowers closed 5 months ago
Latest commit: bbf779ed2faaa5aa6b072e07067deb679496a2f6
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
"\n## š Commitlint Problems for this PR: \n\nš found 2 errors, 0 warnings\nā¹ļø Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint\n \n\n\n1eafb022 - Update little-singers-sell.md \n\n\n- ā subject may not be empty\n- ā type may not be empty "
Name | Link |
---|---|
Latest commit | 476d2dd03d050a95b0aea1daa26172ce240cbf09 |
Deploy Preview | https://deploy-preview-2655--patternfly-elements.netlify.app/ |
To edit notification comments on pull requests, go to your Netlify site settings.
I apparently fixed the import map generator plugin. I then ran roughshod over the demo files because the import map plugin requires all top-level modules be inlined.
I haven't checked yet if this breaks the demos on the DP (eleventy). A followup PR should load those demos in iframes, a la pf.org
We'll have to test this with rhds (and maybe cp too, cc @eyevana)
this is also missing changesets
Ok this appears to work in rhds with the following dev server config
// @ts-check
import { pfeDevServerConfig } from '@patternfly/pfe-tools/dev-server/config.js';
import { glob } from 'glob';
export const litcssOptions = {
include: (/** @type{string[]}*/(/** @type{unknown}*/([
/elements\/rh-[\w-]+\/[\w-]+\.css$/,
/lib\/.*\.css$/,
]))),
exclude: /lightdom/,
};
const libImports =
await glob('./lib/**/*.js', { ignore: ['**/test/**'] })
.then(files => files.map(spec => [`@rhds/elements/${spec}`, `./${spec}`]))
.then(Object.fromEntries);
const elementImports =
await glob('./elements/**/*.js', { ignore: ['**/test/**'] })
.then(files => files.map(spec => [`@rhds/elements/${spec.replace('elements/', '')}`, `./${spec}`]))
.then(Object.fromEntries);
export default pfeDevServerConfig({
litcssOptions,
tsconfig: 'tsconfig.json',
importMapOptions: {
providers: {
'@patternfly/icons': 'nodemodules',
'@patternfly/elements': 'nodemodules',
'@patternfly/pfe-tools': 'nodemodules',
'@patternfly/pfe-core': 'nodemodules',
},
inputMap: {
imports: {
...libImports,
...elementImports,
},
},
},
middleware: [
/** redirect requests for lightdom css to /elements */
function(ctx, next) {
const match = ctx.path.match(/^\/components\/(?<slug>[-\w]+)\/(?<path>.*)\.css$/);
if (match) {
const { slug, path } = /** @type{{ slug: string; path: string }} */ (match.groups);
ctx.redirect(`/elements/rh-${slug}/${path}.css`);
}
return next();
},
/** redirect requests for /assets/* css to /docs/assets/prism.css */
function(ctx, next) {
if (ctx.path.startsWith('/assets/')) {
ctx.redirect(`/docs${ctx.path}`);
}
return next();
}
]
});
What I did
Notes to Reviewers
In reviewing this PR, please take a look at the wds config in https://github.com/RedHat-UX/red-hat-design-system/pull/1420/files/7f8e1bc5c1054e55083a0d50582d0bf0a6d56ff4..bfa209ba48e697ad4c78df20d285ff55518a2bbe, as a sample "downstream" usage of these changes