2017-02-03 19:23:29 -05:00
|
|
|
;; -*- no-byte-compile: t; -*-
|
2017-02-03 19:43:25 -05:00
|
|
|
;;; lang/javascript/packages.el
|
2017-01-16 23:30:37 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(package! coffee-mode)
|
|
|
|
(package! js2-mode)
|
|
|
|
(package! js2-refactor)
|
|
|
|
(package! jsx-mode)
|
|
|
|
(package! nodejs-repl)
|
|
|
|
(package! tern)
|
2017-01-16 23:30:37 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(when (featurep! :completion company)
|
|
|
|
(package! company-tern))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2017-03-15 22:45:27 -04:00
|
|
|
(when (featurep! :feature jump)
|
|
|
|
(package! xref-js2))
|
|
|
|
|
2017-03-20 02:45:31 -04:00
|
|
|
;;
|
|
|
|
(def-bootstrap! javascript
|
|
|
|
(unless (cl-every 'executable-find '("node" "npm" "tern"))
|
|
|
|
(pcase (doom-system-os)
|
|
|
|
('arch
|
|
|
|
(let (progs)
|
|
|
|
(unless (executable-find "node") (push "nodejs" progs))
|
|
|
|
(unless (executable-find "npm") (push "npm" progs))
|
|
|
|
(when progs
|
|
|
|
(sudo "pacman --noconfirm -S %s" progs))))
|
|
|
|
('debian) ;; TODO
|
|
|
|
('macos
|
|
|
|
(unless (executable-find "node")
|
|
|
|
(sh "brew install node"))))
|
|
|
|
(unless (executable-find "node")
|
|
|
|
(error "Failed to install NodeJS"))
|
|
|
|
(unless (executable-find "tern")
|
|
|
|
(funcall (if (file-writable-p (executable-find "npm")) 'sh 'sudo)
|
|
|
|
"npm -g install tern"))
|
|
|
|
t))
|