Files
vercel/packages/edge/scripts/fix-links.js
Ethan Arrowood 9c768b98b7 [tests] Migrate from yarn to pnpm (#9198)
<picture data-single-emoji=":pnpm:" title=":pnpm:"><img class="emoji" src="https://single-emoji.vercel.app/api/emoji/eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..4mJzrO94AnSn0Pue.4apgaKtTUdQ-wxNyahjdJj28u8bbXreLoTA8AGqYjLta3MrsFvbo9DsQFth4CoIkBgXFhQ5_BVcKNfYbwLg4bKzyIvItKe4OFS8AzG7Kkicz2kUUZk0.nXyK_PvHzZFGA-MQB6XHfA" alt=":pnpm:" width="20" height="auto" align="absmiddle"></picture> 

yarn has become increasingly more difficult to use as the v1 we rely on no longer receives updates. pnpm is faster and is actively maintained. 

This PR migrates us to pnpm.
2023-01-11 23:35:13 +00:00

25 lines
768 B
JavaScript

// this step is necessary until https://github.com/TypeStrong/typedoc/issues/2140 is fixed
const fs = require('fs');
const path = require('path');
const docs = path.join(__dirname, '..', 'docs');
const interfaces = path.join(docs, 'interfaces');
for (const dir of [docs, interfaces]) {
for (const entity of fs.readdirSync(dir)) {
try {
const entityPath = path.join(dir, entity);
const stat = fs.statSync(entityPath);
if (stat.isFile()) {
const contents = fs.readFileSync(entityPath, 'utf-8');
const pattern = /node_modules\/\.pnpm\/typescript@\d*\.\d*\.\d*\//gi;
fs.writeFileSync(entityPath, contents.replace(pattern, ''));
}
} catch (e) {
console.error('Error fixing links in docs', e);
}
}
}