提交 33152153 编写于 作者: fxy060608's avatar fxy060608

chore: update deps

上级 102c64bf
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003", "@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"@rollup/pluginutils": "^4.1.1", "@rollup/pluginutils": "^4.1.1",
"clean-css": "^5.1.3", "clean-css": "^5.1.3",
"debug": "^4.3.2",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"postcss-import": "^14.0.2", "postcss-import": "^14.0.2",
"postcss-load-config": "^3.1.0", "postcss-load-config": "^3.1.0",
......
...@@ -8,7 +8,10 @@ export const isInHBuilderX = once(() => { ...@@ -8,7 +8,10 @@ export const isInHBuilderX = once(() => {
process.cwd(), process.cwd(),
'../about/package.json' '../about/package.json'
)) ))
return name === 'about' if (name === 'about') {
process.env.UNI_HBUILDERX_PLUGINS = path.resolve(process.cwd(), '..')
return true
}
} catch (e) { } catch (e) {
// console.error(e) // console.error(e)
} }
......
...@@ -24,9 +24,13 @@ ...@@ -24,9 +24,13 @@
"@rollup/pluginutils": "^4.1.1", "@rollup/pluginutils": "^4.1.1",
"@vue/compiler-dom": "3.2.21", "@vue/compiler-dom": "3.2.21",
"@vue/compiler-sfc": "3.2.21", "@vue/compiler-sfc": "3.2.21",
"@vue/server-renderer": "3.2.21" "@vue/server-renderer": "3.2.21",
"debug": "^4.3.2",
"mime": "^3.0.0",
"module-alias": "^2.2.2"
}, },
"devDependencies": { "devDependencies": {
"@types/mime": "^2.0.3",
"@vue/compiler-core": "3.2.21", "@vue/compiler-core": "3.2.21",
"esbuild": "^0.13.2" "esbuild": "^0.13.2"
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003", "@dcloudio/uni-mp-vue": "3.0.0-alpha-3021320211109003",
"@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003", "@dcloudio/uni-shared": "3.0.0-alpha-3021320211109003",
"base64url": "^3.0.1", "base64url": "^3.0.1",
"debug": "^4.3.2",
"magic-string": "^0.25.7" "magic-string": "^0.25.7"
}, },
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da", "gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
......
{ [
"input": { {
"src/index.js": ["dist/uni-stat.es.js", "dist/uni-stat.cjs.js"] "input": {
"src/plugin/index.ts": "lib/uni.plugin.js"
},
"output": {
"format": "cjs"
},
"external": ["debug", "@dcloudio/uni-cli-shared"]
},
{
"input": {
"src/index.js": ["dist/uni-stat.es.js", "dist/uni-stat.cjs.js"]
}
} }
} ]
const debug = require('debug') 'use strict'
const {
M,
defineUniMainJsPlugin,
getUniStatistics,
parseManifestJsonOnce,
parsePagesJsonOnce,
} = require('@dcloudio/uni-cli-shared')
module.exports = [ var debug = require('debug')
defineUniMainJsPlugin((opts) => { var uniCliShared = require('@dcloudio/uni-cli-shared')
function _interopDefaultLegacy(e) {
return e && typeof e === 'object' && 'default' in e ? e : { default: e }
}
var debug__default = /*#__PURE__*/ _interopDefaultLegacy(debug)
var index = [
uniCliShared.defineUniMainJsPlugin((opts) => {
let isEnable = false let isEnable = false
return { return {
name: 'vite:uni-stat', name: 'vite:uni-stat',
...@@ -19,26 +21,29 @@ module.exports = [ ...@@ -19,26 +21,29 @@ module.exports = [
} }
const inputDir = process.env.UNI_INPUT_DIR const inputDir = process.env.UNI_INPUT_DIR
const platform = process.env.UNI_PLATFORM const platform = process.env.UNI_PLATFORM
isEnable = getUniStatistics(inputDir, platform).enable === true isEnable =
uniCliShared.getUniStatistics(inputDir, platform).enable === true
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
const manifestJson = parseManifestJsonOnce(inputDir) const manifestJson = uniCliShared.parseManifestJsonOnce(inputDir)
if (!manifestJson.appid) { if (!manifestJson.appid) {
console.log() console.log()
console.warn(M['stat.warn.appid']) console.warn(uniCliShared.M['stat.warn.appid'])
console.log() console.log()
isEnable = false isEnable = false
} }
} }
const titlesJson = Object.create(null) const titlesJson = Object.create(null)
if (isEnable) { if (isEnable) {
parsePagesJsonOnce(inputDir, platform).pages.forEach((page) => { uniCliShared
const titleText = page.style.navigationBar.titleText || '' .parsePagesJsonOnce(inputDir, platform)
if (titleText) { .pages.forEach((page) => {
titlesJson[page.path] = titleText const titleText = page.style.navigationBar.titleText || ''
} if (titleText) {
}) titlesJson[page.path] = titleText
}
})
} }
debug('vite:uni:stat')('isEnable', isEnable) debug__default['default']('vite:uni:stat')('isEnable', isEnable)
process.env.UNI_STAT_TITLE_JSON = JSON.stringify(titlesJson) process.env.UNI_STAT_TITLE_JSON = JSON.stringify(titlesJson)
return { return {
define: { define: {
...@@ -57,7 +62,6 @@ module.exports = [ ...@@ -57,7 +62,6 @@ module.exports = [
} }
}), }),
] ]
function isSsr(command, config) { function isSsr(command, config) {
if (command === 'serve') { if (command === 'serve') {
return !!(config.server && config.server.middlewareMode) return !!(config.server && config.server.middlewareMode)
...@@ -67,3 +71,5 @@ function isSsr(command, config) { ...@@ -67,3 +71,5 @@ function isSsr(command, config) {
} }
return false return false
} }
module.exports = index
...@@ -18,5 +18,9 @@ ...@@ -18,5 +18,9 @@
"bugs": { "bugs": {
"url": "https://github.com/dcloudio/uni-app/issues" "url": "https://github.com/dcloudio/uni-app/issues"
}, },
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da" "gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"dependencies": {
"@dcloudio/uni-cli-shared": "workspace:3.0.0-alpha-3021320211109003",
"debug": "^4.3.2"
}
} }
import type { ConfigEnv, UserConfig } from 'vite'
import debug from 'debug'
import {
M,
defineUniMainJsPlugin,
getUniStatistics,
parseManifestJsonOnce,
parsePagesJsonOnce,
} from '@dcloudio/uni-cli-shared'
export default [
defineUniMainJsPlugin((opts) => {
let isEnable = false
return {
name: 'vite:uni-stat',
enforce: 'pre',
config(config, env) {
if (isSsr(env.command, config)) {
return
}
const inputDir = process.env.UNI_INPUT_DIR!
const platform = process.env.UNI_PLATFORM!
isEnable = getUniStatistics(inputDir, platform).enable === true
if (process.env.NODE_ENV === 'production') {
const manifestJson = parseManifestJsonOnce(inputDir)
if (!manifestJson.appid) {
console.log()
console.warn(M['stat.warn.appid'])
console.log()
isEnable = false
}
}
const titlesJson = Object.create(null)
if (isEnable) {
parsePagesJsonOnce(inputDir, platform).pages.forEach((page: any) => {
const titleText = page.style.navigationBar.titleText || ''
if (titleText) {
titlesJson[page.path] = titleText
}
})
}
debug('vite:uni:stat')('isEnable', isEnable)
process.env.UNI_STAT_TITLE_JSON = JSON.stringify(titlesJson)
return {
define: {
'process.env.UNI_STAT_TITLE_JSON': process.env.UNI_STAT_TITLE_JSON,
},
}
},
transform(code, id) {
if (isEnable && opts.filter(id)) {
return {
code: code + `;import '@dcloudio/uni-stat';`,
map: null,
}
}
},
}
}),
]
function isSsr(command: ConfigEnv['command'], config: UserConfig) {
if (command === 'serve') {
return !!(config.server && config.server.middlewareMode)
}
if (command === 'build') {
return !!(config.build && config.build.ssr)
}
return false
}
...@@ -36,14 +36,10 @@ ...@@ -36,14 +36,10 @@
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"express": "^4.17.1", "express": "^4.17.1",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"jsonc-parser": "^3.0.0", "jsonc-parser": "^3.0.0"
"mime": "^2.5.2",
"module-alias": "^2.2.2"
}, },
"devDependencies": { "devDependencies": {
"@types/express": "^4.17.12", "@types/express": "^4.17.12",
"@types/mime": "^2.0.3",
"@types/module-alias": "^2.0.0",
"@types/sass": "^1.16.0", "@types/sass": "^1.16.0",
"@vue/babel-plugin-jsx": "^1.1.1", "@vue/babel-plugin-jsx": "^1.1.1",
"chokidar": "^3.5.2" "chokidar": "^3.5.2"
......
...@@ -197,6 +197,7 @@ importers: ...@@ -197,6 +197,7 @@ importers:
'@rollup/pluginutils': ^4.1.1 '@rollup/pluginutils': ^4.1.1
'@vue/compiler-core': 3.2.21 '@vue/compiler-core': 3.2.21
clean-css: ^5.1.3 clean-css: ^5.1.3
debug: ^4.3.2
fs-extra: ^10.0.0 fs-extra: ^10.0.0
postcss-import: ^14.0.2 postcss-import: ^14.0.2
postcss-load-config: ^3.1.0 postcss-load-config: ^3.1.0
...@@ -208,6 +209,7 @@ importers: ...@@ -208,6 +209,7 @@ importers:
'@dcloudio/uni-shared': link:../uni-shared '@dcloudio/uni-shared': link:../uni-shared
'@rollup/pluginutils': 4.1.1 '@rollup/pluginutils': 4.1.1
clean-css: 5.2.2 clean-css: 5.2.2
debug: 4.3.2
fs-extra: 10.0.0 fs-extra: 10.0.0
postcss-import: 14.0.2 postcss-import: 14.0.2
postcss-load-config: 3.1.0 postcss-load-config: 3.1.0
...@@ -268,6 +270,7 @@ importers: ...@@ -268,6 +270,7 @@ importers:
loader-utils: ^1.1.0 loader-utils: ^1.1.0
lru-cache: ^4.1.2 lru-cache: ^4.1.2
merge-source-map: ^1.1.0 merge-source-map: ^1.1.0
module-alias: ^2.2.2
postcss: ^8.3.8 postcss: ^8.3.8
postcss-comment: ^2.0.0 postcss-comment: ^2.0.0
postcss-import: ^14.0.2 postcss-import: ^14.0.2
...@@ -305,6 +308,7 @@ importers: ...@@ -305,6 +308,7 @@ importers:
loader-utils: 1.4.0 loader-utils: 1.4.0
lru-cache: 4.1.5 lru-cache: 4.1.5
merge-source-map: 1.1.0 merge-source-map: 1.1.0
module-alias: 2.2.2
postcss: 8.3.11 postcss: 8.3.11
postcss-comment: 2.0.0 postcss-comment: 2.0.0
postcss-import: 14.0.2_postcss@8.3.11 postcss-import: 14.0.2_postcss@8.3.11
...@@ -336,6 +340,7 @@ importers: ...@@ -336,6 +340,7 @@ importers:
'@rollup/pluginutils': ^4.1.1 '@rollup/pluginutils': ^4.1.1
'@types/hash-sum': ^1.0.0 '@types/hash-sum': ^1.0.0
'@types/less': ^3.0.3 '@types/less': ^3.0.3
'@types/mime': ^2.0.3
'@types/stylus': ^0.48.36 '@types/stylus': ^0.48.36
'@vue/compiler-core': 3.2.21 '@vue/compiler-core': 3.2.21
'@vue/compiler-dom': 3.2.21 '@vue/compiler-dom': 3.2.21
...@@ -352,6 +357,8 @@ importers: ...@@ -352,6 +357,8 @@ importers:
jsonc-parser: ^3.0.0 jsonc-parser: ^3.0.0
magic-string: ^0.25.7 magic-string: ^0.25.7
merge: ^2.1.1 merge: ^2.1.1
mime: ^3.0.0
module-alias: ^2.2.2
postcss: ^8.3.8 postcss: ^8.3.8
postcss-import: ^14.0.2 postcss-import: ^14.0.2
postcss-load-config: ^3.1.0 postcss-load-config: ^3.1.0
...@@ -379,6 +386,8 @@ importers: ...@@ -379,6 +386,8 @@ importers:
jsonc-parser: 3.0.0 jsonc-parser: 3.0.0
magic-string: 0.25.7 magic-string: 0.25.7
merge: 2.1.1 merge: 2.1.1
mime: 3.0.0
module-alias: 2.2.2
postcss-import: 14.0.2_postcss@8.3.11 postcss-import: 14.0.2_postcss@8.3.11
postcss-load-config: 3.1.0 postcss-load-config: 3.1.0
postcss-selector-parser: 6.0.6 postcss-selector-parser: 6.0.6
...@@ -388,6 +397,7 @@ importers: ...@@ -388,6 +397,7 @@ importers:
devDependencies: devDependencies:
'@types/hash-sum': 1.0.0 '@types/hash-sum': 1.0.0
'@types/less': 3.0.3 '@types/less': 3.0.3
'@types/mime': 2.0.3
'@types/stylus': 0.48.36 '@types/stylus': 0.48.36
'@vue/compiler-sfc': 3.2.21 '@vue/compiler-sfc': 3.2.21
postcss: 8.3.11 postcss: 8.3.11
...@@ -458,11 +468,15 @@ importers: ...@@ -458,11 +468,15 @@ importers:
'@dcloudio/uni-cli-shared': 3.0.0-alpha-3021320211109003 '@dcloudio/uni-cli-shared': 3.0.0-alpha-3021320211109003
'@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003 '@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003
'@rollup/pluginutils': ^4.1.1 '@rollup/pluginutils': ^4.1.1
'@types/mime': ^2.0.3
'@vue/compiler-core': 3.2.21 '@vue/compiler-core': 3.2.21
'@vue/compiler-dom': 3.2.21 '@vue/compiler-dom': 3.2.21
'@vue/compiler-sfc': 3.2.21 '@vue/compiler-sfc': 3.2.21
'@vue/server-renderer': 3.2.21 '@vue/server-renderer': 3.2.21
debug: ^4.3.2
esbuild: ^0.13.2 esbuild: ^0.13.2
mime: ^3.0.0
module-alias: ^2.2.2
dependencies: dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared '@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-shared': link:../uni-shared '@dcloudio/uni-shared': link:../uni-shared
...@@ -470,7 +484,11 @@ importers: ...@@ -470,7 +484,11 @@ importers:
'@vue/compiler-dom': 3.2.21 '@vue/compiler-dom': 3.2.21
'@vue/compiler-sfc': 3.2.21 '@vue/compiler-sfc': 3.2.21
'@vue/server-renderer': 3.2.21_vue@3.2.21 '@vue/server-renderer': 3.2.21_vue@3.2.21
debug: 4.3.2
mime: 3.0.0
module-alias: 2.2.2
devDependencies: devDependencies:
'@types/mime': 2.0.3
'@vue/compiler-core': 3.2.21 '@vue/compiler-core': 3.2.21
esbuild: 0.13.12 esbuild: 0.13.12
...@@ -607,6 +625,7 @@ importers: ...@@ -607,6 +625,7 @@ importers:
'@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003 '@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003
'@vue/compiler-sfc': 3.2.21 '@vue/compiler-sfc': 3.2.21
base64url: ^3.0.1 base64url: ^3.0.1
debug: ^4.3.2
magic-string: ^0.25.7 magic-string: ^0.25.7
dependencies: dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared '@dcloudio/uni-cli-shared': link:../uni-cli-shared
...@@ -614,6 +633,7 @@ importers: ...@@ -614,6 +633,7 @@ importers:
'@dcloudio/uni-mp-vue': link:../uni-mp-vue '@dcloudio/uni-mp-vue': link:../uni-mp-vue
'@dcloudio/uni-shared': link:../uni-shared '@dcloudio/uni-shared': link:../uni-shared
base64url: 3.0.1 base64url: 3.0.1
debug: 4.3.2
magic-string: 0.25.7 magic-string: 0.25.7
devDependencies: devDependencies:
'@vue/compiler-sfc': 3.2.21 '@vue/compiler-sfc': 3.2.21
...@@ -657,7 +677,12 @@ importers: ...@@ -657,7 +677,12 @@ importers:
'@vue/runtime-core': 3.2.21 '@vue/runtime-core': 3.2.21
packages/uni-stat: packages/uni-stat:
specifiers: {} specifiers:
'@dcloudio/uni-cli-shared': workspace:3.0.0-alpha-3021320211109003
debug: ^4.3.2
dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared
debug: 4.3.2
packages/uni-vue: packages/uni-vue:
specifiers: specifiers:
...@@ -673,8 +698,6 @@ importers: ...@@ -673,8 +698,6 @@ importers:
'@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003 '@dcloudio/uni-shared': 3.0.0-alpha-3021320211109003
'@rollup/pluginutils': ^4.1.1 '@rollup/pluginutils': ^4.1.1
'@types/express': ^4.17.12 '@types/express': ^4.17.12
'@types/mime': ^2.0.3
'@types/module-alias': ^2.0.0
'@types/sass': ^1.16.0 '@types/sass': ^1.16.0
'@vitejs/plugin-legacy': ^1.6.2 '@vitejs/plugin-legacy': ^1.6.2
'@vitejs/plugin-vue': ^1.9.4 '@vitejs/plugin-vue': ^1.9.4
...@@ -690,8 +713,6 @@ importers: ...@@ -690,8 +713,6 @@ importers:
express: ^4.17.1 express: ^4.17.1
fs-extra: ^10.0.0 fs-extra: ^10.0.0
jsonc-parser: ^3.0.0 jsonc-parser: ^3.0.0
mime: ^2.5.2
module-alias: ^2.2.2
dependencies: dependencies:
'@dcloudio/uni-cli-shared': link:../uni-cli-shared '@dcloudio/uni-cli-shared': link:../uni-cli-shared
'@dcloudio/uni-shared': link:../uni-shared '@dcloudio/uni-shared': link:../uni-shared
...@@ -708,12 +729,8 @@ importers: ...@@ -708,12 +729,8 @@ importers:
express: 4.17.1 express: 4.17.1
fs-extra: 10.0.0 fs-extra: 10.0.0
jsonc-parser: 3.0.0 jsonc-parser: 3.0.0
mime: 2.6.0
module-alias: 2.2.2
devDependencies: devDependencies:
'@types/express': 4.17.13 '@types/express': 4.17.13
'@types/mime': 2.0.3
'@types/module-alias': 2.0.1
'@types/sass': 1.43.0 '@types/sass': 1.43.0
'@vue/babel-plugin-jsx': 1.1.1 '@vue/babel-plugin-jsx': 1.1.1
chokidar: 3.5.2 chokidar: 3.5.2
...@@ -2554,10 +2571,6 @@ packages: ...@@ -2554,10 +2571,6 @@ packages:
resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==} resolution: {integrity: sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==}
dev: false dev: false
/@types/module-alias/2.0.1:
resolution: {integrity: sha512-DN/CCT1HQG6HquBNJdLkvV+4v5l/oEuwOHUPLxI+Eub0NED+lk0YUfba04WGH90EINiUrNgClkNnwGmbICeWMQ==}
dev: true
/@types/ms/0.7.31: /@types/ms/0.7.31:
resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==} resolution: {integrity: sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==}
dev: true dev: true
...@@ -6623,9 +6636,9 @@ packages: ...@@ -6623,9 +6636,9 @@ packages:
hasBin: true hasBin: true
requiresBuild: true requiresBuild: true
/mime/2.6.0: /mime/3.0.0:
resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==}
engines: {node: '>=4.0.0'} engines: {node: '>=10.0.0'}
hasBin: true hasBin: true
dev: false dev: false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册