install-deps.js 810 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env node
  2. const sh = require('shelljs')
  3. const path = require('path')
  4. const vars = require('./vars')
  5. const log = require('npmlog')
  6. const localBinPath = path.resolve(__dirname, '../node_modules/.bin')
  7. const npx = `${localBinPath}/npx`
  8. log.info('patch')
  9. sh.exec(`${npx} patch-package`)
  10. log.info('deps', 'app')
  11. sh.cd('app')
  12. sh.exec(`${npx} yarn install --force`)
  13. sh.cd('..')
  14. sh.cd('web')
  15. sh.exec(`${npx} yarn install --force`)
  16. sh.exec(`${npx} patch-package`)
  17. sh.cd('..')
  18. vars.allPackages.forEach(plugin => {
  19. log.info('deps', plugin)
  20. sh.cd(plugin)
  21. sh.exec(`${npx} yarn install --force`)
  22. sh.cd('..')
  23. })
  24. if (['darwin', 'linux'].includes(process.platform)) {
  25. sh.cd('node_modules')
  26. for (let x of vars.builtinPlugins) {
  27. sh.ln('-fs', '../' + x, x)
  28. }
  29. sh.cd('..')
  30. }