@skmtc/core 0.0.800 → 0.0.803
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/esm/context/CoreContext.d.ts +2 -2
- package/esm/context/CoreContext.d.ts.map +1 -1
- package/esm/context/GenerateContext.d.ts +16 -3
- package/esm/context/GenerateContext.d.ts.map +1 -1
- package/esm/context/ParseContext.d.ts +3 -3
- package/esm/context/ParseContext.d.ts.map +1 -1
- package/esm/context/RenderContext.d.ts +153 -1
- package/esm/context/RenderContext.d.ts.map +1 -1
- package/esm/context/RenderContext.js +179 -0
- package/esm/context/types.d.ts +30 -0
- package/esm/context/types.d.ts.map +1 -1
- package/esm/dsl/model/ModelBase.d.ts +1 -1
- package/esm/dsl/model/ModelBase.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.d.ts +62 -0
- package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
- package/esm/dsl/model/ModelDriver.js +63 -1
- package/esm/dsl/model/toModelBase.d.ts +66 -0
- package/esm/dsl/model/toModelBase.d.ts.map +1 -1
- package/esm/dsl/model/toModelBase.js +46 -0
- package/esm/dsl/model/toModelEntry.d.ts +63 -0
- package/esm/dsl/model/toModelEntry.d.ts.map +1 -1
- package/esm/dsl/model/toModelEntry.js +63 -0
- package/esm/dsl/operation/OperationBase.d.ts +3 -3
- package/esm/dsl/operation/OperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.d.ts +84 -0
- package/esm/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/esm/dsl/operation/OperationDriver.js +85 -1
- package/esm/dsl/operation/toOperationBase.d.ts +58 -0
- package/esm/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationBase.js +46 -0
- package/esm/dsl/operation/toOperationEntry.d.ts +37 -0
- package/esm/dsl/operation/toOperationEntry.d.ts.map +1 -1
- package/esm/dsl/operation/toOperationEntry.js +28 -0
- package/esm/helpers/isEmpty.d.ts +1 -1
- package/esm/helpers/isEmpty.d.ts.map +1 -1
- package/esm/helpers/tracer.d.ts +1 -1
- package/esm/helpers/tracer.d.ts.map +1 -1
- package/esm/helpers/tracer.js +1 -1
- package/esm/mod.d.ts +52 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +52 -0
- package/esm/oas/array/Array.d.ts +26 -0
- package/esm/oas/array/Array.d.ts.map +1 -1
- package/esm/oas/array/Array.js +26 -0
- package/esm/oas/array/array-types.d.ts +32 -11
- package/esm/oas/array/array-types.d.ts.map +1 -1
- package/esm/oas/array/array-types.js +16 -0
- package/esm/oas/array/toArray.d.ts +111 -0
- package/esm/oas/array/toArray.d.ts.map +1 -1
- package/esm/oas/array/toArray.js +115 -3
- package/esm/oas/boolean/Boolean.d.ts +26 -0
- package/esm/oas/boolean/Boolean.d.ts.map +1 -1
- package/esm/oas/boolean/Boolean.js +26 -0
- package/esm/oas/boolean/boolean-types.d.ts +1 -7
- package/esm/oas/boolean/boolean-types.d.ts.map +1 -1
- package/esm/oas/boolean/toBoolean.d.ts +57 -0
- package/esm/oas/boolean/toBoolean.d.ts.map +1 -1
- package/esm/oas/boolean/toBoolean.js +57 -0
- package/esm/oas/components/components-types.d.ts +19 -0
- package/esm/oas/components/components-types.d.ts.map +1 -0
- package/esm/oas/components/components-types.js +21 -0
- package/esm/oas/contact/contact-types.d.ts +9 -0
- package/esm/oas/contact/contact-types.d.ts.map +1 -0
- package/esm/oas/contact/contact-types.js +7 -0
- package/esm/oas/discriminator/discriminator-types.d.ts +1 -5
- package/esm/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/esm/oas/document/document-types.d.ts +16 -0
- package/esm/oas/document/document-types.d.ts.map +1 -0
- package/esm/oas/document/document-types.js +18 -0
- package/esm/oas/example/example-types.d.ts +1 -6
- package/esm/oas/example/example-types.d.ts.map +1 -1
- package/esm/oas/header/header-types.d.ts +50 -0
- package/esm/oas/header/header-types.d.ts.map +1 -0
- package/esm/oas/header/header-types.js +30 -0
- package/esm/oas/info/info-types.d.ts +14 -0
- package/esm/oas/info/info-types.d.ts.map +1 -0
- package/esm/oas/info/info-types.js +13 -0
- package/esm/oas/integer/integer-types.d.ts +3 -17
- package/esm/oas/integer/integer-types.d.ts.map +1 -1
- package/esm/oas/license/license-types.d.ts +9 -0
- package/esm/oas/license/license-types.d.ts.map +1 -0
- package/esm/oas/license/license-types.js +7 -0
- package/esm/oas/mediaType/mediaType-types.d.ts +1 -11
- package/esm/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/esm/oas/number/number-types.d.ts +2 -16
- package/esm/oas/number/number-types.d.ts.map +1 -1
- package/esm/oas/number/toNumber.d.ts +62 -0
- package/esm/oas/number/toNumber.d.ts.map +1 -1
- package/esm/oas/number/toNumber.js +62 -0
- package/esm/oas/operation/operation-types.d.ts +22 -0
- package/esm/oas/operation/operation-types.d.ts.map +1 -0
- package/esm/oas/operation/operation-types.js +35 -0
- package/esm/oas/parameter/Parameter.d.ts +47 -0
- package/esm/oas/parameter/Parameter.d.ts.map +1 -1
- package/esm/oas/parameter/Parameter.js +47 -0
- package/esm/oas/parameter/parameter-types.d.ts +3 -58
- package/esm/oas/parameter/parameter-types.d.ts.map +1 -1
- package/esm/oas/pathItem/pathItem-types.d.ts +12 -0
- package/esm/oas/pathItem/pathItem-types.d.ts.map +1 -0
- package/esm/oas/pathItem/pathItem-types.js +12 -0
- package/esm/oas/requestBody/requestBody-types.d.ts +10 -0
- package/esm/oas/requestBody/requestBody-types.d.ts.map +1 -0
- package/esm/oas/requestBody/requestBody-types.js +9 -0
- package/esm/oas/response/response-types.d.ts +12 -0
- package/esm/oas/response/response-types.d.ts.map +1 -0
- package/esm/oas/response/response-types.js +11 -0
- package/esm/oas/schema/toSchemasV3.js +2 -2
- package/esm/oas/server/toServerV3.d.ts.map +1 -1
- package/esm/oas/string/string-types.d.ts +2 -29
- package/esm/oas/string/string-types.d.ts.map +1 -1
- package/esm/oas/string/toString.d.ts +125 -1
- package/esm/oas/string/toString.d.ts.map +1 -1
- package/esm/oas/string/toString.js +119 -0
- package/esm/oas/tag/tag-types.d.ts +8 -0
- package/esm/oas/tag/tag-types.d.ts.map +1 -0
- package/esm/oas/tag/tag-types.js +8 -0
- package/esm/oas/union/union-types.d.ts +1 -12
- package/esm/oas/union/union-types.d.ts.map +1 -1
- package/esm/oas/unknown/unknown-types.d.ts +1 -7
- package/esm/oas/unknown/unknown-types.d.ts.map +1 -1
- package/esm/types/CustomValue.d.ts +58 -0
- package/esm/types/CustomValue.d.ts.map +1 -1
- package/esm/types/CustomValue.js +58 -0
- package/esm/types/DenoJson.d.ts +24 -0
- package/esm/types/DenoJson.d.ts.map +1 -1
- package/esm/types/DenoJson.js +12 -0
- package/esm/types/Enrichments.d.ts +103 -0
- package/esm/types/Enrichments.d.ts.map +1 -1
- package/esm/types/Enrichments.js +52 -0
- package/esm/types/GeneratedValue.d.ts +17 -0
- package/esm/types/GeneratedValue.d.ts.map +1 -1
- package/esm/types/Logger.d.ts +9 -0
- package/esm/types/Logger.d.ts.map +1 -0
- package/esm/types/Logger.js +1 -0
- package/esm/types/Preview.d.ts +37 -0
- package/esm/types/Preview.d.ts.map +1 -1
- package/esm/types/Preview.js +37 -0
- package/esm/types/Settings.d.ts +35 -0
- package/esm/types/Settings.d.ts.map +1 -1
- package/esm/types/Settings.js +27 -0
- package/esm/typescript/FunctionParameter.d.ts +4 -4
- package/esm/typescript/FunctionParameter.d.ts.map +1 -1
- package/esm/typescript/List.d.ts +40 -2
- package/esm/typescript/List.d.ts.map +1 -1
- package/esm/typescript/List.js +32 -0
- package/package.json +1 -1
- package/script/context/CoreContext.d.ts +2 -2
- package/script/context/CoreContext.d.ts.map +1 -1
- package/script/context/GenerateContext.d.ts +16 -3
- package/script/context/GenerateContext.d.ts.map +1 -1
- package/script/context/ParseContext.d.ts +3 -3
- package/script/context/ParseContext.d.ts.map +1 -1
- package/script/context/RenderContext.d.ts +153 -1
- package/script/context/RenderContext.d.ts.map +1 -1
- package/script/context/RenderContext.js +179 -0
- package/script/context/types.d.ts +30 -0
- package/script/context/types.d.ts.map +1 -1
- package/script/dsl/model/ModelBase.d.ts +1 -1
- package/script/dsl/model/ModelBase.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.d.ts +62 -0
- package/script/dsl/model/ModelDriver.d.ts.map +1 -1
- package/script/dsl/model/ModelDriver.js +63 -1
- package/script/dsl/model/toModelBase.d.ts +66 -0
- package/script/dsl/model/toModelBase.d.ts.map +1 -1
- package/script/dsl/model/toModelBase.js +46 -0
- package/script/dsl/model/toModelEntry.d.ts +63 -0
- package/script/dsl/model/toModelEntry.d.ts.map +1 -1
- package/script/dsl/model/toModelEntry.js +63 -0
- package/script/dsl/operation/OperationBase.d.ts +3 -3
- package/script/dsl/operation/OperationBase.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.d.ts +84 -0
- package/script/dsl/operation/OperationDriver.d.ts.map +1 -1
- package/script/dsl/operation/OperationDriver.js +85 -1
- package/script/dsl/operation/toOperationBase.d.ts +58 -0
- package/script/dsl/operation/toOperationBase.d.ts.map +1 -1
- package/script/dsl/operation/toOperationBase.js +46 -0
- package/script/dsl/operation/toOperationEntry.d.ts +37 -0
- package/script/dsl/operation/toOperationEntry.d.ts.map +1 -1
- package/script/dsl/operation/toOperationEntry.js +28 -0
- package/script/helpers/isEmpty.d.ts +1 -1
- package/script/helpers/isEmpty.d.ts.map +1 -1
- package/script/helpers/tracer.d.ts +1 -1
- package/script/helpers/tracer.d.ts.map +1 -1
- package/script/helpers/tracer.js +1 -1
- package/script/mod.d.ts +52 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +52 -0
- package/script/oas/array/Array.d.ts +26 -0
- package/script/oas/array/Array.d.ts.map +1 -1
- package/script/oas/array/Array.js +26 -0
- package/script/oas/array/array-types.d.ts +32 -11
- package/script/oas/array/array-types.d.ts.map +1 -1
- package/script/oas/array/array-types.js +17 -1
- package/script/oas/array/toArray.d.ts +111 -0
- package/script/oas/array/toArray.d.ts.map +1 -1
- package/script/oas/array/toArray.js +114 -2
- package/script/oas/boolean/Boolean.d.ts +26 -0
- package/script/oas/boolean/Boolean.d.ts.map +1 -1
- package/script/oas/boolean/Boolean.js +26 -0
- package/script/oas/boolean/boolean-types.d.ts +1 -7
- package/script/oas/boolean/boolean-types.d.ts.map +1 -1
- package/script/oas/boolean/toBoolean.d.ts +57 -0
- package/script/oas/boolean/toBoolean.d.ts.map +1 -1
- package/script/oas/boolean/toBoolean.js +57 -0
- package/script/oas/components/components-types.d.ts +19 -0
- package/script/oas/components/components-types.d.ts.map +1 -0
- package/script/oas/components/components-types.js +57 -0
- package/script/oas/contact/contact-types.d.ts +9 -0
- package/script/oas/contact/contact-types.d.ts.map +1 -0
- package/script/oas/contact/contact-types.js +43 -0
- package/script/oas/discriminator/discriminator-types.d.ts +1 -5
- package/script/oas/discriminator/discriminator-types.d.ts.map +1 -1
- package/script/oas/document/document-types.d.ts +16 -0
- package/script/oas/document/document-types.d.ts.map +1 -0
- package/script/oas/document/document-types.js +54 -0
- package/script/oas/example/example-types.d.ts +1 -6
- package/script/oas/example/example-types.d.ts.map +1 -1
- package/script/oas/header/header-types.d.ts +50 -0
- package/script/oas/header/header-types.d.ts.map +1 -0
- package/script/oas/header/header-types.js +66 -0
- package/script/oas/info/info-types.d.ts +14 -0
- package/script/oas/info/info-types.d.ts.map +1 -0
- package/script/oas/info/info-types.js +49 -0
- package/script/oas/integer/integer-types.d.ts +3 -17
- package/script/oas/integer/integer-types.d.ts.map +1 -1
- package/script/oas/license/license-types.d.ts +9 -0
- package/script/oas/license/license-types.d.ts.map +1 -0
- package/script/oas/license/license-types.js +43 -0
- package/script/oas/mediaType/mediaType-types.d.ts +1 -11
- package/script/oas/mediaType/mediaType-types.d.ts.map +1 -1
- package/script/oas/number/number-types.d.ts +2 -16
- package/script/oas/number/number-types.d.ts.map +1 -1
- package/script/oas/number/toNumber.d.ts +62 -0
- package/script/oas/number/toNumber.d.ts.map +1 -1
- package/script/oas/number/toNumber.js +62 -0
- package/script/oas/operation/operation-types.d.ts +22 -0
- package/script/oas/operation/operation-types.d.ts.map +1 -0
- package/script/oas/operation/operation-types.js +71 -0
- package/script/oas/parameter/Parameter.d.ts +47 -0
- package/script/oas/parameter/Parameter.d.ts.map +1 -1
- package/script/oas/parameter/Parameter.js +47 -0
- package/script/oas/parameter/parameter-types.d.ts +3 -58
- package/script/oas/parameter/parameter-types.d.ts.map +1 -1
- package/script/oas/pathItem/pathItem-types.d.ts +12 -0
- package/script/oas/pathItem/pathItem-types.d.ts.map +1 -0
- package/script/oas/pathItem/pathItem-types.js +48 -0
- package/script/oas/requestBody/requestBody-types.d.ts +10 -0
- package/script/oas/requestBody/requestBody-types.d.ts.map +1 -0
- package/script/oas/requestBody/requestBody-types.js +45 -0
- package/script/oas/response/response-types.d.ts +12 -0
- package/script/oas/response/response-types.d.ts.map +1 -0
- package/script/oas/response/response-types.js +47 -0
- package/script/oas/schema/toSchemasV3.js +2 -2
- package/script/oas/server/toServerV3.d.ts.map +1 -1
- package/script/oas/string/string-types.d.ts +2 -29
- package/script/oas/string/string-types.d.ts.map +1 -1
- package/script/oas/string/toString.d.ts +125 -1
- package/script/oas/string/toString.d.ts.map +1 -1
- package/script/oas/string/toString.js +119 -0
- package/script/oas/tag/tag-types.d.ts +8 -0
- package/script/oas/tag/tag-types.d.ts.map +1 -0
- package/script/oas/tag/tag-types.js +44 -0
- package/script/oas/union/union-types.d.ts +1 -12
- package/script/oas/union/union-types.d.ts.map +1 -1
- package/script/oas/unknown/unknown-types.d.ts +1 -7
- package/script/oas/unknown/unknown-types.d.ts.map +1 -1
- package/script/types/CustomValue.d.ts +58 -0
- package/script/types/CustomValue.d.ts.map +1 -1
- package/script/types/CustomValue.js +58 -0
- package/script/types/DenoJson.d.ts +24 -0
- package/script/types/DenoJson.d.ts.map +1 -1
- package/script/types/DenoJson.js +12 -0
- package/script/types/Enrichments.d.ts +103 -0
- package/script/types/Enrichments.d.ts.map +1 -1
- package/script/types/Enrichments.js +52 -0
- package/script/types/GeneratedValue.d.ts +17 -0
- package/script/types/GeneratedValue.d.ts.map +1 -1
- package/script/types/Logger.d.ts +9 -0
- package/script/types/Logger.d.ts.map +1 -0
- package/script/types/Logger.js +2 -0
- package/script/types/Preview.d.ts +37 -0
- package/script/types/Preview.d.ts.map +1 -1
- package/script/types/Preview.js +37 -0
- package/script/types/Settings.d.ts +35 -0
- package/script/types/Settings.d.ts.map +1 -1
- package/script/types/Settings.js +27 -0
- package/script/typescript/FunctionParameter.d.ts +4 -4
- package/script/typescript/FunctionParameter.d.ts.map +1 -1
- package/script/typescript/List.d.ts +40 -2
- package/script/typescript/List.d.ts.map +1 -1
- package/script/typescript/List.js +32 -0
|
@@ -5,7 +5,7 @@ import type { PrettierConfigType } from '../types/PrettierConfig.js';
|
|
|
5
5
|
import type { OasDocument } from '../oas/document/Document.js';
|
|
6
6
|
import type { ClientSettings } from '../types/Settings.js';
|
|
7
7
|
import type { ResultType } from '../types/Results.js';
|
|
8
|
-
import
|
|
8
|
+
import type { Logger } from '../types/Logger.js';
|
|
9
9
|
import type { GeneratorsMapContainer } from '../types/GeneratorType.js';
|
|
10
10
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
11
11
|
import type { RenderResult } from './types.js';
|
|
@@ -124,7 +124,7 @@ export type ToArtifactsArgs = {
|
|
|
124
124
|
export declare class CoreContext {
|
|
125
125
|
#private;
|
|
126
126
|
/** Logger instance for the context */
|
|
127
|
-
logger:
|
|
127
|
+
logger: Logger;
|
|
128
128
|
/** Whether to suppress console output */
|
|
129
129
|
silent: boolean;
|
|
130
130
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreContext.d.ts","sourceRoot":"","sources":["../../src/context/CoreContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,YAAY,E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;;;;;;;;;;;;;;;;;;;;;;;OAsEG;IACG,WAAW,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,oBAAoB,EAAE,QAAQ,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;IA2DvH;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAkClD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;CAkB/C;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,sEAAsE;IACtE,SAAS,EAAE;QACT,yBAAyB;QACzB,SAAS,EAAE,MAAM,CAAA;QACjB,6CAA6C;QAC7C,QAAQ,EAAE,IAAI,CAAA;QACd,sBAAsB;QACtB,GAAG,EAAE,MAAM,CAAA;QACX,+BAA+B;QAC/B,IAAI,EAAE,OAAO,EAAE,CAAA;KAChB,CAAA;IACD,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,iBAAiB,GAAG,MAAM,CAQnF"}
|
|
@@ -12,6 +12,7 @@ import type { GenerationType, GeneratedValue } from '../types/GeneratedValue.js'
|
|
|
12
12
|
import { ContentSettings } from '../dsl/ContentSettings.js';
|
|
13
13
|
import type { RefName } from '../types/RefName.js';
|
|
14
14
|
import type * as log from '../deps/jsr.io/@std/log/0.224.14/mod.js';
|
|
15
|
+
import type { Logger } from '../types/Logger.js';
|
|
15
16
|
import type { ResultType } from '../types/Results.js';
|
|
16
17
|
import type { StackTrail } from './StackTrail.js';
|
|
17
18
|
import type { Identifier } from '../dsl/Identifier.js';
|
|
@@ -256,11 +257,23 @@ export type InsertModelOptions<T extends GenerationType> = {
|
|
|
256
257
|
* @template EnrichmentType - The enrichment data type
|
|
257
258
|
*/
|
|
258
259
|
export type InsertReturn<V extends GeneratedValue, T extends GenerationType, EnrichmentType> = Inserted<V, T, EnrichmentType>;
|
|
259
|
-
|
|
260
|
+
/**
|
|
261
|
+
* Arguments for generating operation content settings.
|
|
262
|
+
*
|
|
263
|
+
* @template V - The value type for the operation
|
|
264
|
+
* @template EnrichmentType - Optional enrichment type for the operation
|
|
265
|
+
*/
|
|
266
|
+
export type ToOperationSettingsArgs<V, EnrichmentType = undefined> = {
|
|
260
267
|
operation: OasOperation;
|
|
261
268
|
insertable: OperationInsertable<V, EnrichmentType>;
|
|
262
269
|
};
|
|
263
|
-
|
|
270
|
+
/**
|
|
271
|
+
* Arguments for building model content settings.
|
|
272
|
+
*
|
|
273
|
+
* @template V - The value type for the model
|
|
274
|
+
* @template EnrichmentType - Optional enrichment type for the model
|
|
275
|
+
*/
|
|
276
|
+
export type BuildModelSettingsArgs<V, EnrichmentType = undefined> = {
|
|
264
277
|
refName: RefName;
|
|
265
278
|
insertable: ModelInsertable<V, EnrichmentType>;
|
|
266
279
|
};
|
|
@@ -371,7 +384,7 @@ export declare class GenerateContext {
|
|
|
371
384
|
/** Client settings for customization (optional) */
|
|
372
385
|
settings: ClientSettings | undefined;
|
|
373
386
|
/** Logger instance for tracking generation progress */
|
|
374
|
-
logger:
|
|
387
|
+
logger: Logger;
|
|
375
388
|
/** Function to capture processing results at current stack position */
|
|
376
389
|
captureCurrentResult: (result: ResultType) => void;
|
|
377
390
|
/** Function that returns the generator configuration map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;A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
import { OasDocument } from '../oas/document/Document.js';
|
|
4
|
-
import type
|
|
4
|
+
import type { Logger } from '../types/Logger.js';
|
|
5
5
|
import type { StackTrail } from './StackTrail.js';
|
|
6
6
|
import * as v from 'valibot';
|
|
7
7
|
import type { IssueType } from './types.js';
|
|
@@ -12,7 +12,7 @@ type ConstructorArgs = {
|
|
|
12
12
|
/** The OpenAPI v3 document to parse */
|
|
13
13
|
documentObject: OpenAPIV3.Document;
|
|
14
14
|
/** Logger instance for debug information */
|
|
15
|
-
logger:
|
|
15
|
+
logger: Logger;
|
|
16
16
|
/** Stack trail for distributed tracing */
|
|
17
17
|
stackTrail: StackTrail;
|
|
18
18
|
/** Whether to suppress console output */
|
|
@@ -244,7 +244,7 @@ export declare class ParseContext {
|
|
|
244
244
|
/** The original OpenAPI v3 document being parsed */
|
|
245
245
|
documentObject: OpenAPIV3.Document;
|
|
246
246
|
/** Logger instance for tracking parse progress and issues */
|
|
247
|
-
logger:
|
|
247
|
+
logger: Logger;
|
|
248
248
|
/** The parsed OAS document result */
|
|
249
249
|
oasDocument: OasDocument;
|
|
250
250
|
/** Stack trail for tracking current parsing context */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAo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IACH,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY;IAItD;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB;CAqB5D;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,KAAG,SAAS,CAAC,QAMtD,CAAA"}
|
|
@@ -5,6 +5,7 @@ import type { PickArgs } from './GenerateContext.js';
|
|
|
5
5
|
import type { ResultType } from '../types/Results.js';
|
|
6
6
|
import type { StackTrail } from './StackTrail.js';
|
|
7
7
|
import type * as log from '../deps/jsr.io/@std/log/0.224.14/mod.js';
|
|
8
|
+
import type { Logger } from '../types/Logger.js';
|
|
8
9
|
import { File } from '../dsl/File.js';
|
|
9
10
|
import type { Preview, Mapping } from '../types/Preview.js';
|
|
10
11
|
import type { JsonFile } from '../dsl/JsonFile.js';
|
|
@@ -210,17 +211,168 @@ type ConstructorArgs = {
|
|
|
210
211
|
*/
|
|
211
212
|
export declare class RenderContext {
|
|
212
213
|
#private;
|
|
214
|
+
/** Map of generated files to render */
|
|
213
215
|
files: Map<string, File | JsonFile>;
|
|
216
|
+
/** Preview data for generated content */
|
|
214
217
|
previews: Record<string, Record<string, Preview>>;
|
|
218
|
+
/** Mapping data for file relationships */
|
|
215
219
|
mappings: Record<string, Record<string, Mapping>>;
|
|
220
|
+
/** Base path for resolving file paths */
|
|
216
221
|
basePath: string | undefined;
|
|
217
|
-
|
|
222
|
+
/** Logger instance for debug information */
|
|
223
|
+
logger: Logger;
|
|
224
|
+
/** Function to capture result status */
|
|
218
225
|
captureCurrentResult: (result: ResultType) => void;
|
|
226
|
+
/**
|
|
227
|
+
* Creates a new RenderContext instance with the specified configuration.
|
|
228
|
+
*
|
|
229
|
+
* Initializes the rendering context with files to render, preview data,
|
|
230
|
+
* formatting configuration, and logging/tracing infrastructure.
|
|
231
|
+
*
|
|
232
|
+
* @param args - Constructor arguments containing all required configuration
|
|
233
|
+
*/
|
|
219
234
|
constructor({ files, previews, mappings, prettierConfig, basePath, logger, stackTrail, captureCurrentResult }: ConstructorArgs);
|
|
235
|
+
/**
|
|
236
|
+
* Renders all files in the context to their final formatted form.
|
|
237
|
+
*
|
|
238
|
+
* This is the main rendering method that orchestrates the collation and
|
|
239
|
+
* formatting of all generated files. It processes files through Prettier
|
|
240
|
+
* formatting (if configured), resolves paths, and produces the final
|
|
241
|
+
* artifacts ready for writing to the filesystem.
|
|
242
|
+
*
|
|
243
|
+
* The method is wrapped in Sentry tracing spans for performance monitoring
|
|
244
|
+
* and includes both collation and artifact preparation phases.
|
|
245
|
+
*
|
|
246
|
+
* @returns Promise resolving to render result containing artifacts, file metadata, previews, and mappings
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```typescript
|
|
250
|
+
* const renderContext = new RenderContext({
|
|
251
|
+
* files: generatedFiles,
|
|
252
|
+
* previews: previewData,
|
|
253
|
+
* mappings: mappingData,
|
|
254
|
+
* prettierConfig: { semi: false, singleQuote: true },
|
|
255
|
+
* basePath: './src/generated',
|
|
256
|
+
* stackTrail: traceStack,
|
|
257
|
+
* logger: logger,
|
|
258
|
+
* captureCurrentResult: resultHandler
|
|
259
|
+
* });
|
|
260
|
+
*
|
|
261
|
+
* const result = await renderContext.render();
|
|
262
|
+
*
|
|
263
|
+
* // Access rendered files
|
|
264
|
+
* Object.entries(result.artifacts).forEach(([path, content]) => {
|
|
265
|
+
* console.log(`Rendered ${path}: ${result.files[path].lines} lines`);
|
|
266
|
+
* });
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
220
269
|
render(): Promise<Omit<RenderResult, 'results'>>;
|
|
270
|
+
/**
|
|
271
|
+
* Collates all files in the context into a unified render result.
|
|
272
|
+
*
|
|
273
|
+
* This method processes each file in the context through the rendering pipeline,
|
|
274
|
+
* applying Prettier formatting and path resolution. It coordinates the parallel
|
|
275
|
+
* processing of all files and aggregates the results into a single output structure.
|
|
276
|
+
*
|
|
277
|
+
* The collation process includes:
|
|
278
|
+
* - File content rendering with optional Prettier formatting
|
|
279
|
+
* - Path resolution using base path configuration
|
|
280
|
+
* - Metadata calculation (line count, character count)
|
|
281
|
+
* - Result aggregation into artifacts and file metadata maps
|
|
282
|
+
*
|
|
283
|
+
* @returns Promise resolving to collated files with artifacts and metadata
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```typescript
|
|
287
|
+
* const collated = await renderContext.collate();
|
|
288
|
+
*
|
|
289
|
+
* // Access rendered file content
|
|
290
|
+
* console.log(collated.artifacts['/path/to/file.ts']);
|
|
291
|
+
*
|
|
292
|
+
* // Access file metadata
|
|
293
|
+
* console.log(collated.files['/path/to/file.ts'].lines);
|
|
294
|
+
* console.log(collated.files['/path/to/file.ts'].characters);
|
|
295
|
+
* ```
|
|
296
|
+
*/
|
|
221
297
|
collate(): Promise<FilesRenderResult>;
|
|
298
|
+
/**
|
|
299
|
+
* Executes a function within a tracing context for performance monitoring.
|
|
300
|
+
*
|
|
301
|
+
* This method wraps function execution with distributed tracing capabilities,
|
|
302
|
+
* allowing performance monitoring and debugging of the rendering pipeline.
|
|
303
|
+
* It integrates with the stack trail to provide hierarchical tracing.
|
|
304
|
+
*
|
|
305
|
+
* @template T - The return type of the traced function
|
|
306
|
+
* @param token - Trace identifier (string or array of strings)
|
|
307
|
+
* @param fn - Function to execute within the trace context
|
|
308
|
+
* @returns The result of executing the traced function
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* ```typescript
|
|
312
|
+
* const result = renderContext.trace('format-file', () => {
|
|
313
|
+
* return prettier.format(content, prettierConfig);
|
|
314
|
+
* });
|
|
315
|
+
*
|
|
316
|
+
* // With hierarchical tracing
|
|
317
|
+
* const result = renderContext.trace(['render', 'format'], () => {
|
|
318
|
+
* return complexFormattingOperation();
|
|
319
|
+
* });
|
|
320
|
+
* ```
|
|
321
|
+
*/
|
|
222
322
|
trace<T>(token: string | string[], fn: () => T): T;
|
|
323
|
+
/**
|
|
324
|
+
* Retrieves a file from the context by its normalized path.
|
|
325
|
+
*
|
|
326
|
+
* This method looks up a file in the context's file map using path normalization
|
|
327
|
+
* to ensure consistent path resolution. It validates that the requested file
|
|
328
|
+
* exists and throws an error if not found.
|
|
329
|
+
*
|
|
330
|
+
* @param filePath - The file path to retrieve (will be normalized)
|
|
331
|
+
* @returns The File or JsonFile instance
|
|
332
|
+
* @throws {Error} When the file is not found in the context
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* ```typescript
|
|
336
|
+
* const file = renderContext.getFile('./src/models/User.ts');
|
|
337
|
+
* console.log(file.toString()); // Access file content
|
|
338
|
+
*
|
|
339
|
+
* // Works with various path formats
|
|
340
|
+
* const sameFile = renderContext.getFile('src/models/User.ts');
|
|
341
|
+
* const alsoSameFile = renderContext.getFile('/absolute/path/src/models/User.ts');
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
223
344
|
getFile(filePath: string): File | JsonFile;
|
|
345
|
+
/**
|
|
346
|
+
* Picks a specific definition from a file in the context.
|
|
347
|
+
*
|
|
348
|
+
* This method retrieves a named definition (type, interface, etc.) from
|
|
349
|
+
* a specific file in the context. It validates that the target file is
|
|
350
|
+
* a File type (not JsonFile) and returns the requested definition if found.
|
|
351
|
+
*
|
|
352
|
+
* @param args - Object containing the definition name and export path
|
|
353
|
+
* @param args.name - The name of the definition to retrieve
|
|
354
|
+
* @param args.exportPath - The path to the file containing the definition
|
|
355
|
+
* @returns The Definition instance if found, undefined otherwise
|
|
356
|
+
* @throws {Error} When the file is not found or is not a File type
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```typescript
|
|
360
|
+
* const userDefinition = renderContext.pick({
|
|
361
|
+
* name: 'User',
|
|
362
|
+
* exportPath: './src/models/User.ts'
|
|
363
|
+
* });
|
|
364
|
+
*
|
|
365
|
+
* if (userDefinition) {
|
|
366
|
+
* console.log(userDefinition.identifier); // Access definition details
|
|
367
|
+
* }
|
|
368
|
+
*
|
|
369
|
+
* // Pick interface definition
|
|
370
|
+
* const apiInterface = renderContext.pick({
|
|
371
|
+
* name: 'ApiResponse',
|
|
372
|
+
* exportPath: './src/types/api.ts'
|
|
373
|
+
* });
|
|
374
|
+
* ```
|
|
375
|
+
*/
|
|
224
376
|
pick({ name, exportPath }: PickArgs): Definition | undefined;
|
|
225
377
|
}
|
|
226
378
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderContext.d.ts","sourceRoot":"","sources":["../../src/context/RenderContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAGrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,KAAK,GAAG,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAElD;;GAEG;AACH,KAAK,eAAe,GAAG;IACrB,uCAAuC;IACvC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,GAAG,QAAQ,CAAC,CAAA;IACnC,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACjD,0CAA0C;IAC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E,QAAQ,GAAG,UAAU,GAAG,SAAS;CAO7D"}
|
|
@@ -197,39 +197,55 @@ import * as prettier from 'prettier';
|
|
|
197
197
|
* ```
|
|
198
198
|
*/
|
|
199
199
|
export class RenderContext {
|
|
200
|
+
/**
|
|
201
|
+
* Creates a new RenderContext instance with the specified configuration.
|
|
202
|
+
*
|
|
203
|
+
* Initializes the rendering context with files to render, preview data,
|
|
204
|
+
* formatting configuration, and logging/tracing infrastructure.
|
|
205
|
+
*
|
|
206
|
+
* @param args - Constructor arguments containing all required configuration
|
|
207
|
+
*/
|
|
200
208
|
constructor({ files, previews, mappings, prettierConfig, basePath, logger, stackTrail, captureCurrentResult }) {
|
|
209
|
+
/** Map of generated files to render */
|
|
201
210
|
Object.defineProperty(this, "files", {
|
|
202
211
|
enumerable: true,
|
|
203
212
|
configurable: true,
|
|
204
213
|
writable: true,
|
|
205
214
|
value: void 0
|
|
206
215
|
});
|
|
216
|
+
/** Preview data for generated content */
|
|
207
217
|
Object.defineProperty(this, "previews", {
|
|
208
218
|
enumerable: true,
|
|
209
219
|
configurable: true,
|
|
210
220
|
writable: true,
|
|
211
221
|
value: void 0
|
|
212
222
|
});
|
|
223
|
+
/** Mapping data for file relationships */
|
|
213
224
|
Object.defineProperty(this, "mappings", {
|
|
214
225
|
enumerable: true,
|
|
215
226
|
configurable: true,
|
|
216
227
|
writable: true,
|
|
217
228
|
value: void 0
|
|
218
229
|
});
|
|
230
|
+
/** Optional Prettier configuration for code formatting */
|
|
219
231
|
_RenderContext_prettierConfig.set(this, void 0);
|
|
232
|
+
/** Base path for resolving file paths */
|
|
220
233
|
Object.defineProperty(this, "basePath", {
|
|
221
234
|
enumerable: true,
|
|
222
235
|
configurable: true,
|
|
223
236
|
writable: true,
|
|
224
237
|
value: void 0
|
|
225
238
|
});
|
|
239
|
+
/** Logger instance for debug information */
|
|
226
240
|
Object.defineProperty(this, "logger", {
|
|
227
241
|
enumerable: true,
|
|
228
242
|
configurable: true,
|
|
229
243
|
writable: true,
|
|
230
244
|
value: void 0
|
|
231
245
|
});
|
|
246
|
+
/** Stack trail for distributed tracing */
|
|
232
247
|
_RenderContext_stackTrail.set(this, void 0);
|
|
248
|
+
/** Function to capture result status */
|
|
233
249
|
Object.defineProperty(this, "captureCurrentResult", {
|
|
234
250
|
enumerable: true,
|
|
235
251
|
configurable: true,
|
|
@@ -245,6 +261,40 @@ export class RenderContext {
|
|
|
245
261
|
__classPrivateFieldSet(this, _RenderContext_stackTrail, stackTrail, "f");
|
|
246
262
|
this.captureCurrentResult = captureCurrentResult;
|
|
247
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Renders all files in the context to their final formatted form.
|
|
266
|
+
*
|
|
267
|
+
* This is the main rendering method that orchestrates the collation and
|
|
268
|
+
* formatting of all generated files. It processes files through Prettier
|
|
269
|
+
* formatting (if configured), resolves paths, and produces the final
|
|
270
|
+
* artifacts ready for writing to the filesystem.
|
|
271
|
+
*
|
|
272
|
+
* The method is wrapped in Sentry tracing spans for performance monitoring
|
|
273
|
+
* and includes both collation and artifact preparation phases.
|
|
274
|
+
*
|
|
275
|
+
* @returns Promise resolving to render result containing artifacts, file metadata, previews, and mappings
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```typescript
|
|
279
|
+
* const renderContext = new RenderContext({
|
|
280
|
+
* files: generatedFiles,
|
|
281
|
+
* previews: previewData,
|
|
282
|
+
* mappings: mappingData,
|
|
283
|
+
* prettierConfig: { semi: false, singleQuote: true },
|
|
284
|
+
* basePath: './src/generated',
|
|
285
|
+
* stackTrail: traceStack,
|
|
286
|
+
* logger: logger,
|
|
287
|
+
* captureCurrentResult: resultHandler
|
|
288
|
+
* });
|
|
289
|
+
*
|
|
290
|
+
* const result = await renderContext.render();
|
|
291
|
+
*
|
|
292
|
+
* // Access rendered files
|
|
293
|
+
* Object.entries(result.artifacts).forEach(([path, content]) => {
|
|
294
|
+
* console.log(`Rendered ${path}: ${result.files[path].lines} lines`);
|
|
295
|
+
* });
|
|
296
|
+
* ```
|
|
297
|
+
*/
|
|
248
298
|
async render() {
|
|
249
299
|
return await Sentry.startSpan({ name: 'Render artifacts' }, async () => {
|
|
250
300
|
const result = await Sentry.startSpan({ name: 'Collate content' }, async () => {
|
|
@@ -259,6 +309,33 @@ export class RenderContext {
|
|
|
259
309
|
return rendered;
|
|
260
310
|
});
|
|
261
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Collates all files in the context into a unified render result.
|
|
314
|
+
*
|
|
315
|
+
* This method processes each file in the context through the rendering pipeline,
|
|
316
|
+
* applying Prettier formatting and path resolution. It coordinates the parallel
|
|
317
|
+
* processing of all files and aggregates the results into a single output structure.
|
|
318
|
+
*
|
|
319
|
+
* The collation process includes:
|
|
320
|
+
* - File content rendering with optional Prettier formatting
|
|
321
|
+
* - Path resolution using base path configuration
|
|
322
|
+
* - Metadata calculation (line count, character count)
|
|
323
|
+
* - Result aggregation into artifacts and file metadata maps
|
|
324
|
+
*
|
|
325
|
+
* @returns Promise resolving to collated files with artifacts and metadata
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* ```typescript
|
|
329
|
+
* const collated = await renderContext.collate();
|
|
330
|
+
*
|
|
331
|
+
* // Access rendered file content
|
|
332
|
+
* console.log(collated.artifacts['/path/to/file.ts']);
|
|
333
|
+
*
|
|
334
|
+
* // Access file metadata
|
|
335
|
+
* console.log(collated.files['/path/to/file.ts'].lines);
|
|
336
|
+
* console.log(collated.files['/path/to/file.ts'].characters);
|
|
337
|
+
* ```
|
|
338
|
+
*/
|
|
262
339
|
async collate() {
|
|
263
340
|
const fileEntries = Array.from(this.files.entries());
|
|
264
341
|
const fileObjectPromises = fileEntries
|
|
@@ -290,15 +367,91 @@ export class RenderContext {
|
|
|
290
367
|
}
|
|
291
368
|
return output;
|
|
292
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
* Executes a function within a tracing context for performance monitoring.
|
|
372
|
+
*
|
|
373
|
+
* This method wraps function execution with distributed tracing capabilities,
|
|
374
|
+
* allowing performance monitoring and debugging of the rendering pipeline.
|
|
375
|
+
* It integrates with the stack trail to provide hierarchical tracing.
|
|
376
|
+
*
|
|
377
|
+
* @template T - The return type of the traced function
|
|
378
|
+
* @param token - Trace identifier (string or array of strings)
|
|
379
|
+
* @param fn - Function to execute within the trace context
|
|
380
|
+
* @returns The result of executing the traced function
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```typescript
|
|
384
|
+
* const result = renderContext.trace('format-file', () => {
|
|
385
|
+
* return prettier.format(content, prettierConfig);
|
|
386
|
+
* });
|
|
387
|
+
*
|
|
388
|
+
* // With hierarchical tracing
|
|
389
|
+
* const result = renderContext.trace(['render', 'format'], () => {
|
|
390
|
+
* return complexFormattingOperation();
|
|
391
|
+
* });
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
293
394
|
trace(token, fn) {
|
|
294
395
|
return tracer(__classPrivateFieldGet(this, _RenderContext_stackTrail, "f"), token, fn, this.logger);
|
|
295
396
|
}
|
|
397
|
+
/**
|
|
398
|
+
* Retrieves a file from the context by its normalized path.
|
|
399
|
+
*
|
|
400
|
+
* This method looks up a file in the context's file map using path normalization
|
|
401
|
+
* to ensure consistent path resolution. It validates that the requested file
|
|
402
|
+
* exists and throws an error if not found.
|
|
403
|
+
*
|
|
404
|
+
* @param filePath - The file path to retrieve (will be normalized)
|
|
405
|
+
* @returns The File or JsonFile instance
|
|
406
|
+
* @throws {Error} When the file is not found in the context
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* ```typescript
|
|
410
|
+
* const file = renderContext.getFile('./src/models/User.ts');
|
|
411
|
+
* console.log(file.toString()); // Access file content
|
|
412
|
+
*
|
|
413
|
+
* // Works with various path formats
|
|
414
|
+
* const sameFile = renderContext.getFile('src/models/User.ts');
|
|
415
|
+
* const alsoSameFile = renderContext.getFile('/absolute/path/src/models/User.ts');
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
296
418
|
getFile(filePath) {
|
|
297
419
|
const normalisedPath = normalize(filePath);
|
|
298
420
|
const currentFile = this.files.get(normalisedPath);
|
|
299
421
|
invariant(currentFile, `File not found during render phase: ${normalisedPath}`);
|
|
300
422
|
return currentFile;
|
|
301
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* Picks a specific definition from a file in the context.
|
|
426
|
+
*
|
|
427
|
+
* This method retrieves a named definition (type, interface, etc.) from
|
|
428
|
+
* a specific file in the context. It validates that the target file is
|
|
429
|
+
* a File type (not JsonFile) and returns the requested definition if found.
|
|
430
|
+
*
|
|
431
|
+
* @param args - Object containing the definition name and export path
|
|
432
|
+
* @param args.name - The name of the definition to retrieve
|
|
433
|
+
* @param args.exportPath - The path to the file containing the definition
|
|
434
|
+
* @returns The Definition instance if found, undefined otherwise
|
|
435
|
+
* @throws {Error} When the file is not found or is not a File type
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* ```typescript
|
|
439
|
+
* const userDefinition = renderContext.pick({
|
|
440
|
+
* name: 'User',
|
|
441
|
+
* exportPath: './src/models/User.ts'
|
|
442
|
+
* });
|
|
443
|
+
*
|
|
444
|
+
* if (userDefinition) {
|
|
445
|
+
* console.log(userDefinition.identifier); // Access definition details
|
|
446
|
+
* }
|
|
447
|
+
*
|
|
448
|
+
* // Pick interface definition
|
|
449
|
+
* const apiInterface = renderContext.pick({
|
|
450
|
+
* name: 'ApiResponse',
|
|
451
|
+
* exportPath: './src/types/api.ts'
|
|
452
|
+
* });
|
|
453
|
+
* ```
|
|
454
|
+
*/
|
|
302
455
|
pick({ name, exportPath }) {
|
|
303
456
|
const file = this.getFile(exportPath);
|
|
304
457
|
invariant(file instanceof File, `File at "${exportPath}" is not a "File" type`);
|
|
@@ -306,6 +459,32 @@ export class RenderContext {
|
|
|
306
459
|
}
|
|
307
460
|
}
|
|
308
461
|
_RenderContext_prettierConfig = new WeakMap(), _RenderContext_stackTrail = new WeakMap();
|
|
462
|
+
/**
|
|
463
|
+
* Renders a single file with formatting and metadata calculation.
|
|
464
|
+
*
|
|
465
|
+
* This function processes a single file through the rendering pipeline,
|
|
466
|
+
* applying Prettier formatting if configured and calculating file metadata
|
|
467
|
+
* such as line count and character count. It resolves the final path using
|
|
468
|
+
* the base path configuration.
|
|
469
|
+
*
|
|
470
|
+
* @param args - File rendering arguments
|
|
471
|
+
* @returns Promise resolving to a FileObject with content and metadata
|
|
472
|
+
*
|
|
473
|
+
* @example
|
|
474
|
+
* ```typescript
|
|
475
|
+
* const fileObject = await renderFile({
|
|
476
|
+
* content: 'const x = 1;',
|
|
477
|
+
* destinationPath: 'utils.ts',
|
|
478
|
+
* basePath: './src',
|
|
479
|
+
* prettierConfig: { semi: false }
|
|
480
|
+
* });
|
|
481
|
+
*
|
|
482
|
+
* console.log(fileObject.path); // './src/utils.ts'
|
|
483
|
+
* console.log(fileObject.content); // 'const x = 1' (formatted)
|
|
484
|
+
* console.log(fileObject.lines); // 1
|
|
485
|
+
* console.log(fileObject.characters); // 11
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
309
488
|
const renderFile = async ({ content, destinationPath, basePath, prettierConfig }) => {
|
|
310
489
|
const path = toResolvedArtifactPath({ basePath, destinationPath });
|
|
311
490
|
const formatted = prettierConfig
|