@data-fair/dev-server 1.0.4 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.html CHANGED
@@ -1,9 +1,9 @@
1
1
  <!doctype html>
2
2
  <html>
3
3
  <head>
4
- <title>DataFair - Dev server</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="application" name="application-name" content="DataFair - Dev server"><meta data-n-head="1" data-hid="description" name="description" content="A development server for optimal development experience of data-fair applications."><meta data-n-head="1" data-hid="robots" name="robots" content="noindex"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/ce9939c.js" as="script"><link rel="preload" href="/_nuxt/765c8cf.js" as="script"><link rel="preload" href="/_nuxt/b9d9dd1.js" as="script"><link rel="preload" href="/_nuxt/d3a56e4.js" as="script">
4
+ <title>DataFair - Dev server</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="application" name="application-name" content="DataFair - Dev server"><meta data-n-head="1" data-hid="description" name="description" content="A development server for optimal development experience of data-fair applications."><meta data-n-head="1" data-hid="robots" name="robots" content="noindex"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/fa5339e.js" as="script"><link rel="preload" href="/_nuxt/04fc13d.js" as="script"><link rel="preload" href="/_nuxt/13c55a4.js" as="script"><link rel="preload" href="/_nuxt/a928dea.js" as="script">
5
5
  </head>
6
6
  <body>
7
- <div id="__nuxt"><style>#nuxt-loading{background:#fff;visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #000;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div><script>window.__NUXT__={config:{}}</script>
8
- <script src="/_nuxt/ce9939c.js"></script><script src="/_nuxt/765c8cf.js"></script><script src="/_nuxt/b9d9dd1.js"></script><script src="/_nuxt/d3a56e4.js"></script></body>
7
+ <div id="__nuxt"><style>#nuxt-loading{background:#fff;visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #000;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div><script>window.__NUXT__={config:{_app:{basePath:"/",assetsPath:"/_nuxt/",cdnURL:null}}}</script>
8
+ <script src="/_nuxt/fa5339e.js"></script><script src="/_nuxt/04fc13d.js"></script><script src="/_nuxt/13c55a4.js"></script><script src="/_nuxt/a928dea.js"></script></body>
9
9
  </html>
package/nuxt.config.js CHANGED
@@ -5,10 +5,27 @@ if (process.argv.slice(-1)[0] === 'generate') {
5
5
  config = nuxtConfigInject.prepare(config)
6
6
  }
7
7
 
8
+ const locales = ['en', 'fr']
9
+
8
10
  module.exports = {
9
- mode: 'spa',
11
+ ssr: false,
12
+ components: true,
10
13
  srcDir: 'public/',
11
- modules: ['@nuxtjs/axios'],
14
+ telemetry: false,
15
+ modules: ['@nuxtjs/axios', ['@nuxtjs/i18n', {
16
+ seo: false,
17
+ locales,
18
+ defaultLocale: 'en',
19
+ vueI18nLoader: true,
20
+ strategy: 'no_prefix',
21
+ detectBrowserLanguage: {
22
+ useCookie: true,
23
+ cookieKey: 'i18n_lang'
24
+ },
25
+ vueI18n: {
26
+ fallbackLocale: 'en'
27
+ }
28
+ }]],
12
29
  axios: {
13
30
  browserBaseURL: 'http://localhost:5888/data-fair'
14
31
  },
@@ -24,7 +41,7 @@ module.exports = {
24
41
  }
25
42
  }
26
43
  },
