@kengic/uni 0.7.2 → 0.7.3

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 CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@kengic/uni",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "scripts": {
5
5
  "postinstall": "node ./script/postinstall.mjs"
6
6
  },
7
+ "bin": {
8
+ "kg-uni": "./script/cmd.mjs"
9
+ },
7
10
  "dependencies": {
8
11
  "@dcloudio/types": "3.3.3",
9
12
  "@dcloudio/uni-app": "3.0.0-alpha-3080220230428001",
@@ -25,6 +28,7 @@
25
28
  "@vueuse/shared": "8.9.4",
26
29
  "ant-design-vue": "3.2.20",
27
30
  "chalk": "4.1.2",
31
+ "commander": "14.0.2",
28
32
  "dayjs": "1.11.10",
29
33
  "less": "4.1.3",
30
34
  "lodash-es": "4.17.22",
package/script/cmd.mjs ADDED
@@ -0,0 +1,39 @@
1
+ import { Command } from 'commander';
2
+
3
+ const program = new Command();
4
+
5
+ /**
6
+ * 打印日志.
7
+ *
8
+ * @param message 日志消息.
9
+ */
10
+ function log(message) {
11
+ console.log(`[${new Date(Date.now() + 1000 * 60 * 60 * 8).toISOString().substring(0, 23).replace('T', ' ')}] [@kengic/uni] COPY-DIST-TO-ANDROID | ${message}`);
12
+ }
13
+
14
+ async function execute() {
15
+ try {
16
+ program
17
+ .command('copy-dist-to-android')
18
+ .description('COPY DIST TO ANDROID')
19
+ .option('--appid <appid>', 'APPID', '')
20
+ .action(async (args) => {
21
+ try {
22
+ log(``);
23
+ log(`当前目录 | ${process.cwd()}`);
24
+ log(`args | ${args}`);
25
+
26
+ // TODO LT
27
+ log('复制成功');
28
+ } catch (e) {
29
+ console.log(e);
30
+ }
31
+ });
32
+
33
+ program.parse(process.argv);
34
+ } catch (e) {
35
+ console.error(e.stack);
36
+ }
37
+ }
38
+
39
+ export { execute };
@@ -1,44 +0,0 @@
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