@dcloudio/uts 3.0.0-alpha-5000720260416001 → 3.0.0-alpha-5000820260420001
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.
- package/dist/api.d.ts +3 -0
- package/dist/api.js +47 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -1
- package/dist/types.d.ts +6 -0
- package/package.json +7 -7
package/dist/api.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { ToCppCodeOptions, UTSBundleOptions, UTSOptions, UTSParseOptions, UTSResult } from './types';
|
|
2
2
|
export declare function parse(source: string, options?: UTSParseOptions): Promise<any>;
|
|
3
3
|
export declare function toKotlin(options: UTSOptions): Promise<UTSResult>;
|
|
4
|
+
export declare function toKotlinCode(options: UTSOptions): Promise<string>;
|
|
4
5
|
export declare function bundleKotlin(options: UTSBundleOptions): Promise<UTSResult>;
|
|
5
6
|
export declare function toSwift(options: UTSOptions): Promise<UTSResult>;
|
|
7
|
+
export declare function toSwiftCode(options: UTSOptions): Promise<string>;
|
|
6
8
|
export declare function bundleSwift(options: UTSBundleOptions): Promise<UTSResult>;
|
|
7
9
|
export declare function toArkTS(options: UTSOptions): Promise<UTSResult>;
|
|
10
|
+
export declare function toArkTSCode(options: UTSOptions): Promise<string>;
|
|
8
11
|
export declare function toCpp(options: UTSOptions): Promise<UTSResult>;
|
|
9
12
|
export declare function toCppCode(options: ToCppCodeOptions): Promise<string>;
|
|
10
13
|
export declare function bundleArkTS(options: UTSBundleOptions): Promise<UTSResult>;
|
package/dist/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bundleArkTS = exports.toCppCode = exports.toCpp = exports.toArkTS = exports.bundleSwift = exports.toSwift = exports.bundleKotlin = exports.toKotlin = exports.parse = void 0;
|
|
3
|
+
exports.bundleArkTS = exports.toCppCode = exports.toCpp = exports.toArkTSCode = exports.toArkTS = exports.bundleSwift = exports.toSwiftCode = exports.toSwift = exports.bundleKotlin = exports.toKotlinCode = exports.toKotlin = exports.parse = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
6
|
const bindingsOverride = process.env['UTS_BINARY_PATH'];
|
|
@@ -40,6 +40,13 @@ function resolveOptions(options) {
|
|
|
40
40
|
}
|
|
41
41
|
return options;
|
|
42
42
|
}
|
|
43
|
+
function resolveCodeOptions(options) {
|
|
44
|
+
const { input } = options;
|
|
45
|
+
if (!input?.fileContent) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
return options;
|
|
49
|
+
}
|
|
43
50
|
async function parse(source, options = {}) {
|
|
44
51
|
options.noColor = !!options.noColor;
|
|
45
52
|
return bindings
|
|
@@ -63,6 +70,19 @@ async function toKotlin(options) {
|
|
|
63
70
|
});
|
|
64
71
|
}
|
|
65
72
|
exports.toKotlin = toKotlin;
|
|
73
|
+
async function toKotlinCode(options) {
|
|
74
|
+
const kotlinOptions = resolveCodeOptions(options);
|
|
75
|
+
if (!kotlinOptions) {
|
|
76
|
+
return Promise.resolve('');
|
|
77
|
+
}
|
|
78
|
+
return bindings
|
|
79
|
+
.toKotlinCode(toBuffer(kotlinOptions))
|
|
80
|
+
.then((res) => JSON.parse(res))
|
|
81
|
+
.catch((error) => {
|
|
82
|
+
return { error };
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
exports.toKotlinCode = toKotlinCode;
|
|
66
86
|
async function bundleKotlin(options) {
|
|
67
87
|
const bundleOptions = resolveOptions(options);
|
|
68
88
|
if (!bundleOptions) {
|
|
@@ -89,6 +109,19 @@ async function toSwift(options) {
|
|
|
89
109
|
});
|
|
90
110
|
}
|
|
91
111
|
exports.toSwift = toSwift;
|
|
112
|
+
async function toSwiftCode(options) {
|
|
113
|
+
const swiftOptions = resolveCodeOptions(options);
|
|
114
|
+
if (!swiftOptions) {
|
|
115
|
+
return Promise.resolve('');
|
|
116
|
+
}
|
|
117
|
+
return bindings
|
|
118
|
+
.toSwiftCode(toBuffer(swiftOptions))
|
|
119
|
+
.then((res) => JSON.parse(res))
|
|
120
|
+
.catch((error) => {
|
|
121
|
+
return { error };
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
exports.toSwiftCode = toSwiftCode;
|
|
92
125
|
async function bundleSwift(options) {
|
|
93
126
|
const bundleOptions = resolveOptions(options);
|
|
94
127
|
if (!bundleOptions) {
|
|
@@ -115,6 +148,19 @@ async function toArkTS(options) {
|
|
|
115
148
|
});
|
|
116
149
|
}
|
|
117
150
|
exports.toArkTS = toArkTS;
|
|
151
|
+
async function toArkTSCode(options) {
|
|
152
|
+
const arkTSOptions = resolveCodeOptions(options);
|
|
153
|
+
if (!arkTSOptions) {
|
|
154
|
+
return Promise.resolve('');
|
|
155
|
+
}
|
|
156
|
+
return bindings
|
|
157
|
+
.toArkTSCode(toBuffer(arkTSOptions))
|
|
158
|
+
.then((res) => JSON.parse(res))
|
|
159
|
+
.catch((error) => {
|
|
160
|
+
return { error };
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
exports.toArkTSCode = toArkTSCode;
|
|
118
164
|
async function toCpp(options) {
|
|
119
165
|
const cppOptions = resolveOptions(options);
|
|
120
166
|
if (!cppOptions) {
|
package/dist/index.d.ts
CHANGED
|
@@ -45,5 +45,5 @@ export interface ToOptions {
|
|
|
45
45
|
extname?: string;
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
export { parse, toArkTS, toCpp, toCppCode, toKotlin, toSwift, bundleArkTS, bundleKotlin, bundleSwift, } from './api';
|
|
48
|
+
export { parse, toArkTS, toArkTSCode, toCpp, toCppCode, toKotlin, toKotlinCode, toSwift, toSwiftCode, bundleArkTS, bundleKotlin, bundleSwift, } from './api';
|
|
49
49
|
export declare function bundle(target: UTSTarget, opts: UTSBundleOptions): Promise<UTSResult>;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bundle = exports.bundleSwift = exports.bundleKotlin = exports.bundleArkTS = exports.toSwift = exports.toKotlin = exports.toCppCode = exports.toCpp = exports.toArkTS = exports.parse = exports.UTSTargetExtNames = exports.UTSTarget = void 0;
|
|
3
|
+
exports.bundle = exports.bundleSwift = exports.bundleKotlin = exports.bundleArkTS = exports.toSwiftCode = exports.toSwift = exports.toKotlinCode = exports.toKotlin = exports.toCppCode = exports.toCpp = exports.toArkTSCode = exports.toArkTS = exports.parse = exports.UTSTargetExtNames = exports.UTSTarget = void 0;
|
|
4
4
|
const api_1 = require("./api");
|
|
5
5
|
const types_1 = require("./types");
|
|
6
6
|
var types_2 = require("./types");
|
|
@@ -13,10 +13,13 @@ exports.UTSTargetExtNames = {
|
|
|
13
13
|
var api_2 = require("./api");
|
|
14
14
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return api_2.parse; } });
|
|
15
15
|
Object.defineProperty(exports, "toArkTS", { enumerable: true, get: function () { return api_2.toArkTS; } });
|
|
16
|
+
Object.defineProperty(exports, "toArkTSCode", { enumerable: true, get: function () { return api_2.toArkTSCode; } });
|
|
16
17
|
Object.defineProperty(exports, "toCpp", { enumerable: true, get: function () { return api_2.toCpp; } });
|
|
17
18
|
Object.defineProperty(exports, "toCppCode", { enumerable: true, get: function () { return api_2.toCppCode; } });
|
|
18
19
|
Object.defineProperty(exports, "toKotlin", { enumerable: true, get: function () { return api_2.toKotlin; } });
|
|
20
|
+
Object.defineProperty(exports, "toKotlinCode", { enumerable: true, get: function () { return api_2.toKotlinCode; } });
|
|
19
21
|
Object.defineProperty(exports, "toSwift", { enumerable: true, get: function () { return api_2.toSwift; } });
|
|
22
|
+
Object.defineProperty(exports, "toSwiftCode", { enumerable: true, get: function () { return api_2.toSwiftCode; } });
|
|
20
23
|
Object.defineProperty(exports, "bundleArkTS", { enumerable: true, get: function () { return api_2.bundleArkTS; } });
|
|
21
24
|
Object.defineProperty(exports, "bundleKotlin", { enumerable: true, get: function () { return api_2.bundleKotlin; } });
|
|
22
25
|
Object.defineProperty(exports, "bundleSwift", { enumerable: true, get: function () { return api_2.bundleSwift; } });
|
package/dist/types.d.ts
CHANGED
|
@@ -61,9 +61,14 @@ export type UTSOutputOptions = {
|
|
|
61
61
|
isModule?: boolean;
|
|
62
62
|
isExtApi?: boolean;
|
|
63
63
|
isPureSwift?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* 是否由js驱动,目前仅安卓蒸汽模式使用此选项,用于控制编译插件时是否生成js调用相关的代码,默认值为false
|
|
66
|
+
*/
|
|
67
|
+
isJsDriven?: boolean;
|
|
64
68
|
split?: boolean;
|
|
65
69
|
splitClass?: boolean;
|
|
66
70
|
disableSplitManifest?: boolean;
|
|
71
|
+
disableOpenByDefault?: boolean;
|
|
67
72
|
removeImports?: boolean;
|
|
68
73
|
dropImports?: string[];
|
|
69
74
|
returnExportIdent?: boolean;
|
|
@@ -72,6 +77,7 @@ export type UTSOutputOptions = {
|
|
|
72
77
|
uvueOutDir: string;
|
|
73
78
|
};
|
|
74
79
|
transform?: {
|
|
80
|
+
disableUTSBooleanConversion?: boolean;
|
|
75
81
|
enableSwiftUtsArray?: boolean;
|
|
76
82
|
enableSwiftUtsMap?: boolean;
|
|
77
83
|
enableUtsNumber?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uts",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-5000820260420001",
|
|
4
4
|
"description": "uts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"directory": "packages/uts"
|
|
15
15
|
},
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"@dcloudio/uts-
|
|
18
|
-
"@dcloudio/uts-
|
|
19
|
-
"@dcloudio/uts-
|
|
20
|
-
"@dcloudio/uts-
|
|
21
|
-
"@dcloudio/uts-win32-
|
|
22
|
-
"@dcloudio/uts-
|
|
17
|
+
"@dcloudio/uts-darwin-arm64": "3.0.0-alpha-5000820260420001",
|
|
18
|
+
"@dcloudio/uts-darwin-x64": "3.0.0-alpha-5000820260420001",
|
|
19
|
+
"@dcloudio/uts-linux-x64-gnu": "3.0.0-alpha-5000820260420001",
|
|
20
|
+
"@dcloudio/uts-linux-x64-musl": "3.0.0-alpha-5000820260420001",
|
|
21
|
+
"@dcloudio/uts-win32-ia32-msvc": "3.0.0-alpha-5000820260420001",
|
|
22
|
+
"@dcloudio/uts-win32-x64-msvc": "3.0.0-alpha-5000820260420001"
|
|
23
23
|
}
|
|
24
24
|
}
|