@dcloudio/uni-cli-shared 2.0.2-alpha-4080120250820001 → 2.0.2-alpha-4080120250905001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -199,7 +199,10 @@ export default {
|
|
|
199
199
|
if (adData.tmpl_type === 24) {
|
|
200
200
|
this.customFullscreen = 'uni-ad-custom-fullscreen'
|
|
201
201
|
}
|
|
202
|
-
this.loading = true
|
|
202
|
+
this.loading = true
|
|
203
|
+
if (!adData.dcloudAdpid) {
|
|
204
|
+
adData.dcloudAdpid = this.adpid
|
|
205
|
+
}
|
|
203
206
|
this.selectComponent('.uniad-plugin-wx').setConfig(adData)
|
|
204
207
|
}
|
|
205
208
|
})
|
|
@@ -224,14 +227,18 @@ export default {
|
|
|
224
227
|
iv,
|
|
225
228
|
version,
|
|
226
229
|
expireTime
|
|
227
|
-
}) => {
|
|
230
|
+
}) => {
|
|
231
|
+
const uniOptions = {
|
|
232
|
+
adpid: this.adpid
|
|
233
|
+
}
|
|
228
234
|
adComponent.show({
|
|
229
235
|
userId: this.urlCallback.userId || '',
|
|
230
236
|
extra: this.urlCallback.extra || '',
|
|
231
237
|
encryptKey,
|
|
232
238
|
iv,
|
|
233
239
|
version,
|
|
234
|
-
expireTime
|
|
240
|
+
expireTime,
|
|
241
|
+
uniOptions
|
|
235
242
|
})
|
|
236
243
|
},
|
|
237
244
|
fail: (err) => {
|
package/lib/uts/uts-loader.js
CHANGED
|
@@ -59,12 +59,36 @@ function createUniModulesSyncFilePreprocessor (
|
|
|
59
59
|
} else if (extname === '.uts' || extname === '.ts') {
|
|
60
60
|
return preJs(content)
|
|
61
61
|
} else if (extname === '.uvue' || extname === '.vue') {
|
|
62
|
-
return preJs(preHtml(content))
|
|
62
|
+
return preUTSSDKVueFile(fileName, preJs(preHtml(content)))
|
|
63
63
|
}
|
|
64
64
|
return content
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
function preUTSSDKVueFile (filename, content) {
|
|
69
|
+
if (
|
|
70
|
+
filename.includes('utssdk') &&
|
|
71
|
+
(filename.includes('app-android') || filename.includes('app-ios'))
|
|
72
|
+
) {
|
|
73
|
+
const {
|
|
74
|
+
parseComponent
|
|
75
|
+
} = require('vue-template-compiler')
|
|
76
|
+
const descriptor = parseComponent(content, {
|
|
77
|
+
sourceMap: false,
|
|
78
|
+
pad: 'line'
|
|
79
|
+
})
|
|
80
|
+
if (descriptor.script?.content) {
|
|
81
|
+
return (
|
|
82
|
+
descriptor.script.content +
|
|
83
|
+
// 补充 template 内容
|
|
84
|
+
`/*${descriptor.template?.content}*/`
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
return content
|
|
88
|
+
}
|
|
89
|
+
return content
|
|
90
|
+
}
|
|
91
|
+
|
|
68
92
|
function once (fn, ctx = null) {
|
|
69
93
|
let res
|
|
70
94
|
return (...args) => {
|
|
@@ -96,7 +120,8 @@ module.exports = async function (content) {
|
|
|
96
120
|
|
|
97
121
|
const {
|
|
98
122
|
syncUniModuleFilesByCompiler,
|
|
99
|
-
resolveTscUniModuleIndexFileName
|
|
123
|
+
resolveTscUniModuleIndexFileName,
|
|
124
|
+
resolveTscUniModuleUTSSDKVueFileNames
|
|
100
125
|
} = resolveUTSCompiler()
|
|
101
126
|
|
|
102
127
|
const compilePlugin = async (pluginDir) => {
|
|
@@ -127,8 +152,16 @@ module.exports = async function (content) {
|
|
|
127
152
|
if (!utsPlugins.has(pluginId)) {
|
|
128
153
|
utsPlugins.add(pluginId)
|
|
129
154
|
if (uniXKotlinCompiler) {
|
|
155
|
+
const platform = 'app-android'
|
|
156
|
+
const vueFiles = resolveTscUniModuleUTSSDKVueFileNames(
|
|
157
|
+
platform,
|
|
158
|
+
pluginDir
|
|
159
|
+
)
|
|
160
|
+
for (const vueFile of vueFiles) {
|
|
161
|
+
await uniXKotlinCompiler.addRootFile(vueFile)
|
|
162
|
+
}
|
|
130
163
|
const indexFileName = resolveTscUniModuleIndexFileName(
|
|
131
|
-
|
|
164
|
+
platform,
|
|
132
165
|
pluginDir
|
|
133
166
|
)
|
|
134
167
|
if (indexFileName) {
|
|
@@ -136,8 +169,16 @@ module.exports = async function (content) {
|
|
|
136
169
|
}
|
|
137
170
|
}
|
|
138
171
|
if (uniXSwiftCompiler) {
|
|
172
|
+
const platform = 'app-ios'
|
|
173
|
+
const vueFiles = resolveTscUniModuleUTSSDKVueFileNames(
|
|
174
|
+
platform,
|
|
175
|
+
pluginDir
|
|
176
|
+
)
|
|
177
|
+
for (const vueFile of vueFiles) {
|
|
178
|
+
await uniXSwiftCompiler.addRootFile(vueFile)
|
|
179
|
+
}
|
|
139
180
|
const indexFileName = resolveTscUniModuleIndexFileName(
|
|
140
|
-
|
|
181
|
+
platform,
|
|
141
182
|
pluginDir
|
|
142
183
|
)
|
|
143
184
|
if (indexFileName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "2.0.2-alpha-
|
|
3
|
+
"version": "2.0.2-alpha-4080120250905001",
|
|
4
4
|
"description": "uni-cli-shared",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"postcss-urlrewrite": "^0.2.2",
|
|
28
28
|
"strip-json-comments": "^2.0.1"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "2b970c1e601c12ec3cfa696bd0c3ee546a731434"
|
|
31
31
|
}
|