Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
b4262a9a
U
uni-app
项目概览
DCloud
/
uni-app
13 天 前同步成功
通知
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看板
提交
b4262a9a
编写于
9月 25, 2023
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): compiler
上级
a3744a70
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
40 addition
and
9 deletion
+40
-9
packages/uni-cli-shared/src/constants.ts
packages/uni-cli-shared/src/constants.ts
+6
-2
packages/uni-cli-shared/src/utils.ts
packages/uni-cli-shared/src/utils.ts
+10
-3
packages/uni-uts-v1/src/kotlin.ts
packages/uni-uts-v1/src/kotlin.ts
+14
-1
packages/uts-darwin-arm64/uts.darwin-arm64.node
packages/uts-darwin-arm64/uts.darwin-arm64.node
+0
-0
packages/uts-darwin-x64/uts.darwin-x64.node
packages/uts-darwin-x64/uts.darwin-x64.node
+0
-0
packages/uts-linux-x64-gnu/uts.linux-x64-gnu.node
packages/uts-linux-x64-gnu/uts.linux-x64-gnu.node
+0
-0
packages/uts-linux-x64-musl/uts.linux-x64-musl.node
packages/uts-linux-x64-musl/uts.linux-x64-musl.node
+0
-0
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
+0
-0
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
+0
-0
packages/vite-plugin-uni/src/cli/build.ts
packages/vite-plugin-uni/src/cli/build.ts
+4
-1
packages/vite-plugin-uni/src/index.ts
packages/vite-plugin-uni/src/index.ts
+2
-1
packages/vite-plugin-uni/src/utils/polyfill.ts
packages/vite-plugin-uni/src/utils/polyfill.ts
+4
-1
未找到文件。
packages/uni-cli-shared/src/constants.ts
浏览文件 @
b4262a9a
export
const
PUBLIC_DIR
=
'
static
'
export
const
EXTNAME_JS
=
[
'
.js
'
,
'
.ts
'
,
'
.jsx
'
,
'
.tsx
'
]
export
const
EXTNAME_TS
=
[
'
.ts
'
,
'
.tsx
'
]
export
const
EXTNAME_VUE
=
[
'
.vue
'
,
'
.nvue
'
]
export
const
EXTNAME_VUE_TEMPLATE
=
[
'
.vue
'
,
'
.nvue
'
,
'
.jsx
'
,
'
.tsx
'
]
export
const
EXTNAME_VUE
=
[
'
.vue
'
,
'
.nvue
'
,
'
.uvue
'
]
export
const
X_EXTNAME_VUE
=
[
'
.uvue
'
,
'
.vue
'
]
export
const
EXTNAME_VUE_TEMPLATE
=
[
'
.vue
'
,
'
.nvue
'
,
'
.uvue
'
,
'
.jsx
'
,
'
.tsx
'
]
export
const
EXTNAME_VUE_RE
=
/
\.(
vue|nvue|uvue
)
$/
export
const
EXTNAME_JS_RE
=
/
\.(
js|jsx|ts|tsx|mjs
)
$/
export
const
EXTNAME_TS_RE
=
/
\.
tsx
?
$/
...
...
@@ -41,6 +42,9 @@ export const PAGE_EXTNAME_APP = ['.nvue', '.vue', '.tsx', '.jsx', '.js']
// 其他平台解析页面后缀的优先级
export
const
PAGE_EXTNAME
=
[
'
.vue
'
,
'
.nvue
'
,
'
.tsx
'
,
'
.jsx
'
,
'
.js
'
]
export
const
X_PAGE_EXTNAME
=
[
'
.vue
'
,
'
.uvue
'
,
'
.tsx
'
,
'
.jsx
'
,
'
.js
'
]
export
const
X_PAGE_EXTNAME_APP
=
[
'
.uvue
'
,
'
.tsx
'
,
'
.jsx
'
,
'
.js
'
]
export
const
H5_API_STYLE_PATH
=
'
@dcloudio/uni-h5/style/api/
'
export
const
H5_FRAMEWORK_STYLE_PATH
=
'
@dcloudio/uni-h5/style/framework/
'
export
const
H5_COMPONENTS_STYLE_PATH
=
'
@dcloudio/uni-h5/style/
'
...
...
packages/uni-cli-shared/src/utils.ts
浏览文件 @
b4262a9a
...
...
@@ -4,7 +4,13 @@ import path from 'path'
import
colors
from
'
picocolors
'
import
{
camelize
,
capitalize
}
from
'
@vue/shared
'
export
{
default
as
hash
}
from
'
hash-sum
'
import
{
EXTNAME_TS_RE
,
PAGE_EXTNAME
,
PAGE_EXTNAME_APP
}
from
'
./constants
'
import
{
EXTNAME_TS_RE
,
PAGE_EXTNAME
,
PAGE_EXTNAME_APP
,
X_PAGE_EXTNAME
,
X_PAGE_EXTNAME_APP
,
}
from
'
./constants
'
import
{
NodeTypes
,
...
...
@@ -40,9 +46,10 @@ export function normalizeIdentifier(str: string) {
export
function
normalizePagePath
(
pagePath
:
string
,
platform
:
UniApp
.
PLATFORM
)
{
const
absolutePagePath
=
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
pagePath
)
let
extensions
=
PAGE_EXTNAME
const
isX
=
process
.
env
.
UNI_APP_X
===
'
true
'
let
extensions
=
isX
?
X_PAGE_EXTNAME
:
PAGE_EXTNAME
if
(
platform
===
'
app
'
)
{
extensions
=
PAGE_EXTNAME_APP
extensions
=
isX
?
X_PAGE_EXTNAME_APP
:
PAGE_EXTNAME_APP
}
for
(
let
i
=
0
;
i
<
extensions
.
length
;
i
++
)
{
const
extname
=
extensions
[
i
]
...
...
packages/uni-uts-v1/src/kotlin.ts
浏览文件 @
b4262a9a
...
...
@@ -631,7 +631,20 @@ export function createStderrListener(
let
message
=
data
.
toString
().
trim
()
if
(
message
)
{
try
{
const
messages
=
JSON
.
parse
(
message
)
as
MessageSourceLocation
[]
const
messages
=
(
JSON
.
parse
(
message
)
as
MessageSourceLocation
[]
).
filter
((
msg
)
=>
{
if
(
// 暂时屏蔽 Unchecked cast: Any? to UTSArray<String>
// Unchecked cast: Any to UTSArray<String>
msg
.
type
===
'
warning
'
&&
msg
.
message
.
includes
(
'
Unchecked cast: Any
'
)
&&
msg
.
message
.
includes
(
'
to UTSArray<
'
)
)
{
return
false
}
return
true
})
if
(
messages
.
length
)
{
const
msg
=
await
parseUTSKotlinStacktrace
(
messages
,
{
inputDir
,
...
...
packages/uts-darwin-arm64/uts.darwin-arm64.node
浏览文件 @
b4262a9a
无法预览此类型文件
packages/uts-darwin-x64/uts.darwin-x64.node
浏览文件 @
b4262a9a
无法预览此类型文件
packages/uts-linux-x64-gnu/uts.linux-x64-gnu.node
浏览文件 @
b4262a9a
无法预览此类型文件
packages/uts-linux-x64-musl/uts.linux-x64-musl.node
浏览文件 @
b4262a9a
无法预览此类型文件
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
浏览文件 @
b4262a9a
无法预览此类型文件
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
浏览文件 @
b4262a9a
无法预览此类型文件
packages/vite-plugin-uni/src/cli/build.ts
浏览文件 @
b4262a9a
...
...
@@ -84,7 +84,10 @@ function buildManifestJson() {
const
outputDir
=
process
.
env
.
UNI_OUTPUT_DIR
const
pkg
=
require
(
path
.
resolve
(
__dirname
,
'
../../package.json
'
))
process
.
env
.
UNI_COMPILER_VERSION
=
pkg
[
'
uni-app
'
]?.[
'
compilerVersion
'
]
||
''
process
.
env
.
UNI_COMPILER_VERSION
=
process
.
env
.
UNI_COMPILER_VERSION
||
pkg
[
'
uni-app
'
]?.[
'
compilerVersion
'
]
||
''
initPreContext
(
platform
,
process
.
env
.
UNI_CUSTOM_CONTEXT
,
...
...
packages/vite-plugin-uni/src/index.ts
浏览文件 @
b4262a9a
...
...
@@ -46,7 +46,8 @@ const pkg = require(path.resolve(__dirname, '../package.json'))
initModuleAlias
()
process
.
env
.
UNI_COMPILER_VERSION
=
pkg
[
'
uni-app
'
]?.[
'
compilerVersion
'
]
||
''
process
.
env
.
UNI_COMPILER_VERSION
=
process
.
env
.
UNI_COMPILER_VERSION
||
pkg
[
'
uni-app
'
]?.[
'
compilerVersion
'
]
||
''
process
.
env
.
UNI_COMPILER_VERSION_TYPE
=
pkg
.
version
.
includes
(
'
alpha
'
)
?
'
a
'
:
'
r
'
...
...
packages/vite-plugin-uni/src/utils/polyfill.ts
浏览文件 @
b4262a9a
...
...
@@ -2,6 +2,7 @@ import fs, { PathLike } from 'fs'
import
path
from
'
path
'
import
{
EXTNAME_VUE
,
X_EXTNAME_VUE
,
isInHBuilderX
,
normalizePath
,
resolveBuiltIn
,
...
...
@@ -16,11 +17,13 @@ export function rewriteCompilerSfcParse() {
// @ts-ignore
const
compilerSfc
=
require
(
resolveBuiltIn
(
'
@vue/compiler-sfc
'
))
const
{
parse
}
=
compilerSfc
let
extname_vue
=
process
.
env
.
UNI_APP_X
===
'
true
'
?
X_EXTNAME_VUE
:
EXTNAME_VUE
compilerSfc
.
parse
=
(
source
:
string
,
options
:
SFCParseOptions
)
=>
{
if
(
options
?.
filename
)
{
const
extname
=
path
.
extname
(
options
.
filename
)
// wxs、filter、renderjs
if
(
extname
&&
!
EXTNAME_VUE
.
includes
(
extname
))
{
if
(
extname
&&
!
extname_vue
.
includes
(
extname
))
{
const
tag
=
extname
.
slice
(
1
)
source
=
`<
${
tag
}
>`
+
source
+
`</
${
tag
}
>`
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录