jspm-cli: Nested dependencies not getting mapped to `config.js`

ModuleA has roughly 20 dependencies defined within the jspm section of its package.json. ModuleB wants to use ModuleA. Using jspm install ModuleA=github:timbur/ModuleA, ModuleB’s config.js doesn’t get updated with the proper map configuration so that ModuleB’s System will know where to find ModuleA’s dependencies. I’ve tried everything I could think of, other than starting completely from scratch.

I also tried reproducing the issue (see timbur/systemjs-test-c) but that one works correctly.

ModuleA in the above description is actually loggur/web-tedit.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 41 (15 by maintainers)

Most upvoted comments

@guybedford The overrides work, but I feel like the issues I experienced could be avoided if jspm defaulted to npm if no jspm-style dependencies are found within the package.json (and no registry provided of course). I think something along these lines would work:

if (_pjson.registry === undefined && !_pjson.jspm && !hasJspmDep(_pjson.dependencies) && !hasJspmDep(_pjson.devDependencies)) {
  self.jspmPrefix = false;
  _pjson.registry = 'npm';
}

var jspmTest = /^.+:.+@.+$/;
function hasJspmDep (deps) {
  for (var key in deps) {
    if (jspmTest.test(deps[key])) {
      return true;
    }
  }
  return false;
}

It would also avoid having to use a ton of overrides like I’m doing here:

    "overrides": {
      "github:ajaxorg/ace-builds@1.1.9": {
        "directories": {
          "lib": "src-min-noconflict"
        }
      },
      "github:loggur/bodec@master": {
        "registry": "npm"
      },
      "github:creationix/carallel@master": {
        "registry": "npm"
      },
      "github:loggur/dombuilder@master": {
        "registry": "npm"
      },
      "github:creationix/gen-run@0.1.2": {
        "registry": "npm"
      },
      "github:creationix/git-sha1@0.1.2": {
        "registry": "npm"
      },
      "github:loggur/git-tree@master": {
        "registry": "npm"
      },
      "github:loggur/jon-parse@master": {
        "registry": "npm"
      },
      "github:loggur/js-git@master": {
        "registry": "npm"
      },
      "github:loggur/js-github@master": {
        "registry": "npm"
      },
      "github:creationix/mine@0.1.0": {
        "registry": "npm"
      },
      "github:nodeca/pako@0.2.7": {
        "registry": "npm"
      },
      "github:creationix/pathjoin@0.1.0": {
        "registry": "npm"
      },
      "github:reworkcss/css@2.2.0": {
        "registry": "npm"
      },
      "github:loggur/systemjs-reload@master": {
        "registry": "npm"
      },
      "github:creationix/tedit-regenerator@master": {
        "registry": "npm"
      }
    }