create-meadminjs 1.0.2 → 1.0.4
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/bin/cli.js +0 -0
- package/bin/index.js +0 -0
- package/dist/cli.js +13 -4
- package/package.json +36 -38
- package/template/meadmin/meadmin.sql +24 -10
- package/template/meadmin/packageTemplate.json +4 -4
- package/template/meadmin/src/logger.ts +24 -24
- package/template/meadmin/src/types/mwtsc.d.ts +9 -0
- package/template/meadmin/tsconfig.json +1 -1
- package/template/meadmin/view/admin/dist/.gitkeep +0 -0
- package/template/meadmin/view/index/dist/.gitkeep +0 -0
- package/template/meadmin/view/index/types/auto-imports.d.ts +1 -0
- package/template/meadmin/src/middleware/report.middleware.ts +0 -23
- package/template/meadmin/types/mwtsc.d.ts +0 -9
- package/template/meadmin/view/index/src/store/module.ts +0 -5
- package/template/meadmin/view/index/types/components.d.ts +0 -25
- package/template/meadmin/view/index/types/directives.d.ts +0 -7
- package/template/meadmin/view/index/types/meIconComponents.d.ts +0 -11
package/bin/cli.js
CHANGED
|
File without changes
|
package/bin/index.js
CHANGED
|
File without changes
|
package/dist/cli.js
CHANGED
|
@@ -14,11 +14,18 @@ const copyFiles = {
|
|
|
14
14
|
".vscode/": {},
|
|
15
15
|
"src/": {},
|
|
16
16
|
"test/": {},
|
|
17
|
-
"types/": {},
|
|
18
17
|
"public/admin/": {},
|
|
19
18
|
"public/index/": {},
|
|
20
|
-
"view/admin/": { ignore: [
|
|
21
|
-
|
|
19
|
+
"view/admin/": { ignore: [
|
|
20
|
+
"node_modules",
|
|
21
|
+
".eslintcache",
|
|
22
|
+
"dist"
|
|
23
|
+
] },
|
|
24
|
+
"view/index/": { ignore: [
|
|
25
|
+
"node_modules",
|
|
26
|
+
".eslintcache",
|
|
27
|
+
"dist"
|
|
28
|
+
] },
|
|
22
29
|
".editorconfig": {},
|
|
23
30
|
".env": {},
|
|
24
31
|
".eslintrc.json": {},
|
|
@@ -57,7 +64,9 @@ const copyFiles = {
|
|
|
57
64
|
const makeFiles = {
|
|
58
65
|
"logs/.gitkeep": {},
|
|
59
66
|
"uploadFile/admin/.gitkeep": {},
|
|
60
|
-
"uploadFile/index/.gitkeep": {}
|
|
67
|
+
"uploadFile/index/.gitkeep": {},
|
|
68
|
+
"view/admin/dist/.gitkeep": {},
|
|
69
|
+
"view/index/dist/.gitkeep": {}
|
|
61
70
|
};
|
|
62
71
|
const setMeadminTemplate = (program) => {
|
|
63
72
|
program.command("setMeadminTemplate").description("生成meadmin模板").argument("<file>", "文件夹名称").action(async (file) => {
|
package/package.json
CHANGED
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "create-meadminjs",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"author": "Yuntian001",
|
|
9
|
-
"bin": {
|
|
10
|
-
"create-meadminjs": "bin/index.js",
|
|
11
|
-
"cva": "bin/index.js",
|
|
12
|
-
"create-meadminjs-cli": "bin/cli.js"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"bin",
|
|
16
|
-
"template",
|
|
17
|
-
"dist"
|
|
18
|
-
],
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "create-meadminjs",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Yuntian001",
|
|
9
|
+
"bin": {
|
|
10
|
+
"create-meadminjs": "bin/index.js",
|
|
11
|
+
"cva": "bin/index.js",
|
|
12
|
+
"create-meadminjs-cli": "bin/cli.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin",
|
|
16
|
+
"template",
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@sequelize/core": "7.0.0-alpha.47",
|
|
22
|
+
"@sequelize/postgres": "7.0.0-alpha.47",
|
|
23
|
+
"commander": "^14.0.0",
|
|
24
|
+
"cross-spawn": "^7.0.6",
|
|
25
|
+
"dotenv": "^16.6.1",
|
|
26
|
+
"prettier": "2.8.8"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"tsdown": "^0.20.1"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"dev": "tsdown --watch",
|
|
33
|
+
"build": "tsdown",
|
|
34
|
+
"typecheck": "tsc"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Navicat Premium Data Transfer
|
|
3
3
|
|
|
4
|
-
Source Server : meadmin
|
|
5
4
|
Source Server Type : PostgreSQL
|
|
6
5
|
Source Server Version : 160001
|
|
6
|
+
|
|
7
7
|
Target Server Type : PostgreSQL
|
|
8
8
|
Target Server Version : 160001
|
|
9
9
|
File Encoding : 65001
|
|
10
10
|
|
|
11
|
-
Date:
|
|
11
|
+
Date: 12/02/2026 15:43:10
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
|
|
@@ -108,9 +108,6 @@ CREATE TABLE "example_demo_books" (
|
|
|
108
108
|
-- ----------------------------
|
|
109
109
|
-- Records of example_demo_books
|
|
110
110
|
-- ----------------------------
|
|
111
|
-
INSERT INTO "example_demo_books" VALUES ('1', '664043217833951232');
|
|
112
|
-
INSERT INTO "example_demo_books" VALUES ('2', '664043217833951232');
|
|
113
|
-
INSERT INTO "example_demo_books" VALUES ('3', '664043217833951232');
|
|
114
111
|
|
|
115
112
|
-- ----------------------------
|
|
116
113
|
-- Table structure for example_demo_files
|
|
@@ -163,7 +160,11 @@ COMMENT ON COLUMN "file"."path" IS '路径';
|
|
|
163
160
|
COMMENT ON COLUMN "file"."md5" IS '文件MD5值';
|
|
164
161
|
COMMENT ON TABLE "file" IS '附件表';
|
|
165
162
|
|
|
166
|
-
|
|
163
|
+
-- ----------------------------
|
|
164
|
+
-- Records of file
|
|
165
|
+
-- ----------------------------
|
|
166
|
+
INSERT INTO "file" VALUES ('677056935534526464', 'Krma0Tzl8b.jpg', 'image/jpeg', 27667, 'local', '2026-02-12 15:42:32.541+08', '2026-02-12 15:42:32.541+08', '604612615536115712', '604612615536115712', 'a8aa632b76c334a6c6094b3818bb68a9.jpg', 'a8aa632b76c334a6c6094b3818bb68a9');
|
|
167
|
+
INSERT INTO "file" VALUES ('677056968040382464', 'OIP-C.webp', 'image/webp', 1768, 'local', '2026-02-12 15:42:40.292+08', '2026-02-12 15:42:40.292+08', '604612615536115712', '604612615536115712', 'c43cc289054dd01147070f8223c9cfa1.webp', 'c43cc289054dd01147070f8223c9cfa1');
|
|
167
168
|
|
|
168
169
|
-- ----------------------------
|
|
169
170
|
-- Table structure for role_menu
|
|
@@ -228,8 +229,8 @@ COMMENT ON TABLE "system_admin" IS '管理员表';
|
|
|
228
229
|
-- ----------------------------
|
|
229
230
|
-- Records of system_admin
|
|
230
231
|
-- ----------------------------
|
|
231
|
-
INSERT INTO "system_admin" VALUES ('632899190933946368', 'Test', 'test', 'ec7cb37e4c73af64cd2fd5b7e844ae1b8931acb4b1ebe555f2f2eefe33c831fe', 'de80c6206e17adf184a36c7e0840f01f', NULL, '15555555555', 0, NULL, '', 1, '604612615536115712', '604612615536115712', NULL, '2025-10-13 19:15:25.818+08', '2026-
|
|
232
|
-
INSERT INTO "system_admin" VALUES ('604612615536115712', 'admin', 'Admin', 'e8e51c59da6333bce7a443efc3e8e2e792ac6b5592a70523a16b074ba1dcc3c0', 'd06d09e00fbb3ed98f6ce1f004be912c', 'admin@outlock.com', '13333333333', 0, '2026-
|
|
232
|
+
INSERT INTO "system_admin" VALUES ('632899190933946368', 'Test', 'test', 'ec7cb37e4c73af64cd2fd5b7e844ae1b8931acb4b1ebe555f2f2eefe33c831fe', 'de80c6206e17adf184a36c7e0840f01f', NULL, '15555555555', 0, NULL, '', 1, '604612615536115712', '604612615536115712', NULL, '2025-10-13 19:15:25.818+08', '2026-02-12 15:42:33.751+08', '677056935534526464');
|
|
233
|
+
INSERT INTO "system_admin" VALUES ('604612615536115712', 'admin', 'Admin', 'e8e51c59da6333bce7a443efc3e8e2e792ac6b5592a70523a16b074ba1dcc3c0', 'd06d09e00fbb3ed98f6ce1f004be912c', 'admin@outlock.com', '13333333333', 0, '2026-02-12 15:42:11.717+08', '::ffff:127.0.0.1', 1, '604612615536115712', '604612615536115712', NULL, '2025-07-27 17:54:40.704+08', '2026-02-12 15:42:42.173+08', '677056968040382464');
|
|
233
234
|
|
|
234
235
|
-- ----------------------------
|
|
235
236
|
-- Table structure for system_menu
|
|
@@ -432,8 +433,7 @@ COMMENT ON TABLE "user" IS '用户表';
|
|
|
432
433
|
-- ----------------------------
|
|
433
434
|
-- Records of user
|
|
434
435
|
-- ----------------------------
|
|
435
|
-
INSERT INTO "user" VALUES ('657558079876890624', 'test', '测试账户', '0872954db1998fff1a92b4ff42f8f9aeb2932e67d0c7fb96e31dfa3db3504ec5', 'c10ebfb00d8075bb9045d74b3affc81e', '
|
|
436
|
-
INSERT INTO "user" VALUES ('657559945822076928', 'test1', '测试账户', '2716e588736572a6bf2d9cbb06067b52805ccd80557ff03715d4eda151467903', '7ddb011fdb2406e9b57c963aa0737d92', '667311085061144576', NULL, NULL, 0, NULL, '', 1, NULL, '2025-12-20 20:28:27.957+08', '2026-01-16 18:29:07.6+08', NULL, NULL, NULL, '604612615536115712');
|
|
436
|
+
INSERT INTO "user" VALUES ('657558079876890624', 'test', '测试账户', '0872954db1998fff1a92b4ff42f8f9aeb2932e67d0c7fb96e31dfa3db3504ec5', 'c10ebfb00d8075bb9045d74b3affc81e', '676746940855091200', '1111@qq.com', NULL, 0, NULL, '', 1, NULL, '2025-12-20 20:21:03.082+08', '2026-01-02 17:23:59.702+08', NULL, NULL, NULL, NULL);
|
|
437
437
|
|
|
438
438
|
-- ----------------------------
|
|
439
439
|
-- Table structure for user_file
|
|
@@ -469,6 +469,15 @@ COMMENT ON COLUMN "user_file"."created_admin_id" IS '创建者(管理员)Id';
|
|
|
469
469
|
COMMENT ON COLUMN "user_file"."updated_admin_id" IS '最后更新者(管理员)Id';
|
|
470
470
|
COMMENT ON TABLE "user_file" IS '用户附件表(前台)';
|
|
471
471
|
|
|
472
|
+
-- ----------------------------
|
|
473
|
+
-- Records of user_file
|
|
474
|
+
-- ----------------------------
|
|
475
|
+
INSERT INTO "user_file" VALUES ('676746940855091200', 'Krma0Tzl8b.jpg', 'a8aa632b76c334a6c6094b3818bb68a9.jpg', 'image/jpeg', 27667, 'local', 'a8aa632b76c334a6c6094b3818bb68a9', NULL, NULL, '2026-02-11 19:10:44.05+08', '2026-02-11 19:10:44.05+08', '604612615536115712', '604612615536115712');
|
|
476
|
+
|
|
477
|
+
-- ----------------------------
|
|
478
|
+
-- Primary Key structure for table example_book
|
|
479
|
+
-- ----------------------------
|
|
480
|
+
ALTER TABLE "example_book" ADD CONSTRAINT "example_book_pkey" PRIMARY KEY ("id");
|
|
472
481
|
|
|
473
482
|
-- ----------------------------
|
|
474
483
|
-- Indexes structure for table example_demo
|
|
@@ -569,3 +578,8 @@ ALTER TABLE "user" ADD CONSTRAINT "user_pkey" PRIMARY KEY ("id");
|
|
|
569
578
|
-- Primary Key structure for table user_file
|
|
570
579
|
-- ----------------------------
|
|
571
580
|
ALTER TABLE "user_file" ADD CONSTRAINT "user_file_pkey" PRIMARY KEY ("id");
|
|
581
|
+
|
|
582
|
+
-- ----------------------------
|
|
583
|
+
-- Foreign Keys structure for table example_demo_books
|
|
584
|
+
-- ----------------------------
|
|
585
|
+
ALTER TABLE "example_demo_books" ADD CONSTRAINT "example_demo_books_example_book_id_fkey" FOREIGN KEY ("example_book_id") REFERENCES "example_book" ("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"version": "1.0.
|
|
2
|
+
"name": "meadmin",
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"private": true,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@meadmin/cli": "^1.0.
|
|
8
|
+
"@meadmin/cli": "^1.0.3",
|
|
9
9
|
"@meadmin/core": "^1.0.2",
|
|
10
|
-
"@meadmin/midway-vite-view": "^1.0.
|
|
10
|
+
"@meadmin/midway-vite-view": "^1.0.3",
|
|
11
11
|
"@midwayjs/bootstrap": "^3.20.11",
|
|
12
12
|
"@midwayjs/busboy": "3.20.19",
|
|
13
13
|
"@midwayjs/cache-manager": "^3.20.11",
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ILogger } from '@midwayjs/core';
|
|
2
|
-
|
|
3
|
-
export let appLogger: ILogger = {
|
|
4
|
-
info: console.log,
|
|
5
|
-
debug: console.log,
|
|
6
|
-
error: console.log,
|
|
7
|
-
warn: console.log,
|
|
8
|
-
}; //应用logger 必须在ready 后调用
|
|
9
|
-
export let coreLogger: ILogger = {
|
|
10
|
-
info: console.log,
|
|
11
|
-
debug: console.log,
|
|
12
|
-
error: console.log,
|
|
13
|
-
warn: console.log,
|
|
14
|
-
}; //框架级别logger 必须在ready 后调用
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* 初始化log方法
|
|
18
|
-
* @param appLoggerFn
|
|
19
|
-
* @param coreLoggerFn
|
|
20
|
-
*/
|
|
21
|
-
export const initLogger = (appLoggerFn: ILogger, coreLoggerFn: ILogger) => {
|
|
22
|
-
appLogger = appLoggerFn;
|
|
23
|
-
coreLogger = coreLoggerFn;
|
|
24
|
-
};
|
|
1
|
+
import { ILogger } from '@midwayjs/core';
|
|
2
|
+
|
|
3
|
+
export let appLogger: ILogger = {
|
|
4
|
+
info: console.log,
|
|
5
|
+
debug: console.log,
|
|
6
|
+
error: console.log,
|
|
7
|
+
warn: console.log,
|
|
8
|
+
}; //应用logger 必须在ready 后调用
|
|
9
|
+
export let coreLogger: ILogger = {
|
|
10
|
+
info: console.log,
|
|
11
|
+
debug: console.log,
|
|
12
|
+
error: console.log,
|
|
13
|
+
warn: console.log,
|
|
14
|
+
}; //框架级别logger 必须在ready 后调用
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 初始化log方法
|
|
18
|
+
* @param appLoggerFn
|
|
19
|
+
* @param coreLoggerFn
|
|
20
|
+
*/
|
|
21
|
+
export const initLogger = (appLoggerFn: ILogger, coreLoggerFn: ILogger) => {
|
|
22
|
+
appLogger = appLoggerFn;
|
|
23
|
+
coreLogger = coreLoggerFn;
|
|
24
|
+
};
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"declaration": true,
|
|
18
18
|
"forceConsistentCasingInFileNames": true,
|
|
19
19
|
"resolveJsonModule": true,
|
|
20
|
-
"typeRoots": ["./
|
|
20
|
+
"typeRoots": ["./node_modules/@types"],
|
|
21
21
|
"outDir": "dist",
|
|
22
22
|
"rootDir": "src",
|
|
23
23
|
"paths": {
|
|
File without changes
|
|
File without changes
|
|
@@ -8,6 +8,7 @@ export {}
|
|
|
8
8
|
declare global {
|
|
9
9
|
const EffectScope: typeof import('vue').EffectScope
|
|
10
10
|
const ElLoading: typeof import('element-plus/es').ElLoading
|
|
11
|
+
const ElMessage: typeof import('element-plus/es').ElMessage
|
|
11
12
|
const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
|
|
12
13
|
const asyncComputed: typeof import('@vueuse/core').asyncComputed
|
|
13
14
|
const autoResetRef: typeof import('@vueuse/core').autoResetRef
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { IMiddleware, Middleware } from '@midwayjs/core';
|
|
2
|
-
import { Context, NextFunction } from '@midwayjs/koa';
|
|
3
|
-
|
|
4
|
-
@Middleware()
|
|
5
|
-
export class ReportMiddleware implements IMiddleware<Context, NextFunction> {
|
|
6
|
-
resolve() {
|
|
7
|
-
return async (ctx: Context, next: NextFunction) => {
|
|
8
|
-
// 控制器前执行的逻辑
|
|
9
|
-
const startTime = Date.now();
|
|
10
|
-
// 执行下一个 Web 中间件,最后执行到控制器
|
|
11
|
-
// 这里可以拿到下一个中间件或者控制器的返回值
|
|
12
|
-
const result = await next();
|
|
13
|
-
// 控制器之后执行的逻辑
|
|
14
|
-
ctx.logger.info(`Report in "src/middleware/report.middleware.ts", rt = ${Date.now() - startTime}ms`);
|
|
15
|
-
// 返回给上一个中间件的结果
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static getName(): string {
|
|
21
|
-
return 'report';
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
declare module 'vue' {
|
|
2
|
-
export interface GlobalComponents {
|
|
3
|
-
MeButton: typeof import('../src/components/meButton.vue')['default'];
|
|
4
|
-
MeNumber: typeof import('../src/components/meNumber.vue')['default'];
|
|
5
|
-
MeUpAvatar: typeof import('../src/components/meUpAvatar.vue')['default'];
|
|
6
|
-
MeUpload: typeof import('../src/components/meUpload.vue')['default'];
|
|
7
|
-
MeDialog: typeof import('../src/components/meDialog/index.vue')['default'];
|
|
8
|
-
MeSelectFile: typeof import('../src/components/meSelectFile/index.vue')['default'];
|
|
9
|
-
MeWangEditor: typeof import('../src/components/meWangEditor/index.vue')['default'];
|
|
10
|
-
MeVxeTable: typeof import('../src/components/meVxeTable/index.vue')['default'];
|
|
11
|
-
//code
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
declare global {
|
|
15
|
-
type MeButtonInstance = InstanceType<typeof import('../src/components/meButton.vue')['default']>;
|
|
16
|
-
type MeNumberInstance = InstanceType<typeof import('../src/components/meNumber.vue')['default']>;
|
|
17
|
-
type MeUpAvatarInstance = InstanceType<typeof import('../src/components/meUpAvatar.vue')['default']>;
|
|
18
|
-
type MeUploadInstance = InstanceType<typeof import('../src/components/meUpload.vue')['default']>;
|
|
19
|
-
type MeDialogInstance = InstanceType<typeof import('../src/components/meDialog/index.vue')['default']>;
|
|
20
|
-
type MeSelectFileInstance = InstanceType<typeof import('../src/components/meSelectFile/index.vue')['default']>;
|
|
21
|
-
type MeWangEditorInstance = InstanceType<typeof import('../src/components/meWangEditor/index.vue')['default']>;
|
|
22
|
-
type MeVxeTableInstance = InstanceType<typeof import('../src/components/meVxeTable/index.vue')['default']>;
|
|
23
|
-
//typeCode
|
|
24
|
-
}
|
|
25
|
-
export {};
|