diff --git a/custom-elements-manifest.config.js b/custom-elements-manifest.config.js index 6d7f536fc..8e327d7b5 100644 --- a/custom-elements-manifest.config.js +++ b/custom-elements-manifest.config.js @@ -1,10 +1,11 @@ import fs from 'fs'; +import path from 'path'; import { parse } from 'comment-parser'; import { pascalCase } from 'pascal-case'; const packageData = JSON.parse(fs.readFileSync('./package.json', 'utf8')); const { name, description, version, author, homepage, license } = packageData; -// eslint-disable-next-line func-style + const noDash = string => string.replace(/^\s?-/, '').trim(); export default { @@ -86,7 +87,6 @@ export default { } } }, - { name: 'shoelace-react-event-names', analyzePhase({ ts, node, moduleDoc }) { @@ -103,6 +103,30 @@ export default { } } } + }, + { + name: 'shoelace-translate-module-paths', + analyzePhase({ ts, node, moduleDoc }) { + switch (node.kind) { + case ts.SyntaxKind.ClassDeclaration: { + // + // Module paths look like this: + // + // src/components/button/button.ts + // + // But we want them to point to the dist file: + // + // dist/components/button/button.js + // + const relativePath = path.relative('src', moduleDoc.path); + const dirname = path.dirname(relativePath); + const basename = path.basename(relativePath, path.extname(relativePath)) + '.js'; + const distPath = path.join('dist', dirname, basename); + + moduleDoc.path = distPath; + } + } + } } ] }; diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index f12722506..62e613259 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -34,6 +34,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis - Fixed a bug that caused forms to submit unexpectedly when selecting certain characters [#988](https://github.com/shoelace-style/shoelace/pull/988) - Fixed a bug in `` that prevented the `invalid` property from correctly reflecting validity sometimes [#992](https://github.com/shoelace-style/shoelace/issues/992) - Fixed a bug in `` that prevented selections from working correctly on dynamically added tree items [#963](https://github.com/shoelace-style/shoelace/issues/963) +- Fixed module paths in `custom-elements.json` so they point to the dist file instead of the source file [#725](https://github.com/shoelace-style/shoelace/issues/725) - Improved `` to improve padding and render relative to the current font size - Moved all component descriptions to `@summary` to get them within documentation tools [#962](https://github.com/shoelace-style/shoelace/pull/962) - Updated Lit to 2.4.1