New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix ${theme}-theme.js file order #23243
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 93beeba:
|
Codecov Report
@@ Coverage Diff @@
## master #23243 +/- ##
=======================================
Coverage 98.35% 98.35%
=======================================
Files 364 364
Lines 7284 7284
Branches 1988 1998 +10
=======================================
Hits 7164 7164
Misses 120 120 Continue to review full report at Codecov.
|
有办法加个测试用例不?Post check 一下。 |
需要加个测试用例,不然这块很容易搞错。 |
具体是那种配置方式不生效最好写明白。 |
`const { ${theme}ThemeSingle } = require('./theme');\nconst defaultTheme = require('./default-theme');\n | ||
module.exports = { | ||
...${theme}ThemeSingle, | ||
...defaultTheme | ||
}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这就是写反了的那段代码吧,这样不就导致所有生成的主题都是默认主题了吗? _(:D)∠)_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯,但是不会导致你之前那个的报错。
tests/index.test.js
Outdated
...darkThemeSingle | ||
}`; | ||
expect(generateThemeFileContent('dark')).toBe(darkContent); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个测试用例没啥意义。
build 出 dist 以后,require 一下对应 dist 文件,然后加断言,比如暗色主题的某些变量值预期是什么。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我一开始的想法是用 jest mock 出来 dist 文件,但是卡在怎么把 mock 的 dist 文件变成模块,我想一下怎么做。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对哦,好像也不用 mock 的样子。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ant-design/.circleci/config.yml
Line 76 in 3ee0e4a
- run: npm run dist |
这后面加个自定义脚本好了。
@@ -19,5 +19,73 @@ describe('antd dist files', () => { | |||
const antd = require('../dist/antd'); | |||
expect(antd.version).toBe(pkg.version); | |||
}); | |||
|
|||
/* eslint-disable global-require,import/no-unresolved */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't disable eslint rules
docs/react/customize-theme.en-US.md
Outdated
Method 1: using Umi 3 | ||
#### Method 1 | ||
|
||
using Umi 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using Umi 3 | |
Using Umi 3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还是建议标题上带上具体方式,这样右边锚点导航上有信息。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像只有二级标题才会出现在右边锚点导航上,这里用二级标题不太合适。
docs/react/customize-theme.zh-CN.md
Outdated
@@ -184,7 +190,7 @@ module.exports = { | |||
}; | |||
``` | |||
|
|||
同时开启暗黑和紧凑模式会导致 css 的加载体积增加一倍,这暂时受限于我们目前的主题实现方式,请知晓。 | |||
使用 [方式二](#方式二) 同时开启暗黑和紧凑模式会导致 css 的加载体积增加一倍。如果希望体积不变请使用 [方式一](#方式一) 或者 [方式三](#方式三) 引入。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写在方式二里面就好了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
突然又犯错了... 方式二根本不支持混合模式,在方式二中更新了说明。
docs/react/customize-theme.en-US.md
Outdated
@@ -141,7 +141,9 @@ We have some official themes, try them out and give us some feedback! | |||
|
|||
 | |||
|
|||
Method 1: using Umi 3 | |||
#### Method 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
保持原来的写法,标题上有内容会比较好找。
* fix: fix ${theme}-theme.js file order * chore: add generateThemeFileContent test * chore: add test * patch * update docs * update docs * update docs
no
close #23237
貌似上次只是修复了报错,手滑顺序变化了导致以前主题样式配置方式应该是不生效,趁没人提 bug...