point module paths to dist; fixes #725

pull/1006/head
Cory LaViska 2022-11-10 15:28:08 -05:00
rodzic a0d3ac047d
commit 40cb38e0a0
2 zmienionych plików z 27 dodań i 2 usunięć

Wyświetl plik

@ -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;
}
}
}
}
]
};

Wyświetl plik

@ -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