From c65b9d517bba7a1dbcfc4db5fadbde69b728d318 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Thu, 30 Jul 2020 20:26:37 +0200 Subject: [PATCH] Remove dead code `urlRegexp` --- src/detectors/README.md | 2 -- src/detectors/angular.js | 1 - src/detectors/brunch.js | 1 - src/detectors/create-react-app.js | 1 - src/detectors/docusaurus.js | 1 - src/detectors/eleventy.js | 1 - src/detectors/ember.js | 1 - src/detectors/expo.js | 1 - src/detectors/gatsby.js | 1 - src/detectors/gridsome.js | 1 - src/detectors/hexo.js | 1 - src/detectors/hugo.js | 1 - src/detectors/jekyll.js | 1 - src/detectors/middleman.js | 1 - src/detectors/next.js | 1 - src/detectors/nuxt.js | 1 - src/detectors/parcel.js | 1 - src/detectors/phenomic.js | 1 - src/detectors/quasar-v0.17.js | 1 - src/detectors/quasar.js | 1 - src/detectors/react-static.js | 1 - src/detectors/sapper.js | 1 - src/detectors/stencil.js | 1 - src/detectors/svelte.js | 1 - src/detectors/vue.js | 1 - src/detectors/vuepress.js | 1 - src/utils/detect-server.js | 1 - 27 files changed, 28 deletions(-) diff --git a/src/detectors/README.md b/src/detectors/README.md index 173759116a5..d3026993219 100644 --- a/src/detectors/README.md +++ b/src/detectors/README.md @@ -12,7 +12,6 @@ frameworkPort: Number, // e.g. 3000 env: Object, // env variables, see examples possibleArgsArrs: [[String]], // e.g [['run develop]], so that the combined command is 'npm run develop', but we allow for multiple - urlRegexp: RegExp, // see examples dist: String, // static folder where a _redirect file would be placed, e.g. 'public' or 'static'. NOT the build output folder } ``` @@ -56,7 +55,6 @@ module.exports = function() { frameworkPort: 4000, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${4000}(/)?`, 'g'), dist: 'public', } } diff --git a/src/detectors/angular.js b/src/detectors/angular.js index f745e33d654..07d6188b79f 100644 --- a/src/detectors/angular.js +++ b/src/detectors/angular.js @@ -26,7 +26,6 @@ module.exports = function() { frameworkPort: 4200, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${4200}(/)?`, 'g'), dist: 'dist', } } diff --git a/src/detectors/brunch.js b/src/detectors/brunch.js index 3548d7f17f6..d723634b5df 100644 --- a/src/detectors/brunch.js +++ b/src/detectors/brunch.js @@ -19,7 +19,6 @@ module.exports = function() { frameworkPort: 3333, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3333}(/)?`, 'g'), dist: 'app/assets', } } diff --git a/src/detectors/create-react-app.js b/src/detectors/create-react-app.js index 20a49614abe..f40ede6ce0c 100644 --- a/src/detectors/create-react-app.js +++ b/src/detectors/create-react-app.js @@ -29,7 +29,6 @@ module.exports = function() { env: { ...process.env, BROWSER: 'none', PORT: 3000 }, stdio: ['inherit', 'pipe', 'pipe'], possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'), dist: 'public', } } diff --git a/src/detectors/docusaurus.js b/src/detectors/docusaurus.js index 03507ac14d6..1ece11fe3e0 100644 --- a/src/detectors/docusaurus.js +++ b/src/detectors/docusaurus.js @@ -19,7 +19,6 @@ module.exports = function() { frameworkPort: 3000, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'), dist: 'static', } } diff --git a/src/detectors/eleventy.js b/src/detectors/eleventy.js index e3eed627d6a..d329a511566 100644 --- a/src/detectors/eleventy.js +++ b/src/detectors/eleventy.js @@ -15,7 +15,6 @@ module.exports = function() { env: { ...process.env }, command: 'npx', possibleArgsArrs: [['eleventy', '--serve', '--watch']], - urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, 'g'), dist: '_site', } } diff --git a/src/detectors/ember.js b/src/detectors/ember.js index b1a32e56d85..f942cf7994d 100644 --- a/src/detectors/ember.js +++ b/src/detectors/ember.js @@ -26,7 +26,6 @@ module.exports = function() { frameworkPort: 4200, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${4200}(/)?`, 'g'), dist: 'dist', } } diff --git a/src/detectors/expo.js b/src/detectors/expo.js index 9ea5853e678..116c6212c56 100644 --- a/src/detectors/expo.js +++ b/src/detectors/expo.js @@ -27,7 +27,6 @@ module.exports = function() { frameworkPort: 19006, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${19006}(/)?`, 'g'), dist: 'web-build', } } diff --git a/src/detectors/gatsby.js b/src/detectors/gatsby.js index 7078102aebf..f6b34d66f05 100644 --- a/src/detectors/gatsby.js +++ b/src/detectors/gatsby.js @@ -23,7 +23,6 @@ module.exports = function() { frameworkPort: 8000, env: { ...process.env, GATSBY_LOGGER: 'yurnalist' }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${8000}(/)?`, 'g'), dist: 'public', } } diff --git a/src/detectors/gridsome.js b/src/detectors/gridsome.js index 364424269f8..9dd5e9b0cac 100644 --- a/src/detectors/gridsome.js +++ b/src/detectors/gridsome.js @@ -19,7 +19,6 @@ module.exports = function() { frameworkPort: 8080, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, 'g'), dist: 'dist', } } diff --git a/src/detectors/hexo.js b/src/detectors/hexo.js index 0b431bacc06..8978e0deeb6 100644 --- a/src/detectors/hexo.js +++ b/src/detectors/hexo.js @@ -23,7 +23,6 @@ module.exports = function() { frameworkPort: 4000, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${4000}(/)?`, 'g'), dist: 'public', } } diff --git a/src/detectors/hugo.js b/src/detectors/hugo.js index f2e75beaba2..6a563ca4cf6 100644 --- a/src/detectors/hugo.js +++ b/src/detectors/hugo.js @@ -12,7 +12,6 @@ module.exports = function() { env: { ...process.env }, command: 'hugo', possibleArgsArrs: [['server', '-w']], - urlRegexp: new RegExp(`(http://)([^:]+:)${1313}(/)?`, 'g'), dist: 'public', } } diff --git a/src/detectors/jekyll.js b/src/detectors/jekyll.js index 5e786dcf08c..8470e3fa3c4 100644 --- a/src/detectors/jekyll.js +++ b/src/detectors/jekyll.js @@ -12,7 +12,6 @@ module.exports = function() { env: { ...process.env }, command: 'bundle', possibleArgsArrs: [['exec', 'jekyll', 'serve', '-w']], - urlRegexp: new RegExp(`(http://)([^:]+:)${4000}(/)?`, 'g'), dist: '_site', } } diff --git a/src/detectors/middleman.js b/src/detectors/middleman.js index 40c4f90b08a..24af843e8bb 100644 --- a/src/detectors/middleman.js +++ b/src/detectors/middleman.js @@ -12,7 +12,6 @@ module.exports = function() { env: { ...process.env }, command: 'bundle', possibleArgsArrs: [['exec', 'middleman', 'server']], - urlRegexp: new RegExp(`(http://)([^:]+:)${4567}(/)?`, 'g'), dist: 'build', } } diff --git a/src/detectors/next.js b/src/detectors/next.js index 7a2c271b32a..49ccf61f8c7 100644 --- a/src/detectors/next.js +++ b/src/detectors/next.js @@ -23,7 +23,6 @@ module.exports = function() { frameworkPort: 3000, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'), dist: 'out', } } diff --git a/src/detectors/nuxt.js b/src/detectors/nuxt.js index d53e2b8df9d..a9178a33a30 100644 --- a/src/detectors/nuxt.js +++ b/src/detectors/nuxt.js @@ -25,7 +25,6 @@ module.exports = function() { frameworkPort: 3000, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'), dist: 'dist', } } diff --git a/src/detectors/parcel.js b/src/detectors/parcel.js index 9c7e7e0f86a..44f6d1f8c35 100644 --- a/src/detectors/parcel.js +++ b/src/detectors/parcel.js @@ -26,7 +26,6 @@ module.exports = function() { frameworkPort: 1234, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${1234}(/)?`, 'g'), dist: 'dist', } } diff --git a/src/detectors/phenomic.js b/src/detectors/phenomic.js index 8037388065d..61bfa520f07 100644 --- a/src/detectors/phenomic.js +++ b/src/detectors/phenomic.js @@ -19,7 +19,6 @@ module.exports = function() { frameworkPort: 3333, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3333}(/)?`, 'g'), dist: 'public', } } diff --git a/src/detectors/quasar-v0.17.js b/src/detectors/quasar-v0.17.js index d854a44977a..37e2ed2c269 100644 --- a/src/detectors/quasar-v0.17.js +++ b/src/detectors/quasar-v0.17.js @@ -26,7 +26,6 @@ module.exports = function() { frameworkPort: 8080, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, 'g'), dist: '.quasar', } } diff --git a/src/detectors/quasar.js b/src/detectors/quasar.js index 1ee5ffdc235..4a6a4e7a9fd 100644 --- a/src/detectors/quasar.js +++ b/src/detectors/quasar.js @@ -26,7 +26,6 @@ module.exports = function() { frameworkPort: 8081, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, 'g'), dist: '.quasar', } } diff --git a/src/detectors/react-static.js b/src/detectors/react-static.js index 21ad85e205b..4618d09b8f4 100644 --- a/src/detectors/react-static.js +++ b/src/detectors/react-static.js @@ -23,7 +23,6 @@ module.exports = function() { frameworkPort: 3000, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'), dist: 'dist', } } diff --git a/src/detectors/sapper.js b/src/detectors/sapper.js index 2e828b44296..a55400f54c7 100644 --- a/src/detectors/sapper.js +++ b/src/detectors/sapper.js @@ -25,7 +25,6 @@ module.exports = function() { frameworkPort: 3000, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'), dist: 'static', } } diff --git a/src/detectors/stencil.js b/src/detectors/stencil.js index 6c75a9c9f5e..dc577bcf76a 100644 --- a/src/detectors/stencil.js +++ b/src/detectors/stencil.js @@ -23,7 +23,6 @@ module.exports = function() { frameworkPort: 3333, // the port that stencil normally outputs env: { ...process.env, BROWSER: 'none', PORT: 3000 }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${3000}(/)?`, 'g'), dist: 'www', } } diff --git a/src/detectors/svelte.js b/src/detectors/svelte.js index 2404c20b6eb..422835c1f57 100644 --- a/src/detectors/svelte.js +++ b/src/detectors/svelte.js @@ -27,7 +27,6 @@ module.exports = function() { frameworkPort: 5000, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${5000}(/)?`, 'g'), dist: 'public', } } diff --git a/src/detectors/vue.js b/src/detectors/vue.js index 6f70dc41cf2..2dd52f4e585 100644 --- a/src/detectors/vue.js +++ b/src/detectors/vue.js @@ -25,7 +25,6 @@ module.exports = function() { frameworkPort: 8080, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, 'g'), dist: 'dist', } } diff --git a/src/detectors/vuepress.js b/src/detectors/vuepress.js index 9b68e66e35b..52af5e9171a 100644 --- a/src/detectors/vuepress.js +++ b/src/detectors/vuepress.js @@ -25,7 +25,6 @@ module.exports = function() { frameworkPort: 8080, env: { ...process.env }, possibleArgsArrs, - urlRegexp: new RegExp(`(http://)([^:]+:)${8080}(/)?`, 'g'), dist: '.vuepress/dist', } } diff --git a/src/utils/detect-server.js b/src/utils/detect-server.js index 35eac818a63..2ff755e6e2f 100644 --- a/src/utils/detect-server.js +++ b/src/utils/detect-server.js @@ -126,7 +126,6 @@ module.exports.serverSettings = async (devConfig, flags, projectDir, log) => { ) settings.frameworkPort = devConfig.targetPort - settings.urlRegexp = devConfig.urlRegexp || new RegExp(`(http://)([^:]+:)${devConfig.targetPort}(/)?`, 'g') } if (devConfig.port && devConfig.port === settings.frameworkPort) { throw new Error(