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 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.27",
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.0",
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.1"
40
+ semver: "^7.7.2"
41
41
  },
42
42
  devDependencies: {
43
- "@types/node": "^22.13.9",
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 "node:fs";
50
- import { dirname, resolve as resolve2 } from "node:path";
51
- import { cwd } from "node:process";
52
- import { fileURLToPath } from "node:url";
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 "node:fs";
56
- import * as fs from "node:fs";
57
- import { readFile, writeFile } from "node:fs/promises";
58
- import { resolve } from "node:path";
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 "node:fs";
151
- import process2 from "node:process";
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 "node:process";
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 "node:process";
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 "node:fs";
326
- import { resolve as resolve3 } from "node:path";
327
- import process4 from "node:process";
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.27",
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.0",
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.1"
26
+ "semver": "^7.7.2"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "^22.13.9",
30
- "tsup": "^8.4.0"
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.2",
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.18",
19
- "@pubinfo/module-rbac": "^2.0.0-beta.18",
20
- "@pubinfo/pro-components": "^1.7.0",
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.9",
22
+ "alova": "^3.2.13",
23
23
  "ant-design-vue": "^4.2.6",
24
- "pubinfo": "^2.0.0-beta.18"
24
+ "pubinfo": "^2.0.0-beta.27"
25
25
  },
26
26
  "devDependencies": {
27
- "@commitlint/config-conventional": "^19.8.0",
28
- "@commitlint/cz-commitlint": "^19.8.0",
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.0",
33
- "eslint": "^9.21.0",
34
- "lint-staged": "^15.5.0",
35
- "simple-git-hooks": "^2.11.1",
36
- "stylelint": "^16.15.0",
37
- "typescript": "^5.8.2"
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 :load-icon="loadIcon">
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 { app, router, store } = ctx;
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 breadcrumb from './modules/demo/breadcrumb.example';
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
- breadcrumb,
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>