Skip to content

Commit

Permalink
revert: base on [email protected], because of
Browse files Browse the repository at this point in the history
  • Loading branch information
Javey committed Apr 20, 2020
1 parent 0900d9f commit 621e4ce
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 36 deletions.
6 changes: 2 additions & 4 deletions components/code/demos/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ order: 0
>
> `import {CodeModule} from 'kpc-angular/@css/components/code';`


组件可以通过`v-model`双向绑定编辑的代码,通过`height`指定组件的高度(需要带单位),默认`100%`;通过
`language`可以指定编程语言,默认为`javasript`

> `Code`组件基于[Monaco Editor](https://github.com/Microsoft/monaco-editor),使用该组件之前,你需要
> 安装[monaco-editor-webpack-plugin](https://github.com/Microsoft/monaco-editor-webpack-plugin)插件,
> `Code`组件基于[Monaco Editor@0.17](https://github.com/Microsoft/monaco-editor),使用该组件之前,你需要
> 安装[monaco-editor-webpack-plugin@1.7](https://github.com/Microsoft/monaco-editor-webpack-plugin)插件,
> 并加入`webpack`插件配置中
>
> ```shell
Expand Down
3 changes: 2 additions & 1 deletion components/code/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export default class Code extends Intact {
this.set('loading', false);
this._watch();

window.i = this;

this.trigger('ready', this);
});
}
Expand Down Expand Up @@ -115,7 +117,6 @@ function crossDomainWorker() {
oldGetWorkerUrl.$ = true;

window.MonacoEnvironment.getWorkerUrl = (moduleId, label) => {
debugger;
const workerUrl = oldGetWorkerUrl(moduleId, label);
const {isSame, url} = isSameOrigin(workerUrl);

Expand Down
5 changes: 2 additions & 3 deletions components/treeSelect/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ describe('TreeSelect', () => {
expect(instance.get('values')).to.eql(['1.1']);

instance.set('values', ['1']);
window.i = instance;
// expect(dropdown.innerHTML).to.matchSnapshot();
// expect(instance.element.innerHTML).to.matchSnapshot();
expect(dropdown.innerHTML).to.matchSnapshot();
expect(instance.element.innerHTML).to.matchSnapshot();
});

it('checkbox', () => {
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"mermaid": "^8.3.1",
"mini-css-extract-plugin": "^0.9.0",
"mocha": "^5.2.0",
"monaco-editor-webpack-plugin": "^1.9.0",
"monaco-editor-webpack-plugin": "^1.7.0",
"node-style-loader": "0.0.1-alpha",
"null-loader": "^3.0.0",
"postcss-loader": "^3.0.0",
Expand Down Expand Up @@ -179,7 +179,7 @@
"intact": "^2.5.12",
"intact-react": "^1.1.26",
"intact-vue": "^0.5.6",
"monaco-editor": "^0.20.0",
"monaco-editor": "^0.17.1",
"mxgraphx": "^4.0.7",
"resize-observer-polyfill": "^1.5.0",
"tinycolor2": "^1.4.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/kpc-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"enquire.js": "^2.1.6",
"intact": "^2.5.12",
"intact-angular": "^0.1.3",
"monaco-editor": "^0.20.0",
"monaco-editor": "^0.17.1",
"mxgraphx": "^4.0.7",
"resize-observer-polyfill": "^1.5.0",
"tinycolor2": "^1.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/kpc-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"enquire.js": "^2.1.6",
"intact": "^2.5.12",
"intact-react": "^1.1.26",
"monaco-editor": "^0.20.0",
"monaco-editor": "^0.17.1",
"mxgraphx": "^4.0.7",
"resize-observer-polyfill": "^1.5.0",
"tinycolor2": "^1.4.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/kpc-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"enquire.js": "^2.1.6",
"intact": "^2.5.12",
"intact-vue": "^0.5.6",
"monaco-editor": "^0.20.0",
"monaco-editor": "^0.17.1",
"mxgraphx": "^4.0.7",
"resize-observer-polyfill": "^1.5.0",
"tinycolor2": "^1.4.1"
Expand Down
3 changes: 3 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export function testDemos(req, test) {
value.forEach(value => {
it(value.title, async () => {
await test(value.Demo);
// if (key === 'code') {
// await wait(1000);
// }
});
});
});
Expand Down
36 changes: 20 additions & 16 deletions test/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@ const {destData} = require('../build/doc/webpack');
exports.webpackConfig = () => {
const config = genConfig();

config
.module
.rule('istanbulJs')
.test(/^((?!(spec|mxgraph)).)*\.js$/)
.include.add(resolve('./components')).end()
.enforce('post')
.use('istanbul')
.loader('istanbul-instrumenter-loader')
.options({esModules: true})
if (process.env.UPDATE || process.env.CI) {
config
.module
.rule('istanbulJs')
.test(/^((?!(spec|mxgraph)).)*\.js$/)
.include.add(resolve('./components')).end()
.enforce('post')
.use('istanbul')
.loader('istanbul-instrumenter-loader')
.options({esModules: true})
.end()
.end()
.end()
.rule('istanbulVdt')
.test(/^((?!site).)*\.vdt$/)
.enforce('post')
.use('istanbul')
.merge(config.module.rules.get('istanbulJs').uses.get('istanbul').entries())
.rule('istanbulVdt')
.test(/^((?!site).)*\.vdt$/)
.enforce('post')
.use('istanbul')
.merge(config.module.rules.get('istanbulJs').uses.get('istanbul').entries())
.end()
.end()
.end()
.end()
}

config
.resolve
.alias
.set('~', destData)
Expand Down

0 comments on commit 621e4ce

Please sign in to comment.