Giter Site home page Giter Site logo

jspm-cli's Introduction

JSPM CLI

JSPM CLI is the package management of the JSPM project, supporting import map package management.

Getting Started | Documentation | FAQ


  • Resolution against node_modules for local development workflows.
  • Versioned, locked dependency management against the local package.json.
  • Tracing and installing the full dependency tree of an application.
  • Complete NPM-like module resolution that supports conditional environments and package entry points.
  • Support for a wide range of CDNs, such as jspm.io, jsDeliver, esm.sh and unpkg.
  • Import map extraction/injection into HTML files, with module preloading and integrity attributes.

See the documentation and getting started guide on jspm.org.

Contributing

Build and test workflows use Chomp.

License

Apache-2.0

jspm-cli's People

Contributors

adamburgess avatar aluanhaddad avatar aslemammad avatar bubblyworld avatar computmaxer avatar crisptrutski avatar dependabot[bot] avatar djindjic avatar douglasduteil avatar floatdrop avatar frederikschubert avatar guybedford avatar jackfranklin avatar jakeniemiec avatar jarreddebeer avatar jayakrishnanamburu avatar jbanety avatar jimthedev avatar johnraz avatar lookfirst avatar msakamaki avatar nickl avatar orkon avatar seph-m avatar stefanr avatar subesokun avatar tauren avatar unional avatar vladima avatar zenorbi avatar

Stargazers

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

Watchers

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

jspm-cli's Issues

jspm bundle: ReferenceError: window is not defined

$ jspm bundle js/app

     Building the single-file dependency tree for js/app...
