diff --git a/package.json b/package.json index deaed11b1453cf343c8bfb5ff7a88601a686c786..36aa9f562dd853f5383f8caf2f4dfa51f0af97fc 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "semver": "^7.3.5", "ts-jest": "^27.0.3", "typescript": "4.6.4", - "vite": "^2.9.6", + "vite": "^2.9.7", "vue": "3.2.33", "vue-router": "^4.0.14", "yorkie": "^2.0.0" diff --git a/packages/playground/ssr/package.json b/packages/playground/ssr/package.json index 289fab56856b626713fa4e1aa28c4c8f88a468df..b35adda1c06dca9b1c1593bfcf4ec725a5d57196 100644 --- a/packages/playground/ssr/package.json +++ b/packages/playground/ssr/package.json @@ -21,6 +21,6 @@ "compression": "^1.7.4", "cypress": "^7.3.0", "serve-static": "^1.14.1", - "vite": "^2.9.6" + "vite": "^2.9.7" } } diff --git a/packages/uni-app-vite/package.json b/packages/uni-app-vite/package.json index 5b85dbdff9ebe3ad6cf3c88297b803dc8731b5cd..5d70a6c5781840f678251c777cac7a51282db31c 100644 --- a/packages/uni-app-vite/package.json +++ b/packages/uni-app-vite/package.json @@ -37,6 +37,6 @@ "@types/fs-extra": "^9.0.13", "@vue/compiler-core": "3.2.33", "esbuild": "^0.14.27", - "postcss": "^8.4.12" + "postcss": "^8.4.13" } } diff --git a/packages/uni-cli-shared/package.json b/packages/uni-cli-shared/package.json index f19ee5f776f14a659f0d8e9cb361436d0cb6c366..66cd6ed11423d5fbfb5f82a57281a8715908b9a9 100644 --- a/packages/uni-cli-shared/package.json +++ b/packages/uni-cli-shared/package.json @@ -18,6 +18,7 @@ "url": "https://github.com/dcloudio/uni-app/issues" }, "dependencies": { + "@ampproject/remapping": "^2.1.2", "@babel/core": "^7.17.9", "@babel/parser": "^7.17.9", "@babel/types": "^7.17.0", @@ -32,7 +33,7 @@ "@vue/compiler-sfc": "3.2.33", "@vue/server-renderer": "3.2.33", "@vue/shared": "3.2.33", - "autoprefixer": "^10.4.6", + "autoprefixer": "^10.4.7", "base64url": "^3.0.1", "chokidar": "^3.5.3", "compare-versions": "^3.6.0", @@ -66,6 +67,6 @@ "@types/mime": "^2.0.3", "@types/module-alias": "^2.0.1", "@types/stylus": "^0.48.36", - "postcss": "^8.4.12" + "postcss": "^8.4.13" } } diff --git a/packages/uni-cli-shared/src/vite/plugins/vitejs/cleanString.ts b/packages/uni-cli-shared/src/vite/plugins/vitejs/cleanString.ts new file mode 100644 index 0000000000000000000000000000000000000000..c35617536fc4b9285f8462f15b06d759ced10ae6 --- /dev/null +++ b/packages/uni-cli-shared/src/vite/plugins/vitejs/cleanString.ts @@ -0,0 +1,6 @@ +import { multilineCommentsRE } from './utils' + +const blankReplacer = (s: string) => ' '.repeat(s.length) +export function emptyCssComments(raw: string) { + return raw.replace(multilineCommentsRE, blankReplacer) +} diff --git a/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/asset.ts b/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/asset.ts index b6584929f1961632d87ddab6d3c7798469c24708..f4729ac715319e2b805d6b265d7220ab65d5ded9 100644 --- a/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/asset.ts +++ b/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/asset.ts @@ -295,7 +295,7 @@ function fileToBuiltUrl( return url } -export function getAssetHash(content: Buffer): string { +export function getAssetHash(content: Buffer | string): string { return createHash('sha256').update(content).digest('hex').slice(0, 8) } diff --git a/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts b/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts index e1fe0882a5be8ebb364a13348398376cf10681e3..5035de0aac5772da8c3c7f99f82ae7b8670b5038 100644 --- a/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts +++ b/packages/uni-cli-shared/src/vite/plugins/vitejs/plugins/css.ts @@ -4,7 +4,14 @@ import glob from 'fast-glob' import colors from 'picocolors' import postcssrc from 'postcss-load-config' import { dataToEsm } from '@rollup/pluginutils' -import { PluginContext, RollupError, SourceMap } from 'rollup' +import { + ExistingRawSourceMap, + PluginContext, + RollupError, + SourceMapInput, +} from 'rollup' +import { RawSourceMap } from '@ampproject/remapping' +import type * as PostCSS from 'postcss' import { // createDebugger, isExternalUrl, @@ -15,6 +22,7 @@ import { isObject, normalizePath, processSrcSet, + combineSourcemaps, } from '../utils' import { Plugin } from '../plugin' import { ResolvedConfig } from '../config' @@ -31,6 +39,7 @@ import type { Alias } from 'types/alias' import { transform, formatMessages } from 'esbuild' import { preCss, preNVueCss } from '../../../../preprocess' import { PAGES_JSON_JS } from '../../../../constants' +import { emptyCssComments } from '../cleanString' // const debug = createDebugger('vite:css') export interface CSSOptions { @@ -378,7 +387,6 @@ function getCssResolversKeys( ): Array { return Object.keys(resolvers) as unknown as Array } - async function compileCSS( id: string, code: string, @@ -388,12 +396,16 @@ async function compileCSS( server?: ViteDevServer ): Promise<{ code: string - map?: SourceMap - ast?: Postcss.Result + map?: SourceMapInput + ast?: PostCSS.Result modules?: Record deps?: Set }> { - const { modules: modulesOptions, preprocessorOptions } = config.css || {} + const { + modules: modulesOptions, + preprocessorOptions, + devSourcemap, + } = config.css || {} const isModule = modulesOptions !== false && cssModuleRE.test(id) // although at serve time it can work without processing, we do need to // crawl them in order to register watch dependencies. @@ -410,10 +422,10 @@ async function compileCSS( !needInlineImport && !hasUrl ) { - return { code } + return { code, map: null } } - let map: SourceMap | undefined + let preprocessorMap: ExistingRawSourceMap | undefined let modules: Record | undefined const deps = new Set() @@ -442,6 +454,8 @@ async function compileCSS( } // important: set this for relative import resolving opts.filename = cleanUrl(id) + opts.enableSourcemap = devSourcemap ?? false + const preprocessResult = await preProcessor( code, config.root, @@ -449,12 +463,18 @@ async function compileCSS( atImportResolvers, !!config.nvue ) + if (preprocessResult.errors.length) { throw preprocessResult.errors[0] } code = preprocessResult.code - map = preprocessResult.map as SourceMap + preprocessorMap = combineSourcemapsIfExists( + opts.filename, + preprocessResult.map, + preprocessResult.additionalMap + ) + if (preprocessResult.deps) { preprocessResult.deps.forEach((dep) => { // sometimes sass registers the file itself as a dep @@ -474,10 +494,16 @@ async function compileCSS( postcssPlugins.unshift( (await import('postcss-import')).default({ async resolve(id, basedir) { + // const publicFile = checkPublicFile(id, config) + // if (publicFile) { + // return publicFile + // } + const resolved = await atImportResolvers.css( id, path.join(basedir, '*') ) + if (resolved) { return path.resolve(resolved) } @@ -489,7 +515,7 @@ async function compileCSS( postcssPlugins.push( UrlRewritePostcssPlugin({ replacer: urlReplacer, - }) as Postcss.Plugin + }) as PostCSS.Plugin ) if (isModule) { @@ -523,7 +549,7 @@ async function compileCSS( if (!postcssPlugins.length) { return { code, - map, + map: preprocessorMap, } } @@ -532,19 +558,23 @@ async function compileCSS( .default(postcssPlugins) .process(code, { ...postcssOptions, - to: id, - from: id, + to: cleanUrl(id), + from: cleanUrl(id), map: { inline: false, annotation: false, - prev: map, + // postcss may return virtual files + // we cannot obtain content of them, so this needs to be enabled + sourcesContent: true, + // when "prev: preprocessorMap", the result map may include duplicate filename in `postcssResult.map.sources` + // prev: preprocessorMap, }, }) // record CSS dependencies from @imports for (const message of postcssResult.messages) { if (message.type === 'dependency') { - deps.add(message.file as string) + deps.add(normalizePath(message.file as string)) } else if (message.type === 'dir-dependency') { // https://github.com/postcss/postcss/blob/main/docs/guidelines/plugin.md#3-dependencies const { dir, glob: globPattern = '**' } = message @@ -581,15 +611,76 @@ async function compileCSS( } } + if (!devSourcemap) { + return { + ast: postcssResult, + code: postcssResult.css, + map: { mappings: '' }, + modules, + deps, + } + } + + const rawPostcssMap = postcssResult.map.toJSON() + + const postcssMap = formatPostcssSourceMap( + // version property of rawPostcssMap is declared as string + // but actually it is a number + rawPostcssMap as Omit as ExistingRawSourceMap, + cleanUrl(id) + ) + return { ast: postcssResult, code: postcssResult.css, - map: postcssResult.map as any, + map: combineSourcemapsIfExists(cleanUrl(id), postcssMap, preprocessorMap), modules, deps, } } +export function formatPostcssSourceMap( + rawMap: ExistingRawSourceMap, + file: string +): ExistingRawSourceMap { + const inputFileDir = path.dirname(file) + + const sources = rawMap.sources.map((source) => { + const cleanSource = cleanUrl(decodeURIComponent(source)) + + // postcss returns virtual files + if (/^<.+>$/.test(cleanSource)) { + return `\0${cleanSource}` + } + + return normalizePath(path.resolve(inputFileDir, cleanSource)) + }) + + return { + file, + mappings: rawMap.mappings, + names: rawMap.names, + sources, + sourcesContent: rawMap.sourcesContent, + version: rawMap.version, + } +} + +function combineSourcemapsIfExists( + filename: string, + map1: ExistingRawSourceMap | undefined, + map2: ExistingRawSourceMap | undefined +): ExistingRawSourceMap | undefined { + return map1 && map2 + ? (combineSourcemaps(filename, [ + // type of version property of ExistingRawSourceMap is number + // but it is always 3 + map1 as RawSourceMap, + map2 as RawSourceMap, + ]) as ExistingRawSourceMap) + : map1 +} + interface PostCSSConfigResult { options: Postcss.ProcessOptions plugins: Postcss.Plugin[] @@ -614,14 +705,22 @@ async function resolvePostcssConfig( plugins: inlineOptions.plugins || [], } } else { + const searchPath = + typeof inlineOptions === 'string' ? inlineOptions : config.root try { - const searchPath = - typeof inlineOptions === 'string' ? inlineOptions : config.root // @ts-ignore result = await postcssrc({}, searchPath) } catch (e: any) { if (!/No PostCSS Config found/.test(e.message)) { - throw e + if (e instanceof Error) { + const { name, message, stack } = e + e.name = 'Failed to load PostCSS config' + e.message = `Failed to load PostCSS config (searchPath: ${searchPath}): [${name}] ${message}\n${stack}` + e.stack = '' // add stack to message to retain stack + throw e + } else { + throw new Error(`Failed to load PostCSS config: ${e}`) + } } result = null } @@ -743,27 +842,34 @@ export async function minifyCSS(css: string, config: ResolvedConfig) { export async function hoistAtRules(css: string) { const s = new MagicString(css) + const cleanCss = emptyCssComments(css) + let match: RegExpExecArray | null + // #1845 // CSS @import can only appear at top of the file. We need to hoist all @import // to top when multiple files are concatenated. // match until semicolon that's not in quotes - s.replace( - /@import\s*(?:url\([^\)]*\)|"[^"]*"|'[^']*'|[^;]*).*?;/gm, - (match) => { - s.appendLeft(0, match) - return '' - } - ) + const atImportRE = + /@import\s*(?:url\([^\)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|[^;]*).*?;/gm + while ((match = atImportRE.exec(cleanCss))) { + s.remove(match.index, match.index + match[0].length) + // Use `appendLeft` instead of `prepend` to preserve original @import order + s.appendLeft(0, match[0]) + } + // #6333 // CSS @charset must be the top-first in the file, hoist the first to top + const atCharsetRE = + /@charset\s*(?:"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|[^;]*).*?;/gm let foundCharset = false - s.replace(/@charset\s*(?:"[^"]*"|'[^']*'|[^;]*).*?;/gm, (match) => { + while ((match = atCharsetRE.exec(cleanCss))) { + s.remove(match.index, match.index + match[0].length) if (!foundCharset) { - s.prepend(match) + s.prepend(match[0]) foundCharset = true } - return '' - }) + } + return s.toString() } @@ -800,7 +906,8 @@ type SassStylePreprocessor = ( export interface StylePreprocessorResults { code: string - map?: object + map?: ExistingRawSourceMap | undefined + additionalMap?: ExistingRawSourceMap | undefined errors: RollupError[] deps: string[] } @@ -843,9 +950,11 @@ const scss: SassStylePreprocessor = async ( const internalImporter: Sass.Importer = (url, importer, done) => { resolvers.sass(url, importer).then((resolved) => { if (resolved) { - rebaseUrls(resolved, options.filename, options.alias, isNVue).then(done) + rebaseUrls(resolved, options.filename, options.alias, isNVue) + .then((data) => done?.(data)) + .catch((data) => done?.(data)) } else { - done && done(null) + done?.(null) } }) } @@ -856,12 +965,25 @@ const scss: SassStylePreprocessor = async ( : importer.push(options.importer) } + const { content: data, map: additionalMap } = await getSource( + source, + options.filename, + options.additionalData, + options.enableSourcemap + ) const finalOptions: Sass.Options = { ...options, - data: await getSource(source, options.filename, options.additionalData), + data, file: options.filename, outFile: options.filename, importer, + ...(options.enableSourcemap + ? { + sourceMap: true, + omitSourceMapUrl: true, + sourceMapRoot: path.dirname(options.filename), + } + : {}), } try { @@ -875,9 +997,14 @@ const scss: SassStylePreprocessor = async ( }) }) const deps = result.stats.includedFiles + const map: ExistingRawSourceMap | undefined = result.map + ? JSON.parse(result.map.toString()) + : undefined return { code: result.css.toString(), + map, + additionalMap, errors: [], deps, } @@ -975,13 +1102,26 @@ const less: StylePreprocessor = async ( resolvers, isNVue ) - source = await getSource(source, options.filename, options.additionalData) + const { content, map: additionalMap } = await getSource( + source, + options.filename, + options.additionalData, + options.enableSourcemap + ) let result: Less.RenderOutput | undefined try { - result = await nodeLess.render(source, { + result = await nodeLess.render(content, { ...options, plugins: [viteResolverPlugin, ...(options.plugins || [])], + ...(options.enableSourcemap + ? { + sourceMap: { + outputSourceFiles: true, + sourceMapFileInline: false, + }, + } + : {}), }) } catch (e) { const error = e as Less.RenderError @@ -994,8 +1134,16 @@ const less: StylePreprocessor = async ( } return { code: '', errors: [normalizedError], deps: [] } } + + const map: ExistingRawSourceMap = result.map && JSON.parse(result.map) + if (map) { + delete map.sourcesContent + } + return { code: result.css.toString(), + map, + additionalMap, deps: result.imports, errors: [], } @@ -1083,10 +1231,11 @@ const styl: StylePreprocessor = async (source, root, options) => { const nodeStylus = loadPreprocessor(PreprocessLang.stylus, root) // Get source with preprocessor options.additionalData. Make sure a new line separator // is added to avoid any render error, as added stylus content may not have semi-colon separators - source = await getSource( + const { content, map: additionalMap } = await getSource( source, options.filename, options.additionalData, + options.enableSourcemap, '\n' ) // Get preprocessor options.imports dependencies as stylus @@ -1095,32 +1244,85 @@ const styl: StylePreprocessor = async (source, root, options) => { path.resolve(dep) ) try { - const ref = nodeStylus(source, options) - - // if (map) ref.set('sourcemap', { inline: false, comment: false }) + const ref = nodeStylus(content, options) + if (options.enableSourcemap) { + ref.set('sourcemap', { + comment: false, + inline: false, + basePath: root, + }) + } const result = ref.render() // Concat imports deps with computed deps const deps = [...ref.deps(), ...importsDeps] - return { code: result, errors: [], deps } + // @ts-expect-error sourcemap exists + const map: ExistingRawSourceMap | undefined = ref.sourcemap + + return { + code: result, + map: formatStylusSourceMap(map, root), + additionalMap, + errors: [], + deps, + } } catch (e: any) { return { code: '', errors: [e], deps: [] } } } -function getSource( +function formatStylusSourceMap( + mapBefore: ExistingRawSourceMap | undefined, + root: string +): ExistingRawSourceMap | undefined { + if (!mapBefore) return undefined + const map = { ...mapBefore } + + const resolveFromRoot = (p: string) => normalizePath(path.resolve(root, p)) + + if (map.file) { + map.file = resolveFromRoot(map.file) + } + map.sources = map.sources.map(resolveFromRoot) + + return map +} + +async function getSource( source: string, filename: string, - additionalData?: PreprocessorAdditionalData, + additionalData: PreprocessorAdditionalData | undefined, + enableSourcemap: boolean, sep: string = '' -): string | Promise { - if (!additionalData) return source +): Promise<{ content: string; map?: ExistingRawSourceMap }> { + if (!additionalData) return { content: source } + if (typeof additionalData === 'function') { - return additionalData(source, filename) + const newContent = await additionalData(source, filename) + if (typeof newContent === 'string') { + return { content: newContent } + } + return newContent + } + + if (!enableSourcemap) { + return { content: additionalData + sep + source } + } + + const ms = new MagicString(source) + ms.appendLeft(0, sep) + ms.appendLeft(0, additionalData) + + const map = ms.generateMap({ hires: true }) + map.file = filename + map.sources = [filename] + + return { + content: ms.toString(), + map, } - return additionalData + sep + source } const preProcessors = Object.freeze({ diff --git a/packages/uni-cli-shared/src/vite/plugins/vitejs/utils.ts b/packages/uni-cli-shared/src/vite/plugins/vitejs/utils.ts index e0b99046bff0b603689e49ad657253a1053921ff..9d9c922c739d7b04ad344203d0829fe004f89ac5 100644 --- a/packages/uni-cli-shared/src/vite/plugins/vitejs/utils.ts +++ b/packages/uni-cli-shared/src/vite/plugins/vitejs/utils.ts @@ -3,6 +3,9 @@ */ import os from 'os' import path from 'path' +import remapping from '@ampproject/remapping' +import type { DecodedSourceMap, RawSourceMap } from '@ampproject/remapping' + export function slash(p: string): string { return p.replace(/\\/g, '/') } @@ -28,6 +31,8 @@ export const isExternalUrl = (url: string): boolean => externalRE.test(url) export const dataUrlRE = /^\s*data:/i export const isDataUrl = (url: string): boolean => dataUrlRE.test(url) +export const multilineCommentsRE = /\/\*(.|[\r\n])*?\*\//gm + export async function asyncReplace( input: string, re: RegExp, @@ -153,3 +158,91 @@ export async function processSrcSet( return url } + +function escapeToLinuxLikePath(path: string) { + if (/^[A-Z]:/.test(path)) { + return path.replace(/^([A-Z]):\//, '/windows/$1/') + } + if (/^\/[^/]/.test(path)) { + return `/linux${path}` + } + return path +} + +function unescapeToLinuxLikePath(path: string) { + if (path.startsWith('/linux/')) { + return path.slice('/linux'.length) + } + if (path.startsWith('/windows/')) { + return path.replace(/^\/windows\/([A-Z])\//, '$1:/') + } + return path +} + +// based on https://github.com/sveltejs/svelte/blob/abf11bb02b2afbd3e4cac509a0f70e318c306364/src/compiler/utils/mapped_code.ts#L221 +const nullSourceMap: RawSourceMap = { + names: [], + sources: [], + mappings: '', + version: 3, +} + +export function combineSourcemaps( + filename: string, + sourcemapList: Array, + excludeContent = true +): RawSourceMap { + if ( + sourcemapList.length === 0 || + sourcemapList.every((m) => m.sources.length === 0) + ) { + return { ...nullSourceMap } + } + + // hack for parse broken with normalized absolute paths on windows (C:/path/to/something). + // escape them to linux like paths + // also avoid mutation here to prevent breaking plugin's using cache to generate sourcemaps like vue (see #7442) + sourcemapList = sourcemapList.map((sourcemap) => { + const newSourcemaps = { ...sourcemap } + newSourcemaps.sources = sourcemap.sources.map((source) => + source ? escapeToLinuxLikePath(source) : null + ) + if (sourcemap.sourceRoot) { + newSourcemaps.sourceRoot = escapeToLinuxLikePath(sourcemap.sourceRoot) + } + return newSourcemaps + }) + const escapedFilename = escapeToLinuxLikePath(filename) + + // We don't declare type here so we can convert/fake/map as RawSourceMap + let map //: SourceMap + let mapIndex = 1 + const useArrayInterface = + sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === undefined + if (useArrayInterface) { + map = remapping(sourcemapList, () => null, excludeContent) + } else { + map = remapping( + sourcemapList[0], + function loader(sourcefile) { + if (sourcefile === escapedFilename && sourcemapList[mapIndex]) { + return sourcemapList[mapIndex++] + } else { + return null + } + }, + excludeContent + ) + } + if (!map.file) { + delete map.file + } + + // unescape the previous hack + map.sources = map.sources.map((source) => + source ? unescapeToLinuxLikePath(source) : source + ) + map.file = filename + + return map as RawSourceMap +} diff --git a/packages/uni-nvue-styler/package.json b/packages/uni-nvue-styler/package.json index 484e72137dbb11f64346c41fec37e1555ed54a61..b8ef9f20bc326d5e77235d774ae7f09a9b251183 100644 --- a/packages/uni-nvue-styler/package.json +++ b/packages/uni-nvue-styler/package.json @@ -19,6 +19,6 @@ "dependencies": { "@vue/shared": "3.2.33", "parse-css-font": "^4.0.0", - "postcss": "^8.4.12" + "postcss": "^8.4.13" } } diff --git a/packages/vite-plugin-uni/package.json b/packages/vite-plugin-uni/package.json index 07ec15c0cf13fe6f6a411b38da0399dc72558f5f..fdbc3cb0cb5ba56d759835bf6e6b7e79fbbe76f1 100644 --- a/packages/vite-plugin-uni/package.json +++ b/packages/vite-plugin-uni/package.json @@ -28,7 +28,7 @@ "@dcloudio/uni-cli-shared": "3.0.0-alpha-3040820220424001", "@dcloudio/uni-shared": "3.0.0-alpha-3040820220424001", "@rollup/pluginutils": "^4.2.0", - "@vitejs/plugin-legacy": "^1.8.1", + "@vitejs/plugin-legacy": "^1.8.2", "@vitejs/plugin-vue": "^2.3.1", "@vitejs/plugin-vue-jsx": "^1.3.10", "@vue/compiler-core": "3.2.33", @@ -53,7 +53,7 @@ "chokidar": "^3.5.3" }, "peerDependencies": { - "vite": "^2.9.6" + "vite": "^2.9.7" }, "uni-app": { "compilerVersion": "3.4.8" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a7ecb1c385c3f49a031301a9aed592436a60754d..f6f70877af607b2b7204ed86dfdf76d58bcc95df 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,7 +47,7 @@ importers: semver: ^7.3.5 ts-jest: ^27.0.3 typescript: 4.6.4 - vite: ^2.9.6 + vite: ^2.9.7 vue: 3.2.33 vue-router: ^4.0.14 yorkie: ^2.0.0 @@ -67,7 +67,7 @@ importers: '@rollup/plugin-strip': 2.1.0_rollup@2.60.2 '@types/jest': 26.0.24 '@typescript-eslint/parser': 5.14.0_eslint@7.32.0+typescript@4.6.4 - '@vitejs/plugin-vue': 2.3.1_vite@2.9.6+vue@3.2.33 + '@vitejs/plugin-vue': 2.3.1_vite@2.9.7+vue@3.2.33 '@vitejs/plugin-vue-jsx': 1.3.10 '@vue/reactivity': 3.2.33 '@vue/runtime-core': 3.2.33 @@ -95,7 +95,7 @@ importers: semver: 7.3.5 ts-jest: 27.1.0_47d58305135e10b3657e8fdb59182ab7 typescript: 4.6.4 - vite: 2.9.6 + vite: 2.9.7 vue: 3.2.33 vue-router: 4.0.14_vue@3.2.33 yorkie: 2.0.0 @@ -109,7 +109,7 @@ importers: compression: ^1.7.4 cypress: ^7.3.0 serve-static: ^1.14.1 - vite: ^2.9.6 + vite: ^2.9.7 vue: 3.2.33 vue-router: ^4.0.14 vuex: ^4.0.2 @@ -125,7 +125,7 @@ importers: compression: 1.7.4 cypress: 7.7.0 serve-static: 1.14.1 - vite: 2.9.6 + vite: 2.9.7 packages/size-check: specifiers: @@ -213,7 +213,7 @@ importers: esbuild: ^0.14.27 fs-extra: ^10.0.0 picocolors: ^1.0.0 - postcss: ^8.4.12 + postcss: ^8.4.13 rollup: ^2.59.0 dependencies: '@dcloudio/uni-cli-shared': link:../uni-cli-shared @@ -221,7 +221,7 @@ importers: '@dcloudio/uni-nvue-styler': link:../uni-nvue-styler '@dcloudio/uni-shared': link:../uni-shared '@rollup/pluginutils': 4.2.0 - '@vitejs/plugin-vue': 2.3.1_vite@2.9.6+vue@3.2.33 + '@vitejs/plugin-vue': 2.3.1_vite@2.9.7+vue@3.2.33 '@vue/compiler-dom': 3.2.33 '@vue/compiler-sfc': 3.2.33 debug: 4.3.3 @@ -233,7 +233,7 @@ importers: '@types/fs-extra': 9.0.13 '@vue/compiler-core': 3.2.33 esbuild: 0.14.29 - postcss: 8.4.12 + postcss: 8.4.13 packages/uni-app-vue: specifiers: @@ -274,6 +274,7 @@ importers: packages/uni-cli-shared: specifiers: + '@ampproject/remapping': ^2.1.2 '@babel/core': ^7.17.9 '@babel/parser': ^7.17.9 '@babel/types': ^7.17.0 @@ -295,7 +296,7 @@ importers: '@vue/compiler-sfc': 3.2.33 '@vue/server-renderer': 3.2.33 '@vue/shared': 3.2.33 - autoprefixer: ^10.4.6 + autoprefixer: ^10.4.7 base64url: ^3.0.1 chokidar: ^3.5.3 compare-versions: ^3.6.0 @@ -312,7 +313,7 @@ importers: mime: ^3.0.0 module-alias: ^2.2.2 picocolors: ^1.0.0 - postcss: ^8.4.12 + postcss: ^8.4.13 postcss-import: ^14.0.2 postcss-load-config: ^3.1.1 postcss-modules: ^4.3.0 @@ -321,6 +322,7 @@ importers: tapable: ^2.2.0 xregexp: 3.1.0 dependencies: + '@ampproject/remapping': 2.2.0 '@babel/core': 7.17.9 '@babel/parser': 7.17.9 '@babel/types': 7.17.0 @@ -335,7 +337,7 @@ importers: '@vue/compiler-sfc': 3.2.33 '@vue/server-renderer': 3.2.33_vue@3.2.33 '@vue/shared': 3.2.33 - autoprefixer: 10.4.6_postcss@8.4.12 + autoprefixer: 10.4.7_postcss@8.4.13 base64url: 3.0.1 chokidar: 3.5.3 compare-versions: 3.6.0 @@ -352,9 +354,9 @@ importers: mime: 3.0.0 module-alias: 2.2.2 picocolors: 1.0.0 - postcss-import: 14.0.2_postcss@8.4.12 + postcss-import: 14.0.2_postcss@8.4.13 postcss-load-config: 3.1.2 - postcss-modules: 4.3.0_postcss@8.4.12 + postcss-modules: 4.3.0_postcss@8.4.13 postcss-selector-parser: 6.0.6 resolve: 1.22.0 tapable: 2.2.1 @@ -367,7 +369,7 @@ importers: '@types/mime': 2.0.3 '@types/module-alias': 2.0.1 '@types/stylus': 0.48.36 - postcss: 8.4.12 + postcss: 8.4.13 packages/uni-cloud: specifiers: @@ -685,11 +687,11 @@ importers: specifiers: '@vue/shared': 3.2.33 parse-css-font: ^4.0.0 - postcss: ^8.4.12 + postcss: ^8.4.13 dependencies: '@vue/shared': 3.2.33 parse-css-font: 4.0.0 - postcss: 8.4.12 + postcss: 8.4.13 packages/uni-push: specifiers: @@ -756,7 +758,7 @@ importers: '@types/express': ^4.17.12 '@types/fs-extra': ^9.0.13 '@types/sass': ^1.16.0 - '@vitejs/plugin-legacy': ^1.8.1 + '@vitejs/plugin-legacy': ^1.8.2 '@vitejs/plugin-vue': ^2.3.1 '@vitejs/plugin-vue-jsx': ^1.3.10 '@vue/babel-plugin-jsx': ^1.1.1 @@ -780,8 +782,8 @@ importers: '@dcloudio/uni-cli-shared': link:../uni-cli-shared '@dcloudio/uni-shared': link:../uni-shared '@rollup/pluginutils': 4.2.0 - '@vitejs/plugin-legacy': 1.8.1_vite@2.9.6 - '@vitejs/plugin-vue': 2.3.1_vite@2.9.6+vue@3.2.33 + '@vitejs/plugin-legacy': 1.8.2_vite@2.9.7 + '@vitejs/plugin-vue': 2.3.1_vite@2.9.7+vue@3.2.33 '@vitejs/plugin-vue-jsx': 1.3.10 '@vue/compiler-core': 3.2.33 '@vue/compiler-dom': 3.2.33 @@ -805,11 +807,12 @@ importers: packages: - /@ampproject/remapping/2.1.1: - resolution: {integrity: sha512-Aolwjd7HSC2PyY0fDj/wA/EimQT4HfEnFYNp5s9CQlrdhyvWTtvZ5YzrUPu6R6/1jKiUlxu8bUhkdSnKHNAHMA==} + /@ampproject/remapping/2.2.0: + resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} engines: {node: '>=6.0.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.4 + '@jridgewell/gen-mapping': 0.1.1 + '@jridgewell/trace-mapping': 0.3.9 /@babel/code-frame/7.12.11: resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} @@ -870,7 +873,7 @@ packages: resolution: {integrity: sha512-5ug+SfZCpDAkVp9SFIZAzlW18rlzsOcJGaetCjkySnrXXDUw9AR8cDUm1iByTmdWM6yxX6/zycaV76w3YTF2gw==} engines: {node: '>=6.9.0'} dependencies: - '@ampproject/remapping': 2.1.1 + '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.16.7 '@babel/generator': 7.17.9 '@babel/helper-compilation-targets': 7.17.7_@babel+core@7.17.9 @@ -2246,8 +2249,8 @@ packages: regenerator-runtime: 0.13.9 dev: true - /@babel/standalone/7.17.9: - resolution: {integrity: sha512-9wL9AtDlga8avxUrBvQJmhUtJWrelsUL0uV+TcP+49Sb6Pj8/bNIzQzU4dDp0NAPOvnZR/7msFIKsKoCl/W1/w==} + /@babel/standalone/7.17.11: + resolution: {integrity: sha512-47wVYBeTktYHwtzlFuK7qqV/H5X6mU4MUNqpQ9iiJOqnP8rWL0eX0GWLKRsv8D8suYzhuS1K/dtwgGr+26U7Gg==} engines: {node: '>=6.9.0'} dev: false @@ -2685,15 +2688,26 @@ packages: chalk: 4.1.2 dev: true + /@jridgewell/gen-mapping/0.1.1: + resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.0 + '@jridgewell/sourcemap-codec': 1.4.11 + /@jridgewell/resolve-uri/3.0.5: resolution: {integrity: sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==} engines: {node: '>=6.0.0'} + /@jridgewell/set-array/1.1.0: + resolution: {integrity: sha512-SfJxIxNVYLTsKwzB3MoOQ1yxf4w/E6MdkvTgrgAt1bfxjSrLUoHMKrDOykwN14q65waezZIdqDneUIPh4/sKxg==} + engines: {node: '>=6.0.0'} + /@jridgewell/sourcemap-codec/1.4.11: resolution: {integrity: sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==} - /@jridgewell/trace-mapping/0.3.4: - resolution: {integrity: sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==} + /@jridgewell/trace-mapping/0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} dependencies: '@jridgewell/resolve-uri': 3.0.5 '@jridgewell/sourcemap-codec': 1.4.11 @@ -3219,18 +3233,18 @@ packages: eslint-visitor-keys: 3.1.0 dev: true - /@vitejs/plugin-legacy/1.8.1_vite@2.9.6: - resolution: {integrity: sha512-kmBWKq7EeNvzS4AqPBqUKdoWG/NYQXh7StUFMWR3D21aN5Mfmar7CTO2a7K+bBxJH/vAL9gnnueA0wb7cycCmQ==} + /@vitejs/plugin-legacy/1.8.2_vite@2.9.7: + resolution: {integrity: sha512-NCOKU+pU+cxLMR9P9RTolEuOK+h+zYBXlknj+zGcKSj/NXBZYgA1GAH1FnO4zijoWRiTaiOm2ha9LQrELE7XHg==} engines: {node: '>=12.0.0'} peerDependencies: vite: ^2.8.0 dependencies: - '@babel/standalone': 7.17.9 - core-js: 3.21.1 + '@babel/standalone': 7.17.11 + core-js: 3.22.4 magic-string: 0.26.1 regenerator-runtime: 0.13.9 systemjs: 6.12.1 - vite: 2.9.6 + vite: 2.9.7 dev: false /@vitejs/plugin-vue-jsx/1.3.10: @@ -3246,14 +3260,14 @@ packages: transitivePeerDependencies: - supports-color - /@vitejs/plugin-vue/2.3.1_vite@2.9.6+vue@3.2.33: + /@vitejs/plugin-vue/2.3.1_vite@2.9.7+vue@3.2.33: resolution: {integrity: sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==} engines: {node: '>=12.0.0'} peerDependencies: vite: ^2.5.10 vue: ^3.2.25 dependencies: - vite: 2.9.6 + vite: 2.9.7 vue: 3.2.33 /@vue/babel-helper-vue-transform-on/1.0.2: @@ -3300,7 +3314,7 @@ packages: '@vue/shared': 3.2.33 estree-walker: 2.0.2 magic-string: 0.25.7 - postcss: 8.4.12 + postcss: 8.4.13 source-map: 0.6.1 /@vue/compiler-ssr/3.2.33: @@ -3560,8 +3574,8 @@ packages: resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} engines: {node: '>= 4.0.0'} - /autoprefixer/10.4.6_postcss@8.4.12: - resolution: {integrity: sha512-Rvzel0AZO9tJNm3ydySK80PpkWoEZTGC5bHUh/xbrP8qJCy08NFBwNGPcozy3d3SDIM0b2kNxw2K7jAIYFF01A==} + /autoprefixer/10.4.7_postcss@8.4.13: + resolution: {integrity: sha512-ypHju4Y2Oav95SipEcCcI5J7CGPuvz8oat7sUtYj3ClK44bldfvtvcxK6IEK++7rqB7YchDGzweZIBG+SD0ZAA==} engines: {node: ^10 || ^12 || >=14} hasBin: true peerDependencies: @@ -3572,7 +3586,7 @@ packages: fraction.js: 4.2.0 normalize-range: 0.1.2 picocolors: 1.0.0 - postcss: 8.4.12 + postcss: 8.4.13 postcss-value-parser: 4.2.0 dev: false @@ -4225,8 +4239,8 @@ packages: requiresBuild: true dev: true - /core-js/3.21.1: - resolution: {integrity: sha512-FRq5b/VMrWlrmCzwRrpDYNxyHP9BcAZC+xHJaqTgIE5091ZV1NTmyh0sGOg5XqpnHvR0svdy0sv1gWA1zmhxig==} + /core-js/3.22.4: + resolution: {integrity: sha512-1uLykR+iOfYja+6Jn/57743gc9n73EWiOnSJJ4ba3B4fOEYDBv25MagmEZBxTp5cWq4b/KPx/l77zgsp28ju4w==} requiresBuild: true dev: false @@ -5769,13 +5783,13 @@ packages: resolution: {integrity: sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=} dev: false - /icss-utils/5.1.0_postcss@8.4.12: + /icss-utils/5.1.0_postcss@8.4.13: resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - postcss: 8.4.12 + postcss: 8.4.13 dev: false /idb-wrapper/1.7.2: @@ -7146,8 +7160,8 @@ packages: hasBin: true dev: true - /nanoid/3.3.2: - resolution: {integrity: sha512-CuHBogktKwpm5g2sRgv83jEy2ijFzBwMoYA60orPDR7ynsLijJDqgsi4RDGj3OJpy3Ieb+LYwiRmIOGyytgITA==} + /nanoid/3.3.4: + resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -7477,13 +7491,13 @@ packages: semver-compare: 1.0.0 dev: true - /postcss-import/14.0.2_postcss@8.4.12: + /postcss-import/14.0.2_postcss@8.4.13: resolution: {integrity: sha512-BJ2pVK4KhUyMcqjuKs9RijV5tatNzNa73e/32aBVE/ejYPe37iH+6vAu9WvqUkB5OAYgLHzbSvzHnorybJCm9g==} engines: {node: '>=10.0.0'} peerDependencies: postcss: ^8.0.0 dependencies: - postcss: 8.4.12 + postcss: 8.4.13 postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.0 @@ -7502,48 +7516,48 @@ packages: yaml: 1.10.2 dev: false - /postcss-modules-extract-imports/3.0.0_postcss@8.4.12: + /postcss-modules-extract-imports/3.0.0_postcss@8.4.13: resolution: {integrity: sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - postcss: 8.4.12 + postcss: 8.4.13 dev: false - /postcss-modules-local-by-default/4.0.0_postcss@8.4.12: + /postcss-modules-local-by-default/4.0.0_postcss@8.4.13: resolution: {integrity: sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - icss-utils: 5.1.0_postcss@8.4.12 - postcss: 8.4.12 + icss-utils: 5.1.0_postcss@8.4.13 + postcss: 8.4.13 postcss-selector-parser: 6.0.6 postcss-value-parser: 4.2.0 dev: false - /postcss-modules-scope/3.0.0_postcss@8.4.12: + /postcss-modules-scope/3.0.0_postcss@8.4.13: resolution: {integrity: sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - postcss: 8.4.12 + postcss: 8.4.13 postcss-selector-parser: 6.0.6 dev: false - /postcss-modules-values/4.0.0_postcss@8.4.12: + /postcss-modules-values/4.0.0_postcss@8.4.13: resolution: {integrity: sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==} engines: {node: ^10 || ^12 || >= 14} peerDependencies: postcss: ^8.1.0 dependencies: - icss-utils: 5.1.0_postcss@8.4.12 - postcss: 8.4.12 + icss-utils: 5.1.0_postcss@8.4.13 + postcss: 8.4.13 dev: false - /postcss-modules/4.3.0_postcss@8.4.12: + /postcss-modules/4.3.0_postcss@8.4.13: resolution: {integrity: sha512-zoUttLDSsbWDinJM9jH37o7hulLRyEgH6fZm2PchxN7AZ8rkdWiALyNhnQ7+jg7cX9f10m6y5VhHsrjO0Mf/DA==} peerDependencies: postcss: ^8.0.0 @@ -7551,11 +7565,11 @@ packages: generic-names: 4.0.0 icss-replace-symbols: 1.1.0 lodash.camelcase: 4.3.0 - postcss: 8.4.12 - postcss-modules-extract-imports: 3.0.0_postcss@8.4.12 - postcss-modules-local-by-default: 4.0.0_postcss@8.4.12 - postcss-modules-scope: 3.0.0_postcss@8.4.12 - postcss-modules-values: 4.0.0_postcss@8.4.12 + postcss: 8.4.13 + postcss-modules-extract-imports: 3.0.0_postcss@8.4.13 + postcss-modules-local-by-default: 4.0.0_postcss@8.4.13 + postcss-modules-scope: 3.0.0_postcss@8.4.13 + postcss-modules-values: 4.0.0_postcss@8.4.13 string-hash: 1.1.3 dev: false @@ -7571,11 +7585,11 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: false - /postcss/8.4.12: - resolution: {integrity: sha512-lg6eITwYe9v6Hr5CncVbK70SoioNQIq81nsaG86ev5hAidQvmOeETBqs7jm43K2F5/Ley3ytDtriImV6TpNiSg==} + /postcss/8.4.13: + resolution: {integrity: sha512-jtL6eTBrza5MPzy8oJLFuUscHDXTV5KcLlqAWHl5q5WYRfnNRGSmOZmOZ1T6Gy7A99mOZfqungmZMpMmCVJ8ZA==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.2 + nanoid: 3.3.4 picocolors: 1.0.0 source-map-js: 1.0.2 @@ -8732,8 +8746,8 @@ packages: extsprintf: 1.3.0 dev: true - /vite/2.9.6: - resolution: {integrity: sha512-3IffdrByHW95Yjv0a13TQOQfJs7L5dVlSPuTt432XLbRMriWbThqJN2k/IS6kXn5WY4xBLhK9XoaWay1B8VzUw==} + /vite/2.9.7: + resolution: {integrity: sha512-5hH7aNQe8rJiTTqCtPNX/6mIKlGw+1wg8UXwAxDIIN8XaSR+Zx3GT2zSu7QKa1vIaBqfUODGh3vpwY8r0AW/jw==} engines: {node: '>=12.2.0'} hasBin: true peerDependencies: @@ -8749,7 +8763,7 @@ packages: optional: true dependencies: esbuild: 0.14.29 - postcss: 8.4.12 + postcss: 8.4.13 resolve: 1.22.0 rollup: 2.60.2 optionalDependencies: diff --git a/scripts/checkVersion.js b/scripts/checkVersion.js index 098ddd84abc0aa999dec9fe331e8032f9b91b3a5..ef226a4d5246aa845534efb7270fd8ad60c35265 100644 --- a/scripts/checkVersion.js +++ b/scripts/checkVersion.js @@ -25,7 +25,7 @@ const pkgs = { next: '9.1.9', }, vite: { - latest: '2.9.6', + latest: '2.9.7', }, '@vitejs/plugin-vue': { latest: '2.3.1', @@ -34,13 +34,13 @@ const pkgs = { latest: '1.3.10', }, '@vitejs/plugin-legacy': { - latest: '1.8.1', + latest: '1.8.2', }, '@dcloudio/types': { latest: '2.6.6', }, autoprefixer: { - latest: '10.4.6', + latest: '10.4.7', }, 'rollup-plugin-copy': { latest: '3.4.0',