From 5a1642484f80eae5bffae01e8545f7c513bec157 Mon Sep 17 00:00:00 2001 From: Julio Marquez Date: Wed, 18 Dec 2019 20:04:58 -0300 Subject: [PATCH] fix(core): fix compilation error because of invalid core-js version --- packages/@statusfy/core/nuxt.config.js | 14 +++++++++++ packages/@statusfy/core/package.json | 2 ++ .../config/__snapshots__/nuxt.spec.js.snap | 12 ++++++++++ packages/website/nuxt.config.js | 14 +++++++++++ packages/website/package.json | 2 ++ yarn.lock | 23 +++++++++++++++---- 6 files changed, 62 insertions(+), 5 deletions(-) diff --git a/packages/@statusfy/core/nuxt.config.js b/packages/@statusfy/core/nuxt.config.js index 25a24829c..f50ef064e 100644 --- a/packages/@statusfy/core/nuxt.config.js +++ b/packages/@statusfy/core/nuxt.config.js @@ -141,6 +141,20 @@ const config = { */ postcss: { plugins: postcss.plugins(tailwindJS) + }, + + babel: { + presets({ isServer }) { + return [ + [ + require.resolve("@nuxt/babel-preset-app"), + { + buildTarget: isServer ? "server" : "client", + corejs: { version: 3 } + } + ] + ]; + } } }, // Modules Configurations diff --git a/packages/@statusfy/core/package.json b/packages/@statusfy/core/package.json index aa80a8071..368d6dca6 100644 --- a/packages/@statusfy/core/package.json +++ b/packages/@statusfy/core/package.json @@ -34,6 +34,7 @@ "statuspage" ], "dependencies": { + "@babel/runtime-corejs3": "^7.7.6", "@fortawesome/fontawesome-svg-core": "1.2.26", "@nuxtjs/axios": "5.9.0", "@nuxtjs/onesignal": "3.0.0-beta.16", @@ -42,6 +43,7 @@ "@statusfy/markdown": "0.5.0-alpha.0", "body-parser": "1.19.0", "browser-sync": "2.26.7", + "core-js": "3.5.0", "cors": "2.8.5", "cross-env": "6.0.3", "cross-spawn": "7.0.1", diff --git a/packages/@statusfy/core/test/config/__snapshots__/nuxt.spec.js.snap b/packages/@statusfy/core/test/config/__snapshots__/nuxt.spec.js.snap index bca363748..f57ab7e6c 100644 --- a/packages/@statusfy/core/test/config/__snapshots__/nuxt.spec.js.snap +++ b/packages/@statusfy/core/test/config/__snapshots__/nuxt.spec.js.snap @@ -12,6 +12,9 @@ Object { }, "build": Object { "analyze": true, + "babel": Object { + "presets": [Function], + }, "extend": [Function], "postcss": Object { "plugins": Object { @@ -332,6 +335,9 @@ Object { }, "build": Object { "analyze": true, + "babel": Object { + "presets": [Function], + }, "extend": [Function], "postcss": Object { "plugins": Object { @@ -574,6 +580,9 @@ Object { }, "build": Object { "analyze": true, + "babel": Object { + "presets": [Function], + }, "extend": [Function], "postcss": Object { "plugins": Object { @@ -782,6 +791,9 @@ Object { }, "build": Object { "analyze": true, + "babel": Object { + "presets": [Function], + }, "extend": [Function], "postcss": Object { "plugins": Object { diff --git a/packages/website/nuxt.config.js b/packages/website/nuxt.config.js index 429f5c1f0..1c339e691 100644 --- a/packages/website/nuxt.config.js +++ b/packages/website/nuxt.config.js @@ -163,6 +163,20 @@ module.exports = { */ postcss: { plugins: postcss.plugins(tailwindJS) + }, + + babel: { + presets({ isServer }) { + return [ + [ + require.resolve('@nuxt/babel-preset-app'), + { + buildTarget: isServer ? 'server' : 'client', + corejs: { version: 3 } + } + ] + ] + } } }, /* diff --git a/packages/website/package.json b/packages/website/package.json index 9308de5af..60bfd825c 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -18,6 +18,7 @@ "svg": "vsvg -s ./assets/icons -t ./components/icons --es6" }, "dependencies": { + "@babel/runtime-corejs3": "^7.7.6", "@fortawesome/fontawesome-svg-core": "1.2.26", "@nuxtjs/axios": "5.9.0", "@nuxtjs/google-analytics": "2.2.2", @@ -26,6 +27,7 @@ "@statusfy/common": "0.5.0-alpha.0", "animate.css": "3.7.2", "consola": "2.11.1", + "core-js": "3.5.0", "date-fns": "1.30.1", "github-markdown-css": "3.0.1", "intersection-observer": "0.7.0", diff --git a/yarn.lock b/yarn.lock index a6653548b..703c300bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -727,6 +727,14 @@ core-js "^2.6.5" regenerator-runtime "^0.13.2" +"@babel/runtime-corejs3@^7.7.6": + version "7.7.6" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.7.6.tgz#5b1044ea11b659d288f77190e19c62da959ed9a3" + integrity sha512-NrRUehqG0sMSCaP+0XV/vOvvjNl4BQOWq3Qys1Q2KTEm5tGMo9h0dHnIzeKerj0a7SIB8LP5kYg/T1raE3FoKQ== + dependencies: + core-js-pure "^3.0.0" + regenerator-runtime "^0.13.2" + "@babel/runtime@^7.0.0", "@babel/runtime@^7.3.4", "@babel/runtime@^7.4.4", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6": version "7.7.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.6.tgz#d18c511121aff1b4f2cd1d452f1bac9601dd830f" @@ -5574,16 +5582,21 @@ core-js-compat@^3.4.7: browserslist "^4.8.2" semver "^6.3.0" -core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: - version "2.6.11" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" - integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== +core-js-pure@^3.0.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.5.0.tgz#f63c7f2b245e7d678e73f87ad28505480554d70e" + integrity sha512-wB0QtKAofWigiISuT1Tej3hKgq932fB//Lf1VoPbiLpTYlHY0nIDhgF+q1na0DAKFHH5wGCirkAknOmDN8ijXA== -core-js@^3.4.1: +core-js@3.5.0, core-js@^3.4.1: version "3.5.0" resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.5.0.tgz#66df8e49be4bd775e6f952a9d083b756ad41c1ed" integrity sha512-Ifh3kj78gzQ7NAoJXeTu+XwzDld0QRIwjBLRqAMhuLhP3d2Av5wmgE9ycfnvK6NAEjTkQ1sDPeoEZAWO3Hx1Uw== +core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: + version "2.6.11" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" + integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"