GithubHelp home page GithubHelp logo

antd-tools's Introduction

@ant-design/tools 🔧🔧🔧

npm package NPM downloads Travis

Tools for Ant Design of React: https://github.com/ant-design/ant-design

antd-tools run dist
antd-tools run compile
antd-tools run clean
antd-tools run pub
antd-tools run guard
antd-tools run deps-lint
antd-tools run sort-api-table
antd-tools run api-collection

antd-tools's People

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  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

antd-tools's Issues

关于打包有几个问题想请教一下

第一个: build UMD时 为什么在 webpack配置里面去增加babel-plugin-import 不太明白?
第二个: ts编译之后已经输出cjs es代码(可以直接运行)了 为什么还需要babel转一下 ?

antd-tools run compile warning

Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.

Use babel-preset-env

deprecate babel-preset-es2015@^6.18.0 We're super ????  excited that you're trying to use ES2015 syntax, but instead of continuing yearly presets ???? , we recommend using babel-preset-env: npm install babel-preset-env. preset-env without options will compile ES2015+ down to ES5. And by targeting specific browsers, Babel can do less work and you can ship native ES2015+ to users ???? ! Also, we are in the process of releasing v7, so give http://babeljs.io/blog/2017/09/12/planning-for-7.0 a read and test it! Thanks so much for using Babel ???? , please give us a follow @babeljs for updates, join slack.babeljs.io for discussion and help support at opencollective.com/babel

antd-tools run update-self error

antd-tools run update-self

会运行:

tnpm update antd-tools

tnpm update xxx 的现在的逻辑是,删除 node_modules 下所有模块并安装 antd-tools。会导致其他模块丢失。

@fengmk2

npm test warning

████ts-jest[main] (WARN) Replace any occurrences of "ts-jest/dist/preprocessor.js" or  "<rootDir>/node_modules/ts-jest/preprocessor.js" in the 'transform' section of your Jest config with just "ts-jest".
ts-jest[main] (WARN) Replace any occurrences of "ts-jest/dist/preprocessor.js" or  "<rootDir>/node_modules/ts-jest/preprocessor.js" in the 'transform' section of your Jest config with just "ts-jest".
ts-jest[main] (WARN) Replace any occurrences of "ts-jest/dist/preprocessor.js" or  "<rootDir>/node_modules/ts-jest/preprocessor.js" in the 'transform
git clone http://github.com/ant-design/ant-design
cd ant-design
npm install
npm test

warning when publish antd

🌈  [email protected] git:❨master❩ npm run pub

> [email protected] pub /Users/afc163/Projects/ant-design
> antd-tools run pub

antd-tools run pub
[Parallel] Compile to es...
[Parallel] Compile to js...
[Compile] Finalization...
Wrote version into lib/version/index.js
Wrote version into lib/version/index.d.ts

✔ 🚚  Ant Design Tools
  Compiled successfully in 47.76s

(node:97320) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
    at emitMakeCallbackDeprecation (domain.js:106:13)
    at process.topLevelDomainCallback (domain.js:117:5)
[email protected] (/Users/afc163/.nvm/versions/node/v10.12.0/lib/node_modules/@alipay/afx/node_modules/[email protected]@tnpm/bin/tnpm.js)
[email protected] (/Users/afc163/.nvm/versions/node/v10.12.0/lib/node_modules/@alipay/afx/node_modules/[email protected]@npm/lib/npm.js)
[email protected] (/Users/afc163/.nvm/versions/node/v10.12.0/bin/node)
[email protected] (/Users/afc163/.nvm/versions/node/v10.12.0/lib/node_modules/@alipay/afx/node_modules/[email protected]@npminstall/lib/index.js)
prefix=/Users/afc163/.nvm/versions/node/v10.12.0 (load prefix from: $ npm config get prefix)
darwin x64 18.2.0 
registry=https://registry.npm.alibaba-inc.com

Error locating tsconfig.json

