Git Product home page Git Product logo

Comments (5)

mcolyer avatar mcolyer commented on July 26, 2024

So I dug into what it would take to install our atom npm packages into atom_modules and our system npm packages into node_modules.

  • We would need to modify npm to allow installing to a custom global directory.
  • We would then need to modify apm to install globally (to atom_modules) when installing packages and dependencies used within atom and locally when installing dependencies that should be used when using grunt/apm. As part of this step we would most likely need to modify atom's package.json such that devDependencies and dependencies only included the modules that would be used by the system npm.
  • We would need to modify atom-shell on windows and on osx to set NODE_PATH to atom_modules before node is loaded within atom-shell.

However after outlining those steps, I wonder if we could do something clever where we create shims for node and npm after doing the initial bootstrap.

node

#!/bin/bash
ATOM_BIN=`dirname "${BASH_SOURCE[0]}"`/../atom-shell/Atom.app/Contents/MacOS/Atom
ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 $ATOM_BIN "$@"

npm

#!/bin/sh
NPM_BIN=`dirname "${BASH_SOURCE[0]}"`/../node_modules/atom-package-manager/node_modules/.bin/npm
$NPM_BIN

And then we tell people to export PATH=./bin/:$PATH so that if they execute node (or anything that uses node) from atom's root that it will use our node instead of the system node? I'd prefer this approach, thoughts?

from apm.

kevinsawicki avatar kevinsawicki commented on July 26, 2024

What about putting apm and grunt dependencies in their old own folders with their own node_modules folder in there?

So build/node_modules would be where all the grunt dependencies go and apm/node_modules would be where all the apm dependencies go. We could add grunt.sh and apm.sh at the root of the atom repo so the commands could still be run from there and they would just shim to the build/node_modules/.bin/grunt and apm/node_modules/atom-package-manager/.bin/apm.

That leaves the root node_modules for just package dependencies and module dependencies that actually need to ship with atom.

We could move the grunt dependencies perhaps into buid/package.json to segregate.

Just an initial idea, still not 100% clear on if it would work but could be worth a spike.

from apm.

probablycorey avatar probablycorey commented on July 26, 2024

Would any of this be necessary if we this worked?

from apm.

mcolyer avatar mcolyer commented on July 26, 2024

It's more about fixing this atom/atom#1067, I guess I should have put my comment there.

from apm.

kevinsawicki avatar kevinsawicki commented on July 26, 2024

apm now has a login command, closing this out.

from apm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.