(data, dataPath, name)
| 187 | } |
| 188 | |
| 189 | export function writeFile(data, dataPath, name) { |
| 190 | const stringified = JSON.stringify(data, null, 2) + "\n"; |
| 191 | if (process.env.CHECK_COMPAT_DATA) { |
| 192 | const currentData = fs.readFileSync(dataPath, "utf8"); |
| 193 | |
| 194 | // Compare as JSON strings to also check keys ordering |
| 195 | if (currentData !== stringified) { |
| 196 | console.error( |
| 197 | `The newly generated ${name} data does not match the current files. Re-run \`make build-compat-data\`.` |
| 198 | ); |
| 199 | |
| 200 | return false; |
| 201 | } |
| 202 | } else { |
| 203 | fs.writeFileSync(dataPath, stringified); |
| 204 | } |
| 205 | return true; |
| 206 | } |
| 207 | |
| 208 | export function maybeDefineLegacyPluginAliases(data) { |
| 209 | // We create a new object to inject legacy aliases in the correct |
no outgoing calls
no test coverage detected