| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d99deea commit 417a3ac
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -152,6 +152,8 @@ For information on reporting security vulnerabilities in Node.js, see | |||
| 152 | 152 | For information about the governance of the Node.js project, see | |
| 153 | 153 | [GOVERNANCE.md](./GOVERNANCE.md). | |
| 154 | 154 | ||
| 155 | + <!-- node-core-utils depends on the format of the TSC list. If the | ||
| 156 | + format changes, those utilities need to be tested and updated. --> | ||
| 155 | 157 | ### TSC (Technical Steering Committee) | |
| 156 | 158 | ||
| 157 | 159 | <!--lint disable prohibited-strings--> | |
@@ -249,6 +251,9 @@ For information about the governance of the Node.js project, see | |||
| 249 | 251 | ||
| 250 | 252 | </details> | |
| 251 | 253 | ||
| 254 | + <!-- node-core-utils and find-inactive-collaborators.mjs depend on the format | ||
| 255 | + of the collaborator list. If the format changes, those utilities need to be | ||
| 256 | + tested and updated. --> | ||
| 252 | 257 | ### Collaborators | |
| 253 | 258 | ||
| 254 | 259 | * [addaleax](https://github.com/addaleax) - | |
@@ -462,6 +467,8 @@ For information about the governance of the Node.js project, see | |||
| 462 | 467 | ||
| 463 | 468 | <summary>Emeriti</summary> | |
| 464 | 469 | ||
| 470 | + <!-- find-inactive-collaborators.mjs depends on the format of the emeriti list. | ||
| 471 | + If the format changes, those utilities need to be tested and updated. --> | ||
| 465 | 472 | ### Collaborator emeriti | |
| 466 | 473 | ||
| 467 | 474 | * [andrasq](https://github.com/andrasq) - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -100,6 +100,85 @@ async function getCollaboratorsFromReadme() { | |||
| 100 | 100 | return returnedArray; | |
| 101 | 101 | } | |
| 102 | 102 | ||
| 103 | + async function moveCollaboratorToEmeritus(peopleToMove) { | ||
| 104 | + const readmeText = readline.createInterface({ | ||
| 105 | + input: fs.createReadStream(new URL('../README.md', import.meta.url)), | ||
| 106 | + crlfDelay: Infinity, | ||
| 107 | + }); | ||
| 108 | + let fileContents = ''; | ||
| 109 | + let inCollaboratorsSection = false; | ||
| 110 | + let inCollaboratorEmeritusSection = false; | ||
| 111 | + let collaboratorFirstLine = ''; | ||
| 112 | + const textToMove = []; | ||
| 113 | + for await (const line of readmeText) { | ||
| 114 | + // If we've been processing collaborator emeriti and we reach the end of | ||
| 115 | + // the list, print out the remaining entries to be moved because they come | ||
| 116 | + // alphabetically after the last item. | ||
| 117 | + if (inCollaboratorEmeritusSection && line === '' && | ||
| 118 | + fileContents.endsWith('>\n')) { | ||
| 119 | + while (textToMove.length) { | ||
| 120 | + fileContents += textToMove.pop(); | ||
| 121 | + } | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + // If we've found the collaborator heading already, stop processing at the | ||
| 125 | + // next heading. | ||
| 126 | + if (line.startsWith('#')) { | ||
| 127 | + inCollaboratorsSection = false; | ||
| 128 | + inCollaboratorEmeritusSection = false; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + const isCollaborator = inCollaboratorsSection && line.length; | ||
| 132 | + const isCollaboratorEmeritus = inCollaboratorEmeritusSection && line.length; | ||
| 133 | + | ||
| 134 | + if (line === '### Collaborators') { | ||
| 135 | + inCollaboratorsSection = true; | ||
| 136 | + } | ||
| 137 | + if (line === '### Collaborator emeriti') { | ||
| 138 | + inCollaboratorEmeritusSection = true; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + if (isCollaborator) { | ||
| 142 | + if (line.startsWith('* ')) { | ||
| 143 | + collaboratorFirstLine = line; | ||
| 144 | + } else if (line.startsWith('**')) { | ||
| 145 | + const [, name, email] = /^\*\*([^*]+)\*\* <(.+)>/.exec(line); | ||
| 146 | + if (peopleToMove.some((entry) => { | ||
| 147 | + return entry.name === name && entry.email === email; | ||
| 148 | + })) { | ||
| 149 | + textToMove.push(`${collaboratorFirstLine}\n${line}\n`); | ||
| 150 | + } else { | ||
| 151 | + fileContents += `${collaboratorFirstLine}\n${line}\n`; | ||
| 152 | + } | ||
| 153 | + } else { | ||
| 154 | + fileContents += `${line}\n`; | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + if (isCollaboratorEmeritus) { | ||
| 159 | + if (line.startsWith('* ')) { | ||
| 160 | + collaboratorFirstLine = line; | ||
| 161 | + } else if (line.startsWith('**')) { | ||
| 162 | + const currentLine = `${collaboratorFirstLine}\n${line}\n`; | ||
| 163 | + // If textToMove is empty, this still works because when undefined is | ||
| 164 | + // used in a comparison with <, the result is always false. | ||
| 165 | + while (textToMove[0] < currentLine) { | ||
| 166 | + fileContents += textToMove.shift(); | ||
| 167 | + } | ||
| 168 | + fileContents += currentLine; | ||
| 169 | + } else { | ||
| 170 | + fileContents += `${line}\n`; | ||
| 171 | + } | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + if (!isCollaborator && !isCollaboratorEmeritus) { | ||
| 175 | + fileContents += `${line}\n`; | ||
| 176 | + } | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + return fileContents; | ||
| 180 | + } | ||
| 181 | + | ||
| 103 | 182 | // Get list of current collaborators from README.md. | |
| 104 | 183 | const collaborators = await getCollaboratorsFromReadme(); | |
| 105 | 184 | ||
@@ -113,9 +192,13 @@ const inactive = collaborators.filter((collaborator) => | |||
| 113 | 192 | !authors.has(collaborator.mailmap) && | |
| 114 | 193 | !landers.has(collaborator.mailmap) && | |
| 115 | 194 | !approvingReviewers.has(collaborator.name) | |
| 116 | - ).map((collaborator) => collaborator.name); | ||
| 195 | + ); | ||
| 117 | 196 | ||
| 118 | 197 | if (inactive.length) { | |
| 119 | 198 | console.log('\nInactive collaborators:\n'); | |
| 120 | - console.log(inactive.map((name) => `* ${name}`).join('\n')); | ||
| 199 | + console.log(inactive.map((entry) => `* ${entry.name}`).join('\n')); | ||
| 200 | + console.log('\nGenerating new README.md file...'); | ||
| 201 | + const newReadmeText = await moveCollaboratorToEmeritus(inactive); | ||
| 202 | + fs.writeFileSync(new URL('../README.md', import.meta.url), newReadmeText); | ||
| 203 | + console.log('Updated README.md generated. Please commit these changes.'); | ||
| 121 | 204 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments