Giter VIP home page Giter VIP logo

father's People

Contributors

2239559319 avatar 3lang3 avatar afc163 avatar carrotzpc avatar chenshuai2144 avatar cl1107 avatar cnyballk avatar dependabot[bot] avatar doxiaodong avatar focus7eleven avatar fz6m avatar hejin737 avatar jinbao1001 avatar kuitos avatar leftstick avatar miracles1919 avatar nanianlisao avatar peachscript avatar rdmclin2 avatar sorrycc avatar txp1035 avatar wangxingkang avatar xiaohuoni avatar xiefengnian avatar xierenyuan avatar ycjcl868 avatar zengyue avatar zhanba avatar zombiej avatar zzcan 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  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

father's Issues

father build watch error

1.执行 father build --watch 报错,同时watch两个项目文件夹,一个成功,一个报错。
直接build能成功。
如下图 :

QQ图片20190712114353

环境: windows 10 node v10.15.3

底层依赖包需要升级消除安装时报警告⚠️问题

安装 father 包,终端报警告⚠️nomnom 包已经废弃了。

npm WARN deprecated [email protected]: Package no longer supported. 
Contact [email protected] for more info.
npm WARN deprecated [email protected]: 🙌  Thanks for using Babel: 
we recommend using babel-preset-env now: please read babeljs.io/env to update!

我在 package-lock.json 中查找了包依赖关系

father => @storybook/cli 4.1.3 => jscodeshift 0.5.1 => nomnom
father => @storybook/cli 4.1.3 => jscodeshift 0.5.1 => babel-preset-es2015

@storybook/cli 最新版本为 5.2.1,内部将 jscodeshift 升级到了 0.6.3,这个版本已经移除了 nomnom 包的使用,也将 babel-preset-es2015 替换成了 babel-preset-env

希望 father 能升级下 @storybook/cli 版本号,消除安装报警告问题。

@sorrycc

期望在基于lerna时能排除某个package

我的/packages目录下有组件库也有web网站,当我在项目根目录 father build时会报错,提示web网站这个package木有正确配置father

期望不要处理那些木有包含.fatherrc.jspackage

我不清楚是否已有该功能;

组件中引入的less文件在father build时无法被识别

假设我有一个组件Test,我要在这个组件里面引入一个样式,写成下面这种写法:

import styles from './index.module.less';

export default function Test() {
  return (
    <div className={styles.title}>test</div>
  );
}

index.module.less的内容是:

.title {
  color: red;
}

我的.fatherrc.js的内容是:

export default {
  entry: 'src/index.tsx',
  esm: {
    type: 'babel',
  },
  cjs: 'babel',
  cssModules: true,
  extractCSS: true,
  lessInBabelMode: true,
  extraBabelPlugins: [
    ['babel-plugin-import', {
      libraryName: 'antd',
      style: true,
    }]
  ],
};

执行father build的时候会报错:

Cannot find module './index.module.less'.

请问会是什么问题引起的?我应该怎么改呢?

Typescript father build --watch fail

执行father build --watch失败

Error: ENOENT: no such file or directory, rename '/private/var/folders/bz/pksgsq8j6zj0x7w5lxknc3700000gn/T/.rollup_plugin_typescript2_cache/rpt2_8d5c6c4b586394ea612d61d4ced8d17302c715ee/code/cache_' -> '/private/var/folders/bz/pksgsq8j6zj0x7w5lxknc3700000gn/T/.rollup_plugin_typescript2_cache/rpt2_8d5c6c4b586394ea612d61d4ced8d17302c715ee/code/cache' 

father builld可以成功

[lerna + rollup场景] 向上查找tsconfig.json不生效

tsconfig: join(cwd, 'tsconfig.json'),

不应该设置tsconfig的初值,目前是给出tsconfig.json的默认路径,这样导致无法向上查找。

这里是typescript提供的findConfigFile的实现。

源码:

 export function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName = "tsconfig.json"): string | undefined {
        return forEachAncestorDirectory(searchPath, ancestor => {
            const fileName = combinePaths(ancestor, configName);
            return fileExists(fileName) ? fileName : undefined;
        });
    }

项目命名疑问

在 umi 看文档发现404,看提交记录才发现迁到这了。

提出来可以,bug和版本也比较容易维护。

就是不知道为什么要叫father= =,用umi-lib 这类的不是更好么

ts 编译报错

ℹ  info      [smr] Clean dist directory
ℹ  info      [smr] Build esm with undefined
✖  error     Error: failed to open 'undefined' 
    at parseTsConfig (/work/smr/node_modules/rollup-plugin-typescript2/src/parse-tsconfig.ts:17:9)
    at Object.options (/work/smr/node_modules/rollup-plugin-typescript2/src/index.ts:80:64)
    at applyOptionHook (/work/smr/node_modules/rollup/dist/rollup.js:17127:31)
    at Array.reduce (<anonymous>)
    at getInputOptions$1 (/work/smr/node_modules/rollup/dist/rollup.js:17145:41)
    at rollup (/work/smr/node_modules/rollup/dist/rollup.js:17189:30)
    at /work/smr/node_modules/father-build/lib/rollup.js:70:51
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/work/smr/node_modules/father-build/lib/rollup.js:26:103)
    at _next (/work/smr/node_modules/father-build/lib/rollup.js:28:194)

