Skip to content

Commit 52c089f

Browse files
committed
feat: remove fileIcon component and debugger webpack plugin
1 parent a839ef7 commit 52c089f

File tree

9 files changed

+27
-104
lines changed

9 files changed

+27
-104
lines changed

build/webpack.base.js

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const path = require('path');
22
const webpack = require('webpack');
33
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
4-
const CopyWebpackPlugin = require('copy-webpack-plugin');
54

65
module.exports = {
76
mode: 'development',
@@ -20,10 +19,12 @@ module.exports = {
2019
path: path.resolve(__dirname, '../dist'),
2120
},
2221
module: {
23-
rules: [{
22+
rules: [
23+
{
2424
test: /\.(js|jsx|tsx|ts)$/,
2525
exclude: /node_modules/,
26-
use: [{
26+
use: [
27+
{
2728
loader: require.resolve('ts-loader'),
2829
options: {
2930
transpileOnly: true,
@@ -49,12 +50,5 @@ module.exports = {
4950
new webpack.DefinePlugin({
5051
__DEVELOPMENT__: true,
5152
}),
52-
new CopyWebpackPlugin({
53-
patterns: [{
54-
context: path.resolve(__dirname, '../'),
55-
from: './src/static',
56-
to: './static'
57-
}]
58-
})
5953
],
60-
};
54+
};

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"dependencies": {
2727
"@types/react": "^16.9.35",
2828
"@types/react-dom": "^16.9.9",
29-
"copy-webpack-plugin": "^6.3.2",
3029
"dt-utils": "^1.0.1",
3130
"immutability-helper": "^3.1.1",
3231
"loadsh": "^0.0.4",
@@ -41,8 +40,7 @@
4140
"react-split-pane": "^0.1.92",
4241
"reflect-metadata": "^0.1.13",
4342
"tsyringe": "^4.3.0",
44-
"vscode-codicons": "^0.0.10",
45-
"vscode-icons-js": "^11.0.0"
43+
"vscode-codicons": "^0.0.10"
4644
},
4745
"devDependencies": {
4846
"@commitlint/cli": "^11.0.0",
@@ -90,4 +88,4 @@
9088
"path": "cz-conventional-changelog"
9189
}
9290
}
93-
}
91+
}

src/components/fileIcon/index.tsx

-31
This file was deleted.

src/components/fileIcon/style.scss

-11
This file was deleted.

src/components/tabs/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const DraggleTabs = (props: ITabsProps) => {
5151
const onTabClose = (item: ITab) => {};
5252
return (
5353
<DndProvider backend={HTML5Backend}>
54-
<Scrollable>
54+
<Scrollable className={'normal-items'}>
5555
<TabSwicher className="tab-switcher">
5656
{data?.map((item: ITab, index: number) => (
5757
<Tab

src/components/tabs/style.scss

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ $tabSwitcher: 'tab-switcher';
55
display: flex;
66
flex-flow: row nowrap;
77
height: 35px;
8-
width: 100%;
98
}
109

1110
.tab-button {
@@ -88,3 +87,9 @@ $tabSwitcher: 'tab-switcher';
8887
display: block;
8988
}
9089
}
90+
91+
.normal-items {
92+
margin-bottom: auto;
93+
overflow: hidden;
94+
overflow-y: auto;
95+
}

src/components/tabs/tabButton.tsx

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
22
import { useState } from 'react';
3-
import FileIcon from '../fileIcon';
43
import { classNames } from 'mo/common/className';
54
import TabDot from './tabDot';
5+
import { Icon } from '../icon';
66

77
export interface TabButtonProps {
88
name?: string;
@@ -44,16 +44,14 @@ export default function TabButton({
4444
<div
4545
className={classNames(
4646
'tab-button',
47-
{
48-
'tab-button--active': active,
49-
},
47+
active ? 'tab-button--active' : '',
5048
className
5149
)}
5250
onClick={handleClick}
5351
onMouseOver={handleMouseOver}
5452
onMouseOut={handleMouseOut}
5553
>
56-
<FileIcon type="file" fileName={name} />
54+
<Icon type="new-file" />
5755
<span className="tab-button__name">{name}</span>
5856
<TabDot
5957
modified={modified}

stories/components/3-Tabs.stories.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,14 @@ stories.add('Basic Usage', () => {
2525
{
2626
modified: false,
2727
id: 3,
28-
name: 'editor.tsx',
29-
value: 'hello tsx',
28+
name: 'editor.python',
29+
value: 'hello python',
30+
},
31+
{
32+
modified: true,
33+
id: 1,
34+
name: 'editor.md',
35+
value: 'hello markdown',
3036
},
3137
];
3238
const [tabs, setTabs] = useState(data);
@@ -36,7 +42,7 @@ stories.add('Basic Usage', () => {
3642
<p>Tab 提供组件多tab切换;拖拽</p>
3743
<div>
3844
<h3>使用示例 1 - 基本使用</h3>
39-
<div style={{ height: 200 }}>
45+
<div style={{ height: 35 }}>
4046
<Tabs
4147
data={tabs}
4248
onMoveTab={onMoveTab}

yarn.lock

+1-37
Original file line numberDiff line numberDiff line change
@@ -2386,11 +2386,6 @@
23862386
dependencies:
23872387
"@types/istanbul-lib-report" "*"
23882388

2389-
"@types/jasmine@^3.3.8":
2390-
version "3.6.2"
2391-
resolved "https://registry.npm.taobao.org/@types/jasmine/download/@types/jasmine-3.6.2.tgz#02f64450016f7de70f145d698be311136d7c6374"
2392-
integrity sha1-AvZEUAFvfecPFF1pi+MRE218Y3Q=
2393-
23942389
"@types/jest@26.x", "@types/jest@^26.0.0":
23952390
version "26.0.15"
23962391
resolved "http://registry.npm.dtstack.com/@types%2fjest/-/jest-26.0.15.tgz#12e02c0372ad0548e07b9f4e19132b834cb1effe"
@@ -4808,23 +4803,6 @@ copy-to-clipboard@^3.0.8:
48084803
dependencies:
48094804
toggle-selection "^1.0.6"
48104805

4811-
copy-webpack-plugin@^6.3.2:
4812-
version "6.3.2"
4813-
resolved "https://registry.npm.taobao.org/copy-webpack-plugin/download/copy-webpack-plugin-6.3.2.tgz?cache=0&sync_timestamp=1605800705546&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcopy-webpack-plugin%2Fdownload%2Fcopy-webpack-plugin-6.3.2.tgz#0e920a6c181a5052aa6e2861b164bda03f83afeb"
4814-
integrity sha1-DpIKbBgaUFKqbihhsWS9oD+Dr+s=
4815-
dependencies:
4816-
cacache "^15.0.5"
4817-
fast-glob "^3.2.4"
4818-
find-cache-dir "^3.3.1"
4819-
glob-parent "^5.1.1"
4820-
globby "^11.0.1"
4821-
loader-utils "^2.0.0"
4822-
normalize-path "^3.0.0"
4823-
p-limit "^3.0.2"
4824-
schema-utils "^3.0.0"
4825-
serialize-javascript "^5.0.1"
4826-
webpack-sources "^1.4.3"
4827-
48284806
core-js-compat@^3.7.0:
48294807
version "3.7.0"
48304808
resolved "http://registry.npm.dtstack.com/core-js-compat/-/core-js-compat-3.7.0.tgz#8479c5d3d672d83f1f5ab94cf353e57113e065ed"
@@ -6900,7 +6878,7 @@ glob-parent@^3.1.0:
69006878
is-glob "^3.1.0"
69016879
path-dirname "^1.0.0"
69026880

6903-
glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@~5.1.0:
6881+
glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
69046882
version "5.1.1"
69056883
resolved "http://registry.npm.dtstack.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
69066884
integrity sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=
@@ -11987,13 +11965,6 @@ serialize-javascript@^4.0.0:
1198711965
dependencies:
1198811966
randombytes "^2.1.0"
1198911967

11990-
serialize-javascript@^5.0.1:
11991-
version "5.0.1"
11992-
resolved "https://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-5.0.1.tgz?cache=0&sync_timestamp=1599740668657&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fserialize-javascript%2Fdownload%2Fserialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4"
11993-
integrity sha1-eIbshIBJpGJGepfT2Rjrsqr5NPQ=
11994-
dependencies:
11995-
randombytes "^2.1.0"
11996-
1199711968
serve-favicon@^2.5.0:
1199811969
version "2.5.0"
1199911970
resolved "http://registry.npm.dtstack.com/serve-favicon/-/serve-favicon-2.5.0.tgz#935d240cdfe0f5805307fdfe967d88942a2cbcf0"
@@ -13703,13 +13674,6 @@ vscode-codicons@^0.0.10:
1370313674
resolved "http://registry.npm.dtstack.com/vscode-codicons/-/vscode-codicons-0.0.10.tgz#51d1d34d852fc7696fd732b6eaad49f5b57b4e79"
1370413675
integrity sha1-UdHTTYUvx2lv1zK26q1J9bV7Tnk=
1370513676

13706-
vscode-icons-js@^11.0.0:
13707-
version "11.0.0"
13708-
resolved "https://registry.npm.taobao.org/vscode-icons-js/download/vscode-icons-js-11.0.0.tgz#7986d9eb8e5f39b1125de8a142e68526e72ecff8"
13709-
integrity sha1-eYbZ645fObESXeihQuaFJucuz/g=
13710-
dependencies:
13711-
"@types/jasmine" "^3.3.8"
13712-
1371313677
w3c-hr-time@^1.0.2:
1371413678
version "1.0.2"
1371513679
resolved "http://registry.npm.dtstack.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"

0 commit comments

Comments
 (0)