Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use the override the package.name with the jam.name if provided. #102

Merged
merged 1 commit into from

3 participants

Ryan Ramage Jon Sharratt Caolan McMahon
Ryan Ramage
Collaborator

This allows the jam package name to be different than the original
package name. Needed when converting packages over from other package
managers, and for packages with a "something.js" name.

For issue #98

Ryan Ramage ryanramage Use the override the package.name with the jam.name if provided.
This allows the jam package name to be different than the original
package name. Needed when converting packages over from other package
managers, and for packages with a "something.js" name.
6afa115
Jon Sharratt

Looks good, just wondered are you going to take a look at amending the validation (regex) to the "lib/settings.js" file / publish test so that packages with .js within the name are outputted as invalid when trying to publish them ?

Caolan McMahon caolan merged commit ed1a7cb into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 26, 2012
  1. Ryan Ramage

    Use the override the package.name with the jam.name if provided.

    ryanramage authored
    This allows the jam package name to be different than the original
    package name. Needed when converting packages over from other package
    managers, and for packages with a "something.js" name.
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 1 deletion.
  1. +3 −0  lib/project.js
  2. +5 −0 lib/settings.js
  3. +1 −1  package.json
3  lib/project.js
View
@@ -173,6 +173,9 @@ exports.updateRequireConfig = function (package_dir, baseurl, callback) {
if (main) {
val.main = main;
}
+ if (cfg.jam && cfg.jam.name) {
+ val.name = cfg.jam.name;
+ }
packages.push(val);
if (cfg.shim) {
shims[cfg.name] = cfg.shim;
5 lib/settings.js
View
@@ -11,6 +11,11 @@ exports.load = async.memoize(function (dir, callback) {
callback(err);
}
try {
+ // if there is a jam.name we must override the
+ // package name early.
+ if (settings.jam && settings.jam.name) {
+ settings.name = settings.jam.name;
+ }
exports.validate(settings, settings_file);
}
catch (e) {
2  package.json
View
@@ -1,6 +1,6 @@
{
"name": "jamjs",
- "version": "0.2.11",
+ "version": "0.2.12",
"description": "",
"maintainers": [
{"name": "Caolan McMahon", "web": "https://github.com/caolan"}
Something went wrong with that request. Please try again.