diff --git a/.eslintrc.js b/.eslintrc.js index d1e8af7..d855032 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,6 +8,7 @@ module.exports = { 'plugin:vue/recommended', ], parserOptions: { + parser: "babel-eslint", ecmaVersion: 2018, sourceType: 'module', }, diff --git a/package-lock.json b/package-lock.json index 6ce5c01..bc6c04a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2458,6 +2458,20 @@ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==" }, + "babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + } + }, "babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", diff --git a/package.json b/package.json index 732d80c..2ea69de 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ }, "devDependencies": { "@vue/cli-service": "^4.5.4", + "babel-eslint": "^10.1.0", "copyfiles": "^2.3.0", "duplicate-package-checker-webpack-plugin": "^3.0.0", "eslint": "^7.8.1", diff --git a/src/nginxconfig/templates/app.vue b/src/nginxconfig/templates/app.vue index 1d3465c..ccb2514 100644 --- a/src/nginxconfig/templates/app.vue +++ b/src/nginxconfig/templates/app.vue @@ -80,12 +80,15 @@ THE SOFTWARE.

{{ i18n.templates.app.configFiles }}

- +
@@ -113,9 +116,10 @@ THE SOFTWARE. import Domain from './domain'; import Global from './global'; import Setup from './setup'; - import NginxPrism from './prism/nginx'; import Footer from './footer'; + import NginxPrism from './prism/nginx'; + export default { name: 'App', components: { @@ -125,6 +129,8 @@ THE SOFTWARE. Global, Setup, NginxPrism, + 'YamlPrism': () => import('./prism/yaml'), + 'DockerPrism': () => import('./prism/docker'), }, data() { return { @@ -264,6 +270,17 @@ THE SOFTWARE. splitColumnEvent(nonInteraction = false) { analytics('toggle_split_column', 'Button', undefined, Number(this.$data.splitColumn), nonInteraction); }, + getPrismComponent(confName) + { + switch (confName) { + case '/etc/nginx/Dockerfile': + return 'DockerPrism'; + case '/etc/nginx/docker-compose.yaml': + return 'YamlPrism'; + default: + return 'NginxPrism'; + } + }, }, }; diff --git a/src/nginxconfig/templates/prism/docker.vue b/src/nginxconfig/templates/prism/docker.vue new file mode 100644 index 0000000..96635db --- /dev/null +++ b/src/nginxconfig/templates/prism/docker.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/src/nginxconfig/templates/prism/yaml.vue b/src/nginxconfig/templates/prism/yaml.vue new file mode 100644 index 0000000..675bb01 --- /dev/null +++ b/src/nginxconfig/templates/prism/yaml.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/vue.config.js b/vue.config.js index f195a0d..5312a44 100644 --- a/vue.config.js +++ b/vue.config.js @@ -25,7 +25,6 @@ THE SOFTWARE. */ const path = require('path'); -const { LimitChunkCountPlugin } = require('webpack').optimize; const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin'); @@ -37,7 +36,6 @@ module.exports = { configureWebpack: { node: false, // Disable Node.js polyfills (Buffer etc.) -- This will be default in Webpack 5 plugins: [ - new LimitChunkCountPlugin({ maxChunks: 1 }), // Generate a single CSS & JS file for easy embedding process.argv.includes('--analyze') && new BundleAnalyzerPlugin(), process.argv.includes('--analyze') && new DuplicatePackageCheckerPlugin(), ].filter(x => !!x),