GithubHelp home page GithubHelp logo

caolan / jam Goto Github PK

View Code? Open in Web Editor NEW
1.5K 47.0 105.0 2.35 MB

JavaScript package manager - using a browser-focused and RequireJS compatible repository

License: MIT License

JavaScript 99.46% Shell 0.45% Batchfile 0.09%

jam's Introduction

****NOTE: this project is no longer active and not recommended for use. It is left here for reference. ****

Jam was created at a time before Bower and provided a (still to this day) very nice installation workflow which meant you could 'jam install jquery', then immediately 'require("jquery")' in your application. No manual bundling or build step (e.g. browserify, webpack) required. This was thanks in large part to the power and flexibility of the AMD format.

Since it's creation, NPM has set it's sights more firmly on the browser space, and the popularity of the AMD module format is waning. Jam never really got enough traction to compete. Thanks to everone that helped out and gave it a try.

If you want to try hosting your own Jam repository, see the repositories section below. The public Jam repository is now retired.


Jam

For front-end developers who crave maintainable assets, Jam is a package manager for JavaScript. Unlike other repositories, we put the browser first.

  • Manage dependencies - Using a stack of script tags isn't the most maintainable way of managing dependencies, with Jam packages and loaders like RequireJS you get automatic dependency resolution.

  • Fast and modular - Achieve faster load times with asynchronous loading and the ability to optimize downloads. JavaScript modules and packages provide properly namespaced and more modular code.

  • Use with existing stack - Jam manages only your front-end assets, the rest of your app can be written in your favourite language or framework. Node.js tools can use the repository directly with the Jam API.

  • Custom builds - No more configuring custom builds of popular libraries. Now, every build can be optimized automatically depending on the parts you use, and additional components can always be loaded later.

  • Focus on size - Installing multiple versions works great on the server, but client-side we don't want five versions of jQuery! Jam can use powerful dependency resolution to find a working set of packages using only a single version of each.

  • 100% browser - Every package you see here will work in the browser and play nicely with module loaders like RequireJS. We're not hijacking an existing repository, we're creating a 100% browser-focused community!

Visit the Jam website

Example usage

$ jam install jquery
<script src="jam/require.js"></script>

<script>
    require(['jquery'], function ($) {
        ...
    });
</script>

Learn more...

Browser packages in package.json

You can also define your browser dependencies in a project-level package.json file. If you use Node.js, this format will already familiar to you, and the Jam dependencies can live alongside your NPM dependencies. It's also possible to define custom install paths and baseUrls, as well as hand in any requirejs configuration here:

{
    "name": "my-project",
    "version": "0.0.1",
    "description": "My example project",
    "jam": {
        "baseUrl": "public",
        "packageDir": "public/vendor",
        "dependencies": {
            "jquery": "1.7.x",
            "underscore": null
        },
        "config": {
          "paths": {
            "templates": "public/templates"
          }
        }
    }
}

Installation

# npm install -g jamjs

Requires node.js

Settings

You can customize Jam by creating a .jamrc file in your home directory.

.jamrc

repositories

An array with Jam repositiories. Jam uses http://jamjs.org/repository by default, but it's possible to create a local, e.g. corporate, repository.

exports.repositories = [
    "http://mycorporation.com:5984/repository/",
    "http://jamjs.org/repository"
];

Repositories are in preference-order, so packages from repositories earlier in the list will be preferred over packages in repositories later in the list. However, when no package version is specified, the highest version number will be installed (even if that's not from the earliest repository).

You can add custom search URLs to repositories too:

exports.repositories = [
    {
        url: "http://mycorporation.com:5984/repository/",
        search: "http://db.com:5984/_fti/key/_design/search/something"
    },
    "http://jamjs.org/repository"
];

If your local repository doesn't implement full text search (e.g. you don't want to install couchdb lucene), you can disable searching functionality for that repository, otherwise jam search would report an error:

exports.repositories = [
    {
        url: "http://mycorporation.com:5984/repository/",
        search: false
    },
    "http://jamjs.org/repository"
];

See the section below on running your own repository.

package_dir

Sets the default package installation directory (normally uses ./jam). This is best customized in your project-level package.json file, to ensure other developers also install to the correct location.

exports.package_dir = 'libs';

Running the tests

