Merge remote-tracking branch 'origin/3.x' into test/3.x-vfs

This commit is contained in:
Daniel Roe 2024-10-06 07:30:48 +01:00
commit fdd1fe95bc
No known key found for this signature in database
GPG Key ID: CBC814C393D93268
19 changed files with 1428 additions and 822 deletions

View File

@ -1,4 +1,4 @@
FROM node:lts@sha256:48db4f6ea21d134be744207225753a1730c4bc1b4cdf836d44511c36bf0e34d7
FROM node:lts@sha256:fffa89e023a3351904c04284029105d9e2ac7020886d683775a298569591e5bb
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 && \

View File

@ -75,7 +75,7 @@ jobs:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Initialize CodeQL
uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with:
config: |
paths:
@ -91,7 +91,7 @@ jobs:
queries: +security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with:
category: "/language:javascript-typescript"
@ -244,7 +244,7 @@ jobs:
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' }}
- uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
if: github.event_name != 'push' && matrix.env == 'built' && matrix.builder == 'vite' && matrix.context == 'default' && matrix.os == 'ubuntu-latest' && matrix.manifest == 'manifest-on'
with:
token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Lychee link checker
uses: lycheeverse/lychee-action@5047c2a4052946424ce139fe111135f6d7c0fe0b # for v1.8.0
uses: lycheeverse/lychee-action@897f08a07f689df1a43076f4374af272f66a6dd1 # for v1.8.0
with:
# arguments with file types to check
args: >-

View File

@ -26,6 +26,6 @@ jobs:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
# From https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
- name: Check workflow files
uses: docker://rhysd/actionlint:1.7.2@sha256:89d3f90f82781dee3c8724651129634b08cf2241bbd67fcd02a1c5198119fc5e
uses: docker://rhysd/actionlint:1.7.3@sha256:7617f05bd698cd2f1c3aedc05bc733ccec92cca0738f3e8722c32c5b42c70ae6
with:
args: -color

View File

@ -68,7 +68,7 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9
uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
if: github.repository == 'nuxt/nuxt' && success()
with:
sarif_file: results.sarif

View File

@ -39,20 +39,20 @@
"@nuxt/ui-templates": "workspace:*",
"@nuxt/vite-builder": "workspace:*",
"@nuxt/webpack-builder": "workspace:*",
"@types/node": "20.16.9",
"@vue/compiler-core": "3.5.8",
"@vue/compiler-dom": "3.5.8",
"@vue/shared": "3.5.8",
"@types/node": "20.16.10",
"@vue/compiler-core": "3.5.10",
"@vue/compiler-dom": "3.5.10",
"@vue/shared": "3.5.10",
"magic-string": "^0.30.11",
"nuxt": "workspace:*",
"ohash": "1.1.4",
"postcss": "8.4.47",
"rollup": "4.22.4",
"rollup": "4.24.0",
"send": ">=0.19.0",
"typescript": "5.6.2",
"ufo": "1.5.4",
"vite": "5.4.8",
"vue": "3.5.8"
"vue": "3.5.10"
},
"devDependencies": {
"@eslint/js": "9.11.1",
@ -62,12 +62,12 @@
"@nuxt/webpack-builder": "workspace:*",
"@testing-library/vue": "8.1.0",
"@types/eslint__js": "8.42.3",
"@types/node": "20.16.9",
"@types/node": "20.16.10",
"@types/semver": "7.5.8",
"@unhead/schema": "1.11.6",
"@unhead/vue": "1.11.6",
"@unhead/schema": "1.11.7",
"@unhead/vue": "1.11.7",
"@vitejs/plugin-vue": "5.1.4",
"@vitest/coverage-v8": "2.1.1",
"@vitest/coverage-v8": "2.1.2",
"@vue/test-utils": "2.4.6",
"autoprefixer": "10.4.20",
"case-police": "0.7.0",
@ -78,11 +78,11 @@
"devalue": "5.1.1",
"eslint": "9.11.1",
"eslint-plugin-no-only-tests": "3.3.0",
"eslint-plugin-perfectionist": "3.7.0",
"eslint-plugin-perfectionist": "3.8.0",
"eslint-typegen": "0.3.2",
"h3": "1.12.0",
"happy-dom": "15.7.4",
"jiti": "2.0.0",
"jiti": "2.3.1",
"markdownlint-cli": "0.42.0",
"nitropack": "2.9.7",
"nuxi": "3.14.0",
@ -96,16 +96,16 @@
"sherif": "1.0.0",
"std-env": "3.7.0",
"tinyexec": "0.3.0",
"tinyglobby": "0.2.6",
"tinyglobby": "0.2.9",
"typescript": "5.6.2",
"ufo": "1.5.4",
"vitest": "2.1.1",
"vitest": "2.1.2",
"vitest-environment-nuxt": "1.0.1",
"vue": "3.5.8",
"vue": "3.5.10",
"vue-router": "4.4.5",
"vue-tsc": "2.1.6"
},
"packageManager": "pnpm@9.11.0",
"packageManager": "pnpm@9.12.0",
"engines": {
"node": "^16.10.0 || >=18.0.0"
},

View File

@ -27,14 +27,14 @@
},
"dependencies": {
"@nuxt/schema": "workspace:*",
"c12": "^1.11.2",
"c12": "^2.0.1",
"consola": "^3.2.3",
"defu": "^6.1.4",
"destr": "^2.0.3",
"globby": "^14.0.2",
"hash-sum": "^2.0.0",
"ignore": "^6.0.2",
"jiti": "^2.0.0",
"jiti": "^2.3.1",
"klona": "^2.0.6",
"knitwork": "^1.1.0",
"mlly": "^1.7.1",
@ -44,8 +44,8 @@
"semver": "^7.6.3",
"ufo": "^1.5.4",
"unctx": "^2.3.1",
"unimport": "^3.12.0",
"untyped": "^1.4.2"
"unimport": "^3.13.1",
"untyped": "^1.5.1"
},
"devDependencies": {
"@types/hash-sum": "1.0.2",
@ -55,7 +55,7 @@
"nitropack": "2.9.7",
"unbuild": "latest",
"vite": "5.4.8",
"vitest": "2.1.1",
"vitest": "2.1.2",
"webpack": "5.95.0"
},
"engines": {

View File

@ -78,10 +78,7 @@ export const normalizeModuleTranspilePath = (p: string) => {
export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, nuxt: Nuxt = useNuxt()) {
let buildTimeModuleMeta: ModuleMeta = {}
const jiti = createJiti(nuxt.options.rootDir, {
interopDefault: true,
alias: nuxt.options.alias,
})
const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias })
// Import if input is string
if (typeof nuxtModule === 'string') {
@ -91,7 +88,7 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n
for (const path of paths) {
try {
const src = jiti.esmResolve(path, { parentURL: parentURL.replace(/\/node_modules\/?$/, '') })
nuxtModule = await jiti.import(src) as NuxtModule
nuxtModule = await jiti.import(src, { default: true }) as NuxtModule
// nuxt-module-builder generates a module.json with metadata including the version
const moduleMetadataPath = join(dirname(src), 'module.json')

View File

@ -60,18 +60,18 @@
},
"dependencies": {
"@nuxt/devalue": "^2.0.2",
"@nuxt/devtools": "^1.5.1",
"@nuxt/devtools": "^1.5.2",
"@nuxt/kit": "workspace:*",
"@nuxt/schema": "workspace:*",
"@nuxt/telemetry": "^2.6.0",
"@nuxt/vite-builder": "workspace:*",
"@unhead/dom": "^1.11.6",
"@unhead/shared": "^1.11.6",
"@unhead/ssr": "^1.11.6",
"@unhead/vue": "^1.11.6",
"@vue/shared": "^3.5.8",
"@unhead/dom": "^1.11.7",
"@unhead/shared": "^1.11.7",
"@unhead/ssr": "^1.11.7",
"@unhead/vue": "^1.11.7",
"@vue/shared": "^3.5.10",
"acorn": "8.12.1",
"c12": "^1.11.2",
"c12": "^2.0.1",
"chokidar": "^3.6.0",
"compatx": "^0.1.8",
"consola": "^3.2.3",
@ -88,7 +88,7 @@
"hookable": "^5.5.3",
"ignore": "^6.0.2",
"impound": "^0.1.0",
"jiti": "^2.0.0",
"jiti": "^2.3.1",
"klona": "^2.0.6",
"knitwork": "^1.1.0",
"magic-string": "^0.30.11",
@ -107,33 +107,33 @@
"semver": "^7.6.3",
"std-env": "^3.7.0",
"strip-literal": "^2.1.0",
"tinyglobby": "0.2.6",
"tinyglobby": "0.2.9",
"ufo": "^1.5.4",
"ultrahtml": "^1.5.3",
"uncrypto": "^0.1.3",
"unctx": "^2.3.1",
"unenv": "^1.10.0",
"unhead": "^1.11.6",
"unimport": "^3.12.0",
"unhead": "^1.11.7",
"unimport": "^3.13.1",
"unplugin": "^1.14.1",
"unplugin-vue-router": "^0.10.8",
"unstorage": "^1.12.0",
"untyped": "^1.4.2",
"vue": "^3.5.8",
"untyped": "^1.5.1",
"vue": "^3.5.10",
"vue-bundle-renderer": "^2.1.1",
"vue-devtools-stub": "^0.1.0",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@nuxt/scripts": "0.9.3",
"@nuxt/scripts": "0.9.4",
"@nuxt/ui-templates": "1.3.4",
"@parcel/watcher": "2.4.1",
"@types/estree": "1.0.6",
"@vitejs/plugin-vue": "5.1.4",
"@vue/compiler-sfc": "3.5.8",
"@vue/compiler-sfc": "3.5.10",
"unbuild": "latest",
"vite": "5.4.8",
"vitest": "2.1.1"
"vitest": "2.1.2"
},
"peerDependencies": {
"@parcel/watcher": "^2.1.0",

View File

@ -26,7 +26,6 @@ export default defineNuxtModule({
// Initialize untyped/jiti loader
const _resolveSchema = createJiti(fileURLToPath(import.meta.url), {
interopDefault: true,
cache: false,
transformOptions: {
babel: {
@ -100,7 +99,7 @@ export default defineNuxtModule({
let loadedConfig: SchemaDefinition
try {
// TODO: fix type for second argument of `import`
loadedConfig = await _resolveSchema.import(filePath, {}) as SchemaDefinition
loadedConfig = await _resolveSchema.import(filePath, { default: true }) as SchemaDefinition
} catch (err) {
logger.warn(
'Unable to load schema from',

View File

@ -39,13 +39,13 @@
"@types/file-loader": "5.0.4",
"@types/pug": "2.0.10",
"@types/sass-loader": "8.0.9",
"@unhead/schema": "1.11.6",
"@unhead/schema": "1.11.7",
"@vitejs/plugin-vue": "5.1.4",
"@vitejs/plugin-vue-jsx": "4.0.1",
"@vue/compiler-core": "3.5.8",
"@vue/compiler-sfc": "3.5.8",
"@vue/compiler-core": "3.5.10",
"@vue/compiler-sfc": "3.5.10",
"@vue/language-core": "2.1.6",
"c12": "1.11.2",
"c12": "2.0.1",
"esbuild-loader": "4.2.2",
"h3": "1.12.0",
"ignore": "6.0.2",
@ -55,7 +55,7 @@
"unctx": "2.3.1",
"unenv": "1.10.0",
"vite": "5.4.8",
"vue": "3.5.8",
"vue": "3.5.10",
"vue-bundle-renderer": "2.1.1",
"vue-loader": "17.4.2",
"vue-router": "4.4.5",
@ -73,8 +73,8 @@
"std-env": "^3.7.0",
"ufo": "^1.5.4",
"uncrypto": "^0.1.3",
"unimport": "^3.12.0",
"untyped": "^1.4.2"
"unimport": "^3.13.1",
"untyped": "^1.5.1"
},
"engines": {
"node": "^14.18.0 || >=16.10.0"

View File

@ -19,19 +19,19 @@
},
"devDependencies": {
"@types/lodash-es": "4.17.12",
"@unocss/reset": "0.62.4",
"@unocss/reset": "0.63.2",
"critters": "0.0.24",
"html-validate": "8.24.0",
"htmlnano": "2.1.1",
"jiti": "2.0.0",
"jiti": "2.3.1",
"knitwork": "1.1.0",
"lodash-es": "4.17.21",
"pathe": "1.1.2",
"prettier": "3.3.3",
"scule": "1.3.0",
"tinyexec": "0.3.0",
"tinyglobby": "0.2.6",
"unocss": "0.62.4",
"tinyglobby": "0.2.9",
"unocss": "0.63.2",
"vite": "5.4.8"
}
}

View File

@ -27,9 +27,9 @@
"@nuxt/schema": "workspace:*",
"@types/clear": "0.1.4",
"@types/estree": "1.0.6",
"rollup": "4.22.4",
"rollup": "4.24.0",
"unbuild": "latest",
"vue": "3.5.8"
"vue": "3.5.10"
},
"dependencies": {
"@nuxt/kit": "workspace:*",
@ -47,7 +47,7 @@
"externality": "^1.0.2",
"get-port-please": "^3.1.2",
"h3": "^1.12.0",
"jiti": "^2.0.0",
"jiti": "^2.3.1",
"knitwork": "^1.1.0",
"magic-string": "^0.30.11",
"mlly": "^1.7.1",
@ -63,7 +63,7 @@
"unenv": "^1.10.0",
"unplugin": "^1.14.1",
"vite": "^5.4.8",
"vite-node": "^2.1.1",
"vite-node": "^2.1.2",
"vite-plugin-checker": "^0.8.0",
"vue-bundle-renderer": "^2.1.1"
},

View File

@ -18,10 +18,7 @@ export async function resolveCSSOptions (nuxt: Nuxt): Promise<ViteConfig['css']>
css.postcss.plugins = []
const postcssOptions = nuxt.options.postcss
const jiti = createJiti(nuxt.options.rootDir, {
interopDefault: true,
alias: nuxt.options.alias,
})
const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias })
for (const pluginName of sortPlugins(postcssOptions)) {
const pluginOptions = postcssOptions.plugins[pluginName]
@ -29,7 +26,7 @@ export async function resolveCSSOptions (nuxt: Nuxt): Promise<ViteConfig['css']>
let pluginFn: ((opts: Record<string, any>) => Plugin) | undefined
for (const parentURL of nuxt.options.modulesDir) {
pluginFn = await jiti.import(pluginName, { parentURL: parentURL.replace(/\/node_modules\/?$/, ''), try: true }) as (opts: Record<string, any>) => Plugin
pluginFn = await jiti.import(pluginName, { parentURL: parentURL.replace(/\/node_modules\/?$/, ''), try: true, default: true }) as (opts: Record<string, any>) => Plugin
if (typeof pluginFn === 'function') {
css.postcss.plugins.push(pluginFn(pluginOptions))
break

View File

@ -71,7 +71,9 @@ export function ssrStylesPlugin (options: SSRStylePluginOptions): Plugin {
: outputOptions.assetFileNames({
type: 'asset',
name: `${fileName}-styles.mjs`,
names: [`${fileName}-styles.mjs`],
originalFileName: `${fileName}-styles.mjs`,
originalFileNames: [`${fileName}-styles.mjs`],
source: '',
})

View File

@ -39,7 +39,7 @@
"fork-ts-checker-webpack-plugin": "^9.0.2",
"h3": "^1.12.0",
"hash-sum": "^2.0.0",
"jiti": "^2.0.0",
"jiti": "^2.3.1",
"lodash-es": "4.17.21",
"magic-string": "^0.30.11",
"memfs": "^4.12.0",
@ -76,7 +76,7 @@
"@types/webpack-bundle-analyzer": "4.7.0",
"@types/webpack-hot-middleware": "2.25.9",
"unbuild": "latest",
"vue": "3.5.8"
"vue": "3.5.10"
},
"peerDependencies": {
"vue": "^3.3.4"

View File

@ -36,10 +36,7 @@ export async function getPostcssConfig (nuxt: Nuxt) {
sourceMap: nuxt.options.webpack.cssSourceMap,
})
const jiti = createJiti(nuxt.options.rootDir, {
interopDefault: true,
alias: nuxt.options.alias,
})
const jiti = createJiti(nuxt.options.rootDir, { alias: nuxt.options.alias })
// Keep the order of default plugins
if (!Array.isArray(postcssOptions.plugins) && isPureObject(postcssOptions.plugins)) {
@ -51,7 +48,7 @@ export async function getPostcssConfig (nuxt: Nuxt) {
let pluginFn: ((opts: Record<string, any>) => Plugin) | undefined
for (const parentURL of nuxt.options.modulesDir) {
pluginFn = await jiti.import(pluginName, { parentURL: parentURL.replace(/\/node_modules\/?$/, ''), try: true }) as (opts: Record<string, any>) => Plugin
pluginFn = await jiti.import(pluginName, { parentURL: parentURL.replace(/\/node_modules\/?$/, ''), try: true, default: true }) as (opts: Record<string, any>) => Plugin
if (typeof pluginFn === 'function') {
plugins.push(pluginFn(pluginOptions))
break

File diff suppressed because it is too large Load Diff

View File

@ -77,7 +77,7 @@ describe.skipIf(process.env.SKIP_BUNDLE_SIZE === 'true' || process.env.ECOSYSTEM
const serverDir = join(rootDir, '.output-inline/server')
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"562k"`)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"563k"`)
const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"89.7k"`)