Coder Social home page Coder Social logo

npm's People

Contributors

adamburgess avatar alienriver49 avatar aluanhaddad avatar bbosman avatar cehoffman avatar crisptrutski avatar glen-84 avatar gustav-olsen-groupone avatar guybedford avatar jamessharp avatar jbanety avatar jschultzmn avatar mayerwin avatar meggle avatar mortenhoustonludvigsen avatar seph-m avatar v-jiepeng avatar xemle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

npm's Issues

Statically analyze for globals like `Buffer` to add a require

Example case is - System.import('npm:unexpected').

We'd need a parse tree to check if the Buffer global object is accessed, and if so, to then add an effective require('buffer').

This probably applies to other globals, although I'm unsure of which ones offhand.

Versions 1.004.3 don't work

This is because npm calls the version '1.4.3', but the download link retains the old version format.

Fixing this involves a separate request at download time to check for any of this kind of stuff.

Install `latest` tag as latest

While jspm does version selection, we should still obey npm's latest tag for picking the latest version.

An example is jspm install npm:famous where latest is less than the greatest semver match.

support bower.json

The github endpoint supports finding dependencies in bower.json, but the npm endpoint doesn't. It would be nice if these two endpoints were more in line with each other. Possibly even share a lot of the same base codebase?

This caused this confusion: angular/angular#944

debug.js bug

Hi! I'm trying to install koa.js on node.js 0.12.0 via jspm. But import statement throws an error:

    file:---/jspm_packages/npm/[email protected]/browser.js:12
    storage = window.localStorage;
    ^
    ReferenceError: window is not defined
    at Object.<anonymous> (file:---/jspm_packages/npm/[email protected]/browser.js:12:13)
    at file:---/jspm_packages/npm/[email protected]/browser.js:62:4
    at Object.exports.runInThisContext (vm.js:74:17)
    at doEval (---/node_modules/jspm/node_modules/systemjs/dist/system.src.js:2308:10)
    at __eval (---/node_modules/jspm/node_modules/systemjs/dist/system.src.js:2222:7)
    at Loader.exec [as __exec] (---/node_modules/jspm/node_modules/systemjs/dist/system.src.js:335:5)
    at load.metadata.execute (---/node_modules/jspm/node_modules/systemjs/dist/system.src.js:1159:16)
    at linkDynamicModule (---/node_modules/jspm/node_modules/systemjs/dist/system.src.js:667:32)
    at getModule (---/node_modules/jspm/node_modules/systemjs/dist/system.src.js:636:9)
    at ---/node_modules/jspm/node_modules/systemjs/dist/system.src.js:671:16

I've tracked down this problem to package.json of debug.js module. There is "browser" field(pointing to browser.js file) which AFAIU jspm-npm treats as a replacement for main entry point and hance systemjs tries to load browser-specific code in node environment. I'm very new to jspm and really not sure where this bug report would be more appropriate(or is this even a bug).

Support directory requires

Modules can import a directory by name, which results in the index being loaded from that directory. We should detect these require forms within the local package and convert them into the index reference.

stream module

Fix the stream module which currently doesn't work due to circular references.

Stalling issue

When installing npm:leaflet the build hook seems to stall for some reason.

I've traced this down to this line not returning - https://github.com/jspm/npm/blob/master/npm.js#L318.

This makes me think it is a graceful-fs issue, but it would require isolating the use of graceful-fs through the projects as graceful-fs mutates the fs module.

Support directories.lib in override

If a directories.lib is provided in a jspm property in the package.json or in an override, we should still support it. Just the base-level directories.lib should be ignored.

Cross-package JSON resolutions

To allow JSON loading to work across packages, it could be worth creating a js entry point for JSON files that loads the JSON file with the plugin.

loading superagent

I tried to use superagent as is from npm.
Currently it supports browserify via "browser" tag
But instead of specifying a separate main for browser it has this:

"main": "./lib/node/index.js",
"browser": {
  "./lib/node/index.js": "./lib/client.js",
  "emitter": "component-emitter",
  "reduce": "reduce-component"
}

The jspm generated loader [email protected] file points to './lib/node/index.js', so it doesn't work.
And judging from the installed packages, jspm still takes the dependencies from "dependencies" and doesn't follow "browser".
Is it possible to support packages with these kind of settings?

Currently I fork the project and add jspm dependencies under the "jspm" tag.

Consider trusting deep trace for internal npm dependencies

The hard part about this is modularizing the nodelibs package into fully-separated packages for each node core lib, and conditionally including them in dependencies. May well be possible now if the direct browserify repos can be supported without needing any adjustments.

Provide useful message for jspm-style dependencies

From jspm/jspm-cli#556.

If we install a package here that has a dependencies: { p: 'jspm:p' } or something like that (jspm endpoint style), we should throw a useful descriptive error message from within this npm endpoint so the user knows how to correct their dependencies (as it will break down the line in the install process anyway).

Support for npm registries that require authentication

It would be awesome if this could read the .npmrc config file for authentication options and use them if necessary to authenticate to the registry.

I am trying to configure it for use with a private npm registry that uses the npm options

always-auth=true`
ca=-----BEGIN CERTIFICATE-----...
_auth=<token>

Nodelibs to have lower config / install overhead

Adding crypto makes nodelibs a 10 package install, which can easily be seen as overkill for a simple app, and detracts from the configuration simplicity for model cases, which is important to keep.

Ideally we could detect specific node core libs, and only include them when they are used. Then instead of having a single nodelibs repo, we download the nodelibs repos we need as we need them.

The reason this isn't currently supported is because dependencies are returned from getPackageConfig, which is before download completion, and download dependencies are ignored.

The addition would be to allow the build function to return further dependencies. This is the simplest fix and most sensible one.

Breaking change - stop treating all modules as cjs

As people are moving away from Bower it is becoming more and more common to place browser distribution files into npm.

I disagree with this in principle, but it's happening.

We should run the usual detection process on Node modules, and if that isn't sufficient, manually override in the fixes. I think it will be sufficient for most cases though.

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.