From c81e816d97d088c30ecc0ef64b291f9fb0a3b6b7 Mon Sep 17 00:00:00 2001 From: paolo Date: Sun, 4 Nov 2018 14:33:01 +0100 Subject: [PATCH] Manca di includere il file .env --- .babelrc | 29 +++++++++-------- .env | 12 ++------ config/envparser.js | 4 +-- package.json | 35 +++++++++++++-------- quasar.conf.js | 3 +- src/@types/quasar/index.d.ts | 4 +-- src/pages/Index.vue | 13 +++----- src/plugins/i18n.js | 3 ++ tsconfig.json | 38 ++++++++++------------- yarn.lock | 60 ++++++++++++------------------------ 10 files changed, 90 insertions(+), 111 deletions(-) diff --git a/.babelrc b/.babelrc index 0f06ed8..b94e3bf 100644 --- a/.babelrc +++ b/.babelrc @@ -1,27 +1,31 @@ { "env": { "test": { - "presets": [ [ - "@babel/preset-env", { - "modules": "commonjs", - "targets": { - "node": "current" + "presets": [ + [ + "@babel/preset-env", + { + "modules": "commonjs", + "targets": { + "node": "current" + } } - } - ] + ] ] } }, "presets": [ [ - "@babel/preset-env", { + "@babel/preset-env", + { "modules": false, "loose": false, "useBuiltIns": "usage" } ], [ - "@babel/preset-stage-2", { + "@babel/preset-stage-2", + { "modules": false, "loose": false, "useBuiltIns": true, @@ -31,9 +35,10 @@ ], "plugins": [ [ - "@babel/plugin-transform-runtime", { - "polyfill": false, - "regenerator": false + "@babel/plugin-transform-runtime", + { + "regenerator": true, + "helpers": true } ] ], diff --git a/.env b/.env index 4f6fe86..fe897b0 100644 --- a/.env +++ b/.env @@ -1,19 +1,11 @@ -## SVILUPPO !!! - APP_ID=1 -VUE_APP_URL="prova SVILUPPO!" -PROVA_PAOLO="PROVA SVILUPPO" -#LANG_DEFAULT=enUs +VUE_APP_URL=prova SVILUPPO! +PROVA_PAOLO=PROVA SVILUPPO LANG_DEFAULT=it - MONGODB_HOST='http://localhost:3000' - PAO_APP_ID=KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF MASTER_KEY=KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T - LOGO_REG=quasar-logo-full.svg - - TEST_EMAIL=paolo.arena77@gmail.com TEST_USERNAME=paoloar77 TEST_PASSWORD=mypassword diff --git a/config/envparser.js b/config/envparser.js index f9edc5a..ce83685 100644 --- a/config/envparser.js +++ b/config/envparser.js @@ -1,5 +1,5 @@ -const DotEnv = require('dotenv').config({ debug: process.env.DEBUG }) -const parsedEnv = DotEnv.config().parsed; +const DotEnv = require('dotenv') +const parsedEnv = DotEnv.config({ debug: process.env.DEBUG }).parsed; module.exports = function () { // Let's stringify our variables diff --git a/package.json b/package.json index 9a7b5ac..f2f734c 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,11 @@ "deploy:ssr": "now dist/ssr-mat" }, "dependencies": { - "@types/js-cookie": "^2.1.0", - "@types/node": "^10.12.2", - "@types/nprogress": "^0.0.29", - "@types/webpack-env": "^1.13.6", + "vue-i18n": "^8.1.0", + "vue-property-decorator": "^7.2.0", + "vuex-class": "^0.3.1", "axios": "^0.18.0", + "dotenv": "^6.1.0", "element-ui": "^2.3.6", "js-cookie": "^2.2.0", "normalize.css": "^8.0.0", @@ -33,18 +33,22 @@ "register-service-worker": "^1.0.0", "vee-validate": "^2.1.2", "vue": "^2.5.17", - "vue-class-component": "^6.0.0", - "vue-i18n": "^8.1.0", - "vue-property-decorator": "^7.0.0", + "vue-class-component": "^6.3.2", "vue-router": "^3.0.1", "vue-svgicon": "^3.1.0", "vuex": "^3.0.1", - "vuex-class": "^0.3.1", - "vuex-module-decorators": "^0.4.3", - "webpack": "^4.17.2" + "vuex-module-decorators": "^0.4.3" }, "devDependencies": { + "@babel/plugin-transform-runtime": "^7.1.0", + "@types/dotenv": "^4.0.3", + "@types/js-cookie": "^2.1.0", + "@types/nprogress": "^0.0.29", + "@types/webpack-env": "^1.13.6", + "@babel/core": "^7.1.2", + "@babel/preset-env": "^7.1.0", "@types/jest": "^23.1.4", + "@types/node": "^10.12.2", "@vue/cli-plugin-babel": "^3.0.1", "@vue/cli-plugin-e2e-cypress": "^3.0.1", "@vue/cli-plugin-pwa": "^3.0.1", @@ -53,16 +57,21 @@ "@vue/cli-service": "^3.0.1", "@vue/test-utils": "^1.0.0-beta.20", "babel-core": "7.0.0-bridge.0", + "babel-loader": "^8.0.4", "eslint": "^5.5.0", - "jest": "^23.5.0", + "jest": "^23.6.0", "node-sass": "^4.9.0", "quasar-cli": "^0.17.20", "sass-loader": "^7.0.1", "strip-ansi": "=3.0.1", "ts-jest": "^23.0.0", - "typescript": "^3.0.0", + "ts-loader": "^5.3.0", + "tslint": "^5.11.0", + "tslint-config-standard": "^8.0.1", + "typescript": "^3.1.6", "vue-cli-plugin-element-ui": "^1.1.2", - "vue-template-compiler": "^2.5.17" + "vue-template-compiler": "^2.5.17", + "webpack": "^4.24.0" }, "engines": { "node": ">= 8.9.0", diff --git a/quasar.conf.js b/quasar.conf.js index fae4d2e..644df4f 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -2,7 +2,8 @@ const path = require('path'); -//const envparser = require('./config/envparser'); +// Carica il file .env +const envparser = require('./config/envparser'); const extendTypescriptToWebpack = (config) => { config.resolve diff --git a/src/@types/quasar/index.d.ts b/src/@types/quasar/index.d.ts index 8ccb6f6..7ea898b 100644 --- a/src/@types/quasar/index.d.ts +++ b/src/@types/quasar/index.d.ts @@ -10,8 +10,8 @@ declare module 'quasar' { declare module 'quasar/types' { import Vue, { VueConstructor, ComponentOptions } from 'vue' - import VueRouter from 'vue-router'; - import { Store } from 'vuex'; + import VueRouter from 'vue-router' + import { Store } from 'vuex' export interface QuasarSsrContext { req: { diff --git a/src/pages/Index.vue b/src/pages/Index.vue index 369c7a6..f29567e 100644 --- a/src/pages/Index.vue +++ b/src/pages/Index.vue @@ -43,8 +43,6 @@ import { Component, Vue, Watch, Prop } from 'vue-property-decorator' import { GlobModule } from '@/store/modules/glob' - //import { Notify } from 'quasar' - @Component({}) export default class Login extends Vue { text = '' @@ -71,15 +69,12 @@ set conta(valore) { GlobModule.setConta(valore) + var my = process.env.LANG_DEFAULT; + this.showNotification(String(my)); } - mounted() { - console.log("mounted") - } - - - showNotification() { - this.$q.notify('Some other message') + showNotification(msg:string) { + this.$q.notify(msg) } initprompt() { diff --git a/src/plugins/i18n.js b/src/plugins/i18n.js index 144a2d6..9b10f12 100644 --- a/src/plugins/i18n.js +++ b/src/plugins/i18n.js @@ -8,6 +8,9 @@ export default ({ app, store, Vue }) => { console.log("PLUGINS INIT...."); + console.log("LANG_DEFAULT: ") + console.log(process.env.LANG_DEFAULT) + // Set i18n instance on app app.i18n = new VueI18n({ locale: process.env.LANG_DEFAULT, diff --git a/tsconfig.json b/tsconfig.json index b61e6cb..5e761b8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,41 +1,35 @@ { "compilerOptions": { - "target": "esnext", + "target": "es5", "module": "esnext", "strict": true, - "jsx": "preserve", - "importHelpers": true, - "moduleResolution": "node", - "experimentalDecorators": true, "esModuleInterop": true, - "allowSyntheticDefaultImports": true, "sourceMap": true, - "baseUrl": "./", + "experimentalDecorators": true, + "noImplicitAny": true, + "moduleResolution": "node", + "lib": [ + "es2015", + "dom" + ], + "baseUrl": ".", + "paths": { + "~/*": ["./*"], + "@/*": ["src/*"] + }, "types": [ "node", "jest" - ], - "paths": { - "@/*": [ - "src/*" - ] - }, - "lib": [ - "esnext", - "dom", - "dom.iterable", - "scripthost" ] }, "include": [ "src/**/*.ts", - "src/**/*.tsx", "src/**/*.vue", - "tests/**/*.ts", - "tests/**/*.tsx", - "config/**/*.ts" + "test/**/*.ts" ], "exclude": [ + ".quasar", + "dist", "node_modules" ] } diff --git a/yarn.lock b/yarn.lock index 50eee67..69dac18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -56,7 +56,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.0.0": +"@babel/core@^7.0.0", "@babel/core@^7.1.2": version "7.1.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.2.tgz#f8d2a9ceb6832887329a7b60f9d035791400ba4e" integrity sha512-IFeSSnjXdhDaoysIlev//UzHZbdEmm7D0EIH2qtse9xK7mXEZQpYjs2P00XlP1qYsYvid79p+Zgg6tz1mp6iVw== @@ -1141,7 +1141,7 @@ "@babel/helper-module-imports" "7.0.0-beta.54" "@babel/helper-plugin-utils" "7.0.0-beta.54" -"@babel/plugin-transform-runtime@^7.0.0": +"@babel/plugin-transform-runtime@^7.0.0", "@babel/plugin-transform-runtime@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.1.0.tgz#9f76920d42551bb577e2dc594df229b5f7624b63" integrity sha512-WFLMgzu5DLQEah0lKTJzYb14vd6UiES7PTnXcvrPZ1VrwFeJ+mTbvr65fFAsXYMt2bIoOoC0jk76zY1S7HZjUg== @@ -1336,7 +1336,7 @@ js-levenshtein "^1.1.3" semver "^5.3.0" -"@babel/preset-env@^7.0.0": +"@babel/preset-env@^7.0.0", "@babel/preset-env@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.0.tgz#e67ea5b0441cfeab1d6f41e9b5c79798800e8d11" integrity sha512-ZLVSynfAoDHB/34A17/JCZbyrzbQj59QC1Anyueb4Bwjh373nVPq5/HMph0z+tCmcDjXDe+DlKQq9ywQuvWrQg== @@ -1598,6 +1598,13 @@ dependencies: commander "*" +"@types/dotenv@^4.0.3": + version "4.0.3" + resolved "https://registry.yarnpkg.com/@types/dotenv/-/dotenv-4.0.3.tgz#ebcfc40da7bc0728b705945b7db48485ec5b4b67" + integrity sha512-mmhpINC/HcLGQK5ikFJlLXINVvcxhlrV+ZOUJSN7/ottYl+8X4oSXzS9lBtDkmWAl96EGyGyLrNvk9zqdSH8Fw== + dependencies: + "@types/node" "*" + "@types/jest@^23.1.4": version "23.3.9" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.9.tgz#c16b55186ee73ae65e001fbee69d392c51337ad1" @@ -1635,7 +1642,7 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.44.tgz#1d4a798e53f35212fd5ad4d04050620171cd5b5e" integrity sha512-k2tWTQU8G4+iSMvqKi0Q9IIsWAp/n8xzdZS4Q4YVIltApoMA00wFBFdlJnmoaK1/z7B0Cy0yPe6GgXteSmdUNw== -"@types/node@^10.12.2": +"@types/node@*", "@types/node@^10.12.2": version "10.12.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.2.tgz#d77f9faa027cadad9c912cd47f4f8b07b0fb0864" integrity sha512-53ElVDSnZeFUUFIYzI8WLQ25IhWzb6vbddNp8UHlXQyU0ET2RhV5zg0NfubzU7iNMh5bBXb0htCzfvrSVNgzaQ== @@ -4527,7 +4534,7 @@ debug@^3.2.5: dependencies: ms "^2.1.1" -debuglog@*, debuglog@^1.0.1: +debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= @@ -4841,6 +4848,11 @@ dotenv@^5.0.1: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef" integrity sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow== +dotenv@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.1.0.tgz#9853b6ca98292acb7dec67a95018fa40bccff42c" + integrity sha512-/veDn2ztgRlB7gKmE3i9f6CmDIyXAy6d5nBq+whO9SLX+Zs1sXEgFLPi+aSuWqUuusMfbi84fT8j34fs1HaYUw== + duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -6661,7 +6673,7 @@ import-local@^2.0.0: pkg-dir "^3.0.0" resolve-cwd "^2.0.0" -imurmurhash@*, imurmurhash@^0.1.4: +imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= @@ -8091,11 +8103,6 @@ lockfile@^1.0.4: dependencies: signal-exit "^3.0.2" -lodash._baseindexof@*: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c" - integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw= - lodash._baseuniq@~4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8" @@ -8104,33 +8111,11 @@ lodash._baseuniq@~4.6.0: lodash._createset "~4.0.0" lodash._root "~3.0.0" -lodash._bindcallback@*: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e" - integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4= - -lodash._cacheindexof@*: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92" - integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI= - -lodash._createcache@*: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093" - integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM= - dependencies: - lodash._getnative "^3.0.0" - lodash._createset@~4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26" integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY= -lodash._getnative@*, lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -8196,11 +8181,6 @@ lodash.once@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash.restparam@*: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - lodash.snakecase@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" @@ -11064,7 +11044,7 @@ readable-stream@~1.1.10: isarray "0.0.1" string_decoder "~0.10.x" -readdir-scoped-modules@*, readdir-scoped-modules@^1.0.0: +readdir-scoped-modules@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" integrity sha1-n6+jfShr5dksuuve4DDcm19AZ0c= @@ -13582,7 +13562,7 @@ webpack@4.19.1: watchpack "^1.5.0" webpack-sources "^1.2.0" -webpack@^4.17.2, webpack@^4.23.1: +webpack@^4.23.1, webpack@^4.24.0: version "4.24.0" resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.24.0.tgz#d9822c91eeb595f7351aa5dd785a1952f9c4340a" integrity sha512-Xur0l8nBETnW+DjpFqSGME1jNXxEPVETl30k1lWAsbnukVJdq330/i3PDOLPUtVl/E/cciiOp5uW098hFfQLQA==