Skip to content

Commit

Permalink
rich-text: set up autogenerated API docs (#14220)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw committed Mar 7, 2019
1 parent 73ccbe4 commit 29203bf
Show file tree
Hide file tree
Showing 24 changed files with 370 additions and 172 deletions.
28 changes: 21 additions & 7 deletions bin/update-readmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,35 @@ const packages = [
//'plugins',
//'priority-queue',
//'redux-routine',
//'rich-text',
'rich-text',
//'shortcode',
//'url',
//'viewport',
//'wordcount',
];

const getArgsForPackage = ( packageName ) => {
switch ( packageName ) {
case 'rich-text':
return [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
'--ignore "unstable|experimental|^apply$|^changeListType$|^charAt$|^getSelectionStart$|^getSelectionEnd$|^indentListItems$|^insertLineBreak$|^insertLineSeparator$|^isEmptyLine$|^LINE_SEPARATOR$|^outdentListItems$"',
];
default:
return [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
'--ignore "unstable|experimental"',
];
}
};

let aggregatedExitCode = 0;
packages.forEach( ( packageName ) => {
const args = [
`packages/${ packageName }/src/index.js`,
`--output packages/${ packageName }/README.md`,
'--to-token',
'--ignore "unstable|experimental"',
];
const args = getArgsForPackage( packageName );
const pathToDocGen = path.join( __dirname, '..', 'node_modules', '.bin', 'docgen' );
const { status, stderr } = childProcess.spawnSync(
pathToDocGen,
Expand Down
Loading

0 comments on commit 29203bf

Please sign in to comment.