ts-procedures 8.1.0 → 8.2.0

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.
Files changed (131) hide show
  1. package/README.md +14 -0
  2. package/agent_config/claude-code/skills/ts-procedures/api-reference.md +1 -1
  3. package/agent_config/claude-code/skills/ts-procedures/patterns.md +3 -3
  4. package/agent_config/claude-code/skills/ts-procedures-scaffold/templates/client.md +4 -2
  5. package/agent_config/copilot/copilot-instructions.md +3 -3
  6. package/agent_config/cursor/cursorrules +3 -3
  7. package/build/client/call.test.js +1 -1
  8. package/build/client/call.test.js.map +1 -1
  9. package/build/client/errors.js +0 -1
  10. package/build/client/errors.js.map +1 -1
  11. package/build/client/hooks.test.js +1 -1
  12. package/build/client/hooks.test.js.map +1 -1
  13. package/build/client/index.js +1 -1
  14. package/build/client/index.js.map +1 -1
  15. package/build/client/typed-error-dispatch.test.js +6 -3
  16. package/build/client/typed-error-dispatch.test.js.map +1 -1
  17. package/build/codegen/bin/cli.js +1 -1
  18. package/build/codegen/bin/cli.js.map +1 -1
  19. package/build/codegen/bin/cli.test.js +2 -2
  20. package/build/codegen/bin/cli.test.js.map +1 -1
  21. package/build/codegen/bundle-size.test.js +0 -1
  22. package/build/codegen/bundle-size.test.js.map +1 -1
  23. package/build/codegen/constants.d.ts +8 -1
  24. package/build/codegen/constants.js +9 -1
  25. package/build/codegen/constants.js.map +1 -1
  26. package/build/codegen/e2e.test.js +1 -1
  27. package/build/codegen/e2e.test.js.map +1 -1
  28. package/build/codegen/emit-client-types.test.js +1 -0
  29. package/build/codegen/emit-client-types.test.js.map +1 -1
  30. package/build/codegen/emit-errors.test.js +1 -1
  31. package/build/codegen/emit-errors.test.js.map +1 -1
  32. package/build/codegen/emit-index.test.js +1 -1
  33. package/build/codegen/emit-index.test.js.map +1 -1
  34. package/build/codegen/emit-scope.js +1 -1
  35. package/build/codegen/emit-scope.js.map +1 -1
  36. package/build/codegen/emit-scope.test.js +1 -1
  37. package/build/codegen/emit-scope.test.js.map +1 -1
  38. package/build/codegen/pipeline.js +1 -1
  39. package/build/codegen/pipeline.js.map +1 -1
  40. package/build/codegen/pipeline.test.js +33 -10
  41. package/build/codegen/pipeline.test.js.map +1 -1
  42. package/build/codegen/targets/_shared/write-files.d.ts +11 -5
  43. package/build/codegen/targets/_shared/write-files.js +49 -7
  44. package/build/codegen/targets/_shared/write-files.js.map +1 -1
  45. package/build/codegen/targets/_shared/write-files.test.js +87 -21
  46. package/build/codegen/targets/_shared/write-files.test.js.map +1 -1
  47. package/build/codegen/targets/kotlin/emit-scope-kotlin.js +3 -2
  48. package/build/codegen/targets/kotlin/emit-scope-kotlin.js.map +1 -1
  49. package/build/codegen/targets/kotlin/format-kotlin.d.ts +6 -0
  50. package/build/codegen/targets/kotlin/format-kotlin.js +9 -0
  51. package/build/codegen/targets/kotlin/format-kotlin.js.map +1 -1
  52. package/build/codegen/targets/kotlin/format-kotlin.test.js +8 -1
  53. package/build/codegen/targets/kotlin/format-kotlin.test.js.map +1 -1
  54. package/build/codegen/targets/swift/format-swift.js +4 -1
  55. package/build/codegen/targets/swift/format-swift.js.map +1 -1
  56. package/build/codegen/test-helpers/golden.js +0 -1
  57. package/build/codegen/test-helpers/golden.js.map +1 -1
  58. package/build/create-http-stream.d.ts +2 -2
  59. package/build/create-http.d.ts +3 -3
  60. package/build/create-http.js.map +1 -1
  61. package/build/create-http.test.js +1 -1
  62. package/build/create-http.test.js.map +1 -1
  63. package/build/create-stream.d.ts +2 -2
  64. package/build/create-stream.test.js +1 -2
  65. package/build/create-stream.test.js.map +1 -1
  66. package/build/create.d.ts +2 -2
  67. package/build/create.test.js +1 -2
  68. package/build/create.test.js.map +1 -1
  69. package/build/errors.d.ts +2 -2
  70. package/build/errors.js.map +1 -1
  71. package/build/implementations/http/hono/index.d.ts +2 -1
  72. package/build/implementations/http/hono/index.js.map +1 -1
  73. package/build/implementations/types.d.ts +1 -1
  74. package/build/index.d.ts +9 -9
  75. package/build/index.js +1 -0
  76. package/build/index.js.map +1 -1
  77. package/build/index.test.js +0 -1
  78. package/build/index.test.js.map +1 -1
  79. package/build/schema/compute-schema.d.ts +3 -3
  80. package/build/schema/compute-schema.js.map +1 -1
  81. package/build/schema/extract-json-schema.d.ts +1 -1
  82. package/build/schema/parser.d.ts +1 -1
  83. package/build/schema/resolve-schema-lib.d.ts +2 -2
  84. package/build/schema/types.d.ts +2 -2
  85. package/build/stack-utils.test.js.map +1 -1
  86. package/build/types.d.ts +2 -2
  87. package/docs/client-and-codegen.md +2 -2
  88. package/docs/decisions/2026-06-02-monorepo-split-evaluation.md +80 -0
  89. package/docs/npm-workspaces-migration-plan.md +611 -0
  90. package/package.json +2 -1
  91. package/src/client/errors.ts +1 -1
  92. package/src/client/typed-error-dispatch.test.ts +1 -2
  93. package/src/codegen/bin/cli.test.ts +2 -2
  94. package/src/codegen/bin/cli.ts +1 -1
  95. package/src/codegen/bundle-size.test.ts +1 -1
  96. package/src/codegen/constants.ts +10 -1
  97. package/src/codegen/e2e.test.ts +1 -1
  98. package/src/codegen/emit-errors.test.ts +1 -1
  99. package/src/codegen/emit-index.test.ts +1 -1
  100. package/src/codegen/emit-scope.test.ts +1 -1
  101. package/src/codegen/pipeline.test.ts +39 -10
  102. package/src/codegen/pipeline.ts +1 -1
  103. package/src/codegen/targets/_shared/write-files.test.ts +143 -32
  104. package/src/codegen/targets/_shared/write-files.ts +53 -8
  105. package/src/codegen/targets/kotlin/__fixtures__/users-golden.kt +1 -0
  106. package/src/codegen/targets/kotlin/emit-scope-kotlin.ts +3 -2
  107. package/src/codegen/targets/kotlin/format-kotlin.test.ts +9 -0
  108. package/src/codegen/targets/kotlin/format-kotlin.ts +11 -0
  109. package/src/codegen/targets/swift/format-swift.ts +5 -1
  110. package/src/codegen/test-helpers/golden.ts +1 -1
  111. package/src/create-http-stream.ts +2 -2
  112. package/src/create-http.ts +2 -3
  113. package/src/create-stream.test.ts +1 -1
  114. package/src/create-stream.ts +2 -2
  115. package/src/create.test.ts +1 -1
  116. package/src/create.ts +2 -2
  117. package/src/errors.test.ts +1 -1
  118. package/src/errors.ts +3 -2
  119. package/src/implementations/http/hono/index.ts +2 -1
  120. package/src/implementations/http/on-request-error.test.ts +1 -1
  121. package/src/implementations/http/route-errors.test.ts +1 -1
  122. package/src/implementations/types.ts +1 -1
  123. package/src/index.test.ts +1 -1
  124. package/src/index.ts +2 -2
  125. package/src/schema/compute-schema.ts +4 -3
  126. package/src/schema/extract-json-schema.ts +1 -1
  127. package/src/schema/parser.ts +1 -1
  128. package/src/schema/resolve-schema-lib.ts +2 -2
  129. package/src/schema/types.ts +2 -2
  130. package/src/stack-utils.test.ts +2 -1
  131. package/src/types.ts +2 -2
