GithubHelp home page GithubHelp logo

rc-tools's Introduction

rc-tools

offline tools for react component

NPM version gemnasium deps node version npm download david-dm

Usage

$ rc-tools run lint: run lint by https://github.com/airbnb/javascript
$ rc-tools run pub: compile and npm publish
$ rc-tools run watch --out-dir=/xx: watch and compile to /xx, default to lib
$ rc-tools run build: build examples
$ rc-tools run gh-pages: push example to gh-pages
$ rc-tools run start: start dev server

package.json demo

({
  config: {
    entry:{}, // webpack entry for build dist umd
    port: 8000, // dev server port
    output:{}, // webpack output for build dist umd
  }
})

History

9.0.0

  • upgrade all deps
  • add test task

8.0.0

  • upgrade eslint to the latest version
  • introduce prettier

7.0.0

  • upgrade to webpack3

6.0.0

  • move test to rc-test

rc-tools's People

Contributors

benjycui avatar chenshuai2144 avatar jaredleechn avatar jljsj33 avatar just-boris avatar paranoidjk avatar silentcloud avatar simeg avatar thaddeusjiang avatar trxcllnt avatar yesmeck avatar yiminghe avatar zombiej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rc-tools's Issues

No way to change Webpack config

I wanted to use Enzyme with my rc-tools powered component, but it requires some modifications to the Webpack config so that it ignores some conditional requires. I couldn't see anyway to override the default Webpack settings though. Am I missing something?

require 的问题

require 出来的是对象 => { default: xxxx }, codepen 里需要用 window['xxx'].default,,导至全线崩盘,,能恢复不???不然又要改 react 的地址,又要搞这个,,有点烦。。。

npm run lint 报错的时候有奇怪的 log

/Users/afc163/Projects/time-picker/examples/value-and-defaultValue.js
  30:25  error  Must use destructuring state assignment        react/destructuring-assignment
  34:18  error  Must use destructuring state assignment        react/destructuring-assignment
  37:9   error  Missing an explicit type attribute for button  react/button-has-type

✖ 3 problems (3 errors, 0 warnings)

/Users/afc163/Projects/time-picker/node_modules/[email protected]@async-done/index.js:18
    throw err;
    ^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
    at Gulp.emit (events.js:171:17)
    at Gulp.EventEmitter.emit (domain.js:441:20)
    at Object.error (/Users/afc163/Projects/time-picker/node_modules/[email protected]@undertaker/lib/helpers/createExtensions.js:61:10)
    at handler (/Users/afc163/Projects/time-picker/node_modules/[email protected]@now-and-later/lib/mapSeries.js:43:14)
    at f (/Users/afc163/Projects/time-picker/node_modules/[email protected]@once/once.js:25:25)
    at f (/Users/afc163/Projects/time-picker/node_modules/[email protected]@once/once.js:25:25)
    at tryCatch (/Users/afc163/Projects/time-picker/node_modules/[email protected]@async-done/index.js:24:15)
    at done (/Users/afc163/Projects/time-picker/node_modules/[email protected]@async-done/index.js:40:12)
    at ChildProcess.runner.on.code (/Users/afc163/Projects/time-picker/node_modules/[email protected]@rc-tools/lib/util.js:11:7)
    at ChildProcess.emit (events.js:182:13)
    at ChildProcess.EventEmitter.emit (domain.js:459:23)
    at maybeClose (internal/child_process.js:970:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:257:5)

lint 通过后就消失了。

是否考虑提供一种可以配置babel参数的方法?

使用rc-slider组件的时候发现在ie9、ie10全挂了,原因是内部使用了继承的方式,需要修改一下babel的配置。
["transform-es2015-classes", {"loose": true}],

所以想说是否可以暴露一些配置项出来。或者可以内置支持?

error: rc-tools's react-native needs 0.39.0 but yours is 0.41.x

react-native-init 内置的 0.39 版本,不太灵活,目前不同版本的 RN,ios 和 android 只对应几个版本,改成下面的方案如何:

version  = pkg.version, 确定版本区间,解压
{
  "0.34~0.39": "http://xxx.tar",
  "0.39~0.41": "http://xxxx.tar",
  "0.42": "http://xxxx.tar"
}

@yiminghe