Jam includes two test suites, unit tests (in test/unit) and integration tests (in test/integration). The unit tests are easy to run by running the test/unit.sh script, or test\unit.bat on Windows. The integration tests first require you to set up a CouchDB instance to test against (you can get a free account at IrisCouch if you don't want to install CouchDB). You then need to set the JAM_TEST_DB environment variable to point to a CouchDB database URL for testing:

Linux

export JAM_TEST_DB=http://user:password@localhost:5984/jamtest

Windows

set JAM_TEST_DB=http://user:password@localhost:5984/jamtest

Warning: All data in the test database will be deleted!

You can then run the integration tests using test/integration.sh or test\integration.bat. To run BOTH the unit and integration tests use test/all.sh or test\all.bat.

Running your own private repository or mirror

  1. Install couchdb

Mac OS X:

1. Install [Homebrew](http://mxcl.github.com/homebrew/).
2. 
brew install couchdb

Ubuntu:

apt-get install couchdb
  1. Configure your database
curl -X POST http://127.0.0.1:5984/_replicate -d '{
    "source":"http://jamjs.org/repository",
    "target":"http://localhost:5984/repository",
    "continuous":true,
    "doc_ids":["_design/jam-packages"]
    }' -H "Content-Type: application/json"

To create a mirror:

curl -X POST http://127.0.0.1:5984/_replicate -d '{
    "source":"http://jamjs.org/repository",
    "target":"repository",
    "continuous":true,
    "create_target":true
    }' -H "Content-Type: application/json"

To create an empty, private repository:

curl -X PUT http://127.0.0.1:5984/repository
  1. Edit your .jamrc file to use your new repository:
exports.repositories = [
    {
        url: "http://localhost:5984/repository",
        search: false
    },
    "http://jamjs.org/repository"
];

Adding search

  1. Install couchdb-lucene
  2. Restart couchdb.
  3. Edit your .jamrc file to allow searching on your repository:
exports.repositories = [
    {
        url: "http://localhost:5984/repository",
        search: "http://localhost:5984/_fti/local/repository/_design/jam-packages/packages/"
    },
    "http://jamjs.org/repository"
];

Publishing packages to your private repository

jam publish --repository http://localhost:5984/repository

More documentation

To learn how to create and publish packages etc, and for more info on using packages, consult the Jam documentation website.

Links

jam's People

Contributors

hwrod avatar jrf0110 avatar lachenmayer avatar mattrobenolt avatar maxpeterson avatar mitchellrj avatar nfriedly avatar petebacondarwin avatar pieterv avatar ryanramage avatar slexaxton avatar tbranyen 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

jam's Issues

jamjs and static folders in django apps

When I use jam js it always created a relative path. Which is problematic when using it inside of a Django app. Is there a way for when I install that it will add a /static/someapp/js/jam instead of static/someapp/js/jam?

Sample package.json is wrong

The sample in http://jamjs.org/docs#Package_json isn't valid json because the colon has been placed the wrong side of the speach marks:

{
  "name": "example",
  "version": "0.0.1",
  "description:" "An example Jam package",
  "dependencies": {
    "jquery": ">1.4.2",
    "underscore": ">1.3.1"
  },
}

Should Be:

{
  "name": "example",
  "version": "0.0.1",
  "description": "An example Jam package",
  "dependencies": {
    "jquery": ">1.4.2",
    "underscore": ">1.3.1"
  },
}

Canvas Size

