Skip to content

Commit

Permalink
point module paths to dist; fixes #725
Browse files Browse the repository at this point in the history
  • Loading branch information
claviska committed Nov 10, 2022
1 parent a0d3ac0 commit 40cb38e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
28 changes: 26 additions & 2 deletions custom-elements-manifest.config.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -86,7 +87,6 @@ export default {
}
}
},

{
name: 'shoelace-react-event-names',
analyzePhase({ ts, node, moduleDoc }) {
Expand All @@ -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;
}
}
}
}
]
};
1 change: 1 addition & 0 deletions docs/resources/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<sl-radio-group>` that prevented the `invalid` property from correctly reflecting validity sometimes [#992](https://github.com/shoelace-style/shoelace/issues/992)
- Fixed a bug in `<sl-tree>` 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 `<sl-badge>` 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
Expand Down

0 comments on commit 40cb38e

Please sign in to comment.