根目录的md文件被错误识别为mdx,然后报jsx语法错误

错误详情

./README.en.md
SyntaxError: unknown: Unterminated JSX contents (148:16)

  146 | <p>{`Pass in a deep copy of the rules, only to assist in comparison, use the props.form.patchRule method when you need to dynamically modify the rules.`}</p>
  147 | <p><inlineCode parentName="p">{`<validatejsRules>`}</inlineCode></p>
> 148 |     </MDXLayout>
      |                 ^
  149 |   )
  150 | };
  151 | MDXContent.isMDXComponent = true

目录大致如下
-| library  
    -| xxx.xx  
    -| README.md  
    -| README.en.md  

docz的menu属性无效

[email protected] 改为 [email protected] 后,在 .fatherrc.js 中配置 docz 的属性未达到官方文档呈现的效果。

  • 官方文档
Use this option to specify the order of your documents in the menu. You can pass a simple string or if you want to order a nested menu you can pass an object with the name of your document and the menu order of it.

// config
export default {
  menu: [
    'Getting Started',
    { name: 'Components', menu: ['Alert', 'Button'] }
  ]
}
  • 项目中配置
export default {
  doc: {
    menu: [
      '首页',
      '更新日志',
      {
        name: '组件',
        menu: [
          'LinkBtn',
        ]
      }
    ]
  },
}
  • 实际呈现效果
    image

minify无效?

版本: "2.15.1"
.fatherrc.js配置:

export default {
  cjs: 'babel',
  esm: { type: 'babel', importLibToEs: true, minify: true, },
  preCommit: {
    eslint: true,
    prettier: true,
  },
};

输出的es代码没有压缩。

storybook-generator webpack.config module not found error in windows

I worked with rc-tree which is using father package for creating storybook and i'v got this error when i ran npm start:

Cannot find module 'C:UsersHamedDocumentsProjects ree ERR! ode_modules atherlibdocstorybook-webpack'

rc-tree package.json:

"scripts": { "start": "cross-env NODE_ENV=development father doc dev --storybook", "build": "father doc build --storybook", "compile": "father build", "prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish", "lint": "eslint src/ examples/ --ext .tsx,.ts,.jsx,.js", "test": "father test", "now-build": "npm run build" },

there seems to be a problem in storybook generator :
module.exports = function(...args) {
return require('${join(__dirname, 'storybook-webpack')}')(...args);
};

and

const configJs = function loadStories() { require('${entryPath}'); }

that generate webpack.config in .storybook directory like this:
module.exports = function(...args) { return require('C:\Users\Hamed\Documents\Projects\tree\node_modules\father\lib\doc\storybook-webpack')(...args); };
and when this file runs i have got above error .

I think __dirname and path.join in windows return path with back slash "\" that must be replace with forward slash "/" to work properly with require. I have tested it and it works fine with str replace or slash package.

rollup umd not support commonjs module

image

Steps

$ yarn create umi --type=plugin

add code in ui/index.tsx

+ const a = require('./utils');

export default () => {
+   console.log('a', a);
}

create utils.ts file:

module.exports = {
  a: true,
}

npm run build && npm run start

will reproduction

cssModules配置会导致antd样式加载失败

重现的github地址:https://github.com/chj-damon/umi-father-issue-reproduce-demo.git

issue发生的环境:windows,macOS上表现正常

重现步骤:
clone项目之后,yarn install && yarn doc:dev
执行之后在打开的页面发现,windows下浏览器看到Antd的Button的样式没有加载,macOS下antd的button样式正常加载;
打开.fatherrc.js,将cssModules注释掉,然后再次运行yarn doc:dev,在打开的页面发现,windows和macOS的浏览器里面,antd的button的样式都正常加载。

所以我怀疑cssModules这个配置项会导致extraBabelPlugins引入的插件有bug

father watch 不监听css module

index.module.less变更时,开启watch模式,不会重新编译

场景:微前端开发,主项目采用father build --watch,子项目采用umi,并且npm link主项目,子项目追踪主项目dist目录变更时,自动执行编译

//子项目特殊配置
.umirc.ts dll exclude主项目

:question 打包时单独生成css/less文件

What happens?

项目是基于 antd 的二次开发,一个业务组件库,tsx 和样式(less)分离

配置文件

  entry: 'src/index.ts',
  cjs: 'babel',
  esm: 'babel',
  umd: {
    name: "xxx",
    globals: {
      react: 'React',
      antd: 'antd'
    },
    file:"index"
  },
  extractCSS: true,

打包后生成 dist lib es 三个目录

dist 目录下只有 js 和 .d.ts ,没有 less或者css文件,比如像andt的 antd.css antd.less

导致项目中想全局引入样式时,没有途径

已配置了

extractCSS: true,

但我猜测是不是还缺少了什么配置?

相关环境信息

father 版本:2.2.1
Node 版本:10.15.1
操作系统:win10

多chunks提示设置output.dir

动态导入组件时会引发这个问题
const Avatar = () => import('./avatar');
export default Avatar;

默认这样没有问题:export { default as Avatar } from './avatar';

修改getRollupConfig.js添加dir可以解决,后续会添加相关的自定义配置吗
image

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.