adorn-api 1.0.18 → 1.0.20
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.cjs +33 -18
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +33 -18
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -2868,7 +2868,7 @@ function partitionSchemas(schemas, graph, schemaGraph, config = {}) {
|
|
|
2868
2868
|
complexity: totalComplexity,
|
|
2869
2869
|
dependencies: []
|
|
2870
2870
|
}];
|
|
2871
|
-
recommendation = recommendation || "Single file mode (--
|
|
2871
|
+
recommendation = recommendation || "Single file mode (--split not specified)";
|
|
2872
2872
|
} else if (strategy === "controller") {
|
|
2873
2873
|
groups = partitionByController(schemas, graph, finalConfig);
|
|
2874
2874
|
} else if (strategy === "dependency") {
|
|
@@ -3365,16 +3365,31 @@ var ADORN_VERSION = (() => {
|
|
|
3365
3365
|
return null;
|
|
3366
3366
|
}
|
|
3367
3367
|
};
|
|
3368
|
-
const
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3368
|
+
const potentialPaths = [];
|
|
3369
|
+
try {
|
|
3370
|
+
const importMetaUrl = import_meta2?.url;
|
|
3371
|
+
if (importMetaUrl && typeof importMetaUrl === "string" && importMetaUrl.length > 0) {
|
|
3372
|
+
const cliDir = (0, import_node_path6.dirname)((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
3373
|
+
potentialPaths.push(
|
|
3374
|
+
(0, import_node_path6.resolve)(cliDir, "..", "package.json"),
|
|
3375
|
+
(0, import_node_path6.resolve)(cliDir, "package.json")
|
|
3376
|
+
);
|
|
3377
|
+
}
|
|
3378
|
+
} catch {
|
|
3379
|
+
}
|
|
3380
|
+
const cwd = import_node_process2.default.cwd();
|
|
3381
|
+
potentialPaths.push(
|
|
3382
|
+
(0, import_node_path6.resolve)(cwd, "package.json"),
|
|
3383
|
+
(0, import_node_path6.resolve)(cwd, "node_modules", "adorn-api", "package.json"),
|
|
3384
|
+
(0, import_node_path6.resolve)(cwd, "..", "package.json"),
|
|
3385
|
+
(0, import_node_path6.resolve)(cwd, "..", "..", "package.json")
|
|
3386
|
+
);
|
|
3387
|
+
for (const pkgPath of potentialPaths) {
|
|
3388
|
+
const version = tryReadPackageJson(pkgPath);
|
|
3389
|
+
if (version) {
|
|
3390
|
+
return version;
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3378
3393
|
return "0.0.0";
|
|
3379
3394
|
})();
|
|
3380
3395
|
function log(msg, options) {
|
|
@@ -3508,7 +3523,7 @@ async function buildCommand(args) {
|
|
|
3508
3523
|
const validationMode = validationModeIndex !== -1 ? args[validationModeIndex + 1] : "ajv-runtime";
|
|
3509
3524
|
const verbose = args.includes("--verbose");
|
|
3510
3525
|
const quiet = args.includes("--quiet");
|
|
3511
|
-
const
|
|
3526
|
+
const split = args.includes("--split");
|
|
3512
3527
|
const splitStrategyIndex = args.indexOf("--split-strategy");
|
|
3513
3528
|
const splitStrategy = splitStrategyIndex !== -1 ? args[splitStrategyIndex + 1] : void 0;
|
|
3514
3529
|
const splitThresholdIndex = args.indexOf("--split-threshold");
|
|
@@ -3586,7 +3601,7 @@ async function buildCommand(args) {
|
|
|
3586
3601
|
if (!quiet) openapiSpinner.stop();
|
|
3587
3602
|
const schemaCount = Object.keys(openapi.components?.schemas || {}).length;
|
|
3588
3603
|
let splitEnabled = false;
|
|
3589
|
-
if (
|
|
3604
|
+
if (split && schemaCount >= splitThreshold) {
|
|
3590
3605
|
progress.verboseLog(`Schema count (${schemaCount}) >= threshold (${splitThreshold}), analyzing for auto-split...`);
|
|
3591
3606
|
const graph = buildControllerGraph(controllers);
|
|
3592
3607
|
const schemaGraph = new SchemaGraph(graph);
|
|
@@ -3626,9 +3641,9 @@ async function buildCommand(args) {
|
|
|
3626
3641
|
log(` Auto-split not needed: ${partitioning.recommendation}`);
|
|
3627
3642
|
}
|
|
3628
3643
|
}
|
|
3629
|
-
} else if (
|
|
3644
|
+
} else if (!split) {
|
|
3630
3645
|
if (!quiet) {
|
|
3631
|
-
log(` Splitting disabled (--
|
|
3646
|
+
log(` Splitting disabled (--split not specified)`);
|
|
3632
3647
|
}
|
|
3633
3648
|
} else {
|
|
3634
3649
|
if (!quiet) {
|
|
@@ -3749,12 +3764,12 @@ Commands:
|
|
|
3749
3764
|
build Generate OpenAPI and manifest from TypeScript source
|
|
3750
3765
|
clean Remove generated artifacts
|
|
3751
3766
|
|
|
3752
|
-
Options:
|
|
3767
|
+
Options:
|
|
3753
3768
|
-p <path> Path to tsconfig.json (default: ./tsconfig.json)
|
|
3754
3769
|
--output <dir> Output directory (default: .adorn)
|
|
3755
3770
|
--if-stale Only rebuild if artifacts are stale
|
|
3756
3771
|
--validation-mode <mode> Validation mode: none, ajv-runtime, precompiled (default: ajv-runtime)
|
|
3757
|
-
--
|
|
3772
|
+
--split Enable automatic schema splitting (default: disabled)
|
|
3758
3773
|
--split-strategy <mode> Override splitting strategy: controller, dependency, size, auto (default: auto)
|
|
3759
3774
|
--split-threshold <num> Schema count threshold for auto-split (default: 50)
|
|
3760
3775
|
--verbose Show detailed progress information
|
|
@@ -3765,7 +3780,7 @@ Examples:
|
|
|
3765
3780
|
adorn-api build --if-stale
|
|
3766
3781
|
adorn-api build --validation-mode precompiled
|
|
3767
3782
|
adorn-api build --verbose
|
|
3768
|
-
adorn-api build --
|
|
3783
|
+
adorn-api build --split # Enable split mode
|
|
3769
3784
|
adorn-api build --split-strategy controller # Force controller-based splitting
|
|
3770
3785
|
adorn-api build --split-threshold 100 # Increase threshold to 100
|
|
3771
3786
|
adorn-api clean
|