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

Why apm install the packageDependencies to node_module folder? #120

Open

Description

@lijunle

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?

Activity

  1. lijunle commented on Jun 2, 2014

    @lijunle
    ContributorAuthor

    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?

  2. kevinsawicki commented on Jun 2, 2014

    @kevinsawicki
    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.

  3. lijunle commented on Jun 2, 2014

    @lijunle
    ContributorAuthor

    @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)
    ├── [email protected]
    ├── ...
    ├── [email protected]
    
    > 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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions