Code Monkey home page Code Monkey logo

Comments (15)

liqupan avatar liqupan commented on August 23, 2024 1

@theprimone
如果我想不修改直接publish到私有服务器上,不修改包名,没有修改任何地方

npm run pub

还是会出现这些错误
C:\workspace\ant-design\node_modules\async-done\index.js:18
throw err;
^

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
uid: 11,
name: '',
branch: false,
error: 1,
duration: [ 1, 936748000 ],
time: 1622450060616
})
at Gulp.emit (events.js:304:17)
at Gulp.EventEmitter.emit (domain.js:467:12)
at Object.error (C:\workspace\ant-design\node_modules\undertaker\lib\helpers\createExtensions.js:61:10)
at handler (C:\workspace\ant-design\node_modules\now-and-later\lib\mapSeries.js:47:14)
at f (C:\workspace\ant-design\node_modules\once\once.js:25:25)
at f (C:\workspace\ant-design\node_modules\once\once.js:25:25)
at tryCatch (C:\workspace\ant-design\node_modules\async-done\index.js:24:15)
at done (C:\workspace\ant-design\node_modules\async-done\index.js:40:12)
at C:\workspace\ant-design\node_modules@ant-design\tools\lib\gulpfile.js:378:9
at ChildProcess. (C:\workspace\ant-design\node_modules@ant-design\tools\lib\runCmd.js:23:7)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:529:15)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
at Process.callbackTrampoline (internal/async_hooks.js:131:14) {
code: 'ERR_UNHANDLED_ERROR',
context: {
uid: 11,
name: '',
branch: false,
error: 1,
duration: [ 1, 936748000 ],
time: 1622450060616
}
}

from antd-tools.

ihavecoke avatar ihavecoke commented on August 23, 2024 1

@theprimone 在 antd 源代码中找到 webpack.config.js 文件修改processWebpackThemeConfig以下代码即可正常编译
image

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

重新打包发布了 antd-tools,把 antd 关键词全部替换成自定义的包名,好像可用了。

另外,需要重新打包的 antd 中安装依赖时使用 yarn 好像有些问题,删除 node_modules 使用 npm i 之后就没问题了。

from antd-tools.

liqupan avatar liqupan commented on August 23, 2024

重新打包发布了 antd-tools,把 antd 关键词全部替换成自定义的包名,好像可用了。

另外,需要重新打包的 antd 中安装依赖时使用 yarn 好像有些问题,删除 node_modules 使用 npm i 之后就没问题了。

请问在antd-tools中替换了哪些antd关键字,修改了ant-desgin中了哪些文件?

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

展开举例说明一下,以下假设是将 antd 打包成 beed。

antd-tools => beed-tools

  • 全局搜索 antd 替换成 beed,存在一些关联的根据 antd 字段拼成的变量也一起改一下;
  • 然后把 antd-tools package.json 中的 name 改成 beed-tools,bin 中对应的脚本定义以及关联的文件重命名一下
  • npm run pub 发布 beed-tools

antd => beed

  • antd 所在项目中的 package.json 中的 name 改为 beed,相关的 antd-tools 命令替换 beed-tools
  • 全局搜索 antd 改成 beed
  • eslintrc.js 中添加如下字段 overrides.parserOptions.project: './tsconfig.json' 保证项目内 eslint 正常解析 beed
  • 清空 CHANGLOG.*.md 写上自己的版本发布信息,日期必填
  • npm run pub 发布 beed

以上应该差不多完成改造了,可能会有一些报错信息,根据提示修改就行了,当前我暂时禁用了 test-all.sh 中 test 相关脚本。至于如果使用私有镜像仓库,beed-tools 新增 .npmrc 配置 registry=https://your/npm/registry/ 即可。另外由于 beed 使用了 beed-tools 发布,需要修改 package.json 中的 publishConfig.registry 解决。

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

另外,注意还有一些名称中存在 antd 的包那就不要改了,除非你还想重新发布一个。

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

这两个包也得定制一下。。。

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

@liqupan 你是怎么安装项目依赖的?

from antd-tools.

liqupan avatar liqupan commented on August 23, 2024

@theprimone
通过yarn,如果npm会出现错误
λ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! dev react@"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from @ant-design/[email protected]
npm ERR! node_modules/@ant-design/hitu
npm ERR! dev @ant-design/hitu@"^0.0.0-alpha.13" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\54460\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\54460\AppData\Local\npm-cache_logs\2021-06-01T01_49_39_079Z-debug.log

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

那就很奇怪了,我刚才使用通过 yarn 安装的,没什么问题的 😂

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

再补充:

  • antd-theme-generator => beed-theme-generator
  • beed 中 components 中的组件样式需要调整,主要是将 ant => bee

from antd-tools.

liqupan avatar liqupan commented on August 23, 2024

最终解决方案是:没有修改antd名称,最终publish到了私服里面。

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

最终解决方案是:没有修改antd名称,最终publish到了私服里面。

还是啥都不用干呗,不过你这个需求有点离谱啊 😂

from antd-tools.

yunsii avatar yunsii commented on August 23, 2024

@theprimone 在 antd 源代码中找到 webpack.config.js 文件修改processWebpackThemeConfig以下代码即可正常编译 image

这看起来只是处理主题 less 文件而已啊

from antd-tools.

zechau avatar zechau commented on August 23, 2024

@theprimone 在 antd 源代码中找到 webpack.config.js 文件修改processWebpackThemeConfig以下代码即可正常编译 image

It works for me =_=v

from antd-tools.

Related Issues (20)

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.