Skip to content

Commit

Permalink
make browserify compatible
Browse files Browse the repository at this point in the history
add browser mapping for type to type-component
  • Loading branch information
defunctzombie committed Jan 15, 2014
1 parent 0966ccd commit acfb79a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 1 addition & 7 deletions index.js
Expand Up @@ -3,13 +3,7 @@
* Module dependencies.
*/

var type;

try {
type = require('type');
} catch(e){
type = require('type-component');
}
var type = require('type');

/**
* Module exports.
Expand Down
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -8,6 +8,9 @@
"mocha": "*",
"expect.js": "*"
},
"browser": {
"type": "type-component"
},
"component": {
"scripts": {
"clone/index.js": "index.js"
Expand Down

9 comments on commit acfb79a

@jonathanong
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this break for node?

@defunctzombie
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigh yes.. jesus christ I hate component

@jonathanong
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol and i hate npm. it would be easier just to republish as component-type and require('component-type'), etc.

@defunctzombie
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't publish it, just use github urls to require it then. NPM is fine. No one is making you use the registry but having all these duplicates of all the same shit is really annoying. And the naming is out of control.

@defunctzombie
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes me not want to fix components because I can easier fork them and just use my forks that actually work. Many of the component repos with package.json files are totally useless and broken because their deps are not properly packaged. People should either package it or not but half ass packaging is terrible.

@jonathanong
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're like the only one i know who uses these components but not component lol. that's why. now you can properly package them since you're a team member :)

@defunctzombie
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno why anyone would use component for js honestly. Browserify packages the js much better and the deps aren't all *. Anyhow.. rant over.. I am trying :)

@jonathanong
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not just for js though. it's for css, fonts, images, etc. it'll package js better and do semver in v1 :) component is a hack right now

@defunctzombie
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All that other crap can be done in the package.json file if you want. I package css and html with my components just fine. The reality is that those other items are often less used and really so opinionated that people are just as likely to copy the files.

Please sign in to comment.