@faapi/faapi 0.0.0-canary.ede2e84 → 0.0.0-canary.f5b23c6
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/cli/index.js +13 -11
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -564,7 +564,7 @@ interface LifecycleContext {
|
|
|
564
564
|
*
|
|
565
565
|
* 框架元信息通过环境变量配置(不放在 config 内):
|
|
566
566
|
* - `PORT`:服务端口,默认 3000
|
|
567
|
-
* - `FAAPI_DIST
|
|
567
|
+
* - `FAAPI_DIST`:产物输出目录(实际目录),dev 为 <dist>/dev(默认 .faapi/dev),prod 为 <dist>/build(默认 .faapi/build)
|
|
568
568
|
*/
|
|
569
569
|
interface FaapiConfig {
|
|
570
570
|
/** CORS 配置,false 禁用 */
|
|
@@ -995,8 +995,8 @@ declare function collectRouteSchemaSources(routes: RouteManifest, rootDir?: stri
|
|
|
995
995
|
* 加载 faapi 配置文件
|
|
996
996
|
*
|
|
997
997
|
* 统一读取 `<dist>/faapi-config.js` 产物:
|
|
998
|
-
* - dev 模式:`faapi dev` 启动时由 `compileConfig` 生成 `.faapi/faapi-config.js`
|
|
999
|
-
* - prod 模式:`faapi build` 时由 `compileConfig` 生成
|
|
998
|
+
* - dev 模式:`faapi dev` 启动时由 `compileConfig` 生成 `.faapi/dev/faapi-config.js`
|
|
999
|
+
* - prod 模式:`faapi build` 时由 `compileConfig` 生成 `.faapi/build/faapi-config.js`
|
|
1000
1000
|
*
|
|
1001
1001
|
* 产物由 `compileConfig` 在构建阶段合并 env 后固化,运行时不读源码、不现场编译、不按 env 合并。
|
|
1002
1002
|
*
|
|
@@ -1005,7 +1005,7 @@ declare function collectRouteSchemaSources(routes: RouteManifest, rootDir?: stri
|
|
|
1005
1005
|
* - 源码也无配置文件 → 返回 `null`(配置可选)
|
|
1006
1006
|
*
|
|
1007
1007
|
* @param rootDir 项目根目录
|
|
1008
|
-
* @param dist 产物目录(如 '
|
|
1008
|
+
* @param dist 产物目录(如 '.faapi/build' 或 '.faapi/dev')
|
|
1009
1009
|
* @returns 配置对象,无配置文件时返回 null
|
|
1010
1010
|
*/
|
|
1011
1011
|
declare function loadConfig(rootDir: string, dist: string): Promise<Partial<FaapiConfig> | null>;
|
|
@@ -1079,7 +1079,7 @@ interface InjectResponse {
|
|
|
1079
1079
|
interface CreateAppOptions {
|
|
1080
1080
|
/** 项目根目录,默认 process.cwd() */
|
|
1081
1081
|
rootDir?: string;
|
|
1082
|
-
/**
|
|
1082
|
+
/** 产物输出目录(实际目录,如 .faapi/build 或 .faapi/dev),覆盖环境变量 FAAPI_DIST,默认 '.faapi/build' */
|
|
1083
1083
|
dist?: string;
|
|
1084
1084
|
/** 端口号,也可在 listen() 时传入;默认环境变量 PORT 或 3000 */
|
|
1085
1085
|
port?: number;
|
package/dist/index.js
CHANGED
|
@@ -2921,7 +2921,7 @@ function resolveDeclaration(decl) {
|
|
|
2921
2921
|
}
|
|
2922
2922
|
|
|
2923
2923
|
// src/cli/createAppCore.ts
|
|
2924
|
-
var DEFAULT_DIST = "
|
|
2924
|
+
var DEFAULT_DIST = ".faapi/build";
|
|
2925
2925
|
var DEFAULT_PORT = 3e3;
|
|
2926
2926
|
var ROUTES_FILE = "faapi-routes.js";
|
|
2927
2927
|
var PATTERNS = ["src/api/**/*.ts"];
|