I am creating a component library following the same structure as the Ant Design library and want to use antd-tools in the same way as part of my build process. However, when I execute "npm run compile", I get the following error:

Error: Cannot find module 'C:\projects\component-library\node_modules\C:\projects\component-library\tsconfig.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at Module.require (C:\Source\cvet\evolution-ui-components\node_modules\antd-tools\lib\utils\projectHelper.js:32:25)
    at require (internal/modules/cjs/helpers.js:22:18)
    at module.exports (C:\Source\cvet\evolution-ui-components\node_modules\antd-tools\lib\getTSCommonConfig.js:10:10)
    at Object.<anonymous> (C:\Source\cvet\evolution-ui-components\node_modules\antd-tools\lib\gulpfile.js:28:48)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

The path 'C:\projects\component-library\tsconfig.json' is correct. Any idea what I need to do so the require statement looks for the file in the correct location?

I've forked Ant Design and the same statement works fine and I do not see what is different in our configuration.

replaceLib是否有存在必要?

看源代码,antd-tools run compile 的时候只是针对带有'lib'的路径的模块进行node-modules的es路径替换,很多不带lib的模块路径比如import Animate from 'rc-animate';实际上还是以commonjs方式在es代码中引入的。。。然后antd-tools run dist 利用webpack 还是能打包出文件。那这样做的意义是什么,

请问如何一起打包antd和antd-mobile 两个样式文件进css?

请问如何一起打包antd和antd-mobile 两个样式文件进css?
这个是https://github.com/ant-design/antd-init/tree/master/boilerplates/MobileDemo

// Learn more on how to config.
// - https://github.com/ant-tool/atool-build#配置扩展

const webpack = require('atool-build/lib/webpack');

module.exports = function (webpackConfig) {
  webpackConfig.babel.plugins.push('transform-runtime');
  webpackConfig.babel.plugins.push(['antd', {
    style: 'css',  // if true, use less
    libraryName: 'antd-mobile',
  }]);
  return webpackConfig;
};

doc: antd-tools 文档说明

! 这并不是一个官方文档,而是我自己摸索出来的,以及自己的一些使用经验。 仅供参考。

我使用antd-tools的功能主要有一下几点

  1. 预设tslint检查,以及tslint修复
  2. 预设打包编译 antd-tools run compile以及 antd-tools run dist
  3. .... 其他的我还没用过,暂时不太清楚

关于antd-tools

antd-tools 是一些命令行工具,目前用于服务 Ant Design React 。 以下有一些简单的用法。

命令 描述
antd-tools run dist 将代码编译为单个dist文件,目录在dist
antd-tools run compile 将代码编译为 es ,以及lib目录
antd-tools run clean 清理为干净的代码,移除 dist目录,以及es 和lib目录
antd-tools run pub 待补充,没用过
antd-tools run guard 待补充,没用过
antd-tools run ts-lint 检查ts-lint执行代码检查
antd-tools run ts-lint-fix 修复ts-lint检查出来的问题
antd-tools run deps-lint 待补充,没用过
antd-tools run sort-api-table 待补充,没用过
antd-tools run api-collection 待补充,没用过

如果要执行 antd-tools run compile 以及antd-tools run dist 则需要webpack的支持

webpack的例子

https://github.com/Kotomi-Team/kotomi-ui/blob/master/webpack.config.js

Code refactoring

antd-tools 可以去掉 atool-build 依赖,因为只有 dist 命令用了这个。改用依赖 rc-tools ,应该更简单。同时可以对 antd-tools / rc-tools 做相应重构。

不考虑兼容下window操作系统吗?

if (file.path.match(/\/style\/index\.less$/) || file.path.match(/\/style\/v2-compatible-reset\.less$/)) {
类似这种路径匹配的,在window系统下会匹配失败,最终导致没有编译less文件,这种使用场景不考虑吗?

Support source-map?

Hi, I just want to know the missing of source-map is intended or not?

If it is not intended, I can work on a PR to add --sourceMap in the tool.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

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.