-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added typedoc and `build:docs` script ticket: [CLNP-2426] [CLNP-2426]: https://sendbird.atlassian.net/browse/CLNP-2426?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
- Loading branch information
Showing
15 changed files
with
330 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,4 +36,7 @@ yarn-error.log* | |
|
||
.idea/ | ||
|
||
*storybook.log | ||
*storybook.log | ||
|
||
# docs | ||
/docs |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { execSync } from 'child_process'; | ||
import { promises as fs } from 'fs'; | ||
import moduleExports from '../rollup.module-exports.mjs'; | ||
|
||
function removeDuplicates(items) { | ||
return [...new Set(items)]; | ||
} | ||
const order = [ | ||
'src/modules/App', | ||
'src/modules/GroupChannel', | ||
'src/modules/GroupChannelList', | ||
'src/modules', | ||
'src/ui', | ||
'src/hooks', | ||
'src/utils', | ||
]; | ||
async function updateEntryPoints() { | ||
const modulePaths = removeDuplicates(Object.values(moduleExports)).sort((a, b) => { | ||
const aOrder = order.findIndex((o) => a.startsWith(o)) ?? -1; | ||
const bOrder = order.findIndex((o) => b.startsWith(o)) ?? -1; | ||
if (aOrder === -1) return 1; | ||
if (bOrder === -1) return -1; | ||
if (aOrder !== bOrder) return aOrder - bOrder; | ||
return a.localeCompare(b); | ||
}); | ||
const typedoc = JSON.parse(await fs.readFile('typedoc.json', 'utf-8')); | ||
typedoc.entryPoints = modulePaths; | ||
await fs.writeFile('typedoc.json', JSON.stringify(typedoc, null, 2)); | ||
} | ||
|
||
function execTypedoc() { | ||
execSync('npx typedoc', (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`exec error: ${error}`); | ||
return; | ||
} | ||
console.log(`stdout: ${stdout}`); | ||
console.error(`stderr: ${stderr}`); | ||
}); | ||
} | ||
|
||
async function run() { | ||
await updateEntryPoints(); | ||
execTypedoc(); | ||
} | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.