mirror of https://github.com/nuxt/nuxt.git
Merge remote-tracking branch 'origin/3.x' into chore/nitro-v2
This commit is contained in:
commit
bfae0551ec
|
@ -1,4 +1,4 @@
|
|||
FROM node:lts
|
||||
FROM node:lts@sha256:48db4f6ea21d134be744207225753a1730c4bc1b4cdf836d44511c36bf0e34d7
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -fy libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdbus-1-3 libdrm2 libxkbcommon0 libatspi2.0-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 && \
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
paths:
|
||||
- 'packages/*/dist/**'
|
||||
- 'packages/nuxt/bin/**'
|
||||
- 'packages/schema/schema/**'
|
||||
paths-ignore:
|
||||
- 'test/**'
|
||||
- '**/*.test.js'
|
||||
- '**/*.test.ts'
|
||||
- '**/*.test.tsx'
|
||||
- '**/__tests__/**'
|
|
@ -6,6 +6,8 @@ on:
|
|||
types:
|
||||
- closed
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -20,14 +22,14 @@ jobs:
|
|||
gh extension install actions/gh-actions-cache
|
||||
|
||||
echo "Fetching list of cache keys"
|
||||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
|
||||
cacheKeysForPR=$(gh actions-cache list -R "$REPO" -B "$BRANCH" -L 100 | cut -f 1 )
|
||||
|
||||
## Setting this to not fail the workflow while deleting cache keys.
|
||||
set +e
|
||||
echo "Deleting caches..."
|
||||
for cacheKey in $cacheKeysForPR
|
||||
do
|
||||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
|
||||
gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm
|
||||
done
|
||||
echo "Done"
|
||||
env:
|
||||
|
|
|
@ -6,9 +6,7 @@ on:
|
|||
- main
|
||||
- 3.x
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
permissions: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
|
||||
|
@ -19,6 +17,10 @@ jobs:
|
|||
if: github.repository_owner == 'nuxt' && !contains(github.event.head_commit.message, 'v3.') && !contains(github.event.head_commit.message, 'v4.')
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
|
|
|
@ -70,8 +70,6 @@ jobs:
|
|||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
needs:
|
||||
- build
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
@ -81,25 +79,26 @@ jobs:
|
|||
node-version: 20
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
|
||||
with:
|
||||
languages: javascript
|
||||
config: |
|
||||
paths:
|
||||
- 'packages/*/src/**'
|
||||
- 'packages/nuxt/bin/**'
|
||||
- 'packages/schema/schema/**'
|
||||
paths-ignore:
|
||||
- 'test/**'
|
||||
- '**/*.spec.ts'
|
||||
- '**/*.test.ts'
|
||||
- '**/__snapshots__/**'
|
||||
languages: javascript-typescript
|
||||
queries: +security-and-quality
|
||||
|
||||
- name: Restore dist cache
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||
with:
|
||||
name: dist
|
||||
path: packages
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6
|
||||
with:
|
||||
category: "/language:javascript"
|
||||
category: "/language:javascript-typescript"
|
||||
|
||||
typecheck:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
|
|
@ -5,21 +5,22 @@ on:
|
|||
types:
|
||||
- opened
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
add-pr-labels:
|
||||
add-issue-labels:
|
||||
name: Add labels
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
if: github.repository == 'nuxt/nuxt'
|
||||
steps:
|
||||
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
# add 'pending triage' label if issue is created with no labels
|
||||
// add 'pending triage' label if issue is created with no labels
|
||||
if (context.payload.issue.labels.length === 0) {
|
||||
github.rest.issues.addLabels({
|
||||
issue_number: pullRequest.number,
|
||||
issue_number: context.payload.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: ['pending triage']
|
||||
|
|
|
@ -8,6 +8,8 @@ on:
|
|||
- main
|
||||
- 3.x
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
add-pr-labels:
|
||||
name: Add PR labels
|
||||
|
|
|
@ -26,6 +26,6 @@ jobs:
|
|||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
|
||||
- name: Check workflow files
|
||||
run: |
|
||||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/590d3bd9dde0c91f7a66071d40eb84716526e5a6/scripts/download-actionlint.bash) 1.6.25
|
||||
./actionlint -color -shellcheck=""
|
||||
uses: docker://rhysd/actionlint:1.7.1@sha256:435ecdb63b1169e80ca3e136290072548c07fc4d76a044cf5541021712f8f344
|
||||
with:
|
||||
args: -color
|
||||
|
|
|
@ -4,6 +4,9 @@ on:
|
|||
types: [closed]
|
||||
paths:
|
||||
- "packages/nuxt/src/app/composables/**"
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
if: github.event.pull_request.merged == true
|
||||
|
|
|
@ -39,7 +39,7 @@ jobs:
|
|||
GH_REPO: ${{ github.repository }}
|
||||
COMMENT_AT: ${{ github.event.comment.created_at }}
|
||||
run: |
|
||||
pr="$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${GH_REPO}/pulls/${PR_NUMBER})"
|
||||
pr="$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/"${GH_REPO}"/pulls/"${PR_NUMBER}")"
|
||||
head_sha="$(echo "$pr" | jq -r .head.sha)"
|
||||
updated_at="$(echo "$pr" | jq -r .updated_at)"
|
||||
|
||||
|
@ -47,7 +47,7 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "head_sha=$head_sha" >> $GITHUB_OUTPUT
|
||||
echo "head_sha=$head_sha" >> "$GITHUB_OUTPUT"
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
with:
|
||||
ref: ${{ steps.pr.outputs.head_sha }}
|
||||
|
|
|
@ -7,12 +7,12 @@ on:
|
|||
- edited
|
||||
- synchronize
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
semantic-pr:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
|
||||
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
|
||||
if: github.repository == 'nuxt/nuxt' && !startsWith(github.head_ref, 'v')
|
||||
|
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
stackblitz:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: huang-julien/reproduire-sur-stackblitz@v1.0.2
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
- uses: huang-julien/reproduire-sur-stackblitz@9ceccbfbb0f2f9a9a8db2d1f0dd909cf5cfe67aa # v1.0.2
|
||||
with:
|
||||
reproduction-heading: '### Reproduction'
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
"nuxt": "workspace:*",
|
||||
"postcss": "8.4.45",
|
||||
"rollup": "4.21.2",
|
||||
"send": ">=0.19.0",
|
||||
"typescript": "5.6.2",
|
||||
"ufo": "1.5.4",
|
||||
"vite": "5.4.4",
|
||||
|
|
|
@ -2,6 +2,7 @@ import { defineComponent } from 'vue'
|
|||
|
||||
export default defineComponent({
|
||||
name: 'DevOnly',
|
||||
inheritAttrs: false,
|
||||
setup (_, props) {
|
||||
if (import.meta.dev) {
|
||||
return () => props.slots.default?.()
|
||||
|
|
|
@ -8,6 +8,7 @@ import { createError } from '../composables/error'
|
|||
import { islandComponents } from '#build/components.islands.mjs'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'IslandRenderer',
|
||||
props: {
|
||||
context: {
|
||||
type: Object as () => { name: string, props?: Record<string, any> },
|
||||
|
|
|
@ -45,6 +45,7 @@ async function loadComponents (source = appBaseURL, paths: NuxtIslandResponse['c
|
|||
|
||||
export default defineComponent({
|
||||
name: 'NuxtIsland',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
|
|
|
@ -18,6 +18,7 @@ export const NuxtTeleportIslandSymbol = Symbol('NuxtTeleportIslandComponent') as
|
|||
/* @__PURE__ */
|
||||
export default defineComponent({
|
||||
name: 'NuxtTeleportIslandComponent',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
to: {
|
||||
type: String,
|
||||
|
|
|
@ -9,6 +9,7 @@ import { NuxtTeleportIslandSymbol } from './nuxt-teleport-island-component'
|
|||
/* @__PURE__ */
|
||||
export default defineComponent({
|
||||
name: 'NuxtTeleportIslandSlot',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
|
|
|
@ -7,7 +7,7 @@ import { devRootDir } from '#build/nuxt.config.mjs'
|
|||
|
||||
export default (url: string) => defineComponent({
|
||||
name: 'NuxtTestComponentWrapper',
|
||||
|
||||
inheritAttrs: false,
|
||||
async setup (props, { attrs }) {
|
||||
const query = parseQuery(new URL(url, 'http://localhost').search)
|
||||
const urlProps = query.props ? destr<Record<string, any>>(query.props as string) : {}
|
||||
|
|
|
@ -20,7 +20,7 @@ import type { LoadingIndicator } from '../app/composables/loading-indicator'
|
|||
import type { RouteAnnouncer } from '../app/composables/route-announcer'
|
||||
|
||||
// @ts-expect-error virtual file
|
||||
import { appId, multiApp } from '#build/nuxt.config.mjs'
|
||||
import { appId, chunkErrorEvent, multiApp } from '#build/nuxt.config.mjs'
|
||||
|
||||
// TODO: temporary module for backwards compatibility
|
||||
import type { DefaultAsyncDataErrorValue, DefaultErrorValue } from '#app/defaults'
|
||||
|
@ -375,12 +375,14 @@ export function createNuxtApp (options: CreateOptions) {
|
|||
defineGetter(nuxtApp.vueApp, '$nuxt', nuxtApp)
|
||||
defineGetter(nuxtApp.vueApp.config.globalProperties, '$nuxt', nuxtApp)
|
||||
|
||||
// Listen to chunk load errors
|
||||
if (import.meta.client) {
|
||||
window.addEventListener('nuxt.preloadError', (event) => {
|
||||
// Listen to chunk load errors
|
||||
if (chunkErrorEvent) {
|
||||
window.addEventListener(chunkErrorEvent, (event) => {
|
||||
nuxtApp.callHook('app:chunkError', { error: (event as Event & { payload: Error }).payload })
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
}
|
||||
window.useNuxtApp = window.useNuxtApp || useNuxtApp
|
||||
|
||||
// Log errors captured when running plugins, in the `app:created` and `app:beforeMount` hooks
|
||||
|
|
|
@ -26,7 +26,7 @@ export default defineNuxtPlugin({
|
|||
})
|
||||
|
||||
router.onError((error, to) => {
|
||||
if (chunkErrors.has(error)) {
|
||||
if (chunkErrors.has(error) || error.message.includes('Failed to fetch dynamically imported module')) {
|
||||
reloadAppAtPath(to)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -24,7 +24,7 @@ interface ComponentChunkOptions {
|
|||
buildDir: string
|
||||
}
|
||||
|
||||
const SCRIPT_RE = /<script[^>]*>/g
|
||||
const SCRIPT_RE = /<script[^>]*>/gi
|
||||
const HAS_SLOT_OR_CLIENT_RE = /<slot[^>]*>|nuxt-client/
|
||||
const TEMPLATE_RE = /<template>([\s\S]*)<\/template>/
|
||||
const NUXTCLIENT_ATTR_RE = /\s:?nuxt-client(="[^"]*")?/g
|
||||
|
|
|
@ -51,6 +51,7 @@ export function createTransformPlugin (nuxt: Nuxt, getComponents: getComponentsT
|
|||
|
||||
return createUnplugin(() => ({
|
||||
name: 'nuxt:components:imports',
|
||||
enforce: 'post',
|
||||
transformInclude (id) {
|
||||
id = normalize(id)
|
||||
return id.startsWith('virtual:') || id.startsWith('\0virtual:') || id.startsWith(nuxt.options.buildDir) || !isIgnored(id)
|
||||
|
|
|
@ -512,6 +512,7 @@ export const nuxtConfigTemplate: NuxtTemplate = {
|
|||
`export const appId = ${JSON.stringify(ctx.nuxt.options.appId)}`,
|
||||
`export const outdatedBuildInterval = ${ctx.nuxt.options.experimental.checkOutdatedBuildInterval}`,
|
||||
`export const multiApp = ${!!ctx.nuxt.options.future.multiApp}`,
|
||||
`export const chunkErrorEvent = ${ctx.nuxt.options.experimental.emitRouteChunkError ? ctx.nuxt.options.builder === '@nuxt/vite-builder' ? '"vite:preloadError"' : '"nuxt:preloadError"' : 'false'}`,
|
||||
].join('\n\n')
|
||||
},
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import type { Plugin } from 'vite'
|
|||
// @ts-expect-error https://github.com/GoogleChromeLabs/critters/pull/151
|
||||
import Critters from 'critters'
|
||||
import { genObjectFromRawEntries } from 'knitwork'
|
||||
import htmlMinifier from 'html-minifier'
|
||||
import htmlnano from 'htmlnano'
|
||||
import { glob } from 'tinyglobby'
|
||||
import { camelCase } from 'scule'
|
||||
|
||||
|
@ -86,7 +86,7 @@ export const RenderPlugin = () => {
|
|||
}
|
||||
|
||||
// Minify HTML
|
||||
html = htmlMinifier.minify(html, { collapseWhitespace: true })
|
||||
html = await htmlnano.process(html, { collapseWhitespace: 'aggressive' }).then(r => r.html)
|
||||
|
||||
if (!isCompleteHTML) {
|
||||
html = html.replace('<html><head></head><body>', '')
|
||||
|
|
|
@ -18,12 +18,11 @@
|
|||
"test": "pnpm lint && pnpm build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/html-minifier": "4.0.5",
|
||||
"@types/lodash-es": "4.17.12",
|
||||
"@unocss/reset": "0.62.3",
|
||||
"critters": "0.0.24",
|
||||
"html-minifier": "4.0.0",
|
||||
"html-validate": "8.22.0",
|
||||
"htmlnano": "2.1.1",
|
||||
"jiti": "1.21.6",
|
||||
"knitwork": "1.1.0",
|
||||
"lodash-es": "4.17.21",
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<body class="visual-effects relative overflow-hidden min-h-screen bg-white dark:bg-black flex flex-col justify-center items-center text-center">
|
||||
<div id="mouseLight" class="absolute top-0 rounded-full mouse-gradient transition-opacity h-[200px] w-[200px]"></div>
|
||||
<a href="https://nuxt.com" target="_blank" rel="noopener" class="nuxt-logo z-20" aria-label="Nuxt">
|
||||
<svg id="nuxtImg" xmlns="http://www.w3.org/2000/svg" width="214" height="53" fill="none" viewBox="0 0 800 200">
|
||||
<svg class="nuxt-img" xmlns="http://www.w3.org/2000/svg" width="214" height="53" fill="none" viewBox="0 0 800 200">
|
||||
<path fill="#00DC82" d="M168.303 200h111.522c3.543 0 7.022-.924 10.09-2.679A20.086 20.086 0 0 0 297.3 190a19.855 19.855 0 0 0 2.7-10.001 19.858 19.858 0 0 0-2.709-9.998L222.396 41.429a20.09 20.09 0 0 0-7.384-7.32 20.313 20.313 0 0 0-10.088-2.679c-3.541 0-7.02.925-10.087 2.68a20.082 20.082 0 0 0-7.384 7.32l-19.15 32.896L130.86 9.998a20.086 20.086 0 0 0-7.387-7.32A20.322 20.322 0 0 0 113.384 0c-3.542 0-7.022.924-10.09 2.679a20.091 20.091 0 0 0-7.387 7.319L2.709 170A19.853 19.853 0 0 0 0 179.999c-.002 3.511.93 6.96 2.7 10.001a20.091 20.091 0 0 0 7.385 7.321A20.322 20.322 0 0 0 20.175 200h70.004c27.737 0 48.192-12.075 62.266-35.633l34.171-58.652 18.303-31.389 54.93 94.285h-73.233L168.303 200Zm-79.265-31.421-48.854-.011 73.232-125.706 36.541 62.853-24.466 42.01c-9.347 15.285-19.965 20.854-36.453 20.854Z" />
|
||||
<path fill="currentColor" d="M377 200a4 4 0 0 0 4-4v-93s5.244 8.286 15 25l38.707 66.961c1.789 3.119 5.084 5.039 8.649 5.039H470V50h-27a4 4 0 0 0-4 4v94l-17-30-36.588-62.98c-1.792-3.108-5.081-5.02-8.639-5.02H350v150h27ZM676.203 143.857 710.551 92h-25.73a9.972 9.972 0 0 0-8.333 4.522L660.757 120.5l-15.731-23.978A9.972 9.972 0 0 0 636.693 92h-25.527l34.348 51.643L608.524 200h24.966a9.969 9.969 0 0 0 8.29-4.458l19.18-28.756 18.981 28.72a9.968 9.968 0 0 0 8.313 4.494h24.736l-36.787-56.143ZM724.598 92h19.714V60.071h28.251V92H800v24.857h-27.437V159.5c0 10.5 5.284 15.429 14.43 15.429H800V200h-16.869c-23.576 0-38.819-14.143-38.819-39.214v-43.929h-19.714V92ZM590 92h-15c-3.489 0-6.218.145-8.5 2.523-2.282 2.246-2.5 3.63-2.5 7.066v52.486c0 8.058-.376 12.962-4 16.925-3.624 3.831-8.619 5-16 5-7.247 0-12.376-1.169-16-5-3.624-3.963-4-8.867-4-16.925v-52.486c0-3.435-.218-4.82-2.5-7.066C519.218 92.145 516.489 92 513 92h-15v62.422c0 14.004 3.892 25.101 11.676 33.292C517.594 195.905 529.103 200 544 200c14.897 0 26.204-4.095 34.123-12.286 7.918-8.191 11.877-19.288 11.877-33.292V92Z" />
|
||||
</svg>
|
||||
|
@ -95,7 +95,7 @@
|
|||
: !isLowPerformance
|
||||
|
||||
const mouseLight = window.document.getElementById('mouseLight')
|
||||
const nuxtImg = window.document.getElementById('nuxtImg')
|
||||
const nuxtImg = window.document.querySelector('.nuxt-img')
|
||||
const animationToggle = window.document.getElementById('animation-toggle')
|
||||
const body = window.document.body
|
||||
let bodyRect
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -11,7 +11,6 @@ import { defu } from 'defu'
|
|||
import { env, nodeless } from 'unenv'
|
||||
import { appendCorsHeaders, appendCorsPreflightHeaders, defineEventHandler } from 'h3'
|
||||
import type { ViteConfig } from '@nuxt/schema'
|
||||
import { chunkErrorPlugin } from './plugins/chunk-error'
|
||||
import type { ViteBuildContext } from './vite'
|
||||
import { devStyleSSRPlugin } from './plugins/dev-ssr-css'
|
||||
import { runtimePathsPlugin } from './plugins/paths'
|
||||
|
@ -167,11 +166,6 @@ export async function buildClient (ctx: ViteBuildContext) {
|
|||
clientConfig.server!.hmr = false
|
||||
}
|
||||
|
||||
// Emit chunk errors if the user has opted in to `experimental.emitRouteChunkError`
|
||||
if (ctx.nuxt.options.experimental.emitRouteChunkError) {
|
||||
clientConfig.plugins!.push(chunkErrorPlugin({ sourcemap: !!ctx.nuxt.options.sourcemap.client }))
|
||||
}
|
||||
|
||||
// Inject an h3-based CORS handler in preference to vite's
|
||||
const useViteCors = clientConfig.server?.cors !== undefined
|
||||
if (!useViteCors) {
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
import MagicString from 'magic-string'
|
||||
import type { Plugin } from 'vite'
|
||||
|
||||
const vitePreloadHelperId = '\0vite/preload-helper'
|
||||
|
||||
// TODO: remove this function when we upgrade to vite 5
|
||||
export function chunkErrorPlugin (options: { sourcemap?: boolean }): Plugin {
|
||||
return {
|
||||
name: 'nuxt:chunk-error',
|
||||
transform (code, id) {
|
||||
// Vite 5 has an id with extension
|
||||
if (!(id === vitePreloadHelperId || id === `${vitePreloadHelperId}.js`) || code.includes('nuxt.preloadError')) { return }
|
||||
|
||||
const s = new MagicString(code)
|
||||
s.replace(/__vitePreload/g, '___vitePreload')
|
||||
s.append(`
|
||||
export const __vitePreload = (...args) => ___vitePreload(...args).catch(err => {
|
||||
const e = new Event("nuxt.preloadError");
|
||||
e.payload = err;
|
||||
window.dispatchEvent(e);
|
||||
throw err;
|
||||
})`)
|
||||
|
||||
return {
|
||||
code: s.toString(),
|
||||
map: options.sourcemap
|
||||
? s.generateMap({ hires: true })
|
||||
: undefined,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
|
@ -43,7 +43,7 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio
|
|||
},
|
||||
transform (code, id) {
|
||||
if (!KEYED_FUNCTIONS_RE.test(code)) { return }
|
||||
const { 0: script = code, index: codeIndex = 0 } = code.match(/(?<=<script[^>]*>)[\s\S]*?(?=<\/script>)/) || { index: 0, 0: code }
|
||||
const { 0: script = code, index: codeIndex = 0 } = code.match(/(?<=<script[^>]*>)[\s\S]*?(?=<\/script>)/i) || { index: 0, 0: code }
|
||||
const s = new MagicString(code)
|
||||
// https://github.com/unjs/unplugin/issues/90
|
||||
let imports: Set<string> | undefined
|
||||
|
|
|
@ -7,11 +7,11 @@ const script = `
|
|||
if (typeof ${webpack.RuntimeGlobals.require} !== "undefined") {
|
||||
var _ensureChunk = ${webpack.RuntimeGlobals.ensureChunk};
|
||||
${webpack.RuntimeGlobals.ensureChunk} = function (chunkId) {
|
||||
return Promise.resolve(_ensureChunk(chunkId)).catch(err => {
|
||||
const e = new Event("nuxt.preloadError");
|
||||
e.payload = err;
|
||||
window.dispatchEvent(e);
|
||||
throw err;
|
||||
return Promise.resolve(_ensureChunk(chunkId)).catch(error => {
|
||||
const e = new Event('nuxt:preloadError', { cancelable: true })
|
||||
e.payload = error
|
||||
window.dispatchEvent(e)
|
||||
throw error
|
||||
});
|
||||
};
|
||||
};`
|
||||
|
|
243
pnpm-lock.yaml
243
pnpm-lock.yaml
|
@ -17,6 +17,7 @@ overrides:
|
|||
nuxt: workspace:*
|
||||
postcss: 8.4.45
|
||||
rollup: 4.21.2
|
||||
send: '>=0.19.0'
|
||||
typescript: 5.6.2
|
||||
ufo: 1.5.4
|
||||
vite: 5.4.4
|
||||
|
@ -614,9 +615,6 @@ importers:
|
|||
|
||||
packages/ui-templates:
|
||||
devDependencies:
|
||||
'@types/html-minifier':
|
||||
specifier: 4.0.5
|
||||
version: 4.0.5
|
||||
'@types/lodash-es':
|
||||
specifier: 4.17.12
|
||||
version: 4.17.12
|
||||
|
@ -626,12 +624,12 @@ importers:
|
|||
critters:
|
||||
specifier: 0.0.24
|
||||
version: 0.0.24
|
||||
html-minifier:
|
||||
specifier: 4.0.0
|
||||
version: 4.0.0
|
||||
html-validate:
|
||||
specifier: 8.22.0
|
||||
version: 8.22.0(vitest@1.6.0(@types/node@20.16.5)(happy-dom@15.7.3)(sass@1.69.4)(terser@5.27.0))
|
||||
htmlnano:
|
||||
specifier: 2.1.1
|
||||
version: 2.1.1(cssnano@7.0.6(postcss@8.4.45))(postcss@8.4.45)(relateurl@0.2.7)(svgo@3.3.2)(terser@5.27.0)(typescript@5.6.2)
|
||||
jiti:
|
||||
specifier: 1.21.6
|
||||
version: 1.21.6
|
||||
|
@ -2252,9 +2250,6 @@ packages:
|
|||
'@types/aria-query@5.0.4':
|
||||
resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==}
|
||||
|
||||
'@types/clean-css@4.2.11':
|
||||
resolution: {integrity: sha512-Y8n81lQVTAfP2TOdtJJEsCoYl1AnOkqDqMvXb9/7pfgZZ7r8YrEyurrAvAoAjHOGXKRybay+5CsExqIH6liccw==}
|
||||
|
||||
'@types/clear@0.1.4':
|
||||
resolution: {integrity: sha512-4nJjoilJPTbYF7Q4y5+F7JFDK8QdcwOItzwVv3RDEMWALT9Mx9UzfxCiUfpbFK05REhieXTCvhbNkiDW/Wfejw==}
|
||||
|
||||
|
@ -2285,9 +2280,6 @@ packages:
|
|||
'@types/hast@3.0.4':
|
||||
resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}
|
||||
|
||||
'@types/html-minifier@4.0.5':
|
||||
resolution: {integrity: sha512-LfE7f7MFd+YUfZnlBz8W43P4NgSObWiqyKapANsWCj63Aqeqli8/9gVsGP4CwC8jPpTTYlTopKCk9rJSuht/ew==}
|
||||
|
||||
'@types/http-proxy@1.17.15':
|
||||
resolution: {integrity: sha512-25g5atgiVNTIv0LBDTg1H74Hvayx0ajtJPLLcYE3whFv75J0pWNtOBzaXJQgDTmrX1bx5U9YC2w/n65BN1HwRQ==}
|
||||
|
||||
|
@ -2330,9 +2322,6 @@ packages:
|
|||
'@types/pug@2.0.10':
|
||||
resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==}
|
||||
|
||||
'@types/relateurl@0.2.33':
|
||||
resolution: {integrity: sha512-bTQCKsVbIdzLqZhLkF5fcJQreE4y1ro4DIyVrlDNSCJRRwHhB8Z+4zXXa8jN6eDvc2HbRsEYgbvrnGvi54EpSw==}
|
||||
|
||||
'@types/resolve@1.20.2':
|
||||
resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==}
|
||||
|
||||
|
@ -2700,9 +2689,6 @@ packages:
|
|||
'@vue/devtools-kit@7.4.5':
|
||||
resolution: {integrity: sha512-Uuki4Z6Bc/ExvtlPkeDNGSAe4580R+HPcVABfTE9TF7BTz3Nntk7vxIRUyWblZkUEcB/x+wn2uofyt5i2LaUew==}
|
||||
|
||||
'@vue/devtools-shared@7.4.4':
|
||||
resolution: {integrity: sha512-yeJULXFHOKIm8yL2JFO050a9ztTVqOCKTqN9JHFxGTJN0b+gjtfn6zC+FfyHUgjwCwf6E3hfKrlohtthcqoYqw==}
|
||||
|
||||
'@vue/devtools-shared@7.4.5':
|
||||
resolution: {integrity: sha512-2XgUOkL/7QDmyYI9J7cm+rz/qBhcGv+W5+i1fhwdQ0HQ1RowhdK66F0QBuJSz/5k12opJY8eN6m03/XZMs7imQ==}
|
||||
|
||||
|
@ -3122,9 +3108,6 @@ packages:
|
|||
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
camel-case@3.0.0:
|
||||
resolution: {integrity: sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==}
|
||||
|
||||
camelcase@6.3.0:
|
||||
resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==}
|
||||
engines: {node: '>=10'}
|
||||
|
@ -3218,10 +3201,6 @@ packages:
|
|||
citty@0.1.6:
|
||||
resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==}
|
||||
|
||||
clean-css@4.2.4:
|
||||
resolution: {integrity: sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==}
|
||||
engines: {node: '>= 4.0'}
|
||||
|
||||
clean-regexp@1.0.0:
|
||||
resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==}
|
||||
engines: {node: '>=4'}
|
||||
|
@ -3656,16 +3635,26 @@ packages:
|
|||
dom-accessibility-api@0.5.16:
|
||||
resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==}
|
||||
|
||||
dom-serializer@1.4.1:
|
||||
resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==}
|
||||
|
||||
dom-serializer@2.0.0:
|
||||
resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}
|
||||
|
||||
domelementtype@2.3.0:
|
||||
resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==}
|
||||
|
||||
domhandler@4.3.1:
|
||||
resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==}
|
||||
engines: {node: '>= 4'}
|
||||
|
||||
domhandler@5.0.3:
|
||||
resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==}
|
||||
engines: {node: '>= 4'}
|
||||
|
||||
domutils@2.8.0:
|
||||
resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==}
|
||||
|
||||
domutils@3.1.0:
|
||||
resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==}
|
||||
|
||||
|
@ -3725,6 +3714,13 @@ packages:
|
|||
resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
|
||||
entities@2.2.0:
|
||||
resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==}
|
||||
|
||||
entities@3.0.1:
|
||||
resolution: {integrity: sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==}
|
||||
engines: {node: '>=0.12'}
|
||||
|
||||
entities@4.5.0:
|
||||
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
|
||||
engines: {node: '>=0.12'}
|
||||
|
@ -4323,11 +4319,6 @@ packages:
|
|||
html-escaper@2.0.2:
|
||||
resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==}
|
||||
|
||||
html-minifier@4.0.0:
|
||||
resolution: {integrity: sha512-aoGxanpFPLg7MkIl/DDFYtb0iWz7jMFGqFhvEDZga6/4QTjneiD8I/NXL1x5aaoCp7FSIT6h/OhykDdPsbtMig==}
|
||||
engines: {node: '>=6'}
|
||||
hasBin: true
|
||||
|
||||
html-tags@3.3.1:
|
||||
resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
@ -4354,6 +4345,38 @@ packages:
|
|||
html-void-elements@3.0.0:
|
||||
resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==}
|
||||
|
||||
htmlnano@2.1.1:
|
||||
resolution: {integrity: sha512-kAERyg/LuNZYmdqgCdYvugyLWNFAm8MWXpQMz1pLpetmCbFwoMxvkSoaAMlFrOC4OKTWI4KlZGT/RsNxg4ghOw==}
|
||||
peerDependencies:
|
||||
cssnano: ^7.0.0
|
||||
postcss: 8.4.45
|
||||
purgecss: ^6.0.0
|
||||
relateurl: ^0.2.7
|
||||
srcset: 5.0.1
|
||||
svgo: ^3.0.2
|
||||
terser: ^5.10.0
|
||||
uncss: ^0.17.3
|
||||
peerDependenciesMeta:
|
||||
cssnano:
|
||||
optional: true
|
||||
postcss:
|
||||
optional: true
|
||||
purgecss:
|
||||
optional: true
|
||||
relateurl:
|
||||
optional: true
|
||||
srcset:
|
||||
optional: true
|
||||
svgo:
|
||||
optional: true
|
||||
terser:
|
||||
optional: true
|
||||
uncss:
|
||||
optional: true
|
||||
|
||||
htmlparser2@7.2.0:
|
||||
resolution: {integrity: sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==}
|
||||
|
||||
htmlparser2@8.0.2:
|
||||
resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==}
|
||||
|
||||
|
@ -4548,6 +4571,9 @@ packages:
|
|||
resolution: {integrity: sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==}
|
||||
engines: {node: '>=18'}
|
||||
|
||||
is-json@2.0.1:
|
||||
resolution: {integrity: sha512-6BEnpVn1rcf3ngfmViLM6vjUjGErbdrL4rwlv+u1NO1XO8kqT4YGL8+19Q+Z/bas8tY90BTWMk2+fW1g6hQjbA==}
|
||||
|
||||
is-map@2.0.2:
|
||||
resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==}
|
||||
|
||||
|
@ -4875,9 +4901,6 @@ packages:
|
|||
loupe@3.1.1:
|
||||
resolution: {integrity: sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==}
|
||||
|
||||
lower-case@1.1.4:
|
||||
resolution: {integrity: sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==}
|
||||
|
||||
lru-cache@10.4.3:
|
||||
resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}
|
||||
|
||||
|
@ -5250,9 +5273,6 @@ packages:
|
|||
xml2js:
|
||||
optional: true
|
||||
|
||||
no-case@2.3.2:
|
||||
resolution: {integrity: sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==}
|
||||
|
||||
node-abort-controller@3.1.1:
|
||||
resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==}
|
||||
|
||||
|
@ -5437,9 +5457,6 @@ packages:
|
|||
package-manager-detector@0.2.0:
|
||||
resolution: {integrity: sha512-E385OSk9qDcXhcM9LNSe4sdhx8a9mAPrZ4sMLW+tmxl5ZuGtPUcdFu+MPP2jbgiWAZ6Pfe5soGFMd+0Db5Vrog==}
|
||||
|
||||
param-case@2.1.1:
|
||||
resolution: {integrity: sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==}
|
||||
|
||||
parent-module@1.0.1:
|
||||
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
|
||||
engines: {node: '>=6'}
|
||||
|
@ -5792,6 +5809,18 @@ packages:
|
|||
resolution: {integrity: sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==}
|
||||
engines: {node: ^10 || ^12 || >=14}
|
||||
|
||||
posthtml-parser@0.11.0:
|
||||
resolution: {integrity: sha512-QecJtfLekJbWVo/dMAA+OSwY79wpRmbqS5TeXvXSX+f0c6pW4/SE6inzZ2qkU7oAMCPqIDkZDvd/bQsSFUnKyw==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
posthtml-render@3.0.0:
|
||||
resolution: {integrity: sha512-z+16RoxK3fUPgwaIgH9NGnK1HKY9XIDpydky5eQGgAFVXTCSezalv9U2jQuNV+Z9qV1fDWNzldcw4eK0SSbqKA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
posthtml@0.16.6:
|
||||
resolution: {integrity: sha512-JcEmHlyLK/o0uGAlj65vgg+7LIms0xKXe60lcDOTU7oVX/3LuEuLwrQpW3VJ7de5TaFKiW4kWkaIpJL42FEgxQ==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
|
||||
prelude-ls@1.2.1:
|
||||
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
|
@ -6138,8 +6167,8 @@ packages:
|
|||
engines: {node: '>=10'}
|
||||
hasBin: true
|
||||
|
||||
send@0.18.0:
|
||||
resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
|
||||
send@0.19.0:
|
||||
resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
|
||||
serialize-javascript@6.0.2:
|
||||
|
@ -6484,6 +6513,9 @@ packages:
|
|||
peerDependencies:
|
||||
webpack: '>=4.0.0'
|
||||
|
||||
timsort@0.3.0:
|
||||
resolution: {integrity: sha512-qsdtZH+vMoCARQtyod4imc2nIJwg9Cc7lPRrw9CzF8ZKR0khdr8+2nX80PBhET3tcyTtJDxAffGh2rXH4tyU8A==}
|
||||
|
||||
tiny-invariant@1.3.1:
|
||||
resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==}
|
||||
|
||||
|
@ -6624,11 +6656,6 @@ packages:
|
|||
ufo@1.5.4:
|
||||
resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==}
|
||||
|
||||
uglify-js@3.17.4:
|
||||
resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==}
|
||||
engines: {node: '>=0.8.0'}
|
||||
hasBin: true
|
||||
|
||||
ultrahtml@1.5.3:
|
||||
resolution: {integrity: sha512-GykOvZwgDWZlTQMtp5jrD4BVL+gNn2NVlVafjcFUJ7taY20tqYdwdoWBFy6GBJsNTZe1GkGPkSl5knQAjtgceg==}
|
||||
|
||||
|
@ -6792,9 +6819,6 @@ packages:
|
|||
peerDependencies:
|
||||
browserslist: '>= 4.21.0'
|
||||
|
||||
upper-case@1.1.3:
|
||||
resolution: {integrity: sha512-WRbjgmYzgXkCV7zNVpy5YgrHgbBv126rMALQQMrmzOVC4GM2waQ9x7xtm8VU+1yF2kWyPzI9zbZ48n4vSxwfSA==}
|
||||
|
||||
uqr@0.1.2:
|
||||
resolution: {integrity: sha512-MJu7ypHq6QasgF5YRTjqscSzQp/W11zoUk6kvmlH+fmWEs63Y0Eib13hYFwAzagRJcVY8WVnlV+eBDUGMJ5IbA==}
|
||||
|
||||
|
@ -8603,11 +8627,6 @@ snapshots:
|
|||
|
||||
'@types/aria-query@5.0.4': {}
|
||||
|
||||
'@types/clean-css@4.2.11':
|
||||
dependencies:
|
||||
'@types/node': 20.16.5
|
||||
source-map: 0.6.1
|
||||
|
||||
'@types/clear@0.1.4': {}
|
||||
|
||||
'@types/connect@3.4.37':
|
||||
|
@ -8641,12 +8660,6 @@ snapshots:
|
|||
dependencies:
|
||||
'@types/unist': 3.0.2
|
||||
|
||||
'@types/html-minifier@4.0.5':
|
||||
dependencies:
|
||||
'@types/clean-css': 4.2.11
|
||||
'@types/relateurl': 0.2.33
|
||||
'@types/uglify-js': 3.17.3
|
||||
|
||||
'@types/http-proxy@1.17.15':
|
||||
dependencies:
|
||||
'@types/node': 20.16.5
|
||||
|
@ -8689,8 +8702,6 @@ snapshots:
|
|||
|
||||
'@types/pug@2.0.10': {}
|
||||
|
||||
'@types/relateurl@0.2.33': {}
|
||||
|
||||
'@types/resolve@1.20.2': {}
|
||||
|
||||
'@types/sass-loader@8.0.9':
|
||||
|
@ -9315,8 +9326,8 @@ snapshots:
|
|||
|
||||
'@vue/devtools-core@7.4.4(vite@5.4.4(@types/node@20.16.5)(sass@1.69.4)(terser@5.27.0))(vue@3.5.4(typescript@5.6.2))':
|
||||
dependencies:
|
||||
'@vue/devtools-kit': 7.4.4
|
||||
'@vue/devtools-shared': 7.4.4
|
||||
'@vue/devtools-kit': 7.4.5
|
||||
'@vue/devtools-shared': 7.4.5
|
||||
mitt: 3.0.1
|
||||
nanoid: 3.3.7
|
||||
pathe: 1.1.2
|
||||
|
@ -9327,7 +9338,7 @@ snapshots:
|
|||
|
||||
'@vue/devtools-kit@7.4.4':
|
||||
dependencies:
|
||||
'@vue/devtools-shared': 7.4.4
|
||||
'@vue/devtools-shared': 7.4.5
|
||||
birpc: 0.2.17
|
||||
hookable: 5.5.3
|
||||
mitt: 3.0.1
|
||||
|
@ -9345,10 +9356,6 @@ snapshots:
|
|||
speakingurl: 14.0.1
|
||||
superjson: 2.2.1
|
||||
|
||||
'@vue/devtools-shared@7.4.4':
|
||||
dependencies:
|
||||
rfdc: 1.4.1
|
||||
|
||||
'@vue/devtools-shared@7.4.5':
|
||||
dependencies:
|
||||
rfdc: 1.4.1
|
||||
|
@ -9796,11 +9803,6 @@ snapshots:
|
|||
|
||||
callsites@3.1.0: {}
|
||||
|
||||
camel-case@3.0.0:
|
||||
dependencies:
|
||||
no-case: 2.3.2
|
||||
upper-case: 1.1.3
|
||||
|
||||
camelcase@6.3.0: {}
|
||||
|
||||
caniuse-api@3.0.0:
|
||||
|
@ -9913,10 +9915,6 @@ snapshots:
|
|||
dependencies:
|
||||
consola: 3.2.3
|
||||
|
||||
clean-css@4.2.4:
|
||||
dependencies:
|
||||
source-map: 0.6.1
|
||||
|
||||
clean-regexp@1.0.0:
|
||||
dependencies:
|
||||
escape-string-regexp: 1.0.5
|
||||
|
@ -10303,6 +10301,12 @@ snapshots:
|
|||
|
||||
dom-accessibility-api@0.5.16: {}
|
||||
|
||||
dom-serializer@1.4.1:
|
||||
dependencies:
|
||||
domelementtype: 2.3.0
|
||||
domhandler: 4.3.1
|
||||
entities: 2.2.0
|
||||
|
||||
dom-serializer@2.0.0:
|
||||
dependencies:
|
||||
domelementtype: 2.3.0
|
||||
|
@ -10311,10 +10315,20 @@ snapshots:
|
|||
|
||||
domelementtype@2.3.0: {}
|
||||
|
||||
domhandler@4.3.1:
|
||||
dependencies:
|
||||
domelementtype: 2.3.0
|
||||
|
||||
domhandler@5.0.3:
|
||||
dependencies:
|
||||
domelementtype: 2.3.0
|
||||
|
||||
domutils@2.8.0:
|
||||
dependencies:
|
||||
dom-serializer: 1.4.1
|
||||
domelementtype: 2.3.0
|
||||
domhandler: 4.3.1
|
||||
|
||||
domutils@3.1.0:
|
||||
dependencies:
|
||||
dom-serializer: 2.0.0
|
||||
|
@ -10370,6 +10384,10 @@ snapshots:
|
|||
graceful-fs: 4.2.11
|
||||
tapable: 2.2.1
|
||||
|
||||
entities@2.2.0: {}
|
||||
|
||||
entities@3.0.1: {}
|
||||
|
||||
entities@4.5.0: {}
|
||||
|
||||
env-paths@2.2.1: {}
|
||||
|
@ -11179,16 +11197,6 @@ snapshots:
|
|||
|
||||
html-escaper@2.0.2: {}
|
||||
|
||||
html-minifier@4.0.0:
|
||||
dependencies:
|
||||
camel-case: 3.0.0
|
||||
clean-css: 4.2.4
|
||||
commander: 2.20.3
|
||||
he: 1.2.0
|
||||
param-case: 2.1.1
|
||||
relateurl: 0.2.7
|
||||
uglify-js: 3.17.4
|
||||
|
||||
html-tags@3.3.1: {}
|
||||
|
||||
html-validate@8.22.0(vitest@1.6.0(@types/node@20.16.5)(happy-dom@15.7.3)(sass@1.69.4)(terser@5.27.0)):
|
||||
|
@ -11208,6 +11216,27 @@ snapshots:
|
|||
|
||||
html-void-elements@3.0.0: {}
|
||||
|
||||
htmlnano@2.1.1(cssnano@7.0.6(postcss@8.4.45))(postcss@8.4.45)(relateurl@0.2.7)(svgo@3.3.2)(terser@5.27.0)(typescript@5.6.2):
|
||||
dependencies:
|
||||
cosmiconfig: 9.0.0(typescript@5.6.2)
|
||||
posthtml: 0.16.6
|
||||
timsort: 0.3.0
|
||||
optionalDependencies:
|
||||
cssnano: 7.0.6(postcss@8.4.45)
|
||||
postcss: 8.4.45
|
||||
relateurl: 0.2.7
|
||||
svgo: 3.3.2
|
||||
terser: 5.27.0
|
||||
transitivePeerDependencies:
|
||||
- typescript
|
||||
|
||||
htmlparser2@7.2.0:
|
||||
dependencies:
|
||||
domelementtype: 2.3.0
|
||||
domhandler: 4.3.1
|
||||
domutils: 2.8.0
|
||||
entities: 3.0.1
|
||||
|
||||
htmlparser2@8.0.2:
|
||||
dependencies:
|
||||
domelementtype: 2.3.0
|
||||
|
@ -11413,6 +11442,8 @@ snapshots:
|
|||
global-directory: 4.0.1
|
||||
is-path-inside: 4.0.0
|
||||
|
||||
is-json@2.0.1: {}
|
||||
|
||||
is-map@2.0.2: {}
|
||||
|
||||
is-module@1.0.0: {}
|
||||
|
@ -11729,8 +11760,6 @@ snapshots:
|
|||
dependencies:
|
||||
get-func-name: 2.0.2
|
||||
|
||||
lower-case@1.1.4: {}
|
||||
|
||||
lru-cache@10.4.3: {}
|
||||
|
||||
lru-cache@11.0.0: {}
|
||||
|
@ -12347,10 +12376,6 @@ snapshots:
|
|||
- uWebSockets.js
|
||||
- webpack-sources
|
||||
|
||||
no-case@2.3.2:
|
||||
dependencies:
|
||||
lower-case: 1.1.4
|
||||
|
||||
node-abort-controller@3.1.1: {}
|
||||
|
||||
node-addon-api@7.0.0: {}
|
||||
|
@ -12560,10 +12585,6 @@ snapshots:
|
|||
|
||||
package-manager-detector@0.2.0: {}
|
||||
|
||||
param-case@2.1.1:
|
||||
dependencies:
|
||||
no-case: 2.3.2
|
||||
|
||||
parent-module@1.0.1:
|
||||
dependencies:
|
||||
callsites: 3.1.0
|
||||
|
@ -12890,6 +12911,19 @@ snapshots:
|
|||
picocolors: 1.0.1
|
||||
source-map-js: 1.2.0
|
||||
|
||||
posthtml-parser@0.11.0:
|
||||
dependencies:
|
||||
htmlparser2: 7.2.0
|
||||
|
||||
posthtml-render@3.0.0:
|
||||
dependencies:
|
||||
is-json: 2.0.1
|
||||
|
||||
posthtml@0.16.6:
|
||||
dependencies:
|
||||
posthtml-parser: 0.11.0
|
||||
posthtml-render: 3.0.0
|
||||
|
||||
prelude-ls@1.2.1: {}
|
||||
|
||||
prettier@3.3.3: {}
|
||||
|
@ -13140,7 +13174,8 @@ snapshots:
|
|||
'@types/hast': 3.0.4
|
||||
unist-util-visit: 5.0.0
|
||||
|
||||
relateurl@0.2.7: {}
|
||||
relateurl@0.2.7:
|
||||
optional: true
|
||||
|
||||
remark-emoji@4.0.1:
|
||||
dependencies:
|
||||
|
@ -13334,7 +13369,7 @@ snapshots:
|
|||
|
||||
semver@7.6.3: {}
|
||||
|
||||
send@0.18.0:
|
||||
send@0.19.0:
|
||||
dependencies:
|
||||
debug: 2.6.9
|
||||
depd: 2.0.0
|
||||
|
@ -13365,7 +13400,7 @@ snapshots:
|
|||
encodeurl: 1.0.2
|
||||
escape-html: 1.0.3
|
||||
parseurl: 1.3.3
|
||||
send: 0.18.0
|
||||
send: 0.19.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
|
@ -13699,6 +13734,8 @@ snapshots:
|
|||
dependencies:
|
||||
webpack: 5.94.0
|
||||
|
||||
timsort@0.3.0: {}
|
||||
|
||||
tiny-invariant@1.3.1: {}
|
||||
|
||||
tinybench@2.8.0: {}
|
||||
|
@ -13800,8 +13837,6 @@ snapshots:
|
|||
|
||||
ufo@1.5.4: {}
|
||||
|
||||
uglify-js@3.17.4: {}
|
||||
|
||||
ultrahtml@1.5.3: {}
|
||||
|
||||
unbuild@2.0.0(sass@1.69.4)(typescript@5.6.2)(vue-tsc@2.1.6(typescript@5.6.2)):
|
||||
|
@ -14056,8 +14091,6 @@ snapshots:
|
|||
escalade: 3.1.2
|
||||
picocolors: 1.0.1
|
||||
|
||||
upper-case@1.1.3: {}
|
||||
|
||||
uqr@0.1.2: {}
|
||||
|
||||
uri-js@4.4.1:
|
||||
|
|
|
@ -697,8 +697,8 @@ describe('nuxt composables', () => {
|
|||
expect(id1).toBeTruthy()
|
||||
const matches = [
|
||||
html.match(/<script[^>]*>\(\(\)=>\{console.log\(window\)\}\)\(\)<\/script>/),
|
||||
html.match(new RegExp(`<script[^>]*>document.querySelectorAll\\('\\[data-prehydrate-id\\*=":${id1}:"]'\\).forEach\\(o=>{console.log\\(o.outerHTML\\)}\\)</script>`)),
|
||||
html.match(new RegExp(`<script[^>]*>document.querySelectorAll\\('\\[data-prehydrate-id\\*=":${id2}:"]'\\).forEach\\(o=>{console.log\\("other",o.outerHTML\\)}\\)</script>`)),
|
||||
html.match(new RegExp(`<script[^>]*>document.querySelectorAll\\('\\[data-prehydrate-id\\*=":${id1}:"]'\\).forEach\\(o=>{console.log\\(o.outerHTML\\)}\\)</script>`, 'i')),
|
||||
html.match(new RegExp(`<script[^>]*>document.querySelectorAll\\('\\[data-prehydrate-id\\*=":${id2}:"]'\\).forEach\\(o=>{console.log\\("other",o.outerHTML\\)}\\)</script>`, 'i')),
|
||||
]
|
||||
|
||||
// This tests we inject all scripts correctly, and only have one occurrence of multiple calls of a composable
|
||||
|
@ -1167,14 +1167,15 @@ describe('errors', () => {
|
|||
})
|
||||
|
||||
// TODO: need to create test for webpack
|
||||
it.runIf(!isDev() && !isWebpack)('should handle chunk loading errors', async () => {
|
||||
it.runIf(!isDev())('should handle chunk loading errors', async () => {
|
||||
const { page, consoleLogs } = await renderPage('/')
|
||||
await page.getByText('Increment state').click()
|
||||
await page.getByText('Increment state').click()
|
||||
expect(await page.innerText('div')).toContain('Some value: 3')
|
||||
await page.route(/.*/, route => route.abort('timedout'), { times: 1 })
|
||||
await page.getByText('Chunk error').click()
|
||||
await page.waitForURL(url('/chunk-error'))
|
||||
expect(consoleLogs.map(c => c.text).join('')).toContain('caught chunk load error')
|
||||
expect(consoleLogs.map(c => c.text).join('')).toContain('Failed to load resource')
|
||||
expect(await page.innerText('div')).toContain('Chunk error page')
|
||||
await page.waitForFunction(() => window.useNuxtApp?.()._route.fullPath === '/chunk-error')
|
||||
await page.locator('div').getByText('State: 3').waitFor()
|
||||
|
|
|
@ -1,14 +1,4 @@
|
|||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
async middleware (to, from) {
|
||||
await new Promise(resolve => setTimeout(resolve, 1))
|
||||
const nuxtApp = useNuxtApp()
|
||||
if (import.meta.client && from !== to && !nuxtApp.isHydrating) {
|
||||
// trigger a loading error when navigated to via client-side navigation
|
||||
await import(/* webpackIgnore: true */ /* @vite-ignore */ `some-non-exis${''}ting-module`)
|
||||
}
|
||||
},
|
||||
})
|
||||
const someValue = useState('val', () => 1)
|
||||
</script>
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
Immediate remove unmounted
|
||||
</NuxtLink>
|
||||
<NuxtLink
|
||||
no-prefetch
|
||||
to="/chunk-error"
|
||||
:prefetch="false"
|
||||
>
|
||||
Chunk error
|
||||
</NuxtLink>
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.hook('app:chunkError', () => {
|
||||
console.log('caught chunk load error')
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue