-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f075f4
commit f931fc0
Showing
332 changed files
with
49,805 additions
and
3,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
node_modules | ||
.vscode | ||
.git | ||
.history | ||
build | ||
docs | ||
docs | ||
src | ||
public | ||
demo | ||
langs | ||
docs | ||
img | ||
.gitignore | ||
.eslintrc.js | ||
.browserslistrc | ||
babel.config.js | ||
postcss.config.js | ||
vue.config.js | ||
theme | ||
组件API.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
function removeJs(src) { | ||
fs.readdir(src, function(err, paths) { | ||
if (err) { | ||
throw err; | ||
} | ||
paths.forEach(function(file) { | ||
let curPath = path.join(src, file), | ||
stat = fs.statSync(curPath); | ||
|
||
// 判断是否为css文件 | ||
if (stat.isFile() && path.extname(curPath) !== ".css") { | ||
fs.unlinkSync(curPath); | ||
} else if (stat.isDirectory()) { | ||
removeJs(curPath); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
function main() { | ||
let cwd = process.cwd(); | ||
removeJs(path.join(cwd, "theme")); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
module.exports = { | ||
scroll: "./src/components/scroll/index.js", | ||
base: "./src/components/base.js", | ||
alert: "./src/components/alert/index.js", | ||
badge: "./src/components/badge/index.js", | ||
button: "./src/components/button/index.js", | ||
checkbox: "./src/components/checkbox/index.js", | ||
collapse: "./src/components/collapse/index.js", | ||
row: "./src/components/layout/index.js", | ||
col: "./src/components/layout/colIndex.js", | ||
datepicker: "./src/components/datepicker/index.js", | ||
dialog: "./src/components/dialog/index.js", | ||
dropdown: "./src/components/dropdown/index.js", | ||
input: "./src/components/input/index.js", | ||
form: "./src/components/form/index.js", | ||
layout: "./src/components/layout/index.js", | ||
list: "./src/components/list/index.js", | ||
loading: "./src/components/loading/index.js", | ||
message: "./src/components/message/index.js", | ||
notification: "./src/components/notification/index.js", | ||
pagination: "./src/components/pagination/index.js", | ||
popconfirm: "./src/components/popconfirm/index.js", | ||
popover: "./src/components/popover/index.js", | ||
popups: "./src/components/popups/index.js", | ||
radio: "./src/components/radio/index.js", | ||
scroll: "./src/components/scroll/index.js", | ||
select: "./src/components/select/index.js", | ||
slider: "./src/components/slider/index.js", | ||
steps: "./src/components/steps/index.js", | ||
switch: "./src/components/switch/index.js", | ||
tabs: "./src/components/tabs/index.js", | ||
table: "./src/components/table/index.js", | ||
timepicker: "./src/components/timepicker/index.js", | ||
tooltip: "./src/components/tooltip/index.js", | ||
upload: "./src/components/upload/index.js", | ||
bar: "./src/components/chart/bar/index.js", | ||
line: "./src/components/chart/line/index.js", | ||
percent: "./src/components/chart/percent/index.js", | ||
pie: "./src/components/chart/pie/index.js", | ||
percent: "./src/components/chart/percent/index.js" | ||
progress: "./src/components/chart/percent/progress.js" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function getConfig(theme) { | ||
return { | ||
isProd: process.env.NODE_ENV === "production", | ||
variables: `@import "src/scss/varibles.scss";`, | ||
outPath:"/dist" | ||
}; | ||
} | ||
|
||
module.exports = { | ||
getConfig | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
const component = require("./webpack.component.js"); | ||
const publish = require("./webpack.publish.js"); | ||
const scss = require("./webpack.scss.js"); | ||
const { getConfig } = require("./config"); | ||
const MiniCssExtractPlugin = require("mini-css-extract-plugin"); | ||
const _ = require("lodash"); | ||
|
||
let themes = []; | ||
|
||
function webpackPromise(config) { | ||
console.log("组件打包处理中..."); | ||
return new Promise((resolve, reject) => { | ||
webpack(config, (err, stats) => { | ||
if (err) { | ||
reject(err); | ||
return; | ||
} | ||
|
||
process.stdout.write( | ||
stats.toString({ | ||
chunks: true, // 使构建过程更静默无输出 | ||
colors: true // 在控制台展示颜色 | ||
}) + "\n" | ||
); | ||
|
||
resolve(); | ||
}); | ||
}); | ||
} | ||
|
||
function correctConfig(cfg, variables, outPath, theme) { | ||
outPath = path.join(path.resolve(__dirname, ".."), outPath); | ||
cfg.mode = "production"; | ||
|
||
cfg.plugins.push( | ||
new webpack.DefinePlugin({ | ||
"process.env.THEME": JSON.stringify(theme) | ||
}) | ||
); | ||
|
||
if (cfg.noCss) { | ||
delete cfg.noCss; | ||
cfg.module.rules.push({ | ||
test: /\.(scss|css)$/, | ||
use: [ | ||
"css-loader", | ||
"postcss-loader", | ||
{ | ||
loader: "sass-loader", | ||
options: { | ||
prependData: variables | ||
} | ||
} | ||
], | ||
exclude: /node_modules/ | ||
}); | ||
} else { | ||
cfg.module.rules.push({ | ||
test: /\.(scss|css)$/, | ||
use: [ | ||
MiniCssExtractPlugin.loader, | ||
"css-loader", | ||
"postcss-loader", | ||
{ | ||
loader: "sass-loader", | ||
options: { | ||
prependData: variables | ||
} | ||
} | ||
], | ||
exclude: /node_modules/ | ||
}); | ||
} | ||
|
||
cfg.output.path = outPath; | ||
} | ||
|
||
function run() { | ||
|
||
compile(); | ||
} | ||
|
||
function compile() { | ||
let configs = []; | ||
|
||
let scssConfig = _.cloneDeep(scss); | ||
let componentConfig = _.cloneDeep(component); | ||
let publishConfig = _.cloneDeep(publish); | ||
|
||
const { variables, outPath } = getConfig(); | ||
correctConfig(scssConfig, variables, path.join(outPath, "/lib")); | ||
correctConfig(componentConfig, variables, path.join(outPath, "/lib")); | ||
correctConfig(publishConfig, variables, outPath); | ||
configs.push(scssConfig, componentConfig, publishConfig); | ||
console.log("******************************************"); | ||
console.log("风格处理:"); | ||
console.log("变量文件:", variables); | ||
console.log("输出地址:", outPath); | ||
|
||
return webpackPromise(configs); | ||
} | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
module.exports = { | ||
scroll: "./src/scss/components/scroll.scss", | ||
base: "./src/scss/base.scss", | ||
alert: "./src/scss/components/alert.scss", | ||
badge: "./src/scss/components/badge.scss", | ||
button: "./src/scss/components/button.scss", | ||
checkbox: "./src/scss/components/checkbox.scss", | ||
collapse: "./src/scss/components/collapse.scss", | ||
row: "./src/scss/components/row.scss", | ||
col: "./src/scss/components/col.js", | ||
datepicker: "./src/scss/components/datepicker.scss", | ||
dialog: "./src/scss/components/dialog.scss", | ||
dropdown: "./src/scss/components/dropdown.scss", | ||
input: "./src/scss/components/input.scss", | ||
form: "./src/scss/components/form.scss", | ||
layout: "./src/scss/components/row.scss", | ||
list: "./src/scss/components/list.scss", | ||
loading: "./src/scss/components/loading.scss", | ||
message: "./src/scss/components/message.scss", | ||
notification: "./src/scss/components/notification.scss", | ||
pagination: "./src/scss/components/pagination.scss", | ||
popconfirm: "./src/scss/components/popconfirm.scss", | ||
popover: "./src/scss/components/popover.scss", | ||
popups: "./src/scss/components/popups.scss", | ||
radio: "./src/scss/components/radio.scss", | ||
scroll: "./src/scss/components/scroll.scss", | ||
select: "./src/scss/components/select.scss", | ||
slider: "./src/scss/components/slider.scss", | ||
steps: "./src/scss/components/steps.scss", | ||
switch: "./src/scss/components/switch.scss", | ||
tabs: "./src/scss/components/tabs.scss", | ||
table: "./src/scss/components/table.scss", | ||
timepicker: "./src/scss/components/timepicker.scss", | ||
tooltip: "./src/scss/components/tooltip.scss", | ||
upload: "./src/scss/components/upload.scss", | ||
bar: "./src/scss/components/chart-bar.scss", | ||
line: "./src/scss/components/chart-line.scss", | ||
percent: "./src/scss/components/chart-percent.scss", | ||
pie: "./src/scss/components/chart-pie.scss", | ||
percent: "./src/scss/components/chart-percent.scss" | ||
progress: "./src/scss/components/chart-percent.scss" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.