Skip to content

Commit

Permalink
add features to responsible_dev.md, #179
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 24, 2022
1 parent e2b2d78 commit 3983644
Show file tree
Hide file tree
Showing 2 changed files with 232 additions and 206 deletions.
32 changes: 29 additions & 3 deletions sim-info/generateMarkdownOutput.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,40 @@ let responsibleTableString = `
NOTE: This file is generated, do not edit directly. It is created from \`responsible_dev.json\`, see \`./generateMarkdownOutput.mjs\`.
| Simulation | Developer | Designer |
| :---------- | :------------- | :------------- |
| Simulation | Developer | Designer | Features |
| :---------- | :------------- | :------------- | :------------- |
`;


// look at the repo's package.json in phet.simFeatures and note selected features for the sim.
const getFeatures = repo => {
const features = [];
try {
const packageJSON = JSON.parse( fs.readFileSync( `./${repo}/package.json` ).toString() );
if ( packageJSON.phet && packageJSON.phet.simFeatures ) {
if ( packageJSON.phet.simFeatures.supportsSound ) {
features.push( 'Sound' );
}
if ( packageJSON.phet.simFeatures.supportsInteractiveDescription ) {
features.push( 'Interactive Description' );
}
if ( packageJSON.phet.simFeatures.supportsVoicing ) {
features.push( 'Voicing' );
}
if ( packageJSON.phet.simFeatures.supportsInteractiveHighlights ) {
features.push( 'Interactive Highlights' );
}
}
}
catch( e ) {} // some repos don't have package.json, and that's okay.
return features;
};

repos.forEach( repoName => {
const responsibleDeveloper = responsibleDevObject[ repoName ].responsibleDevs.join( ',' )
const responsibleDesigner = responsibleDevObject[ repoName ].responsibleDesigners.join( ',' )
responsibleTableString += `| ${repoName} | ${responsibleDeveloper} | ${responsibleDesigner} | \n`;
const features = getFeatures( repoName ).join( '<br/>' );
responsibleTableString += `| ${repoName} | ${responsibleDeveloper} | ${responsibleDesigner} | ${features} | \n`;
} );

fs.writeFileSync( './phet-info/sim-info/responsible_dev.md', responsibleTableString );
Loading

0 comments on commit 3983644

Please sign in to comment.