Skip to content

Commit 7fdb693

Browse files
committed
Revert "chore(): keep the components file in the previous format. This change applies only to the JP domain."
This reverts commit 31911d0.
1 parent 62bf3a8 commit 7fdb693

File tree

1 file changed

+5
-15
lines changed
  • plugins/docusaurus-plugin-ionic-component-api

1 file changed

+5
-15
lines changed

plugins/docusaurus-plugin-ionic-component-api/index.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,11 @@ module.exports = function (context, options) {
2020
*/
2121
const generateMarkdownForVersion = async (version, npmTag, lang, isCurrentVersion) => {
2222
let COMPONENT_LINK_REGEXP;
23-
const components = await (async () => {
24-
if (isCurrentVersion) {
25-
const { components } = require(process.cwd() + `/scripts/data/translated-api.json`);
26-
return components;
27-
} else {
28-
const response = await fetch(`https://unpkg.com/@ionic/docs@${npmTag}/core.json`);
29-
const { components } = await response.json();
30-
return components;
31-
}
32-
})();
33-
// const response =
34-
// isCurrentVersion && lang === 'ja'
35-
// ? await fetch(`https://raw.githubusercontent.com/ionic-jp/ionic-docs/main/scripts/data/translated-api.json`)
36-
// : await fetch(`https://unpkg.com/@ionic/docs@${npmTag}/core.json`);
37-
// const { components } = await response.json();
23+
const response =
24+
isCurrentVersion && lang === 'ja'
25+
? await fetch(`https://raw.githubusercontent.com/ionic-jp/ionic-docs/main/scripts/data/translated-api.json`)
26+
: await fetch(`https://unpkg.com/@ionic/docs@${npmTag}/core.json`);
27+
const { components } = await response.json();
3828

3929
const names = components.map((component) => component.tag.slice(4));
4030
// matches all relative markdown links to a component, e.g. (../button)

0 commit comments

Comments
 (0)