├── .gitignore ├── .npmignore ├── README.md ├── config-builder.iml ├── dist ├── cli.js ├── index.js ├── next.js └── repl.js ├── example ├── README.md ├── app.js ├── index.html └── package.json ├── generated.config.js ├── lib ├── cli.js ├── index.js ├── next.js └── repl.js ├── package.json ├── test ├── babel │ ├── app.js │ ├── config.js │ ├── generated.config.js │ ├── index.html │ ├── package.json │ └── yarn.lock ├── pure │ ├── app.js │ ├── generated.config.js │ ├── index.html │ ├── package.json │ └── yarn.lock └── typescript │ ├── app.ts │ ├── config.js │ ├── generated.config.js │ ├── index.html │ ├── package.json │ ├── tsconfig.json │ └── yarn.lock └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | systemjs.cache 2 | tags 3 | 4 | 5 | # Created by .ignore support plugin (hsz.mobi) 6 | ### Node template 7 | # Logs 8 | logs 9 | *.log 10 | npm-debug.log* 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | 17 | # Directory for instrumented libs generated by jscoverage/JSCover 18 | lib-cov 19 | 20 | # Coverage directory used by tools like istanbul 21 | coverage 22 | 23 | # nyc test coverage 24 | .nyc_output 25 | 26 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 27 | .grunt 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules 37 | jspm_packages 38 | 39 | # Optional npm cache directory 40 | .npm 41 | 42 | # Optional REPL history 43 | .node_repl_history 44 | ### JetBrains template 45 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 46 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 47 | 48 | # User-specific stuff: 49 | .idea/workspace.xml 50 | .idea/tasks.xml 51 | .idea/dictionaries 52 | .idea/vcs.xml 53 | .idea/jsLibraryMappings.xml 54 | 55 | # Sensitive or high-churn files: 56 | .idea/dataSources.ids 57 | .idea/dataSources.xml 58 | .idea/dataSources.local.xml 59 | .idea/sqlDataSources.xml 60 | .idea/dynamic.xml 61 | .idea/uiDesigner.xml 62 | 63 | # Gradle: 64 | .idea/gradle.xml 65 | .idea/libraries 66 | 67 | # Mongo Explorer plugin: 68 | .idea/mongoSettings.xml 69 | 70 | ## File-based project format: 71 | *.iws 72 | 73 | ## Plugin-specific files: 74 | 75 | # IntelliJ 76 | /out/ 77 | 78 | # mpeltonen/sbt-idea plugin 79 | .idea_modules/ 80 | 81 | # JIRA plugin 82 | atlassian-ide-plugin.xml 83 | 84 | # Crashlytics plugin (for Android Studio and IntelliJ) 85 | com_crashlytics_export_strings.xml 86 | crashlytics.properties 87 | crashlytics-build.properties 88 | fabric.properties 89 | 90 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | test -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SystemJS Config Builder 2 | Generate SystemJS config files from node_modules 3 | 4 | ## Overview 5 | The easiest way to include modules in SystemJS is *currently* through JSPM. This project aims to provide an alternative, by leveraging the deterministic installs of Yarn (also works with npm) and generating config files to explain to SystemJS how to resolve modules from `node_modules`. 6 | 7 | ## Roadmap 8 | 9 | - [x] Trace node_modules and build registry 10 | - [x] Generage compatability configs for packages 11 | - [x] Generate valid SystemJS config file 12 | - [x] Make sure loading React.JS works 13 | - [x] Cache registry (to speed up subsequent generations) 14 | - [x] Use own @node polyfills. See [#1](https://github.com/alexisvincent/systemjs-config-builder/issues/1) for progress 15 | - [x] Respect `jspmPackage: true` 16 | - [x] Perform path optimisations (nm: -> node_modules), for smaller configs 17 | - [ ] Fully support npm resolve algorithym (upper node_module and single dep node_modules) 18 | - [ ] Allow simple local overrides 19 | - [ ] Use JSPM overrides 20 | - [ ] Allow dependency filtering (so we don't include deps meant for just the server) 21 | - [ ] Provide CLI flag to optimize generated.config.js 22 | - [ ] Allow configurability 23 | - [ ] Make more robust 24 | 25 | Currently, given this [package.json](./test/babel/package.json), 26 | SystemJS Config Builder generates this [config](./test/babel/generated.config.js). 27 | 28 | 29 | ## Usage 30 | ### [Example Project (with usage instructions)](./example) 31 | You can test the generation via the cli in [systemjs-tools](https://github.com/alexisvincent/systemjs-tools). 32 | 33 | `yarn global add systemjs-tools` 34 | 35 | add SystemJS @node browser polyfills 36 | 37 | `yarn add systemjs-nodelibs` 38 | 39 | and generate the config 40 | 41 | `systemjs config` 42 | 43 | optionally you can also add a postinstall hook to do this automatically 44 | 45 | package.json 46 | ```json 47 | { 48 | "scripts": { 49 | "postinstall": "systemjs config" 50 | } 51 | } 52 | ``` 53 | 54 | ## Thanks 55 | Thanks to [Juha Järvi](https://github.com/jjrv) for helping me flesh out this idea and for the discussions regarding 56 | his awesome [cbuild project](https://github.com/charto/cbuild). 57 | -------------------------------------------------------------------------------- /config-builder.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /dist/cli.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var _index = require('./index'); 4 | 5 | var _util = require('util'); 6 | 7 | var fs = require('graceful-fs'); 8 | var path = require('path'); 9 | var Promise = require('bluebird'); 10 | 11 | var pfs = {}; 12 | 13 | /** 14 | * Promisify all fs functions 15 | */ 16 | Object.keys(fs).map(function (key) { 17 | if (typeof fs[key] == 'function') pfs[key] = Promise.promisify(fs[key]); 18 | }); 19 | 20 | var log = function log(obj) { 21 | console.log((0, _util.inspect)(obj, { depth: null })); 22 | return obj; 23 | }; 24 | 25 | (0, _index.traceModuleTree)('.').then(_index.fromCache).then(_index.augmentModuleTree).then(_index.toCache).then(_index.pruneModuleTree).then(_index.generateConfig) 26 | // .then(log) 27 | .then(_index.serializeConfig).then(pfs.writeFile.bind(null, './generated.config.js')); -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | /** 7 | * Copyright 2016 Alexis Vincent (http://alexisvincent.io) 8 | */ 9 | var fs = require('graceful-fs'); 10 | var path = require('path').posix; 11 | var Promise = require('bluebird'); 12 | var _ = require('lodash'); 13 | 14 | var _require = require('jspm-npm/lib/node-conversion'), 15 | convertPackage = _require.convertPackage; 16 | 17 | var _require2 = require('util'), 18 | inspect = _require2.inspect; 19 | 20 | var nodeCoreModules = exports.nodeCoreModules = ['assert', 'buffer', 'child_process', 'cluster', 'console', 'constants', 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'module', 'net', 'os', 'path', 'process', 'punycode', 'querystring', 'readline', 'repl', 'stream', 'string_decoder', 'sys', 'timers', 'tls', 'tty', 'url', 'util', 'vm', 'zlib']; 21 | 22 | var pfs = {}; 23 | 24 | /** 25 | * Promisify all fs functions 26 | */ 27 | Object.keys(fs).map(function (key) { 28 | if (typeof fs[key] == 'function') pfs[key] = Promise.promisify(fs[key]); 29 | }); 30 | 31 | var log = function log(obj) { 32 | return console.log(inspect(obj, { depth: null })); 33 | }; 34 | 35 | /** 36 | * Get all directories in a directory 37 | * @param srcpath 38 | * @returns {Promise.<*>} 39 | */ 40 | var getDirectories = function getDirectories(srcpath) { 41 | return pfs.readdir(srcpath).then(function (dirs) { 42 | return dirs.filter(function (file) { 43 | return fs.statSync(path.join(srcpath, file)).isDirectory(); 44 | }); 45 | }).then(function (dirs) { 46 | return Promise.all(dirs.map(function (dir) { 47 | if (dir.startsWith('@')) { 48 | return getDirectories(path.join(srcpath, dir)).then(function (subdirs) { 49 | return subdirs.map(function (subdir) { 50 | return path.join(dir, subdir); 51 | }); 52 | }); 53 | } else { 54 | return dir; 55 | } 56 | })); 57 | }).then(function (dirs) { 58 | // Flatten array in case there are scoped packages that produce a nested array 59 | return [].concat.apply([], dirs); 60 | }); 61 | }; 62 | 63 | /** 64 | * For a given dir, get the corresponding package.json 65 | * @param dir 66 | * @returns {Promise.} 67 | */ 68 | var getPackageConfig = exports.getPackageConfig = function getPackageConfig(dir) { 69 | return pfs.readFile(path.join(dir, 'package.json'), 'utf8').then(JSON.parse) 70 | // Pad it with defaults 71 | .then(function (config) { 72 | return Object.assign({ 73 | dependencies: {}, 74 | devDependencies: {}, 75 | peerDependencies: {}, 76 | augmented: false 77 | }, config); 78 | }).catch(function () { 79 | return null; 80 | }); 81 | }; 82 | 83 | /** 84 | * Return the dependencies that live in the first level of node_modules 85 | * @param packageDir 86 | * @returns {Promise.} 87 | */ 88 | var getOwnDeps = exports.getOwnDeps = function getOwnDeps(packageDir) { 89 | var node_modules = path.join(packageDir, 'node_modules'); 90 | 91 | return pfs.access(node_modules).then(function () { 92 | return getDirectories(node_modules); 93 | }) 94 | // Map directories to their package.json 95 | .then(function (dirs) { 96 | return Promise.all(dirs.map(function (dir) { 97 | return getPackageConfig(path.join(packageDir, 'node_modules', dir)); 98 | })); 99 | }) 100 | // Filter out anything that wasn't a package 101 | .then(function (configs) { 102 | return configs.filter(function (v, k) { 103 | return v; 104 | }); 105 | }).catch(function (err) { 106 | // console.log(err) 107 | return []; 108 | }); 109 | }; 110 | 111 | /** 112 | * Trace the full node_modules tree, and build up a registry on the way. 113 | * 114 | * Registry is of the form: 115 | * { 116 | * 'lodash@1.1.2': { 117 | * name: 'lodash', 118 | * config: , 119 | * key: 'lodash@1.1.2', 120 | * location: 'node_modules/lodash' 121 | * }, 122 | * ... 123 | * } 124 | * 125 | * Returned Tree is of the form: 126 | * [ 127 | * { 128 | * name: 'react', 129 | * version: '15.4.1', 130 | * deps: 131 | * }, 132 | * ... 133 | * ] 134 | * 135 | * 136 | * @param directory 137 | * @param name 138 | * @param version 139 | * @param registry 140 | * @returns {Promise.<{tree: *, registry: Array}>} 141 | */ 142 | var traceModuleTree = exports.traceModuleTree = function traceModuleTree(directory) { 143 | var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 144 | var version = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 145 | var registry = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; 146 | 147 | 148 | return Promise.resolve({ name: name, version: version }) 149 | // Resolve the package.json and set name and version from there if either is not specified 150 | .then(function (_ref) { 151 | var name = _ref.name, 152 | version = _ref.version; 153 | return !name || !version ? getPackageConfig(directory) : { name: name, version: version }; 154 | }).then(function (_ref2) { 155 | var name = _ref2.name, 156 | version = _ref2.version; 157 | return ( 158 | 159 | // Get the dependencies in node_modules 160 | getOwnDeps(directory) 161 | 162 | // Merge package { name@version : package.json } into the registry 163 | .then(function (ownDeps) { 164 | // console.log(ownDeps) 165 | ownDeps.forEach(function (dep) { 166 | var versionName = dep.name + '@' + dep.version; 167 | registry[versionName] = { 168 | name: dep.name, 169 | config: dep, 170 | key: versionName, 171 | location: path.join(directory, 'node_modules', dep.name) 172 | }; 173 | }); 174 | 175 | return ownDeps; 176 | }).then(function (ownDeps) { 177 | // map each package.json to it's own tree 178 | return Promise.all(ownDeps.map(function (_ref3) { 179 | var name = _ref3.name, 180 | version = _ref3.version; 181 | 182 | return traceModuleTree(path.join(directory, 'node_modules', name), name, version, registry) 183 | // Drop the registry 184 | .then(function (_ref4) { 185 | var tree = _ref4.tree, 186 | registry = _ref4.registry; 187 | return tree; 188 | }); 189 | // map the module and its dep list to a tree entry 190 | })).then(function (deps) { 191 | return { name: name, deps: deps, version: version }; 192 | }); 193 | }).then(function (tree) { 194 | return { tree: tree, registry: registry }; 195 | }) 196 | ); 197 | }); 198 | }; 199 | 200 | /** 201 | * Take an array of objects and turn it into an object with the key being the specified key. 202 | * 203 | * objectify('name', [ 204 | * {name: 'Alexis', surname: 'Vincent'}, 205 | * {name: 'Julien', surname: 'Vincent'} 206 | * ]) 207 | * 208 | * => 209 | * 210 | * { 211 | * 'Alexis': {name: 'Alexis', surname: 'Vincent'}, 212 | * 'Julien': {name: 'Julien', surname: 'Vincent'}, 213 | * } 214 | * 215 | * @param key 216 | * @param array 217 | * @returns {*} 218 | */ 219 | var objectify = function objectify(key, array) { 220 | return array.reduce(function (obj, arrayItem) { 221 | obj[arrayItem[key]] = arrayItem; 222 | return obj; 223 | }, {}); 224 | }; 225 | 226 | /** 227 | * Given a registry of package.json files, use jspm/npm to augment them to be SystemJS compatible 228 | * @param registry 229 | * @returns {Promise.} 230 | */ 231 | var augmentRegistry = exports.augmentRegistry = function augmentRegistry(registry) { 232 | return Promise.all(Object.keys(registry).map(function (key) { 233 | var depMap = registry[key]; 234 | 235 | // Don't augment things that already have been (from the cache) 236 | var shouldAugment = !depMap.augmented; 237 | 238 | // Don't augment things that specify config.jspmPackage 239 | if (depMap.config.jspmPackage != undefined && depMap.config.jspmPackage) shouldAugment = false; 240 | 241 | // Don't augment things that specify config.jspmNodeConversion == false 242 | if (depMap.config.jspmNodeConversion !== undefined && !depMap.config.jspmNodeConversion) shouldAugment = false; 243 | 244 | // Don't augment things that specify config.jspm.jspmNodeConversion == false 245 | if (depMap.config.jspm !== undefined && depMap.config.jspm.jspmNodeConversion !== undefined && !depMap.config.jspm.jspmNodeConversion) shouldAugment = false; 246 | 247 | // Augment the package.json 248 | return shouldAugment ? convertPackage(depMap.config, ':' + key, './' + depMap.location, console).then(function (config) { 249 | return Object.assign(depMap, { config: config, augmented: true }); 250 | }).catch(log) : depMap; 251 | })).then(objectify.bind(null, 'key')); 252 | }; 253 | 254 | /** 255 | * Convenience method to allow easy chaining 256 | * @param tree 257 | * @param registry 258 | */ 259 | var augmentModuleTree = exports.augmentModuleTree = function augmentModuleTree(_ref5) { 260 | var tree = _ref5.tree, 261 | registry = _ref5.registry; 262 | return augmentRegistry(registry).then(function (registry) { 263 | return { tree: tree, registry: registry }; 264 | }); 265 | }; 266 | 267 | /** 268 | * Only keep keys we are interested in for package config generation 269 | * @param registry 270 | * @returns {Promise.<*>} 271 | */ 272 | var pruneRegistry = exports.pruneRegistry = function pruneRegistry(registry) { 273 | return Promise.resolve(objectify('key', Object.keys(registry).map(function (key) { 274 | return Object.assign({}, registry[key], { 275 | config: _.pick(registry[key].config, ['meta', 'map', 'main', 'format', 'defaultExtension', 'defaultJSExtensions']) 276 | }); 277 | }))); 278 | }; 279 | 280 | /** 281 | * Convenience method to allow easy chaining 282 | * @param tree 283 | * @param registry 284 | */ 285 | var pruneModuleTree = exports.pruneModuleTree = function pruneModuleTree(_ref6) { 286 | var tree = _ref6.tree, 287 | registry = _ref6.registry; 288 | return pruneRegistry(registry).then(function (registry) { 289 | return { tree: tree, registry: registry }; 290 | }); 291 | }; 292 | 293 | /** 294 | * Walk the tree, call f on all nodes. 295 | * @param tree 296 | * @param registry 297 | * @param f - (versionName, deps, tree) 298 | * @param depth - How deep should we go 299 | * @param skip - How many levels should we skip 300 | */ 301 | var walkTree = exports.walkTree = function walkTree(_ref7, f) { 302 | var tree = _ref7.tree, 303 | registry = _ref7.registry; 304 | var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; 305 | var skip = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; 306 | 307 | if (depth >= 1) { 308 | var name = tree.name, 309 | deps = tree.deps, 310 | version = tree.version; 311 | 312 | 313 | if (skip <= 0) f(registry[name + '@' + version], deps, tree); 314 | 315 | if (depth >= 2) deps.forEach(function (tree) { 316 | return walkTree({ tree: tree, registry: registry }, f, depth - 1, skip - 1); 317 | }); 318 | } 319 | }; 320 | 321 | /** 322 | * Use the tree and registry to create a SystemJS config 323 | * 324 | * TODO: Use SystemJS 20 normalize idempotency to optimize mappings 325 | * // Do this by mapping package@version to location like JSPM does 326 | * 327 | * @param tree 328 | * @param registry 329 | * @returns {Promise.<{map: {}, packages: {}}>} 330 | */ 331 | var generateConfig = exports.generateConfig = function generateConfig(_ref8) { 332 | var tree = _ref8.tree, 333 | registry = _ref8.registry; 334 | 335 | 336 | var systemConfig = { 337 | "map": {}, 338 | "packages": {} 339 | }; 340 | 341 | // get readable stream working 342 | // TODO: Fix this hack 343 | systemConfig['map']["_stream_transform"] = "node_modules/readable-stream/transform"; 344 | 345 | // Walk first level of dependencies and map package name to location 346 | walkTree({ tree: tree, registry: registry }, function (_ref9, deps) { 347 | var name = _ref9.name, 348 | config = _ref9.config, 349 | key = _ref9.key, 350 | location = _ref9.location; 351 | 352 | systemConfig['map'][name] = location; 353 | }, 2, 1); 354 | 355 | // Walk full dep tree and assign package config entries 356 | walkTree({ tree: tree, registry: registry }, function (_ref10, deps, tree) { 357 | var name = _ref10.name, 358 | config = _ref10.config, 359 | key = _ref10.key, 360 | location = _ref10.location; 361 | 362 | 363 | // Construct package entry based off config 364 | var packageEntry = Object.assign({ 365 | map: {}, 366 | meta: {} 367 | }, config); 368 | 369 | // Add mappings for it's deps. 370 | walkTree({ tree: tree, registry: registry }, function (_ref11, deps) { 371 | var name = _ref11.name, 372 | config = _ref11.config, 373 | key = _ref11.key, 374 | location = _ref11.location; 375 | 376 | packageEntry['map'][name] = location; 377 | }, 2, 1); 378 | 379 | // If there are no mappings, don't pollute the config 380 | if (Object.keys(packageEntry['map']).length == 0) delete packageEntry['map']; 381 | 382 | // Assign package entry to config 383 | systemConfig['packages'][location] = packageEntry; 384 | 385 | // Add mappings for all jspm-nodelibs 386 | // TODO: Fix this hack 387 | nodeCoreModules.forEach(function (lib) { 388 | systemConfig['map'][lib] = "node_modules/jspm-nodelibs-" + lib; 389 | }); 390 | }, Infinity, 1); 391 | 392 | // TODO: Make the mappings here more universal 393 | // map nm: -> node_modules/ to make config smaller 394 | systemConfig['paths'] = { 395 | 'nm:': 'node_modules/' 396 | }; 397 | 398 | // map nm: -> node_modules/ to make config smaller 399 | Object.keys(systemConfig['map']).forEach(function (key) { 400 | systemConfig['map'][key] = systemConfig['map'][key].replace(/^node_modules\//, 'nm:'); 401 | }); 402 | 403 | // map nm: -> node_modules/ to make config smaller 404 | Object.keys(systemConfig['packages']).forEach(function (key) { 405 | if (key.startsWith('node_modules/')) { 406 | systemConfig['packages'][key.replace(/^node_modules\//, 'nm:')] = systemConfig['packages'][key]; 407 | delete systemConfig['packages'][key]; 408 | } 409 | }); 410 | 411 | return Promise.resolve(systemConfig); 412 | }; 413 | 414 | // TODO: This needs to be done better (fails if locations of shit changes) 415 | var mergeCache = exports.mergeCache = function mergeCache(registry, cachedRegistry) { 416 | return Object.assign({}, registry, cachedRegistry); 417 | }; 418 | 419 | var fromCache = exports.fromCache = function fromCache(_ref12) { 420 | var tree = _ref12.tree, 421 | registry = _ref12.registry; 422 | 423 | return dehydrateCache().then(function (cachedRegistry) { 424 | return { tree: tree, registry: mergeCache(registry, cachedRegistry) }; 425 | }); 426 | }; 427 | 428 | /** 429 | * Convenience method to allow easy chaining 430 | * @param tree 431 | * @param registry 432 | * @returns {Promise.<{tree: *, registry: *}>} 433 | */ 434 | var toCache = exports.toCache = function toCache(_ref13) { 435 | var tree = _ref13.tree, 436 | registry = _ref13.registry; 437 | 438 | return hydrateCache(registry).then(function () { 439 | return { tree: tree, registry: registry }; 440 | }); 441 | }; 442 | 443 | var serializeConfig = exports.serializeConfig = function serializeConfig(config) { 444 | return 'SystemJS.config(' + JSON.stringify(config, null, 2) + ')'; 445 | }; 446 | 447 | /** 448 | * Write registry to ./systemjs.cache 449 | * @param registry 450 | * @returns {Promise.} 451 | */ 452 | var hydrateCache = function hydrateCache(registry) { 453 | return Promise.resolve(JSON.stringify(registry)).then(pfs.writeFile.bind(null, './systemjs.cache')); 454 | }; 455 | 456 | /** 457 | * Construct registry from ./systemjs.cache 458 | * @returns {Promise.} 459 | */ 460 | var dehydrateCache = function dehydrateCache() { 461 | return pfs.readFile('./systemjs.cache', 'utf8').then(JSON.parse).catch(function (e) { 462 | console.log("No cache, parsing node_modules. Warning this may take a while."); 463 | return {}; 464 | }); 465 | }; -------------------------------------------------------------------------------- /dist/next.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | 7 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 8 | 9 | function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } 10 | 11 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } 12 | 13 | function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } 14 | 15 | /** 16 | * Copyright 2016 Alexis Vincent (http://alexisvincent.io) 17 | */ 18 | var fs = require('mz/fs'); 19 | var path = require('path').posix; 20 | var Promise = require('bluebird'); 21 | var _ = require('lodash'); 22 | var semver = require('semver'); 23 | 24 | var _require = require('jspm-npm/lib/node-conversion'), 25 | convertPackage = _require.convertPackage; 26 | 27 | var _require2 = require('util'), 28 | inspect = _require2.inspect; 29 | 30 | var nodeCoreModules = exports.nodeCoreModules = ['assert', 'buffer', 'child_process', 'cluster', 'console', 'constants', 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'module', 'net', 'os', 'path', 'process', 'punycode', 'querystring', 'readline', 'repl', 'stream', 'string_decoder', 'sys', 'timers', 'tls', 'tty', 'url', 'util', 'vm', 'zlib']; 31 | 32 | // Promise.awaitAll = (promiseArray) => { 33 | // return ( 34 | // Promise.resolve(promiseArray) 35 | // .map(p => Promise.resolve(p)) 36 | // .then(promiseArray => { 37 | // return promiseArray.map(p => p.catch((e) => ({ 38 | // __awaitAll: true, 39 | // promise: p 40 | // }))) 41 | // }).map(p => p.__awaitAll ? p.promise : p) 42 | // ) 43 | // } 44 | // 45 | // const seperate = (promiseArray) => { 46 | // return ( 47 | // Promise.awaitAll(promiseArray).then() 48 | // ) 49 | // } 50 | 51 | var log = function log(obj) { 52 | return console.log(inspect(obj, { depth: null })); 53 | }; 54 | 55 | /** 56 | * Get all directories in a directory 57 | * @param srcpath 58 | * @returns {Promise.<*>} 59 | */ 60 | var getDirectories = function getDirectories(srcpath) { 61 | return Promise.resolve(fs.readdir(srcpath).then(function (files) { 62 | return files.filter(function (file) { 63 | return fs.statSync(path.join(srcpath, file)).isDirectory(); 64 | }).map(function (dir) { 65 | return path.join(srcpath, dir); 66 | }); 67 | })); 68 | }; 69 | 70 | var isPackageDirectory = function () { 71 | var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(dir) { 72 | return regeneratorRuntime.wrap(function _callee$(_context) { 73 | while (1) { 74 | switch (_context.prev = _context.next) { 75 | case 0: 76 | _context.next = 2; 77 | return fs.exists(path.join(dir, 'package.json')); 78 | 79 | case 2: 80 | return _context.abrupt('return', _context.sent); 81 | 82 | case 3: 83 | case 'end': 84 | return _context.stop(); 85 | } 86 | } 87 | }, _callee, undefined); 88 | })); 89 | 90 | return function isPackageDirectory(_x) { 91 | return _ref.apply(this, arguments); 92 | }; 93 | }(); 94 | 95 | /** 96 | * For a given dir, get the corresponding package.json 97 | * @param dir 98 | * @returns {Promise.} 99 | */ 100 | var getPJSON = exports.getPJSON = function getPJSON(dir) { 101 | return fs.readFile(path.join(dir, 'package.json'), 'utf8').then(JSON.parse) 102 | // Pad it with defaults 103 | .then(function (pjson) { 104 | return _extends({ 105 | dependencies: {}, 106 | devDependencies: {}, 107 | peerDependencies: {} 108 | 109 | }, pjson, { 110 | 111 | _augmented: false, 112 | _locations: [dir], 113 | _key: pjson.name + '@' + pjson.version 114 | }); 115 | }).catch(function () { 116 | return false; 117 | }); 118 | }; 119 | 120 | /** 121 | * Return the dependencies that live in the first level of node_modules 122 | * @param packageDir 123 | * @returns {Promise.} 124 | */ 125 | var getOwnDepsDEPRECATED = exports.getOwnDepsDEPRECATED = function getOwnDepsDEPRECATED(packageDir) { 126 | var node_modules = path.join(packageDir, 'node_modules'); 127 | 128 | return fs.access(node_modules).then(function () { 129 | return getDirectories(node_modules); 130 | }) 131 | // Map directories to their package.json 132 | .then(function (dirs) { 133 | return Promise.all(dirs.map(function (dir) { 134 | return getPJSON(path.join(packageDir, 'node_modules', dir)); 135 | })); 136 | }) 137 | // Filter out anything that wasn't a package 138 | .then(function (configs) { 139 | return configs.filter(function (v, k) { 140 | return v; 141 | }); 142 | }).catch(function (err) { 143 | // console.log(err) 144 | return []; 145 | }); 146 | }; 147 | 148 | var test = exports.test = function () { 149 | var _ref2 = _asyncToGenerator(regeneratorRuntime.mark(function _callee2() { 150 | return regeneratorRuntime.wrap(function _callee2$(_context2) { 151 | while (1) { 152 | switch (_context2.prev = _context2.next) { 153 | case 0: 154 | _context2.t0 = console; 155 | _context2.t1 = Object; 156 | _context2.t2 = addPackagesToRegistry; 157 | _context2.t3 = {}; 158 | _context2.next = 6; 159 | return getAllSubPackages('.').map(getPJSON); 160 | 161 | case 6: 162 | _context2.t4 = _context2.sent; 163 | _context2.t5 = (0, _context2.t2)(_context2.t3, _context2.t4); 164 | 165 | _context2.t6 = function (entry) { 166 | return entry._locations.length > 1; 167 | }; 168 | 169 | _context2.t7 = _context2.t1.values.call(_context2.t1, _context2.t5).filter(_context2.t6); 170 | 171 | _context2.t0.log.call(_context2.t0, _context2.t7); 172 | 173 | case 11: 174 | case 'end': 175 | return _context2.stop(); 176 | } 177 | } 178 | }, _callee2, undefined); 179 | })); 180 | 181 | return function test() { 182 | return _ref2.apply(this, arguments); 183 | }; 184 | }(); 185 | 186 | var getSubPackageDirectories = exports.getSubPackageDirectories = function () { 187 | var _ref3 = _asyncToGenerator(regeneratorRuntime.mark(function _callee4(packageDir) { 188 | var node_modules, dirs; 189 | return regeneratorRuntime.wrap(function _callee4$(_context4) { 190 | while (1) { 191 | switch (_context4.prev = _context4.next) { 192 | case 0: 193 | node_modules = path.join(packageDir, 'node_modules'); 194 | _context4.next = 3; 195 | return fs.exists(node_modules); 196 | 197 | case 3: 198 | if (!_context4.sent) { 199 | _context4.next = 16; 200 | break; 201 | } 202 | 203 | _context4.next = 6; 204 | return isPackageDirectory(node_modules); 205 | 206 | case 6: 207 | if (!_context4.sent) { 208 | _context4.next = 10; 209 | break; 210 | } 211 | 212 | return _context4.abrupt('return', [node_modules]); 213 | 214 | case 10: 215 | _context4.next = 12; 216 | return getDirectories(node_modules).map(function () { 217 | var _ref4 = _asyncToGenerator(regeneratorRuntime.mark(function _callee3(dir) { 218 | return regeneratorRuntime.wrap(function _callee3$(_context3) { 219 | while (1) { 220 | switch (_context3.prev = _context3.next) { 221 | case 0: 222 | _context3.next = 2; 223 | return isPackageDirectory(dir); 224 | 225 | case 2: 226 | if (!_context3.sent) { 227 | _context3.next = 6; 228 | break; 229 | } 230 | 231 | return _context3.abrupt('return', Promise.resolve([dir])); 232 | 233 | case 6: 234 | return _context3.abrupt('return', getDirectories(dir).filter(isPackageDirectory)); 235 | 236 | case 7: 237 | case 'end': 238 | return _context3.stop(); 239 | } 240 | } 241 | }, _callee3, undefined); 242 | })); 243 | 244 | return function (_x3) { 245 | return _ref4.apply(this, arguments); 246 | }; 247 | }()); 248 | 249 | case 12: 250 | dirs = _context4.sent; 251 | return _context4.abrupt('return', Promise.resolve([].concat.apply([], dirs))); 252 | 253 | case 14: 254 | _context4.next = 17; 255 | break; 256 | 257 | case 16: 258 | return _context4.abrupt('return', Promise.resolve([])); 259 | 260 | case 17: 261 | case 'end': 262 | return _context4.stop(); 263 | } 264 | } 265 | }, _callee4, undefined); 266 | })); 267 | 268 | return function getSubPackageDirectories(_x2) { 269 | return _ref3.apply(this, arguments); 270 | }; 271 | }(); 272 | 273 | var getAllSubPackages = exports.getAllSubPackages = function () { 274 | var _ref5 = _asyncToGenerator(regeneratorRuntime.mark(function _callee6(directory) { 275 | var subPackages; 276 | return regeneratorRuntime.wrap(function _callee6$(_context6) { 277 | while (1) { 278 | switch (_context6.prev = _context6.next) { 279 | case 0: 280 | subPackages = getSubPackageDirectories(directory).map(function () { 281 | var _ref6 = _asyncToGenerator(regeneratorRuntime.mark(function _callee5(dir) { 282 | return regeneratorRuntime.wrap(function _callee5$(_context5) { 283 | while (1) { 284 | switch (_context5.prev = _context5.next) { 285 | case 0: 286 | _context5.t0 = [dir]; 287 | _context5.t1 = _toConsumableArray; 288 | _context5.next = 4; 289 | return getAllSubPackages(dir); 290 | 291 | case 4: 292 | _context5.t2 = _context5.sent; 293 | _context5.t3 = (0, _context5.t1)(_context5.t2); 294 | return _context5.abrupt('return', _context5.t0.concat.call(_context5.t0, _context5.t3)); 295 | 296 | case 7: 297 | case 'end': 298 | return _context5.stop(); 299 | } 300 | } 301 | }, _callee5, undefined); 302 | })); 303 | 304 | return function (_x5) { 305 | return _ref6.apply(this, arguments); 306 | }; 307 | }()); 308 | _context6.t0 = Promise; 309 | _context6.t1 = [].concat; 310 | _context6.t2 = []; 311 | _context6.next = 6; 312 | return subPackages; 313 | 314 | case 6: 315 | _context6.t3 = _context6.sent; 316 | _context6.t4 = _context6.t1.apply.call(_context6.t1, _context6.t2, _context6.t3); 317 | return _context6.abrupt('return', _context6.t0.resolve.call(_context6.t0, _context6.t4)); 318 | 319 | case 9: 320 | case 'end': 321 | return _context6.stop(); 322 | } 323 | } 324 | }, _callee6, undefined); 325 | })); 326 | 327 | return function getAllSubPackages(_x4) { 328 | return _ref5.apply(this, arguments); 329 | }; 330 | }(); 331 | 332 | var addPackagesToRegistry = exports.addPackagesToRegistry = function addPackagesToRegistry(registry, packages) { 333 | 334 | // TODO: This can be made significantly faster by not doing it one by one 335 | // Should take advantage of the fact that we have been given a list 336 | var addPackageToRegistry = function addPackageToRegistry(registry, pjson) { 337 | var existingEntry = registry[pjson._key] || { 338 | _locations: [], 339 | _augmented: false 340 | }; 341 | 342 | // merge the two entries, preferring the one that is augmented, then the new one 343 | var entry = _extends({}, !existingEntry._augmented ? existingEntry : pjson, existingEntry._augmented ? existingEntry : pjson, { 344 | _locations: _.uniq([].concat(_toConsumableArray(existingEntry._locations), _toConsumableArray(pjson._locations))) 345 | }); 346 | 347 | return _extends({}, registry, _defineProperty({}, entry._key, entry)); 348 | }; 349 | 350 | return packages.reduce(addPackageToRegistry, {}); 351 | }; 352 | 353 | /** 354 | * Trace the full node_modules tree, and build up a registry on the way. 355 | * 356 | * Registry is of the form: 357 | * { 358 | * 'lodash@1.1.2': { 359 | * name: 'lodash', 360 | * version: '1.1.2', 361 | * config: , 362 | * key: 'lodash@1.1.2', 363 | * location: 'node_modules/lodash' 364 | * }, 365 | * ... 366 | * } 367 | * 368 | * @param directory 369 | * @param name 370 | * @param version 371 | * @param registry 372 | * @returns registry: Array 373 | */ 374 | var traceModuleTree = exports.traceModuleTree = function traceModuleTree(directory) { 375 | var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 376 | var version = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 377 | var registry = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; 378 | 379 | 380 | return Promise.resolve({ name: name, version: version }) 381 | // Resolve the package.json and set name and version from there if either is not specified 382 | .then(function (_ref7) { 383 | var name = _ref7.name, 384 | version = _ref7.version; 385 | return !name || !version ? getPJSON(directory) : { name: name, version: version }; 386 | }).then(function (_ref8) { 387 | var name = _ref8.name, 388 | version = _ref8.version; 389 | return ( 390 | 391 | // Get the dependencies in node_modules 392 | getOwnDepsDEPRECATED(directory) 393 | 394 | // Merge package { name@version : package.json } into the registry 395 | .then(function (ownDeps) { 396 | // console.log(ownDeps) 397 | ownDeps.forEach(function (dep) { 398 | var versionName = dep.name + '@' + dep.version; 399 | registry[versionName] = { 400 | name: dep.name, 401 | config: dep, 402 | version: dep.version, 403 | key: versionName, 404 | location: path.join(directory, 'node_modules', dep.name) 405 | }; 406 | }); 407 | 408 | return ownDeps; 409 | }).then(function (ownDeps) { 410 | // map each package.json to it's own tree 411 | return Promise.all(ownDeps.map(function (_ref9) { 412 | var name = _ref9.name, 413 | version = _ref9.version; 414 | 415 | return traceModuleTree(path.join(directory, 'node_modules', name), name, version, registry) 416 | // Drop the registry 417 | .then(function (_ref10) { 418 | var tree = _ref10.tree, 419 | registry = _ref10.registry; 420 | return tree; 421 | }); 422 | // map the module and its dep list to a tree entry 423 | })).then(function (deps) { 424 | return { name: name, deps: deps, version: version }; 425 | }); 426 | }).then(function (tree) { 427 | return { tree: tree, registry: registry }; 428 | }) 429 | ); 430 | }); 431 | }; 432 | 433 | /** 434 | * Take an array of objects and turn it into an object with the key being the specified key. 435 | * 436 | * objectify('name', [ 437 | * {name: 'Alexis', surname: 'Vincent'}, 438 | * {name: 'Julien', surname: 'Vincent'} 439 | * ]) 440 | * 441 | * => 442 | * 443 | * { 444 | * 'Alexis': {name: 'Alexis', surname: 'Vincent'}, 445 | * 'Julien': {name: 'Julien', surname: 'Vincent'}, 446 | * } 447 | * 448 | * @param key 449 | * @param array 450 | * @returns {*} 451 | */ 452 | var objectify = function objectify(key, array) { 453 | return array.reduce(function (obj, arrayItem) { 454 | obj[arrayItem[key]] = arrayItem; 455 | return obj; 456 | }, {}); 457 | }; 458 | 459 | /** 460 | * Given a registry of package.json files, use jspm/npm to augment them to be SystemJS compatible 461 | * @param registry 462 | * @returns {Promise.} 463 | */ 464 | var augmentRegistry = exports.augmentRegistry = function augmentRegistry(registry) { 465 | return Promise.all(Object.keys(registry).map(function (key) { 466 | var depMap = registry[key]; 467 | 468 | // Don't augment things that already have been (from the cache) 469 | var shouldAugment = !depMap.augmented; 470 | 471 | // Don't augment things that specify config.jspmPackage 472 | if (depMap.config.jspmPackage != undefined && depMap.config.jspmPackage) shouldAugment = false; 473 | 474 | // Don't augment things that specify config.jspmNodeConversion == false 475 | if (depMap.config.jspmNodeConversion !== undefined && !depMap.config.jspmNodeConversion) shouldAugment = false; 476 | 477 | // Don't augment things that specify config.jspm.jspmNodeConversion == false 478 | if (depMap.config.jspm !== undefined && depMap.config.jspm.jspmNodeConversion !== undefined && !depMap.config.jspm.jspmNodeConversion) shouldAugment = false; 479 | 480 | // Augment the package.json 481 | return shouldAugment ? convertPackage(depMap.config, ':' + key, './' + depMap.location, console).then(function (config) { 482 | return Object.assign(depMap, { config: config, augmented: true }); 483 | }).catch(log) : depMap; 484 | })).then(objectify.bind(null, 'key')); 485 | }; 486 | 487 | /** 488 | * Convenience method to allow easy chaining 489 | * @param tree 490 | * @param registry 491 | */ 492 | var augmentModuleTree = exports.augmentModuleTree = function augmentModuleTree(_ref11) { 493 | var tree = _ref11.tree, 494 | registry = _ref11.registry; 495 | return augmentRegistry(registry).then(function (registry) { 496 | return { tree: tree, registry: registry }; 497 | }); 498 | }; 499 | 500 | /** 501 | * Only keep keys we are interested in for package config generation 502 | * @param registry 503 | * @returns {Promise.<*>} 504 | */ 505 | var pruneRegistry = exports.pruneRegistry = function pruneRegistry(registry) { 506 | return Promise.resolve(objectify('key', Object.keys(registry).map(function (key) { 507 | return Object.assign({}, registry[key], { 508 | config: _.pick(registry[key].config, ['meta', 'map', 'main', 'format', 'defaultExtension', 'defaultJSExtensions']) 509 | }); 510 | }))); 511 | }; 512 | 513 | /** 514 | * Convenience method to allow easy chaining 515 | * @param tree 516 | * @param registry 517 | */ 518 | var pruneModuleTree = exports.pruneModuleTree = function pruneModuleTree(_ref12) { 519 | var tree = _ref12.tree, 520 | registry = _ref12.registry; 521 | return pruneRegistry(registry).then(function (registry) { 522 | return { tree: tree, registry: registry }; 523 | }); 524 | }; 525 | 526 | /** 527 | * Walk the tree, call f on all nodes. 528 | * @param tree 529 | * @param registry 530 | * @param f - (versionName, deps, tree) 531 | * @param depth - How deep should we go 532 | * @param skip - How many levels should we skip 533 | */ 534 | var walkTree = exports.walkTree = function walkTree(_ref13, f) { 535 | var tree = _ref13.tree, 536 | registry = _ref13.registry; 537 | var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; 538 | var skip = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; 539 | 540 | if (depth >= 1) { 541 | var name = tree.name, 542 | deps = tree.deps, 543 | version = tree.version; 544 | 545 | 546 | if (skip <= 0) f(registry[name + '@' + version], deps, tree); 547 | 548 | if (depth >= 2) deps.forEach(function (tree) { 549 | return walkTree({ tree: tree, registry: registry }, f, depth - 1, skip - 1); 550 | }); 551 | } 552 | }; 553 | 554 | /** 555 | * resolve the package registry entry that should be used given 556 | * @param packageName - name of package to resolve 557 | * @param semverRange - acceptable version range 558 | * @param dir - directory the caller lives in 559 | * @param registry - registry object 560 | */ 561 | var resolvePackage = function resolvePackage(packageName, semverRange, dir, registry) { 562 | return Object.Values(registry).filter(function (_ref14) { 563 | var name = _ref14.name; 564 | return name == registry; 565 | }).filter(function (_ref15) { 566 | var version = _ref15.version; 567 | return semver.satisfies(version, semverRange); 568 | }).filter(function (_ref16) { 569 | var location = _ref16.location; 570 | 571 | location.split('/').indexOf('node_modules'); 572 | }); 573 | }; 574 | 575 | /** 576 | * Use the tree and registry to create a SystemJS config 577 | * 578 | * TODO: Use SystemJS 20 normalize idempotency to optimize mappings 579 | * // Do this by mapping package@version to location like JSPM does 580 | * 581 | * @param tree 582 | * @param registry 583 | * @returns {Promise.<{map: {}, packages: {}}>} 584 | */ 585 | var generateConfig = exports.generateConfig = function generateConfig(_ref17) { 586 | var tree = _ref17.tree, 587 | registry = _ref17.registry; 588 | 589 | 590 | var systemConfig = { 591 | "map": {}, 592 | "packages": {} 593 | }; 594 | 595 | // get readable stream working 596 | // TODO: Fix this hack 597 | systemConfig['map']["_stream_transform"] = "node_modules/readable-stream/transform"; 598 | 599 | // Walk first level of dependencies and map package name to location 600 | walkTree({ tree: tree, registry: registry }, function (_ref18, deps) { 601 | var name = _ref18.name, 602 | config = _ref18.config, 603 | key = _ref18.key, 604 | location = _ref18.location; 605 | 606 | systemConfig['map'][name] = location; 607 | }, 2, 1); 608 | 609 | // Walk full dep tree and assign package config entries 610 | walkTree({ tree: tree, registry: registry }, function (_ref19, deps, tree) { 611 | var name = _ref19.name, 612 | config = _ref19.config, 613 | key = _ref19.key, 614 | location = _ref19.location; 615 | 616 | 617 | // Construct package entry based off config 618 | var packageEntry = Object.assign({ 619 | map: {}, 620 | meta: {} 621 | }, config); 622 | 623 | // Add mappings for it's deps. 624 | walkTree({ tree: tree, registry: registry }, function (_ref20, deps) { 625 | var name = _ref20.name, 626 | config = _ref20.config, 627 | key = _ref20.key, 628 | location = _ref20.location; 629 | 630 | packageEntry['map'][name] = location; 631 | }, 2, 1); 632 | 633 | // If there are no mappings, don't pollute the config 634 | if (Object.keys(packageEntry['map']).length == 0) delete packageEntry['map']; 635 | 636 | // Assign package entry to config 637 | systemConfig['packages'][location] = packageEntry; 638 | 639 | // Add mappings for all jspm-nodelibs 640 | // TODO: Fix this hack 641 | nodeCoreModules.forEach(function (lib) { 642 | systemConfig['map'][lib] = "node_modules/jspm-nodelibs-" + lib; 643 | }); 644 | }, Infinity, 1); 645 | 646 | // TODO: Make the mappings here more universal 647 | // map nm: -> node_modules/ to make config smaller 648 | systemConfig['paths'] = { 649 | 'nm:': 'node_modules/' 650 | }; 651 | 652 | // map nm: -> node_modules/ to make config smaller 653 | Object.keys(systemConfig['map']).forEach(function (key) { 654 | systemConfig['map'][key] = systemConfig['map'][key].replace(/^node_modules\//, 'nm:'); 655 | }); 656 | 657 | // map nm: -> node_modules/ to make config smaller 658 | Object.keys(systemConfig['packages']).forEach(function (key) { 659 | if (key.startsWith('node_modules/')) { 660 | systemConfig['packages'][key.replace(/^node_modules\//, 'nm:')] = systemConfig['packages'][key]; 661 | delete systemConfig['packages'][key]; 662 | } 663 | }); 664 | 665 | return Promise.resolve(systemConfig); 666 | }; 667 | 668 | // TODO: This needs to be done better (fails if locations of shit changes) 669 | var mergeCache = exports.mergeCache = function mergeCache(registry, cachedRegistry) { 670 | return Object.assign({}, registry, cachedRegistry); 671 | }; 672 | 673 | var fromCache = exports.fromCache = function fromCache(dehydrateCache) { 674 | return function (_ref21) { 675 | var tree = _ref21.tree, 676 | registry = _ref21.registry; 677 | 678 | return dehydrateCache().then(function (cachedRegistry) { 679 | return { tree: tree, registry: mergeCache(registry, cachedRegistry) }; 680 | }); 681 | }; 682 | }; 683 | 684 | /** 685 | * Convenience method to allow easy chaining 686 | * @returns {Promise.<{tree: *, registry: *}>} 687 | * @param hydrateCache 688 | */ 689 | var toCache = exports.toCache = function toCache(hydrateCache) { 690 | return function (_ref22) { 691 | var tree = _ref22.tree, 692 | registry = _ref22.registry; 693 | 694 | return hydrateCache(registry).then(function () { 695 | return { tree: tree, registry: registry }; 696 | }); 697 | }; 698 | }; 699 | 700 | var serializeConfig = exports.serializeConfig = function serializeConfig(config) { 701 | return 'SystemJS.config(' + JSON.stringify(config, null, 2) + ')'; 702 | }; -------------------------------------------------------------------------------- /dist/repl.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | require("babel-polyfill"); 4 | 5 | requireU = function requireU(m) { 6 | delete require.cache[require.resolve(m)]; 7 | return require(require.resolve(m)); 8 | }; -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Example Project 2 | This project contains three files, [index.html](./index.html), [app.js](./app.js) 3 | and a [package.json](./package.json) with a `postinstall` hook. 4 | 5 | ## Quick Start 6 | 7 | # Run 8 | yarn global add systemjs-tools serve 9 | yarn add systemjs systemjs-nodelibs systemjs-plugin-babel react react-dom 10 | systemjs config 11 | serve . 12 | 13 | ## Prerequisites 14 | 15 | Install systemjs-tools (for config generation) 16 | 17 | `yarn global add systemjs-tools` 18 | 19 | `yarn global add serve` for a static file server (or another one if you prefer) 20 | 21 | Everytime we do a `yarn add`, we will need to regenerate the config. 22 | There is a `postinstall` hook to do this for you, but if you notice 23 | anything strange, just run `systemjs config` in the `package.json` directory. 24 | 25 | Note that until recently Yarn didn't respect `postinstall` hooks, so either 26 | upgrade Yarn or run `systemjs config` separately. 27 | 28 | ## Basic install 29 | 30 | Install dependencies 31 | 32 | `yarn add systemjs systemjs-nodelibs react react-dom` 33 | 34 | Serve the current directory at http://localhost:3000 35 | 36 | `serve .` 37 | 38 | ## Augment the installation to support ES6 (using babel) 39 | 40 | ***Update app.js to be ES6 version*** 41 | 42 | Add babel plugin 43 | 44 | `yarn add systemjs-plugin-babel` 45 | 46 | ***Update index file to use new transpiler*** 47 | 48 | Serve the current directory at http://localhost:3000 49 | 50 | `serve .` 51 | -------------------------------------------------------------------------------- /example/app.js: -------------------------------------------------------------------------------- 1 | //import {render} from 'react-dom' 2 | var render = require('react-dom').render 3 | //import {DOM} from 'react' 4 | var DOM = require('react').DOM 5 | 6 | render( DOM.div({}, "hello there"), document.getElementById('root') ) 7 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "1.0.0", 4 | "description": "An example application using systemjs-config-builder", 5 | "main": "app.js", 6 | "author": "Alexis Vincent", 7 | "license": "MIT", 8 | "scripts": { 9 | "postinstall": "systemjs config" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/cli.js: -------------------------------------------------------------------------------- 1 | import { 2 | traceModuleTree, 3 | fromCache, 4 | augmentModuleTree, 5 | pruneModuleTree, 6 | toCache, 7 | generateConfig, 8 | serializeConfig 9 | } from './index' 10 | import {inspect} from 'util'; 11 | 12 | const fs = require('graceful-fs') 13 | const path = require('path') 14 | const Promise = require('bluebird') 15 | 16 | const pfs = {} 17 | 18 | /** 19 | * Promisify all fs functions 20 | */ 21 | Object.keys(fs).map(key => { 22 | if (typeof fs[key] == 'function') 23 | pfs[key] = Promise.promisify(fs[key]); 24 | }) 25 | 26 | const log = obj => { 27 | console.log(inspect(obj, {depth: null})) 28 | return obj 29 | } 30 | 31 | traceModuleTree('.') 32 | .then(fromCache) 33 | .then(augmentModuleTree) 34 | .then(toCache) 35 | .then(pruneModuleTree) 36 | .then(generateConfig) 37 | // .then(log) 38 | .then(serializeConfig) 39 | .then(pfs.writeFile.bind(null, './generated.config.js')); 40 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016 Alexis Vincent (http://alexisvincent.io) 3 | */ 4 | const fs = require('graceful-fs') 5 | const path = require('path').posix 6 | const Promise = require('bluebird') 7 | const _ = require('lodash') 8 | const {convertPackage} = require('jspm-npm/lib/node-conversion') 9 | const {inspect} = require('util') 10 | 11 | export const nodeCoreModules = [ 12 | 'assert', 13 | 'buffer', 14 | 'child_process', 15 | 'cluster', 16 | 'console', 17 | 'constants', 18 | 'crypto', 19 | 'dgram', 20 | 'dns', 21 | 'domain', 22 | 'events', 23 | 'fs', 24 | 'http', 25 | 'https', 26 | 'module', 27 | 'net', 28 | 'os', 29 | 'path', 30 | 'process', 31 | 'punycode', 32 | 'querystring', 33 | 'readline', 34 | 'repl', 35 | 'stream', 36 | 'string_decoder', 37 | 'sys', 38 | 'timers', 39 | 'tls', 40 | 'tty', 41 | 'url', 42 | 'util', 43 | 'vm', 44 | 'zlib' 45 | ]; 46 | 47 | 48 | const pfs = {} 49 | 50 | /** 51 | * Promisify all fs functions 52 | */ 53 | Object.keys(fs).map(key => { 54 | if (typeof fs[key] == 'function') 55 | pfs[key] = Promise.promisify(fs[key]); 56 | }) 57 | 58 | const log = obj => console.log(inspect(obj, {depth: null})) 59 | 60 | /** 61 | * Get all directories in a directory 62 | * @param srcpath 63 | * @returns {Promise.<*>} 64 | */ 65 | const getDirectories = (srcpath) => { 66 | return pfs.readdir(srcpath).then( 67 | dirs => dirs.filter((file) => { 68 | return fs.statSync(path.join(srcpath, file)).isDirectory(); 69 | }) 70 | ).then(dirs => { 71 | return Promise.all(dirs.map(dir => { 72 | if (dir.startsWith('@')) { 73 | return getDirectories(path.join(srcpath, dir)).then(subdirs => { 74 | return subdirs.map(subdir => path.join(dir, subdir)); 75 | }); 76 | } else { 77 | return dir; 78 | } 79 | })); 80 | }).then(dirs => { 81 | // Flatten array in case there are scoped packages that produce a nested array 82 | return [].concat.apply([], dirs) 83 | }); 84 | } 85 | 86 | /** 87 | * For a given dir, get the corresponding package.json 88 | * @param dir 89 | * @returns {Promise.} 90 | */ 91 | export const getPackageConfig = (dir) => { 92 | return pfs.readFile(path.join(dir, 'package.json'), 'utf8') 93 | .then(JSON.parse) 94 | // Pad it with defaults 95 | .then(config => Object.assign({ 96 | dependencies: {}, 97 | devDependencies: {}, 98 | peerDependencies: {}, 99 | augmented: false 100 | }, config)) 101 | .catch(() => null) 102 | } 103 | 104 | /** 105 | * Return the dependencies that live in the first level of node_modules 106 | * @param packageDir 107 | * @returns {Promise.} 108 | */ 109 | export const getOwnDeps = (packageDir) => { 110 | const node_modules = path.join(packageDir, 'node_modules') 111 | 112 | return pfs.access(node_modules) 113 | .then(() => getDirectories(node_modules)) 114 | // Map directories to their package.json 115 | .then(dirs => Promise.all(dirs.map(dir => getPackageConfig(path.join(packageDir, 'node_modules', dir))))) 116 | // Filter out anything that wasn't a package 117 | .then(configs => configs.filter((v, k) => v)) 118 | 119 | .catch(err => { 120 | // console.log(err) 121 | return [] 122 | }) 123 | } 124 | 125 | /** 126 | * Trace the full node_modules tree, and build up a registry on the way. 127 | * 128 | * Registry is of the form: 129 | * { 130 | * 'lodash@1.1.2': { 131 | * name: 'lodash', 132 | * config: , 133 | * key: 'lodash@1.1.2', 134 | * location: 'node_modules/lodash' 135 | * }, 136 | * ... 137 | * } 138 | * 139 | * Returned Tree is of the form: 140 | * [ 141 | * { 142 | * name: 'react', 143 | * version: '15.4.1', 144 | * deps: 145 | * }, 146 | * ... 147 | * ] 148 | * 149 | * 150 | * @param directory 151 | * @param name 152 | * @param version 153 | * @param registry 154 | * @returns {Promise.<{tree: *, registry: Array}>} 155 | */ 156 | export const traceModuleTree = (directory, name = false, version = false, registry = {}) => { 157 | 158 | return Promise.resolve({name, version}) 159 | // Resolve the package.json and set name and version from there if either is not specified 160 | .then(({name, version}) => (!name || !version) ? getPackageConfig(directory) : {name, version}) 161 | 162 | .then(({name, version}) => ( 163 | 164 | // Get the dependencies in node_modules 165 | getOwnDeps(directory) 166 | 167 | // Merge package { name@version : package.json } into the registry 168 | .then(ownDeps => { 169 | // console.log(ownDeps) 170 | ownDeps.forEach((dep => { 171 | const versionName = dep.name + '@' + dep.version 172 | registry[versionName] = { 173 | name: dep.name, 174 | config: dep, 175 | key: versionName, 176 | location: path.join(directory, 'node_modules', dep.name) 177 | } 178 | })) 179 | 180 | return ownDeps 181 | }) 182 | 183 | .then(ownDeps => { 184 | // map each package.json to it's own tree 185 | return Promise.all(ownDeps.map(({name, version}) => { 186 | return traceModuleTree(path.join(directory, 'node_modules', name), name, version, registry) 187 | // Drop the registry 188 | .then(({tree, registry}) => tree) 189 | // map the module and its dep list to a tree entry 190 | })).then(deps => ({name, deps, version: version})) 191 | }) 192 | 193 | .then(tree => ({tree, registry})) 194 | )) 195 | } 196 | 197 | 198 | /** 199 | * Take an array of objects and turn it into an object with the key being the specified key. 200 | * 201 | * objectify('name', [ 202 | * {name: 'Alexis', surname: 'Vincent'}, 203 | * {name: 'Julien', surname: 'Vincent'} 204 | * ]) 205 | * 206 | * => 207 | * 208 | * { 209 | * 'Alexis': {name: 'Alexis', surname: 'Vincent'}, 210 | * 'Julien': {name: 'Julien', surname: 'Vincent'}, 211 | * } 212 | * 213 | * @param key 214 | * @param array 215 | * @returns {*} 216 | */ 217 | const objectify = (key, array) => { 218 | return array.reduce((obj, arrayItem) => { 219 | obj[arrayItem[key]] = arrayItem 220 | return obj 221 | }, {}) 222 | } 223 | 224 | /** 225 | * Given a registry of package.json files, use jspm/npm to augment them to be SystemJS compatible 226 | * @param registry 227 | * @returns {Promise.} 228 | */ 229 | export const augmentRegistry = (registry) => { 230 | return Promise.all(Object.keys(registry) 231 | .map(key => { 232 | const depMap = registry[key] 233 | 234 | // Don't augment things that already have been (from the cache) 235 | let shouldAugment = !depMap.augmented 236 | 237 | // Don't augment things that specify config.jspmPackage 238 | if (depMap.config.jspmPackage != undefined && depMap.config.jspmPackage) 239 | shouldAugment = false 240 | 241 | // Don't augment things that specify config.jspmNodeConversion == false 242 | if (depMap.config.jspmNodeConversion !== undefined && !depMap.config.jspmNodeConversion) 243 | shouldAugment = false 244 | 245 | // Don't augment things that specify config.jspm.jspmNodeConversion == false 246 | if (depMap.config.jspm !== undefined 247 | && depMap.config.jspm.jspmNodeConversion !== undefined 248 | && !depMap.config.jspm.jspmNodeConversion) 249 | shouldAugment = false 250 | 251 | // Augment the package.json 252 | return shouldAugment ? 253 | convertPackage(depMap.config, ':' + key, './' + depMap.location, console) 254 | .then(config => Object.assign(depMap, {config, augmented: true})) 255 | .catch(log) : 256 | depMap 257 | })) 258 | .then(objectify.bind(null, 'key')) 259 | } 260 | 261 | /** 262 | * Convenience method to allow easy chaining 263 | * @param tree 264 | * @param registry 265 | */ 266 | export const augmentModuleTree = ({tree, registry}) => augmentRegistry(registry).then(registry => ({tree, registry})) 267 | 268 | /** 269 | * Only keep keys we are interested in for package config generation 270 | * @param registry 271 | * @returns {Promise.<*>} 272 | */ 273 | export const pruneRegistry = (registry) => { 274 | return Promise.resolve( 275 | objectify('key', 276 | Object.keys(registry) 277 | .map(key => { 278 | return Object.assign({}, registry[key], { 279 | config: _.pick( 280 | registry[key].config, [ 281 | 'meta', 282 | 'map', 283 | 'main', 284 | 'format', 285 | 'defaultExtension', 286 | 'defaultJSExtensions' 287 | ]) 288 | }) 289 | } 290 | )) 291 | ) 292 | } 293 | 294 | /** 295 | * Convenience method to allow easy chaining 296 | * @param tree 297 | * @param registry 298 | */ 299 | export const pruneModuleTree = ({tree, registry}) => pruneRegistry(registry).then(registry => ({tree, registry})) 300 | 301 | /** 302 | * Walk the tree, call f on all nodes. 303 | * @param tree 304 | * @param registry 305 | * @param f - (versionName, deps, tree) 306 | * @param depth - How deep should we go 307 | * @param skip - How many levels should we skip 308 | */ 309 | export const walkTree = ({tree, registry}, f, depth = Infinity, skip = 0) => { 310 | if (depth >= 1) { 311 | const {name, deps, version} = tree 312 | 313 | if (skip <= 0) 314 | f(registry[name + '@' + version], deps, tree) 315 | 316 | if (depth >= 2) 317 | deps.forEach(tree => walkTree({tree, registry}, f, depth - 1, skip - 1)) 318 | } 319 | } 320 | 321 | /** 322 | * Use the tree and registry to create a SystemJS config 323 | * 324 | * TODO: Use SystemJS 20 normalize idempotency to optimize mappings 325 | * // Do this by mapping package@version to location like JSPM does 326 | * 327 | * @param tree 328 | * @param registry 329 | * @returns {Promise.<{map: {}, packages: {}}>} 330 | */ 331 | export const generateConfig = ({tree, registry}) => { 332 | 333 | const systemConfig = { 334 | "map": {}, 335 | "packages": {} 336 | } 337 | 338 | // get readable stream working 339 | // TODO: Fix this hack 340 | systemConfig['map']["_stream_transform"] = "node_modules/readable-stream/transform" 341 | 342 | // Walk first level of dependencies and map package name to location 343 | walkTree({tree, registry}, ({name, config, key, location}, deps) => { 344 | systemConfig['map'][name] = location 345 | }, 2, 1) 346 | 347 | // Walk full dep tree and assign package config entries 348 | walkTree({tree, registry}, ({name, config, key, location}, deps, tree) => { 349 | 350 | // Construct package entry based off config 351 | let packageEntry = Object.assign({ 352 | map: {}, 353 | meta: {} 354 | }, config) 355 | 356 | // Add mappings for it's deps. 357 | walkTree({tree, registry}, ({name, config, key, location}, deps) => { 358 | packageEntry['map'][name] = location 359 | }, 2, 1) 360 | 361 | // If there are no mappings, don't pollute the config 362 | if (Object.keys(packageEntry['map']).length == 0) 363 | delete packageEntry['map'] 364 | 365 | // Assign package entry to config 366 | systemConfig['packages'][location] = packageEntry 367 | 368 | // Add mappings for all jspm-nodelibs 369 | // TODO: Fix this hack 370 | nodeCoreModules.forEach(lib => { 371 | systemConfig['map'][lib] = "node_modules/jspm-nodelibs-" + lib 372 | }) 373 | 374 | }, Infinity, 1) 375 | 376 | // TODO: Make the mappings here more universal 377 | // map nm: -> node_modules/ to make config smaller 378 | systemConfig['paths'] = { 379 | 'nm:': 'node_modules/' 380 | } 381 | 382 | // map nm: -> node_modules/ to make config smaller 383 | Object.keys(systemConfig['map']).forEach(key => { 384 | systemConfig['map'][key] = systemConfig['map'][key].replace(/^node_modules\//, 'nm:') 385 | }) 386 | 387 | // map nm: -> node_modules/ to make config smaller 388 | Object.keys(systemConfig['packages']).forEach(key => { 389 | if (key.startsWith('node_modules/')) { 390 | systemConfig['packages'][key.replace(/^node_modules\//, 'nm:')] = systemConfig['packages'][key] 391 | delete systemConfig['packages'][key] 392 | } 393 | }) 394 | 395 | return Promise.resolve(systemConfig) 396 | } 397 | 398 | // TODO: This needs to be done better (fails if locations of shit changes) 399 | export const mergeCache = (registry, cachedRegistry) => { 400 | return Object.assign({}, registry, cachedRegistry) 401 | } 402 | 403 | export const fromCache = ({tree, registry}) => { 404 | return dehydrateCache().then(cachedRegistry => { 405 | return {tree, registry: mergeCache(registry, cachedRegistry)} 406 | }) 407 | } 408 | 409 | /** 410 | * Convenience method to allow easy chaining 411 | * @param tree 412 | * @param registry 413 | * @returns {Promise.<{tree: *, registry: *}>} 414 | */ 415 | export const toCache = ({tree, registry}) => { 416 | return hydrateCache(registry) 417 | .then(() => ({tree, registry})) 418 | } 419 | 420 | export const serializeConfig = config => { 421 | return 'SystemJS.config(' + JSON.stringify(config, null, 2) + ')' 422 | } 423 | 424 | /** 425 | * Write registry to ./systemjs.cache 426 | * @param registry 427 | * @returns {Promise.} 428 | */ 429 | const hydrateCache = (registry) => { 430 | return Promise.resolve(JSON.stringify(registry)) 431 | .then(pfs.writeFile.bind(null, './systemjs.cache')) 432 | } 433 | 434 | /** 435 | * Construct registry from ./systemjs.cache 436 | * @returns {Promise.} 437 | */ 438 | const dehydrateCache = () => { 439 | return pfs.readFile('./systemjs.cache', 'utf8') 440 | .then(JSON.parse) 441 | .catch(e => { 442 | console.log("No cache, parsing node_modules. Warning this may take a while.") 443 | return {} 444 | }) 445 | } 446 | -------------------------------------------------------------------------------- /lib/next.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2016 Alexis Vincent (http://alexisvincent.io) 3 | */ 4 | const fs = require('mz/fs') 5 | const path = require('path').posix 6 | const Promise = require('bluebird') 7 | const _ = require('lodash') 8 | const semver = require('semver') 9 | const {convertPackage} = require('jspm-npm/lib/node-conversion') 10 | const {inspect} = require('util') 11 | 12 | export const nodeCoreModules = [ 13 | 'assert', 14 | 'buffer', 15 | 'child_process', 16 | 'cluster', 17 | 'console', 18 | 'constants', 19 | 'crypto', 20 | 'dgram', 21 | 'dns', 22 | 'domain', 23 | 'events', 24 | 'fs', 25 | 'http', 26 | 'https', 27 | 'module', 28 | 'net', 29 | 'os', 30 | 'path', 31 | 'process', 32 | 'punycode', 33 | 'querystring', 34 | 'readline', 35 | 'repl', 36 | 'stream', 37 | 'string_decoder', 38 | 'sys', 39 | 'timers', 40 | 'tls', 41 | 'tty', 42 | 'url', 43 | 'util', 44 | 'vm', 45 | 'zlib' 46 | ]; 47 | 48 | 49 | // Promise.awaitAll = (promiseArray) => { 50 | // return ( 51 | // Promise.resolve(promiseArray) 52 | // .map(p => Promise.resolve(p)) 53 | // .then(promiseArray => { 54 | // return promiseArray.map(p => p.catch((e) => ({ 55 | // __awaitAll: true, 56 | // promise: p 57 | // }))) 58 | // }).map(p => p.__awaitAll ? p.promise : p) 59 | // ) 60 | // } 61 | // 62 | // const seperate = (promiseArray) => { 63 | // return ( 64 | // Promise.awaitAll(promiseArray).then() 65 | // ) 66 | // } 67 | 68 | const log = obj => console.log(inspect(obj, {depth: null})) 69 | 70 | /** 71 | * Get all directories in a directory 72 | * @param srcpath 73 | * @returns {Promise.<*>} 74 | */ 75 | const getDirectories = (srcpath) => { 76 | return Promise.resolve(fs.readdir(srcpath).then( 77 | files => files.filter((file) => { 78 | return fs.statSync(path.join(srcpath, file)).isDirectory(); 79 | }).map(dir => path.join(srcpath, dir)) 80 | )) 81 | } 82 | 83 | const isPackageDirectory = async(dir) => { 84 | return await fs.exists(path.join(dir, 'package.json')) 85 | } 86 | 87 | /** 88 | * For a given dir, get the corresponding package.json 89 | * @param dir 90 | * @returns {Promise.} 91 | */ 92 | export const getPJSON = (dir) => { 93 | return fs.readFile(path.join(dir, 'package.json'), 'utf8') 94 | .then(JSON.parse) 95 | // Pad it with defaults 96 | .then(pjson => ({ 97 | dependencies: {}, 98 | devDependencies: {}, 99 | peerDependencies: {}, 100 | 101 | ...pjson, 102 | 103 | _augmented: false, 104 | _locations: [dir], 105 | _key: `${pjson.name}@${pjson.version}` 106 | }), 107 | ).catch(() => false) 108 | } 109 | 110 | /** 111 | * Return the dependencies that live in the first level of node_modules 112 | * @param packageDir 113 | * @returns {Promise.} 114 | */ 115 | export const getOwnDepsDEPRECATED = (packageDir) => { 116 | const node_modules = path.join(packageDir, 'node_modules') 117 | 118 | return fs.access(node_modules) 119 | .then(() => getDirectories(node_modules)) 120 | // Map directories to their package.json 121 | .then(dirs => Promise.all(dirs.map(dir => getPJSON(path.join(packageDir, 'node_modules', dir))))) 122 | // Filter out anything that wasn't a package 123 | .then(configs => configs.filter((v, k) => v)) 124 | 125 | .catch(err => { 126 | // console.log(err) 127 | return [] 128 | }) 129 | } 130 | 131 | export const test = async() => { 132 | 133 | console.log( 134 | Object.values(addPackagesToRegistry({}, await getAllSubPackages('.').map(getPJSON))) 135 | .filter(entry => entry._locations.length > 1) 136 | 137 | ) 138 | 139 | 140 | // console.log(subdir) 141 | } 142 | 143 | export const getSubPackageDirectories = async(packageDir) => { 144 | const node_modules = path.join(packageDir, 'node_modules') 145 | 146 | if (await fs.exists(node_modules)) { 147 | 148 | // Check if node_modules itself is a package (apparently node thought this was a good idea) 149 | if (await isPackageDirectory(node_modules)) return [node_modules] 150 | else { 151 | 152 | const dirs = await getDirectories(node_modules).map(async(dir) => { 153 | // If directory contains a package, return it 154 | if (await isPackageDirectory(dir)) return Promise.resolve([dir]) 155 | // For any that aren't packages themselves check if they're scoped and have children 156 | else return getDirectories(dir).filter(isPackageDirectory) 157 | }) 158 | 159 | return Promise.resolve([].concat.apply([], dirs)) 160 | } 161 | } else return Promise.resolve([]) 162 | } 163 | 164 | export const getAllSubPackages = async(directory) => { 165 | const subPackages = getSubPackageDirectories(directory) 166 | .map(async(dir) => { 167 | return [ 168 | dir, 169 | ...(await getAllSubPackages(dir)) 170 | ] 171 | }) 172 | 173 | return Promise.resolve([].concat.apply([], await subPackages)) 174 | } 175 | 176 | export const addPackagesToRegistry = (registry, packages) => { 177 | 178 | // TODO: This can be made significantly faster by not doing it one by one 179 | // Should take advantage of the fact that we have been given a list 180 | const addPackageToRegistry = (registry, pjson) => { 181 | const existingEntry = registry[pjson._key] || { 182 | _locations: [], 183 | _augmented: false 184 | } 185 | 186 | // merge the two entries, preferring the one that is augmented, then the new one 187 | let entry = { 188 | ...(!existingEntry._augmented ? existingEntry : pjson), 189 | ...(existingEntry._augmented ? existingEntry : pjson), 190 | _locations: _.uniq([...existingEntry._locations, ...pjson._locations]) 191 | } 192 | 193 | return { 194 | ...registry, 195 | [entry._key]: entry 196 | } 197 | } 198 | 199 | return packages.reduce(addPackageToRegistry, {}) 200 | } 201 | 202 | 203 | /** 204 | * Trace the full node_modules tree, and build up a registry on the way. 205 | * 206 | * Registry is of the form: 207 | * { 208 | * 'lodash@1.1.2': { 209 | * name: 'lodash', 210 | * version: '1.1.2', 211 | * config: , 212 | * key: 'lodash@1.1.2', 213 | * location: 'node_modules/lodash' 214 | * }, 215 | * ... 216 | * } 217 | * 218 | * @param directory 219 | * @param name 220 | * @param version 221 | * @param registry 222 | * @returns registry: Array 223 | */ 224 | export const traceModuleTree = (directory, name = false, version = false, registry = {}) => { 225 | 226 | return Promise.resolve({name, version}) 227 | // Resolve the package.json and set name and version from there if either is not specified 228 | .then(({name, version}) => (!name || !version) ? getPJSON(directory) : {name, version}) 229 | 230 | .then(({name, version}) => ( 231 | 232 | // Get the dependencies in node_modules 233 | getOwnDepsDEPRECATED(directory) 234 | 235 | // Merge package { name@version : package.json } into the registry 236 | .then(ownDeps => { 237 | // console.log(ownDeps) 238 | ownDeps.forEach((dep => { 239 | const versionName = dep.name + '@' + dep.version 240 | registry[versionName] = { 241 | name: dep.name, 242 | config: dep, 243 | version: dep.version, 244 | key: versionName, 245 | location: path.join(directory, 'node_modules', dep.name) 246 | } 247 | })) 248 | 249 | return ownDeps 250 | }) 251 | 252 | .then(ownDeps => { 253 | // map each package.json to it's own tree 254 | return Promise.all(ownDeps.map(({name, version}) => { 255 | return traceModuleTree(path.join(directory, 'node_modules', name), name, version, registry) 256 | // Drop the registry 257 | .then(({tree, registry}) => tree) 258 | // map the module and its dep list to a tree entry 259 | })).then(deps => ({name, deps, version: version})) 260 | }) 261 | 262 | .then(tree => ({tree, registry})) 263 | )) 264 | } 265 | 266 | /** 267 | * Take an array of objects and turn it into an object with the key being the specified key. 268 | * 269 | * objectify('name', [ 270 | * {name: 'Alexis', surname: 'Vincent'}, 271 | * {name: 'Julien', surname: 'Vincent'} 272 | * ]) 273 | * 274 | * => 275 | * 276 | * { 277 | * 'Alexis': {name: 'Alexis', surname: 'Vincent'}, 278 | * 'Julien': {name: 'Julien', surname: 'Vincent'}, 279 | * } 280 | * 281 | * @param key 282 | * @param array 283 | * @returns {*} 284 | */ 285 | const objectify = (key, array) => { 286 | return array.reduce((obj, arrayItem) => { 287 | obj[arrayItem[key]] = arrayItem 288 | return obj 289 | }, {}) 290 | } 291 | 292 | /** 293 | * Given a registry of package.json files, use jspm/npm to augment them to be SystemJS compatible 294 | * @param registry 295 | * @returns {Promise.} 296 | */ 297 | export const augmentRegistry = (registry) => { 298 | return Promise.all(Object.keys(registry) 299 | .map(key => { 300 | const depMap = registry[key] 301 | 302 | // Don't augment things that already have been (from the cache) 303 | let shouldAugment = !depMap.augmented 304 | 305 | // Don't augment things that specify config.jspmPackage 306 | if (depMap.config.jspmPackage != undefined && depMap.config.jspmPackage) 307 | shouldAugment = false 308 | 309 | // Don't augment things that specify config.jspmNodeConversion == false 310 | if (depMap.config.jspmNodeConversion !== undefined && !depMap.config.jspmNodeConversion) 311 | shouldAugment = false 312 | 313 | // Don't augment things that specify config.jspm.jspmNodeConversion == false 314 | if (depMap.config.jspm !== undefined 315 | && depMap.config.jspm.jspmNodeConversion !== undefined 316 | && !depMap.config.jspm.jspmNodeConversion) 317 | shouldAugment = false 318 | 319 | // Augment the package.json 320 | return shouldAugment ? 321 | convertPackage(depMap.config, ':' + key, './' + depMap.location, console) 322 | .then(config => Object.assign(depMap, {config, augmented: true})) 323 | .catch(log) : 324 | depMap 325 | })) 326 | .then(objectify.bind(null, 'key')) 327 | } 328 | 329 | /** 330 | * Convenience method to allow easy chaining 331 | * @param tree 332 | * @param registry 333 | */ 334 | export const augmentModuleTree = ({tree, registry}) => augmentRegistry(registry).then(registry => ({tree, registry})) 335 | 336 | /** 337 | * Only keep keys we are interested in for package config generation 338 | * @param registry 339 | * @returns {Promise.<*>} 340 | */ 341 | export const pruneRegistry = (registry) => { 342 | return Promise.resolve( 343 | objectify('key', 344 | Object.keys(registry) 345 | .map(key => { 346 | return Object.assign({}, registry[key], { 347 | config: _.pick( 348 | registry[key].config, [ 349 | 'meta', 350 | 'map', 351 | 'main', 352 | 'format', 353 | 'defaultExtension', 354 | 'defaultJSExtensions' 355 | ]) 356 | }) 357 | } 358 | )) 359 | ) 360 | } 361 | 362 | /** 363 | * Convenience method to allow easy chaining 364 | * @param tree 365 | * @param registry 366 | */ 367 | export const pruneModuleTree = ({tree, registry}) => pruneRegistry(registry).then(registry => ({tree, registry})) 368 | 369 | /** 370 | * Walk the tree, call f on all nodes. 371 | * @param tree 372 | * @param registry 373 | * @param f - (versionName, deps, tree) 374 | * @param depth - How deep should we go 375 | * @param skip - How many levels should we skip 376 | */ 377 | export const walkTree = ({tree, registry}, f, depth = Infinity, skip = 0) => { 378 | if (depth >= 1) { 379 | const {name, deps, version} = tree 380 | 381 | if (skip <= 0) 382 | f(registry[name + '@' + version], deps, tree) 383 | 384 | if (depth >= 2) 385 | deps.forEach(tree => walkTree({tree, registry}, f, depth - 1, skip - 1)) 386 | } 387 | } 388 | 389 | /** 390 | * resolve the package registry entry that should be used given 391 | * @param packageName - name of package to resolve 392 | * @param semverRange - acceptable version range 393 | * @param dir - directory the caller lives in 394 | * @param registry - registry object 395 | */ 396 | const resolvePackage = (packageName, semverRange, dir, registry) => { 397 | return Object.Values(registry) 398 | .filter(({name}) => name == registry) 399 | .filter(({version}) => semver.satisfies(version, semverRange)) 400 | .filter(({location}) => { 401 | location.split('/').indexOf('node_modules') 402 | }) 403 | } 404 | 405 | /** 406 | * Use the tree and registry to create a SystemJS config 407 | * 408 | * TODO: Use SystemJS 20 normalize idempotency to optimize mappings 409 | * // Do this by mapping package@version to location like JSPM does 410 | * 411 | * @param tree 412 | * @param registry 413 | * @returns {Promise.<{map: {}, packages: {}}>} 414 | */ 415 | export const generateConfig = ({tree, registry}) => { 416 | 417 | const systemConfig = { 418 | "map": {}, 419 | "packages": {} 420 | } 421 | 422 | // get readable stream working 423 | // TODO: Fix this hack 424 | systemConfig['map']["_stream_transform"] = "node_modules/readable-stream/transform" 425 | 426 | // Walk first level of dependencies and map package name to location 427 | walkTree({tree, registry}, ({name, config, key, location}, deps) => { 428 | systemConfig['map'][name] = location 429 | }, 2, 1) 430 | 431 | // Walk full dep tree and assign package config entries 432 | walkTree({tree, registry}, ({name, config, key, location}, deps, tree) => { 433 | 434 | // Construct package entry based off config 435 | let packageEntry = Object.assign({ 436 | map: {}, 437 | meta: {} 438 | }, config) 439 | 440 | // Add mappings for it's deps. 441 | walkTree({tree, registry}, ({name, config, key, location}, deps) => { 442 | packageEntry['map'][name] = location 443 | }, 2, 1) 444 | 445 | // If there are no mappings, don't pollute the config 446 | if (Object.keys(packageEntry['map']).length == 0) 447 | delete packageEntry['map'] 448 | 449 | // Assign package entry to config 450 | systemConfig['packages'][location] = packageEntry 451 | 452 | // Add mappings for all jspm-nodelibs 453 | // TODO: Fix this hack 454 | nodeCoreModules.forEach(lib => { 455 | systemConfig['map'][lib] = "node_modules/jspm-nodelibs-" + lib 456 | }) 457 | 458 | }, Infinity, 1) 459 | 460 | // TODO: Make the mappings here more universal 461 | // map nm: -> node_modules/ to make config smaller 462 | systemConfig['paths'] = { 463 | 'nm:': 'node_modules/' 464 | } 465 | 466 | // map nm: -> node_modules/ to make config smaller 467 | Object.keys(systemConfig['map']).forEach(key => { 468 | systemConfig['map'][key] = systemConfig['map'][key].replace(/^node_modules\//, 'nm:') 469 | }) 470 | 471 | // map nm: -> node_modules/ to make config smaller 472 | Object.keys(systemConfig['packages']).forEach(key => { 473 | if (key.startsWith('node_modules/')) { 474 | systemConfig['packages'][key.replace(/^node_modules\//, 'nm:')] = systemConfig['packages'][key] 475 | delete systemConfig['packages'][key] 476 | } 477 | }) 478 | 479 | return Promise.resolve(systemConfig) 480 | } 481 | 482 | // TODO: This needs to be done better (fails if locations of shit changes) 483 | export const mergeCache = (registry, cachedRegistry) => { 484 | return Object.assign({}, registry, cachedRegistry) 485 | } 486 | 487 | export const fromCache = (dehydrateCache) => ({tree, registry}) => { 488 | return dehydrateCache().then(cachedRegistry => { 489 | return {tree, registry: mergeCache(registry, cachedRegistry)} 490 | }) 491 | } 492 | 493 | /** 494 | * Convenience method to allow easy chaining 495 | * @returns {Promise.<{tree: *, registry: *}>} 496 | * @param hydrateCache 497 | */ 498 | export const toCache = (hydrateCache) => ({tree, registry}) => { 499 | return hydrateCache(registry) 500 | .then(() => ({tree, registry})) 501 | } 502 | 503 | export const serializeConfig = config => { 504 | return 'SystemJS.config(' + JSON.stringify(config, null, 2) + ')' 505 | } 506 | 507 | -------------------------------------------------------------------------------- /lib/repl.js: -------------------------------------------------------------------------------- 1 | require("babel-polyfill"); 2 | 3 | requireU = m => { 4 | delete require.cache[require.resolve(m)] 5 | return require(require.resolve(m)) 6 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "systemjs-config-builder", 3 | "version": "0.0.9", 4 | "description": "Generate SystemJS config files from node_modules", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "start": "npm run dev & nodemon -d 1 -w lib && fg", 8 | "dev": "babel lib -d dist --copy-files --watch", 9 | "build": "babel lib -d dist --copy-files" 10 | }, 11 | "repository": { 12 | "url": "https://github.com/alexisvincent/systemjs-config-builder", 13 | "type": "git" 14 | }, 15 | "author": "Alexis Vincent ", 16 | "license": "MIT", 17 | "dependencies": { 18 | "bluebird": "^3.4.6", 19 | "jspm-npm": "^0.30.1", 20 | "lodash": "^4.17.1", 21 | "mz": "^2.6.0", 22 | "semver": "^5.3.0" 23 | }, 24 | "devDependencies": { 25 | "babel-cli": "^6.18.0", 26 | "babel-core": "^6.23.1", 27 | "babel-plugin-transform-object-rest-spread": "^6.23.0", 28 | "babel-polyfill": "^6.23.0", 29 | "babel-preset-env": "^1.1.8" 30 | }, 31 | "babel": { 32 | "presets": [ 33 | "env" 34 | ], 35 | "plugins": [ 36 | "transform-object-rest-spread" 37 | ] 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test/babel/app.js: -------------------------------------------------------------------------------- 1 | import {render} from 'react-dom' 2 | import {DOM} from 'react' 3 | 4 | render( DOM.div({}, "hello world"), document.getElementById('root') ) 5 | -------------------------------------------------------------------------------- /test/babel/config.js: -------------------------------------------------------------------------------- 1 | SystemJS.config({ 2 | transpiler: 'systemjs-plugin-babel', 3 | 4 | // "*.js": { 5 | // loader: 'systemjs-plugin-babel' 6 | // }, 7 | // packages: { 8 | // "app": { 9 | // "meta": { 10 | // }, 11 | // }, 12 | // } 13 | }); 14 | 15 | -------------------------------------------------------------------------------- /test/babel/generated.config.js: -------------------------------------------------------------------------------- 1 | SystemJS.config({ 2 | "map": { 3 | "_stream_transform": "nm:readable-stream/transform", 4 | "asn1.js": "nm:asn1.js", 5 | "base64-js": "nm:base64-js", 6 | "bn.js": "nm:bn.js", 7 | "brorand": "nm:brorand", 8 | "browserify-aes": "nm:browserify-aes", 9 | "browserify-cipher": "nm:browserify-cipher", 10 | "browserify-des": "nm:browserify-des", 11 | "browserify-rsa": "nm:browserify-rsa", 12 | "browserify-sign": "nm:browserify-sign", 13 | "browserify-zlib": "nm:browserify-zlib", 14 | "buffer": "nm:jspm-nodelibs-buffer", 15 | "buffer-shims": "nm:buffer-shims", 16 | "buffer-xor": "nm:buffer-xor", 17 | "builtin-status-codes": "nm:builtin-status-codes", 18 | "cipher-base": "nm:cipher-base", 19 | "core-js": "nm:core-js", 20 | "core-util-is": "nm:core-util-is", 21 | "create-ecdh": "nm:create-ecdh", 22 | "create-hash": "nm:create-hash", 23 | "create-hmac": "nm:create-hmac", 24 | "crypto-browserify": "nm:crypto-browserify", 25 | "des.js": "nm:des.js", 26 | "diffie-hellman": "nm:diffie-hellman", 27 | "domain-browser": "nm:domain-browser", 28 | "elliptic": "nm:elliptic", 29 | "encoding": "nm:encoding", 30 | "evp_bytestokey": "nm:evp_bytestokey", 31 | "fbjs": "nm:fbjs", 32 | "hash.js": "nm:hash.js", 33 | "iconv-lite": "nm:iconv-lite", 34 | "ieee754": "nm:ieee754", 35 | "inherits": "nm:inherits", 36 | "is-stream": "nm:is-stream", 37 | "isarray": "nm:isarray", 38 | "isomorphic-fetch": "nm:isomorphic-fetch", 39 | "js-tokens": "nm:js-tokens", 40 | "jspm-nodelibs-assert": "nm:jspm-nodelibs-assert", 41 | "jspm-nodelibs-buffer": "nm:jspm-nodelibs-buffer", 42 | "jspm-nodelibs-child_process": "nm:jspm-nodelibs-child_process", 43 | "jspm-nodelibs-cluster": "nm:jspm-nodelibs-cluster", 44 | "jspm-nodelibs-console": "nm:jspm-nodelibs-console", 45 | "jspm-nodelibs-constants": "nm:jspm-nodelibs-constants", 46 | "jspm-nodelibs-crypto": "nm:jspm-nodelibs-crypto", 47 | "jspm-nodelibs-dgram": "nm:jspm-nodelibs-dgram", 48 | "jspm-nodelibs-dns": "nm:jspm-nodelibs-dns", 49 | "jspm-nodelibs-domain": "nm:jspm-nodelibs-domain", 50 | "jspm-nodelibs-events": "nm:jspm-nodelibs-events", 51 | "jspm-nodelibs-fs": "nm:jspm-nodelibs-fs", 52 | "jspm-nodelibs-http": "nm:jspm-nodelibs-http", 53 | "jspm-nodelibs-https": "nm:jspm-nodelibs-https", 54 | "jspm-nodelibs-module": "nm:jspm-nodelibs-module", 55 | "jspm-nodelibs-net": "nm:jspm-nodelibs-net", 56 | "jspm-nodelibs-os": "nm:jspm-nodelibs-os", 57 | "jspm-nodelibs-path": "nm:jspm-nodelibs-path", 58 | "jspm-nodelibs-process": "nm:jspm-nodelibs-process", 59 | "jspm-nodelibs-punycode": "nm:jspm-nodelibs-punycode", 60 | "jspm-nodelibs-querystring": "nm:jspm-nodelibs-querystring", 61 | "jspm-nodelibs-readline": "nm:jspm-nodelibs-readline", 62 | "jspm-nodelibs-repl": "nm:jspm-nodelibs-repl", 63 | "jspm-nodelibs-stream": "nm:jspm-nodelibs-stream", 64 | "jspm-nodelibs-string_decoder": "nm:jspm-nodelibs-string_decoder", 65 | "jspm-nodelibs-timers": "nm:jspm-nodelibs-timers", 66 | "jspm-nodelibs-tls": "nm:jspm-nodelibs-tls", 67 | "jspm-nodelibs-tty": "nm:jspm-nodelibs-tty", 68 | "jspm-nodelibs-url": "nm:jspm-nodelibs-url", 69 | "jspm-nodelibs-util": "nm:jspm-nodelibs-util", 70 | "jspm-nodelibs-vm": "nm:jspm-nodelibs-vm", 71 | "jspm-nodelibs-zlib": "nm:jspm-nodelibs-zlib", 72 | "loose-envify": "nm:loose-envify", 73 | "miller-rabin": "nm:miller-rabin", 74 | "minimalistic-assert": "nm:minimalistic-assert", 75 | "node-fetch": "nm:node-fetch", 76 | "object-assign": "nm:object-assign", 77 | "os-browserify": "nm:os-browserify", 78 | "pako": "nm:pako", 79 | "parse-asn1": "nm:parse-asn1", 80 | "pbkdf2": "nm:pbkdf2", 81 | "process": "nm:jspm-nodelibs-process", 82 | "process-nextick-args": "nm:process-nextick-args", 83 | "promise": "nm:promise", 84 | "public-encrypt": "nm:public-encrypt", 85 | "punycode": "nm:jspm-nodelibs-punycode", 86 | "querystring": "nm:jspm-nodelibs-querystring", 87 | "randombytes": "nm:randombytes", 88 | "react": "nm:react", 89 | "react-dom": "nm:react-dom", 90 | "readable-stream": "nm:readable-stream", 91 | "ripemd160": "nm:ripemd160", 92 | "sha.js": "nm:sha.js", 93 | "stream-browserify": "nm:stream-browserify", 94 | "stream-http": "nm:stream-http", 95 | "string_decoder": "nm:jspm-nodelibs-string_decoder", 96 | "systemjs": "nm:systemjs", 97 | "systemjs-nodelibs": "nm:systemjs-nodelibs", 98 | "systemjs-plugin-babel": "nm:systemjs-plugin-babel", 99 | "timers-browserify": "nm:timers-browserify", 100 | "to-arraybuffer": "nm:to-arraybuffer", 101 | "ua-parser-js": "nm:ua-parser-js", 102 | "url": "nm:jspm-nodelibs-url", 103 | "util-deprecate": "nm:util-deprecate", 104 | "whatwg-fetch": "nm:whatwg-fetch", 105 | "when": "nm:when", 106 | "xtend": "nm:xtend", 107 | "assert": "nm:jspm-nodelibs-assert", 108 | "child_process": "nm:jspm-nodelibs-child_process", 109 | "cluster": "nm:jspm-nodelibs-cluster", 110 | "console": "nm:jspm-nodelibs-console", 111 | "constants": "nm:jspm-nodelibs-constants", 112 | "crypto": "nm:jspm-nodelibs-crypto", 113 | "dgram": "nm:jspm-nodelibs-dgram", 114 | "dns": "nm:jspm-nodelibs-dns", 115 | "domain": "nm:jspm-nodelibs-domain", 116 | "events": "nm:jspm-nodelibs-events", 117 | "fs": "nm:jspm-nodelibs-fs", 118 | "http": "nm:jspm-nodelibs-http", 119 | "https": "nm:jspm-nodelibs-https", 120 | "module": "nm:jspm-nodelibs-module", 121 | "net": "nm:jspm-nodelibs-net", 122 | "os": "nm:jspm-nodelibs-os", 123 | "path": "nm:jspm-nodelibs-path", 124 | "readline": "nm:jspm-nodelibs-readline", 125 | "repl": "nm:jspm-nodelibs-repl", 126 | "stream": "nm:jspm-nodelibs-stream", 127 | "sys": "nm:jspm-nodelibs-sys", 128 | "timers": "nm:jspm-nodelibs-timers", 129 | "tls": "nm:jspm-nodelibs-tls", 130 | "tty": "nm:jspm-nodelibs-tty", 131 | "util": "nm:jspm-nodelibs-util", 132 | "vm": "nm:jspm-nodelibs-vm", 133 | "zlib": "nm:jspm-nodelibs-zlib" 134 | }, 135 | "packages": { 136 | "nm:asn1.js": { 137 | "map": { 138 | "./lib/asn1/base": "./lib/asn1/base/index.js", 139 | "./lib/asn1/constants": "./lib/asn1/constants/index.js", 140 | "./lib/asn1/decoders": "./lib/asn1/decoders/index.js", 141 | "./lib/asn1/encoders": "./lib/asn1/encoders/index.js" 142 | }, 143 | "meta": { 144 | "*.json": { 145 | "format": "json" 146 | }, 147 | "lib/asn1/base/buffer.js": { 148 | "globals": { 149 | "Buffer": "buffer/global" 150 | } 151 | }, 152 | "lib/asn1/decoders/pem.js": { 153 | "globals": { 154 | "Buffer": "buffer/global" 155 | } 156 | }, 157 | "lib/asn1/encoders/der.js": { 158 | "globals": { 159 | "Buffer": "buffer/global" 160 | } 161 | } 162 | }, 163 | "main": "lib/asn1.js", 164 | "format": "cjs" 165 | }, 166 | "nm:base64-js": { 167 | "meta": { 168 | "*.json": { 169 | "format": "json" 170 | } 171 | }, 172 | "main": "index.js", 173 | "format": "cjs" 174 | }, 175 | "nm:bn.js": { 176 | "meta": { 177 | "*.json": { 178 | "format": "json" 179 | }, 180 | "test/constructor-test.js": { 181 | "globals": { 182 | "Buffer": "buffer/global" 183 | } 184 | }, 185 | "test/pummel/*": { 186 | "globals": { 187 | "Buffer": "buffer/global" 188 | } 189 | }, 190 | "test/red-test.js": { 191 | "globals": { 192 | "Buffer": "buffer/global" 193 | } 194 | } 195 | }, 196 | "main": "lib/bn.js", 197 | "format": "cjs" 198 | }, 199 | "nm:brorand": { 200 | "map": { 201 | "crypto": { 202 | "browser": "@empty" 203 | } 204 | }, 205 | "meta": { 206 | "*.json": { 207 | "format": "json" 208 | } 209 | }, 210 | "main": "index.js", 211 | "format": "cjs" 212 | }, 213 | "nm:browserify-aes": { 214 | "map": { 215 | "./index.js": { 216 | "browser": "./browser.js" 217 | } 218 | }, 219 | "meta": { 220 | "*.json": { 221 | "format": "json" 222 | }, 223 | "aes.js": { 224 | "globals": { 225 | "Buffer": "buffer/global" 226 | } 227 | }, 228 | "authCipher.js": { 229 | "globals": { 230 | "Buffer": "buffer/global" 231 | } 232 | }, 233 | "decrypter.js": { 234 | "globals": { 235 | "Buffer": "buffer/global" 236 | } 237 | }, 238 | "encrypter.js": { 239 | "globals": { 240 | "Buffer": "buffer/global" 241 | } 242 | }, 243 | "ghash.js": { 244 | "globals": { 245 | "Buffer": "buffer/global" 246 | } 247 | }, 248 | "modes/cfb.js": { 249 | "globals": { 250 | "Buffer": "buffer/global" 251 | } 252 | }, 253 | "modes/cfb1.js": { 254 | "globals": { 255 | "Buffer": "buffer/global" 256 | } 257 | }, 258 | "modes/cfb8.js": { 259 | "globals": { 260 | "Buffer": "buffer/global" 261 | } 262 | }, 263 | "modes/ctr.js": { 264 | "globals": { 265 | "Buffer": "buffer/global" 266 | } 267 | }, 268 | "modes/ofb.js": { 269 | "globals": { 270 | "Buffer": "buffer/global" 271 | } 272 | }, 273 | "populateFixtures.js": { 274 | "globals": { 275 | "Buffer": "buffer/global" 276 | } 277 | }, 278 | "streamCipher.js": { 279 | "globals": { 280 | "Buffer": "buffer/global" 281 | } 282 | } 283 | }, 284 | "main": "index.js", 285 | "format": "cjs" 286 | }, 287 | "nm:browserify-cipher": { 288 | "map": { 289 | "./index.js": { 290 | "browser": "./browser.js" 291 | } 292 | }, 293 | "meta": { 294 | "*.json": { 295 | "format": "json" 296 | }, 297 | "test.js": { 298 | "globals": { 299 | "Buffer": "buffer/global" 300 | } 301 | } 302 | }, 303 | "main": "index.js", 304 | "format": "cjs" 305 | }, 306 | "nm:browserify-des": { 307 | "meta": { 308 | "*.json": { 309 | "format": "json" 310 | }, 311 | "index.js": { 312 | "globals": { 313 | "Buffer": "buffer/global" 314 | } 315 | }, 316 | "test.js": { 317 | "globals": { 318 | "Buffer": "buffer/global" 319 | } 320 | } 321 | }, 322 | "main": "index.js", 323 | "format": "cjs" 324 | }, 325 | "nm:browserify-rsa": { 326 | "meta": { 327 | "*.json": { 328 | "format": "json" 329 | }, 330 | "index.js": { 331 | "globals": { 332 | "Buffer": "buffer/global" 333 | } 334 | }, 335 | "test.js": { 336 | "globals": { 337 | "Buffer": "buffer/global" 338 | } 339 | } 340 | }, 341 | "main": "index.js", 342 | "format": "cjs" 343 | }, 344 | "nm:browserify-sign": { 345 | "map": { 346 | "./index.js": { 347 | "browser": "./browser.js" 348 | } 349 | }, 350 | "meta": { 351 | "*.json": { 352 | "format": "json" 353 | }, 354 | "algos.js": { 355 | "globals": { 356 | "Buffer": "buffer/global" 357 | } 358 | }, 359 | "browser.js": { 360 | "globals": { 361 | "Buffer": "buffer/global" 362 | } 363 | }, 364 | "sign.js": { 365 | "globals": { 366 | "Buffer": "buffer/global" 367 | } 368 | }, 369 | "verify.js": { 370 | "globals": { 371 | "Buffer": "buffer/global" 372 | } 373 | } 374 | }, 375 | "main": "index.js", 376 | "format": "cjs" 377 | }, 378 | "nm:browserify-zlib": { 379 | "map": { 380 | "./src": "./src/index.js" 381 | }, 382 | "meta": { 383 | "*": { 384 | "globals": { 385 | "process": "process" 386 | } 387 | }, 388 | "*.json": { 389 | "format": "json" 390 | }, 391 | "src/*": { 392 | "globals": { 393 | "Buffer": "buffer/global" 394 | } 395 | }, 396 | "test/ignored/*": { 397 | "globals": { 398 | "Buffer": "buffer/global" 399 | } 400 | }, 401 | "test/test-zlib-convenience-methods.js": { 402 | "globals": { 403 | "Buffer": "buffer/global" 404 | } 405 | }, 406 | "test/test-zlib-from-string.js": { 407 | "globals": { 408 | "Buffer": "buffer/global" 409 | } 410 | }, 411 | "test/test-zlib-random-byte-pipes.js": { 412 | "globals": { 413 | "Buffer": "buffer/global" 414 | } 415 | }, 416 | "test/test-zlib-zero-byte.js": { 417 | "globals": { 418 | "Buffer": "buffer/global" 419 | } 420 | }, 421 | "test/test-zlib.js": { 422 | "globals": { 423 | "Buffer": "buffer/global" 424 | } 425 | } 426 | }, 427 | "main": "src/index.js", 428 | "format": "cjs" 429 | }, 430 | "nm:buffer": { 431 | "meta": { 432 | "*.json": { 433 | "format": "json" 434 | }, 435 | "test/constructor.js": { 436 | "globals": { 437 | "Buffer": "buffer/global" 438 | } 439 | }, 440 | "test/node/*": { 441 | "globals": { 442 | "Buffer": "buffer/global" 443 | } 444 | } 445 | }, 446 | "main": "index.js", 447 | "format": "cjs" 448 | }, 449 | "nm:buffer-shims": { 450 | "meta": { 451 | "*.json": { 452 | "format": "json" 453 | }, 454 | "index.js": { 455 | "globals": { 456 | "Buffer": "buffer/global" 457 | } 458 | } 459 | }, 460 | "main": "index.js", 461 | "format": "cjs" 462 | }, 463 | "nm:buffer-xor": { 464 | "map": { 465 | "./test": "./test/index.js", 466 | "./test/fixtures": "./test/fixtures.json" 467 | }, 468 | "meta": { 469 | "*.json": { 470 | "format": "json" 471 | }, 472 | "index.js": { 473 | "globals": { 474 | "Buffer": "buffer/global" 475 | } 476 | }, 477 | "test/index.js": { 478 | "globals": { 479 | "Buffer": "buffer/global" 480 | } 481 | } 482 | }, 483 | "main": "index.js", 484 | "format": "cjs" 485 | }, 486 | "nm:builtin-status-codes": { 487 | "map": { 488 | "./index.js": { 489 | "browser": "./browser.js" 490 | } 491 | }, 492 | "meta": { 493 | "*.json": { 494 | "format": "json" 495 | } 496 | }, 497 | "main": "index.js", 498 | "format": "cjs" 499 | }, 500 | "nm:cipher-base": { 501 | "meta": { 502 | "*.json": { 503 | "format": "json" 504 | }, 505 | "index.js": { 506 | "globals": { 507 | "Buffer": "buffer/global" 508 | } 509 | }, 510 | "test.js": { 511 | "globals": { 512 | "Buffer": "buffer/global" 513 | } 514 | } 515 | }, 516 | "main": "index.js", 517 | "format": "cjs" 518 | }, 519 | "nm:core-js": { 520 | "map": { 521 | "./build": "./build/index.js", 522 | "./core": "./core/index.js", 523 | "./es5": "./es5/index.js", 524 | "./es6": "./es6/index.js", 525 | "./es7": "./es7/index.js", 526 | "./fn/array": "./fn/array/index.js", 527 | "./fn/function": "./fn/function/index.js", 528 | "./fn/html-collection": "./fn/html-collection/index.js", 529 | "./fn/math": "./fn/math/index.js", 530 | "./fn/node-list": "./fn/node-list/index.js", 531 | "./fn/number": "./fn/number/index.js", 532 | "./fn/object": "./fn/object/index.js", 533 | "./fn/reflect": "./fn/reflect/index.js", 534 | "./fn/regexp": "./fn/regexp/index.js", 535 | "./fn/string": "./fn/string/index.js", 536 | "./fn/symbol": "./fn/symbol/index.js", 537 | "./js": "./js/index.js", 538 | "./library": "./library/index.js", 539 | "./library/core": "./library/core/index.js", 540 | "./library/es5": "./library/es5/index.js", 541 | "./library/es6": "./library/es6/index.js", 542 | "./library/es7": "./library/es7/index.js", 543 | "./library/fn/array": "./library/fn/array/index.js", 544 | "./library/fn/function": "./library/fn/function/index.js", 545 | "./library/fn/html-collection": "./library/fn/html-collection/index.js", 546 | "./library/fn/math": "./library/fn/math/index.js", 547 | "./library/fn/node-list": "./library/fn/node-list/index.js", 548 | "./library/fn/number": "./library/fn/number/index.js", 549 | "./library/fn/object": "./library/fn/object/index.js", 550 | "./library/fn/reflect": "./library/fn/reflect/index.js", 551 | "./library/fn/regexp": "./library/fn/regexp/index.js", 552 | "./library/fn/string": "./library/fn/string/index.js", 553 | "./library/fn/symbol": "./library/fn/symbol/index.js", 554 | "./library/js": "./library/js/index.js", 555 | "./library/web": "./library/web/index.js", 556 | "./package": "./package.json", 557 | "./web": "./web/index.js" 558 | }, 559 | "meta": { 560 | "*": { 561 | "globals": { 562 | "process": "process" 563 | } 564 | }, 565 | "*.json": { 566 | "format": "json" 567 | } 568 | }, 569 | "main": "index.js", 570 | "format": "cjs" 571 | }, 572 | "nm:core-util-is": { 573 | "meta": { 574 | "*.json": { 575 | "format": "json" 576 | }, 577 | "lib/*": { 578 | "globals": { 579 | "Buffer": "buffer/global" 580 | } 581 | }, 582 | "test.js": { 583 | "globals": { 584 | "Buffer": "buffer/global" 585 | } 586 | } 587 | }, 588 | "main": "lib/util.js", 589 | "format": "cjs" 590 | }, 591 | "nm:create-ecdh": { 592 | "map": { 593 | "./index.js": { 594 | "browser": "./browser.js" 595 | } 596 | }, 597 | "meta": { 598 | "*.json": { 599 | "format": "json" 600 | }, 601 | "browser.js": { 602 | "globals": { 603 | "Buffer": "buffer/global" 604 | } 605 | } 606 | }, 607 | "main": "index.js", 608 | "format": "cjs" 609 | }, 610 | "nm:create-hash": { 611 | "map": { 612 | "./index.js": { 613 | "browser": "./browser.js" 614 | } 615 | }, 616 | "meta": { 617 | "*.json": { 618 | "format": "json" 619 | }, 620 | "browser.js": { 621 | "globals": { 622 | "Buffer": "buffer/global" 623 | } 624 | }, 625 | "helpers.js": { 626 | "globals": { 627 | "Buffer": "buffer/global" 628 | } 629 | }, 630 | "test.js": { 631 | "globals": { 632 | "Buffer": "buffer/global" 633 | } 634 | } 635 | }, 636 | "main": "index.js", 637 | "format": "cjs" 638 | }, 639 | "nm:create-hmac": { 640 | "map": { 641 | "./index.js": { 642 | "browser": "./browser.js" 643 | } 644 | }, 645 | "meta": { 646 | "*.json": { 647 | "format": "json" 648 | }, 649 | "browser.js": { 650 | "globals": { 651 | "Buffer": "buffer/global" 652 | } 653 | }, 654 | "test.js": { 655 | "globals": { 656 | "Buffer": "buffer/global" 657 | } 658 | } 659 | }, 660 | "main": "index.js", 661 | "format": "cjs" 662 | }, 663 | "nm:crypto-browserify": { 664 | "map": { 665 | "./test": "./test/index.js", 666 | "crypto": { 667 | "browser": "@empty" 668 | }, 669 | "crypto-browserify": "." 670 | }, 671 | "meta": { 672 | "*": { 673 | "globals": { 674 | "process": "process" 675 | } 676 | }, 677 | "*.json": { 678 | "format": "json" 679 | }, 680 | "test/aes.js": { 681 | "globals": { 682 | "Buffer": "buffer/global" 683 | } 684 | }, 685 | "test/create-hash.js": { 686 | "globals": { 687 | "Buffer": "buffer/global" 688 | } 689 | }, 690 | "test/create-hmac.js": { 691 | "globals": { 692 | "Buffer": "buffer/global" 693 | } 694 | }, 695 | "test/public-encrypt.js": { 696 | "globals": { 697 | "Buffer": "buffer/global" 698 | } 699 | }, 700 | "test/random-bytes.js": { 701 | "globals": { 702 | "Buffer": "buffer/global" 703 | } 704 | }, 705 | "test/sign.js": { 706 | "globals": { 707 | "Buffer": "buffer/global" 708 | } 709 | } 710 | }, 711 | "main": "index.js", 712 | "format": "cjs" 713 | }, 714 | "nm:des.js": { 715 | "meta": { 716 | "*.json": { 717 | "format": "json" 718 | }, 719 | "test/cbc-test.js": { 720 | "globals": { 721 | "Buffer": "buffer/global" 722 | } 723 | }, 724 | "test/des-test.js": { 725 | "globals": { 726 | "Buffer": "buffer/global" 727 | } 728 | }, 729 | "test/ede-test.js": { 730 | "globals": { 731 | "Buffer": "buffer/global" 732 | } 733 | } 734 | }, 735 | "main": "lib/des.js", 736 | "format": "cjs" 737 | }, 738 | "nm:diffie-hellman": { 739 | "map": { 740 | "./index.js": { 741 | "browser": "./browser.js" 742 | } 743 | }, 744 | "meta": { 745 | "*.json": { 746 | "format": "json" 747 | }, 748 | "browser.js": { 749 | "globals": { 750 | "Buffer": "buffer/global" 751 | } 752 | }, 753 | "lib/dh.js": { 754 | "globals": { 755 | "Buffer": "buffer/global" 756 | } 757 | } 758 | }, 759 | "main": "index.js", 760 | "format": "cjs" 761 | }, 762 | "nm:domain-browser": { 763 | "meta": { 764 | "*.json": { 765 | "format": "json" 766 | } 767 | }, 768 | "main": "index.js", 769 | "format": "cjs" 770 | }, 771 | "nm:elliptic": { 772 | "map": { 773 | "./lib/elliptic/curve": "./lib/elliptic/curve/index.js", 774 | "./lib/elliptic/ec": "./lib/elliptic/ec/index.js", 775 | "./lib/elliptic/eddsa": "./lib/elliptic/eddsa/index.js" 776 | }, 777 | "meta": { 778 | "*.json": { 779 | "format": "json" 780 | } 781 | }, 782 | "main": "lib/elliptic.js", 783 | "format": "cjs" 784 | }, 785 | "nm:encoding": { 786 | "meta": { 787 | "*.json": { 788 | "format": "json" 789 | }, 790 | "lib/encoding.js": { 791 | "globals": { 792 | "Buffer": "buffer/global" 793 | } 794 | }, 795 | "test/*": { 796 | "globals": { 797 | "Buffer": "buffer/global" 798 | } 799 | } 800 | }, 801 | "main": "lib/encoding.js", 802 | "format": "cjs" 803 | }, 804 | "nm:evp_bytestokey": { 805 | "meta": { 806 | "*.json": { 807 | "format": "json" 808 | }, 809 | "index.js": { 810 | "globals": { 811 | "Buffer": "buffer/global" 812 | } 813 | } 814 | }, 815 | "main": "index.js", 816 | "format": "cjs" 817 | }, 818 | "nm:fbjs": { 819 | "meta": { 820 | "*": { 821 | "globals": { 822 | "process": "process" 823 | } 824 | }, 825 | "*.json": { 826 | "format": "json" 827 | } 828 | }, 829 | "main": "index.js", 830 | "format": "cjs" 831 | }, 832 | "nm:hash.js": { 833 | "meta": { 834 | "*.json": { 835 | "format": "json" 836 | } 837 | }, 838 | "main": "lib/hash.js", 839 | "format": "cjs" 840 | }, 841 | "nm:iconv-lite": { 842 | "map": { 843 | "./encodings": "./encodings/index.js", 844 | "./extend-node": { 845 | "browser": "@empty" 846 | }, 847 | "./lib": "./lib/index.js", 848 | "./streams": { 849 | "browser": "@empty" 850 | } 851 | }, 852 | "meta": { 853 | "*": { 854 | "globals": { 855 | "process": "process" 856 | } 857 | }, 858 | "*.json": { 859 | "format": "json" 860 | }, 861 | "encodings/dbcs-codec.js": { 862 | "globals": { 863 | "Buffer": "buffer/global" 864 | } 865 | }, 866 | "encodings/internal.js": { 867 | "globals": { 868 | "Buffer": "buffer/global" 869 | } 870 | }, 871 | "encodings/sbcs-codec.js": { 872 | "globals": { 873 | "Buffer": "buffer/global" 874 | } 875 | }, 876 | "encodings/utf16.js": { 877 | "globals": { 878 | "Buffer": "buffer/global" 879 | } 880 | }, 881 | "encodings/utf7.js": { 882 | "globals": { 883 | "Buffer": "buffer/global" 884 | } 885 | }, 886 | "lib/extend-node.js": { 887 | "globals": { 888 | "Buffer": "buffer/global" 889 | } 890 | }, 891 | "lib/index.js": { 892 | "globals": { 893 | "Buffer": "buffer/global" 894 | } 895 | }, 896 | "lib/streams.js": { 897 | "globals": { 898 | "Buffer": "buffer/global" 899 | } 900 | } 901 | }, 902 | "main": "lib/index.js", 903 | "format": "cjs" 904 | }, 905 | "nm:ieee754": { 906 | "meta": { 907 | "*.json": { 908 | "format": "json" 909 | }, 910 | "test/*": { 911 | "globals": { 912 | "Buffer": "buffer/global" 913 | } 914 | } 915 | }, 916 | "main": "index.js", 917 | "format": "cjs" 918 | }, 919 | "nm:inherits": { 920 | "map": { 921 | "./inherits.js": { 922 | "browser": "./inherits_browser.js" 923 | } 924 | }, 925 | "meta": { 926 | "*.json": { 927 | "format": "json" 928 | } 929 | }, 930 | "main": "inherits.js", 931 | "format": "cjs" 932 | }, 933 | "nm:is-stream": { 934 | "meta": { 935 | "*.json": { 936 | "format": "json" 937 | } 938 | }, 939 | "main": "index.js", 940 | "format": "cjs" 941 | }, 942 | "nm:isarray": { 943 | "meta": { 944 | "*.json": { 945 | "format": "json" 946 | } 947 | }, 948 | "main": "index.js", 949 | "format": "cjs" 950 | }, 951 | "nm:isomorphic-fetch": { 952 | "map": { 953 | "./fetch-npm-node.js": { 954 | "browser": "./fetch-npm-browserify.js" 955 | } 956 | }, 957 | "meta": { 958 | "*.json": { 959 | "format": "json" 960 | } 961 | }, 962 | "main": "fetch-npm-node.js", 963 | "format": "cjs" 964 | }, 965 | "nm:js-tokens": { 966 | "meta": { 967 | "*.json": { 968 | "format": "json" 969 | } 970 | }, 971 | "main": "index.js", 972 | "format": "cjs" 973 | }, 974 | "nm:jspm-nodelibs-assert": { 975 | "map": { 976 | "./assert.js": { 977 | "node": "@node/assert" 978 | } 979 | }, 980 | "meta": {}, 981 | "main": "assert.js" 982 | }, 983 | "nm:jspm-nodelibs-buffer": { 984 | "map": { 985 | "./buffer.js": { 986 | "node": "@node/buffer", 987 | "browser": "node_modules/buffer" 988 | } 989 | }, 990 | "meta": {}, 991 | "main": "buffer.js" 992 | }, 993 | "nm:jspm-nodelibs-child_process": { 994 | "map": { 995 | "./child_process.js": { 996 | "node": "@node/child_process" 997 | } 998 | }, 999 | "meta": {}, 1000 | "main": "./child_process.js" 1001 | }, 1002 | "nm:jspm-nodelibs-cluster": { 1003 | "map": { 1004 | "./cluster.js": { 1005 | "node": "@node/cluster" 1006 | } 1007 | }, 1008 | "meta": {}, 1009 | "main": "./cluster.js" 1010 | }, 1011 | "nm:jspm-nodelibs-console": { 1012 | "map": { 1013 | "./console.js": { 1014 | "node": "@node/console" 1015 | } 1016 | }, 1017 | "meta": {}, 1018 | "main": "./console.js" 1019 | }, 1020 | "nm:jspm-nodelibs-constants": { 1021 | "map": { 1022 | "./constants.js": { 1023 | "node": "@node/constants" 1024 | } 1025 | }, 1026 | "meta": {}, 1027 | "main": "constants.js" 1028 | }, 1029 | "nm:jspm-nodelibs-crypto": { 1030 | "map": { 1031 | "./crypto.js": { 1032 | "node": "@node/crypto", 1033 | "browser": "crypto-browserify" 1034 | } 1035 | }, 1036 | "meta": {}, 1037 | "main": "./crypto.js" 1038 | }, 1039 | "nm:jspm-nodelibs-dgram": { 1040 | "map": { 1041 | "./dgram.js": { 1042 | "node": "@node/dgram" 1043 | } 1044 | }, 1045 | "meta": {}, 1046 | "main": "./dgram.js" 1047 | }, 1048 | "nm:jspm-nodelibs-dns": { 1049 | "map": { 1050 | "./dns.js": { 1051 | "node": "@node/dns" 1052 | } 1053 | }, 1054 | "meta": {}, 1055 | "main": "./dns.js" 1056 | }, 1057 | "nm:jspm-nodelibs-domain": { 1058 | "map": { 1059 | "./domain.js": { 1060 | "node": "@node/domain", 1061 | "browser": "domain-browser" 1062 | } 1063 | }, 1064 | "meta": {}, 1065 | "main": "./domain.js" 1066 | }, 1067 | "nm:jspm-nodelibs-events": { 1068 | "map": { 1069 | "./events.js": { 1070 | "node": "@node/events" 1071 | } 1072 | }, 1073 | "meta": {}, 1074 | "main": "./events.js" 1075 | }, 1076 | "nm:jspm-nodelibs-fs": { 1077 | "map": { 1078 | "./fs.js": { 1079 | "node": "@node/fs" 1080 | } 1081 | }, 1082 | "meta": {}, 1083 | "main": "./fs.js" 1084 | }, 1085 | "nm:jspm-nodelibs-http": { 1086 | "map": { 1087 | "./http.js": { 1088 | "node": "@node/http", 1089 | "browser": "stream-http" 1090 | } 1091 | }, 1092 | "meta": {}, 1093 | "main": "./http.js" 1094 | }, 1095 | "nm:jspm-nodelibs-https": { 1096 | "map": { 1097 | "./https.js": { 1098 | "node": "@node/https" 1099 | } 1100 | }, 1101 | "meta": {}, 1102 | "main": "./https.js" 1103 | }, 1104 | "nm:jspm-nodelibs-module": { 1105 | "map": { 1106 | "./module.js": { 1107 | "node": "@node/module", 1108 | "browser": "@empty" 1109 | } 1110 | }, 1111 | "meta": {}, 1112 | "main": "./module.js" 1113 | }, 1114 | "nm:jspm-nodelibs-net": { 1115 | "map": { 1116 | "./net.js": { 1117 | "node": "@node/net" 1118 | } 1119 | }, 1120 | "meta": {}, 1121 | "main": "./net.js" 1122 | }, 1123 | "nm:jspm-nodelibs-os": { 1124 | "map": { 1125 | "./os.js": { 1126 | "node": "@node/os", 1127 | "browser": "os-browserify" 1128 | } 1129 | }, 1130 | "meta": {}, 1131 | "main": "./os.js" 1132 | }, 1133 | "nm:jspm-nodelibs-path": { 1134 | "map": { 1135 | "./path.js": { 1136 | "node": "@node/path" 1137 | } 1138 | }, 1139 | "meta": {}, 1140 | "main": "./path.js" 1141 | }, 1142 | "nm:jspm-nodelibs-process": { 1143 | "map": { 1144 | "./process.js": { 1145 | "node": "./process-node.js" 1146 | } 1147 | }, 1148 | "meta": {}, 1149 | "main": "./process.js" 1150 | }, 1151 | "nm:jspm-nodelibs-punycode": { 1152 | "map": { 1153 | "./punycode.js": { 1154 | "node": "@node/punycode", 1155 | "browser": "punycode" 1156 | } 1157 | }, 1158 | "meta": {}, 1159 | "main": "./punycode.js" 1160 | }, 1161 | "nm:jspm-nodelibs-querystring": { 1162 | "map": { 1163 | "./querystring.js": { 1164 | "node": "@node/querystring" 1165 | } 1166 | }, 1167 | "meta": {}, 1168 | "main": "./querystring.js" 1169 | }, 1170 | "nm:jspm-nodelibs-readline": { 1171 | "map": { 1172 | "./readline.js": { 1173 | "node": "@node/readline" 1174 | } 1175 | }, 1176 | "meta": {}, 1177 | "main": "./readline.js" 1178 | }, 1179 | "nm:jspm-nodelibs-repl": { 1180 | "map": { 1181 | "./repl.js": { 1182 | "node": "@node/repl" 1183 | } 1184 | }, 1185 | "meta": {}, 1186 | "main": "./repl.js" 1187 | }, 1188 | "nm:jspm-nodelibs-stream": { 1189 | "map": { 1190 | "./stream.js": { 1191 | "node": "@node/stream", 1192 | "browser": "stream-browserify" 1193 | } 1194 | }, 1195 | "meta": {}, 1196 | "main": "./stream.js" 1197 | }, 1198 | "nm:jspm-nodelibs-string_decoder": { 1199 | "map": { 1200 | "./string_decoder.js": { 1201 | "node": "@node/string_decoder", 1202 | "browser": "string_decoder" 1203 | } 1204 | }, 1205 | "meta": {}, 1206 | "main": "./string_decoder.js" 1207 | }, 1208 | "nm:jspm-nodelibs-timers": { 1209 | "map": { 1210 | "./timers.js": { 1211 | "node": "@node/timers", 1212 | "browser": "timers-browserify" 1213 | } 1214 | }, 1215 | "meta": {}, 1216 | "main": "./timers.js" 1217 | }, 1218 | "nm:jspm-nodelibs-tls": { 1219 | "map": { 1220 | "./tls.js": { 1221 | "node": "@node/tls" 1222 | } 1223 | }, 1224 | "meta": {}, 1225 | "main": "./tls.js" 1226 | }, 1227 | "nm:jspm-nodelibs-tty": { 1228 | "map": { 1229 | "./tty.js": { 1230 | "node": "@node/tty" 1231 | } 1232 | }, 1233 | "meta": {}, 1234 | "main": "./tty.js" 1235 | }, 1236 | "nm:jspm-nodelibs-url": { 1237 | "map": { 1238 | "./url.js": { 1239 | "node": "@node/url", 1240 | "browser": "url" 1241 | } 1242 | }, 1243 | "meta": {}, 1244 | "main": "./url.js" 1245 | }, 1246 | "nm:jspm-nodelibs-util": { 1247 | "map": { 1248 | "./isBuffer.js": { 1249 | "~node": "./isBufferBrowser.js" 1250 | }, 1251 | "./util.js": { 1252 | "node": "@node/util" 1253 | } 1254 | }, 1255 | "meta": {}, 1256 | "main": "./util.js" 1257 | }, 1258 | "nm:jspm-nodelibs-vm": { 1259 | "map": { 1260 | "./vm.js": { 1261 | "node": "@node/vm" 1262 | } 1263 | }, 1264 | "meta": {}, 1265 | "main": "./vm.js" 1266 | }, 1267 | "nm:jspm-nodelibs-zlib": { 1268 | "map": { 1269 | "./zlib.js": { 1270 | "node": "@node/zlib", 1271 | "browser": "browserify-zlib" 1272 | } 1273 | }, 1274 | "meta": {}, 1275 | "main": "./zlib.js" 1276 | }, 1277 | "nm:loose-envify": { 1278 | "meta": { 1279 | "*": { 1280 | "globals": { 1281 | "process": "process" 1282 | } 1283 | }, 1284 | "*.json": { 1285 | "format": "json" 1286 | } 1287 | }, 1288 | "main": "index.js", 1289 | "format": "cjs" 1290 | }, 1291 | "nm:miller-rabin": { 1292 | "meta": { 1293 | "*.json": { 1294 | "format": "json" 1295 | } 1296 | }, 1297 | "main": "lib/mr.js", 1298 | "format": "cjs" 1299 | }, 1300 | "nm:minimalistic-assert": { 1301 | "meta": { 1302 | "*.json": { 1303 | "format": "json" 1304 | } 1305 | }, 1306 | "main": "index.js", 1307 | "format": "cjs" 1308 | }, 1309 | "nm:node-fetch": { 1310 | "meta": { 1311 | "*.json": { 1312 | "format": "json" 1313 | }, 1314 | "index.js": { 1315 | "globals": { 1316 | "Buffer": "buffer/global" 1317 | } 1318 | }, 1319 | "lib/body.js": { 1320 | "globals": { 1321 | "Buffer": "buffer/global" 1322 | } 1323 | }, 1324 | "test/test.js": { 1325 | "globals": { 1326 | "Buffer": "buffer/global" 1327 | } 1328 | } 1329 | }, 1330 | "main": "index.js", 1331 | "format": "cjs" 1332 | }, 1333 | "nm:object-assign": { 1334 | "meta": { 1335 | "*.json": { 1336 | "format": "json" 1337 | } 1338 | }, 1339 | "main": "index.js", 1340 | "format": "cjs" 1341 | }, 1342 | "nm:os-browserify": { 1343 | "map": { 1344 | "./main.js": { 1345 | "browser": "./browser.js" 1346 | } 1347 | }, 1348 | "meta": { 1349 | "*.json": { 1350 | "format": "json" 1351 | } 1352 | }, 1353 | "main": "main.js", 1354 | "format": "cjs" 1355 | }, 1356 | "nm:pako": { 1357 | "meta": { 1358 | "*.json": { 1359 | "format": "json" 1360 | }, 1361 | "dist/pako.js": { 1362 | "cjsRequireDetection": false 1363 | }, 1364 | "dist/pako_deflate.js": { 1365 | "cjsRequireDetection": false 1366 | }, 1367 | "dist/pako_inflate.js": { 1368 | "cjsRequireDetection": false 1369 | } 1370 | }, 1371 | "main": "index.js", 1372 | "format": "cjs" 1373 | }, 1374 | "nm:parse-asn1": { 1375 | "map": { 1376 | "./test": "./test/index.js" 1377 | }, 1378 | "meta": { 1379 | "*.json": { 1380 | "format": "json" 1381 | }, 1382 | "fixProc.js": { 1383 | "globals": { 1384 | "Buffer": "buffer/global" 1385 | } 1386 | }, 1387 | "index.js": { 1388 | "globals": { 1389 | "Buffer": "buffer/global" 1390 | } 1391 | }, 1392 | "test/vector.js": { 1393 | "globals": { 1394 | "Buffer": "buffer/global" 1395 | } 1396 | } 1397 | }, 1398 | "main": "index.js", 1399 | "format": "cjs" 1400 | }, 1401 | "nm:pbkdf2": { 1402 | "map": { 1403 | "./index.js": { 1404 | "browser": "./browser.js" 1405 | } 1406 | }, 1407 | "meta": { 1408 | "*": { 1409 | "globals": { 1410 | "process": "process" 1411 | } 1412 | }, 1413 | "*.json": { 1414 | "format": "json" 1415 | }, 1416 | "browser.js": { 1417 | "globals": { 1418 | "Buffer": "buffer/global" 1419 | } 1420 | } 1421 | }, 1422 | "main": "index.js", 1423 | "format": "cjs" 1424 | }, 1425 | "nm:process": { 1426 | "map": { 1427 | "./index.js": { 1428 | "browser": "./browser.js" 1429 | } 1430 | }, 1431 | "meta": { 1432 | "*": { 1433 | "globals": { 1434 | "process": "process" 1435 | } 1436 | }, 1437 | "*.json": { 1438 | "format": "json" 1439 | } 1440 | }, 1441 | "main": "index.js", 1442 | "format": "cjs" 1443 | }, 1444 | "nm:process-nextick-args": { 1445 | "meta": { 1446 | "*": { 1447 | "globals": { 1448 | "process": "process" 1449 | } 1450 | }, 1451 | "*.json": { 1452 | "format": "json" 1453 | } 1454 | }, 1455 | "main": "index.js", 1456 | "format": "cjs" 1457 | }, 1458 | "nm:promise": { 1459 | "map": { 1460 | "./domains": "./domains/index.js", 1461 | "./lib": "./lib/index.js", 1462 | "./setimmediate": "./setimmediate/index.js", 1463 | "./src": "./src/index.js" 1464 | }, 1465 | "meta": { 1466 | "*.json": { 1467 | "format": "json" 1468 | } 1469 | }, 1470 | "main": "index.js", 1471 | "format": "cjs" 1472 | }, 1473 | "nm:public-encrypt": { 1474 | "map": { 1475 | "./index.js": { 1476 | "browser": "./browser.js" 1477 | }, 1478 | "./test": "./test/index.js" 1479 | }, 1480 | "meta": { 1481 | "*.json": { 1482 | "format": "json" 1483 | }, 1484 | "mgf.js": { 1485 | "globals": { 1486 | "Buffer": "buffer/global" 1487 | } 1488 | }, 1489 | "privateDecrypt.js": { 1490 | "globals": { 1491 | "Buffer": "buffer/global" 1492 | } 1493 | }, 1494 | "publicEncrypt.js": { 1495 | "globals": { 1496 | "Buffer": "buffer/global" 1497 | } 1498 | }, 1499 | "test/index.js": { 1500 | "globals": { 1501 | "Buffer": "buffer/global" 1502 | } 1503 | }, 1504 | "test/nodeTests.js": { 1505 | "globals": { 1506 | "Buffer": "buffer/global" 1507 | } 1508 | }, 1509 | "withPublic.js": { 1510 | "globals": { 1511 | "Buffer": "buffer/global" 1512 | } 1513 | } 1514 | }, 1515 | "main": "index.js", 1516 | "format": "cjs" 1517 | }, 1518 | "nm:punycode": { 1519 | "meta": { 1520 | "*.json": { 1521 | "format": "json" 1522 | } 1523 | }, 1524 | "main": "punycode.js", 1525 | "format": "cjs" 1526 | }, 1527 | "nm:querystring": { 1528 | "map": { 1529 | "./test": "./test/index.js" 1530 | }, 1531 | "meta": { 1532 | "*.json": { 1533 | "format": "json" 1534 | } 1535 | }, 1536 | "main": "index.js", 1537 | "format": "cjs" 1538 | }, 1539 | "nm:randombytes": { 1540 | "map": { 1541 | "./index.js": { 1542 | "browser": "./browser.js" 1543 | } 1544 | }, 1545 | "meta": { 1546 | "*": { 1547 | "globals": { 1548 | "process": "process" 1549 | } 1550 | }, 1551 | "*.json": { 1552 | "format": "json" 1553 | }, 1554 | "browser.js": { 1555 | "globals": { 1556 | "Buffer": "buffer/global" 1557 | } 1558 | } 1559 | }, 1560 | "main": "index.js", 1561 | "format": "cjs" 1562 | }, 1563 | "nm:react": { 1564 | "meta": { 1565 | "*": { 1566 | "globals": { 1567 | "process": "process" 1568 | } 1569 | }, 1570 | "*.json": { 1571 | "format": "json" 1572 | }, 1573 | "dist/react-with-addons.js": { 1574 | "cjsRequireDetection": false 1575 | }, 1576 | "dist/react.js": { 1577 | "cjsRequireDetection": false 1578 | } 1579 | }, 1580 | "main": "react.js", 1581 | "format": "cjs" 1582 | }, 1583 | "nm:react-dom": { 1584 | "meta": { 1585 | "*": { 1586 | "globals": { 1587 | "process": "process" 1588 | } 1589 | }, 1590 | "*.json": { 1591 | "format": "json" 1592 | }, 1593 | "dist/react-dom-server.js": { 1594 | "cjsRequireDetection": false 1595 | }, 1596 | "dist/react-dom.js": { 1597 | "cjsRequireDetection": false 1598 | } 1599 | }, 1600 | "main": "index.js", 1601 | "format": "cjs" 1602 | }, 1603 | "nm:readable-stream": { 1604 | "map": { 1605 | "util": { 1606 | "browser": "@empty" 1607 | } 1608 | }, 1609 | "meta": { 1610 | "*": { 1611 | "globals": { 1612 | "process": "process" 1613 | } 1614 | }, 1615 | "*.json": { 1616 | "format": "json" 1617 | }, 1618 | "lib/_stream_readable.js": { 1619 | "globals": { 1620 | "Buffer": "buffer/global" 1621 | } 1622 | }, 1623 | "lib/_stream_writable.js": { 1624 | "globals": { 1625 | "Buffer": "buffer/global" 1626 | } 1627 | } 1628 | }, 1629 | "main": "readable.js", 1630 | "format": "cjs" 1631 | }, 1632 | "nm:ripemd160": { 1633 | "meta": { 1634 | "*.json": { 1635 | "format": "json" 1636 | }, 1637 | "lib/*": { 1638 | "globals": { 1639 | "Buffer": "buffer/global" 1640 | } 1641 | } 1642 | }, 1643 | "main": "lib/ripemd160.js", 1644 | "format": "cjs" 1645 | }, 1646 | "nm:sha.js": { 1647 | "meta": { 1648 | "*": { 1649 | "globals": { 1650 | "process": "process" 1651 | } 1652 | }, 1653 | "*.json": { 1654 | "format": "json" 1655 | }, 1656 | "hash.js": { 1657 | "globals": { 1658 | "Buffer": "buffer/global" 1659 | } 1660 | }, 1661 | "sha.js": { 1662 | "globals": { 1663 | "Buffer": "buffer/global" 1664 | } 1665 | }, 1666 | "sha1.js": { 1667 | "globals": { 1668 | "Buffer": "buffer/global" 1669 | } 1670 | }, 1671 | "sha224.js": { 1672 | "globals": { 1673 | "Buffer": "buffer/global" 1674 | } 1675 | }, 1676 | "sha256.js": { 1677 | "globals": { 1678 | "Buffer": "buffer/global" 1679 | } 1680 | }, 1681 | "sha384.js": { 1682 | "globals": { 1683 | "Buffer": "buffer/global" 1684 | } 1685 | }, 1686 | "sha512.js": { 1687 | "globals": { 1688 | "Buffer": "buffer/global" 1689 | } 1690 | }, 1691 | "test/*": { 1692 | "globals": { 1693 | "Buffer": "buffer/global" 1694 | } 1695 | } 1696 | }, 1697 | "main": "index.js", 1698 | "format": "cjs" 1699 | }, 1700 | "nm:stream-browserify": { 1701 | "meta": { 1702 | "*.json": { 1703 | "format": "json" 1704 | }, 1705 | "test/*": { 1706 | "globals": { 1707 | "Buffer": "buffer/global" 1708 | } 1709 | } 1710 | }, 1711 | "main": "index.js", 1712 | "format": "cjs" 1713 | }, 1714 | "nm:stream-http": { 1715 | "map": { 1716 | "./test/server": "./test/server/index.js" 1717 | }, 1718 | "meta": { 1719 | "*": { 1720 | "globals": { 1721 | "process": "process" 1722 | } 1723 | }, 1724 | "*.json": { 1725 | "format": "json" 1726 | }, 1727 | "lib/request.js": { 1728 | "globals": { 1729 | "Buffer": "buffer/global" 1730 | } 1731 | }, 1732 | "lib/response.js": { 1733 | "globals": { 1734 | "Buffer": "buffer/global" 1735 | } 1736 | }, 1737 | "test/browser/auth.js": { 1738 | "globals": { 1739 | "Buffer": "buffer/global" 1740 | } 1741 | }, 1742 | "test/browser/binary-streaming.js": { 1743 | "globals": { 1744 | "Buffer": "buffer/global" 1745 | } 1746 | }, 1747 | "test/browser/binary.js": { 1748 | "globals": { 1749 | "Buffer": "buffer/global" 1750 | } 1751 | }, 1752 | "test/browser/cookie.js": { 1753 | "globals": { 1754 | "Buffer": "buffer/global" 1755 | } 1756 | }, 1757 | "test/browser/headers.js": { 1758 | "globals": { 1759 | "Buffer": "buffer/global" 1760 | } 1761 | }, 1762 | "test/browser/lib/*": { 1763 | "globals": { 1764 | "Buffer": "buffer/global" 1765 | } 1766 | }, 1767 | "test/browser/post-binary.js": { 1768 | "globals": { 1769 | "Buffer": "buffer/global" 1770 | } 1771 | }, 1772 | "test/browser/post-text.js": { 1773 | "globals": { 1774 | "Buffer": "buffer/global" 1775 | } 1776 | }, 1777 | "test/browser/text-streaming.js": { 1778 | "globals": { 1779 | "Buffer": "buffer/global" 1780 | } 1781 | }, 1782 | "test/browser/text.js": { 1783 | "globals": { 1784 | "Buffer": "buffer/global" 1785 | } 1786 | }, 1787 | "test/browser/webworker.js": { 1788 | "globals": { 1789 | "Buffer": "buffer/global" 1790 | } 1791 | } 1792 | }, 1793 | "main": "index.js", 1794 | "format": "cjs" 1795 | }, 1796 | "nm:string_decoder": { 1797 | "meta": { 1798 | "*.json": { 1799 | "format": "json" 1800 | }, 1801 | "index.js": { 1802 | "globals": { 1803 | "Buffer": "buffer/global" 1804 | } 1805 | } 1806 | }, 1807 | "main": "index.js", 1808 | "format": "cjs" 1809 | }, 1810 | "nm:systemjs": { 1811 | "meta": { 1812 | "*": { 1813 | "globals": { 1814 | "process": "process" 1815 | } 1816 | }, 1817 | "*.json": { 1818 | "format": "json" 1819 | }, 1820 | "dist/system-polyfills.src.js": { 1821 | "cjsRequireDetection": false 1822 | }, 1823 | "dist/system.js": { 1824 | "globals": { 1825 | "Buffer": "buffer/global" 1826 | } 1827 | }, 1828 | "dist/system.src.js": { 1829 | "globals": { 1830 | "Buffer": "buffer/global" 1831 | } 1832 | } 1833 | }, 1834 | "main": "index.js", 1835 | "format": "cjs" 1836 | }, 1837 | "nm:systemjs-nodelibs": { 1838 | "meta": { 1839 | "*.json": { 1840 | "format": "json" 1841 | } 1842 | }, 1843 | "main": "index.js", 1844 | "format": "cjs" 1845 | }, 1846 | "nm:systemjs-plugin-babel": { 1847 | "map": { 1848 | "systemjs-babel-build": { 1849 | "node": "./systemjs-babel-node.js", 1850 | "browser": "./systemjs-babel-browser.js", 1851 | "default": "./systemjs-babel-browser.js" 1852 | } 1853 | }, 1854 | "meta": { 1855 | "./plugin-babel.js": { 1856 | "format": "cjs" 1857 | } 1858 | }, 1859 | "main": "plugin-babel.js" 1860 | }, 1861 | "nm:timers-browserify": { 1862 | "meta": { 1863 | "*": { 1864 | "globals": { 1865 | "process": "process" 1866 | } 1867 | }, 1868 | "*.json": { 1869 | "format": "json" 1870 | } 1871 | }, 1872 | "main": "main.js", 1873 | "format": "cjs" 1874 | }, 1875 | "nm:to-arraybuffer": { 1876 | "meta": { 1877 | "*.json": { 1878 | "format": "json" 1879 | }, 1880 | "index.js": { 1881 | "globals": { 1882 | "Buffer": "buffer/global" 1883 | } 1884 | }, 1885 | "test.js": { 1886 | "globals": { 1887 | "Buffer": "buffer/global" 1888 | } 1889 | } 1890 | }, 1891 | "main": "index.js", 1892 | "format": "cjs" 1893 | }, 1894 | "nm:ua-parser-js": { 1895 | "meta": { 1896 | "*.json": { 1897 | "format": "json" 1898 | } 1899 | }, 1900 | "main": "src/ua-parser.js", 1901 | "format": "cjs" 1902 | }, 1903 | "nm:url": { 1904 | "meta": { 1905 | "*.json": { 1906 | "format": "json" 1907 | } 1908 | }, 1909 | "main": "url.js", 1910 | "format": "cjs" 1911 | }, 1912 | "nm:util-deprecate": { 1913 | "map": { 1914 | "./node.js": { 1915 | "browser": "./browser.js" 1916 | } 1917 | }, 1918 | "meta": { 1919 | "*.json": { 1920 | "format": "json" 1921 | } 1922 | }, 1923 | "main": "node.js", 1924 | "format": "cjs" 1925 | }, 1926 | "nm:whatwg-fetch": { 1927 | "meta": { 1928 | "*.json": { 1929 | "format": "json" 1930 | } 1931 | }, 1932 | "main": "fetch.js", 1933 | "format": "cjs" 1934 | }, 1935 | "nm:when": { 1936 | "map": { 1937 | "vertx": { 1938 | "browser": "@empty" 1939 | }, 1940 | "when": { 1941 | "browser": "./dist/browser/when.js" 1942 | } 1943 | }, 1944 | "meta": { 1945 | "*": { 1946 | "globals": { 1947 | "process": "process" 1948 | } 1949 | }, 1950 | "*.json": { 1951 | "format": "json" 1952 | }, 1953 | "dist/browser/when.debug.js": { 1954 | "cjsRequireDetection": false 1955 | }, 1956 | "dist/browser/when.js": { 1957 | "cjsRequireDetection": false 1958 | }, 1959 | "es6-shim/Promise.js": { 1960 | "cjsRequireDetection": false 1961 | } 1962 | }, 1963 | "main": "when.js", 1964 | "format": "cjs" 1965 | }, 1966 | "nm:xtend": { 1967 | "meta": { 1968 | "*.json": { 1969 | "format": "json" 1970 | } 1971 | }, 1972 | "main": "immutable.js", 1973 | "format": "cjs" 1974 | } 1975 | }, 1976 | "paths": { 1977 | "nm:": "node_modules/" 1978 | } 1979 | }) -------------------------------------------------------------------------------- /test/babel/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 13 |
14 | 15 | -------------------------------------------------------------------------------- /test/babel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "config": "node ../../dist/cli.js", 7 | "start": "serve", 8 | "postinstall": "npm run config" 9 | }, 10 | "license": "MIT", 11 | "dependencies": { 12 | "react": "^15.3.2", 13 | "react-dom": "^15.3.2", 14 | "systemjs": "^0.19.41", 15 | "systemjs-nodelibs": "^1.0.0", 16 | "systemjs-plugin-babel": "^0.0.17" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/babel/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | asap@~2.0.3: 6 | version "2.0.5" 7 | resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.5.tgz#522765b50c3510490e52d7dcfe085ef9ba96958f" 8 | 9 | asn1.js@^4.0.0: 10 | version "4.9.0" 11 | resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.0.tgz#f71a1243f3e79d46d7b07d7fbf4824ee73af054a" 12 | dependencies: 13 | bn.js "^4.0.0" 14 | inherits "^2.0.1" 15 | minimalistic-assert "^1.0.0" 16 | 17 | base64-js@^1.0.2: 18 | version "1.2.0" 19 | resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" 20 | 21 | bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: 22 | version "4.11.6" 23 | resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" 24 | 25 | brorand@^1.0.1: 26 | version "1.0.6" 27 | resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.0.6.tgz#4028706b915f91f7b349a2e0bf3c376039d216e5" 28 | 29 | browserify-aes@^1.0.0, browserify-aes@^1.0.4: 30 | version "1.0.6" 31 | resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" 32 | dependencies: 33 | buffer-xor "^1.0.2" 34 | cipher-base "^1.0.0" 35 | create-hash "^1.1.0" 36 | evp_bytestokey "^1.0.0" 37 | inherits "^2.0.1" 38 | 39 | browserify-cipher@^1.0.0: 40 | version "1.0.0" 41 | resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" 42 | dependencies: 43 | browserify-aes "^1.0.4" 44 | browserify-des "^1.0.0" 45 | evp_bytestokey "^1.0.0" 46 | 47 | browserify-des@^1.0.0: 48 | version "1.0.0" 49 | resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" 50 | dependencies: 51 | cipher-base "^1.0.1" 52 | des.js "^1.0.0" 53 | inherits "^2.0.1" 54 | 55 | browserify-rsa@^4.0.0: 56 | version "4.0.1" 57 | resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" 58 | dependencies: 59 | bn.js "^4.1.0" 60 | randombytes "^2.0.1" 61 | 62 | browserify-sign@^4.0.0: 63 | version "4.0.0" 64 | resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.0.tgz#10773910c3c206d5420a46aad8694f820b85968f" 65 | dependencies: 66 | bn.js "^4.1.1" 67 | browserify-rsa "^4.0.0" 68 | create-hash "^1.1.0" 69 | create-hmac "^1.1.2" 70 | elliptic "^6.0.0" 71 | inherits "^2.0.1" 72 | parse-asn1 "^5.0.0" 73 | 74 | browserify-zlib@^0.1.4: 75 | version "0.1.4" 76 | resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" 77 | dependencies: 78 | pako "~0.2.0" 79 | 80 | buffer-shims@^1.0.0: 81 | version "1.0.0" 82 | resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" 83 | 84 | buffer-xor@^1.0.2: 85 | version "1.0.3" 86 | resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" 87 | 88 | buffer@^5.0.0: 89 | version "5.0.1" 90 | resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.1.tgz#28165188f46d451b516b8be3e611b00029573486" 91 | dependencies: 92 | base64-js "^1.0.2" 93 | ieee754 "^1.1.4" 94 | 95 | builtin-status-codes@^2.0.0: 96 | version "2.0.0" 97 | resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-2.0.0.tgz#6f22003baacf003ccd287afe6872151fddc58579" 98 | 99 | cipher-base@^1.0.0, cipher-base@^1.0.1: 100 | version "1.0.3" 101 | resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" 102 | dependencies: 103 | inherits "^2.0.1" 104 | 105 | core-js@^1.0.0: 106 | version "1.2.7" 107 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" 108 | 109 | core-util-is@~1.0.0: 110 | version "1.0.2" 111 | resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" 112 | 113 | create-ecdh@^4.0.0: 114 | version "4.0.0" 115 | resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" 116 | dependencies: 117 | bn.js "^4.1.0" 118 | elliptic "^6.0.0" 119 | 120 | create-hash@^1.1.0, create-hash@^1.1.1: 121 | version "1.1.2" 122 | resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" 123 | dependencies: 124 | cipher-base "^1.0.1" 125 | inherits "^2.0.1" 126 | ripemd160 "^1.0.0" 127 | sha.js "^2.3.6" 128 | 129 | create-hmac@^1.1.0, create-hmac@^1.1.2: 130 | version "1.1.4" 131 | resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" 132 | dependencies: 133 | create-hash "^1.1.0" 134 | inherits "^2.0.1" 135 | 136 | crypto-browserify@^3.11.0: 137 | version "3.11.0" 138 | resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" 139 | dependencies: 140 | browserify-cipher "^1.0.0" 141 | browserify-sign "^4.0.0" 142 | create-ecdh "^4.0.0" 143 | create-hash "^1.1.0" 144 | create-hmac "^1.1.0" 145 | diffie-hellman "^5.0.0" 146 | inherits "^2.0.1" 147 | pbkdf2 "^3.0.3" 148 | public-encrypt "^4.0.0" 149 | randombytes "^2.0.0" 150 | 151 | des.js@^1.0.0: 152 | version "1.0.0" 153 | resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" 154 | dependencies: 155 | inherits "^2.0.1" 156 | minimalistic-assert "^1.0.0" 157 | 158 | diffie-hellman@^5.0.0: 159 | version "5.0.2" 160 | resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" 161 | dependencies: 162 | bn.js "^4.1.0" 163 | miller-rabin "^4.0.0" 164 | randombytes "^2.0.0" 165 | 166 | domain-browser@^1.1.7: 167 | version "1.1.7" 168 | resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" 169 | 170 | elliptic@^6.0.0: 171 | version "6.3.2" 172 | resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.2.tgz#e4c81e0829cf0a65ab70e998b8232723b5c1bc48" 173 | dependencies: 174 | bn.js "^4.4.0" 175 | brorand "^1.0.1" 176 | hash.js "^1.0.0" 177 | inherits "^2.0.1" 178 | 179 | encoding@^0.1.11: 180 | version "0.1.12" 181 | resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" 182 | dependencies: 183 | iconv-lite "~0.4.13" 184 | 185 | evp_bytestokey@^1.0.0: 186 | version "1.0.0" 187 | resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" 188 | dependencies: 189 | create-hash "^1.1.1" 190 | 191 | fbjs@^0.8.1, fbjs@^0.8.4: 192 | version "0.8.6" 193 | resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.6.tgz#7eb67d6986b2d5007a9b6e92e0e7cb6f75cad290" 194 | dependencies: 195 | core-js "^1.0.0" 196 | isomorphic-fetch "^2.1.1" 197 | loose-envify "^1.0.0" 198 | object-assign "^4.1.0" 199 | promise "^7.1.1" 200 | ua-parser-js "^0.7.9" 201 | 202 | hash.js@^1.0.0: 203 | version "1.0.3" 204 | resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" 205 | dependencies: 206 | inherits "^2.0.1" 207 | 208 | iconv-lite@~0.4.13: 209 | version "0.4.13" 210 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" 211 | 212 | ieee754@^1.1.4: 213 | version "1.1.8" 214 | resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" 215 | 216 | inherits@^2.0.1, inherits@~2.0.1: 217 | version "2.0.3" 218 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 219 | 220 | is-stream@^1.0.1: 221 | version "1.1.0" 222 | resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" 223 | 224 | isarray@~1.0.0: 225 | version "1.0.0" 226 | resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" 227 | 228 | isomorphic-fetch@^2.1.1: 229 | version "2.2.1" 230 | resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" 231 | dependencies: 232 | node-fetch "^1.0.1" 233 | whatwg-fetch ">=0.10.0" 234 | 235 | js-tokens@^2.0.0: 236 | version "2.0.0" 237 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" 238 | 239 | "jspm-nodelibs-assert@github:jspm/nodelibs-assert": 240 | version "0.2.0" 241 | resolved "https://codeload.github.com/jspm/nodelibs-assert/tar.gz/300511666919c7a420e868c0cba6f5a652b7f181" 242 | 243 | "jspm-nodelibs-buffer@github:alexisvincent/nodelibs-buffer": 244 | version "0.3.0" 245 | resolved "https://codeload.github.com/alexisvincent/nodelibs-buffer/tar.gz/218ee95b4e41ae6709e2246393942e5d8c58b0ea" 246 | dependencies: 247 | buffer "^5.0.0" 248 | 249 | "jspm-nodelibs-child_process@github:jspm/nodelibs-child_process": 250 | version "0.2.0" 251 | resolved "https://codeload.github.com/jspm/nodelibs-child_process/tar.gz/cfdc2d27af9d644c7366174bb1de793fe8e9b5f0" 252 | 253 | "jspm-nodelibs-cluster@github:jspm/nodelibs-cluster": 254 | version "0.2.0" 255 | resolved "https://codeload.github.com/jspm/nodelibs-cluster/tar.gz/3e860218e0377db083ce1344bdd4fe00ce55ba1e" 256 | 257 | "jspm-nodelibs-console@github:jspm/nodelibs-console": 258 | version "0.2.1" 259 | resolved "https://codeload.github.com/jspm/nodelibs-console/tar.gz/2c708a3141fb3bbd83e568997086ae7eee605f86" 260 | 261 | "jspm-nodelibs-constants@github:jspm/nodelibs-constants": 262 | version "0.2.0" 263 | resolved "https://codeload.github.com/jspm/nodelibs-constants/tar.gz/eab9ace469f5f8e767397a894e2168c450991b23" 264 | 265 | "jspm-nodelibs-crypto@github:jspm/nodelibs-crypto": 266 | version "0.2.0" 267 | resolved "https://codeload.github.com/jspm/nodelibs-crypto/tar.gz/916bcca3ca088d0abb86e949f80d95374cb98362" 268 | dependencies: 269 | crypto-browserify "^3.11.0" 270 | 271 | "jspm-nodelibs-dgram@github:jspm/nodelibs-dgram": 272 | version "0.2.0" 273 | resolved "https://codeload.github.com/jspm/nodelibs-dgram/tar.gz/3ea3db55ca80a417201992103378ce6d8de25f6c" 274 | 275 | "jspm-nodelibs-dns@github:jspm/nodelibs-dns": 276 | version "0.2.0" 277 | resolved "https://codeload.github.com/jspm/nodelibs-dns/tar.gz/7dc8ed45dbf4955b9f98aea7406b877ee7b6a774" 278 | 279 | "jspm-nodelibs-domain@github:jspm/nodelibs-domain": 280 | version "0.2.0" 281 | resolved "https://codeload.github.com/jspm/nodelibs-domain/tar.gz/31266e4c148b11665b01ac00ad83d2d318bc2f3a" 282 | dependencies: 283 | domain-browser "^1.1.7" 284 | 285 | "jspm-nodelibs-events@github:jspm/nodelibs-events": 286 | version "0.2.0" 287 | resolved "https://codeload.github.com/jspm/nodelibs-events/tar.gz/8de16cf4f1e222003d4474c074e1f4e586c7af42" 288 | 289 | "jspm-nodelibs-fs@github:jspm/nodelibs-fs": 290 | version "0.2.0" 291 | resolved "https://codeload.github.com/jspm/nodelibs-fs/tar.gz/cec6a394f91f3524e72b02e940895ff8224a7e31" 292 | 293 | "jspm-nodelibs-http@github:jspm/nodelibs-http": 294 | version "0.2.0" 295 | resolved "https://codeload.github.com/jspm/nodelibs-http/tar.gz/d9695acd19f036396fc3325ede3a814d94eb5502" 296 | dependencies: 297 | stream-http "^2.0.2" 298 | 299 | "jspm-nodelibs-https@github:jspm/nodelibs-https": 300 | version "0.2.1" 301 | resolved "https://codeload.github.com/jspm/nodelibs-https/tar.gz/03da1a99a726c82d2c1db7c766763b42d3017f8e" 302 | 303 | "jspm-nodelibs-module@github:jspm/nodelibs-module": 304 | version "0.2.0" 305 | resolved "https://codeload.github.com/jspm/nodelibs-module/tar.gz/2df5505600396eb99b5752f47c826ba33bdb194c" 306 | 307 | "jspm-nodelibs-net@github:jspm/nodelibs-net": 308 | version "0.2.0" 309 | resolved "https://codeload.github.com/jspm/nodelibs-net/tar.gz/71b3139a1af61434135586a8bb95a194a266eae1" 310 | 311 | "jspm-nodelibs-os@github:jspm/nodelibs-os": 312 | version "0.2.0" 313 | resolved "https://codeload.github.com/jspm/nodelibs-os/tar.gz/5dc25f4572b5460fc6caed1245d41700858a2df9" 314 | dependencies: 315 | os-browserify "^0.2.0" 316 | 317 | "jspm-nodelibs-path@github:jspm/nodelibs-path": 318 | version "0.2.1" 319 | resolved "https://codeload.github.com/jspm/nodelibs-path/tar.gz/366c5b05e5ee6feed820ab674207a4643290fe37" 320 | 321 | "jspm-nodelibs-process@github:jspm/nodelibs-process": 322 | version "0.2.0" 323 | resolved "https://codeload.github.com/jspm/nodelibs-process/tar.gz/a603cf42280ad4346c73d91caec312f9f3535724" 324 | 325 | "jspm-nodelibs-punycode@github:jspm/nodelibs-punycode": 326 | version "0.2.0" 327 | resolved "https://codeload.github.com/jspm/nodelibs-punycode/tar.gz/ac6a6aea21a14bb1b0810a1b1376992e7edfc8d1" 328 | dependencies: 329 | punycode "^1.3.0" 330 | 331 | "jspm-nodelibs-querystring@github:jspm/nodelibs-querystring": 332 | version "0.2.0" 333 | resolved "https://codeload.github.com/jspm/nodelibs-querystring/tar.gz/8511d57812a9347a894669e4a544ee3ef19171e8" 334 | 335 | "jspm-nodelibs-readline@github:jspm/nodelibs-readline": 336 | version "0.2.0" 337 | resolved "https://codeload.github.com/jspm/nodelibs-readline/tar.gz/c5aea34a0a2709ac56d7255f7afdbeca0c403f1a" 338 | 339 | "jspm-nodelibs-repl@github:jspm/nodelibs-repl": 340 | version "0.2.0" 341 | resolved "https://codeload.github.com/jspm/nodelibs-repl/tar.gz/46fbc74c0abed658e10950a87507bce029fc71c3" 342 | 343 | "jspm-nodelibs-stream@github:jspm/nodelibs-stream": 344 | version "0.2.0" 345 | resolved "https://codeload.github.com/jspm/nodelibs-stream/tar.gz/1e45169f0dd33b7dd069ac71c1451cb9c97fcc02" 346 | dependencies: 347 | stream-browserify "^2.0.1" 348 | 349 | "jspm-nodelibs-string_decoder@github:jspm/nodelibs-string_decoder": 350 | version "0.2.0" 351 | resolved "https://codeload.github.com/jspm/nodelibs-string_decoder/tar.gz/4ada152d14a0627146a92e69e866d6551c68e5b1" 352 | dependencies: 353 | string_decoder "^0.10.31" 354 | 355 | "jspm-nodelibs-timers@github:jspm/nodelibs-timers": 356 | version "0.2.0" 357 | resolved "https://codeload.github.com/jspm/nodelibs-timers/tar.gz/99515d81769c97dd4f45ecb5f6f2f8925a4e514f" 358 | dependencies: 359 | timers-browserify "^1.4.2" 360 | 361 | "jspm-nodelibs-tls@github:jspm/nodelibs-tls": 362 | version "0.2.0" 363 | resolved "https://codeload.github.com/jspm/nodelibs-tls/tar.gz/6577b9ee65d9e4434fdf3a153b852570aa2cf3cd" 364 | 365 | "jspm-nodelibs-tty@github:jspm/nodelibs-tty": 366 | version "0.2.0" 367 | resolved "https://codeload.github.com/jspm/nodelibs-tty/tar.gz/aed9a41ca80f35829ab7d9e827b323f99e482437" 368 | 369 | "jspm-nodelibs-url@github:jspm/nodelibs-url": 370 | version "0.2.0" 371 | resolved "https://codeload.github.com/jspm/nodelibs-url/tar.gz/70fc96f80afc5ae4d50b9047eb4074c7e2c3c943" 372 | dependencies: 373 | url "^0.11.0" 374 | 375 | "jspm-nodelibs-util@github:jspm/nodelibs-util": 376 | version "0.2.1" 377 | resolved "https://codeload.github.com/jspm/nodelibs-util/tar.gz/56953ea0f27d378e911baa2324405cc04fae15c5" 378 | 379 | "jspm-nodelibs-vm@github:jspm/nodelibs-vm": 380 | version "0.2.0" 381 | resolved "https://codeload.github.com/jspm/nodelibs-vm/tar.gz/4a686700a8c8fc4cdd52547082132b69b9356e3f" 382 | 383 | "jspm-nodelibs-zlib@github:jspm/nodelibs-zlib": 384 | version "0.2.0" 385 | resolved "https://codeload.github.com/jspm/nodelibs-zlib/tar.gz/2ca74692613176a36fbc3ee7d1047af5ada631e9" 386 | dependencies: 387 | browserify-zlib "^0.1.4" 388 | 389 | loose-envify@^1.0.0, loose-envify@^1.1.0: 390 | version "1.3.0" 391 | resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.0.tgz#6b26248c42f6d4fa4b0d8542f78edfcde35642a8" 392 | dependencies: 393 | js-tokens "^2.0.0" 394 | 395 | miller-rabin@^4.0.0: 396 | version "4.0.0" 397 | resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" 398 | dependencies: 399 | bn.js "^4.0.0" 400 | brorand "^1.0.1" 401 | 402 | minimalistic-assert@^1.0.0: 403 | version "1.0.0" 404 | resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" 405 | 406 | node-fetch@^1.0.1: 407 | version "1.6.3" 408 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" 409 | dependencies: 410 | encoding "^0.1.11" 411 | is-stream "^1.0.1" 412 | 413 | object-assign@^4.1.0: 414 | version "4.1.0" 415 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" 416 | 417 | os-browserify@^0.2.0: 418 | version "0.2.1" 419 | resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" 420 | 421 | pako@~0.2.0: 422 | version "0.2.9" 423 | resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" 424 | 425 | parse-asn1@^5.0.0: 426 | version "5.0.0" 427 | resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.0.0.tgz#35060f6d5015d37628c770f4e091a0b5a278bc23" 428 | dependencies: 429 | asn1.js "^4.0.0" 430 | browserify-aes "^1.0.0" 431 | create-hash "^1.1.0" 432 | evp_bytestokey "^1.0.0" 433 | pbkdf2 "^3.0.3" 434 | 435 | pbkdf2@^3.0.3: 436 | version "3.0.9" 437 | resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" 438 | dependencies: 439 | create-hmac "^1.1.2" 440 | 441 | process-nextick-args@~1.0.6: 442 | version "1.0.7" 443 | resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" 444 | 445 | process@~0.11.0: 446 | version "0.11.9" 447 | resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" 448 | 449 | promise@^7.1.1: 450 | version "7.1.1" 451 | resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf" 452 | dependencies: 453 | asap "~2.0.3" 454 | 455 | public-encrypt@^4.0.0: 456 | version "4.0.0" 457 | resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" 458 | dependencies: 459 | bn.js "^4.1.0" 460 | browserify-rsa "^4.0.0" 461 | create-hash "^1.1.0" 462 | parse-asn1 "^5.0.0" 463 | randombytes "^2.0.1" 464 | 465 | punycode@1.3.2: 466 | version "1.3.2" 467 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" 468 | 469 | punycode@^1.3.0: 470 | version "1.4.1" 471 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" 472 | 473 | querystring@0.2.0: 474 | version "0.2.0" 475 | resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" 476 | 477 | randombytes@^2.0.0, randombytes@^2.0.1: 478 | version "2.0.3" 479 | resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" 480 | 481 | react-dom@^15.3.2: 482 | version "15.4.0" 483 | resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.4.0.tgz#6a97a69000966570db48c746bc4b7b0ca50d1534" 484 | dependencies: 485 | fbjs "^0.8.1" 486 | loose-envify "^1.1.0" 487 | object-assign "^4.1.0" 488 | 489 | react@^15.3.2: 490 | version "15.4.0" 491 | resolved "https://registry.yarnpkg.com/react/-/react-15.4.0.tgz#736c1c7c542e8088127106e1f450b010f86d172b" 492 | dependencies: 493 | fbjs "^0.8.4" 494 | loose-envify "^1.1.0" 495 | object-assign "^4.1.0" 496 | 497 | readable-stream@^2.0.2, readable-stream@^2.1.0: 498 | version "2.2.2" 499 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" 500 | dependencies: 501 | buffer-shims "^1.0.0" 502 | core-util-is "~1.0.0" 503 | inherits "~2.0.1" 504 | isarray "~1.0.0" 505 | process-nextick-args "~1.0.6" 506 | string_decoder "~0.10.x" 507 | util-deprecate "~1.0.1" 508 | 509 | ripemd160@^1.0.0: 510 | version "1.0.1" 511 | resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" 512 | 513 | sha.js@^2.3.6: 514 | version "2.4.8" 515 | resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" 516 | dependencies: 517 | inherits "^2.0.1" 518 | 519 | stream-browserify@^2.0.1: 520 | version "2.0.1" 521 | resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" 522 | dependencies: 523 | inherits "~2.0.1" 524 | readable-stream "^2.0.2" 525 | 526 | stream-http@^2.0.2: 527 | version "2.5.0" 528 | resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.5.0.tgz#585eee513217ed98fe199817e7313b6f772a6802" 529 | dependencies: 530 | builtin-status-codes "^2.0.0" 531 | inherits "^2.0.1" 532 | readable-stream "^2.1.0" 533 | to-arraybuffer "^1.0.0" 534 | xtend "^4.0.0" 535 | 536 | string_decoder@^0.10.31, string_decoder@~0.10.x: 537 | version "0.10.31" 538 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" 539 | 540 | systemjs-nodelibs@^1.0.0: 541 | version "1.0.0" 542 | resolved "https://registry.yarnpkg.com/systemjs-nodelibs/-/systemjs-nodelibs-1.0.0.tgz#7e270a1b2120414284fce176143c77d61bf6d897" 543 | dependencies: 544 | jspm-nodelibs-assert jspm/nodelibs-assert 545 | jspm-nodelibs-buffer alexisvincent/nodelibs-buffer 546 | jspm-nodelibs-child_process jspm/nodelibs-child_process 547 | jspm-nodelibs-cluster jspm/nodelibs-cluster 548 | jspm-nodelibs-console jspm/nodelibs-console 549 | jspm-nodelibs-constants jspm/nodelibs-constants 550 | jspm-nodelibs-crypto jspm/nodelibs-crypto 551 | jspm-nodelibs-dgram jspm/nodelibs-dgram 552 | jspm-nodelibs-dns jspm/nodelibs-dns 553 | jspm-nodelibs-domain jspm/nodelibs-domain 554 | jspm-nodelibs-events jspm/nodelibs-events 555 | jspm-nodelibs-fs jspm/nodelibs-fs 556 | jspm-nodelibs-http jspm/nodelibs-http 557 | jspm-nodelibs-https jspm/nodelibs-https 558 | jspm-nodelibs-module jspm/nodelibs-module 559 | jspm-nodelibs-net jspm/nodelibs-net 560 | jspm-nodelibs-os jspm/nodelibs-os 561 | jspm-nodelibs-path jspm/nodelibs-path 562 | jspm-nodelibs-process jspm/nodelibs-process 563 | jspm-nodelibs-punycode jspm/nodelibs-punycode 564 | jspm-nodelibs-querystring jspm/nodelibs-querystring 565 | jspm-nodelibs-readline jspm/nodelibs-readline 566 | jspm-nodelibs-repl jspm/nodelibs-repl 567 | jspm-nodelibs-stream jspm/nodelibs-stream 568 | jspm-nodelibs-string_decoder jspm/nodelibs-string_decoder 569 | jspm-nodelibs-timers jspm/nodelibs-timers 570 | jspm-nodelibs-tls jspm/nodelibs-tls 571 | jspm-nodelibs-tty jspm/nodelibs-tty 572 | jspm-nodelibs-url jspm/nodelibs-url 573 | jspm-nodelibs-util jspm/nodelibs-util 574 | jspm-nodelibs-vm jspm/nodelibs-vm 575 | jspm-nodelibs-zlib jspm/nodelibs-zlib 576 | readable-stream "^2.0.2" 577 | 578 | systemjs-plugin-babel@^0.0.17: 579 | version "0.0.17" 580 | resolved "https://registry.yarnpkg.com/systemjs-plugin-babel/-/systemjs-plugin-babel-0.0.17.tgz#66561e4fb0135328d5a03d9613ce52da7b101c8b" 581 | 582 | systemjs@^0.19.41: 583 | version "0.19.41" 584 | resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-0.19.41.tgz#835d2c0f10bf403b551fedc875f84bb44a02c4eb" 585 | dependencies: 586 | when "^3.7.5" 587 | 588 | timers-browserify@^1.4.2: 589 | version "1.4.2" 590 | resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" 591 | dependencies: 592 | process "~0.11.0" 593 | 594 | to-arraybuffer@^1.0.0: 595 | version "1.0.1" 596 | resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" 597 | 598 | ua-parser-js@^0.7.9: 599 | version "0.7.12" 600 | resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" 601 | 602 | url@^0.11.0: 603 | version "0.11.0" 604 | resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" 605 | dependencies: 606 | punycode "1.3.2" 607 | querystring "0.2.0" 608 | 609 | util-deprecate@~1.0.1: 610 | version "1.0.2" 611 | resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" 612 | 613 | whatwg-fetch@>=0.10.0: 614 | version "2.0.1" 615 | resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.1.tgz#078b9461bbe91cea73cbce8bb122a05f9e92b772" 616 | 617 | when@^3.7.5: 618 | version "3.7.7" 619 | resolved "https://registry.yarnpkg.com/when/-/when-3.7.7.tgz#aba03fc3bb736d6c88b091d013d8a8e590d84718" 620 | 621 | xtend@^4.0.0: 622 | version "4.0.1" 623 | resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" 624 | -------------------------------------------------------------------------------- /test/pure/app.js: -------------------------------------------------------------------------------- 1 | var render = require('react-dom').render 2 | var DOM = require('react').DOM 3 | 4 | render( DOM.div({}, "hello world"), document.getElementById('root') ) 5 | -------------------------------------------------------------------------------- /test/pure/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 |
14 | 15 | -------------------------------------------------------------------------------- /test/pure/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "config": "node ../../dist/cli.js", 7 | "start": "serve", 8 | "postinstall": "npm run config" 9 | }, 10 | "license": "MIT", 11 | "dependencies": { 12 | "react": "^15.3.2", 13 | "react-dom": "^15.3.2", 14 | "systemjs": "^0.19.41", 15 | "systemjs-nodelibs": "^1.0.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/pure/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | asap@~2.0.3: 6 | version "2.0.5" 7 | resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.5.tgz#522765b50c3510490e52d7dcfe085ef9ba96958f" 8 | 9 | asn1.js@^4.0.0: 10 | version "4.9.0" 11 | resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.0.tgz#f71a1243f3e79d46d7b07d7fbf4824ee73af054a" 12 | dependencies: 13 | bn.js "^4.0.0" 14 | inherits "^2.0.1" 15 | minimalistic-assert "^1.0.0" 16 | 17 | base64-js@^1.0.2: 18 | version "1.2.0" 19 | resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" 20 | 21 | bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: 22 | version "4.11.6" 23 | resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" 24 | 25 | brorand@^1.0.1: 26 | version "1.0.6" 27 | resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.0.6.tgz#4028706b915f91f7b349a2e0bf3c376039d216e5" 28 | 29 | browserify-aes@^1.0.0, browserify-aes@^1.0.4: 30 | version "1.0.6" 31 | resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" 32 | dependencies: 33 | buffer-xor "^1.0.2" 34 | cipher-base "^1.0.0" 35 | create-hash "^1.1.0" 36 | evp_bytestokey "^1.0.0" 37 | inherits "^2.0.1" 38 | 39 | browserify-cipher@^1.0.0: 40 | version "1.0.0" 41 | resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" 42 | dependencies: 43 | browserify-aes "^1.0.4" 44 | browserify-des "^1.0.0" 45 | evp_bytestokey "^1.0.0" 46 | 47 | browserify-des@^1.0.0: 48 | version "1.0.0" 49 | resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" 50 | dependencies: 51 | cipher-base "^1.0.1" 52 | des.js "^1.0.0" 53 | inherits "^2.0.1" 54 | 55 | browserify-rsa@^4.0.0: 56 | version "4.0.1" 57 | resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" 58 | dependencies: 59 | bn.js "^4.1.0" 60 | randombytes "^2.0.1" 61 | 62 | browserify-sign@^4.0.0: 63 | version "4.0.0" 64 | resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.0.tgz#10773910c3c206d5420a46aad8694f820b85968f" 65 | dependencies: 66 | bn.js "^4.1.1" 67 | browserify-rsa "^4.0.0" 68 | create-hash "^1.1.0" 69 | create-hmac "^1.1.2" 70 | elliptic "^6.0.0" 71 | inherits "^2.0.1" 72 | parse-asn1 "^5.0.0" 73 | 74 | browserify-zlib@^0.1.4: 75 | version "0.1.4" 76 | resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" 77 | dependencies: 78 | pako "~0.2.0" 79 | 80 | buffer-shims@^1.0.0: 81 | version "1.0.0" 82 | resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" 83 | 84 | buffer-xor@^1.0.2: 85 | version "1.0.3" 86 | resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" 87 | 88 | buffer@^5.0.0: 89 | version "5.0.1" 90 | resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.1.tgz#28165188f46d451b516b8be3e611b00029573486" 91 | dependencies: 92 | base64-js "^1.0.2" 93 | ieee754 "^1.1.4" 94 | 95 | builtin-status-codes@^2.0.0: 96 | version "2.0.0" 97 | resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-2.0.0.tgz#6f22003baacf003ccd287afe6872151fddc58579" 98 | 99 | cipher-base@^1.0.0, cipher-base@^1.0.1: 100 | version "1.0.3" 101 | resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" 102 | dependencies: 103 | inherits "^2.0.1" 104 | 105 | core-js@^1.0.0: 106 | version "1.2.7" 107 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" 108 | 109 | core-util-is@~1.0.0: 110 | version "1.0.2" 111 | resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" 112 | 113 | create-ecdh@^4.0.0: 114 | version "4.0.0" 115 | resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" 116 | dependencies: 117 | bn.js "^4.1.0" 118 | elliptic "^6.0.0" 119 | 120 | create-hash@^1.1.0, create-hash@^1.1.1: 121 | version "1.1.2" 122 | resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" 123 | dependencies: 124 | cipher-base "^1.0.1" 125 | inherits "^2.0.1" 126 | ripemd160 "^1.0.0" 127 | sha.js "^2.3.6" 128 | 129 | create-hmac@^1.1.0, create-hmac@^1.1.2: 130 | version "1.1.4" 131 | resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" 132 | dependencies: 133 | create-hash "^1.1.0" 134 | inherits "^2.0.1" 135 | 136 | crypto-browserify@^3.11.0: 137 | version "3.11.0" 138 | resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" 139 | dependencies: 140 | browserify-cipher "^1.0.0" 141 | browserify-sign "^4.0.0" 142 | create-ecdh "^4.0.0" 143 | create-hash "^1.1.0" 144 | create-hmac "^1.1.0" 145 | diffie-hellman "^5.0.0" 146 | inherits "^2.0.1" 147 | pbkdf2 "^3.0.3" 148 | public-encrypt "^4.0.0" 149 | randombytes "^2.0.0" 150 | 151 | des.js@^1.0.0: 152 | version "1.0.0" 153 | resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" 154 | dependencies: 155 | inherits "^2.0.1" 156 | minimalistic-assert "^1.0.0" 157 | 158 | diffie-hellman@^5.0.0: 159 | version "5.0.2" 160 | resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" 161 | dependencies: 162 | bn.js "^4.1.0" 163 | miller-rabin "^4.0.0" 164 | randombytes "^2.0.0" 165 | 166 | domain-browser@^1.1.7: 167 | version "1.1.7" 168 | resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" 169 | 170 | elliptic@^6.0.0: 171 | version "6.3.2" 172 | resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.2.tgz#e4c81e0829cf0a65ab70e998b8232723b5c1bc48" 173 | dependencies: 174 | bn.js "^4.4.0" 175 | brorand "^1.0.1" 176 | hash.js "^1.0.0" 177 | inherits "^2.0.1" 178 | 179 | encoding@^0.1.11: 180 | version "0.1.12" 181 | resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" 182 | dependencies: 183 | iconv-lite "~0.4.13" 184 | 185 | evp_bytestokey@^1.0.0: 186 | version "1.0.0" 187 | resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" 188 | dependencies: 189 | create-hash "^1.1.1" 190 | 191 | fbjs@^0.8.1, fbjs@^0.8.4: 192 | version "0.8.6" 193 | resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.6.tgz#7eb67d6986b2d5007a9b6e92e0e7cb6f75cad290" 194 | dependencies: 195 | core-js "^1.0.0" 196 | isomorphic-fetch "^2.1.1" 197 | loose-envify "^1.0.0" 198 | object-assign "^4.1.0" 199 | promise "^7.1.1" 200 | ua-parser-js "^0.7.9" 201 | 202 | hash.js@^1.0.0: 203 | version "1.0.3" 204 | resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" 205 | dependencies: 206 | inherits "^2.0.1" 207 | 208 | iconv-lite@~0.4.13: 209 | version "0.4.13" 210 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" 211 | 212 | ieee754@^1.1.4: 213 | version "1.1.8" 214 | resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" 215 | 216 | inherits@^2.0.1, inherits@~2.0.1: 217 | version "2.0.3" 218 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 219 | 220 | is-stream@^1.0.1: 221 | version "1.1.0" 222 | resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" 223 | 224 | isarray@~1.0.0: 225 | version "1.0.0" 226 | resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" 227 | 228 | isomorphic-fetch@^2.1.1: 229 | version "2.2.1" 230 | resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" 231 | dependencies: 232 | node-fetch "^1.0.1" 233 | whatwg-fetch ">=0.10.0" 234 | 235 | js-tokens@^2.0.0: 236 | version "2.0.0" 237 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" 238 | 239 | "jspm-nodelibs-assert@github:jspm/nodelibs-assert": 240 | version "0.2.0" 241 | resolved "https://codeload.github.com/jspm/nodelibs-assert/tar.gz/300511666919c7a420e868c0cba6f5a652b7f181" 242 | 243 | "jspm-nodelibs-buffer@github:alexisvincent/nodelibs-buffer": 244 | version "0.3.0" 245 | resolved "https://codeload.github.com/alexisvincent/nodelibs-buffer/tar.gz/218ee95b4e41ae6709e2246393942e5d8c58b0ea" 246 | dependencies: 247 | buffer "^5.0.0" 248 | 249 | "jspm-nodelibs-child_process@github:jspm/nodelibs-child_process": 250 | version "0.2.0" 251 | resolved "https://codeload.github.com/jspm/nodelibs-child_process/tar.gz/cfdc2d27af9d644c7366174bb1de793fe8e9b5f0" 252 | 253 | "jspm-nodelibs-cluster@github:jspm/nodelibs-cluster": 254 | version "0.2.0" 255 | resolved "https://codeload.github.com/jspm/nodelibs-cluster/tar.gz/3e860218e0377db083ce1344bdd4fe00ce55ba1e" 256 | 257 | "jspm-nodelibs-console@github:jspm/nodelibs-console": 258 | version "0.2.1" 259 | resolved "https://codeload.github.com/jspm/nodelibs-console/tar.gz/2c708a3141fb3bbd83e568997086ae7eee605f86" 260 | 261 | "jspm-nodelibs-constants@github:jspm/nodelibs-constants": 262 | version "0.2.0" 263 | resolved "https://codeload.github.com/jspm/nodelibs-constants/tar.gz/eab9ace469f5f8e767397a894e2168c450991b23" 264 | 265 | "jspm-nodelibs-crypto@github:jspm/nodelibs-crypto": 266 | version "0.2.0" 267 | resolved "https://codeload.github.com/jspm/nodelibs-crypto/tar.gz/916bcca3ca088d0abb86e949f80d95374cb98362" 268 | dependencies: 269 | crypto-browserify "^3.11.0" 270 | 271 | "jspm-nodelibs-dgram@github:jspm/nodelibs-dgram": 272 | version "0.2.0" 273 | resolved "https://codeload.github.com/jspm/nodelibs-dgram/tar.gz/3ea3db55ca80a417201992103378ce6d8de25f6c" 274 | 275 | "jspm-nodelibs-dns@github:jspm/nodelibs-dns": 276 | version "0.2.0" 277 | resolved "https://codeload.github.com/jspm/nodelibs-dns/tar.gz/7dc8ed45dbf4955b9f98aea7406b877ee7b6a774" 278 | 279 | "jspm-nodelibs-domain@github:jspm/nodelibs-domain": 280 | version "0.2.0" 281 | resolved "https://codeload.github.com/jspm/nodelibs-domain/tar.gz/31266e4c148b11665b01ac00ad83d2d318bc2f3a" 282 | dependencies: 283 | domain-browser "^1.1.7" 284 | 285 | "jspm-nodelibs-events@github:jspm/nodelibs-events": 286 | version "0.2.0" 287 | resolved "https://codeload.github.com/jspm/nodelibs-events/tar.gz/8de16cf4f1e222003d4474c074e1f4e586c7af42" 288 | 289 | "jspm-nodelibs-fs@github:jspm/nodelibs-fs": 290 | version "0.2.0" 291 | resolved "https://codeload.github.com/jspm/nodelibs-fs/tar.gz/cec6a394f91f3524e72b02e940895ff8224a7e31" 292 | 293 | "jspm-nodelibs-http@github:jspm/nodelibs-http": 294 | version "0.2.0" 295 | resolved "https://codeload.github.com/jspm/nodelibs-http/tar.gz/d9695acd19f036396fc3325ede3a814d94eb5502" 296 | dependencies: 297 | stream-http "^2.0.2" 298 | 299 | "jspm-nodelibs-https@github:jspm/nodelibs-https": 300 | version "0.2.1" 301 | resolved "https://codeload.github.com/jspm/nodelibs-https/tar.gz/03da1a99a726c82d2c1db7c766763b42d3017f8e" 302 | 303 | "jspm-nodelibs-module@github:jspm/nodelibs-module": 304 | version "0.2.0" 305 | resolved "https://codeload.github.com/jspm/nodelibs-module/tar.gz/2df5505600396eb99b5752f47c826ba33bdb194c" 306 | 307 | "jspm-nodelibs-net@github:jspm/nodelibs-net": 308 | version "0.2.0" 309 | resolved "https://codeload.github.com/jspm/nodelibs-net/tar.gz/71b3139a1af61434135586a8bb95a194a266eae1" 310 | 311 | "jspm-nodelibs-os@github:jspm/nodelibs-os": 312 | version "0.2.0" 313 | resolved "https://codeload.github.com/jspm/nodelibs-os/tar.gz/5dc25f4572b5460fc6caed1245d41700858a2df9" 314 | dependencies: 315 | os-browserify "^0.2.0" 316 | 317 | "jspm-nodelibs-path@github:jspm/nodelibs-path": 318 | version "0.2.1" 319 | resolved "https://codeload.github.com/jspm/nodelibs-path/tar.gz/366c5b05e5ee6feed820ab674207a4643290fe37" 320 | 321 | "jspm-nodelibs-process@github:jspm/nodelibs-process": 322 | version "0.2.0" 323 | resolved "https://codeload.github.com/jspm/nodelibs-process/tar.gz/a603cf42280ad4346c73d91caec312f9f3535724" 324 | 325 | "jspm-nodelibs-punycode@github:jspm/nodelibs-punycode": 326 | version "0.2.0" 327 | resolved "https://codeload.github.com/jspm/nodelibs-punycode/tar.gz/ac6a6aea21a14bb1b0810a1b1376992e7edfc8d1" 328 | dependencies: 329 | punycode "^1.3.0" 330 | 331 | "jspm-nodelibs-querystring@github:jspm/nodelibs-querystring": 332 | version "0.2.0" 333 | resolved "https://codeload.github.com/jspm/nodelibs-querystring/tar.gz/8511d57812a9347a894669e4a544ee3ef19171e8" 334 | 335 | "jspm-nodelibs-readline@github:jspm/nodelibs-readline": 336 | version "0.2.0" 337 | resolved "https://codeload.github.com/jspm/nodelibs-readline/tar.gz/c5aea34a0a2709ac56d7255f7afdbeca0c403f1a" 338 | 339 | "jspm-nodelibs-repl@github:jspm/nodelibs-repl": 340 | version "0.2.0" 341 | resolved "https://codeload.github.com/jspm/nodelibs-repl/tar.gz/46fbc74c0abed658e10950a87507bce029fc71c3" 342 | 343 | "jspm-nodelibs-stream@github:jspm/nodelibs-stream": 344 | version "0.2.0" 345 | resolved "https://codeload.github.com/jspm/nodelibs-stream/tar.gz/1e45169f0dd33b7dd069ac71c1451cb9c97fcc02" 346 | dependencies: 347 | stream-browserify "^2.0.1" 348 | 349 | "jspm-nodelibs-string_decoder@github:jspm/nodelibs-string_decoder": 350 | version "0.2.0" 351 | resolved "https://codeload.github.com/jspm/nodelibs-string_decoder/tar.gz/4ada152d14a0627146a92e69e866d6551c68e5b1" 352 | dependencies: 353 | string_decoder "^0.10.31" 354 | 355 | "jspm-nodelibs-timers@github:jspm/nodelibs-timers": 356 | version "0.2.0" 357 | resolved "https://codeload.github.com/jspm/nodelibs-timers/tar.gz/99515d81769c97dd4f45ecb5f6f2f8925a4e514f" 358 | dependencies: 359 | timers-browserify "^1.4.2" 360 | 361 | "jspm-nodelibs-tls@github:jspm/nodelibs-tls": 362 | version "0.2.0" 363 | resolved "https://codeload.github.com/jspm/nodelibs-tls/tar.gz/6577b9ee65d9e4434fdf3a153b852570aa2cf3cd" 364 | 365 | "jspm-nodelibs-tty@github:jspm/nodelibs-tty": 366 | version "0.2.0" 367 | resolved "https://codeload.github.com/jspm/nodelibs-tty/tar.gz/aed9a41ca80f35829ab7d9e827b323f99e482437" 368 | 369 | "jspm-nodelibs-url@github:jspm/nodelibs-url": 370 | version "0.2.0" 371 | resolved "https://codeload.github.com/jspm/nodelibs-url/tar.gz/70fc96f80afc5ae4d50b9047eb4074c7e2c3c943" 372 | dependencies: 373 | url "^0.11.0" 374 | 375 | "jspm-nodelibs-util@github:jspm/nodelibs-util": 376 | version "0.2.1" 377 | resolved "https://codeload.github.com/jspm/nodelibs-util/tar.gz/56953ea0f27d378e911baa2324405cc04fae15c5" 378 | 379 | "jspm-nodelibs-vm@github:jspm/nodelibs-vm": 380 | version "0.2.0" 381 | resolved "https://codeload.github.com/jspm/nodelibs-vm/tar.gz/4a686700a8c8fc4cdd52547082132b69b9356e3f" 382 | 383 | "jspm-nodelibs-zlib@github:jspm/nodelibs-zlib": 384 | version "0.2.0" 385 | resolved "https://codeload.github.com/jspm/nodelibs-zlib/tar.gz/2ca74692613176a36fbc3ee7d1047af5ada631e9" 386 | dependencies: 387 | browserify-zlib "^0.1.4" 388 | 389 | loose-envify@^1.0.0, loose-envify@^1.1.0: 390 | version "1.3.0" 391 | resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.0.tgz#6b26248c42f6d4fa4b0d8542f78edfcde35642a8" 392 | dependencies: 393 | js-tokens "^2.0.0" 394 | 395 | miller-rabin@^4.0.0: 396 | version "4.0.0" 397 | resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" 398 | dependencies: 399 | bn.js "^4.0.0" 400 | brorand "^1.0.1" 401 | 402 | minimalistic-assert@^1.0.0: 403 | version "1.0.0" 404 | resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" 405 | 406 | node-fetch@^1.0.1: 407 | version "1.6.3" 408 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.6.3.tgz#dc234edd6489982d58e8f0db4f695029abcd8c04" 409 | dependencies: 410 | encoding "^0.1.11" 411 | is-stream "^1.0.1" 412 | 413 | object-assign@^4.1.0: 414 | version "4.1.0" 415 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" 416 | 417 | os-browserify@^0.2.0: 418 | version "0.2.1" 419 | resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" 420 | 421 | pako@~0.2.0: 422 | version "0.2.9" 423 | resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" 424 | 425 | parse-asn1@^5.0.0: 426 | version "5.0.0" 427 | resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.0.0.tgz#35060f6d5015d37628c770f4e091a0b5a278bc23" 428 | dependencies: 429 | asn1.js "^4.0.0" 430 | browserify-aes "^1.0.0" 431 | create-hash "^1.1.0" 432 | evp_bytestokey "^1.0.0" 433 | pbkdf2 "^3.0.3" 434 | 435 | pbkdf2@^3.0.3: 436 | version "3.0.9" 437 | resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" 438 | dependencies: 439 | create-hmac "^1.1.2" 440 | 441 | process-nextick-args@~1.0.6: 442 | version "1.0.7" 443 | resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" 444 | 445 | process@~0.11.0: 446 | version "0.11.9" 447 | resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" 448 | 449 | promise@^7.1.1: 450 | version "7.1.1" 451 | resolved "https://registry.yarnpkg.com/promise/-/promise-7.1.1.tgz#489654c692616b8aa55b0724fa809bb7db49c5bf" 452 | dependencies: 453 | asap "~2.0.3" 454 | 455 | public-encrypt@^4.0.0: 456 | version "4.0.0" 457 | resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" 458 | dependencies: 459 | bn.js "^4.1.0" 460 | browserify-rsa "^4.0.0" 461 | create-hash "^1.1.0" 462 | parse-asn1 "^5.0.0" 463 | randombytes "^2.0.1" 464 | 465 | punycode@1.3.2: 466 | version "1.3.2" 467 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" 468 | 469 | punycode@^1.3.0: 470 | version "1.4.1" 471 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" 472 | 473 | querystring@0.2.0: 474 | version "0.2.0" 475 | resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" 476 | 477 | randombytes@^2.0.0, randombytes@^2.0.1: 478 | version "2.0.3" 479 | resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" 480 | 481 | react-dom@^15.3.2: 482 | version "15.4.0" 483 | resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-15.4.0.tgz#6a97a69000966570db48c746bc4b7b0ca50d1534" 484 | dependencies: 485 | fbjs "^0.8.1" 486 | loose-envify "^1.1.0" 487 | object-assign "^4.1.0" 488 | 489 | react@^15.3.2: 490 | version "15.4.0" 491 | resolved "https://registry.yarnpkg.com/react/-/react-15.4.0.tgz#736c1c7c542e8088127106e1f450b010f86d172b" 492 | dependencies: 493 | fbjs "^0.8.4" 494 | loose-envify "^1.1.0" 495 | object-assign "^4.1.0" 496 | 497 | readable-stream@^2.0.2, readable-stream@^2.1.0: 498 | version "2.2.2" 499 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" 500 | dependencies: 501 | buffer-shims "^1.0.0" 502 | core-util-is "~1.0.0" 503 | inherits "~2.0.1" 504 | isarray "~1.0.0" 505 | process-nextick-args "~1.0.6" 506 | string_decoder "~0.10.x" 507 | util-deprecate "~1.0.1" 508 | 509 | ripemd160@^1.0.0: 510 | version "1.0.1" 511 | resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" 512 | 513 | sha.js@^2.3.6: 514 | version "2.4.8" 515 | resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.8.tgz#37068c2c476b6baf402d14a49c67f597921f634f" 516 | dependencies: 517 | inherits "^2.0.1" 518 | 519 | stream-browserify@^2.0.1: 520 | version "2.0.1" 521 | resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" 522 | dependencies: 523 | inherits "~2.0.1" 524 | readable-stream "^2.0.2" 525 | 526 | stream-http@^2.0.2: 527 | version "2.5.0" 528 | resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.5.0.tgz#585eee513217ed98fe199817e7313b6f772a6802" 529 | dependencies: 530 | builtin-status-codes "^2.0.0" 531 | inherits "^2.0.1" 532 | readable-stream "^2.1.0" 533 | to-arraybuffer "^1.0.0" 534 | xtend "^4.0.0" 535 | 536 | string_decoder@^0.10.31, string_decoder@~0.10.x: 537 | version "0.10.31" 538 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" 539 | 540 | systemjs-nodelibs@^1.0.0: 541 | version "1.0.0" 542 | resolved "https://registry.yarnpkg.com/systemjs-nodelibs/-/systemjs-nodelibs-1.0.0.tgz#7e270a1b2120414284fce176143c77d61bf6d897" 543 | dependencies: 544 | jspm-nodelibs-assert jspm/nodelibs-assert 545 | jspm-nodelibs-buffer alexisvincent/nodelibs-buffer 546 | jspm-nodelibs-child_process jspm/nodelibs-child_process 547 | jspm-nodelibs-cluster jspm/nodelibs-cluster 548 | jspm-nodelibs-console jspm/nodelibs-console 549 | jspm-nodelibs-constants jspm/nodelibs-constants 550 | jspm-nodelibs-crypto jspm/nodelibs-crypto 551 | jspm-nodelibs-dgram jspm/nodelibs-dgram 552 | jspm-nodelibs-dns jspm/nodelibs-dns 553 | jspm-nodelibs-domain jspm/nodelibs-domain 554 | jspm-nodelibs-events jspm/nodelibs-events 555 | jspm-nodelibs-fs jspm/nodelibs-fs 556 | jspm-nodelibs-http jspm/nodelibs-http 557 | jspm-nodelibs-https jspm/nodelibs-https 558 | jspm-nodelibs-module jspm/nodelibs-module 559 | jspm-nodelibs-net jspm/nodelibs-net 560 | jspm-nodelibs-os jspm/nodelibs-os 561 | jspm-nodelibs-path jspm/nodelibs-path 562 | jspm-nodelibs-process jspm/nodelibs-process 563 | jspm-nodelibs-punycode jspm/nodelibs-punycode 564 | jspm-nodelibs-querystring jspm/nodelibs-querystring 565 | jspm-nodelibs-readline jspm/nodelibs-readline 566 | jspm-nodelibs-repl jspm/nodelibs-repl 567 | jspm-nodelibs-stream jspm/nodelibs-stream 568 | jspm-nodelibs-string_decoder jspm/nodelibs-string_decoder 569 | jspm-nodelibs-timers jspm/nodelibs-timers 570 | jspm-nodelibs-tls jspm/nodelibs-tls 571 | jspm-nodelibs-tty jspm/nodelibs-tty 572 | jspm-nodelibs-url jspm/nodelibs-url 573 | jspm-nodelibs-util jspm/nodelibs-util 574 | jspm-nodelibs-vm jspm/nodelibs-vm 575 | jspm-nodelibs-zlib jspm/nodelibs-zlib 576 | readable-stream "^2.0.2" 577 | 578 | systemjs@^0.19.41: 579 | version "0.19.41" 580 | resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-0.19.41.tgz#835d2c0f10bf403b551fedc875f84bb44a02c4eb" 581 | dependencies: 582 | when "^3.7.5" 583 | 584 | timers-browserify@^1.4.2: 585 | version "1.4.2" 586 | resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" 587 | dependencies: 588 | process "~0.11.0" 589 | 590 | to-arraybuffer@^1.0.0: 591 | version "1.0.1" 592 | resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" 593 | 594 | ua-parser-js@^0.7.9: 595 | version "0.7.12" 596 | resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb" 597 | 598 | url@^0.11.0: 599 | version "0.11.0" 600 | resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" 601 | dependencies: 602 | punycode "1.3.2" 603 | querystring "0.2.0" 604 | 605 | util-deprecate@~1.0.1: 606 | version "1.0.2" 607 | resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" 608 | 609 | whatwg-fetch@>=0.10.0: 610 | version "2.0.1" 611 | resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.1.tgz#078b9461bbe91cea73cbce8bb122a05f9e92b772" 612 | 613 | when@^3.7.5: 614 | version "3.7.7" 615 | resolved "https://registry.yarnpkg.com/when/-/when-3.7.7.tgz#aba03fc3bb736d6c88b091d013d8a8e590d84718" 616 | 617 | xtend@^4.0.0: 618 | version "4.0.1" 619 | resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" 620 | -------------------------------------------------------------------------------- /test/typescript/app.ts: -------------------------------------------------------------------------------- 1 | import "core-js/client/shim-min.js"; 2 | import "reflect-metadata"; 3 | import "zone.js"; 4 | 5 | import { Component, NgModule } from "@angular/core"; 6 | import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; 7 | import { BrowserModule } from "@angular/platform-browser"; 8 | 9 | @Component({ 10 | selector: "test-app", 11 | template: ` 12 |

Hello SystemJS

13 | ` 14 | }) 15 | export class AppComponent { 16 | 17 | } 18 | 19 | @NgModule({ 20 | imports: [BrowserModule], 21 | declarations: [AppComponent], 22 | bootstrap: [AppComponent] 23 | }) 24 | export class AppModule { 25 | 26 | } -------------------------------------------------------------------------------- /test/typescript/config.js: -------------------------------------------------------------------------------- 1 | SystemJS.config({ 2 | transpiler: 'plugin-typescript', 3 | typescriptOptions: { 4 | module: "system", 5 | noImplicitAny: true, 6 | typeCheck: true, 7 | tsconfig: true 8 | } 9 | }); -------------------------------------------------------------------------------- /test/typescript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 18 | 19 | 20 | 21 | 22 | Loading... 23 | 24 | 25 | 26 | 27 |
Welcome to {{title}}
28 | 29 |
30 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /test/typescript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "systemjs-config-builder-test-typescript", 3 | "version": "1.0.0", 4 | "main": "app.ts", 5 | "license": "MIT", 6 | "scripts": { 7 | "start": "ws -c", 8 | "config": "node ../../dist/cli.js", 9 | "postinstall": "npm run config" 10 | }, 11 | "dependencies": { 12 | "@angular/common": "^2.2.4", 13 | "@angular/compiler": "^2.2.4", 14 | "@angular/core": "^2.2.4", 15 | "@angular/platform-browser": "^2.2.4", 16 | "@angular/platform-browser-dynamic": "^2.2.4", 17 | "core-js": "^2.4.1", 18 | "plugin-typescript": "5.2.7", 19 | "reflect-metadata": "^0.1.8", 20 | "rxjs": "5.0.0-beta.12", 21 | "systemjs": "^0.19.41", 22 | "systemjs-nodelibs": "^1.0.0", 23 | "zone.js": "0.6.26" 24 | }, 25 | "devDependencies": { 26 | "local-web-server": "^1.2.6" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "noImplicitAny": false, 6 | "sourceMap": true, 7 | "experimentalDecorators": true, 8 | "emitDecoratorMetadata": true, 9 | "moduleResolution": "node" 10 | } 11 | } --------------------------------------------------------------------------------