Lint + ES6

This commit is contained in:
Liyas Thomas
2020-10-21 12:20:32 +05:30
parent 774853af7a
commit f49c2138de
25 changed files with 263 additions and 212 deletions

View File

@@ -1,5 +1,4 @@
// Some helpful application constants.
// TODO: Use these when rendering the pages (rather than just for head/meta tags...)
// Common options
export const options = {
name: "Hoppscotch",
shortDescription: "A free, fast and beautiful API request builder",
@@ -15,14 +14,20 @@ export const options = {
twitter: "@liyasthomas",
},
}
export default {
// Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
ssr: false,
// Target (https://go.nuxtjs.dev/config-target)
target: "static",
// Default: localhost
server: {
host: "0.0.0.0", // default: localhost
host: "0.0.0.0",
},
/*
** Headers of the page
*/
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
title: `${options.name}${options.shortDescription}`,
meta: [
@@ -81,66 +86,60 @@ export default {
},
],
},
/*
** Customize the progress-bar color
*/
// Customize the progress-bar color (https://nuxtjs.org/api/configuration-loading/#customizing-the-progress-bar)
loading: {
color: options.loading.color,
continuous: true,
},
/*
** Customize the loading indicator
*/
// Customize the loading indicator (https://nuxtjs.org/api/configuration-loading-indicator)
loadingIndicator: {
name: "pulse",
color: options.loading.color,
background: options.loading.background,
},
/*
** Global CSS
*/
// Global CSS (https://go.nuxtjs.dev/config-css)
css: ["~/assets/scss/styles.scss", "~/assets/scss/themes.scss", "~/assets/scss/fonts.scss"],
/*
** Plugins to load before mounting the App
*/
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: ["~/plugins/vuex-persist", "~/plugins/v-tooltip"],
/*
** Auto import components
** See https://nuxtjs.org/api/configuration-components
*/
// Auto import components (https://go.nuxtjs.dev/config-components)
components: true,
/*
** Nuxt.js dev-modules
*/
// Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
buildModules: [
// https://pwa.nuxtjs.org
// https://github.com/nuxt-community/pwa-module
"@nuxtjs/pwa",
// Doc: https://github.com/nuxt-community/analytics-module
// https://github.com/nuxt-community/analytics-module
"@nuxtjs/google-analytics",
// Doc: https://github.com/nuxt-community/gtm-module
// https://github.com/nuxt-community/gtm-module
"@nuxtjs/gtm",
// Doc: https://github.com/nuxt-community/svg-module
// https://github.com/nuxt-community/svg-module
"@nuxtjs/svg",
// Doc: https://tailwindcss.nuxtjs.org
// https://github.com/nuxt-community/nuxt-tailwindcss
"@nuxtjs/tailwindcss",
// Doc: https://color-mode.nuxtjs.org
// https://github.com/nuxt-community/color-mode-module
"@nuxtjs/color-mode",
],
/*
** Nuxt.js modules
*/
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://axios.nuxtjs.org
// https://github.com/nuxt-community/axios-module
"@nuxtjs/axios",
// https://github.com/nuxt-community/modules/tree/master/packages/toast
"@nuxtjs/toast",
// Doc: https://github.com/nuxt-community/nuxt-i18n
// https://github.com/nuxt-community/i18n-module
"nuxt-i18n",
// Doc: https://github.com/nuxt-community/robots-module
// https://github.com/nuxt-community/robots-module
"@nuxtjs/robots",
// Doc: https://github.com/nuxt-community/sitemap-module
// https://github.com/nuxt-community/sitemap-module
"@nuxtjs/sitemap",
],
// PWA module configuration (https://pwa.nuxtjs.org/setup)
pwa: {
meta: {
ogHost: process.env.BASE_URL,
@@ -160,32 +159,46 @@ export default {
},
workbox: false,
},
// Toast module configuration (https://github.com/nuxt-community/modules/tree/master/packages/toast)
toast: {
position: "bottom-center",
duration: 3000,
theme: "bubble",
keepOnHover: true,
},
// Google Analytics module configuration (https://github.com/nuxt-community/analytics-module)
googleAnalytics: {
id: process.env.GA_ID,
},
// Google Tag Manager module configuration (https://github.com/nuxt-community/gtm-module)
gtm: {
id: process.env.GTM_ID,
},
// Sitemap module configuration (https://github.com/nuxt-community/sitemap-module)
sitemap: {
hostname: process.env.BASE_URL || "https://hoppscotch.io/",
},
// Robots module configuration (https://github.com/nuxt-community/robots-module)
robots: {
UserAgent: "*",
Disallow: "",
Allow: "/",
Sitemap: `${process.env.BASE_URL}sitemap.xml`,
},
// Color Mode module configuration (https://github.com/nuxt-community/color-mode-module)
colorMode: {
classSuffix: "",
preference: "dark",
fallback: "dark",
},
// i18n module configuration (https://github.com/nuxt-community/i18n-module)
i18n: {
locales: [
{
@@ -296,13 +309,10 @@ export default {
fallbackLocale: "en",
},
},
/*
** Build configuration
*/
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
/*
** You can extend webpack config here
*/
// You can extend webpack config here
extend(config, ctx) {
// Sets webpack's mode to development if `isDev` is true.
if (ctx.isDev) {
@@ -316,17 +326,20 @@ export default {
cache: true,
// hardSource: true,
},
/*
** Generate configuration
*/
// Generate configuration (https://nuxtjs.org/api/configuration-generate)
generate: {
fallback: true,
},
// Public runtime configuration (https://nuxtjs.org/guide/runtime-config)
publicRuntimeConfig: {
GA_ID: process.env.GA_ID || "UA-61422507-4",
GTM_ID: process.env.GTM_ID || "GTM-NMKVBMV",
BASE_URL: process.env.BASE_URL || "https://hoppscotch.io/",
},
// Private runtime configuration (https://nuxtjs.org/guide/runtime-config)
privateRuntimeConfig: {
API_KEY: process.env.API_KEY,
AUTH_DOMAIN: process.env.AUTH_DOMAIN,