Skip to content

Commit

Permalink
Разработал порядок работы с плагинами
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiontik committed Dec 18, 2022
1 parent 4bcb181 commit 1bdf9cd
Show file tree
Hide file tree
Showing 18 changed files with 11,132 additions and 19,725 deletions.
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
last 2 years
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"node": true,
"jest": true
},
"globals": {
"DocHub": true
},
"ignorePatterns": ["**/public/libs/*.js"],
"extends": [
"eslint:recommended",
Expand Down
3 changes: 0 additions & 3 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,5 @@
# Если "y" подключает контроль метамодели DocHub
# VUE_APP_DOCHUB_APPEND_DOCHUB_METAMODEL= y / n

# Если "plugin" сборка осуществляется для использования в IDEA плагине https://github.com/RabotaRu/DocHubIdeaPlugin
# VUE_APP_DOCHUB_MODE=plugin

# Определяет движок рендеринга (graphviz | smetana | elk). По умолчанию ELK
# VUE_APP_DOCHUB_RENDER_CORE=ELK
29,509 changes: 10,929 additions & 18,580 deletions package-lock.json

Large diffs are not rendered by default.

53 changes: 26 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.1.0",
"private": true,
"scripts": {
"plugin": "vue-cli-service build --name plugin --target lib plugins/*/*.vue",
"lib": "vue-cli-service build --name test --target lib ",
"plugin": "export VUE_APP_DOCHUB_MODE=plugin && vue-cli-service build",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
Expand All @@ -13,57 +14,55 @@
"dependencies": {
"@asyncapi/web-component": "0.24.23",
"@mdi/font": "5.9.55",
"@mermaid-js/mermaid-mindmap": "^9.2.2",
"@mermaid-js/mermaid-mindmap": "9.3.0",
"ajv": "8.11.0",
"ajv-i18n": "4.2.0",
"axios": "0.21.1",
"axios": "^0.21.4",
"dateformat": "3.0.3",
"dochub-plugin-html": "file:plugins/html",
"jsonata": "1.8.6",
"mustache": "4.2.0",
"swagger-ui": "3.24.3",
"swagger-ui": "3.52.5",
"vis-network": "9.1.2",
"vue": "2.6.11",
"vue-code-diff": "0.0.4",
"vue": "2.7.14",
"vue-cookie": "1.1.4",
"vue-markdown": "2.2.4",
"vue-router": "3.1.5",
"vue-router": "3.6.5",
"vue-split-panel": "1.0.4",
"vuetify": "2.2.14",
"vuex": "3.1.2",
"vuetify": "2.6.13",
"vuex": "3.6.2",
"yaml": "1.10.2"
},
"devDependencies": {
"@babel/eslint-parser": "7.18.9",
"@types/jest": "28.1.6",
"@vue/cli-plugin-babel": "4.2.2",
"@vue/cli-plugin-eslint": "4.2.2",
"@vue/cli-service": "4.2.2",
"@babel/eslint-parser": "7.19.1",
"@types/jest": "28.1.8",
"@vue/cli-plugin-babel": "5.0.8",
"@vue/cli-plugin-eslint": "5.0.8",
"@vue/cli-service": "5.0.8",
"babel-eslint": "10.1.0",
"babel-loader": "8.0.6",
"css-loader": "3.4.2",
"babel-loader": "8.3.0",
"cross-env": "7.0.3",
"css-loader": "3.6.0",
"eslint": "7.32.0",
"eslint-plugin-vue": "7.20.0",
"html-webpack-inline-source-plugin": "0.0.10",
"html-webpack-plugin": "5.5.0",
"jest": "28.1.3",
"mermaid": "9.2.2",
"postcss-loader": "2.0.8",
"mermaid": "9.3.0",
"postcss-loader": "2.1.6",
"raw-loader": "4.0.2",
"vue-loader": "13.7.3",
"vue-monaco": "0.3.1",
"vue-monaco": "0.3.2",
"vue-style-loader": "3.1.2",
"vue-template-compiler": "2.6.11"
"vue-template-compiler": "2.7.14",
"webpack-pwa-manifest": "4.3.0"
},
"plugins": {
"html": "html/html"
"html": "html/index",
"svg": "svg/index"
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
}
13 changes: 13 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "DocHub",
"short_name": "DocHub",
"orientation": "portrait",
"display": "standalone",
"start_url": ".",
"description": "Actitecture as a code",
"background_color": "#ffffff",
"plugins": [
"/plugins/html.js",
"/plugins/svg.js"
]
}
32 changes: 32 additions & 0 deletions src/building/plugin-maker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const pluginName = 'PluginMakerWebpackPlugin';

const { ConcatSource } = require('webpack-sources');

module.exports = class PluginMakerWebpackPlugin {
constructor(options) {
this.options = Object.assign(options || {}, {
filer: /^plugins\/.*\.js$/
});
this.options.test = new RegExp(this.options.test);
}
apply(compiler) {
compiler.hooks.compilation.tap(pluginName, compilation => {
compilation.hooks.processAssets.tap(
{
name: pluginName,
stage: compilation.PROCESS_ASSETS_STAGE_ADDITIONS
},
() => {
for (const chunk of compilation.chunks) {
for (const file of chunk.files) {
if (this.options.filer.test(file)) {
compilation.updateAsset(file, old => {
return new ConcatSource('(function (DocHub){', old, '})(window.DocHub);');
});
}
}
}
});
});
}
};
106 changes: 0 additions & 106 deletions src/components/Branches.vue

This file was deleted.

59 changes: 0 additions & 59 deletions src/components/CatalogSelector.vue

This file was deleted.

68 changes: 0 additions & 68 deletions src/components/Conditions.vue

This file was deleted.

Loading

0 comments on commit 1bdf9cd

Please sign in to comment.