Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Why apm install the packageDependencies to node_module folder? #120

Open
lijunle opened this issue May 31, 2014 · 3 comments
Open

Why apm install the packageDependencies to node_module folder? #120

lijunle opened this issue May 31, 2014 · 3 comments

Comments

@lijunle
Copy link
Contributor

lijunle commented May 31, 2014

The apm install says:

if no package name is given then all the dependencies in the package.json file are installed to the node_modules folder in the current working directory.

Why this is by design?

I am writing some specs for an atom package, which is dependent on another package. So, I write the dependent package's name on the packageDependencies list, then use the Travis CI config provided by Atom/CI to run the specs.

After push the commit, Travis said:

The dependent package is installed successfully
Bla bla bla...
Start to run spec...
Cannot resolve the path of the dependent package
Failed! :(

The failure message confused me, and after investigation, I find this is a design issue. So, why does apm install install packageDependencies to node_module folder instead of ~/.atom/package folder?

@lijunle
Copy link
Contributor Author

lijunle commented Jun 2, 2014

ping the author @kevinsawicki

I check the commit history, the help comment is added first, then the packageDependencies options is supported later. So, does this consider as a bug?

@kevinsawicki
Copy link
Contributor

packageDependencies is currently only intended to be supported in the atom/atom repository which uses it, it isn't designed to be used by packages yet.

I would consider this an enhancement to support package to package dependencies using this property.

@lijunle
Copy link
Contributor Author

lijunle commented Jun 2, 2014

@kevinsawicki Oh, following your clue. I find one bigger issue.

The atom main package is using packageDependencies to install packages. Those packages are installed inside atom folder (<atom>/resources/app/node_modules), list as built-in packages in apm list.

Other personal installed packages are under ~/.atom/packages or ~/.atom/dev/packages (dev mode).

All built-in packages cannot be uninstall from apm uninstall, although I get a ✓ from console

> apm uninstall welcome
Uninstalling welcome ✓

> apm list
Built-in Atom packages (74)
├── archive-view@0.31.0
├── ...
├── welcome@0.14.0

> apm help uninstall

Usage: apm uninstall <package_name>...

Delete the installed package(s) from the ~/.atom/packages directory.

Options:
  --help, -h  Print this usage message
  --dev, -d   Uninstall from ~/.atom/dev/packages                       [boolean]
  --hard      Uninstall from ~/.atom/packages and ~/.atom/dev/packages  [boolean]

I think this is violating the notion of hackable editor, those built-in packages are like the embedded packages, they are not hackable. :(

In my opinion, it is better to distinguish as global packages and personal packages, Just like what npm does, global packages and project packages. Then, a user should have the ability to install/uninstall/hack the global (built-in) package. The packageDependencies field should be treat as the same for the global and personal package.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants