@contractkit/plugin-typescript 0.18.0 → 0.19.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.
@@ -634,7 +634,7 @@ export function <span class="fstat-no" title="function not covered" >computePubl
634
634
  <div class='footer quiet pad2 space-top1 center small'>
635
635
  Code coverage generated by
636
636
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
637
- at 2026-05-06T16:22:17.029Z
637
+ at 2026-05-07T11:16:43.674Z
638
638
  </div>
639
639
  <script src="../prettify.js"></script>
640
640
  <script>
@@ -577,7 +577,7 @@ export function renderOutputTsType(type: ContractTypeNode, modelsWithOutput?: Se
577
577
  <div class='footer quiet pad2 space-top1 center small'>
578
578
  Code coverage generated by
579
579
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
580
- at 2026-05-06T16:22:17.029Z
580
+ at 2026-05-07T11:16:43.674Z
581
581
  </div>
582
582
  <script src="../prettify.js"></script>
583
583
  <script>
@@ -811,7 +811,7 @@ operation /users/{id}: {
811
811
  <div class='footer quiet pad2 space-top1 center small'>
812
812
  Code coverage generated by
813
813
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
814
- at 2026-05-06T16:22:17.029Z
814
+ at 2026-05-07T11:16:43.674Z
815
815
  </div>
816
816
  <script src="../prettify.js"></script>
817
817
  <script>
@@ -101,7 +101,7 @@
101
101
  <div class='footer quiet pad2 space-top1 center small'>
102
102
  Code coverage generated by
103
103
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
104
- at 2026-05-06T16:22:17.029Z
104
+ at 2026-05-07T11:16:43.674Z
105
105
  </div>
106
106
  <script src="../prettify.js"></script>
107
107
  <script>
package/dist/index.d.ts CHANGED
@@ -2,81 +2,48 @@ import type { ContractKitPlugin } from '@contractkit/core';
2
2
  export interface ServerConfig {
3
3
  /** Directory (relative to rootDir) where server files are written. Default: rootDir. */
4
4
  baseDir?: string;
5
- /**
6
- * When true, `output.types` emits Zod schema files (via `generateContract`).
7
- * When false/omitted, `output.types` emits plain TypeScript interfaces.
8
- */
5
+ /** When true, `output.types` emits Zod schema files (via `generateContract`). When false/omitted, emits plain TypeScript. */
9
6
  zod?: boolean;
10
7
  output?: {
11
- /** Path template for Koa router files. Supports {filename}, {dir}, {area}. Default: `{filename}.router.ts`. */
8
+ /** Path template for Koa router files. Supports {filename}, {dir}, {area}. */
12
9
  routes?: string;
13
- /**
14
- * Path template for type/schema files. Supports {filename}, {dir}, {area}.
15
- * Generates Zod schemas when `zod: true`, otherwise plain TypeScript interfaces.
16
- */
10
+ /** Path template for type/schema files. Supports {filename}, {dir}, {area}. */
17
11
  types?: string;
18
12
  };
19
- /** Import path template for service implementations. Supports {module}. */
13
+ /** Import path template for service implementations. */
20
14
  servicePathTemplate?: string;
21
- /**
22
- * Whether to emit handlers for operations marked `internal`. Defaults to `true` —
23
- * the server still needs routes for internal endpoints. Set to `false` to omit them.
24
- */
15
+ /** Whether to emit handlers for `internal` operations. Default true. */
25
16
  includeInternal?: boolean;
26
17
  }
27
18
  export interface SdkConfig {
28
- /** Directory (relative to rootDir) where SDK files are written. Default: rootDir. */
29
19
  baseDir?: string;
30
- /** Name used for the aggregator SDK class (e.g. "homegrown" → `HomegrownSdk`). */
31
20
  name?: string;
32
- /**
33
- * When true, `output.types` emits Zod schema files (via `generateContract`).
34
- * When false/omitted, `output.types` emits plain TypeScript interfaces.
35
- */
36
21
  zod?: boolean;
37
22
  output?: {
38
- /** Path template for the SDK aggregator file. Supports {name}. Default: `sdk.ts`. */
39
23
  sdk?: string;
40
- /** Path template for SDK type files. Supports {filename}, {dir}, {area}, {subarea}. */
41
24
  types?: string;
42
- /** Path template for client class files. Supports {filename}, {dir}, {area}, {subarea}. */
43
25
  clients?: string;
44
26
  };
45
- /**
46
- * Whether to emit SDK methods for operations marked `internal`. Defaults to `false` —
47
- * internal ops are omitted from the SDK so consumers don't pick them up. Set to `true`
48
- * for an internal-use SDK that should expose them.
49
- */
50
27
  includeInternal?: boolean;
51
28
  }
52
29
  export interface ZodConfig {
53
- /** Directory (relative to rootDir) where Zod schema files are written. Default: rootDir. */
54
30
  baseDir?: string;
55
- /** Output path template. Supports {filename}, {dir}. Default: `{filename}.schema.ts` alongside source. */
56
31
  output?: string;
57
32
  }
58
33
  export interface TypesConfig {
59
- /** Directory (relative to rootDir) where plain TypeScript type files are written. Default: rootDir. */
60
34
  baseDir?: string;
61
- /** Output path template. Supports {filename}, {dir}. Default: `{filename}.types.ts` alongside source. */
62
35
  output?: string;
63
36
  }
64
37
  export interface TypescriptPluginConfig {
65
- /** Generate Koa router files from `operation` declarations. */
66
38
  server?: ServerConfig;
67
- /** Generate TypeScript SDK client files from `operation` declarations. */
68
39
  sdk?: SdkConfig;
69
- /** Generate Zod schema files from `contract` declarations. */
70
40
  zod?: ZodConfig;
71
- /** Generate plain TypeScript interface/type files from `contract` declarations (no Zod runtime). */
72
41
  types?: TypesConfig;
73
42
  }
43
+ /** Bumped when the codegen output shape changes in a way that should bust every per-file fingerprint. */
44
+ export declare const TYPESCRIPT_CODEGEN_VERSION = "1";
74
45
  declare const plugin: ContractKitPlugin;
75
46
  export default plugin;
76
- /**
77
- * Build a `@contractkit/plugin-typescript` instance with explicit configuration, for
78
- * programmatic use (tests, custom build scripts). Prefer the default export when loading
79
- * via `contractkit.config.json`.
80
- */
47
+ /** Build a `@contractkit/plugin-typescript` instance with explicit configuration, for programmatic use. */
81
48
  export declare function createTypescriptPlugin(config: TypescriptPluginConfig, rootDir: string): ContractKitPlugin;
82
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AA6B3D,MAAM,WAAW,YAAY;IACzB,wFAAwF;IACxF,OAAO,CAAC,EAAE,MA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