Skip to content

Commit

Permalink
feat: remove fileIcon component and debugger webpack plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mumiao committed Nov 27, 2020
1 parent a839ef7 commit 52c089f
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 104 deletions.
16 changes: 5 additions & 11 deletions build/webpack.base.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const path = require('path');
const webpack = require('webpack');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
mode: 'development',
Expand All @@ -20,10 +19,12 @@ module.exports = {
path: path.resolve(__dirname, '../dist'),
},
module: {
rules: [{
rules: [
{
test: /\.(js|jsx|tsx|ts)$/,
exclude: /node_modules/,
use: [{
use: [
{
loader: require.resolve('ts-loader'),
options: {
transpileOnly: true,
Expand All @@ -49,12 +50,5 @@ module.exports = {
new webpack.DefinePlugin({
__DEVELOPMENT__: true,
}),
new CopyWebpackPlugin({
patterns: [{
context: path.resolve(__dirname, '../'),
from: './src/static',
to: './static'
}]
})
],
};
};
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"dependencies": {
"@types/react": "^16.9.35",
"@types/react-dom": "^16.9.9",
"copy-webpack-plugin": "^6.3.2",
"dt-utils": "^1.0.1",
"immutability-helper": "^3.1.1",
"loadsh": "^0.0.4",
Expand All @@ -41,8 +40,7 @@
"react-split-pane": "^0.1.92",
"reflect-metadata": "^0.1.13",
"tsyringe": "^4.3.0",
"vscode-codicons": "^0.0.10",
"vscode-icons-js": "^11.0.0"
"vscode-codicons": "^0.0.10"
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
Expand Down Expand Up @@ -90,4 +88,4 @@
"path": "cz-conventional-changelog"
}
}
}
}
31 changes: 0 additions & 31 deletions src/components/fileIcon/index.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions src/components/fileIcon/style.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const DraggleTabs = (props: ITabsProps) => {
const onTabClose = (item: ITab) => {};
return (
<DndProvider backend={HTML5Backend}>
<Scrollable>
<Scrollable className={'normal-items'}>
<TabSwicher className="tab-switcher">
{data?.map((item: ITab, index: number) => (
<Tab
Expand Down
7 changes: 6 additions & 1 deletion src/components/tabs/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ $tabSwitcher: 'tab-switcher';
display: flex;
flex-flow: row nowrap;
height: 35px;
width: 100%;
}

.tab-button {
Expand Down Expand Up @@ -88,3 +87,9 @@ $tabSwitcher: 'tab-switcher';
display: block;
}
}

.normal-items {
margin-bottom: auto;
overflow: hidden;
overflow-y: auto;
}
8 changes: 3 additions & 5 deletions src/components/tabs/tabButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { useState } from 'react';
import FileIcon from '../fileIcon';
import { classNames } from 'mo/common/className';
import TabDot from './tabDot';
import { Icon } from '../icon';

export interface TabButtonProps {
name?: string;
Expand Down Expand Up @@ -44,16 +44,14 @@ export default function TabButton({
<div
className={classNames(
'tab-button',
{
'tab-button--active': active,
},
active ? 'tab-button--active' : '',
className
)}
onClick={handleClick}
onMouseOver={handleMouseOver}
onMouseOut={handleMouseOut}
>
<FileIcon type="file" fileName={name} />
<Icon type="new-file" />
<span className="tab-button__name">{name}</span>
<TabDot
modified={modified}
Expand Down
12 changes: 9 additions & 3 deletions stories/components/3-Tabs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ stories.add('Basic Usage', () => {
{
modified: false,
id: 3,
name: 'editor.tsx',
value: 'hello tsx',
name: 'editor.python',
value: 'hello python',
},
{
modified: true,
id: 1,
name: 'editor.md',
value: 'hello markdown',
},
];
const [tabs, setTabs] = useState(data);
Expand All @@ -36,7 +42,7 @@ stories.add('Basic Usage', () => {
<p>Tab 提供组件多tab切换;拖拽</p>
<div>
<h3>使用示例 1 - 基本使用</h3>
<div style={{ height: 200 }}>
<div style={{ height: 35 }}>
<Tabs
data={tabs}
onMoveTab={onMoveTab}
Expand Down
38 changes: 1 addition & 37 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2386,11 +2386,6 @@
dependencies:
"@types/istanbul-lib-report" "*"

"@types/jasmine@^3.3.8":
version "3.6.2"
resolved "https://registry.npm.taobao.org/@types/jasmine/download/@types/jasmine-3.6.2.tgz#02f64450016f7de70f145d698be311136d7c6374"
integrity sha1-AvZEUAFvfecPFF1pi+MRE218Y3Q=

"@types/jest@26.x", "@types/jest@^26.0.0":
version "26.0.15"
resolved "http://registry.npm.dtstack.com/@types%2fjest/-/jest-26.0.15.tgz#12e02c0372ad0548e07b9f4e19132b834cb1effe"
Expand Down Expand Up @@ -4808,23 +4803,6 @@ copy-to-clipboard@^3.0.8:
dependencies:
toggle-selection "^1.0.6"

copy-webpack-plugin@^6.3.2:
version "6.3.2"
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"
integrity sha1-DpIKbBgaUFKqbihhsWS9oD+Dr+s=
dependencies:
cacache "^15.0.5"
fast-glob "^3.2.4"
find-cache-dir "^3.3.1"
glob-parent "^5.1.1"
globby "^11.0.1"
loader-utils "^2.0.0"
normalize-path "^3.0.0"
p-limit "^3.0.2"
schema-utils "^3.0.0"
serialize-javascript "^5.0.1"
webpack-sources "^1.4.3"

core-js-compat@^3.7.0:
version "3.7.0"
resolved "http://registry.npm.dtstack.com/core-js-compat/-/core-js-compat-3.7.0.tgz#8479c5d3d672d83f1f5ab94cf353e57113e065ed"
Expand Down Expand Up @@ -6900,7 +6878,7 @@ glob-parent@^3.1.0:
is-glob "^3.1.0"
path-dirname "^1.0.0"

glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@^5.1.1, glob-parent@~5.1.0:
glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
version "5.1.1"
resolved "http://registry.npm.dtstack.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
integrity sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=
Expand Down Expand Up @@ -11987,13 +11965,6 @@ serialize-javascript@^4.0.0:
dependencies:
randombytes "^2.1.0"

serialize-javascript@^5.0.1:
version "5.0.1"
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"
integrity sha1-eIbshIBJpGJGepfT2Rjrsqr5NPQ=
dependencies:
randombytes "^2.1.0"

serve-favicon@^2.5.0:
version "2.5.0"
resolved "http://registry.npm.dtstack.com/serve-favicon/-/serve-favicon-2.5.0.tgz#935d240cdfe0f5805307fdfe967d88942a2cbcf0"
Expand Down Expand Up @@ -13703,13 +13674,6 @@ vscode-codicons@^0.0.10:
resolved "http://registry.npm.dtstack.com/vscode-codicons/-/vscode-codicons-0.0.10.tgz#51d1d34d852fc7696fd732b6eaad49f5b57b4e79"
integrity sha1-UdHTTYUvx2lv1zK26q1J9bV7Tnk=

vscode-icons-js@^11.0.0:
version "11.0.0"
resolved "https://registry.npm.taobao.org/vscode-icons-js/download/vscode-icons-js-11.0.0.tgz#7986d9eb8e5f39b1125de8a142e68526e72ecff8"
integrity sha1-eYbZ645fObESXeihQuaFJucuz/g=
dependencies:
"@types/jasmine" "^3.3.8"

w3c-hr-time@^1.0.2:
version "1.0.2"
resolved "http://registry.npm.dtstack.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd"
Expand Down

0 comments on commit 52c089f

Please sign in to comment.