Skip to content

Commit e00e61c

Browse files
authored
chore(codegen): omit generation of union visitors in schema serde (#1772)
* chore(codegen): omit generation of union visitors in schema serde * switch pkg json to workspace
1 parent 1d2e9ab commit e00e61c

31 files changed

+1614
-12
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ generate-protocol-tests:
1212
rm -rf ./private/smithy-rpcv2-cbor
1313
rm -rf ./private/smithy-rpcv2-cbor-schema
1414
rm -rf ./private/my-local-model
15+
rm -rf ./private/my-local-model-schema
1516
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/smithy-rpcv2-cbor/typescript-codegen ./private/smithy-rpcv2-cbor
1617
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/smithy-rpcv2-cbor-schema/typescript-codegen ./private/smithy-rpcv2-cbor-schema
1718
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model/typescript-client-codegen/ ./private/my-local-model
19+
cp -r ./smithy-typescript-protocol-test-codegen/build/smithyprojections/smithy-typescript-protocol-test-codegen/my-local-model-schema/typescript-client-codegen/ ./private/my-local-model-schema
1820
node ./scripts/post-protocol-test-codegen
1921
npx prettier --write ./private/smithy-rpcv2-cbor
2022
npx prettier --write ./private/smithy-rpcv2-cbor-schema
2123
npx prettier --write ./private/my-local-model
24+
npx prettier --write ./private/my-local-model-schema
2225
yarn
2326

2427
test-protocols:
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"name": "xyz-schema",
3+
"description": "xyz-schema client",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7+
"build:cjs": "tsc -p tsconfig.cjs.json",
8+
"build:es": "tsc -p tsconfig.es.json",
9+
"build:types": "tsc -p tsconfig.types.json",
10+
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
11+
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
12+
"prepack": "yarn run clean && yarn run build"
13+
},
14+
"main": "./dist-cjs/index.js",
15+
"types": "./dist-types/index.d.ts",
16+
"module": "./dist-es/index.js",
17+
"sideEffects": false,
18+
"dependencies": {
19+
"@aws-crypto/sha256-browser": "5.2.0",
20+
"@aws-crypto/sha256-js": "5.2.0",
21+
"@aws-sdk/types": "latest",
22+
"@smithy/config-resolver": "workspace:^",
23+
"@smithy/core": "workspace:^",
24+
"@smithy/eventstream-serde-browser": "workspace:^",
25+
"@smithy/eventstream-serde-config-resolver": "workspace:^",
26+
"@smithy/eventstream-serde-node": "workspace:^",
27+
"@smithy/fetch-http-handler": "workspace:^",
28+
"@smithy/hash-node": "workspace:^",
29+
"@smithy/invalid-dependency": "workspace:^",
30+
"@smithy/middleware-content-length": "workspace:^",
31+
"@smithy/middleware-endpoint": "workspace:^",
32+
"@smithy/middleware-retry": "workspace:^",
33+
"@smithy/middleware-serde": "workspace:^",
34+
"@smithy/middleware-stack": "workspace:^",
35+
"@smithy/node-config-provider": "workspace:^",
36+
"@smithy/node-http-handler": "workspace:^",
37+
"@smithy/protocol-http": "workspace:^",
38+
"@smithy/smithy-client": "workspace:^",
39+
"@smithy/types": "workspace:^",
40+
"@smithy/url-parser": "workspace:^",
41+
"@smithy/util-base64": "workspace:^",
42+
"@smithy/util-body-length-browser": "workspace:^",
43+
"@smithy/util-body-length-node": "workspace:^",
44+
"@smithy/util-defaults-mode-browser": "workspace:^",
45+
"@smithy/util-defaults-mode-node": "workspace:^",
46+
"@smithy/util-endpoints": "workspace:^",
47+
"@smithy/util-middleware": "workspace:^",
48+
"@smithy/util-retry": "workspace:^",
49+
"@smithy/util-utf8": "workspace:^",
50+
"tslib": "^2.6.2"
51+
},
52+
"devDependencies": {
53+
"@tsconfig/node18": "18.2.4",
54+
"@types/node": "^18.19.69",
55+
"concurrently": "7.0.0",
56+
"downlevel-dts": "0.10.1",
57+
"rimraf": "^3.0.0",
58+
"typescript": "~5.8.3"
59+
},
60+
"engines": {
61+
"node": ">=18.0.0"
62+
},
63+
"typesVersions": {
64+
"<4.0": {
65+
"dist-types/*": [
66+
"dist-types/ts3.4/*"
67+
]
68+
}
69+
},
70+
"files": [
71+
"dist-*/**"
72+
],
73+
"private": true,
74+
"browser": {
75+
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.browser"
76+
},
77+
"react-native": {
78+
"./dist-es/runtimeConfig": "./dist-es/runtimeConfig.native"
79+
}
80+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// smithy-typescript generated code
2+
import { XYZServiceClient, XYZServiceClientConfig } from "./XYZServiceClient";
3+
import { GetNumbersCommand, GetNumbersCommandInput, GetNumbersCommandOutput } from "./commands/GetNumbersCommand";
4+
import {
5+
TradeEventStreamCommand,
6+
TradeEventStreamCommandInput,
7+
TradeEventStreamCommandOutput,
8+
} from "./commands/TradeEventStreamCommand";
9+
import { createAggregatedClient } from "@smithy/smithy-client";
10+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
11+
12+
const commands = {
13+
GetNumbersCommand,
14+
TradeEventStreamCommand,
15+
};
16+
17+
export interface XYZService {
18+
/**
19+
* @see {@link GetNumbersCommand}
20+
*/
21+
getNumbers(): Promise<GetNumbersCommandOutput>;
22+
getNumbers(args: GetNumbersCommandInput, options?: __HttpHandlerOptions): Promise<GetNumbersCommandOutput>;
23+
getNumbers(args: GetNumbersCommandInput, cb: (err: any, data?: GetNumbersCommandOutput) => void): void;
24+
getNumbers(
25+
args: GetNumbersCommandInput,
26+
options: __HttpHandlerOptions,
27+
cb: (err: any, data?: GetNumbersCommandOutput) => void
28+
): void;
29+
30+
/**
31+
* @see {@link TradeEventStreamCommand}
32+
*/
33+
tradeEventStream(): Promise<TradeEventStreamCommandOutput>;
34+
tradeEventStream(
35+
args: TradeEventStreamCommandInput,
36+
options?: __HttpHandlerOptions
37+
): Promise<TradeEventStreamCommandOutput>;
38+
tradeEventStream(
39+
args: TradeEventStreamCommandInput,
40+
cb: (err: any, data?: TradeEventStreamCommandOutput) => void
41+
): void;
42+
tradeEventStream(
43+
args: TradeEventStreamCommandInput,
44+
options: __HttpHandlerOptions,
45+
cb: (err: any, data?: TradeEventStreamCommandOutput) => void
46+
): void;
47+
}
48+
49+
/**
50+
* xyz interfaces
51+
* @public
52+
*/
53+
export class XYZService extends XYZServiceClient implements XYZService {}
54+
createAggregatedClient(commands, XYZService);

0 commit comments

Comments
 (0)