Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 143 lines (106 sloc) 4.758 kB
98a5bb9 @tj Initial commit
tj authored
1
2 # component
3
d06fab4 @tj docs
tj authored
4 Component package manager.
5
6 ## Installation
7
37b0511 @tj docs
tj authored
8 $ npm install -g component
d06fab4 @tj docs
tj authored
9
10 ## Installing packages
11
12 To install one or more packages, simply pass their github
13 repo names as arguments to `component install`. Dependencies
14 are resolved and the component contents are downloaded into
15 `./components` by default.
16
17 ```
18 $ component install component/tip
19
20 install : component/tip@master
21 dep : component/emitter@master
22 install : component/emitter@master
23 dep : component/jquery@master
24 install : component/jquery@master
25 fetch : component/tip:index.js
26 fetch : component/tip:tip.css
27 fetch : component/tip:tip.html
28 fetch : component/emitter:index.js
29 fetch : component/jquery:index.js
30 complete : component/emitter
31 complete : component/jquery
32 complete : component/tip
33 ```
34
35 ## Usage
36
37 Via `--help`:
38
39 ```
40 Usage: component <command> [options]
41
42 Options:
43
44 -h, --help output usage information
45 -V, --version output the version number
46
47 Commands:
48
49 install <name ...> install one or more components
50 search [query] search with the given query
51 info [prop] output json component information
52 ls list installed components
53 ```
98a5bb9 @tj Initial commit
tj authored
54
32f16ca @tj docs
tj authored
55 ## Features
56
57 - no registry required, uses github repositories
6b2b654 @tj docs
tj authored
58 - pretty fast (~2x faster than uncached npm at the time of comparison)
b33beb6 @tj docs
tj authored
59 - extensible sub-commands via `component-YOURCOMMAND` git-style
6b2b654 @tj docs
tj authored
60 - component skeleton creation command
32f16ca @tj docs
tj authored
61 - resolves dependencies
62
0724267 @tj docs
tj authored
63 ## Dependencies
64
65 By using GitHub as the registry, `component(1)` is automatically
66 available to you without further explicit knowledge or work
67 creating a registry account etc.
68
69 A nice side-effect of this namespaced world is that dependencies
70 are explicit and self-documenting. No longer do you need to query
71 the registry for a "repo" property that may not exist, it's simply
72 build in to the package name, for example ["visionmedia/page.js"](https://github.com/visionmedia/page.js) rather
efebc26 @tj docs
tj authored
73 than the unclear "page".
0724267 @tj docs
tj authored
74
7c0b0a2 @tj docs
tj authored
75 ## Creating a component
76
77 The `component-create(1)` command can create a component
78 project skeleton for you by filling out the prompts. Once
79 this repo is published to Github, you're all done!
80
81 ```
2811ddd @tj update docs
tj authored
82 name: popover
83 description: Popover UI component
7c0b0a2 @tj docs
tj authored
84 does this component have js? yes
85 does this component have css? yes
86 does this component have html? yes
87
2811ddd @tj update docs
tj authored
88 create : popover
89 create : popover/index.js
90 create : popover/template.html
91 create : popover/popover.css
92 create : popover/Makefile
93 create : popover/Readme.md
94 create : popover/.gitignore
95 create : popover/component.json
7c0b0a2 @tj docs
tj authored
96
97 ```
98
67002d6 @tj docs
tj authored
99 A `Makefile` is created for you in order to create a build of the component,
100 complete with installed dependencies simply execute `make`.
101
8947deb @tj docs
tj authored
102 ## Templates
103
104 Because `component(1)` has no notion of a "template", even simple HTML files
105 should be converted to a `require()`-able module. It is recommended that public
106 components shared within the community use regular HTML templates, and regular
107 CSS stylesheets to maximize contributions, however if you wish to use alternate
108 technologies just make sure to compile them before publishing them to Github.
109
110 ## Developing component(1) sub-commands
460e6fe @tj add some dev docs
tj authored
111
112 `component(1)` and sub-commands are structured much like `git(1)`,
113 in that sub-commands are simply separate executables. For example
114 `$ component info pkg` and `$ component-info pkg` are equivalent.
115
116 Because of this you'll likely want `PATH="./bin:$PATH"` in your
117 profile or session while developing component, otherwise `./bin/component`
118 will have a hard time finding the sub-commands.
119
98a5bb9 @tj Initial commit
tj authored
120 ## License
121
122 (The MIT License)
123
124 Copyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
125
126 Permission is hereby granted, free of charge, to any person obtaining
127 a copy of this software and associated documentation files (the
128 'Software'), to deal in the Software without restriction, including
129 without limitation the rights to use, copy, modify, merge, publish,
130 distribute, sublicense, and/or sell copies of the Software, and to
131 permit persons to whom the Software is furnished to do so, subject to
132 the following conditions:
133
134 The above copyright notice and this permission notice shall be
135 included in all copies or substantial portions of the Software.
136
137 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
138 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
139 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
140 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
141 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
142 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
143 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.