27
- env: { app: config.app, dataFair: config.dataFair },
44
+ env: { app: config.app, dataFair: config.dataFair, iframeLog: config.iframeLog, locales },
28
45
  head: {
29
46
  title: 'DataFair - Dev server',
30
47
  meta: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/dev-server",
3
- "version": "1.0.4",
3
+ "version": "1.4.0",
4
4
  "description": "A development server for optimal development experience of data-fair applications.",
5
5
  "main": "server/index.js",
6
6
  "bin": {
@@ -26,47 +26,61 @@
26
26
  "url": "https://github.com/koumoul-dev/df-dev-server/issues"
27
27
  },
28
28
  "homepage": "https://github.com/koumoul-dev/df-dev-server#readme",
29
+ "eslintConfig": {
30
+ "root": true,
31
+ "env": {
32
+ "node": true
33
+ },
34
+ "extends": [
35
+ "plugin:vue/essential",
36
+ "eslint:recommended",
37
+ "standard",
38
+ "plugin:vue/recommended"
39
+ ],
40
+ "rules": {
41
+ "vue/no-v-html": "off",
42
+ "vue/multi-word-component-names": "off"
43
+ }
44
+ },
29
45
  "dependencies": {
30
46
  "@koumoul/nuxt-config-inject": "^0.4.4",
31
- "@koumoul/vjsf": "^2.1.3",
32
- "ajv": "^6.12.0",
33
- "body-parser": "^1.19.0",
47
+ "@koumoul/vjsf": "^2.9.0",
48
+ "ajv": "^8.8.2",
49
+ "ajv-i18n": "^4.2.0",
50
+ "body-parser": "^1.19.1",
34
51
  "chalk": "^3.0.0",
35
- "config": "^3.2.4",
52
+ "config": "^3.3.6",
36
53
  "cors": "^2.8.5",
37
- "dot-prop": "^6.0.0",
54
+ "dot-prop": "^6.0.1",
38
55
  "dotenv": "^10.0.0",
39
56
  "escape-string-regexp": "^2.0.0",
40
57
  "event-to-promise": "^0.8.0",
41
- "express": "^4.17.1",
42
- "fs-extra": "^8.1.0",
43
- "http-proxy-middleware": "^0.20.0",
44
- "open": "^7.0.0",
58
+ "express": "^4.17.2",
59
+ "fs-extra": "^10.0.0",
60
+ "http-proxy-middleware": "^2.0.1",
61
+ "open": "^8.4.0",
45
62
  "parse5": "^6.0.1",
46
63
  "tree-kill": "^1.2.2",
47
- "ws": "^7.3.0"
64
+ "ws": "^8.3.0"
48
65
  },
49
66
  "devDependencies": {
50
- "@koumoul/v-iframe": "^0.5.4",
51
- "@nuxtjs/axios": "^5.12.5",
52
- "@nuxtjs/vuetify": "^1.11.3",
53
- "babel-eslint": "^10.1.0",
54
- "cross-env": "^6.0.3",
55
- "eslint": "^6.8.0",
56
- "eslint-config-standard": "^14.1.1",
57
- "eslint-friendly-formatter": "^4.0.1",
58
- "eslint-loader": "^3.0.4",
59
- "eslint-plugin-import": "^2.22.1",
60
- "eslint-plugin-node": "^10.0.0",
61
- "eslint-plugin-promise": "^4.2.1",
62
- "eslint-plugin-standard": "^4.1.0",
63
- "eslint-plugin-vue": "^6.2.2",
64
- "eslint-plugin-vuetify": "^1.0.0-beta.7",
67
+ "@babel/eslint-parser": "^7.16.0",
68
+ "@koumoul/v-iframe": "^0.9.1",
69
+ "@nuxtjs/axios": "^5.13.6",
70
+ "@nuxtjs/i18n": "^7.2.0",
71
+ "@nuxtjs/vuetify": "^1.12.3",
72
+ "cross-env": "^7.0.3",
73
+ "eslint": "^7.12.1",
74
+ "eslint-config-standard": "^16.0.3",
75
+ "eslint-plugin-import": "^2.25.2",
76
+ "eslint-plugin-node": "^11.1.0",
77
+ "eslint-plugin-promise": "^5.1.1",
78
+ "eslint-plugin-vue": "^8.0.3",
65
79
  "http-server": "^0.12.3",
66
- "iframe-resizer": "^4.3.1",
67
- "nodemon": "^2.0.7",
68
- "nuxt": "^2.14.12",
80
+ "iframe-resizer": "^4.3.2",
81
+ "nodemon": "^2.0.15",
82
+ "nuxt": "^2.15.8",
69
83
  "reconnecting-websocket": "^4.4.0",
70
- "vuetify": "^2.4.11"
84
+ "vuetify": "^2.6.1"
71
85
  }
72
86
  }
