@fecommunity/reactpress-toolkit 1.0.0-beta.1 → 1.0.0-beta.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/README.md +405 -0
- package/dist/api/Article.d.ts +44 -29
- package/dist/api/Article.js +42 -31
- package/dist/api/Auth.d.ts +11 -6
- package/dist/api/Auth.js +10 -8
- package/dist/api/Category.d.ts +20 -13
- package/dist/api/Category.js +18 -15
- package/dist/api/Comment.d.ts +22 -14
- package/dist/api/Comment.js +20 -16
- package/dist/api/File.d.ts +16 -10
- package/dist/api/File.js +14 -12
- package/dist/api/{http-client.d.ts → HttpClient.d.ts} +2 -2
- package/dist/api/{http-client.js → HttpClient.js} +4 -2
- package/dist/api/Knowledge.d.ts +29 -19
- package/dist/api/Knowledge.js +27 -22
- package/dist/api/Page.d.ts +23 -15
- package/dist/api/Page.js +21 -17
- package/dist/api/Search.d.ts +12 -7
- package/dist/api/Search.js +11 -9
- package/dist/api/Setting.d.ts +10 -6
- package/dist/api/Setting.js +8 -8
- package/dist/api/Smtp.d.ts +14 -9
- package/dist/api/Smtp.js +12 -11
- package/dist/api/Tag.d.ts +22 -14
- package/dist/api/Tag.js +20 -16
- package/dist/api/User.d.ts +15 -8
- package/dist/api/User.js +13 -13
- package/dist/api/View.d.ts +19 -12
- package/dist/api/View.js +17 -14
- package/dist/api/index.d.ts +13 -18
- package/dist/api/index.js +28 -41
- package/dist/api/instance.d.ts +47 -0
- package/dist/api/instance.js +71 -0
- package/dist/config/env.d.ts +1 -0
- package/dist/config/env.js +93 -0
- package/dist/config/global.d.ts +34 -0
- package/dist/config/global.js +382 -0
- package/dist/config/i18n.d.ts +5 -0
- package/dist/config/i18n.js +47 -0
- package/dist/config/index.d.ts +14 -0
- package/dist/config/index.js +30 -0
- package/dist/index.d.ts +8 -9
- package/dist/index.js +20 -18
- package/dist/locales/en.json +97 -0
- package/dist/locales/zh.json +97 -0
- package/dist/types/index.d.ts +245 -1
- package/dist/types/index.js +10 -17
- package/dist/utils/index.d.ts +33 -2
- package/dist/utils/index.js +57 -18
- package/package.json +15 -6
- package/demos/simple.ts +0 -65
- package/dist/api/Admin.d.ts +0 -14
- package/dist/api/Admin.js +0 -32
- package/dist/api/All.d.ts +0 -14
- package/dist/api/All.js +0 -32
- package/dist/api/Archives.d.ts +0 -14
- package/dist/api/Archives.js +0 -32
- package/dist/api/Book.d.ts +0 -15
- package/dist/api/Book.js +0 -33
- package/dist/api/Chapter.d.ts +0 -15
- package/dist/api/Chapter.js +0 -33
- package/dist/api/Get.d.ts +0 -14
- package/dist/api/Get.js +0 -32
- package/dist/api/Github.d.ts +0 -14
- package/dist/api/Github.js +0 -32
- package/dist/api/Host.d.ts +0 -14
- package/dist/api/Host.js +0 -32
- package/dist/api/Id.d.ts +0 -284
- package/dist/api/Id.js +0 -422
- package/dist/api/Login.d.ts +0 -14
- package/dist/api/Login.js +0 -32
- package/dist/api/Password.d.ts +0 -15
- package/dist/api/Password.js +0 -33
- package/dist/api/Recommend.d.ts +0 -14
- package/dist/api/Recommend.js +0 -32
- package/dist/api/Register.d.ts +0 -15
- package/dist/api/Register.js +0 -33
- package/dist/api/Update.d.ts +0 -15
- package/dist/api/Update.js +0 -33
- package/dist/api/Upload.d.ts +0 -15
- package/dist/api/Upload.js +0 -33
- package/dist/api/Url.d.ts +0 -14
- package/dist/api/Url.js +0 -32
- package/dist/api/api-instance.d.ts +0 -39
- package/dist/api/api-instance.js +0 -46
- package/dist/api/httpClient.d.ts +0 -41
- package/dist/api/httpClient.js +0 -94
- package/dist/types/data-contracts.d.ts +0 -177
- package/dist/types/data-contracts.js +0 -12
- package/dist/utils/common.d.ts +0 -23
- package/dist/utils/common.js +0 -78
- package/dist/utils/http.d.ts +0 -3
- package/dist/utils/http.js +0 -47
- package/scripts/generate-api-types.js +0 -571
- package/scripts/generate-swagger.js +0 -47
- package/scripts/organize-api.js +0 -136
- package/src/api/Article.ts +0 -186
- package/src/api/Auth.ts +0 -54
- package/src/api/Category.ts +0 -82
- package/src/api/Comment.ts +0 -95
- package/src/api/File.ts +0 -69
- package/src/api/Knowledge.ts +0 -122
- package/src/api/Page.ts +0 -95
- package/src/api/Search.ts +0 -54
- package/src/api/Setting.ts +0 -43
- package/src/api/Smtp.ts +0 -56
- package/src/api/Tag.ts +0 -95
- package/src/api/User.ts +0 -72
- package/src/api/View.ts +0 -82
- package/src/api/api-instance.ts +0 -69
- package/src/api/httpClient.ts +0 -140
- package/src/api/index.ts +0 -25
- package/src/index.ts +0 -18
- package/src/types/data-contracts.ts +0 -198
- package/src/types/index.ts +0 -4
- package/src/utils/common.ts +0 -108
- package/src/utils/http.ts +0 -52
- package/src/utils/index.ts +0 -5
- package/test-final.js +0 -56
- package/test-import.js +0 -34
- package/tsconfig.json +0 -20
package/dist/api/index.js
CHANGED
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// API
|
|
3
|
-
// 自动生成,请勿手动修改
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
-
};
|
|
18
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
-
};
|
|
2
|
+
// Auto-generated API module index
|
|
21
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
4
|
+
exports.View = exports.User = exports.Tag = exports.Smtp = exports.Setting = exports.Search = exports.Page = exports.Knowledge = exports.File = exports.Comment = exports.Category = exports.Auth = exports.Article = void 0;
|
|
5
|
+
var Article_1 = require("./Article");
|
|
6
|
+
Object.defineProperty(exports, "Article", { enumerable: true, get: function () { return Article_1.Article; } });
|
|
7
|
+
var Auth_1 = require("./Auth");
|
|
8
|
+
Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return Auth_1.Auth; } });
|
|
9
|
+
var Category_1 = require("./Category");
|
|
10
|
+
Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return Category_1.Category; } });
|
|
11
|
+
var Comment_1 = require("./Comment");
|
|
12
|
+
Object.defineProperty(exports, "Comment", { enumerable: true, get: function () { return Comment_1.Comment; } });
|
|
13
|
+
var File_1 = require("./File");
|
|
14
|
+
Object.defineProperty(exports, "File", { enumerable: true, get: function () { return File_1.File; } });
|
|
15
|
+
var Knowledge_1 = require("./Knowledge");
|
|
16
|
+
Object.defineProperty(exports, "Knowledge", { enumerable: true, get: function () { return Knowledge_1.Knowledge; } });
|
|
17
|
+
var Page_1 = require("./Page");
|
|
18
|
+
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
|
|
19
|
+
var Search_1 = require("./Search");
|
|
20
|
+
Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return Search_1.Search; } });
|
|
21
|
+
var Setting_1 = require("./Setting");
|
|
22
|
+
Object.defineProperty(exports, "Setting", { enumerable: true, get: function () { return Setting_1.Setting; } });
|
|
23
|
+
var Smtp_1 = require("./Smtp");
|
|
24
|
+
Object.defineProperty(exports, "Smtp", { enumerable: true, get: function () { return Smtp_1.Smtp; } });
|
|
25
|
+
var Tag_1 = require("./Tag");
|
|
26
|
+
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return Tag_1.Tag; } });
|
|
27
|
+
var User_1 = require("./User");
|
|
28
|
+
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
|
|
29
|
+
var View_1 = require("./View");
|
|
30
|
+
Object.defineProperty(exports, "View", { enumerable: true, get: function () { return View_1.View; } });
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { HttpClient } from './HttpClient';
|
|
2
|
+
import { Article } from './Article';
|
|
3
|
+
import { Auth } from './Auth';
|
|
4
|
+
import { Category } from './Category';
|
|
5
|
+
import { Comment } from './Comment';
|
|
6
|
+
import { File } from './File';
|
|
7
|
+
import { Knowledge } from './Knowledge';
|
|
8
|
+
import { Page } from './Page';
|
|
9
|
+
import { Search } from './Search';
|
|
10
|
+
import { Setting } from './Setting';
|
|
11
|
+
import { Smtp } from './Smtp';
|
|
12
|
+
import { Tag } from './Tag';
|
|
13
|
+
import { User } from './User';
|
|
14
|
+
import { View } from './View';
|
|
15
|
+
export declare const http: HttpClient<unknown>;
|
|
16
|
+
export declare const api: {
|
|
17
|
+
article: Article<unknown>;
|
|
18
|
+
auth: Auth<unknown>;
|
|
19
|
+
category: Category<unknown>;
|
|
20
|
+
comment: Comment<unknown>;
|
|
21
|
+
file: File<unknown>;
|
|
22
|
+
knowledge: Knowledge<unknown>;
|
|
23
|
+
page: Page<unknown>;
|
|
24
|
+
search: Search<unknown>;
|
|
25
|
+
setting: Setting<unknown>;
|
|
26
|
+
smtp: Smtp<unknown>;
|
|
27
|
+
tag: Tag<unknown>;
|
|
28
|
+
user: User<unknown>;
|
|
29
|
+
view: View<unknown>;
|
|
30
|
+
};
|
|
31
|
+
export declare function createApiInstance(config: any): {
|
|
32
|
+
article: Article<unknown>;
|
|
33
|
+
auth: Auth<unknown>;
|
|
34
|
+
category: Category<unknown>;
|
|
35
|
+
comment: Comment<unknown>;
|
|
36
|
+
file: File<unknown>;
|
|
37
|
+
knowledge: Knowledge<unknown>;
|
|
38
|
+
page: Page<unknown>;
|
|
39
|
+
search: Search<unknown>;
|
|
40
|
+
setting: Setting<unknown>;
|
|
41
|
+
smtp: Smtp<unknown>;
|
|
42
|
+
tag: Tag<unknown>;
|
|
43
|
+
user: User<unknown>;
|
|
44
|
+
view: View<unknown>;
|
|
45
|
+
};
|
|
46
|
+
export default api;
|
|
47
|
+
export { Article, Auth, Category, Comment, File, Knowledge, Page, Search, Setting, Smtp, Tag, User, View, };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.View = exports.User = exports.Tag = exports.Smtp = exports.Setting = exports.Search = exports.Page = exports.Knowledge = exports.File = exports.Comment = exports.Category = exports.Auth = exports.Article = exports.createApiInstance = exports.api = exports.http = void 0;
|
|
4
|
+
const HttpClient_1 = require("./HttpClient");
|
|
5
|
+
// Auto-generated API instance
|
|
6
|
+
const Article_1 = require("./Article");
|
|
7
|
+
Object.defineProperty(exports, "Article", { enumerable: true, get: function () { return Article_1.Article; } });
|
|
8
|
+
const Auth_1 = require("./Auth");
|
|
9
|
+
Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return Auth_1.Auth; } });
|
|
10
|
+
const Category_1 = require("./Category");
|
|
11
|
+
Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return Category_1.Category; } });
|
|
12
|
+
const Comment_1 = require("./Comment");
|
|
13
|
+
Object.defineProperty(exports, "Comment", { enumerable: true, get: function () { return Comment_1.Comment; } });
|
|
14
|
+
const File_1 = require("./File");
|
|
15
|
+
Object.defineProperty(exports, "File", { enumerable: true, get: function () { return File_1.File; } });
|
|
16
|
+
const Knowledge_1 = require("./Knowledge");
|
|
17
|
+
Object.defineProperty(exports, "Knowledge", { enumerable: true, get: function () { return Knowledge_1.Knowledge; } });
|
|
18
|
+
const Page_1 = require("./Page");
|
|
19
|
+
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
|
|
20
|
+
const Search_1 = require("./Search");
|
|
21
|
+
Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return Search_1.Search; } });
|
|
22
|
+
const Setting_1 = require("./Setting");
|
|
23
|
+
Object.defineProperty(exports, "Setting", { enumerable: true, get: function () { return Setting_1.Setting; } });
|
|
24
|
+
const Smtp_1 = require("./Smtp");
|
|
25
|
+
Object.defineProperty(exports, "Smtp", { enumerable: true, get: function () { return Smtp_1.Smtp; } });
|
|
26
|
+
const Tag_1 = require("./Tag");
|
|
27
|
+
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return Tag_1.Tag; } });
|
|
28
|
+
const User_1 = require("./User");
|
|
29
|
+
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
|
|
30
|
+
const View_1 = require("./View");
|
|
31
|
+
Object.defineProperty(exports, "View", { enumerable: true, get: function () { return View_1.View; } });
|
|
32
|
+
// Create default HTTP client
|
|
33
|
+
exports.http = new HttpClient_1.HttpClient();
|
|
34
|
+
// Create API instance with all modules
|
|
35
|
+
exports.api = {
|
|
36
|
+
article: new Article_1.Article(exports.http),
|
|
37
|
+
auth: new Auth_1.Auth(exports.http),
|
|
38
|
+
category: new Category_1.Category(exports.http),
|
|
39
|
+
comment: new Comment_1.Comment(exports.http),
|
|
40
|
+
file: new File_1.File(exports.http),
|
|
41
|
+
knowledge: new Knowledge_1.Knowledge(exports.http),
|
|
42
|
+
page: new Page_1.Page(exports.http),
|
|
43
|
+
search: new Search_1.Search(exports.http),
|
|
44
|
+
setting: new Setting_1.Setting(exports.http),
|
|
45
|
+
smtp: new Smtp_1.Smtp(exports.http),
|
|
46
|
+
tag: new Tag_1.Tag(exports.http),
|
|
47
|
+
user: new User_1.User(exports.http),
|
|
48
|
+
view: new View_1.View(exports.http),
|
|
49
|
+
};
|
|
50
|
+
// Create custom API instance function
|
|
51
|
+
function createApiInstance(config) {
|
|
52
|
+
const customHttp = new HttpClient_1.HttpClient(config);
|
|
53
|
+
return {
|
|
54
|
+
article: new Article_1.Article(customHttp),
|
|
55
|
+
auth: new Auth_1.Auth(customHttp),
|
|
56
|
+
category: new Category_1.Category(customHttp),
|
|
57
|
+
comment: new Comment_1.Comment(customHttp),
|
|
58
|
+
file: new File_1.File(customHttp),
|
|
59
|
+
knowledge: new Knowledge_1.Knowledge(customHttp),
|
|
60
|
+
page: new Page_1.Page(customHttp),
|
|
61
|
+
search: new Search_1.Search(customHttp),
|
|
62
|
+
setting: new Setting_1.Setting(customHttp),
|
|
63
|
+
smtp: new Smtp_1.Smtp(customHttp),
|
|
64
|
+
tag: new Tag_1.Tag(customHttp),
|
|
65
|
+
user: new User_1.User(customHttp),
|
|
66
|
+
view: new View_1.View(customHttp),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
exports.createApiInstance = createApiInstance;
|
|
70
|
+
// Export default API instance
|
|
71
|
+
exports.default = exports.api;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const file: string, config: Record<string, string>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var _a;
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.config = exports.file = void 0;
|
|
28
|
+
const fs = __importStar(require("fs-extra"));
|
|
29
|
+
const path = __importStar(require("path"));
|
|
30
|
+
const dotenv = __importStar(require("dotenv"));
|
|
31
|
+
const isProd = process.env.NODE_ENV === 'production';
|
|
32
|
+
// 获取项目根目录的函数
|
|
33
|
+
function getProjectRoot() {
|
|
34
|
+
// 优先使用通过环境变量传递的原始工作目录
|
|
35
|
+
// 这是在 bin/reactpress-server.js 中设置的,表示用户执行 npx 命令的目录
|
|
36
|
+
if (process.env.REACTPRESS_ORIGINAL_CWD) {
|
|
37
|
+
return process.env.REACTPRESS_ORIGINAL_CWD;
|
|
38
|
+
}
|
|
39
|
+
// 如果没有设置环境变量,则回退到当前工作目录
|
|
40
|
+
return process.cwd();
|
|
41
|
+
}
|
|
42
|
+
function parseEnv() {
|
|
43
|
+
// 使用改进的项目根目录查找
|
|
44
|
+
const projectRoot = getProjectRoot();
|
|
45
|
+
const possibleBasePaths = [
|
|
46
|
+
projectRoot,
|
|
47
|
+
path.resolve(__dirname, '../../'),
|
|
48
|
+
path.resolve(__dirname, '../../../'),
|
|
49
|
+
path.resolve(__dirname, '../'),
|
|
50
|
+
process.cwd(),
|
|
51
|
+
path.resolve(process.cwd(), '../'), // From client directory to project root
|
|
52
|
+
];
|
|
53
|
+
let foundEnvFiles = [];
|
|
54
|
+
// Search for .env files in all possible locations
|
|
55
|
+
for (const basePath of possibleBasePaths) {
|
|
56
|
+
const localenv = path.join(basePath, '.env');
|
|
57
|
+
const prodenv = path.join(basePath, '.env.prod');
|
|
58
|
+
const envFiles = [
|
|
59
|
+
{ path: prodenv, isProd: true },
|
|
60
|
+
{ path: localenv, isProd: false }
|
|
61
|
+
];
|
|
62
|
+
const availableEnvFiles = envFiles.filter(({ path: envPath }) => fs.existsSync(envPath));
|
|
63
|
+
if (availableEnvFiles.length > 0) {
|
|
64
|
+
foundEnvFiles = availableEnvFiles;
|
|
65
|
+
break; // Use the first location where we find env files
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (foundEnvFiles.length === 0) {
|
|
69
|
+
// Show all possible paths in error message for debugging
|
|
70
|
+
const allPossiblePaths = [];
|
|
71
|
+
for (const basePath of possibleBasePaths) {
|
|
72
|
+
allPossiblePaths.push(path.join(basePath, '.env'));
|
|
73
|
+
allPossiblePaths.push(path.join(basePath, '.env.prod'));
|
|
74
|
+
}
|
|
75
|
+
throw new Error(`No environment file found. Searched in these locations:\n` +
|
|
76
|
+
allPossiblePaths.map((p) => `- ${p}`).join('\n') +
|
|
77
|
+
`\n\nPlease create a .env file in your project root directory.`);
|
|
78
|
+
}
|
|
79
|
+
const file = foundEnvFiles.find(({ isProd: prod }) => isProd === prod)?.path ||
|
|
80
|
+
foundEnvFiles[0].path;
|
|
81
|
+
try {
|
|
82
|
+
const envContent = fs.readFileSync(file, 'utf8');
|
|
83
|
+
const config = dotenv.parse(envContent);
|
|
84
|
+
if (Object.keys(config).length === 0) {
|
|
85
|
+
console.warn(`Warning: No environment variables found in ${file}`);
|
|
86
|
+
}
|
|
87
|
+
return { file, config };
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
throw new Error(`Failed to parse ${file}: ${error instanceof Error ? error.message : String(error)}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
_a = parseEnv(), exports.file = _a.file, exports.config = _a.config;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface NavItem {
|
|
2
|
+
label: string;
|
|
3
|
+
key: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
children?: NavItem[];
|
|
10
|
+
}
|
|
11
|
+
interface NavConfig {
|
|
12
|
+
categories: NavItem[];
|
|
13
|
+
subCategories: Record<string, NavItem[]>;
|
|
14
|
+
}
|
|
15
|
+
interface UrlCategory {
|
|
16
|
+
key: string;
|
|
17
|
+
label: string;
|
|
18
|
+
icon: string;
|
|
19
|
+
children: NavItem[];
|
|
20
|
+
}
|
|
21
|
+
interface GlobalConfig {
|
|
22
|
+
navConfig: NavConfig;
|
|
23
|
+
urlConfig: UrlCategory[];
|
|
24
|
+
}
|
|
25
|
+
interface LanguageConfig {
|
|
26
|
+
globalConfig: GlobalConfig;
|
|
27
|
+
}
|
|
28
|
+
interface GlobalSetting {
|
|
29
|
+
zh: LanguageConfig;
|
|
30
|
+
en: LanguageConfig;
|
|
31
|
+
}
|
|
32
|
+
declare const globalSetting: GlobalSetting;
|
|
33
|
+
export type { GlobalSetting, LanguageConfig, GlobalConfig, NavConfig, NavItem, UrlCategory };
|
|
34
|
+
export { globalSetting };
|