Skip to content

Commit cfb9be1

Browse files
authored
chore(deps): bump consola to 3.x to align with other packages (#122)
1 parent c2bb98e commit cfb9be1

File tree

8 files changed

+2292
-2283
lines changed

8 files changed

+2292
-2283
lines changed

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,36 @@
3232
"arg": "^5.0.2",
3333
"chalk": "^4.1.1",
3434
"ci-info": "^3.7.1",
35-
"consola": "^2.15.3",
35+
"consola": "^3.2.3",
3636
"create-require": "^1.1.1",
37-
"defu": "^6.1.2",
38-
"destr": "^1.2.2",
37+
"defu": "^6.1.3",
38+
"destr": "^2.0.2",
3939
"dotenv": "^9.0.2",
4040
"fs-extra": "^8.1.0",
41-
"git-url-parse": "^13.1.0",
41+
"git-url-parse": "^13.1.1",
4242
"inquirer": "^7.3.3",
43-
"jiti": "^1.16.2",
43+
"jiti": "^1.21.0",
4444
"nanoid": "^3.1.23",
4545
"node-fetch": "^2.6.1",
4646
"parse-git-config": "^3.0.0",
47-
"rc9": "^2.0.1",
48-
"std-env": "^3.3.1"
47+
"rc9": "^2.1.1",
48+
"std-env": "^3.5.0"
4949
},
5050
"devDependencies": {
51-
"@nuxt/types": "2.16.3",
52-
"@nuxt/typescript-build": "3.0.1",
53-
"@nuxtjs/eslint-config-typescript": "12.0.0",
51+
"@nuxt/types": "2.17.2",
52+
"@nuxt/typescript-build": "3.0.2",
53+
"@nuxtjs/eslint-config-typescript": "12.1.0",
5454
"@nuxtjs/proxy": "latest",
5555
"@types/ci-info": "latest",
5656
"@types/inquirer": "latest",
5757
"babel-eslint": "latest",
5858
"bili": "latest",
59-
"eslint": "8.42.0",
60-
"nuxt-edge": "2.17.0-28105172.a0fd395",
59+
"eslint": "8.53.0",
60+
"nuxt-edge": "2.17.2-28284499.5674f49",
6161
"rollup-plugin-typescript2": "0.34.1",
6262
"siroc": "0.16.0",
6363
"standard-version": "9.5.0",
64-
"typescript": "5.1.3"
64+
"typescript": "5.2.2"
6565
},
6666
"publishConfig": {
6767
"access": "public"

src/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import arg from 'arg'
55
import destr from 'destr'
66
import * as rc from 'rc9'
77
import c from 'chalk'
8-
import consola from 'consola'
8+
import { consola } from 'consola'
99
import jiti from 'jiti'
1010
import { isTest } from 'std-env'
1111
import dotenv from 'dotenv'

src/consent.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import c from 'chalk'
22
import inquirer from 'inquirer'
3-
import consola from 'consola'
3+
import { consola } from 'consola'
44
import { isMinimal } from 'std-env'
55
import { isDocker } from './utils/docker'
66
import { updateUserNuxtRc } from './utils/nuxtrc'

src/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function createContext (nuxt: Nuxt, options: TelemetryOptions): Pro
1313
const packageManager = await detectPackageManager(rootDir)
1414

1515
const { seed } = options
16-
const projectHash = await getProjectHash(rootDir, git, seed)
16+
const projectHash = getProjectHash(rootDir, git, seed)
1717
const projectSession = getProjectSession(projectHash, seed)
1818

1919
const nuxtVersion = ((nuxt.constructor as any).version || '').replace('v', '')

src/index.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Telemetry } from './telemetry'
77
import { getStats } from './utils/build-stats'
88
import { Stats, Nuxt, TelemetryOptions } from './types'
99
import { ensureUserconsent } from './consent'
10-
import log from './utils/log'
10+
import { logger } from './utils/log'
1111
import { hash } from './utils/hash'
1212

1313
async function _telemetryModule (nuxt) {
@@ -18,7 +18,7 @@ async function _telemetryModule (nuxt) {
1818
}
1919

2020
if (!toptions.debug) {
21-
log.level = -Infinity
21+
logger.level = -Infinity
2222
}
2323

2424
if (nuxt.options.telemetry !== true) {
@@ -27,17 +27,17 @@ async function _telemetryModule (nuxt) {
2727
nuxt.options.telemetry === false ||
2828
!await ensureUserconsent(toptions)
2929
) {
30-
log.info('Telemetry disabled')
30+
logger.info('Telemetry disabled')
3131
return
3232
}
3333
}
3434

35-
log.info('Telemetry enabled')
35+
logger.info('Telemetry enabled')
3636

3737
if (!toptions.seed) {
3838
toptions.seed = hash(nanoid())
3939
updateUserNuxtRc('telemetry.seed', toptions.seed)
40-
log.info('Seed generated:', toptions.seed)
40+
logger.info('Seed generated:', toptions.seed)
4141
}
4242

4343
const t = new Telemetry(nuxt, toptions)
@@ -66,7 +66,7 @@ const telemetryModule: Module<TelemetryOptions> = async function () {
6666
try {
6767
await _telemetryModule(this.nuxt)
6868
} catch (err) {
69-
log.error(err)
69+
logger.error(err)
7070
}
7171
}
7272

src/telemetry.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { postEvent } from './utils/post-event'
22
import * as events from './events/index'
33
import { createContext } from './context'
44
import { EventFactory, TelemetryOptions, Context, Nuxt, EventFactoryResult } from './types'
5-
import log from './utils/log'
5+
import { logger } from './utils/log'
66

77
export class Telemetry {
88
nuxt: Nuxt
@@ -28,7 +28,7 @@ export class Telemetry {
2828
// eslint-disable-next-line import/namespace
2929
const eventFactory: EventFactory<any> = events[name]
3030
if (typeof eventFactory !== 'function') {
31-
log.warn('Unknown event:', name)
31+
logger.warn('Unknown event:', name)
3232
return
3333
}
3434
const eventPromise = this._invokeEvent(name, eventFactory, payload)
@@ -42,7 +42,7 @@ export class Telemetry {
4242
event.name = name
4343
return event
4444
} catch (err) {
45-
log.error('Error while running event:', err)
45+
logger.error('Error while running event:', err)
4646
}
4747
}
4848

@@ -78,11 +78,11 @@ export class Telemetry {
7878
if (this.options.endpoint) {
7979
const start = Date.now()
8080
try {
81-
log.info('Sending events:', JSON.stringify(body, null, 2))
81+
logger.info('Sending events:', JSON.stringify(body, null, 2))
8282
await postEvent(this.options.endpoint, body)
83-
log.success(`Events sent to \`${this.options.endpoint}\` (${Date.now() - start} ms)`)
83+
logger.success(`Events sent to \`${this.options.endpoint}\` (${Date.now() - start} ms)`)
8484
} catch (err) {
85-
log.error(`Error sending sent to \`${this.options.endpoint}\` (${Date.now() - start} ms)\n`, err)
85+
logger.error(`Error sending sent to \`${this.options.endpoint}\` (${Date.now() - start} ms)\n`, err)
8686
}
8787
}
8888
}

src/utils/log.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import consola from 'consola'
1+
import { ConsolaInstance, consola } from 'consola'
22

3-
export default consola.withScope('@nuxt/telemetry')
3+
export const logger = consola.withTag('@nuxt/telemetry') as ConsolaInstance

0 commit comments

Comments
 (0)