<script type="text/javascript"> var WIDTH; var HEIGHT; var canvas; var con; var g; var pxs = new Array(); var rint = 60; $(document).ready(function(){ WIDTH = window.innerWidth; HEIGHT = window.innerHeight; $('#container').width(WIDTH).height(HEIGHT); canvas = document.getElementById('pixie'); $(canvas).attr('width', WIDTH).attr('height',HEIGHT); con = canvas.getContext('2d'); for(var i = 0; i < 100; i++) { pxs[i] = new Circle(); pxs[i].reset(); } setInterval(draw,rint); --- I want to set this to spefic width & height

Add jam section to node's package.json for "jam install" command.

I would love the ability to have a "jam" section in my node package.json.

{
  "name": "myapp",
  "description": "My cool app that uses npm and jam",
  "version": "0.0.1",
  "private": true,
  "dependencies": {
    "smith": "~0.1.5",
    "ws": "~0.4.21"
  },
  "scripts": {
    "postinstall": "cd public; jam install ../package.json"
  },
  "jam": {
    "dependencies": {
      "events": "~0.0.1",
      "smith": "~0.1.5"
    }
  }
}

In this example, the node "smith" module is actually the same exact module as the smith used in the browser. It's an rpc protocol over websockets. It's important that the server version and the client version match. By having both libraries defined in the same file, I can easily see that they are both updated at the same time.

To launch this app I would checkout the git source, and then npm install. Which would then jam install pacakge.json (maybe make the package.json optional and default to this behavior). Then I would npm start which would run node server.js and my server would be up and running!

Add --exclude option to compile command

Especially useful in the case of plugins such as "text" or "cs", where you don't actually want to include the coffeescript compiler if you're pre-compiling and not dynamically loading any coffeescript code.

Add Project Generator Support

It will be nice if the jam command had a functionality to output a project for you to start coding into. Just a thought.

`baseUrl` not properly set or configured in generated requirejs files?

I am working on a node app with a directory structure like so:

├── app.js
├── package.json
├── public
│   ├── admin.html
│   ├── jam
│   ├── js

My app is serving up the public directory directly, so if you request http://example.com/admin.html it will give you public/admin.html.

I am running in to problems making jam create the correct paths in the generate requirejs files. The relevant portions of my package.json file looks like this:

  "jam": {
    "packageDir": "public/jam",
    "baseUrl": "public",
    "dependencies": {
      "angularjs": "1.0.1"
    }
  },

So I specify to install into the public directory, and to use that as a baseUrl. I expect the baseUrl in the generated require.js and require.config.js files to be ../, since that is the relative path to public from public/jam, and will let me require files from the correct paths. However, the generated require.js doesn't contain a baseUrl property, so scripts are being required relative to the directory from data-main in my script tags.

How can I make jamjs generate requirejs files with the baseUrl properly set?

Fix modules with "." in name

You should be able to create and install modules with a "." in the name. I created a socket.io module, but can't install from the repository:

Error: Unknown install target: socket.io
    at Object.oncomplete (/usr/lib/node_modules/jamjs/lib/commands/install.js:213:29)
Failed

However installing from the tar.gz works.

cdnjs

Hi there,
looking into making browser extensions and gems/packages that give the developer a synchronous copy of the entire cdnjs.com repository. Is it in this projects philosophy to support cdn hosted libraries. e.g. you could throw in an option -cdn which sets up the library to use a cdn link instead for that file.

So instead of mashing jquery into your require.js build instead use a cdn version such that it will be faster in production because jquery is usually cached.

Allow package.jam.json to overwrite package.json values

I faced issues on my very first package that i tried to publish, there were conflicting values in the package.json file between npm and jam.

First and, well, disarming problem, was that because the name i chose for my package was not available in npm, i had to change it a bit... While i didn't have to change it for jam as it was available... So there goes the name key...

It would be awesome if jam honored the package.jam.json file. A file where whatever key is declared, overwrites the one in the package.json file...

So in my case package.jam.json would look like:

{
    "name": "jam",
    "main": "example.js",
    "shim": {
        "deps": ["jquery"],
        "exports": "Example"
    }
}

npm is happy, jam is happy, everyone's happy...

And i'd be happier than everyone if you could point me to the right direction so i can send a pull req for this...

Cheers

Thanks!

Just wanted to say thanks for this! I've been looking for something like this for a while and this fits the bill perfectly! Thanks for the hard work putting this together.

compiling bootstrap

I'm just trying jam.
I have installed jquery and bootstrap, all fine, when i executed the compile command this error was throwed:

Error: Error: ENOENT, no such file or directory '/home/usuario/projects/front/jam/bootstrap/main.js'
    at Object.<anonymous> (fs.js:230:18)

    at /usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:14253:23
    at /usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:15451:30
    at Object.execCb (/usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:1766:33)
    at Object.check (/usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:1075:51)
    at Object.enable (/usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:1316:22)
    at Object.init (/usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:974:26)
    at Object.require (/usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:1571:28)
    at /usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:1850:24
    at Function.optimize (/usr/local/lib/node_modules/jamjs/node_modules/requirejs/bin/r.js:15461:13)
    at /usr/local/lib/node_modules/jamjs/lib/commands/compile.js:189:23
Failed

Search and install don't agree

I can do this:

$ jam search boot
bootstrap 2.0.3
HTML, CSS, and JS toolkit from Twitter.
...

but then:

$ jam install bootstrap
Error: Unknown install target: bootstrap
    at exports.install (/usr/local/lib/node_modules/jamjs/lib/commands/install.js:213:29)
    at Object.oncomplete (fs.js:297:15)
Failed

Other packages install flawlessly. I can't seem to figure out what's wrong here exactly.

package.json example in docs is invalid JSON

Hey,

i didn't find the source for the docs up at jamjs.org/docs, but I ran into a bug while copy-pasting from http://jamjs.org/docs#Package_json :


{
  "name": "example",
  "version": "0.0.1",
  "description:" "An example Jam package",
  "dependencies": {
    "jquery": ">1.4.2",
    "underscore": ">1.3.1"
  },
}

isn't proper JSON, here's a fixed version (for copy-pasting):

{
    "name": "example",
    "version": "0.0.1",
    "description": "An example Jam package",
    "dependencies": {
        "jquery": ">1.4.2",
        "underscore": ">1.3.1"
    }
}

Same is true for the "Full example", fixed version is:

{
    "name": "example",
    "version": "0.0.1",
    "description": "An example Jam package",
    "homepage": "http://example.com",
    "keywords": [
        "package",
        "example"
    ],
    "dependencies": {
        "jquery": ">1.4.2",
        "underscore": ">1.3.1"
    },
    "maintainers": [
        {
            "name": "Bill Smith",
            "email": "[email protected]",
            "web": "http://www.example.com"
        }
    ],
    "contributors": [
        {
            "name": "Mary Brown",
            "email": "[email protected]",
            "web": "http://www.example.com"
        }
    ],
    "bugs": {
        "mail": "[email protected]",
        "web": "http://www.example.com/bugs"
    },
    "licenses": [
        {
            "type": "MIT",
            "url": "http://www.opensource.org/licenses/mit-license.php"
        }
    ],
    "repositories": [
        {
            "type": "git",
            "url": "http://github.com/example/example.git"
        }
    ],
    "github": "http://github.com/example/example",
    "main": "example.js",
    "shim": {
        "deps": [
            "jquery"
        ],
        "exports": "Example"
    }
}

HTH,
Filip

jam link fails on Mac OS X

Hello,

When trying out to create my a package I think I ran into an issue.
I need to tell you that I'm quite new to using node.js.

Version information:

jam --version
0.1.11
node --version
v0.8.2

I've tried to debug the issue, here's what I got:

break in lib/commands/link.js:35
33 debugger;
34
35 var opt = a.options;
36 opt.target_dir = opt.target_dir || './jam';
37
debug> n
break in lib/commands/link.js:36
34
35 var opt = a.options;
36 opt.target_dir = opt.target_dir || './jam';
37
38 opt.repositories = _settings.repositories;
debug> opt
ReferenceError: opt is not defined
at repl:1:2
at Interface.controlEval (_debugger.js:960:21)
at Interface. (repl.js:250:12)
at Interface.EventEmitter.emit (events.js:88:17)
at Interface._onLine (readline.js:183:10)
at Interface._line (readline.js:501:8)
at Interface._ttyWrite (readline.js:719:14)
at ReadStream. (readline.js:105:12)
at ReadStream.EventEmitter.emit (events.js:115:20)
at emitKey (readline.js:1041:12)
debug> console.log(opt)
ReferenceError: opt is not defined
at repl:1:14
at Interface.controlEval (_debugger.js:960:21)
at Interface. (repl.js:250:12)
at Interface.EventEmitter.emit (events.js:88:17)
at Interface._onLine (readline.js:183:10)
at Interface._line (readline.js:501:8)
at Interface._ttyWrite (readline.js:719:14)
at ReadStream. (readline.js:105:12)
at ReadStream.EventEmitter.emit (events.js:115:20)
at emitKey (readline.js:1041:12)

That's where I got stuck, I can't seem to figure out why opt is undefined.
It's should be defined by line 35, else I'm expecting line 36 to throw some kind of
exception that opt is undefined.

creating a package in a local repository

I'm attempting to create a local package (local being internal to my company). In my jam.json, I list the github url as:

  "repositories": [
      {
        "type": "git",
        "url": "https://github.[company].net/[username]/demo_jam.git"
      }
    ]

I noticed your bug about installing through jam.json, but I can't get it to work with jam install demojam.
I get the error :

installing from repositories demojam
Building version tree...
repositories checking "demojam"
Error: No package for 'demojam'
    at Object.dependencyError (/usr/local/lib/node_modules/jamjs/lib/tree.js:216:16)
    at Object.updateDep (/usr/local/lib/node_modules/jamjs/lib/tree.js:181:33)
    at Object.addDependency (/usr/local/lib/node_modules/jamjs/lib/tree.js:128:28)
    at /usr/local/lib/node_modules/jamjs/lib/tree.js:134:32
    at /usr/local/lib/node_modules/jamjs/lib/tree.js:177:20
    at /usr/local/lib/node_modules/jamjs/lib/repository.js:445:9
    at /usr/local/lib/node_modules/jamjs/node_modules/async/lib/async.js:94:25
    at /usr/local/lib/node_modules/jamjs/lib/repository.js:441:13
    at /usr/local/lib/node_modules/jamjs/lib/repository.js:203:9
    at IncomingMessage. (/usr/local/lib/node_modules/jamjs/lib/couchdb.js:248:25)
Failed

In the github repository, the structure looks like:

demo_jam
    > jam
        > demojam
            main.js
            package.json
    demojam.tar.gz

Where demojam.tar.gz is a jam packed version of the demojam folder within it. Further, demojam > package.json looks like this:

{
    "name": "demojam",
    "version": "1.0.0",
    "description": "It's a demo of Jam",
    "homepage": "https://github.[company].net/[username]/demo_jam",
    "main": "main.js"
}

I presume having both the tar and the directory (demojam with package.json and main.js) is one too many approaches. But either way, should this work?

jam uses wrong _session url when repository has a prefix

This happens when you are trying to use an internal couchdb database for jam packages.

If the url to your repository is this:

http://localhost/couchdb/jam_packages

jam publish will try to start a session at http://localhost/_session rather than http://localhost/couchdb/_session.

Make .jamrc location more flexible

It would be nice if the .jamrc file could be put inside your project directory or your home directory.

Maybe when making a jam call it should look into the current directory for the .jamrc file and if not found recursively look into the parent directories until the file is found or defaults used.

This would be similar to how grunt.js works for finding it's grunt config files.

Honor `baseUrl`

Most projects do not have their webroot as their project root. While you can use jam install -d path/to/dir to install packages to an arbitrary directory, you can't actually make require.js load them from the right place, as jam does not have an option to set baseUrl when writing the location field in jam.json. I'd suggest adding another flag to jam install to set this option, probably -b / --base-url.

http://requirejs.org/docs/api.html#config-baseUrl

As an example, let's say you run:

jam install --package-dir www/js/jam jquery

You'll get a www/js/jam/require.config.js that has:

var jam = {
    "packages": [
        {
            "name": "jquery",
            "location": "jam/jquery",
            "main": "jquery.js"
        }
    ],
    "version": "0.1.11",
    "shim": {}
};

This is wrong in several ways.

First off, I want location to say js/jam/jquery, but I don't have the option to do this (hence this ticket).

But secondly, this is not a sane default. When I use the default package dir, the location field becomes jam/jquery. This implies location is composed of $PKG_DIR/$MODULE_ID, or in my case, www/js/jam/jquery. That would at least be consistent.

jamjs.org Needs A Password Reset Page

Not that I'm claiming to be so stupid as to have signed up and promptly lost my password, ahem, but I have somehow noticed that http://jamjs.org/packages does not have a password reset page. As many otherwise competent and charming users might someday forget their passwords, it would probably be wise to create a means to resolve this problem.

Signed up with invalid email

An honest mistake, however i was able to register.

In the email field of the signup form i entered my handle (thanpolas) and it signed me up...

Publishing to private npm registry returns "no_db_file" error

I've finally managed to install a local version of npm registry and tried pushing a jam package to it, but I'm getting the no_db_file error. I will dig into jam's code, but I thought you might have some quick pointers.

jam publish
Please provide credentials for: http://localhost:5984/repository
Username: karolis
Password: 
creating /Users/karolis/.jam/cache/helloworld/0.0.1/helloworld-0.0.1.tar.gz
extracting /Users/karolis/.jam/cache/helloworld/0.0.1/helloworld-0.0.1.tar.gz
Error: not_found
no_db_file
    at IncomingMessage.CouchDB.client (/usr/local/lib/node_modules/jamjs/lib/couchdb.js:242:35)
    at IncomingMessage.EventEmitter.emit (events.js:115:20)
    at IncomingMessage._emitEnd (http.js:366:10)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
    at Socket.socketOnData [as ondata] (http.js:1356:20)
    at TCP.onread (net.js:410:27)
Failed

Recursive package removal

Should be able to recursively remove a package and all it's dependencies (if not in use by other packages). This is essentially just a "jam remove" followed by a "jam clean", but make it a command-line option. Eg, "jam remove -R backbone"

jam link in empty directory fails

When no other jam modules have been installed (/jam/... doesn't exist yet), we get the following error.

Error: ENOENT, symlink '/Users/visser/Development/spine'

After installing something, (jam install jquery; jam remove jquery) it will work!

Customized search URL returns error

  1. Set a repository with customized URL
  2. Run search command jam search jqu

TypeError: Parameter 'url' must be a string, not object appears.

Full trace:

Error: TypeError: Parameter 'url' must be a string, not object
    at urlParse (url.js:96:11)
    at Object.exports.noAuthURL (/home/s/nodejs/jam/lib/utils.js:183:17)
    at exports.searchRepositories (/home/s/nodejs/jam/lib/commands/search.js:58:48)
    at Request.exports.search [as _callback] (/home/s/nodejs/jam/lib/repository.js:595:16)
    at Request.init.self.callback (/home/s/nodejs/jam/node_modules/request/main.js:119:22)
    at Request.EventEmitter.emit (events.js:91:17)
    at Request.<anonymous> (/home/s/nodejs/jam/node_modules/request/main.js:521:16)
    at Request.EventEmitter.emit (events.js:88:17)
    at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/home/s/nodejs/jam/node_modules/request/main.js:483:14)
    at IncomingMessage.EventEmitter.emit (events.js:115:20)

Changing utils.js (line 183) to something like

if ( typeof url === 'string' ) {
    var parts = urlParse(url);
} else {
    var parts = urlParse( url.url );
};

helps, but I'm not sure if this the only place where the error might appear.

Docs Incorrect for package.json Main Override

The docs say that the key jam.main overrides main in package.json when present. This is false (and ambiguous).

I tried the following:

  • "jam.main": "index-jam.js" -- This is what the docs say, literally...
  • "jam": { "main": "index-jam.js" } -- I figured maybe the docs were ambiguous, and implied a nested object...
  • "jamMain": "index-jam.js" -- Still unsuccessful, I searched issues and found #11 ...
  • "browser": { "main": "index-jam.js" } -- So I then looked for that line in the current source, and, yeah, it works. But jeez, that's totally different and unrelated to what the docs say :P

Fix custom install paths

Currently installing to a directory other than "jam" causes lookup errors due the require.js config options.

working with Express(node.js)

I am trying to setup with Express Framework. ( http://expressjs.com/ ). I have pre-setup my static assets folder at Root/public/ ...
When I am using jam install, it creates a folder of jam under the Root.

The problem here is my Express server can only serve the static content from Root/public folder, so my html file could not reach require.js located at Root/jam/require.js, because it is located out of the static assets folder.

Is there a way that I could set jam install location instead of default at the Root level? I cannot find it from the doc. Help please,

Thank you very much.

Add shim support to package.json

Example:

"shim": {
    deps: ['underscore', 'jquery'],
    exports: 'Backbone'
}

This just needs to get carried through to jam/require.config.js with the appropiate package name.

Sample package.json is wrong

The sample in http://jamjs.org/docs#Package_json isn't valid json because the colon has been placed the wrong side of the speach marks:

{
  "name": "example",
  "version": "0.0.1",
  "description:" "An example Jam package",
  "dependencies": {
    "jquery": ">1.4.2",
    "underscore": ">1.3.1"
  },
}

Should Be:

{
  "name": "example",
  "version": "0.0.1",
  "description": "An example Jam package",
  "dependencies": {
    "jquery": ">1.4.2",
    "underscore": ">1.3.1"
  },
}

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.