create-pubinfo 2.0.0-beta.27 → 2.0.0-beta.28
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/index.js +19 -19
- package/package.json +5 -5
- package/templates/pubinfo-template/package.json +14 -14
- package/templates/pubinfo-template/src/App.vue +1 -9
- package/templates/pubinfo-template/src/main.ts +4 -2
- package/templates/pubinfo-template/src/routes/index.ts +2 -2
- package/templates/pubinfo-template/src/views/system/login/components/PasswordLogin.vue +15 -0
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import consola6 from "consola";
|
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "create-pubinfo",
|
|
10
10
|
type: "module",
|
|
11
|
-
version: "2.0.0-beta.
|
|
11
|
+
version: "2.0.0-beta.28",
|
|
12
12
|
description: "\u521D\u59CB\u5316\u9879\u76EE\u6846\u67B6",
|
|
13
13
|
author: "Werheng <werheng.zhang@gmail.com>",
|
|
14
14
|
license: "MIT",
|
|
@@ -32,30 +32,30 @@ var package_default = {
|
|
|
32
32
|
cfonts: "^3.3.0",
|
|
33
33
|
commander: "^12.1.0",
|
|
34
34
|
confbox: "^0.1.8",
|
|
35
|
-
consola: "^3.4.
|
|
35
|
+
consola: "^3.4.2",
|
|
36
36
|
giget: "^1.2.5",
|
|
37
37
|
ofetch: "^1.4.1",
|
|
38
38
|
ora: "^8.2.0",
|
|
39
39
|
rimraf: "^6.0.1",
|
|
40
|
-
semver: "^7.7.
|
|
40
|
+
semver: "^7.7.2"
|
|
41
41
|
},
|
|
42
42
|
devDependencies: {
|
|
43
|
-
"@types/node": "^22.
|
|
43
|
+
"@types/node": "^22.15.27",
|
|
44
44
|
tsup: "catalog:"
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
// src/core/generate.ts
|
|
49
|
-
import { renameSync } from "
|
|
50
|
-
import { dirname, resolve as resolve2 } from "
|
|
51
|
-
import { cwd } from "
|
|
52
|
-
import { fileURLToPath } from "
|
|
49
|
+
import { renameSync } from "fs";
|
|
50
|
+
import { dirname, resolve as resolve2 } from "path";
|
|
51
|
+
import { cwd } from "process";
|
|
52
|
+
import { fileURLToPath } from "url";
|
|
53
53
|
|
|
54
54
|
// src/utils.ts
|
|
55
|
-
import { existsSync, readFileSync, writeFileSync } from "
|
|
56
|
-
import * as fs from "
|
|
57
|
-
import { readFile, writeFile } from "
|
|
58
|
-
import { resolve } from "
|
|
55
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
56
|
+
import * as fs from "fs";
|
|
57
|
+
import { readFile, writeFile } from "fs/promises";
|
|
58
|
+
import { resolve } from "path";
|
|
59
59
|
import { parseJSON, parseJSONC, stringifyJSON } from "confbox";
|
|
60
60
|
import consola from "consola";
|
|
61
61
|
function rewriteFile(path, fn) {
|
|
@@ -147,8 +147,8 @@ function generate(options, version) {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
// src/core/init.ts
|
|
150
|
-
import { existsSync as existsSync2 } from "
|
|
151
|
-
import process2 from "
|
|
150
|
+
import { existsSync as existsSync2 } from "fs";
|
|
151
|
+
import process2 from "process";
|
|
152
152
|
import { checkbox, confirm, input, select } from "@inquirer/prompts";
|
|
153
153
|
import colors from "ansi-colors";
|
|
154
154
|
import consola3 from "consola";
|
|
@@ -167,7 +167,7 @@ var METADATA_DIR = "configs/metadata";
|
|
|
167
167
|
var META_FILENAME = "pubinfo.json";
|
|
168
168
|
|
|
169
169
|
// src/v1/fetch.ts
|
|
170
|
-
import process from "
|
|
170
|
+
import process from "process";
|
|
171
171
|
import consola2 from "consola";
|
|
172
172
|
import { ofetch } from "ofetch";
|
|
173
173
|
import ora from "ora";
|
|
@@ -273,7 +273,7 @@ function bootstrop() {
|
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
// src/v1/download.ts
|
|
276
|
-
import process3 from "
|
|
276
|
+
import process3 from "process";
|
|
277
277
|
import colors2 from "ansi-colors";
|
|
278
278
|
import consola4 from "consola";
|
|
279
279
|
import { downloadTemplate } from "giget";
|
|
@@ -322,9 +322,9 @@ function loading() {
|
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
// src/v1/rewrite.ts
|
|
325
|
-
import { existsSync as existsSync3, readdirSync as readdirSync2 } from "
|
|
326
|
-
import { resolve as resolve3 } from "
|
|
327
|
-
import process4 from "
|
|
325
|
+
import { existsSync as existsSync3, readdirSync as readdirSync2 } from "fs";
|
|
326
|
+
import { resolve as resolve3 } from "path";
|
|
327
|
+
import process4 from "process";
|
|
328
328
|
import consola5 from "consola";
|
|
329
329
|
import { rimrafSync } from "rimraf";
|
|
330
330
|
async function rewrite(options) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pubinfo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.28",
|
|
5
5
|
"description": "初始化项目框架",
|
|
6
6
|
"author": "Werheng <werheng.zhang@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
"cfonts": "^3.3.0",
|
|
19
19
|
"commander": "^12.1.0",
|
|
20
20
|
"confbox": "^0.1.8",
|
|
21
|
-
"consola": "^3.4.
|
|
21
|
+
"consola": "^3.4.2",
|
|
22
22
|
"giget": "^1.2.5",
|
|
23
23
|
"ofetch": "^1.4.1",
|
|
24
24
|
"ora": "^8.2.0",
|
|
25
25
|
"rimraf": "^6.0.1",
|
|
26
|
-
"semver": "^7.7.
|
|
26
|
+
"semver": "^7.7.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "^22.
|
|
30
|
-
"tsup": "^8.
|
|
29
|
+
"@types/node": "^22.15.27",
|
|
30
|
+
"tsup": "^8.5.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"dev": "tsup --watch src",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "pubinfo-template",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"private": true,
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
5
|
+
"packageManager": "pnpm@10.11.0",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "pubinfo dev",
|
|
8
8
|
"build": "pubinfo build",
|
|
@@ -15,26 +15,26 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@ant-design/icons-vue": "^7.0.1",
|
|
18
|
-
"@pubinfo/module-auth": "^2.0.0-beta.
|
|
19
|
-
"@pubinfo/module-rbac": "^2.0.0-beta.
|
|
20
|
-
"@pubinfo/pro-components": "^1.7.
|
|
18
|
+
"@pubinfo/module-auth": "^2.0.0-beta.27",
|
|
19
|
+
"@pubinfo/module-rbac": "^2.0.0-beta.27",
|
|
20
|
+
"@pubinfo/pro-components": "^1.7.1",
|
|
21
21
|
"@vueuse/core": "^12.8.2",
|
|
22
|
-
"alova": "^3.2.
|
|
22
|
+
"alova": "^3.2.13",
|
|
23
23
|
"ant-design-vue": "^4.2.6",
|
|
24
|
-
"pubinfo": "^2.0.0-beta.
|
|
24
|
+
"pubinfo": "^2.0.0-beta.27"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@commitlint/config-conventional": "^19.8.
|
|
28
|
-
"@commitlint/cz-commitlint": "^19.8.
|
|
27
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
28
|
+
"@commitlint/cz-commitlint": "^19.8.1",
|
|
29
29
|
"@pubinfo/openapi": "^0.8.4",
|
|
30
30
|
"@pubinfo/preset-openapi": "^0.8.4",
|
|
31
31
|
"commitizen": "^4.3.1",
|
|
32
|
-
"commitlint": "^19.8.
|
|
33
|
-
"eslint": "^9.
|
|
34
|
-
"lint-staged": "^
|
|
35
|
-
"simple-git-hooks": "^2.
|
|
36
|
-
"stylelint": "^16.
|
|
37
|
-
"typescript": "^5.8.
|
|
32
|
+
"commitlint": "^19.8.1",
|
|
33
|
+
"eslint": "^9.27.0",
|
|
34
|
+
"lint-staged": "^16.1.0",
|
|
35
|
+
"simple-git-hooks": "^2.13.0",
|
|
36
|
+
"stylelint": "^16.20.0",
|
|
37
|
+
"typescript": "^5.8.3"
|
|
38
38
|
},
|
|
39
39
|
"config": {
|
|
40
40
|
"commitizen": {
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
function loadIcon(name: string) {
|
|
3
|
-
const modules = (import.meta as any).glob('./assets/icons/*', { eager: true });
|
|
4
|
-
const path = `./assets/icons/${name}.svg`;
|
|
5
|
-
return modules[path]?.default;
|
|
6
|
-
}
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
1
|
<template>
|
|
10
2
|
<UIProvider>
|
|
11
|
-
<PubinfoProvider
|
|
3
|
+
<PubinfoProvider>
|
|
12
4
|
<PubinfoApp />
|
|
13
5
|
</PubinfoProvider>
|
|
14
6
|
</UIProvider>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createPubinfo } from 'pubinfo';
|
|
1
|
+
import { createPubinfo, loadIconsFromGlob } from 'pubinfo';
|
|
2
2
|
import App from './App.vue';
|
|
3
3
|
import { setupAuth } from './modules/auth';
|
|
4
4
|
import { setupRbac } from './modules/rbac';
|
|
@@ -12,7 +12,9 @@ createPubinfo(
|
|
|
12
12
|
routes: constantRoutes,
|
|
13
13
|
},
|
|
14
14
|
(ctx) => {
|
|
15
|
-
const {
|
|
15
|
+
const { iconRegistry } = ctx;
|
|
16
|
+
const iconMap = loadIconsFromGlob(import.meta.glob('./assets/icons/*.svg', { eager: true }));
|
|
17
|
+
iconRegistry.register(iconMap);
|
|
16
18
|
},
|
|
17
19
|
{
|
|
18
20
|
modules: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Login from '@/views/system/login/index.vue';
|
|
2
2
|
import { defineAsyncRoutes, defineSystemRoutes } from 'pubinfo';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import Breadcrumb from './modules/demo/breadcrumb.example';
|
|
5
5
|
import Link from './modules/demo/link';
|
|
6
6
|
import MultilevelMenuExample from './modules/demo/multilevel.menu.example';
|
|
7
7
|
import OtherPage from './modules/demo/other.page';
|
|
@@ -23,7 +23,7 @@ defineAsyncRoutes([
|
|
|
23
23
|
MultilevelMenuExample,
|
|
24
24
|
OtherPage,
|
|
25
25
|
Link,
|
|
26
|
-
|
|
26
|
+
Breadcrumb,
|
|
27
27
|
],
|
|
28
28
|
},
|
|
29
29
|
{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { FormInstance, Rule } from 'ant-design-vue/es/form';
|
|
3
3
|
import type { UnwrapRef } from 'vue';
|
|
4
|
+
import { auth } from '@/modules/auth';
|
|
4
5
|
import { useToggle } from '@vueuse/core';
|
|
5
6
|
import { message, Modal } from 'ant-design-vue';
|
|
6
7
|
import { useUserStore } from 'pubinfo';
|
|
@@ -107,6 +108,8 @@ function createChangePasswordModal(msg: string, token: string) {
|
|
|
107
108
|
},
|
|
108
109
|
});
|
|
109
110
|
}
|
|
111
|
+
|
|
112
|
+
const AUTH_4A_ENABLED = import.meta.env.VITE_AUTH_4A_ENABLED === 'true';
|
|
110
113
|
</script>
|
|
111
114
|
|
|
112
115
|
<template>
|
|
@@ -182,6 +185,18 @@ function createChangePasswordModal(msg: string, token: string) {
|
|
|
182
185
|
登录
|
|
183
186
|
</a-button>
|
|
184
187
|
</div>
|
|
188
|
+
<div v-if="AUTH_4A_ENABLED" w-full h-48px>
|
|
189
|
+
<a-divider>
|
|
190
|
+
<a-button
|
|
191
|
+
class="h-48px!"
|
|
192
|
+
type="link"
|
|
193
|
+
block
|
|
194
|
+
@click="auth.signIn('4A')"
|
|
195
|
+
>
|
|
196
|
+
前往4A登录
|
|
197
|
+
</a-button>
|
|
198
|
+
</a-divider>
|
|
199
|
+
</div>
|
|
185
200
|
</a-form-item>
|
|
186
201
|
</AForm>
|
|
187
202
|
</div>
|