@kengic/uni 0.7.0 → 0.7.2
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/package.json +1 -1
- package/script/copy-dist-to-android.mjs +44 -0
- package/script/postinstall.mjs +5 -11
- package/lodash-es.ts +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 将打包之后的文件拷贝到 android 项目对应的目录.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 打印日志.
|
|
9
|
+
*
|
|
10
|
+
* @param message 日志消息.
|
|
11
|
+
*/
|
|
12
|
+
function log(message) {
|
|
13
|
+
console.log(`[${new Date(Date.now() + 1000 * 60 * 60 * 8).toISOString().substring(0, 23).replace('T', ' ')}] [@kengic/uni] COPY-DIST-TO-ANDROID | ${message}`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 项目的根目录.
|
|
18
|
+
*/
|
|
19
|
+
const PROJECT_DIR_01 = '../../../../../../..';
|
|
20
|
+
const PROJECT_DIR_02 = '../../../../../..';
|
|
21
|
+
|
|
22
|
+
log(``);
|
|
23
|
+
log(`当前目录 | ${process.cwd()}`);
|
|
24
|
+
|
|
25
|
+
if (!process.argv || !process.argv.length || !process.argv.length < 3) {
|
|
26
|
+
throw new Error(`必须指定参数「appid」`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const appid = process.argv[2];
|
|
30
|
+
if (!appid) {
|
|
31
|
+
throw new Error(`必须指定参数「appid」`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
throw new Error(`参数「appid」${appid}`);
|
|
35
|
+
//region 删除旧的文件,
|
|
36
|
+
//----------------------------------------------------------------------------------------------------
|
|
37
|
+
//----------------------------------------------------------------------------------------------------
|
|
38
|
+
//endregion
|
|
39
|
+
|
|
40
|
+
//region 复制新的文件,
|
|
41
|
+
//----------------------------------------------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
//----------------------------------------------------------------------------------------------------
|
|
44
|
+
//endregion
|
package/script/postinstall.mjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* 安装完成之后, 处理其他任务.
|
|
5
5
|
*/
|
|
6
|
-
function now() {
|
|
7
|
-
return `[${new Date(Date.now() + 1000 * 60 * 60 * 8).toISOString().substring(0, 23).replace('T', ' ')}] [@kengic/uni] POST INSTALL | `;
|
|
8
|
-
}
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* 打印日志.
|
|
@@ -13,7 +10,7 @@ function now() {
|
|
|
13
10
|
* @param message 日志消息.
|
|
14
11
|
*/
|
|
15
12
|
function log(message) {
|
|
16
|
-
console.log(
|
|
13
|
+
console.log(`[${new Date(Date.now() + 1000 * 60 * 60 * 8).toISOString().substring(0, 23).replace('T', ' ')}] [@kengic/uni] POST-INSTALL | ${message}`);
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
/**
|
|
@@ -22,11 +19,11 @@ function log(message) {
|
|
|
22
19
|
const PROJECT_DIR_01 = '../../../../../../..';
|
|
23
20
|
const PROJECT_DIR_02 = '../../../../../..';
|
|
24
21
|
|
|
25
|
-
//region 同步依赖
|
|
26
|
-
//----------------------------------------------------------------------------------------------------
|
|
27
22
|
log(``);
|
|
28
23
|
log(`当前目录 | ${process.cwd()}`);
|
|
29
24
|
|
|
25
|
+
//region 同步依赖
|
|
26
|
+
//----------------------------------------------------------------------------------------------------
|
|
30
27
|
let json01 = null;
|
|
31
28
|
|
|
32
29
|
try {
|
|
@@ -97,10 +94,7 @@ if (json01 && json02) {
|
|
|
97
94
|
text = text.replaceAll("'Run method: open {devtools}, import {outputDir} run.'", "''");
|
|
98
95
|
text = text.replaceAll("'Compiler version: {version}'", "'框架版本: {version}'");
|
|
99
96
|
text = text.replaceAll("'运行方式:打开 {devtools}, 导入 {outputDir} 运行。'", "''");
|
|
100
|
-
text = text.replaceAll(
|
|
101
|
-
"'Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.'",
|
|
102
|
-
"''",
|
|
103
|
-
);
|
|
97
|
+
text = text.replaceAll("'Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.'", "''");
|
|
104
98
|
fs.writeFileSync(filepath, text, {});
|
|
105
99
|
}
|
|
106
100
|
|
package/lodash-es.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'lodash-es';
|