@oiyo/config 0.0.1
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/LICENSE +183 -0
- package/README.md +72 -0
- package/THIRD_PARTY_NOTICES.md +21 -0
- package/dist/index.cjs +81 -0
- package/dist/index.d.cts +3022 -0
- package/dist/index.d.mts +3022 -0
- package/dist/index.mjs +53 -0
- package/package.json +44 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @oiyo/config v0.0.1
|
|
3
|
+
* Copyright (c) 2026 skiyee. All rights reserved.
|
|
4
|
+
* Commercial software. See LICENSE for terms.
|
|
5
|
+
* Official site: https://oiyo.pages.dev
|
|
6
|
+
*/
|
|
7
|
+
import process from "node:process";
|
|
8
|
+
import { defu } from "defu";
|
|
9
|
+
//#region src/oiyo/index.ts
|
|
10
|
+
/**
|
|
11
|
+
* 默认排除规则
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_EXCLUDE = [
|
|
14
|
+
"**/components/**",
|
|
15
|
+
"**/composables/**",
|
|
16
|
+
"**/utils/**"
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* 默认的 Oiyo 配置
|
|
20
|
+
*/
|
|
21
|
+
const defaultConfig = {
|
|
22
|
+
rootDir: process.cwd(),
|
|
23
|
+
srcDir: "src",
|
|
24
|
+
dir: {
|
|
25
|
+
mainPackage: "pages",
|
|
26
|
+
subPackages: [],
|
|
27
|
+
layouts: "layouts",
|
|
28
|
+
middleware: "middlewares"
|
|
29
|
+
},
|
|
30
|
+
exclude: DEFAULT_EXCLUDE,
|
|
31
|
+
ide: {
|
|
32
|
+
open: false,
|
|
33
|
+
path: {}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* 解析并合并配置
|
|
38
|
+
* @param userConfig 用户提供的配置
|
|
39
|
+
* @returns 合并后的完整配置
|
|
40
|
+
*/
|
|
41
|
+
function resolveOiyoConfig(userConfig) {
|
|
42
|
+
return defu(userConfig, defaultConfig);
|
|
43
|
+
}
|
|
44
|
+
function defineOiyoConfig(config) {
|
|
45
|
+
return config;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/pages/index.ts
|
|
49
|
+
function definePagesConfig(config) {
|
|
50
|
+
return config;
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { DEFAULT_EXCLUDE, defaultConfig, defineOiyoConfig, definePagesConfig, resolveOiyoConfig };
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oiyo/config",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "skiyee",
|
|
7
|
+
"email": "319619193@qq.com",
|
|
8
|
+
"url": "https://skiyee.pages.dev"
|
|
9
|
+
},
|
|
10
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
11
|
+
"funding": "https://github.com/skiyee/sponsors",
|
|
12
|
+
"homepage": "https://oiyo.pages.dev",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/skiyee/oiyo.git"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/skiyee/oiyo/issues"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./dist/index.d.mts",
|
|
23
|
+
"import": "./dist/index.mjs",
|
|
24
|
+
"require": "./dist/index.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.mjs",
|
|
30
|
+
"types": "./dist/index.d.mts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"THIRD_PARTY_NOTICES.md"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"defu": "^6.1.4"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsdown",
|
|
40
|
+
"dev": "tsdown --watch",
|
|
41
|
+
"test": "vitest",
|
|
42
|
+
"test:run": "vitest run"
|
|
43
|
+
}
|
|
44
|
+
}
|