Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dcloudio/uni-cli-shared

Package Overview
Dependencies
Maintainers
10
Versions
1736
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dcloudio/uni-cli-shared - npm Package Compare versions

Comparing version 2.0.2-4020420240722003 to 2.0.2-4020420240722004

39

lib/platform.js
const fs = require('fs')
const path = require('path')
const {
getManifestJson
} = require('./manifest')

@@ -20,6 +23,8 @@ const {

}
const cdn = getShadowCdn()
return `${tagName}::after{position:fixed;content:'';left:-1000px;top:-1000px;-webkit-animation:shadow-preload .1s;-webkit-animation-delay:3s;animation:shadow-preload .1s;animation-delay:3s}@-webkit-keyframes shadow-preload{0%{background-image:url(${cdn}/img/shadow-grey.png)}100%{background-image:url(${cdn}/img/shadow-grey.png)}}@keyframes shadow-preload{0%{background-image:url(${cdn}/img/shadow-grey.png)}100%{background-image:url(${cdn}/img/shadow-grey.png)}}`
const url = createShadowImageUrl(getShadowCdn(), 'grey')
return `${tagName}::after{position:fixed;content:'';left:-1000px;top:-1000px;-webkit-animation:shadow-preload .1s;-webkit-animation-delay:3s;animation:shadow-preload .1s;animation-delay:3s}@-webkit-keyframes shadow-preload{0%{background-image:url(${url})}100%{background-image:url(${url})}}@keyframes shadow-preload{0%{background-image:url(${url})}100%{background-image:url(${url})}}`
}
const cdns = {
h5: '',
web: '',
'mp-weixin': 1,

@@ -41,6 +46,29 @@ 'mp-alipay': 2,

function getShadowCdn () {
const index = cdns[process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM] || ''
return `https://cdn${index}.dcloud.net.cn`
return cdns[process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM] || ''
}
let appid
function createIdent () {
if (process.env.UNI_INPUT_DIR) {
if (typeof appid === 'undefined') {
appid = getManifestJson().appid || ''
}
const id = appid.replace('__UNI__', '')
if (id) {
return Buffer.from(Buffer.from(id).toString('base64')).toString('hex')
}
}
return ''
}
function createShadowImageUrl (cdn, type = 'grey') {
let identStr = ''
if (process.env.UNI_PLATFORM !== 'h5' && process.env.UNI_PLATFORM !== 'web') {
const ident = createIdent()
identStr = ident ? `${ident}/` : ''
}
return `https://cdn${cdn || ''}.dcloud.net.cn/${identStr}img/shadow-${type}.png`
}
// 解决 vue-cli-service lint 时 UNI_PLATFORM 不存在

@@ -150,2 +178,3 @@ process.env.UNI_PLATFORM = process.env.UNI_PLATFORM || 'h5'

},
createShadowImageUrl,
getShadowCss,

@@ -158,3 +187,3 @@ getShadowTemplate (colorType = 'grey') {

}
return `<${tagName} src="${getShadowCdn()}/img/shadow-${colorType}.png" style="z-index:998;position:fixed;left:0;top:0;width:100%;height:3px;"/>`
return `<${tagName} src="${createShadowImageUrl(getShadowCdn(), colorType)}" style="z-index:998;position:fixed;left:0;top:0;width:100%;height:3px;"/>`
},

@@ -161,0 +190,0 @@ getPlatformScss () {

4

package.json
{
"name": "@dcloudio/uni-cli-shared",
"version": "2.0.2-4020420240722003",
"version": "2.0.2-4020420240722004",
"description": "uni-cli-shared",

@@ -29,3 +29,3 @@ "main": "lib/index.js",

},
"gitHead": "7ab031552c02be8bb0c163fd2b81e6d811b23d29"
"gitHead": "2d3e029c00dc153d1f9b01b3cf4e697470e01087"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc