Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.

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

Open
thanpolas opened this issue Jul 12, 2012 · 3 comments
Open

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

thanpolas opened this issue Jul 12, 2012 · 3 comments

Comments

@thanpolas
Copy link

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

@benatkin
Copy link

How about adding this to your npm package:

{
  "scripts": {
    "publish-jam": "cp package.json package.npm.json; cp package.jam.json package.json; jam publish; mv package.npm.json package.json"
  }
}

Then you could run npm run-script publish-jam.


That wouldn't work for installing from git, though. On to another idea:

jam could add an overrides option or somesuch, so you could do:

{
  "jam": {
    "overrides": {
      "name": "hello"
    }
  }
}

Your package.jam.json idea isn't a bad one, though.

@caolan
Copy link
Owner

caolan commented Sep 10, 2012

Currently a number of properties have been namespaced using the 'jam' property, perhaps we could let any value inside 'jam' in package.json to override the values from the top level (including name, version, etc) ?

@benatkin
Copy link

It sounds like a good idea to me. It's best to avoid naming conflicts between the top-level and /jam anyway. I like it better without that extra level of nesting. It's also a lot like browserify.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants