These are chat archives for systemjs/systemjs

4th
Feb 2015
Veaceslav Cotruta
@katrotz
Feb 04 2015 08:37
@guybedford I was actually installing the auth0-lock library from github
jspm install github:auth0/lock
Actually it is a dead end. Even if I did path rewrites to be able to load CJS index.js when relative directory is required, I am failing as auth0 lock requires nodeJS dependencies, for eg. fs.
I have submitted a feature request on their github repo to think of ES6 compatibility.
Guy Bedford
@guybedford
Feb 04 2015 10:05
@katrotz jspm install npm:auto0-lock does a conversion process where it supports all the Node browserify libraries, directory requires etc etc
as mentioned, there is a specific issue here in that the dependency chain contains a git commit reference in it, but happy to help you work through that if you need, as it is completely fixable through an override
@petr-k SystemJS uses Traceur or 6to5 when it loads ES6 sources directly
that is when the metadata on a load indicates it is an ES6 source (System.meta['my/module'] = { format: 'es6' })
otherwise if no format meta is present, SystemJS will run regex detection to see if it is an ES6 module
Veaceslav Cotruta
@katrotz
Feb 04 2015 11:11
@guybedford oh, didn't know of that feature :D, thanks, will try to debug the problem, 10x a lot
Guy Bedford
@guybedford
Feb 04 2015 12:16
@katrotz, @volak was wanting to use auth0, so we added an override in the jspm registry
if you try jspm install npm:auth0-lock it should be working now I believe, but haven't tested it too deply myself... let me know
Charles Solar
@volak
Feb 04 2015 15:57
@katrotz Yeah I was able to get auth0 lock downloaded via jspm using jspm install npm:auth0-lock with the override
I can help get you going too - spent like 8 hours disecting
Besides the override, you'll also need to add these paths "npm:*.ejs": "jspm_packages/npm/*.ejs", "npm:*.version": "jspm_packages/npm/*.version",
because auth0lock does require('main.ejs') and such in a lot of places, without the paths jspm will try to resolve main.ejs.js
Veaceslav Cotruta
@katrotz
Feb 04 2015 18:06
@volak .ejs && package.version is the exact problem I am currently trying to solve and run out of ideas. I would appreciate a lot if you could send a gist with an example of your jspm config file with the overrides
Charles Solar
@volak
Feb 04 2015 18:09
My current paths:
System.config({
  "paths": {
    "*": "*.js",
    "~/*": "app/*.js",
    "github:*": "jspm_packages/github/*.js",
    "npm:*": "jspm_packages/npm/*.js",
    "npm:*.ejs": "jspm_packages/npm/*.ejs",
    "npm:*.version": "jspm_packages/npm/*.version",
    "local:*": "jspm_packages/local/*.js"
  }
});
I still havn't gotten the require("package.version") line working
Im thinking it must be some weird cjs thing, no idea why its not require('./package.version')
Guy Bedford
@guybedford
Feb 04 2015 19:17

@volak for that require you can use the package.json map -

{
  "map": {
    "package.version": "./path/to/package.version"
  }
}

It's supported in overrides

Veaceslav Cotruta
@katrotz
Feb 04 2015 20:23
@guybedford This is how I see the problem: the require('package.version') is not an actual CJS require, but kind of a flag that gets processed by a browserify transform called packageify during the bundling
I'll just add the auth-lock outside SystemJS
Guy Bedford
@guybedford
Feb 04 2015 20:45
@katrotz sure, for next time, to ignore it, you can map it to the empty module:
{
  "map": {
    "package.version": "@empty"
  }
}
Charles Solar
@volak
Feb 04 2015 22:25
@guybedford I think I can make the auth0 github version work, since the github repo has a build directory. Can I map a specific js file in a library? Something like
"auth0-lock": "github:auth0/lock@7.1.1/build/auth0-lock.js"
yes - it works, but now I get Uncaught TypeError: Multiple defines for anonymous module
Charles Solar
@volak
Feb 04 2015 22:30
aha - need to create an override :)