How to support hot reload ?

It seems rc-tools cannot support hot reload? Or is there someway to support hot reload when use rc-tools?

Error: Cannot find module '/usr/local/lib/package.json'

i run this command : sudo npm install -g rc-tools to install rc-tools cli

but it throw err like this;

> [email protected] install /usr/local/lib/node_modules/rc-tools/node_modules/fsevents
> node install

[fsevents] Success: "/usr/local/lib/node_modules/rc-tools/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] postinstall /usr/local/lib/node_modules/rc-tools/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> [email protected] postinstall /usr/local/lib/node_modules/rc-tools
> node lib/init.js

module.js:549
    throw err;
    ^

Error: Cannot find module '/usr/local/lib/package.json'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at init (/usr/local/lib/node_modules/rc-tools/lib/init.js:73:15)
    at Object.<anonymous> (/usr/local/lib/node_modules/rc-tools/lib/init.js:83:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

version info: see below

platform: macos 10.13.4
node: 8.11.1
npm: 5.6.0

lint 时报错 redundant dependency

🎯   [email protected] git:❨master❩ tnpm run lint

> [email protected] lint /Users/afc163/Projects/banner-anim
> rc-tools run lint


/Users/afc163/Projects/banner-anim/node_modules/orchestrator/index.js:153
            throw err;
            ^
redundant dependency in dependencies of package.json: style-utils

重现步骤

  1. git clone https://github.com/react-component/banner-anim && cd banner-anim
  2. npm install
  3. 删除 https://github.com/react-component/banner-anim/blob/8721afddcca319d2206b86fe80f91a3cb04ea3d1/src/BannerAnim.jsx#L11-L12 这两行没有实际作用的代码。
  4. npm run lint

lib/server/js2html.js代码是否有误?

rc-tools/lib/server/js2html.js

line - 16 ~ 18
if (fs.existsSync(path.join(cwd, 'examples/template.xtpl'))) { tplName = path.join(cwd, 'examples/template.xtpl'); }
当我想要自定义模板时,翻阅源码发现提供了这么一个方法。然后我在自己项目添加examples/template.xtpl文件后,报错:找不到文件 examples/template.xtpl.xtpl 。可见render时默认添加的后缀.xtpl。故这段代码是否存在问题,我认为应该改为:
if (fs.existsSync(path.join(cwd, 'examples/template.xtpl'))) { tplName = path.join(cwd, 'examples/template'); }

老板 umd 编译模式是不是不好使啊

rc-tools run dist 不好用啊
gulpfile.js 558行的压缩是不是不兼容webpack4

最近想编译成umd格式的,看RC组件都改成了fatherJs。但我的TS代码fatherJs编译也有问题

我该怎么办呢

support webpack output.umdNamedDefine for UMD bundles

Supporting webpack's output.umdNamedDefine option is helpful for developing libs with scoped package names. For example, our module name is @graphistry/client-api, but we would like the root's UMD exports to show up as window.GraphistryJS, instead of window['@graphistry/client-api']. Would support for customizing output in package.json work for your team, similar to support for entry?

feat: generate dist files

生成 dist/xxx.js 之类的文件,方便在 CodePen 和 JSFiddle 中引用,以重现问题。

rc-tools 可否暴露一些配置项给开发者

hi , rc-tools 是基于webpack 的吧。那是否可以暴露一些配置项给开发者,比如,我想自定义打包 rc-calendar , 然后再使用其他的库, 可能会有些资源复用的,比如React, classnames 我希望不打包进来,而是保持 require('react') ?

还有就是希望生成的文件,支持 umd ,应该怎么打包??

publish lost css files ?

  1. there has a css file in my source folder

1

2.but it losted in the published folder

2

How to solve it ? thanks

@decorators in examples are not supported

examples/simple.js:

@oneDecorator()
class App extends React.Component {
  render() {
    return <button> click me </button>
  }
}
ERROR in ./examples/simple.js
Module build failed: SyntaxError: Decorators are not officially supported yet in 6.x pending a proposal update.
However, if you need to use them you can install the legacy decorators transform with:

npm install babel-plugin-transform-decorators-legacy --save-dev

and add the following line to your .babelrc file:

{
  "plugins": ["transform-decorators-legacy"]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.