package/src/errors.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { TSchemaValidationError } from './schema/parser.js'
2
- import { DefinitionInfo, DefinitionLocation, formatDefinitionInfo } from './stack-utils.js'
1
+ import type { TSchemaValidationError } from './schema/parser.js'
2
+ import type { DefinitionInfo, DefinitionLocation} from './stack-utils.js';
3
+ import { formatDefinitionInfo } from './stack-utils.js'
3
4
  import { kebabCase } from 'es-toolkit/string'
4
5
 
5
6
  export class ProcedureError extends Error {
@@ -1,4 +1,5 @@
1
- import { Context, Hono } from 'hono'
1
+ import type { Context} from 'hono';
2
+ import { Hono } from 'hono'
2
3
  import type {
3
4
  AnyHttpRouteDoc,
4
5
  ProceduresFactory,
@@ -14,7 +14,7 @@
14
14
  import { describe, expect, test, vi } from 'vitest'
15
15
  import { Type } from 'typebox'
16
16
  import { Procedures } from '../../index.js'
17
- import { RPCConfig } from '../types.js'
17
+ import type { RPCConfig } from '../types.js'
18
18
  import { HonoAppBuilder } from './hono/index.js'
19
19
 
20
20
  describe('onRequestError — HonoAppBuilder (rpc kind)', () => {
@@ -2,7 +2,7 @@
2
2
  import { describe, expect, test } from 'vitest'
3
3
  import { Type } from 'typebox'
4
4
  import { Procedures } from '../../index.js'
5
- import { APIConfig, RPCConfig } from '../types.js'
5
+ import type { APIConfig, RPCConfig } from '../types.js'
6
6
  import { HonoAppBuilder } from './hono/index.js'
7
7
  import { DocRegistry } from './doc-registry.js'
8
8
  import { defineErrorTaxonomy } from './error-taxonomy.js'
@@ -1,4 +1,4 @@
1
- import { Procedures } from '../index.js'
1
+ import type { Procedures } from '../index.js'
2
2
  import type { ErrorTaxonomy } from './http/error-taxonomy.js'
3
3
 
4
4
  /**
package/src/index.test.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-unused-vars */
1
+
2
2
  import { describe, expect, it, test } from 'vitest'
3
3
  import { Procedures } from './index.js'
4
4
  import { v } from 'suretype'
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Prettify, TJSONSchema } from './schema/types.js'
1
+ import type { Prettify } from './schema/types.js'
2
2
  import { makeCreate } from './create.js'
3
3
  import { makeCreateStream } from './create-stream.js'
4
4
  import { makeCreateHttp } from './create-http.js'
@@ -16,7 +16,7 @@ export {
16
16
  type TBuilderConfig,
17
17
  } from './types.js'
18
18
 
19
- import {
19
+ import type {
20
20
  TNoContextProvided,
21
21
  TBuilderConfig,
22
22
  TProcedureRegistration,
@@ -1,7 +1,8 @@
1
- import { schemaParser, TSchemaValidationError } from './parser.js'
1
+ import type { TSchemaValidationError } from './parser.js';
2
+ import { schemaParser } from './parser.js'
2
3
  import { ProcedureRegistrationError } from '../errors.js'
3
- import { TJSONSchema } from './types.js'
4
- import { DefinitionInfo } from '../stack-utils.js'
4
+ import type { TJSONSchema } from './types.js'
5
+ import type { DefinitionInfo } from '../stack-utils.js'
5
6
 
6
7
  /**
7
8
  * This function is used to compute the JSON schema and validation functions
@@ -1,6 +1,6 @@
1
1
  import { extractSingleJsonSchema } from 'suretype'
2
2
  import { isSuretypeSchema, isTypeboxSchema } from './resolve-schema-lib.js'
3
- import { TJSONSchema } from './types.js'
3
+ import type { TJSONSchema } from './types.js'
4
4
 
5
5
  export function extractJsonSchema(libSchema: unknown): TJSONSchema | undefined {
6
6
  if (isTypeboxSchema(libSchema)) {
@@ -1,7 +1,7 @@
1
1
  import { default as addFormats } from 'ajv-formats'
2
2
  import * as AJV from 'ajv'
3
3
  import { extractJsonSchema } from './extract-json-schema.js'
4
- import { TJSONSchema } from './types.js'
4
+ import type { TJSONSchema } from './types.js'
5
5
 
6
6
  export type TSchemaParsed = {
7
7
  jsonSchema: {
@@ -1,5 +1,5 @@
1
- import { CoreValidator } from 'suretype'
2
- import { Type } from 'typebox'
1
+ import type { CoreValidator } from 'suretype'
2
+ import type { Type } from 'typebox'
3
3
 
4
4
  export type IsTypeboxSchema<TSchema> = TSchema extends {
5
5
  static: unknown
@@ -1,5 +1,5 @@
1
- import { CoreValidator, TypeOf } from 'suretype'
2
- import { Static, TSchema } from 'typebox'
1
+ import type { CoreValidator, TypeOf } from 'suretype'
2
+ import type { Static, TSchema } from 'typebox'
3
3
 
4
4
  // Determine if the generic "SchemaLibType" is Suretype's CoreValidator or Typebox's TSchema
5
5
  export type TSchemaLib<SchemaLibType> =
@@ -1,5 +1,6 @@
1
1
  import { describe, expect, test } from 'vitest'
2
- import { captureDefinitionInfo, formatDefinitionInfo, DefinitionInfo } from './stack-utils.js'
2
+ import type { DefinitionInfo } from './stack-utils.js';
3
+ import { captureDefinitionInfo, formatDefinitionInfo } from './stack-utils.js'
3
4
 
4
5
  describe('Stack Utils', () => {
5
6
  describe('captureDefinitionInfo', () => {
package/src/types.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ProcedureError } from './errors.js'
2
- import { TJSONSchema } from './schema/types.js'
1
+ import type { ProcedureError } from './errors.js'
2
+ import type { TJSONSchema } from './schema/types.js'
3
3
 
4
4
  export type TNoContextProvided = unknown
5
5