1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-28 17:02:01 +03:00

Add CI to protect against mixing src and lib imports (#2704)

This commit is contained in:
Michael Telatynski
2022-09-30 09:05:28 +01:00
committed by GitHub
parent f398e3564d
commit f349663329
13 changed files with 170 additions and 14 deletions

View File

@ -0,0 +1,17 @@
#!/usr/bin/env node
const fsProm = require('fs/promises');
const PKGJSON = 'package.json';
async function main() {
const pkgJson = JSON.parse(await fsProm.readFile(PKGJSON, 'utf8'));
for (const field of ['main', 'typings']) {
if (pkgJson["matrix_lib_"+field] !== undefined) {
pkgJson[field] = pkgJson["matrix_lib_"+field];
}
}
await fsProm.writeFile(PKGJSON, JSON.stringify(pkgJson, null, 2));
}
main();