mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
Compare commits
9 Commits
d2921a547f
...
e07591058b
Author | SHA1 | Date | |
---|---|---|---|
|
e07591058b | ||
|
edc299a043 | ||
|
ad3ab4d310 | ||
|
b0577a6bb5 | ||
|
01de9c3889 | ||
|
203abc0693 | ||
|
07db7219bd | ||
|
e3aecd5d73 | ||
|
6830f658ee |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -248,7 +248,7 @@ jobs:
|
|||||||
TEST_PAYLOAD: ${{ matrix.payload }}
|
TEST_PAYLOAD: ${{ matrix.payload }}
|
||||||
SKIP_BUNDLE_SIZE: ${{ github.event_name != 'push' || matrix.env == 'dev' || matrix.builder == 'webpack' || matrix.context == 'default' || matrix.payload == 'js' || runner.os == 'Windows' }}
|
SKIP_BUNDLE_SIZE: ${{ github.event_name != 'push' || matrix.env == 'dev' || matrix.builder == 'webpack' || matrix.context == 'default' || matrix.payload == 'js' || runner.os == 'Windows' }}
|
||||||
|
|
||||||
- uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v5.0.2
|
- uses: codecov/codecov-action@985343d70564a82044c1b7fcb84c2fa05405c1a2 # v5.0.4
|
||||||
if: github.event_name != 'push' && matrix.env == 'built' && matrix.builder == 'vite' && matrix.context == 'default' && matrix.os == 'ubuntu-latest' && matrix.manifest == 'manifest-on'
|
if: github.event_name != 'push' && matrix.env == 'built' && matrix.builder == 'vite' && matrix.context == 'default' && matrix.os == 'ubuntu-latest' && matrix.manifest == 'manifest-on'
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
"devalue": "5.1.1",
|
"devalue": "5.1.1",
|
||||||
"eslint": "9.15.0",
|
"eslint": "9.15.0",
|
||||||
"eslint-plugin-no-only-tests": "3.3.0",
|
"eslint-plugin-no-only-tests": "3.3.0",
|
||||||
"eslint-plugin-perfectionist": "4.0.2",
|
"eslint-plugin-perfectionist": "4.0.3",
|
||||||
"eslint-typegen": "0.3.2",
|
"eslint-typegen": "0.3.2",
|
||||||
"h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e",
|
"h3": "npm:h3-nightly@2.0.0-1718872656.6765a6e",
|
||||||
"happy-dom": "15.11.6",
|
"happy-dom": "15.11.6",
|
||||||
@ -118,7 +118,7 @@
|
|||||||
"vue-router": "4.4.5",
|
"vue-router": "4.4.5",
|
||||||
"vue-tsc": "2.1.10"
|
"vue-tsc": "2.1.10"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@9.13.2",
|
"packageManager": "pnpm@9.14.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^16.10.0 || >=18.0.0"
|
"node": "^16.10.0 || >=18.0.0"
|
||||||
},
|
},
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
import { defineNuxtPlugin } from '../nuxt'
|
||||||
|
|
||||||
|
export default defineNuxtPlugin({
|
||||||
|
name: 'nuxt:browser-devtools-timing',
|
||||||
|
enforce: 'pre',
|
||||||
|
setup (nuxtApp) {
|
||||||
|
nuxtApp.hooks.beforeEach((event) => {
|
||||||
|
// @ts-expect-error __startTime is not a public API
|
||||||
|
event.__startTime = performance.now()
|
||||||
|
})
|
||||||
|
|
||||||
|
// After each
|
||||||
|
nuxtApp.hooks.afterEach((event) => {
|
||||||
|
performance.measure(event.name, {
|
||||||
|
// @ts-expect-error __startTime is not a public API
|
||||||
|
start: event.__startTime,
|
||||||
|
detail: {
|
||||||
|
devtools: {
|
||||||
|
dataType: 'track-entry',
|
||||||
|
track: 'nuxt',
|
||||||
|
color: 'tertiary-dark',
|
||||||
|
} satisfies ExtensionTrackEntryPayload,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
type DevToolsColor =
|
||||||
|
'primary' | 'primary-light' | 'primary-dark' |
|
||||||
|
'secondary' | 'secondary-light' | 'secondary-dark' |
|
||||||
|
'tertiary' | 'tertiary-light' | 'tertiary-dark' |
|
||||||
|
'error'
|
||||||
|
|
||||||
|
interface ExtensionTrackEntryPayload {
|
||||||
|
dataType?: 'track-entry' // Defaults to "track-entry"
|
||||||
|
color?: DevToolsColor // Defaults to "primary"
|
||||||
|
track: string // Required: Name of the custom track
|
||||||
|
trackGroup?: string // Optional: Group for organizing tracks
|
||||||
|
properties?: [string, string][] // Key-value pairs for detailed view
|
||||||
|
tooltipText?: string // Short description for tooltip
|
||||||
|
}
|
@ -540,6 +540,12 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
addPlugin(resolve(nuxt.options.appDir, 'plugins/debug'))
|
addPlugin(resolve(nuxt.options.appDir, 'plugins/debug'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add experimental Chrome devtools timings support
|
||||||
|
// https://developer.chrome.com/docs/devtools/performance/extension
|
||||||
|
if (nuxt.options.experimental.browserDevtoolsTiming) {
|
||||||
|
addPlugin(resolve(nuxt.options.appDir, 'plugins/browser-devtools-timing.client'))
|
||||||
|
}
|
||||||
|
|
||||||
for (const [key, options] of modulesToInstall) {
|
for (const [key, options] of modulesToInstall) {
|
||||||
await installModule(key, options)
|
await installModule(key, options)
|
||||||
}
|
}
|
||||||
|
@ -407,5 +407,14 @@ export default defineUntypedSchema({
|
|||||||
return val ?? ((await get('future') as Record<string, unknown>).compatibilityVersion === 4)
|
return val ?? ((await get('future') as Record<string, unknown>).compatibilityVersion === 4)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable timings for Nuxt application hooks in the performance panel of Chromium-based browsers.
|
||||||
|
*
|
||||||
|
* @see [the Chrome DevTools extensibility API](https://developer.chrome.com/docs/devtools/performance/extension#tracks)
|
||||||
|
*/
|
||||||
|
browserDevtoolsTiming: {
|
||||||
|
$resolve: async (val, get) => val ?? await get('dev'),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -114,8 +114,8 @@ importers:
|
|||||||
specifier: 3.3.0
|
specifier: 3.3.0
|
||||||
version: 3.3.0
|
version: 3.3.0
|
||||||
eslint-plugin-perfectionist:
|
eslint-plugin-perfectionist:
|
||||||
specifier: 4.0.2
|
specifier: 4.0.3
|
||||||
version: 4.0.2(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3)
|
version: 4.0.3(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3)
|
||||||
eslint-typegen:
|
eslint-typegen:
|
||||||
specifier: 0.3.2
|
specifier: 0.3.2
|
||||||
version: 0.3.2(eslint@9.15.0(jiti@2.4.0))
|
version: 0.3.2(eslint@9.15.0(jiti@2.4.0))
|
||||||
@ -4373,8 +4373,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-brcKcxGnISN2CcVhXJ/kEQlNa0MEfGRtwKtWA16SkqXHKitaKIMrfemJKLKX1YqDU5C/5JY3PvZXd5jEW04e0Q==}
|
resolution: {integrity: sha512-brcKcxGnISN2CcVhXJ/kEQlNa0MEfGRtwKtWA16SkqXHKitaKIMrfemJKLKX1YqDU5C/5JY3PvZXd5jEW04e0Q==}
|
||||||
engines: {node: '>=5.0.0'}
|
engines: {node: '>=5.0.0'}
|
||||||
|
|
||||||
eslint-plugin-perfectionist@4.0.2:
|
eslint-plugin-perfectionist@4.0.3:
|
||||||
resolution: {integrity: sha512-zWdgyg2SdHqhp/P9d9vKwo5qD9is28xMAGzBslHqkZz5mVIikjyz1qvuJ4yS7Wrsf4KlbGorORefb4Kbe7Puzg==}
|
resolution: {integrity: sha512-CyafnreF6boy4lf1XaF72U8NbkwrfjU/mOf1y6doaDMS9zGXhUU1DSk+ZPf/rVwCf1PL1m+rhHqFs+IcB8kDmA==}
|
||||||
engines: {node: ^18.0.0 || >=20.0.0}
|
engines: {node: ^18.0.0 || >=20.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: '>=8.0.0'
|
eslint: '>=8.0.0'
|
||||||
@ -11519,7 +11519,7 @@ snapshots:
|
|||||||
|
|
||||||
eslint-plugin-no-only-tests@3.3.0: {}
|
eslint-plugin-no-only-tests@3.3.0: {}
|
||||||
|
|
||||||
eslint-plugin-perfectionist@4.0.2(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3):
|
eslint-plugin-perfectionist@4.0.3(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 8.15.0
|
'@typescript-eslint/types': 8.15.0
|
||||||
'@typescript-eslint/utils': 8.15.0(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3)
|
'@typescript-eslint/utils': 8.15.0(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3)
|
||||||
|
Loading…
Reference in New Issue
Block a user