package/server/app.js CHANGED
@@ -7,7 +7,7 @@ const config = require('config')
7
7
  const eventToPromise = require('event-to-promise')
8
8
  const http = require('http')
9
9
  const fs = require('fs-extra')
10
- const proxy = require('http-proxy-middleware')
10
+ const { createProxyMiddleware } = require('http-proxy-middleware')
11
11
  const cors = require('cors')
12
12
  const open = require('open')
13
13
  const kill = require('tree-kill')
@@ -25,7 +25,7 @@ wss.on('connection', (_ws) => {
25
25
  if (ws) ws.terminate()
26
26
  ws = _ws
27
27
 
28
- ws.on('message', function incoming(message) {
28
+ ws.on('message', function incoming (message) {
29
29
  if (!message.includes('"pong"')) console.log('received: %s', message)
30
30
  })
31
31
  ws.send(JSON.stringify({ type: 'ping' }))
@@ -53,7 +53,7 @@ app.post('/config/error', (req, res) => {
53
53
 
54
54
  // re-expose the application performing similar modifications to the body as data-fair
55
55
  const appUrl = new URL(config.app.url)
56
- app.use('/app', proxy({
56
+ app.use('/app', createProxyMiddleware({
57
57
  target: appUrl.origin,
58
58
  pathRewrite: { '^/app': appUrl.pathname === '/' ? '' : appUrl.pathname },
59
59
  secure: false,
@@ -151,14 +151,14 @@ setTimeout(function() {
151
151
 
152
152
  // re-expose a data-fair instance to access datasets, etc.
153
153
  const dfUrl = new URL(config.dataFair.url)
154
- app.use('/data-fair', proxy({
154
+ app.use('/data-fair', createProxyMiddleware({
155
155
  target: dfUrl.origin,
156
156
  pathRewrite: { '^/data-fair': dfUrl.pathname },
157
157
  secure: false,
158
158
  changeOrigin: true,
159
159
  ws: true,
160
160
  selfHandleResponse: true, // so that the onProxyRes takes care of sending the response
161
- onProxyReq(proxyReq) {
161
+ onProxyReq (proxyReq) {
162
162
  // no gzip so that we can process the content
163
163
  proxyReq.setHeader('accept-encoding', 'identity')
164
164
  proxyReq.setHeader('cookie', '')
@@ -218,7 +218,7 @@ exports.run = async () => {
218
218
  return server
219
219
  }
220
220
 
221
- exports.stop = async() => {
221
+ exports.stop = async () => {
222
222
  if (spawnedDevSrc) kill(spawnedDevSrc.pid)
223
223
  if (ws) ws.terminate()
224
224
  server.close()
package/.eslintrc.js DELETED
@@ -1,31 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parserOptions: {
4
- parser: 'babel-eslint',
5
- sourceType: 'module'
6
- },
7
- extends: [
8
- // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
9
- 'standard',
10
- // https://github.com/vuejs/eslint-plugin-vue,
11
- 'plugin:vue/recommended'
12
- ],
13
- plugins: [],
14
- // add your custom rules here
15
- rules: {
16
- // allow paren-less arrow functions
17
- 'arrow-parens': 0,
18
- // allow async-await
19
- 'generator-star-spacing': 0,
20
- // allow debugger during development
21
- 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
22
- // This rule is required because atom vue-format package remove the space
23
- 'space-before-function-paren': 0,
24
- // Turn off vuejs rules, not because ther are not good, but mostly because
25
- // they are very present in initial code base.. Maybe we should clean that up someday..
26
- 'vue/max-attributes-per-line': 'off',
27
- 'vue/require-prop-types': 'off',
28
- 'no-new': 'off',
29
- 'no-template-curly-in-string': 'off'
30
- }
31
- }