nativescript-nodeify icon indicating copy to clipboard operation
nativescript-nodeify copied to clipboard

Support scoped packages

Open gnarula opened this issue 7 years ago • 1 comments

Thanks for making this awesome plugin! While trying to use it I ran into an issue where I found scoped packages are being ignored https://github.com/EddyVerbruggen/nativescript-nodeify/blob/master/patch-npm-packages.js#L213

I'm sure there must be a reason behind it. Is there a way to override that and maybe whitelist some scoped packages?

gnarula avatar Feb 21 '18 19:02 gnarula

Just ran into the same issue today...

Had to work around it by putting a postinstall script that does

const fs = require('fs')

const toRemove = '&& !folderName.startsWith("@")'

const filePath = require.resolve('nativescript-nodeify/patch-npm-packages')

const initialScript = fs.readFileSync(filePath, 'utf8')

const repairedScript = initialScript.replace(toRemove, '')

if (initialScript === repairedScript) console.log('Nothing to patch.')
else console.log('Patched `patch-npm-packages.js` successfully')

fs.writeFileSync(filePath, repairedScript, 'utf8')

This is more than ugly, and I'd love to get rid of it.

arantes555 avatar Aug 12 '18 17:08 arantes555