Execution error for /Users/Oliver/Development/developers/src/jspm_packages/github/ded/[email protected]/reqwest.js: ReferenceError: window is not defined
    at eval (eval at __eval (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1946:10), <anonymous>:13:13)
    at win (eval at __eval (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1946:10), <anonymous>:8:72)
    at eval (eval at __eval (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1946:10), <anonymous>:11:2)
    at __eval (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1946:5)
    at Object.exec [as __exec] (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:211:5)
    at Object.loader.instantiate (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1282:14)
    at Object.loader.instantiate (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1579:32)
    at p.then.then.then.traceur (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/node_modules/es6-module-loader/lib/loader.js:262:33)
    at eval (eval at <anonymous> (/usr/local/lib/node_modules/jspm/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:1383:100)
    at promiseHandle (eval at <anonymous> (/usr/local/lib/node_modules/jspm/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:1477:20)

err  ReferenceError: window is not defined
         at eval (eval at __eval (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1946:10), <anonymous>:13:13)
         at win (eval at __eval (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1946:10), <anonymous>:8:72)
         at eval (eval at __eval (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1946:10), <anonymous>:11:2)
         at __eval (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1946:5)
         at Object.exec [as __exec] (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:211:5)
         at Object.loader.instantiate (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1282:14)
         at Object.loader.instantiate (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/dist/system.js:1579:32)
         at p.then.then.then.traceur (/usr/local/lib/node_modules/jspm/node_modules/systemjs-builder/node_modules/systemjs/node_modules/es6-module-loader/lib/loader.js:262:33)
         at eval (eval at <anonymous> (/usr/local/lib/node_modules/jspm/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:1383:100)
         at promiseHandle (eval at <anonymous> (/usr/local/lib/node_modules/jspm/node_modules/traceur/src/node/traceur.js:24:17), <anonymous>:1477:20)

Is this because my reqwest dependency references window?

import jspm package using github

I am doing the following:

jspm install github:angular/bower-angular-messages

However I can not import the library. I first install

jspm install angular

That workds fine with

import angular from 'angular';

I am not able to import using the following:

import angularMessages from  'github:angular/bower-angular-messages';

or

import angularMessages from  'angular-messages';

I am not sure what is wrong. How can I import angular-messages?

Thanks

move to URL-scheme based endpoints

Let the endpoint, from the perspective of the CLI, simply be a URL, say https://myserver.com

Then, we assume the following structure:

  /some-package.versions.json - version listing JSON as in getVersions
  /[email protected] - archives provided
  /[email protected]
  /[email protected] 
  /[email protected] 

This can be combined with CDN support as well, making the entire communication system a scheme as opposed to some special server.

This allows installs of myserver:some-package with full version management.

Trouble resolving '~' versions

Trying to install a lib with a flexible version range defined with a tilde. jspm reports that no compatible version are found

$ jspm install when@~3
No package.json found, would you like to create one? [yes]: 
Enter packages folder [jspm_packages]: 
Enter config file path [config.js]: 
Configuration file config.js not found, create it? [y]: 

     Looking up when in registry
     Checking versions for github:cujojs/when

err  No version match found for github:cujojs/when@~3

warn Installation changes not saved

However, versions defined with a carrot do work.

$ jspm install when@^3
No package.json found, would you like to create one? [yes]: 
Enter packages folder [jspm_packages]: 
Enter config file path [config.js]: 
Configuration file config.js not found, create it? [y]: 

     Looking up when in registry
     Checking versions for github:cujojs/when
     Downloading github:cujojs/[email protected]
ok   Installed when as github:cujojs/when@^3 (3.2.2)
     Downloading loader files to jspm_packages
       [email protected]
       [email protected]
       [email protected]
       [email protected]
       [email protected]
ok   Loader files downloaded successfully
ok   Loader set to local library sources

ok   Install complete

Running [email protected]

Implement bundle arithmetic

It's simply a matter of wiring now!

I was thinking of something like:

  jspm bundle npm:moduleA + github:anther/module/file out.js
  jspm bundle npm:moduleA * github:anther/module/file + app out.js
  jspm bundle npm:moduleA - github:anther/module/file - app out.js

Where:

  • - is subtractTrees (negation)
  • + is addTrees (union)
  • * is intersectTrees (intersection)

Hardest part now is recursive operator ordering and testing. Implementations are already complete here https://github.com/systemjs/builder#advanced-build

TypeError: Arguments to path.resolve must be strings

Once again, sorry for the dumb copy/paste of the error. After updating the CLI and running jspm.init I got this at the 'create package.json' stage:

o package.json found, would you like to create one? (y/n): y
package.json updated.
Downloading loader files to undefined.
err TypeError: Arguments to path.resolve must be strings
at Object.exports.resolve (path.js:313:15)
at /usr/local/lib/node_modules/jspm/jspm.js:942:20
at Object.Config.verifyJSPMPackages (/usr/local/lib/node_modules/jspm/jspm.js:639:14)
at /usr/local/lib/node_modules/jspm/jspm.js:940:14
at /usr/local/lib/node_modules/jspm/jspm.js:938:7
at Object.JSPM.downloadLoader (/usr/local/lib/node_modules/jspm/jspm.js:939:7)
at /usr/local/lib/node_modules/jspm/jspm.js:931:14
at Object.Config.savePackageJSON (/usr/local/lib/node_modules/jspm/jspm.js:693:5)
at /usr/local/lib/node_modules/jspm/jspm.js:674:16
at /usr/local/lib/node_modules/jspm/jspm.js:1090:9

CDN support?

Hi,

Just thought to point out there's a little API available for some of the most popular JavaScript CDNs at https://github.com/jsdelivr/api . Maybe you can use that somehow (ie. load assets from CDN or something).

Traceur dependency uses git+ssh:// URI

In the 0.6.2 NPM package, the package.json file still references traceur as "git+ssh://[email protected]/google/traceur-compiler.git". This is preventing me to npm install jspm globally, because my root user does not have keys setup to access Github over SSH (of course).

I can see that the package.json file has been fixed in master (pointing to "google/traceur-compiler#0.0.43"), but I can't find the tag for 0.6.2.

Would it be possible to issue a new release that contains a fix to the traceur dependency? Would be much appreciated! I assume it's mostly a question of releasing master, but let me know if I can help.

Thanks!

auto downgrade / upgrade should only happen within new libraries

Already installed libraries that have been used by the developer should not be automatically upgraded or downgraded otherwise this may introduce bugs they did not ask for!

The way to handle this is to distinguish the "new" libraries from the "old" libraries when running deduping during install.

jspm init: Custom jspm packages folder not respected

$ jspm init
No package.json found, would you like to create one? [yes]:
Enter packages folder [jspm_packages]: foobar
Enter config file path [config.js]: bazbob.js
Configuration file bazbob.js not found, create it? [y]:

ok   Verified package.json at package.json
     Verified config file at bazbob.js

However packages are still installed to jspm_packages.

what does this do that npm doesn't

Having a comparison of this vs npm would be nice.

I don't understand what this does?

Couldn't you just do ES6 module loader loading from node_modules ?

Allow for direct jspm install

When no arguments are given, jspm install should work in an update / create mode for everything currently defined.

The map config would provide those dependencies which need to be updated based on latest or minor versions.

Then for exact version installed resources, we need to do a dependency trace of the whole project to get these and install the resources, just as with downloads.

Allow configuration injection without install

Usage:

  jspm inject jquery

Configures the package and locks the version, without installing locally, still using the CDN version.

Ideally this should be the same subroutine that gets run during install.

minify options

minify.mangle, minify.firstComment, minify.sourceMaps

Hashes should only be added on completion

This way partial installs won't mess things up.

The reason this is hard is how to install circular packages, since which do we add the hash to first to indicate completion?

Allow commit SHAs

I wish to access commits on GitHub, not just releases (tags).

Is this possible?

Contributing to JSPM

Guy,
Fantastic talk at MWJS. You mentioned you're looking for help on the project, I'm certain many of us here are very interested in getting involved. Just wanted to ask you directly:
How could we get involved?
Where are you looking for help next?
What are the next hurdles for the project & are any of those parts we could get involved in?

jspm init fails with: TypeError: Arguments to path.resolve must be strings

Apologies for purely pasting text from the terminal:

$ jspm init
Enter config file location (config.js):
Enter external library install location (jspm_packages):
Enter local application code location / baseURL (lib): js
Config file updated.
No package.json found, would you like to create one? (y/n): y
Downloading loader files to jspm_packages.
err TypeError: Arguments to path.resolve must be strings
at Object.exports.resolve (path.js:313:15)
at /usr/local/lib/node_modules/jspm/jspm.js:809:18
at /usr/local/lib/node_modules/jspm/jspm.js:806:7
at Object.JSPM.downloadLoader (/usr/local/lib/node_modules/jspm/jspm.js:807:7)
at /usr/local/lib/node_modules/jspm/jspm.js:801:12
at /usr/local/lib/node_modules/jspm/jspm.js:480:13
at Object.Config.verifyConfig (/usr/local/lib/node_modules/jspm/jspm.js:547:7)
at /usr/local/lib/node_modules/jspm/jspm.js:542:23
at ReadStream. (/usr/local/lib/node_modules/jspm/jspm.js:988:16)
at ReadStream.EventEmitter.emit (events.js:95:17)
package.json updated.

System.import doesn't return object in callback of promise

Hi, I think jspm it's very interesting solution to load libraries from npm directly in browser. But I have a little problem with my module. I try to load it with function call:

  System.import('npm:util').then(function(Util) {
       Util.log('hello');
  });

But this construction isn't' work as good as it works with jquery and underscore.

Maybe thing is in the way I try to understand in what environment my code is working:

(function(scope) {
  if (scope.window) {
        Scope           = window;
        Scope.Util      = new UtilProto();
    } else {
        Scope           = global;
        module.exports  = new UtilProto();
    }
})(this);

This code works good in browser and node.js and module loads any way with jspm. But I can't figure out why it do not go to the parameters of promises callback. Could you please help me?

By the way I suggest you parse markdown of jspm.io on server because this site wouldn't work without JavaScript enabled (it's very bad for search engines and mobile users, they just could read nothing).

Windows support

I've installed jspm

npm install -g jspm

When I run

jspm install npm:grunt

I accept all the defaults for the init and then get the following output:

Checking versions for npm:grunt
Downloading npm:[email protected]

And the prompt just sits there for forever, never installing. If I terminate the batch process early, it doesn't look like the package.json, jspm_packages, or config.js were created.

I am running this on Windows 7

es6 workflow

Questions -

  • Distribute ES6 or compiled ES6?
  • How to version Traceur runtime in a sharable way?
  • If we just distribute ES6 rather, do we let Traceur updates happen globally and assume the existing code still works?

Can't install on Mac

Using Mac OS X Version 10.7.5
Running

npm install jspm -g

Gives the following output:

npm ERR! notarget No compatible version found: traceur@'google/traceur-compiler#0.0.43'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9","0.0.10","0.0.11","0.0.12","0.0.13","0.0.14","0.0.15","0.0.16","0.0.17","0.0.18","0.0.19","0.0.20","0.0.21","0.0.22","0.0.23","0.0.24","0.0.25","0.0.27","0.0.28","0.0.29","0.0.30","0.0.31","0.0.32","0.0.33","0.0.34","0.0.35","0.0.36","0.0.37","0.0.38","0.0.39","0.0.40","0.0.41","0.0.42","0.0.43","0.0.44","0.0.45","0.0.46","0.0.47","0.0.48","0.0.49"]
npm ERR! notarget 
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "jspm" "-g"
npm ERR! cwd /Users/qabypass
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ETARGET
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/qabypass/npm-debug.log
npm ERR! not ok code 0

Looking at your packages json and this error, im wondering if the traceur dependency should be "0.0.43" instead of "google/traceur-compiler#0.0.43"

es6 tracing not working

Seems to be a conflict with es6-module-transpiler and traceur in NodeJS.

Moving to a traceur-only workflow will resolve this.

fix source maps for CLI

Currently the base folder for the source map is the CLI base dir itself. It should be process.cwd() rather.

Make package.json optional

  • It should work without a package.json being necessary, asking before creating a config file and jspm_packages folder though still.
  • dl-loader should also work without a package.json

This simplifies the thinking of what the CLI does to just being "adds things to jspm_packages and updates a configuration file at config.js".

jspm install fails behind proxy

$ jspm install github:jquery

Getting version list for github:jquery
err  Error looking up version for jquery
     ssh: connect to host github.com port 22: Connection refused
     fatal: Could not read from remote repository.

     Please make sure you have the correct access rights
     and the repository exists.

     Config file updated.
     package.json updated.
warn Install finished, with errors.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.