Skip to content

Commit

Permalink
disable all console statements
Browse files Browse the repository at this point in the history
  • Loading branch information
tinuola committed Oct 16, 2024
1 parent fdf4a7f commit 4067e64
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { provideTheme } from '@/composables/provideTheme'
provideTheme()
const { enabled, state } = usePreviewMode()
console.log('App.vue', enabled.value, state.token)
// console.log('App.vue', enabled.value, state.token)
const route = useRoute()
const globalStore = useGlobalStore()
Expand All @@ -16,13 +16,13 @@ const primaryMenuItems = computed(() => {
return header?.value?.primary
})
watch(globalStore.header, (newVal, oldVal) => {
console.log('Global store changed for draft previews', newVal, oldVal)
// console.log('Global store changed for draft previews', newVal, oldVal)
setHeader(globalStore)
})
const { $layoutData } = useNuxtApp()
onMounted(async () => {
// globalstore state is lost due to 404 error for draft previews, this is hack to repopulate state on client side
console.log('No layout query', route.query, 'preview enabled', enabled.value, 'state?.token', state?.token)
// console.log('No layout query', route.query, 'preview enabled', enabled.value, 'state?.token', state?.token)
if (process.env.NODE_ENV !== 'development' && (route.query?.preview === 'true' || enabled.value) && (route.query?.token !== undefined || state?.token !== undefined)) {
await $layoutData()
}
Expand Down
6 changes: 3 additions & 3 deletions layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ const primaryMenuItems = computed(() => {
const isMobile = ref(false)
watch(globalStore, (newVal, oldVal) => {
console.log('Global store changed', newVal, oldVal)
// console.log('Global store changed', newVal, oldVal)
})
const { $layoutData } = useNuxtApp()
// globalstore state is lost when error page is generated , this is hack to repopulate state on client side
onMounted(async () => {
console.log('In default layout', enabled.value, state?.token)
// console.log('In default layout', enabled.value, state?.token)
if (process.env.NODE_ENV !== 'development' && layoutCustomProps['is-error']) {
console.log('In SSG refresh layout data as state is not maintained after an error response')
// console.log('In SSG refresh layout data as state is not maintained after an error response')
await $layoutData()
}
Expand Down
14 changes: 7 additions & 7 deletions modules/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import fetch from 'node-fetch'
export default defineNuxtModule({

setup(options, nuxt) {
console.log('Nuxt module start ')
console.log('process.env.NODE_ENV:' + process.env.NODE_ENV)
// console.log('Nuxt module start ')
// console.log('process.env.NODE_ENV:' + process.env.NODE_ENV)
if (!nuxt.options._prepare && process.env.NODE_ENV !== 'development') {
nuxt.hooks.hook('nitro:init', async (nitro) => {
console.log('Ready to create library temp index...')
// console.log('Ready to create library temp index...')

const esLibraryIndexTemp = nuxt.options.runtimeConfig.public.esTempIndex
console.log('Index named:' + esLibraryIndexTemp)
// console.log('Index named:' + esLibraryIndexTemp)
// https://www.elastic.co/guide/en/elasticsearch/reference/current/flattened.html
try {
const response = await fetch(`${nuxt.options.runtimeConfig.public.esURL}/${esLibraryIndexTemp}`, {
Expand Down Expand Up @@ -49,14 +49,14 @@ export default defineNuxtModule({
const body = await response.text()
const testJson = JSON.parse(body)
// console.log('Index created:' + JSON.stringify(testJson))
console.log('Elastic Search index created succesfully!')
// console.log('Elastic Search index created succesfully!')
} catch (err) {
console.error('Error:', err)
// console.error('Error:', err)
console.error('Response body:', body)
throw err
}
})
}
console.log('Nuxt module end ')
// console.log('Nuxt module end ')
}
})
4 changes: 2 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ export default defineNuxtConfig({
/* if (route.route?.includes('&')) {
route.skip = true
} */
console.log('prerender:generate', route)
// console.log('prerender:generate', route)
},
'prerender:routes'(routes) {
// const allRoutes = []

console.log('prerender:routes ctx.routes', routes)
// console.log('prerender:routes ctx.routes', routes)
}
},

Expand Down
2 changes: 1 addition & 1 deletion plugins/data-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function keywordSearchWithFilters(
extraFilters = [],
) {
// var data_url = new URL(`${ES_URL}/apps-dev-library-website/_search`)
console.log('In data api keywordsearchwithfilters')
// console.log('In data api keywordsearchwithfilters')
const config = useRuntimeConfig()
// console.log(config.public.esReadKey)
// console.log(config.public.esURL)
Expand Down

0 comments on commit 4067e64

Please sign in to comment.