Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yangkaifeng
uni-app
提交
72ea400d
U
uni-app
项目概览
yangkaifeng
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
72ea400d
编写于
10月 20, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): compiler
上级
48358b7c
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
150 addition
and
122 deletion
+150
-122
.gitignore
.gitignore
+2
-1
packages/uni-app-plus/build.json
packages/uni-app-plus/build.json
+1
-1
packages/uni-app-plus/dist/uni.compiler.js
packages/uni-app-plus/dist/uni.compiler.js
+1
-3
packages/uni-app-plus/dist/uni.runtime.esm.js
packages/uni-app-plus/dist/uni.runtime.esm.js
+27
-30
packages/uni-app-plus/package.json
packages/uni-app-plus/package.json
+1
-2
packages/uni-app-plus/src/compiler/index.ts
packages/uni-app-plus/src/compiler/index.ts
+1
-2
packages/uni-app-vite/src/index.ts
packages/uni-app-vite/src/index.ts
+2
-0
packages/uni-app-vite/src/plugins/uts.ts
packages/uni-app-vite/src/plugins/uts.ts
+13
-5
packages/uni-cli-shared/package.json
packages/uni-cli-shared/package.json
+1
-0
packages/uni-cli-shared/src/hbx/env.ts
packages/uni-cli-shared/src/hbx/env.ts
+1
-1
packages/uni-cli-shared/src/resolve.ts
packages/uni-cli-shared/src/resolve.ts
+13
-0
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+61
-44
packages/uni-uts-vite/dist/index.d.ts
packages/uni-uts-vite/dist/index.d.ts
+0
-2
packages/uni-uts-vite/dist/index.js
packages/uni-uts-vite/dist/index.js
+0
-4
packages/uni-uts-vite/src/index.ts
packages/uni-uts-vite/src/index.ts
+0
-3
packages/uni-uts/package.json
packages/uni-uts/package.json
+4
-11
packages/uni-uts/src/index.ts
packages/uni-uts/src/index.ts
+1
-0
packages/uni-uts/src/v1/code.ts
packages/uni-uts/src/v1/code.ts
+1
-1
packages/uni-uts/src/v1/index.ts
packages/uni-uts/src/v1/index.ts
+2
-1
packages/uni-uts/src/v1/kotlin.ts
packages/uni-uts/src/v1/kotlin.ts
+8
-3
packages/uni-uts/src/v1/swift.ts
packages/uni-uts/src/v1/swift.ts
+1
-1
packages/uni-uts/src/v1/utils.ts
packages/uni-uts/src/v1/utils.ts
+1
-1
packages/uni-uts/tsconfig.json
packages/uni-uts/tsconfig.json
+0
-0
packages/uni-uts/types/types.d.ts
packages/uni-uts/types/types.d.ts
+0
-0
pnpm-lock.yaml
pnpm-lock.yaml
+6
-4
scripts/utils.js
scripts/utils.js
+2
-2
未找到文件。
.gitignore
浏览文件 @
72ea400d
...
...
@@ -8,7 +8,8 @@ packages/uni-mp-compiler/dist
packages/uni-nvue-styler/dist
packages/vite-plugin-uni/dist
packages/uts/dist
packages/uni-uts-vite/dist
packages/uni-uts/dist
.DS_Store
node_modules
...
...
packages/uni-app-plus/build.json
浏览文件 @
72ea400d
...
...
@@ -6,7 +6,7 @@
"output"
:
{
"format"
:
"cjs"
},
"external"
:
[
"@dcloudio/uni-app-vite"
,
"@dcloudio/uni-uts-vite"
]
"external"
:
[
"@dcloudio/uni-app-vite"
]
},
{
"input"
:
{
...
...
packages/uni-app-plus/dist/uni.compiler.js
浏览文件 @
72ea400d
'
use strict
'
;
var
appVite
=
require
(
'
@dcloudio/uni-app-vite
'
);
var
utsVite
=
require
(
'
@dcloudio/uni-uts-vite
'
);
function
_interopDefaultLegacy
(
e
)
{
return
e
&&
typeof
e
===
'
object
'
&&
'
default
'
in
e
?
e
:
{
'
default
'
:
e
};
}
var
appVite__default
=
/*#__PURE__*/
_interopDefaultLegacy
(
appVite
);
var
utsVite__default
=
/*#__PURE__*/
_interopDefaultLegacy
(
utsVite
);
var
index
=
[
appVite__default
[
"
default
"
]
,
utsVite__default
[
"
default
"
]
];
var
index
=
[
appVite__default
[
"
default
"
]];
module
.
exports
=
index
;
packages/uni-app-plus/dist/uni.runtime.esm.js
浏览文件 @
72ea400d
...
...
@@ -12160,7 +12160,7 @@ const StartLocationUpdateOptions = {
type(value, params) {
value = (value || '').toLowerCase();
if (coordTypes.indexOf(value) === -1) {
params.type = coordTypes[
0
];
params.type = coordTypes[
1
];
}
else {
params.type = value;
...
...
@@ -16173,42 +16173,39 @@ const openLocation = defineAsyncApi(API_OPEN_LOCATION, (data, { resolve, reject
return resolve();
}, OpenLocationProtocol, OpenLocationOptions);
let started = false;
let watchId = 0;
/**
* 开始更新定位
*/
const startLocationUpdate = defineAsyncApi(API_START_LOCATION_UPDATE, (_, { resolve, reject }
) => {
if (plus.geolocation && watchId === 0) {
watchId = plus.geolocation.watchPosition((res) => {
UniServiceJSBridge.invokeOnCallback(API_ON_LOCATION_CHANGE, res.coords);
resolve();
}, (error) => {
reject(error.message)
;
}, {
coordsType: _ === null || _ === void 0 ? void 0 : _.type,
});
}
else
{
UniServiceJSBridge.invokeOnCallback(API_ON_LOCATION_CHANGE_ERROR, 'onLocationChange:fail');
}
resolve(
);
const startLocationUpdate = defineAsyncApi(API_START_LOCATION_UPDATE, (options, { resolve, reject }) => {
watchId =
watchId ||
plus.geolocation.watchPosition((res
) => {
started = true;
UniServiceJSBridge.invokeOnCallback(API_ON_LOCATION_CHANGE, res.coords);
}, (error) => {
if (!started) {
reject(error.message);
started = true
;
}
UniServiceJSBridge.invokeOnCallback(API_ON_LOCATION_CHANGE_ERROR, {
errMsg: `onLocationChange:fail ${error.message}`,
});
},
{
coordsType: options === null || options === void 0 ? void 0 : options.type,
});
setTimeout(resolve, 100
);
}, StartLocationUpdateProtocol, StartLocationUpdateOptions);
const onLocationChange = defineOnApi(API_ON_LOCATION_CHANGE, () => { });
const stopLocationUpdate = defineAsyncApi(API_STOP_LOCATION_UPDATE, (_, { resolve, reject }) => {
const stopLocationUpdate = defineAsyncApi(API_STOP_LOCATION_UPDATE, (_, { resolve }) => {
if (watchId) {
plus.geolocation.clearWatch(watchId);
started = false;
watchId = 0;
resolve();
}
else {
reject('stopLocationUpdate:fail');
}
resolve();
});
const offLocationChange = defineOffApi(API_OFF_LOCATION_CHANGE, () => {
stopLocationUpdate();
});
const onLocationChange = defineOnApi(API_ON_LOCATION_CHANGE, () => { });
const offLocationChange = defineOffApi(API_OFF_LOCATION_CHANGE, () => { });
const onLocationChangeError = defineOnApi(API_ON_LOCATION_CHANGE_ERROR, () => { });
const offLocationChangeError = defineO
n
Api(API_OFF_LOCATION_CHANGE_ERROR, () => { });
const offLocationChangeError = defineO
ff
Api(API_OFF_LOCATION_CHANGE_ERROR, () => { });
const showModal = defineAsyncApi(API_SHOW_MODAL, ({ title = '', content = '', showCancel = true, cancelText, cancelColor, confirmText, confirmColor, editable = false, placeholderText = '', } = {}, { resolve }) => {
const buttons = showCancel ? [cancelText, confirmText] : [confirmText];
...
...
@@ -19431,8 +19428,8 @@ var uni$1 = {
chooseLocation: chooseLocation,
openLocation: openLocation,
startLocationUpdate: startLocationUpdate,
onLocationChange: onLocationChange,
stopLocationUpdate: stopLocationUpdate,
onLocationChange: onLocationChange,
offLocationChange: offLocationChange,
onLocationChangeError: onLocationChangeError,
offLocationChangeError: offLocationChangeError,
...
...
packages/uni-app-plus/package.json
浏览文件 @
72ea400d
...
...
@@ -42,7 +42,6 @@
},
"dependencies"
:
{
"@dcloudio/uni-app-vite"
:
"3.0.0-alpha-3060720221018002"
,
"@dcloudio/uni-app-vue"
:
"3.0.0-alpha-3060720221018002"
,
"@dcloudio/uni-uts-vite"
:
"3.0.0-alpha-3060720221018002"
"@dcloudio/uni-app-vue"
:
"3.0.0-alpha-3060720221018002"
}
}
packages/uni-app-plus/src/compiler/index.ts
浏览文件 @
72ea400d
import
appVite
from
'
@dcloudio/uni-app-vite
'
import
utsVite
from
'
@dcloudio/uni-uts-vite
'
export
default
[
appVite
,
utsVite
]
export
default
[
appVite
]
packages/uni-app-vite/src/index.ts
浏览文件 @
72ea400d
import
{
initVuePlugins
}
from
'
./vue
'
import
{
initNVuePlugins
}
from
'
./nvue
'
import
{
uniAppPlugin
}
from
'
./plugin
'
import
{
uniUtsV1Plugin
}
from
'
./plugins/uts
'
export
default
()
=>
{
return
[
uniAppPlugin
({
renderer
:
process
.
env
.
UNI_RENDERER
,
appService
:
process
.
env
.
UNI_RENDERER_NATIVE
===
'
appService
'
,
}),
uniUtsV1Plugin
(),
...(
process
.
env
.
UNI_COMPILER
===
'
nvue
'
?
initNVuePlugins
()
:
initVuePlugins
()),
...
...
packages/uni-
uts-vite/src/plugins/v1
.ts
→
packages/uni-
app-vite/src/plugins/uts
.ts
浏览文件 @
72ea400d
import
type
{
Plugin
}
from
'
vite
'
import
path
from
'
path
'
import
{
parseVueRequest
,
resolveUtsAppModule
}
from
'
@dcloudio/uni-cli-shared
'
import
{
getCompiler
,
genProxyCode
}
from
'
../utils/compiler
'
import
{
resolvePackage
}
from
'
../utils/compiler/utils
'
import
{
resolvePlatformIndex
,
resolveRootIndex
}
from
'
../utils/compiler/code
'
import
{
parseVueRequest
,
resolveUtsAppModule
,
resolveUTSCompiler
,
}
from
'
@dcloudio/uni-cli-shared
'
const
UTSProxyRE
=
/
\?
uts-proxy$/
...
...
@@ -41,6 +41,14 @@ export function uniUtsV1Plugin(): Plugin {
}
const
{
filename
:
module
}
=
parseVueRequest
(
id
.
replace
(
'
\
0
'
,
''
))
const
{
getCompiler
,
genProxyCode
,
resolvePackage
,
resolvePlatformIndex
,
resolveRootIndex
,
}
=
resolveUTSCompiler
().
v1
const
pkg
=
resolvePackage
(
module
)
if
(
!
pkg
)
{
return
...
...
packages/uni-cli-shared/package.json
浏览文件 @
72ea400d
...
...
@@ -64,6 +64,7 @@
},
"gitHead"
:
"33e807d66e1fe47e2ee08ad9c59247e37b8884da"
,
"devDependencies"
:
{
"@dcloudio/uni-uts"
:
"3.0.0-alpha-3060720221018002"
,
"@types/babel__core"
:
"^7.1.19"
,
"@types/debug"
:
"^4.1.7"
,
"@types/estree"
:
"^0.0.51"
,
...
...
packages/uni-cli-shared/src/hbx/env.ts
浏览文件 @
72ea400d
...
...
@@ -19,7 +19,7 @@ export const isInHBuilderX = once(() => {
})
export
const
runByHBuilderX
=
once
(()
=>
{
return
!!
process
.
env
.
UNI_HBUILDERX_PLUGINS
return
!!
process
.
env
.
UNI_HBUILDERX_PLUGINS
&&
!!
process
.
env
.
RUN_BY_HBUILDERX
})
/**
...
...
packages/uni-cli-shared/src/resolve.ts
浏览文件 @
72ea400d
...
...
@@ -4,6 +4,7 @@ import path from 'path'
import
debug
from
'
debug
'
import
resolve
from
'
resolve
'
import
{
once
}
from
'
@dcloudio/uni-shared
'
import
*
as
UTSCompiler
from
'
@dcloudio/uni-uts
'
import
{
normalizePath
}
from
'
./utils
'
import
{
isInHBuilderX
}
from
'
./hbx/env
'
...
...
@@ -198,3 +199,15 @@ function resolveUtsFile(
}
}
}
export
function
resolveUTSCompiler
():
typeof
UTSCompiler
{
if
(
isInHBuilderX
())
{
return
require
(
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
uniapp-uts
'
))
}
return
require
(
require
.
resolve
(
'
@dcloudio/uni-uts
'
,
{
paths
:
[
process
.
env
.
UNI_CLI_CONTEXT
],
}))
}
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
72ea400d
...
...
@@ -5744,7 +5744,7 @@ const StartLocationUpdateOptions = {
type(value, params) {
value = (value || "").toLowerCase();
if (coordTypes.indexOf(value) === -1) {
params.type = coordTypes[
0
];
params.type = coordTypes[
1
];
} else {
params.type = value;
}
...
...
@@ -16593,13 +16593,16 @@ function translateGeo(type, coords, skip) {
},
(res) => {
if ("detail" in res && "points" in res.detail && res.detail.points.length) {
const location2 = res.detail.points[0];
resolve(
extend({}, coords, {
longitude: location2.lng,
latitude: location2.lat
})
);
const { lng, lat } = res.detail.points[0];
resolve({
longitude: lng,
latitude: lat,
altitude: coords.altitude,
accuracy: coords.accuracy,
altitudeAccuracy: coords.altitudeAccuracy,
heading: coords.heading,
speed: coords.speed
});
} else {
resolve(coords);
}
...
...
@@ -16617,12 +16620,15 @@ function translateGeo(type, coords, skip) {
(_, res) => {
if (res.info === "ok" && res.locations.length) {
const { lat, lng } = res.locations[0];
resolve(
extend({}, coords, {
longitude: lng,
latitude: lat
})
);
resolve({
longitude: lng,
latitude: lat,
altitude: coords.altitude,
accuracy: coords.accuracy,
altitudeAccuracy: coords.altitudeAccuracy,
heading: coords.heading,
speed: coords.speed
});
} else {
resolve(coords);
}
...
...
@@ -20290,54 +20296,65 @@ const chooseLocation = /* @__PURE__ */ defineAsyncApi(
},
ChooseLocationProtocol
);
let started = false;
let watchId = 0;
const startLocationUpdate = /* @__PURE__ */ defineAsyncApi(
API_START_LOCATION_UPDATE,
(_, { resolve, reject }) => {
if (navigator.geolocation && watchId === 0) {
watchId = navigator.geolocation.watchPosition(
(res) => {
translateGeo(_ == null ? void 0 : _.type, res.coords).then((coords) => {
UniServiceJSBridge.invokeOnCallback(
API_ON_LOCATION_CHANGE,
coords
);
resolve();
}).catch((error) => {
reject(error.message);
});
},
(error) => {
(options, { resolve, reject }) => {
if (!navigator.geolocation) {
reject();
return;
}
watchId = watchId || navigator.geolocation.watchPosition(
(res) => {
started = true;
translateGeo(options == null ? void 0 : options.type, res.coords).then((coords) => {
UniServiceJSBridge.invokeOnCallback(
API_ON_LOCATION_CHANGE,
coords
);
resolve();
}).catch((error) => {
UniServiceJSBridge.invokeOnCallback(
API_ON_LOCATION_CHANGE_ERROR,
{ errMsg: `onLocationChange:fail ${error.message}` }
);
});
},
(error) => {
if (!started) {
reject(error.message);
started = true;
}
);
}
resolve();
UniServiceJSBridge.invokeOnCallback(API_ON_LOCATION_CHANGE_ERROR, {
errMsg: `onLocationChange:fail ${error.message}`
});
}
);
setTimeout(resolve, 100);
},
StartLocationUpdateProtocol,
StartLocationUpdateOptions
);
const onLocationChange = /* @__PURE__ */ defineOnApi(
API_ON_LOCATION_CHANGE,
() => {
}
);
const stopLocationUpdate = /* @__PURE__ */ defineAsyncApi(
API_STOP_LOCATION_UPDATE,
(_, { resolve
, reject
}) => {
(_, { resolve }) => {
if (watchId) {
navigator.geolocation.clearWatch(watchId);
started = false;
watchId = 0;
resolve();
} else {
reject("stopLocationUpdate:fail");
}
resolve();
}
);
const onLocationChange = /* @__PURE__ */ defineOnApi(
API_ON_LOCATION_CHANGE,
() => {
}
);
const offLocationChange = /* @__PURE__ */ defineOffApi(
API_OFF_LOCATION_CHANGE,
() => {
stopLocationUpdate();
}
);
const onLocationChangeError = /* @__PURE__ */ defineOnApi(
...
...
@@ -20345,7 +20362,7 @@ const onLocationChangeError = /* @__PURE__ */ defineOnApi(
() => {
}
);
const offLocationChangeError = /* @__PURE__ */ defineO
n
Api(
const offLocationChangeError = /* @__PURE__ */ defineO
ff
Api(
API_OFF_LOCATION_CHANGE_ERROR,
() => {
}
...
...
@@ -22377,8 +22394,8 @@ const api = /* @__PURE__ */ Object.defineProperty({
openLocation,
chooseLocation,
startLocationUpdate,
onLocationChange,
stopLocationUpdate,
onLocationChange,
offLocationChange,
onLocationChangeError,
offLocationChangeError,
...
...
packages/uni-uts-vite/dist/index.d.ts
已删除
100644 → 0
浏览文件 @
48358b7c
declare
const
_default
:
import
(
"
vite
"
).
Plugin
[];
export
default
_default
;
packages/uni-uts-vite/dist/index.js
已删除
100644 → 0
浏览文件 @
48358b7c
"
use strict
"
;
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
const
v1_1
=
require
(
"
./plugins/v1
"
);
exports
.
default
=
[(
0
,
v1_1
.
uniUtsV1Plugin
)()];
packages/uni-uts-vite/src/index.ts
已删除
100644 → 0
浏览文件 @
48358b7c
import
{
uniUtsV1Plugin
}
from
'
./plugins/v1
'
export
default
[
uniUtsV1Plugin
()]
packages/uni-uts
-vite
/package.json
→
packages/uni-uts/package.json
浏览文件 @
72ea400d
{
"name"
:
"@dcloudio/uni-uts
-vite
"
,
"name"
:
"@dcloudio/uni-uts"
,
"version"
:
"3.0.0-alpha-3060720221018002"
,
"description"
:
"uni-uts
-vite
"
,
"description"
:
"uni-uts"
,
"main"
:
"dist/index.js"
,
"types"
:
"dist/index.d.ts"
,
"files"
:
[
...
...
@@ -10,24 +10,17 @@
"repository"
:
{
"type"
:
"git"
,
"url"
:
"git+https://github.com/dcloudio/uni-app.git"
,
"directory"
:
"packages/uni-uts
-vite
"
"directory"
:
"packages/uni-uts"
},
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"license"
:
"Apache-2.0"
,
"uni-app"
:
{
"name"
:
"uts"
,
"title"
:
"uts"
,
"apply"
:
[
"app"
],
"main"
:
"dist/index.js"
},
"dependencies"
:
{
"@dcloudio/uni-cli-shared"
:
"3.0.0-alpha-3060720221018002"
,
"@dcloudio/uni-shared"
:
"3.0.0-alpha-3060720221018002"
,
"@dcloudio/uts"
:
"3.0.0-alpha-3060720221018002"
,
"@vue/shared"
:
"3.2.41"
,
"adm-zip"
:
"^0.5.9"
,
"execa"
:
"^5.1.1"
,
"fast-glob"
:
"^3.2.11"
,
...
...
packages/uni-uts/src/index.ts
0 → 100644
浏览文件 @
72ea400d
export
*
as
v1
from
'
./v1
'
packages/uni-uts
-vite/src/utils/compiler
/code.ts
→
packages/uni-uts
/src/v1
/code.ts
浏览文件 @
72ea400d
...
...
@@ -14,7 +14,7 @@ import {
Param
,
TsTypeAnnotation
,
VariableDeclaration
,
}
from
'
../../
../
types/types
'
}
from
'
../../types/types
'
import
{
createResolveTypeReferenceName
}
from
'
./utils
'
interface
GenProxyCodeOptions
{
...
...
packages/uni-uts
-vite/src/utils/compiler
/index.ts
→
packages/uni-uts
/src/v1
/index.ts
浏览文件 @
72ea400d
import
{
runKotlinProd
,
runKotlinDev
}
from
'
./kotlin
'
import
{
runSwiftProd
,
runSwiftDev
}
from
'
./swift
'
export
{
genProxyCode
}
from
'
./code
'
export
{
genProxyCode
,
resolvePlatformIndex
,
resolveRootIndex
}
from
'
./code
'
export
{
resolvePackage
}
from
'
./utils
'
export
function
getCompiler
(
type
:
'
kotlin
'
|
'
swift
'
)
{
if
(
type
===
'
swift
'
)
{
return
{
...
...
packages/uni-uts
-vite/src/utils/compiler
/kotlin.ts
→
packages/uni-uts
/src/v1
/kotlin.ts
浏览文件 @
72ea400d
...
...
@@ -9,6 +9,7 @@ import {
isInHBuilderX
,
normalizePath
,
resolveSourceMapPath
,
runByHBuilderX
,
}
from
'
@dcloudio/uni-cli-shared
'
import
{
genUTSPlatformResource
,
...
...
@@ -19,7 +20,7 @@ import {
resolveUTSPlatformFile
,
resolveUTSSourceMapPath
,
}
from
'
./utils
'
import
{
Module
}
from
'
../../
../
types/types
'
import
{
Module
}
from
'
../../types/types
'
export
function
createKotlinResolveTypeReferenceName
(
_namespace
:
string
,
...
...
@@ -111,7 +112,7 @@ function resolveSourceMapFile(outputDir: string, kotlinFile: string) {
async
function
compile
(
filename
:
string
)
{
if
(
!
process
.
env
.
UNI_HBUILDERX_PLUGINS
)
{
return
return
console
.
error
(
'
process.env.UNI_HBUILDERX_PLUGINS is not found
'
)
}
const
{
bundle
,
UtsTarget
}
=
getUtsCompiler
()
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
...
...
@@ -238,7 +239,11 @@ const getCompilerServer = ():
// eslint-disable-next-line no-restricted-globals
return
require
(
compilerServerPath
)
}
else
{
installHBuilderXPlugin
(
'
uniapp-runextension
'
)
if
(
runByHBuilderX
())
{
installHBuilderXPlugin
(
'
uniapp-runextension
'
)
}
else
{
console
.
error
(
compilerServerPath
+
'
is not found
'
)
}
}
return
false
...
...
packages/uni-uts
-vite/src/utils/compiler
/swift.ts
→
packages/uni-uts
/src/v1
/swift.ts
浏览文件 @
72ea400d
...
...
@@ -40,7 +40,7 @@ export async function runSwiftDev(_filename: string) {}
async
function
compile
(
filename
:
string
)
{
if
(
!
process
.
env
.
UNI_HBUILDERX_PLUGINS
)
{
return
return
console
.
error
(
'
process.env.UNI_HBUILDERX_PLUGINS is not found
'
)
}
const
{
bundle
,
UtsTarget
}
=
getUtsCompiler
()
const
inputDir
=
process
.
env
.
UNI_INPUT_DIR
...
...
packages/uni-uts
-vite/src/utils/compiler
/utils.ts
→
packages/uni-uts
/src/v1
/utils.ts
浏览文件 @
72ea400d
...
...
@@ -3,7 +3,7 @@ import fs from 'fs-extra'
import
type
{
parse
,
bundle
,
UtsTarget
}
from
'
@dcloudio/uts
'
import
{
normalizePath
,
resolveSourceMapPath
}
from
'
@dcloudio/uni-cli-shared
'
import
{
camelize
,
capitalize
}
from
'
@vue/shared
'
import
{
Module
,
ModuleItem
}
from
'
../../
../
types/types
'
import
{
Module
,
ModuleItem
}
from
'
../../types/types
'
export
function
resolveUTSSourceMapPath
(
_filename
:
string
)
{
return
resolveSourceMapPath
()
...
...
packages/uni-uts
-vite
/tsconfig.json
→
packages/uni-uts/tsconfig.json
浏览文件 @
72ea400d
文件已移动
packages/uni-uts
-vite
/types/types.d.ts
→
packages/uni-uts/types/types.d.ts
浏览文件 @
72ea400d
文件已移动
pnpm-lock.yaml
浏览文件 @
72ea400d
...
...
@@ -192,7 +192,6 @@ importers:
'
@dcloudio/uni-h5'
:
3.0.0-alpha-3060720221018002
'
@dcloudio/uni-i18n'
:
3.0.0-alpha-3060720221018002
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3060720221018002
'
@dcloudio/uni-uts-vite'
:
3.0.0-alpha-3060720221018002
'
@types/pako'
:
1.0.2
'
@vue/compiler-sfc'
:
3.2.41
autoprefixer
:
^10.4.12
...
...
@@ -202,7 +201,6 @@ importers:
dependencies
:
'
@dcloudio/uni-app-vite'
:
link:../uni-app-vite
'
@dcloudio/uni-app-vue'
:
link:../uni-app-vue
'
@dcloudio/uni-uts-vite'
:
link:../uni-uts-vite
devDependencies
:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-components'
:
link:../uni-components
...
...
@@ -306,6 +304,7 @@ importers:
'
@babel/types'
:
^7.17.0
'
@dcloudio/uni-i18n'
:
3.0.0-alpha-3060720221018002
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3060720221018002
'
@dcloudio/uni-uts'
:
3.0.0-alpha-3060720221018002
'
@intlify/core-base'
:
9.1.9
'
@intlify/shared'
:
9.1.9
'
@intlify/vue-devtools'
:
9.1.9
...
...
@@ -395,6 +394,7 @@ importers:
tapable
:
2.2.1
xregexp
:
3.1.0
devDependencies
:
'
@dcloudio/uni-uts'
:
link:../uni-uts
'
@types/babel__core'
:
7.1.19
'
@types/debug'
:
4.1.7
'
@types/estree'
:
0.0.51
...
...
@@ -799,13 +799,14 @@ importers:
devDependencies
:
'
@types/debug'
:
4.1.7
packages/uni-uts
-vite
:
packages/uni-uts
:
specifiers
:
'
@dcloudio/uni-cli-shared'
:
3.0.0-alpha-3060720221018002
'
@dcloudio/uni-shared'
:
3.0.0-alpha-3060720221018002
'
@dcloudio/uts'
:
3.0.0-alpha-3060720221018002
'
@types/adm-zip'
:
^0.5.0
'
@types/fs-extra'
:
^9.0.13
'
@vue/shared'
:
3.2.41
adm-zip
:
^0.5.9
execa
:
^5.1.1
fast-glob
:
^3.2.11
...
...
@@ -814,6 +815,7 @@ importers:
'
@dcloudio/uni-cli-shared'
:
link:../uni-cli-shared
'
@dcloudio/uni-shared'
:
link:../uni-shared
'
@dcloudio/uts'
:
link:../uts
'
@vue/shared'
:
3.2.41
adm-zip
:
0.5.9
execa
:
5.1.1
fast-glob
:
3.2.12
...
...
@@ -5347,7 +5349,7 @@ packages:
resolution
:
{
integrity
:
sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
}
/graceful-fs/4.2.9
:
resolution
:
{
integrity
:
sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
,
registry
:
https
:
//registry.yarnpkg.com/
}
resolution
:
{
integrity
:
sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
,
registry
:
https
:
//registry.yarnpkg.com/
,
tarball
:
https
:
//registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz
}
dev
:
true
/has-flag/3.0.0
:
...
...
scripts/utils.js
浏览文件 @
72ea400d
...
...
@@ -32,8 +32,8 @@ const priority = {
'
uni-cloud
'
:
10
,
'
uni-automator
'
:
10
,
uts
:
10
,
'
uni-uts
-vite
'
:
9
,
'
uni-stacktracey
'
:
9
,
'
uni-uts
'
:
9
,
'
uni-stacktracey
'
:
8
,
'
size-check
'
:
0
,
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录