build
build copied to clipboard
remove `import { tmpName } from 'tmp-promise'` dependency
This dependency is not needed for creating a temp directory as node can do that:
import { tmpName } from 'tmp-promise'
const path = await tmpName({ template: 'netlify-test-socket-XXXXXX' })
can be converted to:
import { promises as fs } from 'fs'
import { tmpdir } from 'os'
import { join } from 'path'
const path = await fs.mkdtemp(join(tmpdir(), 'netlify-test-socket-'))
@lukasholzer tmpName
just generates a random file name using some random chars (and checks if they don't already exist) while fs.mkdtemp
actually creates the directory. Should we be changing the behaviour here from just creating a valid temp dir name to actually creating the directory?
Yea this is combined. We never just create a name without creating the dir. So we should replacing that + creating the dir with fs.mkdtemp
may i work on it
may i work on it
Sure. Go ahead @muditgaur-1009. Let me know if you come across any issues while setting things up.
@tinfoil-knight please review i have made the changes
As this dependency is only used in tests I would prefer to keep it. It has a bunch of convenient functions.
I noticed though that @netlify/build
has it listed under dependencies, which is wrong as it is only used in tests. https://github.com/netlify/build/pull/5064
This issue has been automatically marked as stale because it has not had activity in 1 year. It will be closed in 14 days if no further activity occurs. Thanks!
This issue was closed because it had no activity for over 1 year.