Skip to content

Commit 5c4b511

Browse files
committed
Initial commit of packaging
0 parents  commit 5c4b511

9 files changed

+124
-0
lines changed

.babelrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"modules": "umd",
3+
"sourceMaps": true,
4+
"compact": true,
5+
"comments": false,
6+
"loose": "all",
7+
"jsxPragma": "h"
8+
}

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.md
2+
preact-router.js
3+
preact-router.js.map

.eslintrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"parser": "babel-eslint",
3+
"ignore": ["*.md"]
4+
}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/dist
2+
/node_modules
3+
/npm-debug.log
4+
.DS_Store

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.eslintrc

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
language: node_js
2+
node_js:
3+
- "node"

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Jason Miller
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# preact-router
2+
3+
[![NPM](http://img.shields.io/npm/v/preact-router.svg)](https://www.npmjs.com/package/preact-router)
4+
[![travis-ci](https://travis-ci.org/developit/preact-router.svg)](https://travis-ci.org/developit/preact-router)
5+
6+
Connect your [Preact] components up to that address bar.
7+
8+
9+
---
10+
11+
12+
### Usage Example
13+
14+
```js
15+
import Router from 'preact-router';
16+
import { h } from 'preact';
17+
/** @jsx h */
18+
19+
const Main = () => (
20+
<Router>
21+
<Home path="/" />
22+
<About path="/about" />
23+
<Search path="/search/:query" />
24+
</Router>
25+
);
26+
27+
render(<Main />, document.body);
28+
```
29+
30+
31+
---
32+
33+
34+
### License
35+
36+
[MIT]
37+
38+
39+
[Preact]: https://github.com/developit/preact
40+
[MIT]: http://choosealicense.com/licenses/mit/

package.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "preact-router",
3+
"version": "0.1.0",
4+
"description": "Connect your components up to that address bar.",
5+
"main": "dist/preact-router.js",
6+
"scripts": {
7+
"build": "babel -f $npm_package_main -s -o $npm_package_main < src/index.js",
8+
"prebuild": "mkdirp dist",
9+
"test": "eslint {src,test} && mocha --compilers js:babel/register test/**/*.js",
10+
"prepublish": "npm run build",
11+
"release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
12+
},
13+
"keywords": [
14+
"preact",
15+
"router"
16+
],
17+
"author": "Jason Miller <[email protected]>",
18+
"license": "MIT",
19+
"repository": {
20+
"type": "git",
21+
"url": "https://github.com/developit/preact-router.git"
22+
},
23+
"bugs": {
24+
"url": "https://github.com/developit/preact-router/issues"
25+
},
26+
"homepage": "https://github.com/developit/preact-router",
27+
"peerDependencies": {
28+
"preact": "^1.5.0 || ^2.1.0"
29+
},
30+
"devDependencies": {
31+
"babel": "^5.8.23",
32+
"babel-eslint": "^4.1.3",
33+
"chai": "^3.3.0",
34+
"eslint": "^1.7.1",
35+
"mkdirp": "^0.5.1",
36+
"mocha": "^2.3.3",
37+
"sinon": "^1.17.1",
38+
"sinon-chai": "^2.8.0"
39+
}
40+
}

0 commit comments

Comments
 (0)