rc-server
server for react-component
Last updated 5 years ago by yiminghe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rc-server 
SYNC missed versions from official npm registry.

rc-server

development server for react component

NPM version gemnasium deps node version npm download

Feature

  • support jsx
  • support autoprefixer
  • support mocha-phantomjs
  • support travis
  • support coveralls.io
  • support react js module render as html
  • support load commonjs file into browser and run

Usage

file structure

- .travis.yml
- examples
 - index.html
 - index.js
- lib
 - Component.js
- index.js
- tests
  - index-spec.js
- package.json

Suggest using https://github.com/react-component/generator-rc

index.js

/** @jsx React.DOM */
var Component = require('./lib/Component');
module.exports = <Component />

Component.js

/** @jsx React.DOM */
var React = require('react');
var Component = React.createClass({
    // TODO
    render: function(){
        return <div></div>;
    };
});
module.exports = Component;

.travis.yml

language: node_js
node_js:
- 0.11
before_script:
- npm start &
- npm install mocha-phantomjs -g
- phantomjs --version
script:
- npm test
- npm run browser-test
- npm run browser-test-cover

package.json

{
    "devDependencies": {
        "rc-server": "^1.0.0"
    },
    "config": {
        "port": 8001
    },
    "scripts": {
        "start": "node --harmony node_modules/.bin/rc-server",
        "browser-test": "mocha-phantomjs http://localhost:$npm_package_config_port/tests/runner.html",
        "browser-test-cover": "mocha-phantomjs -R node_modules/rc-server/node_modules/node-jscover/lib/reporters/mocha/console http://localhost:$npm_package_config_port/tests/runner.html?coverage"

    }
}

index-spec.js

var expect = require('expect.js');
var React = require('react');
var Component = require('../');

describe('it', function(){
    it('works', function(){
        var component = (<Component/><a></a></Component>);
        expect(component).to.be(component);
    });
});

index.html

placeholder

remove backslash!

Suggest using https://github.com/react-component/generator-rc

start server

npm install
npm start

Current Tags

  • 3.3.5                                ...           latest (5 years ago)

67 Versions

  • 3.3.5                                ...           5 years ago
  • 3.3.4                                ...           5 years ago
  • 3.3.3                                ...           5 years ago
  • 3.3.2                                ...           5 years ago
  • 3.3.1                                ...           5 years ago
  • 3.3.0                                ...           5 years ago
  • 3.2.5                                ...           5 years ago
  • 3.2.4                                ...           5 years ago
  • 3.2.3                                ...           5 years ago
  • 3.2.2                                ...           5 years ago
  • 3.2.1                                ...           5 years ago
  • 3.2.0                                ...           5 years ago
  • 3.1.2                                ...           5 years ago
  • 3.1.1                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.7                                ...           5 years ago
  • 3.0.6                                ...           5 years ago
  • 3.0.5                                ...           5 years ago
  • 3.0.4                                ...           5 years ago
  • 3.0.3                                ...           5 years ago
  • 3.0.2                                ...           5 years ago
  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 2.1.8                                ...           5 years ago
  • 2.1.7                                ...           5 years ago
  • 2.1.6                                ...           5 years ago
  • 2.1.5                                ...           5 years ago
  • 2.1.4                                ...           5 years ago
  • 2.1.3                                ...           5 years ago
  • 2.1.2                                ...           6 years ago
  • 2.1.1                                ...           6 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.4                                ...           6 years ago
  • 2.0.3                                ...           6 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.5.10                                ...           6 years ago
  • 1.5.9                                ...           6 years ago
  • 1.5.8                                ...           6 years ago
  • 1.5.7                                ...           6 years ago
  • 1.5.6                                ...           6 years ago
  • 1.5.5                                ...           6 years ago
  • 1.5.4                                ...           6 years ago
  • 1.5.3                                ...           6 years ago
  • 1.5.2                                ...           6 years ago
  • 1.5.1                                ...           6 years ago
  • 1.5.0                                ...           6 years ago
  • 1.4.4                                ...           6 years ago
  • 1.4.3                                ...           6 years ago
  • 1.4.2                                ...           6 years ago
  • 1.4.1                                ...           6 years ago
  • 1.4.0                                ...           6 years ago
  • 1.3.4                                ...           6 years ago
  • 1.3.3                                ...           6 years ago
  • 1.3.2                                ...           6 years ago
  • 1.3.1                                ...           6 years ago
  • 1.3.0                                ...           6 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.3                                ...           6 years ago
  • 1.1.2                                ...           6 years ago
  • 1.1.1                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 2
Last Month 4
Dependencies (26)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |