Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
c13bf9e1
U
uni-app
项目概览
DCloud
/
uni-app
6 个月 前同步成功
通知
751
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c13bf9e1
编写于
7月 09, 2024
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(x-android): tsc
上级
1c457380
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
104 addition
and
85 deletion
+104
-85
packages/uni-app-uts/src/plugins/android/uvue/sfc/compiler/script/utils.ts
...uts/src/plugins/android/uvue/sfc/compiler/script/utils.ts
+1
-1
packages/uni-uts-v1/lib/javascript/lib/runtime/uts.js
packages/uni-uts-v1/lib/javascript/lib/runtime/uts.js
+12
-0
packages/uni-uts-v1/lib/kotlin/dist/index.js
packages/uni-uts-v1/lib/kotlin/dist/index.js
+1
-1
packages/uni-uts-v1/lib/kotlin/types/env.d.ts
packages/uni-uts-v1/lib/kotlin/types/env.d.ts
+0
-5
packages/uni-uts-v1/lib/kotlin/types/global.d.ts
packages/uni-uts-v1/lib/kotlin/types/global.d.ts
+32
-5
packages/uni-uts-v1/lib/kotlin/types/runtime-types.d.ts
packages/uni-uts-v1/lib/kotlin/types/runtime-types.d.ts
+0
-37
packages/uni-uts-v1/src/tsc/kotlin/index.ts
packages/uni-uts-v1/src/tsc/kotlin/index.ts
+58
-36
未找到文件。
packages/uni-app-uts/src/plugins/android/uvue/sfc/compiler/script/utils.ts
浏览文件 @
c13bf9e1
...
...
@@ -20,7 +20,7 @@ export function resolveDefineCode(
return
componentType
===
'
app
'
?
`defineApp`
:
componentType
===
'
page
'
?
`definePage`
?
`define
Component`
//`define
Page`
:
`defineComponent`
}
...
...
packages/uni-uts-v1/lib/javascript/lib/runtime/uts.js
浏览文件 @
c13bf9e1
...
...
@@ -476,6 +476,18 @@ function setUTSJSONObjectValue(obj, key, value) {
}
}
let
UTSJSONObject$1
=
class
UTSJSONObject
{
static
keys
(
obj
)
{
return
Object
.
keys
(
obj
);
}
static
assign
(
target
,
...
sources
)
{
for
(
let
i
=
0
;
i
<
sources
.
length
;
i
++
)
{
const
source
=
sources
[
i
];
for
(
let
key
in
source
)
{
target
[
key
]
=
source
[
key
];
}
}
return
target
;
}
constructor
(
content
=
{})
{
if
(
content
instanceof
Map
)
{
content
.
forEach
((
value
,
key
)
=>
{
...
...
packages/uni-uts-v1/lib/kotlin/dist/index.js
浏览文件 @
c13bf9e1
此差异已折叠。
点击以展开。
packages/uni-uts-v1/lib/kotlin/types/env.d.ts
已删除
100644 → 0
浏览文件 @
1c457380
import
"
@dcloudio/virtual-modules/hbuilderx-language-services/builtin-dts/uts-types/common/index.d.ts
"
// import "@dcloudio/virtual-modules/hbuilderx-language-services/builtin-dts/uts-types/app-android/index.d.ts"
import
"
@dcloudio/virtual-modules/hbuilderx-language-services/builtin-dts/common/HBuilderX.d.ts
"
import
"
@dcloudio/virtual-modules/hbuilderx-language-services/builtin-dts/uniappx/node_modules/@dcloudio/uni-app-x/types/index.d.ts
"
import
"
@dcloudio/virtual-modules/hbuilderx-language-services/builtin-dts/uniappx/node_modules/@vue/global.d.ts
"
packages/uni-uts-v1/lib/kotlin/types/global.d.ts
浏览文件 @
c13bf9e1
import
{
defineComponent
as
defineComponentOrigin
}
from
'
@vue/runtime-core
'
declare
global
{
type
UniPageMeta
=
import
(
'
./runtime-types
'
).
UniPageMeta
type
UniPageRoute
=
import
(
'
./runtime-types
'
).
UniPageRoute
const
__uniConfig
:
import
(
'
./runtime-types
'
).
UniConfig
const
defineComponent
:
typeof
defineComponentOrigin
const
__uniConfig
:
UniConfig
const
__uniRoutes
:
UniPageRoute
[]
const
padStyleMapOf
:
import
(
'
./runtime-types
'
).
PadStyleMapOf
function
utsMapOf
(
obj
:
Record
<
string
,
any
>
):
Map
<
string
,
any
|
null
>
function
utsMapOf
<
K
,
V
>
(
obj
:
Array
<
Array
<
any
>>
):
Map
<
string
,
any
|
null
>
function
padStyleMapOf
(
style
:
Map
<
string
,
any
>
):
Map
<
string
,
Map
<
string
,
any
>>
declare
class
UTSSourceMapPosition
<
type
UniPageMeta
=
{
isQuit
:
boolean
}
type
UniPageRoute
=
{
path
:
string
component
:
any
meta
:
UniPageMeta
style
:
Map
<
string
,
any
>
needLogin
?:
boolean
|
null
}
type
UniConfigOnReadyCallback
=
()
=>
void
type
UniConfig
=
{
realEntryPagePath
:
string
entryPagePath
:
string
globalStyle
:
Map
<
string
,
any
>
tabBar
:
Map
<
string
,
any
>
|
null
conditionUrl
:
string
uniIdRouter
:
Map
<
string
,
any
>
themeConfig
:
Map
<
string
,
Map
<
string
,
any
>>
_ready
:
boolean
callbacks
:
UniConfigOnReadyCallback
[]
onReady
(
callback
:
UniConfigOnReadyCallback
):
void
get
ready
():
boolean
set
ready
(
value
:
boolean
)
}
class
UTSSourceMapPosition
<
name
=
string
,
fileName
=
string
,
line
=
number
,
...
...
packages/uni-uts-v1/lib/kotlin/types/runtime-types.d.ts
已删除
100644 → 0
浏览文件 @
1c457380
/// <reference types="@dcloudio/uni-app-x/types/native-global" />
import
{
CreateVueComponent
}
from
'
@vue/runtime-core
'
;
declare
function
padStyleMapOf
(
style
:
Map
<
string
,
any
>
):
Map
<
string
,
Map
<
string
,
any
>>
;
type
UniConfigOnReadyCallback
=
()
=>
void
;
declare
class
UniConfig$1
{
realEntryPagePath
:
string
;
entryPagePath
:
string
;
globalStyle
:
Map
<
string
,
any
>
;
tabBar
:
Map
<
string
,
any
>
|
null
;
conditionUrl
:
string
;
uniIdRouter
:
Map
<
string
,
any
>
;
themeConfig
:
Map
<
string
,
Map
<
string
,
any
>>
;
_ready
:
boolean
;
callbacks
:
UniConfigOnReadyCallback
[];
onReady
(
callback
:
UniConfigOnReadyCallback
):
void
;
get
ready
():
boolean
;
set
ready
(
value
:
boolean
);
}
type
UniPageMeta$1
=
{
isQuit
:
boolean
;
};
type
UniPageRoute$1
=
{
path
:
string
;
component
:
CreateVueComponent
;
meta
:
UniPageMeta$1
;
style
:
Map
<
string
,
any
>
;
needLogin
?:
boolean
|
null
;
};
export
type
UniPageRoute
=
UniPageRoute$1
;
export
type
UniPageMeta
=
UniPageMeta$1
;
export
type
UniConfig
=
UniConfig$1
;
export
type
PadStyleMapOf
=
typeof
padStyleMapOf
;
packages/uni-uts-v1/src/tsc/kotlin/index.ts
浏览文件 @
c13bf9e1
import
fs
from
'
fs-extra
'
import
path
from
'
path
'
import
{
extend
}
from
'
@vue/shared
'
import
type
{
CompilerOptions
,
SemanticDiagnosticsBuilderProgram
,
...
...
@@ -10,7 +9,6 @@ import {
SourceMapConsumer
,
SourceMapGenerator
,
}
from
'
source-map-js
'
import
{
createBasicUtsOptions
}
from
'
../utils/options
'
import
{
isInHBuilderX
,
normalizePath
}
from
'
../../shared
'
export
interface
UTS2KotlinOptions
{
...
...
@@ -18,6 +16,7 @@ export interface UTS2KotlinOptions {
inputDir
:
string
cacheDir
:
string
outputDir
:
string
hxLanguageServiceDir
?:
string
tsconfig
?:
string
rootFiles
?:
string
[]
compilerOptions
?:
CompilerOptions
...
...
@@ -34,41 +33,68 @@ export function runUTS2Kotlin(
):
{
watcher
?:
WatchProgramHelper
}
{
const
{
/* check, noCache, */
tsconfig
,
typescript
,
tsconfigOverride
}
=
createBasicUtsOptions
(
options
.
inputDir
)
const
kotlinTypesPath
=
path
.
resolve
(
__dirname
,
'
../../../lib/kotlin/types
'
)
const
rootFiles
:
string
[]
=
[
path
.
resolve
(
kotlinTypesPath
,
'
global.d.ts
'
)]
;[
'
env.d.ts
'
,
'
shim-uni.d.ts
'
,
'
shim-dom.d.ts
'
,
'
global.d.ts
'
].
forEach
(
(
file
)
=>
{
rootFiles
.
push
(
path
.
resolve
(
__dirname
,
'
../../../lib/tsconfig
'
,
file
))
}
)
rootFiles
.
push
(
path
.
resolve
(
options
.
inputDir
,
'
main.uts.ts
'
))
const
pluginPath
=
isInHBuilderX
()
?
process
.
env
.
UNI_HBUILDERX_PLUGINS
:
path
.
resolve
(
process
.
cwd
(),
'
../
'
)
const
nodeModulesPath
=
path
.
resolve
(
const
hbxLanguageServicePath
=
path
.
resolve
(
pluginPath
,
'
hbuilderx-language-services/builtin-dts
/uniappx/node_modules
'
'
hbuilderx-language-services/builtin-dts
'
)
const
kotlinTypesPath
=
path
.
resolve
(
__dirname
,
'
../../../lib/kotlin/types
'
)
const
rootFiles
:
string
[]
=
[
path
.
resolve
(
kotlinTypesPath
,
'
global.d.ts
'
),
path
.
resolve
(
kotlinTypesPath
,
'
env.d.ts
'
),
path
.
resolve
(
hbxLanguageServicePath
,
'
uts-types/common/index.d.ts
'
),
//path.resolve(hbxLanguageServicePath, 'uts-types/app-android/index.d.ts'),
path
.
resolve
(
hbxLanguageServicePath
,
'
common/HBuilderX.d.ts
'
),
path
.
resolve
(
hbxLanguageServicePath
,
'
uniappx/node_modules/@dcloudio/uni-app-x/types/index.d.ts
'
),
path
.
resolve
(
hbxLanguageServicePath
,
'
uniappx/node_modules/@vue/global.d.ts
'
),
]
rootFiles
.
push
(
path
.
resolve
(
options
.
inputDir
,
'
main.uts.ts
'
))
const
vueRuntimeDts
=
[
path
.
resolve
(
nodeModulesPath
,
'
@vue/runtime-core/index.d.ts
'
),
path
.
resolve
(
hbxLanguageServicePath
,
'
uniappx/node_modules/@vue/runtime-core/index.d.ts
'
),
]
extend
(
tsconfigOverride
.
compilerOptions
.
paths
,
{
'
@dcloudio/uni-runtime
'
:
[
path
.
resolve
(
kotlinTypesPath
,
'
@dcloudio/uni-runtime/dist/uni-runtime.d.ts
'
),
],
'
@vue/reactivity
'
:
[
path
.
resolve
(
nodeModulesPath
,
'
@vue/reactivity/dist/reactivity.d.ts
'
),
],
'
@vue/runtime-core
'
:
vueRuntimeDts
,
vue
:
vueRuntimeDts
,
})
const
typescript
=
require
(
'
../../../lib/typescript
'
)
const
compilerOptions
:
CompilerOptions
=
{
rootDir
:
options
.
inputDir
,
baseUrl
:
options
.
inputDir
,
outDir
:
options
.
outputDir
,
noLib
:
true
,
noImplicitAny
:
false
,
useDefineForClassFields
:
false
,
sourceMap
:
process
.
env
.
NODE_ENV
===
'
development
'
,
inlineSources
:
true
,
noEmitOnError
:
false
,
typeRoots
:
[],
paths
:
{
'
@dcloudio/uni-runtime
'
:
[
path
.
resolve
(
kotlinTypesPath
,
'
@dcloudio/uni-runtime/dist/uni-runtime.d.ts
'
),
],
'
@vue/reactivity
'
:
[
path
.
resolve
(
hbxLanguageServicePath
,
'
uniappx/node_modules/@vue/reactivity/dist/reactivity.d.ts
'
),
],
'
@vue/runtime-core
'
:
vueRuntimeDts
,
vue
:
vueRuntimeDts
,
},
}
type
RunDevOptions
=
Required
<
UTS2KotlinOptions
&
{
...
...
@@ -88,13 +114,9 @@ export function runUTS2Kotlin(
typescript
,
inputDir
:
options
.
inputDir
,
cacheDir
:
options
.
cacheDir
,
tsconfig
,
rootFiles
,
compilerOptions
:
extend
(
tsconfigOverride
.
compilerOptions
,
{
outDir
:
options
.
outputDir
,
inlineSources
:
true
,
lib
:
[],
}),
hxLanguageServiceDir
:
hbxLanguageServicePath
,
compilerOptions
,
normalizeFileName
:
options
.
normalizeFileName
,
sourceMapCallback
:
(
fileName
,
text
,
writeFile
)
=>
{
const
relativeFileName
=
normalizePath
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录