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.
- package/README.md +14 -0
- package/agent_config/claude-code/skills/ts-procedures/api-reference.md +1 -1
- package/agent_config/claude-code/skills/ts-procedures/patterns.md +3 -3
- package/agent_config/claude-code/skills/ts-procedures-scaffold/templates/client.md +4 -2
- package/agent_config/copilot/copilot-instructions.md +3 -3
- package/agent_config/cursor/cursorrules +3 -3
- package/build/client/call.test.js +1 -1
- package/build/client/call.test.js.map +1 -1
- package/build/client/errors.js +0 -1
- package/build/client/errors.js.map +1 -1
- package/build/client/hooks.test.js +1 -1
- package/build/client/hooks.test.js.map +1 -1
- package/build/client/index.js +1 -1
- package/build/client/index.js.map +1 -1
- package/build/client/typed-error-dispatch.test.js +6 -3
- package/build/client/typed-error-dispatch.test.js.map +1 -1
- package/build/codegen/bin/cli.js +1 -1
- package/build/codegen/bin/cli.js.map +1 -1
- package/build/codegen/bin/cli.test.js +2 -2
- package/build/codegen/bin/cli.test.js.map +1 -1
- package/build/codegen/bundle-size.test.js +0 -1
- package/build/codegen/bundle-size.test.js.map +1 -1
- package/build/codegen/constants.d.ts +8 -1
- package/build/codegen/constants.js +9 -1
- package/build/codegen/constants.js.map +1 -1
- package/build/codegen/e2e.test.js +1 -1
- package/build/codegen/e2e.test.js.map +1 -1
- package/build/codegen/emit-client-types.test.js +1 -0
- package/build/codegen/emit-client-types.test.js.map +1 -1
- package/build/codegen/emit-errors.test.js +1 -1
- package/build/codegen/emit-errors.test.js.map +1 -1
- package/build/codegen/emit-index.test.js +1 -1
- package/build/codegen/emit-index.test.js.map +1 -1
- package/build/codegen/emit-scope.js +1 -1
- package/build/codegen/emit-scope.js.map +1 -1
- package/build/codegen/emit-scope.test.js +1 -1
- package/build/codegen/emit-scope.test.js.map +1 -1
- package/build/codegen/pipeline.js +1 -1
- package/build/codegen/pipeline.js.map +1 -1
- package/build/codegen/pipeline.test.js +33 -10
- package/build/codegen/pipeline.test.js.map +1 -1
- package/build/codegen/targets/_shared/write-files.d.ts +11 -5
- package/build/codegen/targets/_shared/write-files.js +49 -7
- package/build/codegen/targets/_shared/write-files.js.map +1 -1
- package/build/codegen/targets/_shared/write-files.test.js +87 -21
- package/build/codegen/targets/_shared/write-files.test.js.map +1 -1
- package/build/codegen/targets/kotlin/emit-scope-kotlin.js +3 -2
- package/build/codegen/targets/kotlin/emit-scope-kotlin.js.map +1 -1
- package/build/codegen/targets/kotlin/format-kotlin.d.ts +6 -0
- package/build/codegen/targets/kotlin/format-kotlin.js +9 -0
- package/build/codegen/targets/kotlin/format-kotlin.js.map +1 -1
- package/build/codegen/targets/kotlin/format-kotlin.test.js +8 -1
- package/build/codegen/targets/kotlin/format-kotlin.test.js.map +1 -1
- package/build/codegen/targets/swift/format-swift.js +4 -1
- package/build/codegen/targets/swift/format-swift.js.map +1 -1
- package/build/codegen/test-helpers/golden.js +0 -1
- package/build/codegen/test-helpers/golden.js.map +1 -1
- package/build/create-http-stream.d.ts +2 -2
- package/build/create-http.d.ts +3 -3
- package/build/create-http.js.map +1 -1
- package/build/create-http.test.js +1 -1
- package/build/create-http.test.js.map +1 -1
- package/build/create-stream.d.ts +2 -2
- package/build/create-stream.test.js +1 -2
- package/build/create-stream.test.js.map +1 -1
- package/build/create.d.ts +2 -2
- package/build/create.test.js +1 -2
- package/build/create.test.js.map +1 -1
- package/build/errors.d.ts +2 -2
- package/build/errors.js.map +1 -1
- package/build/implementations/http/hono/index.d.ts +2 -1
- package/build/implementations/http/hono/index.js.map +1 -1
- package/build/implementations/types.d.ts +1 -1
- package/build/index.d.ts +9 -9
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/index.test.js +0 -1
- package/build/index.test.js.map +1 -1
- package/build/schema/compute-schema.d.ts +3 -3
- package/build/schema/compute-schema.js.map +1 -1
- package/build/schema/extract-json-schema.d.ts +1 -1
- package/build/schema/parser.d.ts +1 -1
- package/build/schema/resolve-schema-lib.d.ts +2 -2
- package/build/schema/types.d.ts +2 -2
- package/build/stack-utils.test.js.map +1 -1
- package/build/types.d.ts +2 -2
- package/docs/client-and-codegen.md +2 -2
- package/docs/decisions/2026-06-02-monorepo-split-evaluation.md +80 -0
- package/docs/npm-workspaces-migration-plan.md +611 -0
- package/package.json +2 -1
- package/src/client/errors.ts +1 -1
- package/src/client/typed-error-dispatch.test.ts +1 -2
- package/src/codegen/bin/cli.test.ts +2 -2
- package/src/codegen/bin/cli.ts +1 -1
- package/src/codegen/bundle-size.test.ts +1 -1
- package/src/codegen/constants.ts +10 -1
- package/src/codegen/e2e.test.ts +1 -1
- package/src/codegen/emit-errors.test.ts +1 -1
- package/src/codegen/emit-index.test.ts +1 -1
- package/src/codegen/emit-scope.test.ts +1 -1
- package/src/codegen/pipeline.test.ts +39 -10
- package/src/codegen/pipeline.ts +1 -1
- package/src/codegen/targets/_shared/write-files.test.ts +143 -32
- package/src/codegen/targets/_shared/write-files.ts +53 -8
- package/src/codegen/targets/kotlin/__fixtures__/users-golden.kt +1 -0
- package/src/codegen/targets/kotlin/emit-scope-kotlin.ts +3 -2
- package/src/codegen/targets/kotlin/format-kotlin.test.ts +9 -0
- package/src/codegen/targets/kotlin/format-kotlin.ts +11 -0
- package/src/codegen/targets/swift/format-swift.ts +5 -1
- package/src/codegen/test-helpers/golden.ts +1 -1
- package/src/create-http-stream.ts +2 -2
- package/src/create-http.ts +2 -3
- package/src/create-stream.test.ts +1 -1
- package/src/create-stream.ts +2 -2
- package/src/create.test.ts +1 -1
- package/src/create.ts +2 -2
- package/src/errors.test.ts +1 -1
- package/src/errors.ts +3 -2
- package/src/implementations/http/hono/index.ts +2 -1
- package/src/implementations/http/on-request-error.test.ts +1 -1
- package/src/implementations/http/route-errors.test.ts +1 -1
- package/src/implementations/types.ts +1 -1
- package/src/index.test.ts +1 -1
- package/src/index.ts +2 -2
- package/src/schema/compute-schema.ts +4 -3
- package/src/schema/extract-json-schema.ts +1 -1
- package/src/schema/parser.ts +1 -1
- package/src/schema/resolve-schema-lib.ts +2 -2
- package/src/schema/types.ts +2 -2
- package/src/stack-utils.test.ts +2 -1
- 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
|
|
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 {
|
|
@@ -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'
|
package/src/index.test.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Prettify
|
|
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 {
|
|
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)) {
|
package/src/schema/parser.ts
CHANGED
|
@@ -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: {
|
package/src/schema/types.ts
CHANGED
|
@@ -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> =
|
package/src/stack-utils.test.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest'
|
|
2
|
-
import {
|
|
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