From db6f9b5063e234b5ccb61760ef4a519afa84a07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Thu, 15 Jul 2021 09:50:10 +0800 Subject: [PATCH 01/47] =?UTF-8?q?'=E9=85=8D=E7=BD=AE=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=9A=84=E8=BF=9E=E6=8E=A5=E5=9B=BE=E6=A0=87?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4f2448c..aafedaf 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ mxGraph 是一个 JavaScript 图表库,可以快速创建交互式图形和图表应用程序,这些应用程序可以在其供应商支持的任何主要浏览器中运行。mxGraph 提供图形绘制、图形可视化、图形交互、图形布局、图形分析等能力, 适用于工作流程图、BPMN 图、网络图、UML 图、循环图、组织结构图、MindMap 图、机架图、甘特图、信息图、平面图等绘制。 mxGraph 在 2005 年创建,作为商业项目一直持续到 2016 年,2016 年创建者以 Apache 2.0 开源协议在 GitHub 上公布源码。 + 官方产品(Draw.io): [https://app.diagrams.net/](https://app.diagrams.net/) + 官方 API :[http://jgraph.github.io/mxgraph/docs/js-api](https://app.diagrams.net/) GitHub 库:jgraph/mxgraph @@ -24,7 +26,8 @@ mxGraph 是用户直接操作的图,图的所有状态都保存;在 mxGraphMod mxGraph 的功能依赖关系如图所示: ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302165359553.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) -除此之外,mxGraph 还有 mxClient、组结构、复杂管理等部分组成,并提供 editor、io、handler、shape、view、util、layout 等 API。具体框架结构如下。 + 除此之外,mxGraph 还有 mxClient、组结构、复杂管理等部分组成,并提供 editor、io、handler、shape、view、util、layout 等 API。具体框架结构如下。 + ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302165408607.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) ``` @@ -90,6 +93,7 @@ export default { ``` 第四步:运行效果 + ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302165600359.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) API 方法使用总结: @@ -101,16 +105,24 @@ API 方法使用总结: –会创建一个 mxCell 对象并返回。 **方法的参数:** -parent – 组结构中此图元的直接父图元。我们会很快谈论到组结构,但现在我们直接使用 graph.getDefaultParent();作为默认的父图元,就像在 HelloWorld 这个例子一样。 -id – 描述此单元的全局唯一身份号码,总是一个字符串。主要用于外部对这单元的引用。如果你不想自己维护这些号码,只需要传入一个空参数并确保 mxGraphModel.isCreateIds()返回真即可。这样,模型就会管理这些号码,并保证它们的唯一性。 -value – 此单元的用户对象。用户对象只是一些对象,可以让您把应用程序的商务逻辑与 mxGraph 的可视化呈现相关联。在手册的后面有详细地描述,这里我们就只用字符 串就好,并把它们显示成节点和边的标签。 -x, y, width, height – 就像名字提到的,这是节点的左上角的 x 和 y 的位置以及它的宽度和高度。 -style – 将被应用到节点的样式描述。关于样式,很快会有更详细的描述,简单来讲,就是一个特定格式的字符串。这个字符串有零个或多个样式名字和一些键/值配对,用来覆盖全局设置或者创立新的样式。除非我们要创建自己的样式,我们可以直接使用这些现有的设置。 -source 和 target –参数定义了节点要连接的节点;注意,源节点 和目标节点需要已经被加入到模型中。 + + parent – 组结构中此图元的直接父图元。我们会很快谈论到组结构,但现在我们直接使用 graph.getDefaultParent();作为默认的父图元,就像在 HelloWorld 这个例子一样。 + + id – 描述此单元的全局唯一身份号码,总是一个字符串。主要用于外部对这单元的引用。如果你不想自己维护这些号码,只需要传入一个空参数并确保 mxGraphModel.isCreateIds()返回真即可。这样,模型就会管理这些号码,并保证它们的唯一性。 + + value – 此单元的用户对象。用户对象只是一些对象,可以让您把应用程序的商务逻辑与 mxGraph 的可视化呈现相关联。在手册的后面有详细地描述,这里我们就只用字符 串就好,并把它们显示成节点和边的标签。 + + x, y, width, height – 就像名字提到的,这是节点的左上角的 x 和 y 的位置以及它的宽度和高度。 + + style – 将被应用到节点的样式描述。关于样式,很快会有更详细的描述,简单来讲,就是一个特定格式的字符串。这个字符串有零个或多个样式名字和一些键/值配对,用来覆盖全局设置或者创立新的样式。除非我们要创建自己的样式,我们可以直接使用这些现有的设置。 + + source 和 target –参数定义了节点要连接的节点;注意,源节点 和目标节点需要已经被加入到模型中。 + **注意:** 1.mxGraph 事物的更新(插入新元素时)一定要放在 beginUpdate 和 endUpdate 里面。一次 beginUpdate 必须对应一次 endUpdate 2.由于 mxGraph 配置了默认的样式(节点字体、连线等元素样式)和默认的配置所以样式看起来比较单一;我们可以在绘制图形前修改 mxGraph 默认配置好的配置项,来达到我们想要的效果; 3.mxgraph 的自定义配置 + js 代码如下: ```js @@ -201,14 +213,20 @@ export default { ``` 注意: 1.我们在配置中会用到 mxGraph 中其他的模块,所以我们使用到 mxGraph 的哪个方法就得把它们 import 进来。 + 2.mxGraph 中有三个主要的组件:mxGraph、mxGraphModel、mxCell。mxGraph 是用户直接操作的图,图的所有状态都保存在 mxGraphModel 中,而图中的顶点和边都是用 mxCell 定义。 -3.insertVertex 做了三件事,先是设置几何信息,然后创建一个节点,最后将这个节点添加到画布。insertEdge 与 insertVertex 类似,方法中的几何信息四个数字分别对应 X、 Y、 宽、 高 ;坐标是以 graph 的左上角为原点。 3.当用户对 mxGraph 进行操作时,所有操作都映射到对 mxGraphModel 中保存的状态进行修改,而 mxGraphModel 中保存的状态也就是 mxCell 的状态。 + +3.insertVertex 做了三件事,先是设置几何信息,然后创建一个节点,最后将这个节点添加到画布。insertEdge 与 insertVertex 类似,方法中的几何信息四个数字分别对应 X、 Y、 宽、 高 ;坐标是以 graph 的左上角为原点。 + +4.当用户对 mxGraph 进行操作时,所有操作都映射到对 mxGraphModel 中保存的状态进行修改,而 mxGraphModel 中保存的状态也就是 mxCell 的状态。 + 运行效果: ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302165656158.png) 4.绘制具备树形结构的拓扑图 对于自动布局,我们可以根据官网提供的 mxHierarchicalLayout 模块,它提供了 getLayout 钩子。可以重写它以返回给定 cell 的子节点的布局算法。 + 代码如下: ```js @@ -295,10 +313,12 @@ export default { ``` 运行效果: + ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302165709326.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) 关于 mxGraph,官方 API 文档不友好,介绍简单;API 文档也是全是英文,官网的 Demo 倒是不少,不过有的拉下来在自己的环境下跑会报错,只有根据官方的 demo 不断地尝试和理解才能解决使用上的问题,目前只基本掌握基础使用部分,个人使用心得还会继续更新。 5.辅助功能演示: 通过以上三个 demo 的演示,相信大家对 mxgraph 已经有大致的了解了;下面在 demo 基础上我们针对一些辅助功能进行演示: + 5.1 选择线框 ```js @@ -317,6 +337,8 @@ position: absolute; ``` +运行效果: + ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302165805725.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) ``` @@ -344,6 +366,8 @@ graph.getModel().setStyle(e1, 'edgeStyle=myEdgeStyle'); ``` +运行效果: + ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302165835344.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) 也可以在定义好自定义样式后,直接修改连线的默认样式: @@ -371,9 +395,13 @@ mxGraphHandler.prototype.guidesEnabled = true ``` 针对上述功能,我们下一步进行 mxgraph 拓扑图编辑工具的开发说明: + 初始化画布: + 导入 mxgraph 的资源的由于源代码中已有且各个功能注释已写的较明确在这里就暂不赘述了,主要以功能性方面进行介绍;下面将初始化画布分解为 6 个步骤讲解 + 第一步:首先 mxgraph 将会检测当前浏览器是否支持 mxgraph,若不支持将会弹出警告并终止操作 + 第二步:.创建画布: ```js @@ -392,10 +420,15 @@ createGraph () { ``` 我们在获取画布的 dom 元素(this.\$ref.container)之后即可进行初始化;此步骤相当于告诉 mxgraph 我们将在那个 dom 元素上进行绘图;剩下的就是画布的配置项,各个配置的具体功能代码中备注 + 第三步:配置事件中心:此步骤将会配置各个事件 + 3.1 监听 新增 cell 事件: + (在 mxgraph 中,节点和连线都是 cell),当我们向画布新增 cell 时就会触发该事件;我们还可以配置其他的事件,所有事件都在 mxEvent 中,直接在控制台打印出,mxEvent 就可以知道有什么事件,配置方法直接参考 ADD_CELLS 即可 + 第四步:配置鼠标事件: + 我们可以配置鼠标事件来监听我们鼠标在画布中的操作 ```js @@ -446,7 +479,9 @@ createGraph () { ``` 各个事件函数的形参即可获取当前鼠标操作的元素信息 + 第五步:.配置画布中的右键菜单 + 首先 mxEvent.disableContextMenu(this.\$refs.container) 告诉 mxgraph 你要在画布中配置右键菜单,并使用 popupMenuHandler 进行菜单项新增 ```js @@ -480,6 +515,7 @@ configMenu () { ``` 第六步:.初始化左侧工具栏: + 此处是重点,在此处配置后左侧的节点列表即可进行拖拽,并可通过拖拽节点到画布新增节点 ```js @@ -551,9 +587,11 @@ var generalToolbarDomArray = this.$refs.generalToolItems ### 6.4 当节点新增到画布之后会自动触发 ADD_CELLS 事件 注意: + 左侧节点列表上方的搜索功能.在执行搜索后 generalToolbarDomArray 会改变, 所以在过滤完节点列表之后 我们要手动再执行一遍 initGeneralTool 函数,这样新的节点列表才可被拖拽新增 -第七步:.自动布局 +第七步:自动布局 + mxgraph 提供了几种自动布局的 API,直接调用 graphLayout 即可 ```js From 3a87753d60d9069def40e638eab9504d064fbce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Thu, 15 Jul 2021 09:52:59 +0800 Subject: [PATCH 02/47] =?UTF-8?q?'=E6=9B=B4=E6=96=B0=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=96=87=E6=A1=A3'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index aafedaf..20dd25a 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,10 @@ API 方法使用总结: source 和 target –参数定义了节点要连接的节点;注意,源节点 和目标节点需要已经被加入到模型中。 **注意:** -1.mxGraph 事物的更新(插入新元素时)一定要放在 beginUpdate 和 endUpdate 里面。一次 beginUpdate 必须对应一次 endUpdate 2.由于 mxGraph 配置了默认的样式(节点字体、连线等元素样式)和默认的配置所以样式看起来比较单一;我们可以在绘制图形前修改 mxGraph 默认配置好的配置项,来达到我们想要的效果; + +1.mxGraph 事物的更新(插入新元素时)一定要放在 beginUpdate 和 endUpdate 里面。一次 beginUpdate 必须对应一次 endUpdate + +2.由于 mxGraph 配置了默认的样式(节点字体、连线等元素样式)和默认的配置所以样式看起来比较单一;我们可以在绘制图形前修改 mxGraph 默认配置好的配置项,来达到我们想要的效果; 3.mxgraph 的自定义配置 @@ -212,7 +215,9 @@ export default { ``` -注意: 1.我们在配置中会用到 mxGraph 中其他的模块,所以我们使用到 mxGraph 的哪个方法就得把它们 import 进来。 +注意: + +1.我们在配置中会用到 mxGraph 中其他的模块,所以我们使用到 mxGraph 的哪个方法就得把它们 import 进来。 2.mxGraph 中有三个主要的组件:mxGraph、mxGraphModel、mxCell。mxGraph 是用户直接操作的图,图的所有状态都保存在 mxGraphModel 中,而图中的顶点和边都是用 mxCell 定义。 @@ -341,10 +346,7 @@ position: absolute; ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210302165805725.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) -``` - 5.3修改连线样式 - -``` +5.3 修改连线样式 ```js mxEdgeStyle 中定义了线的各种样式:Loop、ElbowConnector、SideToSide等等,可以通过以下方式自定义连线样式: From 7fc876840767383b9ae9773b47e5348ff2d8319f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Fri, 13 Aug 2021 14:42:06 +0800 Subject: [PATCH 03/47] =?UTF-8?q?'=E4=BC=98=E5=8C=96webpack=E6=89=93?= =?UTF-8?q?=E5=8C=85'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- build/build.js | 42 ++ build/check-version.js | 54 +++ build/thread-loader.conf | 30 ++ build/utils.js | 100 +++++ build/webpack.base.conf.js | 208 ++++++++++ build/webpack.dev.conf.js | 123 ++++++ build/webpack.dll.conf.js | 20 + build/webpack.prod.conf.js | 165 ++++++++ config/dev.env.js | 8 + config/dllEntry.json | 41 ++ config/index.js | 131 ++++++ config/prod.env.js | 5 + package-lock.json | 711 +++++++++++++++++++++++++++++++-- package.json | 6 +- public/index.html | 2 +- src/components/mouseHover.html | 201 ++++++++++ stats.json | 2 + vue.config.js | 66 ++- web-serve/app.js | 59 +++ web-serve/package-lock.json | 527 ++++++++++++++++++++++++ web-serve/package.json | 17 + yarn.lock | 224 ++++++++++- 23 files changed, 2705 insertions(+), 39 deletions(-) create mode 100644 build/build.js create mode 100644 build/check-version.js create mode 100644 build/thread-loader.conf create mode 100644 build/utils.js create mode 100644 build/webpack.base.conf.js create mode 100644 build/webpack.dev.conf.js create mode 100644 build/webpack.dll.conf.js create mode 100644 build/webpack.prod.conf.js create mode 100644 config/dev.env.js create mode 100644 config/dllEntry.json create mode 100644 config/index.js create mode 100644 config/prod.env.js create mode 100644 src/components/mouseHover.html create mode 100644 stats.json create mode 100644 web-serve/app.js create mode 100644 web-serve/package-lock.json create mode 100644 web-serve/package.json diff --git a/.gitignore b/.gitignore index 11f5d71..32618de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .DS_Store node_modules /dist - +/web-serve-until/node_modules # local env files .env.local .env.*.local diff --git a/build/build.js b/build/build.js new file mode 100644 index 0000000..cb27f4b --- /dev/null +++ b/build/build.js @@ -0,0 +1,42 @@ +'use strict'; +require('./check-versions')(); + +process.env.OPT_TYPE = 'deploy'; +process.env.NODE_ENV = 'production'; + +const ora = require('ora'); +const rm = require('rimraf'); +const path = require('path'); +const chalk = require('chalk'); +const webpack = require('webpack'); +const config = require('../config'); +const webpackConfig = require('./webpack.prod.conf'); + +const spinner = ora('building for production...'); +spinner.start(); + +rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { + if (err) throw err; + webpack(webpackConfig, (err, stats) => { + spinner.stop(); + if (err) throw err; + process.stdout.write(stats.toString({ + colors: true, + modules: false, + children: false, + chunks: false, + chunkModules: false, + }) + '\n\n'); + + if (stats.hasErrors()) { + console.log(chalk.red(' Build failed with errors.\n')); + process.exit(1); + } + + console.log(chalk.cyan(' Build complete.\n')); + console.log(chalk.yellow( + ' Tip: built files are meant to be served over an HTTP server.\n' + + ' Opening index.html over file:// won\'t work.\n', + )); + }); +}); diff --git a/build/check-version.js b/build/check-version.js new file mode 100644 index 0000000..0211023 --- /dev/null +++ b/build/check-version.js @@ -0,0 +1,54 @@ +'use strict'; +const chalk = require('chalk'); +const semver = require('semver'); +const packageConfig = require('../package.json'); +const shell = require('shelljs'); + +function exec (cmd) { + return require('child_process').execSync(cmd).toString().trim(); +} + +const versionRequirements = [ + { + name: 'node', + currentVersion: semver.clean(process.version), + versionRequirement: packageConfig.engines.node, + }, +]; + +if (shell.which('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm, + }); +} + +module.exports = function () { + const warnings = []; + + for (let i = 0; i < versionRequirements.length; i++) { + const mod = versionRequirements[i]; + + if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { + warnings.push(mod.name + ': ' + + chalk.red(mod.currentVersion) + ' should be ' + + chalk.green(mod.versionRequirement), + ); + } + } + + if (warnings.length) { + console.log(''); + console.log(chalk.yellow('To use this template, you must update following to modules:')); + console.log(); + + for (let i = 0; i < warnings.length; i++) { + const warning = warnings[i]; + console.log(' ' + warning); + } + + console.log(); + process.exit(1); + } +}; diff --git a/build/thread-loader.conf b/build/thread-loader.conf new file mode 100644 index 0000000..400c781 --- /dev/null +++ b/build/thread-loader.conf @@ -0,0 +1,30 @@ +module.exports = { + options: { + // 产生的 worker 的数量,默认是 (cpu 核心数 - 1) + // 或者,在 require('os').cpus() 是 undefined 时回退至 1 + // workers: require('os').cpus() - 1, + + // 一个 worker 进程中并行执行工作的数量 + // 默认为 20 + workerParallelJobs: 20, + + // 额外的 Node.js 参数 + workerNodeArgs: ['--max-old-space-size=4096'], + + // Allow to respawn a dead worker pool + // respawning slows down the entire compilation + // and should be set to false for development + poolRespawn: false, + + // 闲置时定时删除 worker 进程 + // 默认为 500ms + // 可以设置为无穷大, 这样在监视模式(--watch)下可以保持 worker 持续存在 + poolTimeout: 500, + + // 池(pool)分配给 worker 的工作数量 + // 默认为 200 + // 降低这个数值会降低总体的效率,但是会提升工作分布更均一 + poolParallelJobs: 200, + + }, +}; diff --git a/build/utils.js b/build/utils.js new file mode 100644 index 0000000..7d7d351 --- /dev/null +++ b/build/utils.js @@ -0,0 +1,100 @@ +'use strict'; +const path = require('path'); +const config = require('../config'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const packageConfig = require('../package.json'); + +exports.assetsPath = function (_path) { + const assetsSubDirectory = process.env.NODE_ENV === 'production' + ? config.build.assetsSubDirectory + : config.dev.assetsSubDirectory; + + return path.posix.join(assetsSubDirectory, _path); +}; + +exports.cssLoaders = function (options) { + options = options || {}; + + const cssLoader = { + loader: 'css-loader', + options: { + sourceMap: options.sourceMap, + }, + }; + + const postcssLoader = { + loader: 'postcss-loader', + options: { + sourceMap: options.sourceMap, + }, + }; + + // generate loader string to be used with extract text plugin + function generateLoaders (loader, loaderOptions) { + const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]; + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap, + }), + }); + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return [MiniCssExtractPlugin.loader].concat(loaders); + } else { + return ['vue-style-loader'].concat(loaders); + } + } + + // https://vue-loader.vuejs.org/en/configurations/extract-css.html + return { + css: generateLoaders(), + postcss: generateLoaders(), + less: generateLoaders('less', { + javascriptEnabled: true, + }), + sass: generateLoaders('sass', { indentedSyntax: true }), + scss: generateLoaders('sass'), + stylus: generateLoaders('stylus'), + styl: generateLoaders('stylus'), + }; +}; + +// Generate loaders for standalone style files (outside of .vue) +exports.styleLoaders = function (options) { + const output = []; + const loaders = exports.cssLoaders(options); + + for (const extension in loaders) { + const loader = loaders[extension]; + output.push({ + test: new RegExp('\\.' + extension + '$'), + use: loader, + }); + } + + return output; +}; + +exports.createNotifierCallback = () => { + const notifier = require('node-notifier'); + + return (severity, errors) => { + if (severity !== 'error') return; + + const error = errors[0]; + const filename = error.file && error.file.split('!').pop(); + + notifier.notify({ + title: packageConfig.name, + message: severity + ': ' + error.name, + subtitle: filename || '', + icon: path.join(__dirname, 'logo.png'), + }); + }; +}; diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js new file mode 100644 index 0000000..920af77 --- /dev/null +++ b/build/webpack.base.conf.js @@ -0,0 +1,208 @@ +'use strict'; +const path = require('path'); +const utils = require('./utils'); +const config = require('../config'); +const vueLoaderConfig = require('./vue-loader.conf'); +const VueLoaderPlugin = require('vue-loader/lib/plugin'); +const ProgressBarPlugin = require('progress-bar-webpack-plugin'); +const threadLoaderConfig = require('./thread-loader.conf'); +const FilterWarningsPlugin = require('webpack-filter-warnings-plugin'); +const webpack = require('webpack'); + +const excludeModuleDependencyWarning = new RegExp('"export .* was not found in \'.*\''); + +function resolve (dir) { + return path.join(__dirname, '..', dir); +} + +let entry = {}, output = {}; +if (process.env.OPT_TYPE === 'dll') { + // dll打包 + entry = { + libs: config.dll.entry, + }; + output = { + path: config.dll.output, + filename: config.dll.filename, + publicPath: config.dll.publicPath, + library: '[name]', + }; +} else { + // if (process.env.NODE_ENV !== 'production') { + // threadLoader.warmup({ + // // pool options, like passed to loader options + // // must match loader options to boot the correct pool + // ...threadLoaderConfig, + // }, [ + // // modules to load + // // can be any module, i. e. + // 'babel-loader', + // 'vue-loader', + // 'ts-loader', + // 'svg-sprite-loader', + // 'url-loader', + // ]); + // } + entry = { + app: './src/main.ts', + }; + output = { + path: process.env.NODE_ENV === 'production' ? config.build.assetsRoot : config.dev.assetsRoot, + filename: '[name].js', + publicPath: process.env.NODE_ENV === 'production' + ? config.build.assetsPublicPath + : config.dev.assetsPublicPath, + }; +} +module.exports = { + context: path.resolve(__dirname, '../'), + entry, + output, + resolve: { + // 绝对路径, 查找module的话从这里开始查找(可选) + modules: [resolve('src'), 'node_modules'], + extensions: ['.ts', '.tsx', '.js', '.jsx', '.vue', '.json', '.less', '.css', '.scss'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + 'edsp-vue-ui': resolve('src/packages'), + 'package.json': resolve('package.json'), + }, + }, + optimization: { + splitChunks: { + //缓存组(配置的关键) + cacheGroups: { + commons: { + chunks: 'all',//表示从哪些chunks里面抽取代码,除了三个可选字符串值 initial、async、all 之外,还可以通过函数来过滤所需的 chunks; + minChunks: 2,//表示被引用次数,默认为1; + maxInitialRequests: 5, //最大的初始化加载次数,默认为 3; + minSize: 0, // 模块的文件体积超过 0 byte就抽取到common中 + name: true,//抽取出来文件的名字,默认为 true,表示自动生成文件名 + }, + }, + }, + }, + plugins: [ + new webpack.ProvidePlugin({ + // other modules + introJs: ['intro.js'], + }), + new FilterWarningsPlugin({ + exclude: excludeModuleDependencyWarning, + }), + new VueLoaderPlugin(), + new ProgressBarPlugin(), + ], + module: { + rules: [ + // { + // enforce: 'pre', + // test: /\.(ts|tsx)$/, + // exclude: /node_modules|.vue.ts|.vue.tsx/, + // use: ['cache-loader', { loader: 'thread-loader', ...threadLoaderConfig }, { + // loader: 'tslint-loader', + // options: vueLoaderConfig, + // }], + // }, + // { + // resourceQuery: /blockType=i18n/, + // type: 'javascript/auto', + // loader: '@kazupon/vue-i18n-loader', + // }, + { + test: /\.vue$/, + use: ['cache-loader', { loader: 'thread-loader', ...threadLoaderConfig }, { + loader: 'vue-loader', + options: vueLoaderConfig, + }], + }, + { + test: /\.tsx?$/, + exclude: /node_modules/, + use: [ + 'cache-loader', + { loader: 'thread-loader', ...threadLoaderConfig }, + 'babel-loader', + { + loader: 'ts-loader', + options: { + appendTsxSuffixTo: [/\.vue$/], + happyPackMode: true, + }, + }, + ], + }, + { + test: /\.jsx?$/, + use: ['cache-loader', { loader: 'thread-loader', ...threadLoaderConfig }, 'babel-loader'], + include: [resolve('src'), resolve('test'), resolve('node_modules/vue-echarts'), + resolve('node_modules/resize-detector')], + }, + // { + // test: /\.html$/, + // loader: 'vue-template-loader', + // include: [resolve('src', 'views')], + // }, + // { + // test: /\.scss$/, + // use: [ + // 'style-loader', // creates style nodes from JS strings + // 'css-loader', // translates CSS into CommonJS + // 'sass-loader', // compiles Sass to CSS, using Node Sass by default + // ], + // }, + { + test: /\.svg$/, + loader: 'svg-sprite-loader', + options: { + symbolId: '[name]', + }, + include: [resolve('src/assets/svg')], + }, + { + test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]'), + }, + include: [resolve('src/assets/img'), resolve('src/assets/font/iconfont'), resolve('src/packages/styles'), resolve('src/packages/images'), resolve('src/styles'), + resolve('src/components/topology/assets'), resolve('src/components/trace/trace-chart-table'), resolve('node_modules/jsoneditor/dist/img'), resolve('node_modules/edsp-gls-ui'), resolve('src/views/dynamicFlow/flow/css/font') + , resolve('node_modules/bpmn-js')], + }, + // { + // test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, + // use: [ + // 'cache-loader', { + // loader: 'url-loader', + // options: { + // limit: 10000, + // name: utils.assetsPath('media/[name].[hash:7].[ext]'), + // }, + // }, + // ], + // }, + { + test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, + loader: 'url-loader', + options: { + limit: 10000, + name: utils.assetsPath('font/[name].[hash:7].[ext]'), + }, + }, + ], + }, + node: { + // prevent webpack from injecting useless setImmediate polyfill because Vue + // source contains it (although only uses it if it's native). + setImmediate: false, + // prevent webpack from injecting mocks to Node native modules + // that does not make sense for the client + dgram: 'empty', + fs: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty', + }, +}; diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js new file mode 100644 index 0000000..a74f2ee --- /dev/null +++ b/build/webpack.dev.conf.js @@ -0,0 +1,123 @@ +'use strict'; +const path = require('path'); +const utils = require('./utils'); +const webpack = require('webpack'); +const config = require('../config'); +const merge = require('webpack-merge'); +const baseWebpackConfig = require('./webpack.base.conf'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin'); +const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin'); +const portfinder = require('portfinder'); +const address = require('address'); + +// const SpeedMeasurePlugin = require("speed-measure-webpack-plugin"); + +// const smp = new SpeedMeasurePlugin(); + +function resolve (dir) { + return path.join(__dirname, '..', dir); +} + +const HOST = process.env.HOST; +const PORT = process.env.PORT && Number(process.env.PORT); +const manifest = path.resolve(config.dll.output, 'manifest.json'); + +const devWebpackConfig = merge(baseWebpackConfig, { + mode: 'development', + module: { + rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }), + }, + // cheap-module-eval-source-map is faster for development + // devtool: config.dev.devtool, + devtool: 'eval-source-map', + + // these devServer options should be customized in /config/index.js + devServer: { + clientLogLevel: 'warning', + historyApiFallback: true, + hot: true, + inline: config.dev.inline, + compress: true, + host: HOST || config.dev.host, + port: PORT || config.dev.port, + open: config.dev.autoOpenBrowser, + overlay: config.dev.errorOverlay + ? { warnings: false, errors: true } + : false, + publicPath: config.dev.assetsPublicPath, + proxy: config.dev.proxyTable, + quiet: true, // necessary for FriendlyErrorsPlugin + watchOptions: { + poll: config.dev.poll, + }, + }, + plugins: [ + new webpack.DllReferencePlugin({ + manifest, + name: 'libs', + }), + new webpack.HotModuleReplacementPlugin(), + new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. + new webpack.NoEmitOnErrorsPlugin(), + // https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: 'index.html', + template: 'public/index.ejs', + templateParameters: { + edspDistTime: new Date().getTime() + }, + inject: true, + hash: true, + // favicon: resolve('public/favicon.ico'), + path: config.dev.assetsPublicPath + config.dev.assetsSubDirectory, + }), + new HtmlWebpackIncludeAssetsPlugin({ + assets: ['./js/libs.js'], + append: false, + hash: true, + }), + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../public'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'], + }, + { + from: config.dll.output, + to: './', + }, + ]), + ], +}); + +module.exports = new Promise((resolve, reject) => { + portfinder.basePort = process.env.PORT || config.dev.port; + portfinder.getPort((err, port) => { + if (err) { + reject(err); + } else { + // publish the new Port, necessary for e2e tests + process.env.PORT = port; + // add port to devServer config + devWebpackConfig.devServer.port = port; + + // Add FriendlyErrorsPlugin + devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ + compilationSuccessInfo: { + messages: [ + ` App running at:`, + ` - Local: http://localhost:${port}`, + ` - Network: http://${address.ip()}:${port}`, + ], + }, + onErrors: config.dev.notifyOnErrors + ? utils.createNotifierCallback() + : undefined, + })); + + resolve(devWebpackConfig); + } + }); +}); diff --git a/build/webpack.dll.conf.js b/build/webpack.dll.conf.js new file mode 100644 index 0000000..75258ad --- /dev/null +++ b/build/webpack.dll.conf.js @@ -0,0 +1,20 @@ +'use strict'; +process.env.NODE_ENV = 'production'; +process.env.OPT_TYPE = 'dll'; +const webpack = require('webpack'); +const merge = require('webpack-merge'); +const baseWebpackConfig = require('./webpack.base.conf'); +const config = require('../config'); +const path = require('path'); + +const manifest = path.resolve(config.dll.output, 'manifest.json'); + +module.exports = merge(baseWebpackConfig, { + mode: 'production', + plugins: [ + new webpack.DllPlugin({ + path: manifest, + name: '[name]_[hash]', + }), + ], +}); diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js new file mode 100644 index 0000000..77aecaa --- /dev/null +++ b/build/webpack.prod.conf.js @@ -0,0 +1,165 @@ +'use strict'; +const path = require('path'); +const utils = require('./utils'); +const webpack = require('webpack'); +const config = require('../config'); +const merge = require('webpack-merge'); +const baseWebpackConfig = require('./webpack.base.conf'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const HtmlWebpackIncludeAssetsPlugin = require('html-webpack-include-assets-plugin'); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); + +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin'); +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +const FileManagerPlugin = require('filemanager-webpack-plugin'); + +function resolve (dir) { + return path.join(__dirname, '..', dir); +} + +const manifest = path.resolve(config.dll.output, 'manifest.json'); + +const webpackConfig = merge(baseWebpackConfig, { + mode: 'production', + module: { + rules: utils.styleLoaders({ + sourceMap: config.build.productionSourceMap, + extract: true, + usePostCSS: true, + }), + }, + devtool: 'cheap-module-source-map', + output: { + path: config.build.assetsRoot, + filename: utils.assetsPath('js/[name].[chunkhash].js'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js'), + }, + plugins: [ + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + reduce_vars: true,// 把使用多次的静态值自动定义为变量 + drop_debugger: true,// 删除所有的debugger语句 + drop_console: true,// 删除所有的console语句 + }, + parallel: true, // 允许并发 + cache: true, // 开启缓存 + output: { + beautify: false // 使输出的代码尽可能紧凑 + } + }, + }), + new webpack.DllReferencePlugin({ + manifest, + name: 'libs', + }), + // extract css into its own file + new MiniCssExtractPlugin({ + filename: utils.assetsPath('css/[name].css'), + }), + // Compress extracted CSS. We are using this plugin so that possible + // duplicated CSS from different components can be deduped. + new OptimizeCSSPlugin({ + cssProcessorOptions: config.build.productionSourceMap + ? { safe: true, map: { inline: false } } + : { safe: true }, + }), + // generate dist index.html with correct asset hash for caching. + // you can customize output by editing /index.html + // see https://github.com/ampedandwired/html-webpack-plugin + new HtmlWebpackPlugin({ + filename: config.build.index, + template: 'public/index.ejs', + templateParameters: { + edspDistTime: new Date().getTime() + }, + inject: true, + hash: true, + // favicon: resolve('public/favicon.ico'), + // title: 'admin-sunline', + path: config.build.assetsPublicPath + config.build.assetsSubDirectory, + minify: { + removeComments: true, + collapseWhitespace: true, + // removeAttributeQuotes: true, + // more options: + // https://github.com/kangax/html-minifier#options-quick-reference + }, + // necessary to consistently work with multiple chunks via CommonsChunkPlugin + chunksSortMode: 'none', + }), + new HtmlWebpackIncludeAssetsPlugin({ + assets: ['js/libs.js'], + append: false, + hash: true, + }), + // copy custom public assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../public'), + to: config.build.assetsSubDirectory, + ignore: ['.*'], + }, + { + from: config.dll.output, + to: path.resolve(config.build.assetsRoot), + }, + ]), + new FileManagerPlugin({ + onEnd: [ + { + move: [ + { source: path.resolve(__dirname, '../deploy', 'font'), destination: path.resolve(__dirname, '../deploy', 'css', 'font') }, + ], + copy: [ + { source: path.resolve(__dirname, '../deploy', 'img/*.svg'), destination: path.resolve(__dirname, '../deploy', 'css', 'img') }, + ], + }, + ] + }) + ], + optimization: { + minimizer: [ + // 在 webpack@5 中,你可以使用 `...` 语法来扩展现有的 minimizer(即 `terser-webpack-plugin`),将下一行取消注释 + // `...`, + new CssMinimizerPlugin({ + parallel: true,// 多并发执行 + minimizerOptions: { + preset: [ + "default", + { + discardComments: { removeAll: true },//移除所有注释 + }, + ], + }, + }), + ], + }, +}); + +if (config.build.productionGzip) { + const CompressionWebpackPlugin = require('compression-webpack-plugin'); + + webpackConfig.plugins.push( + new CompressionWebpackPlugin({ + filename: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp( + '\\.(' + + config.build.productionGzipExtensions.join('|') + + ')$', + ), + threshold: 10240,//仅处理大于此大小的资产。以字节为单位。 + minRatio: 0.8, + }), + ); +} + +if (config.build.bundleAnalyzerReport) { + const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; + webpackConfig.plugins.push(new BundleAnalyzerPlugin()); +} + +module.exports = webpackConfig; diff --git a/config/dev.env.js b/config/dev.env.js new file mode 100644 index 0000000..54a2f97 --- /dev/null +++ b/config/dev.env.js @@ -0,0 +1,8 @@ +'use strict'; +const merge = require('webpack-merge'); +const prodEnv = require('./prod.env'); + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"', + BASE_API: '"/api"', +}); diff --git a/config/dllEntry.json b/config/dllEntry.json new file mode 100644 index 0000000..b362198 --- /dev/null +++ b/config/dllEntry.json @@ -0,0 +1,41 @@ +[ + "@ant-design/dark-theme", + "@chenfengyuan/vue-countdown", + "@riophae/vue-treeselect", + "ant-design-vue", + "axios", + "bluebird", + "byt", + "d3", + "d3-tip", + "dayjs", + "echarts", + "element-ui", + "file-saver", + "isomorphic-fetch", + "jquery", + "jwt-builder", + "jwt-decode", + "lodash", + "memoize-one", + "mockjs", + "moment", + "nprogress", + "popper.js", + "pretty-bytes", + "prop-types", + "query-string", + "screenfull", + "vee-validate", + "vue", + "vue-class-component", + "vue-clipboard2", + "vue-codemirror", + "vue-highlight-words", + "vue-i18n", + "vue-property-decorator", + "vue-router", + "vue-tsx-support", + "vuex", + "vuex-class" +] diff --git a/config/index.js b/config/index.js new file mode 100644 index 0000000..3c91d2f --- /dev/null +++ b/config/index.js @@ -0,0 +1,131 @@ +'use strict'; +// Template version: 1.2.6 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path'); +const version = require('../src/Controls.json').version; +const proxyJson = require('../src/proxy.json'); +const dllEntry = require('./dllEntry.json'); +function resolve (dir) { + return path.join(__dirname, '.', dir); +} +// 获取代理 +function getProxy (proxyJson, version) { + const devServerProxy = {}; + proxyJson.forEach(function (item) { + let proxyUrl = ''; + if (item.proxyUrl === '/loader' || item.notVersion) { + // 不需要带版本号 + // 壳子服务不需要版本 + proxyUrl = item.proxyUrl; + } else { + proxyUrl = item.proxyUrl + '/' + version; + } + devServerProxy[proxyUrl] = { + target: item.targetApi, + ws: item.protocol === 'ws://', + changeOrigin: item.changeOrigin, + secure: false, + }; + if (!item.notPathRewrite) { + if (item.pathRewrite) { + devServerProxy[proxyUrl]['pathRewrite'] = item.pathRewrite; + } else { + devServerProxy[proxyUrl]['pathRewrite'] = {}; + devServerProxy[proxyUrl]['pathRewrite'][proxyUrl] = ''; + } + } + }); + return devServerProxy; +} + +module.exports = { + dev: { + // Paths + assetsRoot: path.resolve(__dirname, '../'), + assetsSubDirectory: '', + assetsPublicPath: '/', + proxyTable: getProxy(proxyJson, version), // 代理 + inline: true, // 是否热部署 + // Various Dev Server settings + host: '0.0.0.0', // can be overwritten by process.env.HOST + // host: 'localhost', // can be overwritten by process.env.HOST + port: 9080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: false, + errorOverlay: true, + notifyOnErrors: false, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + // Use Eslint Loader? + // If true, your code will be linted during bundling and + // linting errors and warnings will be shown in the console. + useEslint: true, + // If true, eslint errors and warnings will also be shown in the error overlay + // in the browser. + showEslintErrorsInOverlay: false, + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: '#source-map', + + // If you have problems debugging vue-files in devtools, + // set this to false - it *may* help + // https://vue-loader.vuejs.org/en/options.html#cachebusting + cacheBusting: true, + + // CSS Sourcemaps off by default because relative paths are "buggy" + // with this option, according to the CSS-Loader README + // (https://github.com/webpack/css-loader#sourcemaps) + // In our experience, they generally work as expected, + // just be aware of this issue when enabling this option. + cssSourceMap: true, + }, + + dll: { + filename: './js/[name].js', // 文件名 + publicPath: '/', // 公共目录 + entry: dllEntry, // 入口 + output: path.resolve(__dirname, '../vendor'), // 出口 + }, + + build: { + entry: path.resolve(__dirname, '../src/main.js'), // 入口 + output: path.resolve(__dirname, '../deploy'), // 出口 + // Template for index.html + index: path.resolve(__dirname, '../deploy/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../deploy'), + assetsSubDirectory: '', + + // you can set by youself according to actual condition + assetsPublicPath: './', + // Use Eslint Loader? + // If true, your code will be linted during bundling and + // linting errors and warnings will be shown in the console. + useEslint: true, + /** + * Source Maps + */ + + productionSourceMap: false, + // https://webpack.js.org/configuration/devtool/#production + devtool: 'nosources-source-map', + + // Gzip off by default as many popular public hosts such as + // Surge or Netlify already gzip all public assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: true, + productionGzipExtensions: ['js', 'css', 'html', 'svg', 'txt', 'eot', 'otf', 'ttf', 'gif'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report, + }, +}; diff --git a/config/prod.env.js b/config/prod.env.js new file mode 100644 index 0000000..c3dad8f --- /dev/null +++ b/config/prod.env.js @@ -0,0 +1,5 @@ +'use strict'; +module.exports = { + NODE_ENV: '"production"', + BASE_API: '"/api"', +}; diff --git a/package-lock.json b/package-lock.json index 4866c51..d113344 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1071,6 +1071,39 @@ "integrity": "sha1-K1o6s/kYzKSKjHVMCBaOPwPrphs=", "dev": true }, + "@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/@npmcli/move-file/download/@npmcli/move-file-1.1.2.tgz", + "integrity": "sha1-GoLD43L3yuklPrZtclQ9a4aFxnQ=", + "dev": true, + "requires": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz", + "integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1591175021598&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz", + "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "@polka/url": { + "version": "1.0.0-next.15", + "resolved": "https://registry.nlark.com/@polka/url/download/@polka/url-1.0.0-next.15.tgz", + "integrity": "sha1-ap0UP39PSdsteC+eHIg5optDriM=", + "dev": true + }, "@soda/friendly-errors-webpack-plugin": { "version": "1.7.1", "resolved": "https://registry.npm.taobao.org/@soda/friendly-errors-webpack-plugin/download/@soda/friendly-errors-webpack-plugin-1.7.1.tgz", @@ -1479,6 +1512,16 @@ "path-exists": "^4.0.0" } }, + "gzip-size": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/gzip-size/download/gzip-size-5.1.1.tgz?cache=0&sync_timestamp=1605523244597&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fgzip-size%2Fdownload%2Fgzip-size-5.1.1.tgz", + "integrity": "sha1-y5vuaS+HwGErIyhAqHOQTkwTUnQ=", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "pify": "^4.0.1" + } + }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", @@ -1559,6 +1602,27 @@ "terser": "^4.6.12", "webpack-sources": "^1.4.3" } + }, + "webpack-bundle-analyzer": { + "version": "3.9.0", + "resolved": "https://registry.nlark.com/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.9.0.tgz?cache=0&sync_timestamp=1621259099265&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-3.9.0.tgz", + "integrity": "sha1-9vlNsQj7V05BWtMT3kGicH0z7zw=", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1", + "bfj": "^6.1.1", + "chalk": "^2.4.1", + "commander": "^2.18.0", + "ejs": "^2.6.1", + "express": "^4.16.3", + "filesize": "^3.6.1", + "gzip-size": "^5.0.0", + "lodash": "^4.17.19", + "mkdirp": "^0.5.1", + "opener": "^1.5.1", + "ws": "^6.0.0" + } } } }, @@ -3271,6 +3335,178 @@ } } }, + "compression-webpack-plugin": { + "version": "5.0.1", + "resolved": "https://registry.nlark.com/compression-webpack-plugin/download/compression-webpack-plugin-5.0.1.tgz?cache=0&sync_timestamp=1624626650884&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcompression-webpack-plugin%2Fdownload%2Fcompression-webpack-plugin-5.0.1.tgz", + "integrity": "sha1-MWwaTkzMlFEKl4yWf8FDWB0eNkM=", + "dev": true, + "requires": { + "cacache": "^15.0.5", + "find-cache-dir": "^3.3.1", + "schema-utils": "^2.7.0", + "serialize-javascript": "^4.0.0", + "webpack-sources": "^1.4.3" + }, + "dependencies": { + "cacache": { + "version": "15.2.0", + "resolved": "https://registry.nlark.com/cacache/download/cacache-15.2.0.tgz?cache=0&sync_timestamp=1621949655085&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcacache%2Fdownload%2Fcacache-15.2.0.tgz", + "integrity": "sha1-c69193xY5y2MYwp6KFjLGO9SM4k=", + "dev": true, + "requires": { + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + } + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/chownr/download/chownr-2.0.0.tgz", + "integrity": "sha1-Fb++U9LqtM9w8YqM1o6+Wzyx3s4=", + "dev": true + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz", + "integrity": "sha1-ibM/rUpGcNqpT4Vff74x1thP6IA=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz?cache=0&sync_timestamp=1597169882796&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-up%2Fdownload%2Ffind-up-4.1.0.tgz", + "integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", + "integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-6.0.0.tgz?cache=0&sync_timestamp=1599054167787&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flru-cache%2Fdownload%2Flru-cache-6.0.0.tgz", + "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz", + "integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz", + "integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=", + "dev": true + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz", + "integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.nlark.com/p-map/download/p-map-4.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fp-map%2Fdownload%2Fp-map-4.0.0.tgz", + "integrity": "sha1-uy+Vpe2i7BaOySdOBqdHw+KQTSs=", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz", + "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz?cache=0&sync_timestamp=1602858985920&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpkg-dir%2Fdownload%2Fpkg-dir-4.2.0.tgz", + "integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1591175021598&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz", + "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz", + "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "dev": true + }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.nlark.com/serialize-javascript/download/serialize-javascript-4.0.0.tgz", + "integrity": "sha1-tSXhI4SJpez8Qq+sw/6Z5mb0sao=", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "ssri": { + "version": "8.0.1", + "resolved": "https://registry.nlark.com/ssri/download/ssri-8.0.1.tgz?cache=0&sync_timestamp=1621364668574&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fssri%2Fdownload%2Fssri-8.0.1.tgz", + "integrity": "sha1-Y45OQ54v+9LNKJd21cpFfE9Roq8=", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz", + "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=", + "dev": true + } + } + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz", @@ -3638,6 +3874,234 @@ } } }, + "css-minimizer-webpack-plugin": { + "version": "1.0.0", + "resolved": "https://registry.nlark.com/css-minimizer-webpack-plugin/download/css-minimizer-webpack-plugin-1.0.0.tgz?cache=0&sync_timestamp=1624621647030&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcss-minimizer-webpack-plugin%2Fdownload%2Fcss-minimizer-webpack-plugin-1.0.0.tgz", + "integrity": "sha1-10ySkbFvIhWsppcXlTdolUS+Uhw=", + "dev": true, + "requires": { + "cacache": "^15.0.5", + "cssnano": "^4.1.10", + "find-cache-dir": "^3.3.1", + "jest-worker": "^26.2.0", + "p-limit": "^3.0.2", + "schema-utils": "^2.7.0", + "serialize-javascript": "^4.0.0", + "source-map": "^0.6.1", + "webpack-sources": "^1.4.3" + }, + "dependencies": { + "cacache": { + "version": "15.2.0", + "resolved": "https://registry.nlark.com/cacache/download/cacache-15.2.0.tgz?cache=0&sync_timestamp=1621949655085&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcacache%2Fdownload%2Fcacache-15.2.0.tgz", + "integrity": "sha1-c69193xY5y2MYwp6KFjLGO9SM4k=", + "dev": true, + "requires": { + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + } + }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/chownr/download/chownr-2.0.0.tgz", + "integrity": "sha1-Fb++U9LqtM9w8YqM1o6+Wzyx3s4=", + "dev": true + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-3.3.1.tgz", + "integrity": "sha1-ibM/rUpGcNqpT4Vff74x1thP6IA=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz?cache=0&sync_timestamp=1597169882796&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-up%2Fdownload%2Ffind-up-4.1.0.tgz", + "integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.nlark.com/jest-worker/download/jest-worker-26.6.2.tgz", + "integrity": "sha1-f3LLxNZDw2Xie5/XdfnQ6qnHqO0=", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", + "integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-6.0.0.tgz?cache=0&sync_timestamp=1599054167787&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flru-cache%2Fdownload%2Flru-cache-6.0.0.tgz", + "integrity": "sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ=", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz", + "integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz", + "integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=", + "dev": true + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-3.1.0.tgz?cache=0&sync_timestamp=1606290276843&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-3.1.0.tgz", + "integrity": "sha1-4drMvnjQ0TiMoYxk/qOOPlfjcGs=", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz", + "integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + }, + "dependencies": { + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1606290276843&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz", + "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + } + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.nlark.com/p-map/download/p-map-4.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fp-map%2Fdownload%2Fp-map-4.0.0.tgz", + "integrity": "sha1-uy+Vpe2i7BaOySdOBqdHw+KQTSs=", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz", + "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz?cache=0&sync_timestamp=1602858985920&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpkg-dir%2Fdownload%2Fpkg-dir-4.2.0.tgz", + "integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1591175021598&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz", + "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz", + "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "dev": true + }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.nlark.com/serialize-javascript/download/serialize-javascript-4.0.0.tgz", + "integrity": "sha1-tSXhI4SJpez8Qq+sw/6Z5mb0sao=", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + }, + "ssri": { + "version": "8.0.1", + "resolved": "https://registry.nlark.com/ssri/download/ssri-8.0.1.tgz?cache=0&sync_timestamp=1621364668574&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fssri%2Fdownload%2Fssri-8.0.1.tgz", + "integrity": "sha1-Y45OQ54v+9LNKJd21cpFfE9Roq8=", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1626703414084&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", + "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz", + "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=", + "dev": true + } + } + }, "css-select": { "version": "2.1.0", "resolved": "https://registry.npm.taobao.org/css-select/download/css-select-2.1.0.tgz", @@ -4265,9 +4729,9 @@ "dev": true }, "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npm.taobao.org/duplexer/download/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/duplexer/download/duplexer-0.1.2.tgz", + "integrity": "sha1-Or5DrvODX4rgd9E23c4PJ2sEAOY=", "dev": true }, "duplexify": { @@ -5103,7 +5567,7 @@ }, "filesize": { "version": "3.6.1", - "resolved": "https://registry.npm.taobao.org/filesize/download/filesize-3.6.1.tgz", + "resolved": "https://registry.nlark.com/filesize/download/filesize-3.6.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffilesize%2Fdownload%2Ffilesize-3.6.1.tgz", "integrity": "sha1-CQuz7gG2+AGoqL6Z0xcQs0Irsxc=", "dev": true }, @@ -5435,13 +5899,12 @@ "integrity": "sha1-Ila94U02MpWMRl68ltxGfKB6Kfs=" }, "gzip-size": { - "version": "5.1.1", - "resolved": "https://registry.npm.taobao.org/gzip-size/download/gzip-size-5.1.1.tgz", - "integrity": "sha1-y5vuaS+HwGErIyhAqHOQTkwTUnQ=", + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/gzip-size/download/gzip-size-6.0.0.tgz?cache=0&sync_timestamp=1605523244597&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fgzip-size%2Fdownload%2Fgzip-size-6.0.0.tgz", + "integrity": "sha1-BlNn/VDCOcBnHLy61b4+LusQ5GI=", "dev": true, "requires": { - "duplexer": "^0.1.1", - "pify": "^4.0.1" + "duplexer": "^0.1.2" } }, "handle-thing": { @@ -7140,6 +7603,24 @@ "minipass": "^3.0.0" } }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.nlark.com/minizlib/download/minizlib-2.1.2.tgz", + "integrity": "sha1-6Q00Zrogm5MkUVCKEc49NjIUWTE=", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz", + "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=", + "dev": true + } + } + }, "mississippi": { "version": "3.0.0", "resolved": "https://registry.npm.taobao.org/mississippi/download/mississippi-3.0.0.tgz", @@ -7602,9 +8083,9 @@ } }, "opener": { - "version": "1.5.1", - "resolved": "https://registry.npm.taobao.org/opener/download/opener-1.5.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fopener%2Fdownload%2Fopener-1.5.1.tgz", - "integrity": "sha1-bS8Od/GgrwAyrKcWwsH7uOfoq+0=", + "version": "1.5.2", + "resolved": "https://registry.npm.taobao.org/opener/download/opener-1.5.2.tgz", + "integrity": "sha1-XTfh81B3udysQwE3InGv3rKhNZg=", "dev": true }, "opn": { @@ -9449,6 +9930,17 @@ } } }, + "sirv": { + "version": "1.0.12", + "resolved": "https://registry.nlark.com/sirv/download/sirv-1.0.12.tgz", + "integrity": "sha1-2BbIgrNUibPGMpDi9FWuPszV9lI=", + "dev": true, + "requires": { + "@polka/url": "^1.0.0-next.15", + "mime": "^2.3.1", + "totalist": "^1.0.0" + } + }, "slash": { "version": "2.0.0", "resolved": "https://registry.npm.taobao.org/slash/download/slash-2.0.0.tgz", @@ -10088,6 +10580,40 @@ "integrity": "sha1-ofzMBrWNth/XpF2i2kT186Pme6I=", "dev": true }, + "tar": { + "version": "6.1.8", + "resolved": "https://registry.nlark.com/tar/download/tar-6.1.8.tgz?cache=0&sync_timestamp=1628724927194&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftar%2Fdownload%2Ftar-6.1.8.tgz", + "integrity": "sha1-T8UM/lZRHFOM4Vtx4F7r5mUwy9Q=", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/chownr/download/chownr-2.0.0.tgz", + "integrity": "sha1-Fb++U9LqtM9w8YqM1o6+Wzyx3s4=", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.4.tgz", + "integrity": "sha1-PrXtYmInVteaXw4qIh3+utdcL34=", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-4.0.0.tgz", + "integrity": "sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=", + "dev": true + } + } + }, "terser": { "version": "4.8.0", "resolved": "https://registry.npm.taobao.org/terser/download/terser-4.8.0.tgz?cache=0&sync_timestamp=1592448394415&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser%2Fdownload%2Fterser-4.8.0.tgz", @@ -10300,6 +10826,12 @@ "integrity": "sha1-LmhELZ9k7HILjMieZEOsbKqVACk=", "dev": true }, + "totalist": { + "version": "1.1.0", + "resolved": "https://registry.nlark.com/totalist/download/totalist-1.1.0.tgz", + "integrity": "sha1-pNZaPlRlF3AePlw3pHpwrJf+Vt8=", + "dev": true + }, "tough-cookie": { "version": "2.5.0", "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz", @@ -10400,6 +10932,54 @@ } } }, + "uglifyjs-webpack-plugin": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/uglifyjs-webpack-plugin/download/uglifyjs-webpack-plugin-2.2.0.tgz", + "integrity": "sha1-51vIDn8ZN/cllUybTFoeln6p0Nc=", + "dev": true, + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^1.7.0", + "source-map": "^0.6.1", + "uglify-js": "^3.6.0", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "dependencies": { + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.nlark.com/schema-utils/download/schema-utils-1.0.0.tgz?cache=0&sync_timestamp=1626694740261&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fschema-utils%2Fdownload%2Fschema-utils-1.0.0.tgz", + "integrity": "sha1-C3mpMgTXtgDUsoUNH2bCo0lRx3A=", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "serialize-javascript": { + "version": "1.9.1", + "resolved": "https://registry.nlark.com/serialize-javascript/download/serialize-javascript-1.9.1.tgz", + "integrity": "sha1-z8IArvd7YAxH2pu4FJyUPnmML9s=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + }, + "uglify-js": { + "version": "3.14.1", + "resolved": "https://registry.nlark.com/uglify-js/download/uglify-js-3.14.1.tgz?cache=0&sync_timestamp=1627379738025&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fuglify-js%2Fdownload%2Fuglify-js-3.14.1.tgz", + "integrity": "sha1-4suf4025y0z3410dJt/qKOCafQY=", + "dev": true + } + } + }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npm.taobao.org/unicode-canonical-property-names-ecmascript/download/unicode-canonical-property-names-ecmascript-1.0.4.tgz", @@ -11004,30 +11584,93 @@ } }, "webpack-bundle-analyzer": { - "version": "3.8.0", - "resolved": "https://registry.npm.taobao.org/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.8.0.tgz", - "integrity": "sha1-zms/kI2vBp/R9yZvaSy7O97ZuhY=", + "version": "4.4.2", + "resolved": "https://registry.nlark.com/webpack-bundle-analyzer/download/webpack-bundle-analyzer-4.4.2.tgz?cache=0&sync_timestamp=1621259099265&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-4.4.2.tgz", + "integrity": "sha1-OYmM9iABeCQJENYpcF8PNJP31mY=", "dev": true, "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1", - "bfj": "^6.1.1", - "chalk": "^2.4.1", - "commander": "^2.18.0", - "ejs": "^2.6.1", - "express": "^4.16.3", - "filesize": "^3.6.1", - "gzip-size": "^5.0.0", - "lodash": "^4.17.15", - "mkdirp": "^0.5.1", - "opener": "^1.5.1", - "ws": "^6.0.0" + "acorn": "^8.0.4", + "acorn-walk": "^8.0.0", + "chalk": "^4.1.0", + "commander": "^6.2.0", + "gzip-size": "^6.0.0", + "lodash": "^4.17.20", + "opener": "^1.5.2", + "sirv": "^1.0.7", + "ws": "^7.3.1" }, "dependencies": { "acorn": { - "version": "7.3.1", - "resolved": "https://registry.npm.taobao.org/acorn/download/acorn-7.3.1.tgz?cache=0&sync_timestamp=1591869439113&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-7.3.1.tgz", - "integrity": "sha1-hQEHVNtTw/uvO56j4IOqXF0Uf/0=", + "version": "8.4.1", + "resolved": "https://registry.nlark.com/acorn/download/acorn-8.4.1.tgz", + "integrity": "sha1-VsNiUfx8q8cJatwY8Fr+gUMhoow=", + "dev": true + }, + "acorn-walk": { + "version": "8.1.1", + "resolved": "https://registry.nlark.com/acorn-walk/download/acorn-walk-8.1.1.tgz?cache=0&sync_timestamp=1624951990736&other_urls=https%3A%2F%2Fregistry.nlark.com%2Facorn-walk%2Fdownload%2Facorn-walk-8.1.1.tgz", + "integrity": "sha1-Pdq3+E5KfiMT9sQUxbfayF9OPrw=", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz", + "integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz", + "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "commander": { + "version": "6.2.1", + "resolved": "https://registry.nlark.com/commander/download/commander-6.2.1.tgz?cache=0&sync_timestamp=1627358203890&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcommander%2Fdownload%2Fcommander-6.2.1.tgz", + "integrity": "sha1-B5LraC37wyWZm7K4T93duhEKxzw=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1626703414084&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz", + "integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "ws": { + "version": "7.5.3", + "resolved": "https://registry.nlark.com/ws/download/ws-7.5.3.tgz?cache=0&sync_timestamp=1627496096076&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fws%2Fdownload%2Fws-7.5.3.tgz", + "integrity": "sha1-Fgg1tjx9l7+rQY/BuKn87SrAGnQ=", "dev": true } } @@ -11608,6 +12251,12 @@ "decamelize": "^1.2.0" } }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npm.taobao.org/yocto-queue/download/yocto-queue-0.1.0.tgz?cache=0&sync_timestamp=1606290282107&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyocto-queue%2Fdownload%2Fyocto-queue-0.1.0.tgz", + "integrity": "sha1-ApTrPe4FAo0x7hpfosVWpqrxChs=", + "dev": true + }, "yorkie": { "version": "2.0.0", "resolved": "https://registry.npm.taobao.org/yorkie/download/yorkie-2.0.0.tgz", diff --git a/package.json b/package.json index 48cc4a9..c9bc964 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,13 @@ "@vue/cli-plugin-eslint": "~4.4.0", "@vue/cli-service": "~4.4.0", "babel-eslint": "^10.1.0", + "compression-webpack-plugin": "^5.0.1", + "css-minimizer-webpack-plugin": "^1.0.0", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", - "vue-template-compiler": "^2.6.11" + "uglifyjs-webpack-plugin": "^2.2.0", + "vue-template-compiler": "^2.6.11", + "webpack-bundle-analyzer": "^4.4.2" }, "eslintConfig": { "root": true, diff --git a/public/index.html b/public/index.html index d2e66e8..8576aa3 100644 --- a/public/index.html +++ b/public/index.html @@ -17,7 +17,7 @@ Please enable it to continue.
- + \ No newline at end of file diff --git a/src/components/mouseHover.html b/src/components/mouseHover.html new file mode 100644 index 0000000..872e2f4 --- /dev/null +++ b/src/components/mouseHover.html @@ -0,0 +1,201 @@ + + + + + Hover icons example for mxGraph + + + + + + + + + + + + + + + + +
+
+ + + \ No newline at end of file diff --git a/stats.json b/stats.json new file mode 100644 index 0000000..660301c --- /dev/null +++ b/stats.json @@ -0,0 +1,2 @@ +Installing 'webpack-cli' (running 'yarn add -D webpack-cli')... +ֹ(Y/N)? yarn add v1.22.4 diff --git a/vue.config.js b/vue.config.js index fd8dfae..21966e5 100644 --- a/vue.config.js +++ b/vue.config.js @@ -3,11 +3,73 @@ const path = require('path'); function resolve (dir) { return path.join(__dirname, dir); } - +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; +const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); +const CompressionWebpackPlugin = require('compression-webpack-plugin'); +const productionGzipExtensions = ['js', 'css', 'html'] module.exports = { publicPath: './', outputDir: 'dist', lintOnSave: true, + configureWebpack: { + plugins: [ + new BundleAnalyzerPlugin(), + new CompressionWebpackPlugin({ + filename: '[path].gz[query]', + algorithm: 'gzip', + test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$',), + threshold: 10240,//仅处理大于此大小的资产。以字节为单位。 + minRatio: 0.8, + }), + ], + optimization: { + splitChunks: { + chunks: 'all', + name: false, + minSize: 0, + cacheGroups: { + defaultVendors: { + test: /[\\/]node_modules[\\/]/, + priority: -10 + }, + default: { + minChunks: 2, + priority: -20, + reuseExistingChunk: true + } + } + }, + minimizer: [new UglifyJsPlugin( + { + uglifyOptions: { + compress: { + reduce_vars: true,// 把使用多次的静态值自动定义为变量 + drop_debugger: true,// 删除所有的debugger语句 + drop_console: true,// 删除所有的console语句 + }, + parallel: true, // 允许并发 + cache: true, // 开启缓存 + output: { + beautify: false // 使输出的代码尽可能紧凑 + } + }, + } + ), + new CssMinimizerPlugin({ + parallel: true,// 多并发执行 + minimizerOptions: { + preset: [ + "default", + { + discardComments: { removeAll: true },//移除所有注释 + }, + ], + }, + })], + + }, + }, chainWebpack: (config) => { config.module .rule('') @@ -23,6 +85,6 @@ module.exports = { .set('@', resolve('src')) .set('@assets', resolve('src/assets')); // 按这种格式.set('', resolve('')) 自己添加 - } + }, }; diff --git a/web-serve/app.js b/web-serve/app.js new file mode 100644 index 0000000..1fc1878 --- /dev/null +++ b/web-serve/app.js @@ -0,0 +1,59 @@ +const express = require('express'); +// 代理 +// const proxy = require('http-proxy-middleware'); +// 服务端压缩gzip +// var compression = require('compression'); +// webpack打包好gzip文件 +const expressStaticGzip = require('express-static-gzip'); +const app = express(); +// 启用服务端压缩gzip +// app.use(compression()); +app.use( + expressStaticGzip('../dist', { + maxAge: '3d', + setHeaders: setCustomCacheControl, + }) +); + +function setCustomCacheControl (res, currentFilePath) { + if (currentFilePath.match(/\index\.html$/)) { + // Custom Cache-Control for HTML files + res.setHeader('Cache-Control', 'no-cache'); + } +} + +app.use(express.static('../deploy')); + +// const PROXY_EDSP = process.env.PROXY_EDSP || 'http://10.22.0.137:31801/edsp'; +const PROXY_EDSP = 'http://10.22.0.137:31801/edsp'; +const PROXY_LOADER = process.env.PROXY_LOADER || 'http://10.22.0.230:8080'; + +console.log('PROXY_EDSP: ', PROXY_EDSP); +console.log('PROXY_LOADER: ', PROXY_LOADER); +// 代理 +// app.use( +// '/edsp', +// proxy({ +// target: PROXY_EDSP, +// pathRewrite: { +// '/edsp': '', +// }, +// changeOrigin: true, +// }), +// ); +// app.use( +// '/loader', +// proxy({ +// target: PROXY_LOADER, +// pathRewrite: { +// '/loader': '', +// }, +// changeOrigin: true, +// }), +// ); + +app.listen(9900, (req, res) => { + console.log(req, res); + console.log('启动成功,请通过localhost:9900访问'); +}); + diff --git a/web-serve/package-lock.json b/web-serve/package-lock.json new file mode 100644 index 0000000..10b244f --- /dev/null +++ b/web-serve/package-lock.json @@ -0,0 +1,527 @@ +{ + "name": "-y", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/http-proxy": { + "version": "1.17.7", + "resolved": "https://registry.nlark.com/@types/http-proxy/download/@types/http-proxy-1.17.7.tgz", + "integrity": "sha1-MOqFzCyGg2g1Kjfw0NNYHiSDTG8=", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "16.6.0", + "resolved": "https://registry.nlark.com/@types/node/download/@types/node-16.6.0.tgz?cache=0&sync_timestamp=1628719497956&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-16.6.0.tgz", + "integrity": "sha1-DVaF+FBm+U6X8Z6KZ/4APF+trMQ=" + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npm.taobao.org/accepts/download/accepts-1.3.7.tgz", + "integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/array-flatten/download/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npm.taobao.org/body-parser/download/body-parser-1.19.0.tgz", + "integrity": "sha1-lrJwnlfJxOCab9Zqj9l5hE9p8Io=", + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "requires": { + "fill-range": "^7.0.1" + } + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.1.0.tgz", + "integrity": "sha1-9s95M6Ng4FiPqf3oVlHNx/gF0fY=" + }, + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npm.taobao.org/compressible/download/compressible-2.0.18.tgz", + "integrity": "sha1-r1PMprBw1MPAdQ+9dyhqbXzEb7o=", + "requires": { + "mime-db": ">= 1.43.0 < 2" + } + }, + "compression": { + "version": "1.7.4", + "resolved": "https://registry.npm.taobao.org/compression/download/compression-1.7.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcompression%2Fdownload%2Fcompression-1.7.4.tgz", + "integrity": "sha1-lVI+/xcMpXwpoMpB5v4TH0Hlu48=", + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "dependencies": { + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + } + } + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npm.taobao.org/content-disposition/download/content-disposition-0.5.3.tgz", + "integrity": "sha1-4TDK9+cnkIfFYWwgB9BIVpiYT70=", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/content-type/download/content-type-1.0.4.tgz", + "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=" + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npm.taobao.org/cookie/download/cookie-0.4.0.tgz?cache=0&sync_timestamp=1599054117231&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcookie%2Fdownload%2Fcookie-0.4.0.tgz", + "integrity": "sha1-vrQ35wIrO21JAZ0IhmUwPr6cFLo=" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npm.taobao.org/cookie-signature/download/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.nlark.com/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1625374675284&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npm.taobao.org/etag/download/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npm.taobao.org/eventemitter3/download/eventemitter3-4.0.7.tgz?cache=0&sync_timestamp=1598517714257&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feventemitter3%2Fdownload%2Feventemitter3-4.0.7.tgz", + "integrity": "sha1-Lem2j2Uo1WRO9cWVJqG0oHMGFp8=" + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npm.taobao.org/express/download/express-4.17.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpress%2Fdownload%2Fexpress-4.17.1.tgz", + "integrity": "sha1-RJH8OGBc9R+GKdOcK10Cb5ikwTQ=", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "express-static-gzip": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/express-static-gzip/download/express-static-gzip-2.1.1.tgz", + "integrity": "sha1-7joOyj8QNIvNIUCV+7RvjQ+MtHE=", + "requires": { + "serve-static": "^1.14.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/finalhandler/download/finalhandler-1.1.2.tgz", + "integrity": "sha1-t+fQAP/RGTjQ/bBTUG9uur6fWH0=", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + } + }, + "follow-redirects": { + "version": "1.14.1", + "resolved": "https://registry.nlark.com/follow-redirects/download/follow-redirects-1.14.1.tgz?cache=0&sync_timestamp=1620555300559&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.14.1.tgz", + "integrity": "sha1-2RFN7Qoc/dM04WTmZirQK/2R/0M=" + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.nlark.com/forwarded/download/forwarded-0.2.0.tgz?cache=0&sync_timestamp=1622503408398&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fforwarded%2Fdownload%2Fforwarded-0.2.0.tgz", + "integrity": "sha1-ImmTZCiq1MFcfr6XeahL8LKoGBE=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npm.taobao.org/fresh/download/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npm.taobao.org/http-errors/download/http-errors-1.7.2.tgz", + "integrity": "sha1-T1ApzxMjnzEDblsuVSkrz7zIXI8=", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npm.taobao.org/http-proxy/download/http-proxy-1.18.1.tgz", + "integrity": "sha1-QBVB8FNIhLv5UmAzTnL4juOXZUk=", + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-middleware": { + "version": "2.0.1", + "resolved": "https://registry.nlark.com/http-proxy-middleware/download/http-proxy-middleware-2.0.1.tgz", + "integrity": "sha1-fvNBekeft2ZqVx4Jlmxmo5vSwV8=", + "requires": { + "@types/http-proxy": "^1.17.5", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.1", + "is-plain-obj": "^3.0.0", + "micromatch": "^4.0.2" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.nlark.com/iconv-lite/download/iconv-lite-0.4.24.tgz", + "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.nlark.com/ipaddr.js/download/ipaddr.js-1.9.1.tgz", + "integrity": "sha1-v/OFQ+64mEglB5/zoqjmy9RngbM=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz", + "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=" + }, + "is-plain-obj": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/is-plain-obj/download/is-plain-obj-3.0.0.tgz?cache=0&sync_timestamp=1618600489644&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-plain-obj%2Fdownload%2Fis-plain-obj-3.0.0.tgz", + "integrity": "sha1-r28uoUrFpkYYOlu9tbqrvBVq2dc=" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/merge-descriptors/download/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/methods/download/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.nlark.com/micromatch/download/micromatch-4.0.4.tgz", + "integrity": "sha1-iW1Rnf6dsl/OlM63pQCRm/iB6/k=", + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npm.taobao.org/mime/download/mime-1.6.0.tgz", + "integrity": "sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE=" + }, + "mime-db": { + "version": "1.49.0", + "resolved": "https://registry.nlark.com/mime-db/download/mime-db-1.49.0.tgz", + "integrity": "sha1-89/eYMmenPO8lwHWh3ePU3ABy+0=" + }, + "mime-types": { + "version": "2.1.32", + "resolved": "https://registry.nlark.com/mime-types/download/mime-types-2.1.32.tgz?cache=0&sync_timestamp=1627407652875&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fmime-types%2Fdownload%2Fmime-types-2.1.32.tgz", + "integrity": "sha1-HQDonn3n/gIAjbYQAdngKFJnD9U=", + "requires": { + "mime-db": "1.49.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz?cache=0&sync_timestamp=1607433842694&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npm.taobao.org/negotiator/download/negotiator-0.6.2.tgz", + "integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/on-headers/download/on-headers-1.0.2.tgz", + "integrity": "sha1-dysK5qqlJcOZ5Imt+tkMQD6zwo8=" + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npm.taobao.org/parseurl/download/parseurl-1.3.3.tgz", + "integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.nlark.com/picomatch/download/picomatch-2.3.0.tgz?cache=0&sync_timestamp=1621648246651&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fpicomatch%2Fdownload%2Fpicomatch-2.3.0.tgz", + "integrity": "sha1-8fBh3o9qS/AiiS4tEoI0+5gwKXI=" + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.nlark.com/proxy-addr/download/proxy-addr-2.0.7.tgz", + "integrity": "sha1-8Z/mnOqzEe65S0LnDowgcPm6ECU=", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.7.0.tgz?cache=0&sync_timestamp=1616385281714&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.7.0.tgz", + "integrity": "sha1-QdwaAV49WB8WIXdr4xr7KHapsbw=" + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npm.taobao.org/range-parser/download/range-parser-1.2.1.tgz", + "integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE=" + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npm.taobao.org/raw-body/download/raw-body-2.4.0.tgz", + "integrity": "sha1-oc5vucm8NWylLoklarWQWeE9AzI=", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/requires-port/download/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz", + "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz", + "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=" + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npm.taobao.org/send/download/send-0.17.1.tgz", + "integrity": "sha1-wdiwWfeQD3Rm3Uk4vcROEd2zdsg=", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.1.tgz?cache=0&sync_timestamp=1607433842694&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.1.tgz", + "integrity": "sha1-MKWGTrPrsKZvLr5tcnrwagnYbgo=" + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npm.taobao.org/serve-static/download/serve-static-1.14.1.tgz", + "integrity": "sha1-Zm5jbcTwEPfvKZcKiKZ0MgiYsvk=", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.1.1.tgz", + "integrity": "sha1-fpWsskqpL1iF4KvvW6ExMw1K5oM=" + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npm.taobao.org/statuses/download/statuses-1.5.0.tgz?cache=0&sync_timestamp=1609654014762&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstatuses%2Fdownload%2Fstatuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/toidentifier/download/toidentifier-1.0.0.tgz", + "integrity": "sha1-fhvjRw8ed5SLxD2Uo8j013UrpVM=" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npm.taobao.org/type-is/download/type-is-1.6.18.tgz", + "integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + } + } +} diff --git a/web-serve/package.json b/web-serve/package.json new file mode 100644 index 0000000..a50784b --- /dev/null +++ b/web-serve/package.json @@ -0,0 +1,17 @@ +{ + "name": "-y", + "version": "1.0.0", + "description": "", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "compression": "^1.7.4", + "express": "^4.17.1", + "express-static-gzip": "^2.1.1", + "http-proxy-middleware": "^2.0.1" + } +} diff --git a/yarn.lock b/yarn.lock index c4bdf96..5d365a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -911,6 +911,19 @@ resolved "https://registry.npm.taobao.org/@nodelib/fs.stat/download/@nodelib/fs.stat-1.1.3.tgz?cache=0&sync_timestamp=1609074554588&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40nodelib%2Ffs.stat%2Fdownload%2F%40nodelib%2Ffs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha1-K1o6s/kYzKSKjHVMCBaOPwPrphs= +"@npmcli/move-file@^1.0.1": + version "1.1.2" + resolved "https://registry.npm.taobao.org/@npmcli/move-file/download/@npmcli/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" + integrity sha1-GoLD43L3yuklPrZtclQ9a4aFxnQ= + dependencies: + mkdirp "^1.0.4" + rimraf "^3.0.2" + +"@polka/url@^1.0.0-next.15": + version "1.0.0-next.15" + resolved "https://registry.nlark.com/@polka/url/download/@polka/url-1.0.0-next.15.tgz#6a9d143f7f4f49db2d782f9e1c8839a29b43ae23" + integrity sha1-ap0UP39PSdsteC+eHIg5optDriM= + "@soda/friendly-errors-webpack-plugin@^1.7.1": version "1.8.0" resolved "https://registry.npm.taobao.org/@soda/friendly-errors-webpack-plugin/download/@soda/friendly-errors-webpack-plugin-1.8.0.tgz?cache=0&sync_timestamp=1607927438775&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40soda%2Ffriendly-errors-webpack-plugin%2Fdownload%2F%40soda%2Ffriendly-errors-webpack-plugin-1.8.0.tgz#84751d82a93019d5c92c0cf0e45ac59087cd2240" @@ -1398,6 +1411,11 @@ acorn-walk@^7.1.1: resolved "https://registry.npm.taobao.org/acorn-walk/download/acorn-walk-7.2.0.tgz?cache=0&sync_timestamp=1611560713023&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn-walk%2Fdownload%2Facorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha1-DeiJpgEgOQmw++B7iTjcIdLpZ7w= +acorn-walk@^8.0.0: + version "8.1.1" + resolved "https://registry.nlark.com/acorn-walk/download/acorn-walk-8.1.1.tgz#3ddab7f84e4a7e2313f6c414c5b7dac85f4e3ebc" + integrity sha1-Pdq3+E5KfiMT9sQUxbfayF9OPrw= + acorn@^6.4.1: version "6.4.2" resolved "https://registry.npm.taobao.org/acorn/download/acorn-6.4.2.tgz?cache=0&sync_timestamp=1611561275462&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" @@ -1408,6 +1426,11 @@ acorn@^7.1.1, acorn@^7.2.0: resolved "https://registry.npm.taobao.org/acorn/download/acorn-7.4.1.tgz?cache=0&sync_timestamp=1611561275462&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha1-/q7SVZc9LndVW4PbwIhRpsY1IPo= +acorn@^8.0.4: + version "8.4.1" + resolved "https://registry.nlark.com/acorn/download/acorn-8.4.1.tgz#56c36251fc7cabc7096adc18f05afe814321a28c" + integrity sha1-VsNiUfx8q8cJatwY8Fr+gUMhoow= + address@^1.1.2: version "1.1.2" resolved "https://registry.npm.taobao.org/address/download/address-1.1.2.tgz#bf1116c9c758c51b7a933d296b72c221ed9428b6" @@ -2057,6 +2080,29 @@ cacache@^13.0.1: ssri "^7.0.0" unique-filename "^1.1.1" +cacache@^15.0.5: + version "15.2.0" + resolved "https://registry.nlark.com/cacache/download/cacache-15.2.0.tgz?cache=0&sync_timestamp=1621949655085&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcacache%2Fdownload%2Fcacache-15.2.0.tgz#73af75f77c58e72d8c630a7a2858cb18ef523389" + integrity sha1-c69193xY5y2MYwp6KFjLGO9SM4k= + dependencies: + "@npmcli/move-file" "^1.0.1" + chownr "^2.0.0" + fs-minipass "^2.0.0" + glob "^7.1.4" + infer-owner "^1.0.4" + lru-cache "^6.0.0" + minipass "^3.1.1" + minipass-collect "^1.0.2" + minipass-flush "^1.0.5" + minipass-pipeline "^1.2.2" + mkdirp "^1.0.3" + p-map "^4.0.0" + promise-inflight "^1.0.1" + rimraf "^3.0.2" + ssri "^8.0.1" + tar "^6.0.2" + unique-filename "^1.1.1" + cache-base@^1.0.1: version "1.0.1" resolved "https://registry.npm.taobao.org/cache-base/download/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" @@ -2230,6 +2276,11 @@ chownr@^1.1.1, chownr@^1.1.2: resolved "https://registry.npm.taobao.org/chownr/download/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha1-b8nXtC0ypYNZYzdmbn0ICE2izGs= +chownr@^2.0.0: + version "2.0.0" + resolved "https://registry.nlark.com/chownr/download/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" + integrity sha1-Fb++U9LqtM9w8YqM1o6+Wzyx3s4= + chrome-trace-event@^1.0.2: version "1.0.2" resolved "https://registry.npm.taobao.org/chrome-trace-event/download/chrome-trace-event-1.0.2.tgz#234090ee97c7d4ad1a2c4beae27505deffc608a4" @@ -2447,6 +2498,11 @@ commander@^2.18.0, commander@^2.20.0: resolved "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz?cache=0&sync_timestamp=1613374024216&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha1-/UhehMA+tIgcIHIrpIA16FMa6zM= +commander@^6.2.0: + version "6.2.1" + resolved "https://registry.nlark.com/commander/download/commander-6.2.1.tgz?cache=0&sync_timestamp=1627358203890&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcommander%2Fdownload%2Fcommander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c" + integrity sha1-B5LraC37wyWZm7K4T93duhEKxzw= + commander@~2.19.0: version "2.19.0" resolved "https://registry.npm.taobao.org/commander/download/commander-2.19.0.tgz?cache=0&sync_timestamp=1613374024216&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" @@ -2732,6 +2788,21 @@ css-loader@^3.5.3: schema-utils "^2.7.0" semver "^6.3.0" +css-minimizer-webpack-plugin@1.x: + version "1.3.0" + resolved "https://registry.nlark.com/css-minimizer-webpack-plugin/download/css-minimizer-webpack-plugin-1.3.0.tgz?cache=0&sync_timestamp=1624621647030&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcss-minimizer-webpack-plugin%2Fdownload%2Fcss-minimizer-webpack-plugin-1.3.0.tgz#d867b4a54ca9920125b30263505e8cca72bc8cf1" + integrity sha1-2Ge0pUypkgElswJjUF6MynK8jPE= + dependencies: + cacache "^15.0.5" + cssnano "^4.1.10" + find-cache-dir "^3.3.1" + jest-worker "^26.3.0" + p-limit "^3.0.2" + schema-utils "^3.0.0" + serialize-javascript "^5.0.1" + source-map "^0.6.1" + webpack-sources "^1.4.3" + css-select-base-adapter@^0.1.1: version "0.1.1" resolved "https://registry.npm.taobao.org/css-select-base-adapter/download/css-select-base-adapter-0.1.1.tgz#3b2ff4972cc362ab88561507a95408a1432135d7" @@ -3125,7 +3196,7 @@ dotenv@^8.2.0: resolved "https://registry.npm.taobao.org/dotenv/download/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a" integrity sha1-l+YZJZradQ7qPk6j4mvO6lQksWo= -duplexer@^0.1.1: +duplexer@^0.1.1, duplexer@^0.1.2: version "0.1.2" resolved "https://registry.npm.taobao.org/duplexer/download/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" integrity sha1-Or5DrvODX4rgd9E23c4PJ2sEAOY= @@ -4075,6 +4146,13 @@ gzip-size@^5.0.0: duplexer "^0.1.1" pify "^4.0.1" +gzip-size@^6.0.0: + version "6.0.0" + resolved "https://registry.npm.taobao.org/gzip-size/download/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" + integrity sha1-BlNn/VDCOcBnHLy61b4+LusQ5GI= + dependencies: + duplexer "^0.1.2" + handle-thing@^2.0.0: version "2.0.1" resolved "https://registry.npm.taobao.org/handle-thing/download/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" @@ -4863,6 +4941,15 @@ jest-worker@^25.4.0: merge-stream "^2.0.0" supports-color "^7.0.0" +jest-worker@^26.3.0: + version "26.6.2" + resolved "https://registry.nlark.com/jest-worker/download/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" + integrity sha1-f3LLxNZDw2Xie5/XdfnQ6qnHqO0= + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + jquery@^3.5.1: version "3.5.1" resolved "https://registry.npm.taobao.org/jquery/download/jquery-3.5.1.tgz#d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5" @@ -5190,6 +5277,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.nlark.com/lru-cache/download/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha1-bW/mVw69lqr5D8rR2vo7JWbbOpQ= + dependencies: + yallist "^4.0.0" + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.npm.taobao.org/make-dir/download/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -5328,7 +5422,7 @@ mime@1.6.0, mime@^1.4.1: resolved "https://registry.npm.taobao.org/mime/download/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha1-Ms2eXGRVO9WNGaVor0Uqz/BJgbE= -mime@^2.4.4: +mime@^2.3.1, mime@^2.4.4: version "2.5.2" resolved "https://registry.npm.taobao.org/mime/download/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" integrity sha1-bj3GzCuVEGQ4MOXxnVy3U9pe6r4= @@ -5403,6 +5497,14 @@ minipass@^3.0.0, minipass@^3.1.1: dependencies: yallist "^4.0.0" +minizlib@^2.1.1: + version "2.1.2" + resolved "https://registry.nlark.com/minizlib/download/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" + integrity sha1-6Q00Zrogm5MkUVCKEc49NjIUWTE= + dependencies: + minipass "^3.0.0" + yallist "^4.0.0" + mississippi@^3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/mississippi/download/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" @@ -5434,6 +5536,11 @@ mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1: dependencies: minimist "^1.2.5" +mkdirp@^1.0.3, mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha1-PrXtYmInVteaXw4qIh3+utdcL34= + move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -5813,7 +5920,7 @@ open@^6.3.0: dependencies: is-wsl "^1.1.0" -opener@^1.5.1: +opener@^1.5.1, opener@^1.5.2: version "1.5.2" resolved "https://registry.npm.taobao.org/opener/download/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha1-XTfh81B3udysQwE3InGv3rKhNZg= @@ -5883,6 +5990,13 @@ p-limit@^2.0.0, p-limit@^2.2.0, p-limit@^2.2.1, p-limit@^2.3.0: dependencies: p-try "^2.0.0" +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.nlark.com/p-limit/download/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha1-4drMvnjQ0TiMoYxk/qOOPlfjcGs= + dependencies: + yocto-queue "^0.1.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.npm.taobao.org/p-locate/download/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -5909,6 +6023,13 @@ p-map@^3.0.0: dependencies: aggregate-error "^3.0.0" +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.nlark.com/p-map/download/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha1-uy+Vpe2i7BaOySdOBqdHw+KQTSs= + dependencies: + aggregate-error "^3.0.0" + p-retry@^3.0.1: version "3.0.1" resolved "https://registry.npm.taobao.org/p-retry/download/p-retry-3.0.1.tgz?cache=0&sync_timestamp=1613394452411&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-retry%2Fdownload%2Fp-retry-3.0.1.tgz#316b4c8893e2c8dc1cfa891f406c4b422bebf328" @@ -6965,6 +7086,13 @@ rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3, rimraf@^2.7.1: dependencies: glob "^7.1.3" +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho= + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.npm.taobao.org/ripemd160/download/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -7097,6 +7225,11 @@ send@0.17.1: range-parser "~1.2.1" statuses "~1.5.0" +serialize-javascript@^1.7.0: + version "1.9.1" + resolved "https://registry.nlark.com/serialize-javascript/download/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb" + integrity sha1-z8IArvd7YAxH2pu4FJyUPnmML9s= + serialize-javascript@^4.0.0: version "4.0.0" resolved "https://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-4.0.0.tgz?cache=0&sync_timestamp=1599740650381&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fserialize-javascript%2Fdownload%2Fserialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" @@ -7104,6 +7237,13 @@ serialize-javascript@^4.0.0: dependencies: randombytes "^2.1.0" +serialize-javascript@^5.0.1: + version "5.0.1" + resolved "https://registry.nlark.com/serialize-javascript/download/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" + integrity sha1-eIbshIBJpGJGepfT2Rjrsqr5NPQ= + dependencies: + randombytes "^2.1.0" + serve-index@^1.9.1: version "1.9.1" resolved "https://registry.npm.taobao.org/serve-index/download/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" @@ -7206,6 +7346,15 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" +sirv@^1.0.7: + version "1.0.12" + resolved "https://registry.nlark.com/sirv/download/sirv-1.0.12.tgz#d816c882b35489b3c63290e2f455ae3eccd5f652" + integrity sha1-2BbIgrNUibPGMpDi9FWuPszV9lI= + dependencies: + "@polka/url" "^1.0.0-next.15" + mime "^2.3.1" + totalist "^1.0.0" + slash@^1.0.0: version "1.0.0" resolved "https://registry.npm.taobao.org/slash/download/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" @@ -7413,6 +7562,13 @@ ssri@^7.0.0, ssri@^7.1.0: figgy-pudding "^3.5.1" minipass "^3.1.1" +ssri@^8.0.1: + version "8.0.1" + resolved "https://registry.nlark.com/ssri/download/ssri-8.0.1.tgz?cache=0&sync_timestamp=1621364626710&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fssri%2Fdownload%2Fssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" + integrity sha1-Y45OQ54v+9LNKJd21cpFfE9Roq8= + dependencies: + minipass "^3.1.1" + stable@^0.1.8: version "0.1.8" resolved "https://registry.npm.taobao.org/stable/download/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" @@ -7646,6 +7802,18 @@ tapable@^1.0.0, tapable@^1.1.3: resolved "https://registry.npm.taobao.org/tapable/download/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" integrity sha1-ofzMBrWNth/XpF2i2kT186Pme6I= +tar@^6.0.2: + version "6.1.7" + resolved "https://registry.nlark.com/tar/download/tar-6.1.7.tgz?cache=0&sync_timestamp=1628551130388&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftar%2Fdownload%2Ftar-6.1.7.tgz#c566d1107d38b09e92983a68db5534fc7f6cab42" + integrity sha1-xWbREH04sJ6SmDpo21U0/H9sq0I= + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^3.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + terser-webpack-plugin@^1.4.3: version "1.4.5" resolved "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-1.4.5.tgz?cache=0&sync_timestamp=1610196021147&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-1.4.5.tgz#a217aefaea330e734ffacb6120ec1fa312d6040b" @@ -7812,6 +7980,11 @@ toposort@^1.0.0: resolved "https://registry.npm.taobao.org/toposort/download/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" integrity sha1-LmhELZ9k7HILjMieZEOsbKqVACk= +totalist@^1.0.0: + version "1.1.0" + resolved "https://registry.nlark.com/totalist/download/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" + integrity sha1-pNZaPlRlF3AePlw3pHpwrJf+Vt8= + tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" @@ -7895,6 +8068,26 @@ uglify-js@3.4.x: commander "~2.19.0" source-map "~0.6.1" +uglify-js@^3.6.0: + version "3.14.1" + resolved "https://registry.nlark.com/uglify-js/download/uglify-js-3.14.1.tgz?cache=0&sync_timestamp=1627379699154&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fuglify-js%2Fdownload%2Fuglify-js-3.14.1.tgz#e2cb9fe34db9cb4cf7e35d1d26dfea28e09a7d06" + integrity sha1-4suf4025y0z3410dJt/qKOCafQY= + +uglifyjs-webpack-plugin@^2.2.0: + version "2.2.0" + resolved "https://registry.npm.taobao.org/uglifyjs-webpack-plugin/download/uglifyjs-webpack-plugin-2.2.0.tgz#e75bc80e7f1937f725954c9b4c5a1e967ea9d0d7" + integrity sha1-51vIDn8ZN/cllUybTFoeln6p0Nc= + dependencies: + cacache "^12.0.2" + find-cache-dir "^2.1.0" + is-wsl "^1.1.0" + schema-utils "^1.0.0" + serialize-javascript "^1.7.0" + source-map "^0.6.1" + uglify-js "^3.6.0" + webpack-sources "^1.4.0" + worker-farm "^1.7.0" + unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.npm.taobao.org/unicode-canonical-property-names-ecmascript/download/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" @@ -8242,6 +8435,21 @@ webpack-bundle-analyzer@^3.8.0: opener "^1.5.1" ws "^6.0.0" +webpack-bundle-analyzer@^4.4.2: + version "4.4.2" + resolved "https://registry.nlark.com/webpack-bundle-analyzer/download/webpack-bundle-analyzer-4.4.2.tgz#39898cf6200178240910d629705f0f3493f7d666" + integrity sha1-OYmM9iABeCQJENYpcF8PNJP31mY= + dependencies: + acorn "^8.0.4" + acorn-walk "^8.0.0" + chalk "^4.1.0" + commander "^6.2.0" + gzip-size "^6.0.0" + lodash "^4.17.20" + opener "^1.5.2" + sirv "^1.0.7" + ws "^7.3.1" + webpack-chain@^6.4.0: version "6.5.1" resolved "https://registry.npm.taobao.org/webpack-chain/download/webpack-chain-6.5.1.tgz#4f27284cbbb637e3c8fbdef43eef588d4d861206" @@ -8443,6 +8651,11 @@ ws@^6.0.0, ws@^6.2.1: dependencies: async-limiter "~1.0.0" +ws@^7.3.1: + version "7.5.3" + resolved "https://registry.nlark.com/ws/download/ws-7.5.3.tgz?cache=0&sync_timestamp=1627496096076&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fws%2Fdownload%2Fws-7.5.3.tgz#160835b63c7d97bfab418fc1b8a9fced2ac01a74" + integrity sha1-Fgg1tjx9l7+rQY/BuKn87SrAGnQ= + x2js@^3.4.0: version "3.4.0" resolved "https://registry.npm.taobao.org/x2js/download/x2js-3.4.0.tgz#1414ad99062705086a4838e8dde4ecd06e8bd3a9" @@ -8527,6 +8740,11 @@ yargs@^16.0.0: y18n "^5.0.5" yargs-parser "^20.2.2" +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.nlark.com/yocto-queue/download/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha1-ApTrPe4FAo0x7hpfosVWpqrxChs= + yorkie@^2.0.0: version "2.0.0" resolved "https://registry.npm.taobao.org/yorkie/download/yorkie-2.0.0.tgz#92411912d435214e12c51c2ae1093e54b6bb83d9" From f71ad6b45d5c4db7bbf5aaa6635b4800791df2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Fri, 13 Aug 2021 15:21:04 +0800 Subject: [PATCH 04/47] =?UTF-8?q?'=E4=BC=98=E5=8C=96webpack=E6=89=93?= =?UTF-8?q?=E5=8C=85'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 24 +++++++++++++++++++++++- stats.json | 2 -- 2 files changed, 23 insertions(+), 3 deletions(-) delete mode 100644 stats.json diff --git a/package.json b/package.json index c9bc964..d3ceec1 100644 --- a/package.json +++ b/package.json @@ -2,10 +2,32 @@ "name": "mxgraph-easyeditor", "version": "0.1.0", "private": true, + "pre-commit": [ + "pre-commit" + ], + "main": "./main.js", "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "lint": "vue-cli-service lint", + "preinstall": "bash ./scripts/init_files.sh", + "dev": "cross-env BABEL_ENV=development ./node_modules/.bin/webpack-dev-server --progress --devtool eval-source-map --config build/webpack.dev.conf.js", + "start": "yarn lint && yarn dll && yarn dev", + "del:dll": "./node_modules/.bin/rimraf vendor", + "compile:dll": "./node_modules/.bin/webpack --config build/webpack.dll.conf.js --colors --profile", + "dll": "yarn del:dll && yarn compile:dll", + "build:report": "npm_config_report=true node --max_old_space_size=4096 build/build.js", + "pre-commit": "echo 'Pre-commit checks...' && yarn switch-source-in && yarn lint2", + "switch-source-in": "bash ./scripts/switch_source.sh i", + "lint3": "./node_modules/.bin/eslint --fix --ext .js,.jsx,.ts,.tsx,.vue src && ./node_modules/.bin/tslint --fix 'src/**/*{.ts,.tsx}'", + "test": "cross-env NODE_ENV=test jest --config jest.config.js", + "del:components": "./node_modules/.bin/rimraf components", + "copy": "./node_modules/.bin/gulp copy", + "babel": "./node_modules/.bin/babel components -d components", + "components": "yarn del:components && yarn copy && yarn babel", + "deploy": "node --max_old_space_size=4096 build/build.js", + "clean:node": "rm -Rf ./node_modules", + "change:version": "./node/node ./ci_script/changeVersion.js" }, "dependencies": { "core-js": "^3.6.5", diff --git a/stats.json b/stats.json deleted file mode 100644 index 660301c..0000000 --- a/stats.json +++ /dev/null @@ -1,2 +0,0 @@ -Installing 'webpack-cli' (running 'yarn add -D webpack-cli')... -ֹ(Y/N)? yarn add v1.22.4 From 3317bec453540e9109f3feee196be5a207b94a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Mon, 16 Aug 2021 17:58:57 +0800 Subject: [PATCH 05/47] =?UTF-8?q?'webpack=E6=89=93=E5=8C=85=E4=BC=98?= =?UTF-8?q?=E5=8C=96'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/vue-loader.conf | 33 +++++++++++++++++++++++++++++++++ public/index.html | 29 ++++++++++++++++++++++++++++- src/router/index.js | 12 ++++++++++-- test.js | 13 +++++++++++++ vue.config.js | 26 +++++++++++++++++--------- web-serve/app.js | 31 +++++++++++++------------------ 6 files changed, 114 insertions(+), 30 deletions(-) create mode 100644 build/vue-loader.conf create mode 100644 test.js diff --git a/build/vue-loader.conf b/build/vue-loader.conf new file mode 100644 index 0000000..24fa9d2 --- /dev/null +++ b/build/vue-loader.conf @@ -0,0 +1,33 @@ +/* + * @Descripttion: + * @version: + * @Author: Jason chen + * @Date: 2021-08-16 17:58:07 + * @LastEditors: sueRimn + * @LastEditTime: 2021-08-16 17:58:08 + */ +'use strict'; +const utils = require('./utils'); +const config = require('../config'); +const isProduction = process.env.NODE_ENV === 'production'; +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap; + +module.exports = { + loaders: Object.assign(utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction, + }), { + ts: 'ts-loader', + tsx: 'babel-loader!ts-loader', + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href', + }, +}; diff --git a/public/index.html b/public/index.html index 8576aa3..87f1303 100644 --- a/public/index.html +++ b/public/index.html @@ -1,3 +1,11 @@ + @@ -11,13 +19,32 @@ - +
+ \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index d7af090..ed58465 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,3 +1,11 @@ +/* + * @Descripttion: + * @version: + * @Author: Jason chen + * @Date: 2020-06-26 17:46:26 + * @LastEditors: sueRimn + * @LastEditTime: 2021-08-16 17:03:46 + */ // 导入 vue-router import Vue from 'vue'; import VueRouter from 'vue-router' @@ -13,11 +21,11 @@ const router = new VueRouter({ routes: [ { path: '/', - component: () => import("../views/customToolbar/customToolbar.vue"), + component: () => import(/*webpackChunkName: "my-customToolbar-chunk"*/ "../views/customToolbar/customToolbar.vue"), }, { path: "/customToolbar", - component: () => import("../views/customToolbar/customToolbar.vue") + component: () => import(/*webpackChunkName: "my-customToolbar-chunk"*/ "../views/customToolbar/customToolbar.vue") }, { path: "/renderModel", diff --git a/test.js b/test.js new file mode 100644 index 0000000..bf5e5ee --- /dev/null +++ b/test.js @@ -0,0 +1,13 @@ +function sleep (fn, time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(fn); + }, time); + }); +} +let saySomething = (name) => console.log(`hello,${name}`) +async function autoPlay () { + let demo = await sleep(saySomething('Jason Chen'), 1000) + let demo2 = await sleep(saySomething('节省钱'), 1000) +} +autoPlay() \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 21966e5..c997222 100644 --- a/vue.config.js +++ b/vue.config.js @@ -8,6 +8,7 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); const CompressionWebpackPlugin = require('compression-webpack-plugin'); const productionGzipExtensions = ['js', 'css', 'html'] + module.exports = { publicPath: './', outputDir: 'dist', @@ -25,19 +26,26 @@ module.exports = { ], optimization: { splitChunks: { - chunks: 'all', + chunks: "all", name: false, minSize: 0, cacheGroups: { - defaultVendors: { - test: /[\\/]node_modules[\\/]/, - priority: -10 + commons: { + minChunks: 2,//表示被引用次数,默认为1; + maxInitialRequests: 5, //最大的初始化加载次数,默认为 3; + minSize: 0, // 模块的文件体积超过 0 byte就抽取到common中 + name: 'chunk-commons',//抽取出来文件的名字,默认为 true,表示自动生成文件名 + }, + elementUI: { + name: "chunk-element-ui", // 单独将 elementUI 拆包 + priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app + test: /[\\/]node_modules[\\/]element-ui[\\/]/, + }, + mxgraph: { + name: "chunk-mxgraph", // 单独将 elementUI 拆包 + priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app + test: /[\\/]node_modules[\\/]mxgraph[\\/]/, }, - default: { - minChunks: 2, - priority: -20, - reuseExistingChunk: true - } } }, minimizer: [new UglifyJsPlugin( diff --git a/web-serve/app.js b/web-serve/app.js index 1fc1878..edcdb24 100644 --- a/web-serve/app.js +++ b/web-serve/app.js @@ -1,3 +1,11 @@ +/* + * @Descripttion: + * @version: + * @Author: Jason chen + * @Date: 2021-08-12 18:00:06 + * @LastEditors: sueRimn + * @LastEditTime: 2021-08-16 15:02:54 + */ const express = require('express'); // 代理 // const proxy = require('http-proxy-middleware'); @@ -21,16 +29,12 @@ function setCustomCacheControl (res, currentFilePath) { res.setHeader('Cache-Control', 'no-cache'); } } +// 打包后的静态资源目录 +app.use(express.static('../dist')); -app.use(express.static('../deploy')); - -// const PROXY_EDSP = process.env.PROXY_EDSP || 'http://10.22.0.137:31801/edsp'; -const PROXY_EDSP = 'http://10.22.0.137:31801/edsp'; -const PROXY_LOADER = process.env.PROXY_LOADER || 'http://10.22.0.230:8080'; - -console.log('PROXY_EDSP: ', PROXY_EDSP); -console.log('PROXY_LOADER: ', PROXY_LOADER); // 代理 + +// const PROXY_EDSP = 'http://10.22.0.137:31801/edsp'; // app.use( // '/edsp', // proxy({ @@ -41,16 +45,7 @@ console.log('PROXY_LOADER: ', PROXY_LOADER); // changeOrigin: true, // }), // ); -// app.use( -// '/loader', -// proxy({ -// target: PROXY_LOADER, -// pathRewrite: { -// '/loader': '', -// }, -// changeOrigin: true, -// }), -// ); + app.listen(9900, (req, res) => { console.log(req, res); From a9410f9b9569b5384df34d8886044524c54d1bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Mon, 30 Aug 2021 15:07:33 +0800 Subject: [PATCH 06/47] Update README.md --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 20dd25a..65b12f7 100644 --- a/README.md +++ b/README.md @@ -669,26 +669,21 @@ mxgraph 提供了几种自动布局的 API,直接调用 graphLayout 即可 ## Project setup ``` -npm install +yarn ``` ### Compiles and hot-reloads for development ``` -npm run serve +yarn serve ``` ### Compiles and minifies for production ``` -npm run build +yarn build ``` -### Lints and fixes files - -``` -npm run lint -``` ### Customize configuration From 1964706c04e10a9d7dcf288af628f521efc2cdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Mon, 30 Aug 2021 15:11:07 +0800 Subject: [PATCH 07/47] =?UTF-8?q?'=E8=B7=AF=E7=94=B1=E6=87=92=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=88=86=E5=8C=85'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 6 +++--- test.js | 13 ------------ vue.config.js | 52 +++++++++++++++++++++++++-------------------- 3 files changed, 32 insertions(+), 39 deletions(-) delete mode 100644 test.js diff --git a/src/router/index.js b/src/router/index.js index ed58465..00e1b9d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,7 +4,7 @@ * @Author: Jason chen * @Date: 2020-06-26 17:46:26 * @LastEditors: sueRimn - * @LastEditTime: 2021-08-16 17:03:46 + * @LastEditTime: 2021-08-17 11:23:34 */ // 导入 vue-router import Vue from 'vue'; @@ -21,11 +21,11 @@ const router = new VueRouter({ routes: [ { path: '/', - component: () => import(/*webpackChunkName: "my-customToolbar-chunk"*/ "../views/customToolbar/customToolbar.vue"), + component: () => import("../views/customToolbar/customToolbar.vue"), }, { path: "/customToolbar", - component: () => import(/*webpackChunkName: "my-customToolbar-chunk"*/ "../views/customToolbar/customToolbar.vue") + component: () => import("../views/customToolbar/customToolbar.vue") }, { path: "/renderModel", diff --git a/test.js b/test.js deleted file mode 100644 index bf5e5ee..0000000 --- a/test.js +++ /dev/null @@ -1,13 +0,0 @@ -function sleep (fn, time) { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve(fn); - }, time); - }); -} -let saySomething = (name) => console.log(`hello,${name}`) -async function autoPlay () { - let demo = await sleep(saySomething('Jason Chen'), 1000) - let demo2 = await sleep(saySomething('节省钱'), 1000) -} -autoPlay() \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index c997222..a4da995 100644 --- a/vue.config.js +++ b/vue.config.js @@ -25,29 +25,35 @@ module.exports = { }), ], optimization: { - splitChunks: { - chunks: "all", - name: false, - minSize: 0, - cacheGroups: { - commons: { - minChunks: 2,//表示被引用次数,默认为1; - maxInitialRequests: 5, //最大的初始化加载次数,默认为 3; - minSize: 0, // 模块的文件体积超过 0 byte就抽取到common中 - name: 'chunk-commons',//抽取出来文件的名字,默认为 true,表示自动生成文件名 - }, - elementUI: { - name: "chunk-element-ui", // 单独将 elementUI 拆包 - priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app - test: /[\\/]node_modules[\\/]element-ui[\\/]/, - }, - mxgraph: { - name: "chunk-mxgraph", // 单独将 elementUI 拆包 - priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app - test: /[\\/]node_modules[\\/]mxgraph[\\/]/, - }, - } - }, + // splitChunks: { + // chunks: "all", + // cacheGroups: { + // common: { + // name: 'chunk-common', + // test: /[\\/]node_modules[\\/]/, + // priority: 10, + // minChunks: 1, + // chunks: 'all', + // }, + // elementUI: { + // name: "chunk-element-ui", // 单独将 elementUI 拆包 + // priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app + // test: /[\\/]node_modules[\\/]element-ui[\\/]/, + // }, + // mxgraph: { + // name: "chunk-mxgraph", // 单独将 elementUI 拆包 + // priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app + // test: /[\\/]node_modules[\\/]mxgraph[\\/]/, + // }, + // component: { + // name: 'chunk-componentaa', + // test: /[\\/]src[\\/]/, + // priority: 50, + // minChunks: 1, + // chunks: 'all', + // }, + // } + // }, minimizer: [new UglifyJsPlugin( { uglifyOptions: { From 59c9bc5769d9b1748aef30b66b5dc08a9b717c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Mon, 30 Aug 2021 15:14:02 +0800 Subject: [PATCH 08/47] =?UTF-8?q?'=E8=B7=AF=E7=94=B1=E6=87=92=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=88=86=E5=8C=85'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 00e1b9d..11fbed3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,8 +3,8 @@ * @version: * @Author: Jason chen * @Date: 2020-06-26 17:46:26 - * @LastEditors: sueRimn - * @LastEditTime: 2021-08-17 11:23:34 + * @LastEditors: Jason chen + * @LastEditTime: 2021-08-30 15:13:17 */ // 导入 vue-router import Vue from 'vue'; @@ -21,15 +21,15 @@ const router = new VueRouter({ routes: [ { path: '/', - component: () => import("../views/customToolbar/customToolbar.vue"), + component: () => import(/*webpackChunkName: "my-customToolbar-chunk"*/ "../views/customToolbar/customToolbar.vue"), }, { path: "/customToolbar", - component: () => import("../views/customToolbar/customToolbar.vue") + component: () => import(/*webpackChunkName: "my-customToolbar-chunk"*/ "../views/customToolbar/customToolbar.vue") }, { path: "/renderModel", - component: () => import("../views/renderModel/index.vue") + component: () => import(/*webpackChunkName: "renderModel-chunk"*/"../views/renderModel/index.vue") } ] }) From 0f056873e4426079ed0b96d1da04feddc2efb7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Tue, 31 Aug 2021 11:21:23 +0800 Subject: [PATCH 09/47] =?UTF-8?q?'=E4=BC=98=E5=8C=96mxgraph=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E6=96=B9=E5=BC=8F'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graph/index.js | 78 +++++- src/views/customToolbar/GroupToolbarItems.js | 32 +-- src/views/customToolbar/general-shape.js | 8 +- src/views/customToolbar/toolbar.js | 126 ++++----- src/views/renderModel/index.js | 70 +++++ src/views/renderModel/index.vue | 261 +++++++++++-------- 6 files changed, 373 insertions(+), 202 deletions(-) create mode 100644 src/views/renderModel/index.js diff --git a/src/graph/index.js b/src/graph/index.js index 2d95385..5524005 100644 --- a/src/graph/index.js +++ b/src/graph/index.js @@ -1,12 +1,66 @@ -import mx from 'mxgraph' -const mxgraph = mx({}) -// decode bug https://github.com/jgraph/mxgraph/issues/49 -window.mxGraph = mxgraph.mxGraph -window.mxGraphModel = mxgraph.mxGraphModel -window.mxEditor = mxgraph.mxEditor -window.mxGeometry = mxgraph.mxGeometry -window.mxDefaultKeyHandler = mxgraph.mxDefaultKeyHandler -window.mxDefaultPopupMenu = mxgraph.mxDefaultPopupMenu -window.mxStylesheet = mxgraph.mxStylesheet -window.mxDefaultToolbar = mxgraph.mxDefaultToolbar -export default mxgraph \ No newline at end of file +/* + * @Descripttion: + * @version: + * @Author: Jason chen + * @Date: 2020-07-09 17:04:43 + * @LastEditors: Jason chen + * @LastEditTime: 2021-08-31 11:14:26 + */ +const mx = require('mxgraph') + +const mxgraph = mx({ + // 核心中所有图像url的Basepath,不带斜杠。在mxClient.imageBasePath中指定路径. + mxImageBasePath: 'mxgraph/images', + // 核心中的所有url的Basepath,不带斜杠。在mxClient.basePath中指定路径。 + // 指向的路径一定要是一个可以通过 url 访问的静态资源目录 + mxBasePath: 'mxgraph', + // 可选的全局配置变量。切换加载mxGraph和mxEditor中的两个资源文件。 + // 默认值是true。在主线程警告上禁用同步XMLHttpRequest + mxLoadResources: true + // 指定是否应加载任何样式表。 默认值是true。 + // mxLoadStylesheets: false, + // 可选的全局配置变量,在开发模式下强制加载JavaScript文件。 + // mxForceIncludes: true, + // 可选的全局配置变量来指定资源文件的扩展名。 + // mxResourceExtension: '.txt' +}) + +const MxCell = mxgraph.mxCell +const MxConstants = mxgraph.mxConstants +const MxEvent = mxgraph.mxEvent +const MxGraph = mxgraph.mxGraph + +const MxRubberBand = mxgraph.mxRubberband + +const MxUtils = mxgraph.mxUtils +const MxCodec = mxgraph.mxCodec +const MxGeometry = mxgraph.mxGeometry +const MxEditor = mxgraph.mxEditor +const MxGraphHandler = mxgraph.mxGraphHandler +const MxRectangleShape = mxgraph.mxRectangleShape +const MxCellTracker = mxgraph.mxCellTracker +const MxClient = mxgraph.mxClient +const MxPerimeter = mxgraph.mxPerimeter +const MxEventObject = mxgraph.mxEventObject +const ActiveXObject = mxgraph.activeXObject + + +MxRubberBand.prototype.defaultOpacity = 30 + +export { + MxEvent, + MxGraph, + MxEditor, + MxUtils, + MxGraphHandler, + MxConstants, + MxCodec, + MxRectangleShape, + MxCellTracker, + MxClient, + MxPerimeter, + MxEventObject, + MxGeometry, + MxCell, + ActiveXObject +} \ No newline at end of file diff --git a/src/views/customToolbar/GroupToolbarItems.js b/src/views/customToolbar/GroupToolbarItems.js index 93e414a..d7c0263 100644 --- a/src/views/customToolbar/GroupToolbarItems.js +++ b/src/views/customToolbar/GroupToolbarItems.js @@ -1,6 +1,6 @@ -import mxgraph from '../../graph/index'; +import { MxConstants } from '../../graph/index'; -const { mxConstants } = mxgraph; +// const { MxConstants } = mxgraph; export const grouptoolItems = [ { title: '分组1', @@ -16,8 +16,8 @@ export const grouptoolItems = [ fillColor: '#409eff', strokeColor: '#629EA0', fontColor: '#000000', - verticalAlign: mxConstants.ALIGN_TOP, - align: mxConstants.ALIGN_CENTER, + verticalAlign: MxConstants.ALIGN_TOP, + align: MxConstants.ALIGN_CENTER, }, created (graph, cell, index) { const deleteIconDom = document.querySelector(`.deleteIcon_${index}`); @@ -48,8 +48,8 @@ export const grouptoolItems = [ fillColor: '#409eff', strokeColor: '#629EA0', fontColor: '#000000', - verticalAlign: mxConstants.ALIGN_TOP, - align: mxConstants.ALIGN_CENTER, + verticalAlign: MxConstants.ALIGN_TOP, + align: MxConstants.ALIGN_CENTER, }, created (graph, cell, index) { const deleteIconDom = document.querySelector(`.deleteIcon_${index}`); @@ -80,8 +80,8 @@ export const grouptoolItems = [ fillColor: '#409eff', strokeColor: '#629EA0', fontColor: '#000000', - verticalAlign: mxConstants.ALIGN_TOP, - align: mxConstants.ALIGN_CENTER, + verticalAlign: MxConstants.ALIGN_TOP, + align: MxConstants.ALIGN_CENTER, }, created (graph, cell, index) { const deleteIconDom = document.querySelector(`.deleteIcon_${index}`); @@ -112,8 +112,8 @@ export const grouptoolItems = [ fillColor: '#409eff', strokeColor: '#629EA0', fontColor: '#000000', - verticalAlign: mxConstants.ALIGN_TOP, - align: mxConstants.ALIGN_CENTER, + verticalAlign: MxConstants.ALIGN_TOP, + align: MxConstants.ALIGN_CENTER, }, created (graph, cell, index) { const deleteIconDom = document.querySelector(`.deleteIcon_${index}`); @@ -144,8 +144,8 @@ export const grouptoolItems = [ fillColor: '#409eff', strokeColor: '#629EA0', fontColor: '#000000', - verticalAlign: mxConstants.ALIGN_TOP, - align: mxConstants.ALIGN_CENTER, + verticalAlign: MxConstants.ALIGN_TOP, + align: MxConstants.ALIGN_CENTER, }, created (graph, cell, index) { const deleteIconDom = document.querySelector(`.deleteIcon_${index}`); @@ -176,8 +176,8 @@ export const grouptoolItems = [ fillColor: '#409eff', strokeColor: '#629EA0', fontColor: '#000000', - verticalAlign: mxConstants.ALIGN_TOP, - align: mxConstants.ALIGN_CENTER, + verticalAlign: MxConstants.ALIGN_TOP, + align: MxConstants.ALIGN_CENTER, }, created (graph, cell, index) { const deleteIconDom = document.querySelector(`.deleteIcon_${index}`); @@ -208,8 +208,8 @@ export const grouptoolItems = [ fillColor: '#409eff', strokeColor: '#629EA0', fontColor: '#000000', - verticalAlign: mxConstants.ALIGN_TOP, - align: mxConstants.ALIGN_CENTER, + verticalAlign: MxConstants.ALIGN_TOP, + align: MxConstants.ALIGN_CENTER, }, created (graph, cell, index) { const deleteIconDom = document.querySelector(`.deleteIcon_${index}`); diff --git a/src/views/customToolbar/general-shape.js b/src/views/customToolbar/general-shape.js index c073656..b686fb6 100644 --- a/src/views/customToolbar/general-shape.js +++ b/src/views/customToolbar/general-shape.js @@ -1,5 +1,5 @@ -import mxgraph from "../../graph/index"; -const { mxConstants } = mxgraph; +import { MxConstants } from "../../graph/index"; +// const { MxConstants } = mxgraph; export const generalToolbarItems = [ { index: 0, @@ -151,8 +151,8 @@ export const generalToolbarItems = [ strokeWidth: '1', html: 1, fillColor: '#FFFFFF', - verticalAlign: mxConstants.ALIGN_MIDDLE, - align: mxConstants.ALIGN_CENTER, + verticalAlign: MxConstants.ALIGN_MIDDLE, + align: MxConstants.ALIGN_CENTER, whiteSpace: 'wrap', rounded: 0, } diff --git a/src/views/customToolbar/toolbar.js b/src/views/customToolbar/toolbar.js index 311ecb0..87f5d3c 100644 --- a/src/views/customToolbar/toolbar.js +++ b/src/views/customToolbar/toolbar.js @@ -1,10 +1,10 @@ // import { -// mxConstants as mxConstants +// MxConstants as MxConstants // } from 'mxgraph-js' // const closeIcon = require('@/assets/icon/delete.png') -import mxgraph from "../../graph/index"; -const { mxConstants } = mxgraph; +import { MxConstants } from "../../graph/index"; +// const { MxConstants } = mxgraph; const boxDomain = './icon/boxDomain.png' const center = './icon/center.png' const database = './icon/database.png' @@ -32,11 +32,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', strokeColor: '#000000', strokeWidth: '1', - shape: mxConstants.SHAPE_LABEL, - align: mxConstants.ALIGN_TOP, - verticalAlign: mxConstants.ALIGN_BOTTOM, - imageAlign: mxConstants.ALIGN_CENTER, // 背景图的水平方向的定位 - imageVerticalAlign: mxConstants.ALIGN_TOP, // 背景图垂直方向的定位 + shape: MxConstants.SHAPE_LABEL, + align: MxConstants.ALIGN_TOP, + verticalAlign: MxConstants.ALIGN_BOTTOM, + imageAlign: MxConstants.ALIGN_CENTER, // 背景图的水平方向的定位 + imageVerticalAlign: MxConstants.ALIGN_TOP, // 背景图垂直方向的定位 image: boxDomain } }, @@ -53,11 +53,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', // 填充色 strokeColor: '#000000', // 线条颜色 strokeWidth: '1', // 线条粗细 - shape: mxConstants.SHAPE_LABEL, // 形状 - align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - verticalAlign: mxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 - imageAlign: mxConstants.ALIGN_CENTER, // 图形水平方向对其方式 - imageVerticalAlign: mxConstants.ALIGN_TOP, // 图形方向对其方式 + shape: MxConstants.SHAPE_LABEL, // 形状 + align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + verticalAlign: MxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 + imageAlign: MxConstants.ALIGN_CENTER, // 图形水平方向对其方式 + imageVerticalAlign: MxConstants.ALIGN_TOP, // 图形方向对其方式 image: center // 图形 } }, @@ -74,11 +74,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', // 填充色 strokeColor: '#000000', // 线条颜色 strokeWidth: '1', // 线条粗细 - shape: mxConstants.SHAPE_LABEL, // 形状 - align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - verticalAlign: mxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 - imageAlign: mxConstants.ALIGN_CENTER, // 图形水平方向对其方式 - imageVerticalAlign: mxConstants.ALIGN_TOP, // 图形方向对其方式 + shape: MxConstants.SHAPE_LABEL, // 形状 + align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + verticalAlign: MxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 + imageAlign: MxConstants.ALIGN_CENTER, // 图形水平方向对其方式 + imageVerticalAlign: MxConstants.ALIGN_TOP, // 图形方向对其方式 image: database // 图形 } }, @@ -95,11 +95,11 @@ export const toolbarItems = [ // fillColor: '#FFFFFF', // 填充色 // strokeColor: '#000000', // 线条颜色 // strokeWidth: '1', // 线条粗细 - // shape: mxConstants.SHAPE_LABEL, // 形状 - // align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - // verticalAlign: mxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 - // imageAlign: mxConstants.ALIGN_CENTER, // 图形水平方向对其方式 - // imageVerticalAlign: mxConstants.ALIGN_TOP, // 图形方向对其方式 + // shape: MxConstants.SHAPE_LABEL, // 形状 + // align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + // verticalAlign: MxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 + // imageAlign: MxConstants.ALIGN_CENTER, // 图形水平方向对其方式 + // imageVerticalAlign: MxConstants.ALIGN_TOP, // 图形方向对其方式 // image: authorizate // 图形 // } // }, @@ -116,11 +116,11 @@ export const toolbarItems = [ // fillColor: '#FFFFFF', // 填充色 // strokeColor: '#000000', // 线条颜色 // strokeWidth: '1', // 线条粗细 - // shape: mxConstants.SHAPE_LABEL, // 形状 - // align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - // verticalAlign: mxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 - // imageAlign: mxConstants.ALIGN_CENTER, // 图形水平方向对其方式 - // imageVerticalAlign: mxConstants.ALIGN_TOP, // 图形方向对其方式 + // shape: MxConstants.SHAPE_LABEL, // 形状 + // align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + // verticalAlign: MxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 + // imageAlign: MxConstants.ALIGN_CENTER, // 图形水平方向对其方式 + // imageVerticalAlign: MxConstants.ALIGN_TOP, // 图形方向对其方式 // image: cluster // 图形 // } // }, @@ -137,11 +137,11 @@ export const toolbarItems = [ // fillColor: '#FFFFFF', // 填充色 // strokeColor: '#000000', // 线条颜色 // strokeWidth: '1', // 线条粗细 - // shape: mxConstants.SHAPE_LABEL, // 形状 - // align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - // verticalAlign: mxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 - // imageAlign: mxConstants.ALIGN_CENTER, // 图形水平方向对其方式 - // imageVerticalAlign: mxConstants.ALIGN_TOP, // 图形方向对其方式 + // shape: MxConstants.SHAPE_LABEL, // 形状 + // align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + // verticalAlign: MxConstants.ALIGN_BOTTOM, // 垂直方向对其方式 + // imageAlign: MxConstants.ALIGN_CENTER, // 图形水平方向对其方式 + // imageVerticalAlign: MxConstants.ALIGN_TOP, // 图形方向对其方式 // image: exchange // 图形 // }, // }, @@ -158,11 +158,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', // 填充色 strokeColor: '#000000', // 线条颜色 strokeWidth: '1', // 线条粗细 - shape: mxConstants.SHAPE_LABEL, // 形状 - align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - verticalAlign: mxConstants.ALIGN_CENTER, // 垂直方向对其方式 - imageAlign: mxConstants.ALIGN_LEFT, // 图形水平方向对其方式 - imageVerticalAlign: mxConstants.ALIGN_CENTER, // 图形方向对其方式 + shape: MxConstants.SHAPE_LABEL, // 形状 + align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + verticalAlign: MxConstants.ALIGN_CENTER, // 垂直方向对其方式 + imageAlign: MxConstants.ALIGN_LEFT, // 图形水平方向对其方式 + imageVerticalAlign: MxConstants.ALIGN_CENTER, // 图形方向对其方式 image: elasticsearch // 图形 }, }, @@ -179,11 +179,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', // 填充色 strokeColor: '#000000', // 线条颜色 strokeWidth: '1', // 线条粗细 - shape: mxConstants.SHAPE_LABEL, // 形状 - align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - verticalAlign: mxConstants.ALIGN_CENTER, // 垂直方向对其方式 - imageAlign: mxConstants.ALIGN_LEFT, // 图形水平方向对其方式 - imageVerticalAlign: mxConstants.ALIGN_CENTER, // 图形方向对其方式 + shape: MxConstants.SHAPE_LABEL, // 形状 + align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + verticalAlign: MxConstants.ALIGN_CENTER, // 垂直方向对其方式 + imageAlign: MxConstants.ALIGN_LEFT, // 图形水平方向对其方式 + imageVerticalAlign: MxConstants.ALIGN_CENTER, // 图形方向对其方式 image: kibana // 图形 }, }, @@ -200,11 +200,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', // 填充色 strokeColor: '#000000', // 线条颜色 strokeWidth: '1', // 线条粗细 - shape: mxConstants.SHAPE_LABEL, // 形状 - align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - verticalAlign: mxConstants.ALIGN_CENTER, // 垂直方向对其方式 - imageAlign: mxConstants.ALIGN_LEFT, // 图形水平方向对其方式 - imageVerticalAlign: mxConstants.ALIGN_CENTER, // 图形方向对其方式 + shape: MxConstants.SHAPE_LABEL, // 形状 + align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + verticalAlign: MxConstants.ALIGN_CENTER, // 垂直方向对其方式 + imageAlign: MxConstants.ALIGN_LEFT, // 图形水平方向对其方式 + imageVerticalAlign: MxConstants.ALIGN_CENTER, // 图形方向对其方式 image: logstash // 图形 }, }, @@ -221,11 +221,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', // 填充色 strokeColor: '#000000', // 线条颜色 strokeWidth: '1', // 线条粗细 - shape: mxConstants.SHAPE_LABEL, // 形状 - align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - verticalAlign: mxConstants.ALIGN_CENTER, // 垂直方向对其方式 - imageAlign: mxConstants.ALIGN_LEFT, // 图形水平方向对其方式 - imageVerticalAlign: mxConstants.ALIGN_CENTER, // 图形方向对其方式 + shape: MxConstants.SHAPE_LABEL, // 形状 + align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + verticalAlign: MxConstants.ALIGN_CENTER, // 垂直方向对其方式 + imageAlign: MxConstants.ALIGN_LEFT, // 图形水平方向对其方式 + imageVerticalAlign: MxConstants.ALIGN_CENTER, // 图形方向对其方式 image: KAFKA // 图形 }, }, @@ -242,11 +242,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', // 填充色 strokeColor: '#000000', // 线条颜色 strokeWidth: '1', // 线条粗细 - shape: mxConstants.SHAPE_LABEL, // 形状 - align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - verticalAlign: mxConstants.ALIGN_CENTER, // 垂直方向对其方式 - imageAlign: mxConstants.ALIGN_LEFT, // 图形水平方向对其方式 - imageVerticalAlign: mxConstants.ALIGN_CENTER, // 图形方向对其方式 + shape: MxConstants.SHAPE_LABEL, // 形状 + align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + verticalAlign: MxConstants.ALIGN_CENTER, // 垂直方向对其方式 + imageAlign: MxConstants.ALIGN_LEFT, // 图形水平方向对其方式 + imageVerticalAlign: MxConstants.ALIGN_CENTER, // 图形方向对其方式 image: beats // 图形 }, }, @@ -263,11 +263,11 @@ export const toolbarItems = [ fillColor: '#FFFFFF', // 填充色 strokeColor: '#000000', // 线条颜色 strokeWidth: '1', // 线条粗细 - shape: mxConstants.SHAPE_LABEL, // 形状 - align: mxConstants.ALIGN_CENTER, // 水平方向对其方式 - verticalAlign: mxConstants.ALIGN_CENTER, // 垂直方向对其方式 - imageAlign: mxConstants.ALIGN_LEFT, // 图形水平方向对其方式 - imageVerticalAlign: mxConstants.ALIGN_CENTER, // 图形方向对其方式 + shape: MxConstants.SHAPE_LABEL, // 形状 + align: MxConstants.ALIGN_CENTER, // 水平方向对其方式 + verticalAlign: MxConstants.ALIGN_CENTER, // 垂直方向对其方式 + imageAlign: MxConstants.ALIGN_LEFT, // 图形水平方向对其方式 + imageVerticalAlign: MxConstants.ALIGN_CENTER, // 图形方向对其方式 image: redis // 图形 }, }, diff --git a/src/views/renderModel/index.js b/src/views/renderModel/index.js new file mode 100644 index 0000000..eb6f626 --- /dev/null +++ b/src/views/renderModel/index.js @@ -0,0 +1,70 @@ +/* + * @Descripttion: + * @version: + * @Author: Jason chen + * @Date: 2021-08-31 11:10:34 + * @LastEditors: Jason chen + * @LastEditTime: 2021-08-31 11:13:05 + */ +const mx = require('mxgraph') + +const mxgraph = mx({ + // 核心中所有图像url的Basepath,不带斜杠。在mxClient.imageBasePath中指定路径. + mxImageBasePath: 'mxgraph/images', + // 核心中的所有url的Basepath,不带斜杠。在mxClient.basePath中指定路径。 + // 指向的路径一定要是一个可以通过 url 访问的静态资源目录 + mxBasePath: 'mxgraph', + // 可选的全局配置变量。切换加载mxGraph和mxEditor中的两个资源文件。 + // 默认值是true。在主线程警告上禁用同步XMLHttpRequest + mxLoadResources: true + // 指定是否应加载任何样式表。 默认值是true。 + // mxLoadStylesheets: false, + // 可选的全局配置变量,在开发模式下强制加载JavaScript文件。 + // mxForceIncludes: true, + // 可选的全局配置变量来指定资源文件的扩展名。 + // mxResourceExtension: '.txt' +}) + +// Object.keys(mxgraph).forEach((key) => { +// window[key] = mxgraph[key]; +// }); + +const MxCell = mxgraph.mxCell +const MxConstants = mxgraph.mxConstants +const MxEvent = mxgraph.mxEvent +const MxGraph = mxgraph.mxGraph + +const MxRubberBand = mxgraph.mxRubberband + +const MxUtils = mxgraph.mxUtils +const MxCodec = mxgraph.mxCodec +const MxGeometry = mxgraph.mxGeometry +const MxEditor = mxgraph.mxEditor +const MxGraphHandler = mxgraph.mxGraphHandler +const MxRectangleShape = mxgraph.mxRectangleShape +const MxCellTracker = mxgraph.mxCellTracker +const MxClient = mxgraph.mxClient +const MxPerimeter = mxgraph.mxPerimeter +const MxEventObject = mxgraph.mxEventObject +const ActiveXObject = mxgraph.activeXObject + + +MxRubberBand.prototype.defaultOpacity = 30 + +export { + MxEvent, + MxGraph, + MxEditor, + MxUtils, + MxGraphHandler, + MxConstants, + MxCodec, + MxRectangleShape, + MxCellTracker, + MxClient, + MxPerimeter, + MxEventObject, + MxGeometry, + MxCell, + ActiveXObject +} \ No newline at end of file diff --git a/src/views/renderModel/index.vue b/src/views/renderModel/index.vue index f877ccb..b8d53b3 100644 --- a/src/views/renderModel/index.vue +++ b/src/views/renderModel/index.vue @@ -5,21 +5,53 @@
Easy Editor
+ style=" + color: rgb(64, 158, 255); + font-weight: 800; + font-size: 22px; + margin-left: 44px; + " + > + Easy Editor +
- - + + - - + + - + @@ -29,8 +61,17 @@ - - + + -
] +
+ ] - + \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 1889418..51bc5e2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -14,7 +14,6 @@ module.exports = { publicPath: './', outputDir: 'dist', lintOnSave: true, - quite: true, configureWebpack: { plugins: [ new ProgressBarPlugin(), From bd0d4fcdb6f23804b1f0cca7b5da56cac4ef7381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Thu, 23 Sep 2021 13:28:48 +0800 Subject: [PATCH 13/47] =?UTF-8?q?'github=E9=83=A8=E7=BD=B2'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 ++++----- package-lock.json | 2 +- package.json | 3 ++- src/views/customToolbar/customToolbar.vue | 1 + vue.config.js | 4 +++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 65b12f7..fec3085 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mxgraph-easyeditor +# Mxgraph-EasyFlowEditor ## 1.什么是 mxgraph @@ -653,7 +653,7 @@ mxgraph 提供了几种自动布局的 API,直接调用 graphLayout 即可 ## 项目源码欢迎 star: -[项目源码地址](https://github.com/Jason-chen-coder/mxgraph-EasyEditor): +[项目源码地址](https://github.com/Jason-chen-coder/Mxgraph-EasyFlowEditor): ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210608102620212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) ## 推荐文章: @@ -669,13 +669,13 @@ mxgraph 提供了几种自动布局的 API,直接调用 graphLayout 即可 ## Project setup ``` -yarn +yarn ``` ### Compiles and hot-reloads for development ``` -yarn serve +yarn serve ``` ### Compiles and minifies for production @@ -684,7 +684,6 @@ yarn serve yarn build ``` - ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/package-lock.json b/package-lock.json index 4c451a2..4b10d56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "mxgraph-easyeditor", + "name": "Mxgraph-EasyFlowEditor", "version": "0.1.0", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index 944e252..06ef5d7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { - "name": "mxgraph-easyeditor", + "name": "Mxgraph-EasyFlowEditor", "version": "0.1.0", "private": true, + "homepage": "https://Jason-chen-coder.github.io/Mxgraph-EasyFlowEditor", "pre-commit": [ "pre-commit" ], diff --git a/src/views/customToolbar/customToolbar.vue b/src/views/customToolbar/customToolbar.vue index f51779f..5852065 100644 --- a/src/views/customToolbar/customToolbar.vue +++ b/src/views/customToolbar/customToolbar.vue @@ -767,6 +767,7 @@ export default { if (!(toolbarDomArray instanceof Array) || toolbarDomArray.length <= 0) { return; } + toolbarDomArray.forEach((dom, domIndex) => { var toolItem = this.toolbarItems[domIndex]; var { width, height } = toolItem; diff --git a/vue.config.js b/vue.config.js index 51bc5e2..6b42050 100644 --- a/vue.config.js +++ b/vue.config.js @@ -11,7 +11,9 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin'); const productionGzipExtensions = ['js', 'css', 'html'] module.exports = { - publicPath: './', + publicPath: process.env.NODE_ENV === 'production' + ? '/Mxgraph-EasyFlowEditor/' + : '/', outputDir: 'dist', lintOnSave: true, configureWebpack: { From 3424ab14caa3a16ffdaa657b79134bbf13d9fd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 13:40:53 +0800 Subject: [PATCH 14/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/buildAndDeploy.yml diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml new file mode 100644 index 0000000..4c129a1 --- /dev/null +++ b/.github/workflows/buildAndDeploy.yml @@ -0,0 +1,17 @@ +name: buildAndDeploy +on: + push +jobs: + build-and-deploy: + runs-on: ubuntu-latest # 我们选择使用最新的ubuntu系统 + steps: + - name: checkout + uses: actions/checkout@master # 将代码拷贝到虚机中 + + - name: buildAndDeploy + uses: JamesIves/github-pages-deploy-action@master + env: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret + BRANCH: V1.0-beat # 存放产物的分支名称 + FOLDER: dist # 存放build后产物的目录 + BUILD_SCRIPT: npm install && npm run build # 执行的命令 From 23944c1c0f7738788284382939b069e2232241f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 13:44:58 +0800 Subject: [PATCH 15/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 4c129a1..4c351e3 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -9,7 +9,7 @@ jobs: uses: actions/checkout@master # 将代码拷贝到虚机中 - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@master + uses: Jason-chen-coder/Mxgraph-EasyFlowEditor@V1.0-beat env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret BRANCH: V1.0-beat # 存放产物的分支名称 From 1ce244d74305ffc7a77e6b1e9b93bd452ba2fd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 13:46:37 +0800 Subject: [PATCH 16/47] buildAndDeploy.yml buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 4c351e3..e017da7 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -9,7 +9,7 @@ jobs: uses: actions/checkout@master # 将代码拷贝到虚机中 - name: buildAndDeploy - uses: Jason-chen-coder/Mxgraph-EasyFlowEditor@V1.0-beat + uses: JamesIves/github-pages-deploy-action@master env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret BRANCH: V1.0-beat # 存放产物的分支名称 From 2bfbe5e89a0870d6956dd6691f28fc0df93ed312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:09:39 +0800 Subject: [PATCH 17/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 48 ++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index e017da7..b2840e2 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -1,17 +1,39 @@ -name: buildAndDeploy -on: - push +# 工作流名称,不设置的话默认取配置文件名 +name: Build and Deploy +# 指定触发 workflow 的条件 +# 指定触发事件时,可以限定分支或标签 +# 当前是 只有 master分支上触发 push 事件时才执行工作流任务 +on: + push: + branches: + - V1.0-beat +# 工作流执行的一个或多个任务 jobs: + # 任务名称 build-and-deploy: - runs-on: ubuntu-latest # 我们选择使用最新的ubuntu系统 + # 任务运行的容器类型(虚拟机环境) + runs-on: ubuntu-latest + # 任务执行的步骤 steps: - - name: checkout - uses: actions/checkout@master # 将代码拷贝到虚机中 + # 步骤名称 + - name: Checkout 🛎️ + # 使用的操作 actions,可以使用公共仓库,本地仓库,别人的仓库的action + # 拉取代码 + uses: actions/checkout@V1.0-beat - - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@master - env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret - BRANCH: V1.0-beat # 存放产物的分支名称 - FOLDER: dist # 存放build后产物的目录 - BUILD_SCRIPT: npm install && npm run build # 执行的命令 + - name: Build and Deploy + # 构建发布 Github pages + uses: JamesIves/github-pages-deploy-action@releases/v2 + # 该步骤所需的环境变量 + env: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + # 在部署前要checkout的基本分支,默认是master + BASE_BRANCH: V1.0-beat # The branch the action should deploy from. + # 指定部署的分支,默认是 gh-pages 分支 + BRANCH: V1.0-beat # The branch the action should deploy to. + # 存储库中要部署的文件夹。 + # 该步骤会将项目中 FOLDER 指定文件夹下的文件推送到 BRANCH 分支,作为Github Pages 部署的内容。 + # Vue CLI默认打包到 dist 目录 + FOLDER: dist # The folder the action should deploy. + # 在向 BRANCH 分支推送代码前,可以指定构建脚本 + BUILD_SCRIPT: yarn && yarn build # The build script the action should run prior to deploying. From f54dbaf3247e553319b86f5236592506aec5c836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:11:57 +0800 Subject: [PATCH 18/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index b2840e2..553ddb1 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -6,7 +6,7 @@ name: Build and Deploy on: push: branches: - - V1.0-beat + - master # 工作流执行的一个或多个任务 jobs: # 任务名称 @@ -19,7 +19,7 @@ jobs: - name: Checkout 🛎️ # 使用的操作 actions,可以使用公共仓库,本地仓库,别人的仓库的action # 拉取代码 - uses: actions/checkout@V1.0-beat + uses: actions/checkout@master - name: Build and Deploy # 构建发布 Github pages From 2367bf558e5c22b2eebb7d7ba542e6cb2f349c26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:14:14 +0800 Subject: [PATCH 19/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 47 ++++++++-------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 553ddb1..f6a9e7f 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -1,39 +1,18 @@ # 工作流名称,不设置的话默认取配置文件名 -name: Build and Deploy -# 指定触发 workflow 的条件 -# 指定触发事件时,可以限定分支或标签 -# 当前是 只有 master分支上触发 push 事件时才执行工作流任务 -on: - push: - branches: - - master -# 工作流执行的一个或多个任务 +name: buildAndDeploy +on: + push jobs: - # 任务名称 build-and-deploy: - # 任务运行的容器类型(虚拟机环境) - runs-on: ubuntu-latest - # 任务执行的步骤 + runs-on: ubuntu-latest # 我们选择使用最新的ubuntu系统 steps: - # 步骤名称 - - name: Checkout 🛎️ - # 使用的操作 actions,可以使用公共仓库,本地仓库,别人的仓库的action - # 拉取代码 - uses: actions/checkout@master + - name: checkout + uses: actions/checkout@V1.0-beat # 将代码拷贝到虚机中 - - name: Build and Deploy - # 构建发布 Github pages - uses: JamesIves/github-pages-deploy-action@releases/v2 - # 该步骤所需的环境变量 - env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} - # 在部署前要checkout的基本分支,默认是master - BASE_BRANCH: V1.0-beat # The branch the action should deploy from. - # 指定部署的分支,默认是 gh-pages 分支 - BRANCH: V1.0-beat # The branch the action should deploy to. - # 存储库中要部署的文件夹。 - # 该步骤会将项目中 FOLDER 指定文件夹下的文件推送到 BRANCH 分支,作为Github Pages 部署的内容。 - # Vue CLI默认打包到 dist 目录 - FOLDER: dist # The folder the action should deploy. - # 在向 BRANCH 分支推送代码前,可以指定构建脚本 - BUILD_SCRIPT: yarn && yarn build # The build script the action should run prior to deploying. + - name: buildAndDeploy + uses: JamesIves/github-pages-deploy-action@releases/v2 + env: + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret + BRANCH: V1.0-beat # 存放产物的分支名称 + FOLDER: dist # 存放build后产物的目录 + BUILD_SCRIPT: npm install && npm run build # 执行的命令 From dfcbbebd40bd3ca5038cf226d71fc9f1d4213633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:15:28 +0800 Subject: [PATCH 20/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index f6a9e7f..fa9a50f 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest # 我们选择使用最新的ubuntu系统 steps: - name: checkout - uses: actions/checkout@V1.0-beat # 将代码拷贝到虚机中 + uses: actions/checkout@master # 将代码拷贝到虚机中 - name: buildAndDeploy uses: JamesIves/github-pages-deploy-action@releases/v2 From f7e553a0c7df2edc81e92077242aaaedf9ce2e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:17:01 +0800 Subject: [PATCH 21/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index fa9a50f..9a15cea 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -10,7 +10,7 @@ jobs: uses: actions/checkout@master # 将代码拷贝到虚机中 - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@releases/v2 + uses: JamesIves/github-pages-deploy-action@master env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret BRANCH: V1.0-beat # 存放产物的分支名称 From b14144560f7d0c153def289d9a620383674424cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:19:08 +0800 Subject: [PATCH 22/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 9a15cea..049fe26 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -1,4 +1,3 @@ -# 工作流名称,不设置的话默认取配置文件名 name: buildAndDeploy on: push @@ -10,9 +9,9 @@ jobs: uses: actions/checkout@master # 将代码拷贝到虚机中 - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@master + uses: JamesIves/github-pages-deploy-action@master env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret - BRANCH: V1.0-beat # 存放产物的分支名称 + BRANCH: gh-pages # 存放产物的分支名称 FOLDER: dist # 存放build后产物的目录 BUILD_SCRIPT: npm install && npm run build # 执行的命令 From e1758804b2fedbd62c0c04d08ae08b11c6a276e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:20:19 +0800 Subject: [PATCH 23/47] buildAndDeploy.yml buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 049fe26..28c27f0 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -9,7 +9,7 @@ jobs: uses: actions/checkout@master # 将代码拷贝到虚机中 - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@master + uses: JamesIves/github-pages-deploy-action@4.1.4 env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret BRANCH: gh-pages # 存放产物的分支名称 From 8fb76f15dd2a65419aa34cf5a477c394549102f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:23:05 +0800 Subject: [PATCH 24/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 28c27f0..c1edd7c 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -9,9 +9,10 @@ jobs: uses: actions/checkout@master # 将代码拷贝到虚机中 - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@4.1.4 + uses: JamesIves/github-pages-deploy-action@3.7.1 env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret BRANCH: gh-pages # 存放产物的分支名称 FOLDER: dist # 存放build后产物的目录 + CLEAN: true BUILD_SCRIPT: npm install && npm run build # 执行的命令 From 79db95438f1aa26dd33c2698a12d8667f90c3977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:24:29 +0800 Subject: [PATCH 25/47] buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index c1edd7c..27daf5c 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -12,7 +12,7 @@ jobs: uses: JamesIves/github-pages-deploy-action@3.7.1 env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret - BRANCH: gh-pages # 存放产物的分支名称 + BRANCH: V1.0-beat # 存放产物的分支名称 FOLDER: dist # 存放build后产物的目录 CLEAN: true BUILD_SCRIPT: npm install && npm run build # 执行的命令 From d22cde03c6f50736e3b11a4be7a23aba89546d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:31:19 +0800 Subject: [PATCH 26/47] buildAndDeploy.yml buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 27daf5c..684313f 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -1,18 +1,18 @@ -name: buildAndDeploy +name: GitHub Actions Build and Deploy Demo on: - push + push: + branches: + - master jobs: build-and-deploy: - runs-on: ubuntu-latest # 我们选择使用最新的ubuntu系统 + runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@master # 将代码拷贝到虚机中 - - - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@3.7.1 + - name: Checkout + uses: actions/checkout@master + - name: Build and Deploy + uses: JamesIves/github-pages-deploy-action@master env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret - BRANCH: V1.0-beat # 存放产物的分支名称 - FOLDER: dist # 存放build后产物的目录 - CLEAN: true - BUILD_SCRIPT: npm install && npm run build # 执行的命令 + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} + BRANCH: gh-pages + FOLDER: dist + BUILD_SCRIPT: npm install && npm run build From 95ab6c6c74d41d19a5135d009112633ad2d9cfc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:33:54 +0800 Subject: [PATCH 27/47] buildAndDeploy.yml buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 684313f..049fe26 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -1,18 +1,17 @@ -name: GitHub Actions Build and Deploy Demo +name: buildAndDeploy on: - push: - branches: - - master + push jobs: build-and-deploy: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # 我们选择使用最新的ubuntu系统 steps: - - name: Checkout - uses: actions/checkout@master - - name: Build and Deploy - uses: JamesIves/github-pages-deploy-action@master + - name: checkout + uses: actions/checkout@master # 将代码拷贝到虚机中 + + - name: buildAndDeploy + uses: JamesIves/github-pages-deploy-action@master env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} - BRANCH: gh-pages - FOLDER: dist - BUILD_SCRIPT: npm install && npm run build + ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret + BRANCH: gh-pages # 存放产物的分支名称 + FOLDER: dist # 存放build后产物的目录 + BUILD_SCRIPT: npm install && npm run build # 执行的命令 From 247c2085e564fa9f1d928c0b7a73947e9b9c7578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:35:35 +0800 Subject: [PATCH 28/47] buildAndDeploy.yml buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 049fe26..22a3999 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -9,7 +9,7 @@ jobs: uses: actions/checkout@master # 将代码拷贝到虚机中 - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@master + uses: JamesIves/github-pages-deploy-action@3.7.1 env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret BRANCH: gh-pages # 存放产物的分支名称 From 7f6beab54366ea56f3bec161160a544319304deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:36:53 +0800 Subject: [PATCH 29/47] buildAndDeploy.yml buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 22a3999..97d682c 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -12,6 +12,6 @@ jobs: uses: JamesIves/github-pages-deploy-action@3.7.1 env: ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret - BRANCH: gh-pages # 存放产物的分支名称 + BRANCH: gh-page # 存放产物的分支名称 FOLDER: dist # 存放build后产物的目录 BUILD_SCRIPT: npm install && npm run build # 执行的命令 From 03128dc47ff864a1dd8c0d936cd7855bab0677fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:40:01 +0800 Subject: [PATCH 30/47] buildAndDeploy.yml buildAndDeploy.yml --- .github/workflows/buildAndDeploy.yml | 39 ++++++++++++++++++---------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/buildAndDeploy.yml b/.github/workflows/buildAndDeploy.yml index 97d682c..a553d5e 100644 --- a/.github/workflows/buildAndDeploy.yml +++ b/.github/workflows/buildAndDeploy.yml @@ -1,17 +1,30 @@ -name: buildAndDeploy +# name 可以自定义 +name: CI +# 指定触发workflow的条件 +# 下面的意思就是在监听到main分支push操作的时候运行 on: - push + push: + branches: [ main ] + +# jobs 表示要执行的一项或者多项任务 jobs: + # 任务名,可自定义 build-and-deploy: - runs-on: ubuntu-latest # 我们选择使用最新的ubuntu系统 + # runs-on字段指定运行所需要的虚拟机环境。它是必填字段。目前可用的虚拟机如下。 + runs-on: ubuntu-latest + # steps表示执行步骤 steps: - - name: checkout - uses: actions/checkout@master # 将代码拷贝到虚机中 - - - name: buildAndDeploy - uses: JamesIves/github-pages-deploy-action@3.7.1 - env: - ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} # 使用刚新建的secret - BRANCH: gh-page # 存放产物的分支名称 - FOLDER: dist # 存放build后产物的目录 - BUILD_SCRIPT: npm install && npm run build # 执行的命令 + # 检出代码,这里用了 actions/checkout@master 库来完成 + - name: Checkout + uses: actions/checkout@master + # 这里展示了如何执行多条命令 + - name: Install and Build + run: | + npm install + npm run build + # 这里引用了别人写好的发布库,具体参数信息可以查阅上面的链接 + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.0.0 + with: + branch: gh-pages + folder: dist From d0ffd02449f5630c75389d85265332c231449b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:40:54 +0800 Subject: [PATCH 31/47] buildAndDeploy.yml buildAndDeploy.yml From b5d189b070e0f08f7e521dacf462ab1675f1ffa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:43:40 +0800 Subject: [PATCH 32/47] ci.yml ci.yml --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d1ad6fc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the V1.0-beat branch + push: + branches: [ V1.0-beat ] + pull_request: + branches: [ V1.0-beat ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# jobs 表示要执行的一项或者多项任务 +jobs: + # 任务名,可自定义 + build-and-deploy: + # runs-on字段指定运行所需要的虚拟机环境。它是必填字段。目前可用的虚拟机如下。 + runs-on: ubuntu-latest + # steps表示执行步骤 + steps: + # 检出代码,这里用了 actions/checkout@master 库来完成 + - name: Checkout + uses: actions/checkout@master + # 这里展示了如何执行多条命令 + - name: Install and Build + run: | + npm install + npm run build + # 这里引用了别人写好的发布库,具体参数信息可以查阅上面的链接 + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.0.0 + with: + branch: gh-pages + folder: dist From a62a5c924fb854a7ba19bf530e6ffe486bf5bf78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 23 Sep 2021 14:55:33 +0800 Subject: [PATCH 33/47] ci.yml ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1ad6fc..576a942 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,8 @@ jobs: # 这里展示了如何执行多条命令 - name: Install and Build run: | - npm install - npm run build + yarn + yarn build # 这里引用了别人写好的发布库,具体参数信息可以查阅上面的链接 - name: Deploy to GitHub Pages uses: JamesIves/github-pages-deploy-action@4.0.0 From fb1919cbbc4d35850b0155045b7c628681e72f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <561864073@qq.com> Date: Fri, 24 Sep 2021 14:17:59 +0800 Subject: [PATCH 34/47] =?UTF-8?q?'=E5=8E=BB=E9=99=A4=E6=89=93=E5=8C=85?= =?UTF-8?q?=E6=8F=92=E4=BB=B6'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue.config.js | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/vue.config.js b/vue.config.js index 6b42050..661c5eb 100644 --- a/vue.config.js +++ b/vue.config.js @@ -3,12 +3,12 @@ const path = require('path'); function resolve (dir) { return path.join(__dirname, dir); } -const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; -const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); -const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); -const CompressionWebpackPlugin = require('compression-webpack-plugin'); -const ProgressBarPlugin = require('progress-bar-webpack-plugin'); -const productionGzipExtensions = ['js', 'css', 'html'] +// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; +// const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +// const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); +// const CompressionWebpackPlugin = require('compression-webpack-plugin'); +// const ProgressBarPlugin = require('progress-bar-webpack-plugin'); +// const productionGzipExtensions = ['js', 'css', 'html'] module.exports = { publicPath: process.env.NODE_ENV === 'production' @@ -18,15 +18,15 @@ module.exports = { lintOnSave: true, configureWebpack: { plugins: [ - new ProgressBarPlugin(), - new BundleAnalyzerPlugin(), - new CompressionWebpackPlugin({ - filename: '[path].gz[query]', - algorithm: 'gzip', - test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$',), - threshold: 10240,//仅处理大于此大小的资产。以字节为单位。 - minRatio: 0.8, - }), + // new ProgressBarPlugin(), + // new BundleAnalyzerPlugin(), + // new CompressionWebpackPlugin({ + // filename: '[path].gz[query]', + // algorithm: 'gzip', + // test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$',), + // threshold: 10240,//仅处理大于此大小的资产。以字节为单位。 + // minRatio: 0.8, + // }), ], optimization: { // splitChunks: { @@ -58,34 +58,34 @@ module.exports = { // }, // } // }, - minimizer: [new UglifyJsPlugin( - { - uglifyOptions: { - compress: { - reduce_vars: true,// 把使用多次的静态值自动定义为变量 - drop_debugger: true,// 删除所有的debugger语句 - drop_console: true,// 删除所有的console语句 - }, - parallel: true, // 允许并发 - cache: true, // 开启缓存 - output: { - beautify: false // 使输出的代码尽可能紧凑 - } - }, - } - ), - new CssMinimizerPlugin({ - parallel: true,// 多并发执行 - minimizerOptions: { - preset: [ - "default", - { - discardComments: { removeAll: true },//移除所有注释 - }, - ], - }, - })], - + // minimizer: [ + // new UglifyJsPlugin( + // { + // uglifyOptions: { + // compress: { + // reduce_vars: true,// 把使用多次的静态值自动定义为变量 + // drop_debugger: true,// 删除所有的debugger语句 + // drop_console: true,// 删除所有的console语句 + // }, + // parallel: true, // 允许并发 + // cache: true, // 开启缓存 + // output: { + // beautify: false // 使输出的代码尽可能紧凑 + // } + // }, + // } + // ), + // new CssMinimizerPlugin({ + // parallel: true,// 多并发执行 + // minimizerOptions: { + // preset: [ + // "default", + // { + // discardComments: { removeAll: true },//移除所有注释 + // }, + // ], + // }, + // })], }, }, chainWebpack: (config) => { From f6d57c714535651668a31fb5f265a4feaae764f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Fri, 24 Sep 2021 14:33:02 +0800 Subject: [PATCH 35/47] Create SECURITY.md --- SECURITY.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..034e848 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. From a883b8a2e260615231caadebc44c9c9e17c0a861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Tue, 17 May 2022 09:05:39 +0800 Subject: [PATCH 36/47] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fec3085..633704c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mxgraph-EasyFlowEditor +# Mxgraph-Editor ## 1.什么是 mxgraph From cd4c9e519c66b2868fac5bea7dc57e521579c592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Tue, 17 May 2022 09:10:22 +0800 Subject: [PATCH 37/47] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 633704c..fec3085 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mxgraph-Editor +# Mxgraph-EasyFlowEditor ## 1.什么是 mxgraph From 2a3351b2e1e8b6241c9df8d4b0a04942084ce312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Mon, 29 Aug 2022 10:56:14 +0800 Subject: [PATCH 38/47] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fec3085..fa55859 100644 --- a/README.md +++ b/README.md @@ -687,3 +687,7 @@ yarn build ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). + +## Star 趋势图 + +[![Stargazers over time](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor.svg)](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor) From 7439f682807f58b8dac27c864b56e2a845d7e3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Thu, 1 Sep 2022 09:36:20 +0800 Subject: [PATCH 39/47] Update README.md --- README.md | 82 +++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index fa55859..84e9532 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,46 @@ # Mxgraph-EasyFlowEditor +## 项目源码欢迎 star: + +[项目源码地址](https://github.com/Jason-chen-coder/Mxgraph-EasyFlowEditor): +![在这里插入图片描述](https://img-blog.csdnimg.cn/20210608102620212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) + +## 推荐文章: + +1.基于 mxGraph 的可视化环境组网设计器:https://github.com/igonglei/env-editor + +2.mxGraph 学习笔记:https://www.kancloud.cn/wujie520303/mxgraph/1434409 + +3.功能全面的案例:https://github.com/lanniu/vue-mxgraph-example + +4.关于 mxGraph 可搜索的 API 中文文档:https://api.mxgraph.lanniu.top/#/ + +## Project setup + +``` +yarn +``` + +### Compiles and hot-reloads for development + +``` +yarn serve +``` + +### Compiles and minifies for production + +``` +yarn build +``` + +### Customize configuration + +See [Configuration Reference](https://cli.vuejs.org/config/). + +## Star 趋势图 + +[![Stargazers over time](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor.svg)](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor) + ## 1.什么是 mxgraph mxGraph 是一个 JavaScript 图表库,可以快速创建交互式图形和图表应用程序,这些应用程序可以在其供应商支持的任何主要浏览器中运行。mxGraph 提供图形绘制、图形可视化、图形交互、图形布局、图形分析等能力, 适用于工作流程图、BPMN 图、网络图、UML 图、循环图、组织结构图、MindMap 图、机架图、甘特图、信息图、平面图等绘制。 @@ -650,44 +691,3 @@ mxgraph 提供了几种自动布局的 API,直接调用 graphLayout 即可 } ``` - -## 项目源码欢迎 star: - -[项目源码地址](https://github.com/Jason-chen-coder/Mxgraph-EasyFlowEditor): -![在这里插入图片描述](https://img-blog.csdnimg.cn/20210608102620212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) - -## 推荐文章: - -1.基于 mxGraph 的可视化环境组网设计器:https://github.com/igonglei/env-editor - -2.mxGraph 学习笔记:https://www.kancloud.cn/wujie520303/mxgraph/1434409 - -3.功能全面的案例:https://github.com/lanniu/vue-mxgraph-example - -4.关于 mxGraph 可搜索的 API 中文文档:https://api.mxgraph.lanniu.top/#/ - -## Project setup - -``` -yarn -``` - -### Compiles and hot-reloads for development - -``` -yarn serve -``` - -### Compiles and minifies for production - -``` -yarn build -``` - -### Customize configuration - -See [Configuration Reference](https://cli.vuejs.org/config/). - -## Star 趋势图 - -[![Stargazers over time](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor.svg)](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor) From 0d84143ad6ab4146178602726dad6eef13043585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Fri, 2 Sep 2022 17:47:15 +0800 Subject: [PATCH 40/47] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84e9532..2da95ce 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ yarn build See [Configuration Reference](https://cli.vuejs.org/config/). -## Star 趋势图 +## Star 趋势图 [![Stargazers over time](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor.svg)](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor) From 3a4754ea7a5e7bfc8012c653e6cc260602785a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:36:33 +0800 Subject: [PATCH 41/47] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2da95ce..5dc9475 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Mxgraph-EasyFlowEditor +# Mxgraph-EasyFlowEdito + 本项目是基于mxGraph+vue设计的流程图编辑器,可用于流程图绘制,流程渲染等等 ## 项目源码欢迎 star: From 2e4b62e29b97a09956648f59f83d0477c3c5bd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:47:22 +0800 Subject: [PATCH 42/47] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5dc9475..a77b850 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ ## 项目源码欢迎 star: [项目源码地址](https://github.com/Jason-chen-coder/Mxgraph-EasyFlowEditor): +项目展示: ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210608102620212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) +https://img-blog.csdnimg.cn/2c18e17f1f47442e8f36e775aa5b3497.png## ## 推荐文章: @@ -34,10 +36,6 @@ yarn serve yarn build ``` -### Customize configuration - -See [Configuration Reference](https://cli.vuejs.org/config/). - ## Star 趋势图 [![Stargazers over time](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor.svg)](https://starchart.cc/Jason-chen-coder/Mxgraph-EasyFlowEditor) From 4fa8a401bd2d070d4e22b5211ac2d7126031df08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:49:19 +0800 Subject: [PATCH 43/47] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a77b850..cbc4f64 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ ## 项目源码欢迎 star: [项目源码地址](https://github.com/Jason-chen-coder/Mxgraph-EasyFlowEditor): + 项目展示: ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210608102620212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) -https://img-blog.csdnimg.cn/2c18e17f1f47442e8f36e775aa5b3497.png## + +![在这里插入图片描述](https://img-blog.csdnimg.cn/2c18e17f1f47442e8f36e775aa5b3497.png) ## 推荐文章: From ea06173e516efaee2f1c6ce660a130aa2bb8c375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:53:47 +0800 Subject: [PATCH 44/47] Update README.md --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cbc4f64..9efe544 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # Mxgraph-EasyFlowEdito - 本项目是基于mxGraph+vue设计的流程图编辑器,可用于流程图绘制,流程渲染等等 + 本项目是基于mxGraph+vue设计的流程图编辑器,可用于流程图绘制,流程渲染等等;欢迎交流,欢迎star,谢谢!: ## 项目源码欢迎 star: -[项目源码地址](https://github.com/Jason-chen-coder/Mxgraph-EasyFlowEditor): - 项目展示: -![在这里插入图片描述](https://img-blog.csdnimg.cn/20210608102620212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) +![Vue生命周期流程的绘制](https://img-blog.csdnimg.cn/20210608102620212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) -![在这里插入图片描述](https://img-blog.csdnimg.cn/2c18e17f1f47442e8f36e775aa5b3497.png) +![定制化场景的流程渲染](https://img-blog.csdnimg.cn/2c18e17f1f47442e8f36e775aa5b3497.png) ## 推荐文章: From e2023c029904dd0a9bd20fb6bd30a6c6afc67b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Tue, 6 Sep 2022 16:55:58 +0800 Subject: [PATCH 45/47] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9efe544..477a1be 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ # Mxgraph-EasyFlowEdito 本项目是基于mxGraph+vue设计的流程图编辑器,可用于流程图绘制,流程渲染等等;欢迎交流,欢迎star,谢谢!: -## 项目源码欢迎 star: - -项目展示: +## 项目展示: ![Vue生命周期流程的绘制](https://img-blog.csdnimg.cn/20210608102620212.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl8zOTA4NTgyMg==,size_16,color_FFFFFF,t_70) ![定制化场景的流程渲染](https://img-blog.csdnimg.cn/2c18e17f1f47442e8f36e775aa5b3497.png) ## 推荐文章: +以下是个人认为对上手mxgraph非常有帮助的文章: 1.基于 mxGraph 的可视化环境组网设计器:https://github.com/igonglei/env-editor From 1ecb4e6c570236790b29b65739501553a773a769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Tue, 6 Sep 2022 17:00:14 +0800 Subject: [PATCH 46/47] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 477a1be..f6a8f63 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ## 推荐文章: 以下是个人认为对上手mxgraph非常有帮助的文章: -1.基于 mxGraph 的可视化环境组网设计器:https://github.com/igonglei/env-editor +1.基于 mxGraph 的可视化环境组网设计器:[https://github.com/igonglei/env-editor](https://github.com/yooSeeFly/env-editor) 2.mxGraph 学习笔记:https://www.kancloud.cn/wujie520303/mxgraph/1434409 From 4a11ac4417a9c91046055b7b672406f2cfef114f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=82=E7=9C=81=E9=92=B1?= <53551357+Jason-chen-coder@users.noreply.github.com> Date: Mon, 27 Feb 2023 11:19:47 +0800 Subject: [PATCH 47/47] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6a8f63..430b72c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mxgraph-EasyFlowEdito +# Mxgraph-EasyFlowEditor 本项目是基于mxGraph+vue设计的流程图编辑器,可用于流程图绘制,流程渲染等等;欢迎交流,欢迎star,谢谢!: ## 项目展示: