mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-28 22:40:19 +00:00
* feat: all cjs export * test: fix deno test * style: fix error Expected space or tab before '*/' in comment spaced-comment * fix: deno import map * fix: sneak in a fix for yarn
24 lines
803 B
JavaScript
24 lines
803 B
JavaScript
import fs from 'node:fs'
|
|
|
|
const dirs = ['']
|
|
for await (const dir of dirs) {
|
|
await Promise.all(
|
|
fs.readdirSync(`denoTestsDist${dir}`).map(async (file) => {
|
|
if (!file.endsWith('.js') && !file.endsWith('.map') && !file.endsWith('.ts')) {
|
|
dirs.push(`${dir}/${file}`)
|
|
return
|
|
}
|
|
const content = await fs.promises.readFile(`denoTestsDist${dir}/${file}`, 'utf-8')
|
|
await fs.promises.rm(`denoTestsDist${dir}/${file}`)
|
|
fs.promises.writeFile(
|
|
`denoTestsDist${dir}/${file.slice(-8) === '.spec.js' ? `${file.slice(0, -7)}test.js` : file}`,
|
|
content
|
|
.replace(/src\//g, 'dist/esm/')
|
|
.replace(/\.ts/g, '.js')
|
|
.replace(/describe\.skip/g, 'describe.ignore')
|
|
.replace(/it\.skip/g, 'it.ignore'),
|
|
)
|
|
}),
|
|
)
|
|
}
|