Skip to content

Commit 35b4705

Browse files
committed
chore(release): v0.26.0
1 parent ac5d799 commit 35b4705

File tree

9 files changed

+35
-18
lines changed

9 files changed

+35
-18
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ Each protocol has its own limitations, corner cases, and features; thus, each ha
5555

5656

5757

58+

docs/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,4 @@ What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor
135135

136136
Prefix that follows specification is not enough though. Remember that the title must be clear and descriptive with usage of [imperative mood](https://chris.beams.io/posts/git-commit/#imperative).
137137

138+

docs/usage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $ npm install -g @the-codegen-project/cli
99
$ codegen COMMAND
1010
running command...
1111
$ codegen (--version)
12-
@the-codegen-project/cli/0.25.0 linux-x64 node-v18.20.5
12+
@the-codegen-project/cli/0.26.0 linux-x64 node-v18.20.5
1313
$ codegen --help [COMMAND]
1414
USAGE
1515
$ codegen COMMAND
@@ -81,7 +81,7 @@ DESCRIPTION
8181
Generate code based on your configuration, use `init` to get started.
8282
```
8383

84-
_See code: [src/commands/generate.ts](https://github.com/the-codegen-project/cli/blob/v0.25.0/src/commands/generate.ts)_
84+
_See code: [src/commands/generate.ts](https://github.com/the-codegen-project/cli/blob/v0.26.0/src/commands/generate.ts)_
8585

8686
## `codegen help [COMMAND]`
8787

@@ -139,7 +139,7 @@ DESCRIPTION
139139
Initialize The Codegen Project in your project
140140
```
141141

142-
_See code: [src/commands/init.ts](https://github.com/the-codegen-project/cli/blob/v0.25.0/src/commands/init.ts)_
142+
_See code: [src/commands/init.ts](https://github.com/the-codegen-project/cli/blob/v0.26.0/src/commands/init.ts)_
143143

144144
## `codegen version`
145145

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@the-codegen-project/cli",
33
"description": "CLI to work with code generation in any environment",
4-
"version": "0.25.0",
4+
"version": "0.26.0",
55
"bin": {
66
"codegen": "./bin/run.mjs"
77
},

schemas/configuration-schema-0.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,13 @@
164164
"items": {
165165
"type": "string",
166166
"enum": [
167-
"nats"
167+
"nats",
168+
"kafka"
168169
]
169170
},
170171
"default": [
171-
"nats"
172+
"nats",
173+
"kafka"
172174
]
173175
},
174176
"parameterGeneratorId": {
@@ -209,7 +211,9 @@
209211
"nats_subscribe",
210212
"nats_publish",
211213
"nats_request",
212-
"nats_reply"
214+
"nats_reply",
215+
"kafka_publish",
216+
"kafka_subscribe"
213217
]
214218
}
215219
}
@@ -218,6 +222,11 @@
218222
"default": {},
219223
"description": "Used in conjunction with AsyncAPI input, can define channel ID along side the type of functions that should be rendered."
220224
},
225+
"kafkaTopicSeparator": {
226+
"type": "string",
227+
"default": ".",
228+
"description": "Used with AsyncAPI to ensure the right character separate topics, example if address is my/resource/path it will be converted to my.resource.path"
229+
},
221230
"language": {
222231
"type": "string",
223232
"const": "typescript",

src/codegen/generators/typescript/channels/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,8 @@ export async function generateTypeScriptChannels(
386386
`Could not find payload for ${channel.id()} for channel typescript generator`
387387
);
388388
}
389-
const {messageModule, messageType} =
390-
getMessageTypeAndModule(payload);
391-
kafkaContext = {...kafkaContext, messageType, messageModule};
389+
const {messageModule, messageType} = getMessageTypeAndModule(payload);
390+
kafkaContext = {...kafkaContext, messageType, messageModule};
392391
const operations = channel.operations().all();
393392
if (operations.length > 0 && !ignoreOperation) {
394393
for (const operation of operations) {

src/codegen/generators/typescript/channels/protocols/kafka/subscribe.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export function renderSubscribe({
6060
jsDoc: ' * @param kafka the KafkaJS client to subscribe through'
6161
},
6262
{
63-
parameter: 'options: {fromBeginning: boolean, groupId: string} = {fromBeginning: true, groupId: \'\'}',
63+
parameter:
64+
"options: {fromBeginning: boolean, groupId: string} = {fromBeginning: true, groupId: ''}",
6465
jsDoc: ' * @param options when setting up the subscription'
6566
}
6667
];
@@ -73,11 +74,11 @@ export function renderSubscribe({
7374
onDataCallback(undefined, callbackData, parameters, kafkaMessage);`;
7475
}
7576
} else if (messageType === 'null') {
76-
whenReceivingMessage = `onDataCallback(undefined, null, kafkaMessage);`;
77-
} else {
78-
whenReceivingMessage = `const callbackData = ${messageUnmarshalling};
77+
whenReceivingMessage = `onDataCallback(undefined, null, kafkaMessage);`;
78+
} else {
79+
whenReceivingMessage = `const callbackData = ${messageUnmarshalling};
7980
onDataCallback(undefined, callbackData, kafkaMessage);`;
80-
}
81+
}
8182
const jsDocParameters = functionParameters
8283
.map((param) => param.jsDoc)
8384
.join('\n');

src/codegen/generators/typescript/channels/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ export const zodTypescriptChannelsGenerator = z.object({
6161
.describe(
6262
'Used in conjunction with AsyncAPI input, can define channel ID along side the type of functions that should be rendered.'
6363
),
64-
kafkaTopicSeparator: z.string().optional().default('.').describe('Used with AsyncAPI to ensure the right character separate topics, example if address is my/resource/path it will be converted to my.resource.path'),
64+
kafkaTopicSeparator: z
65+
.string()
66+
.optional()
67+
.default('.')
68+
.describe(
69+
'Used with AsyncAPI to ensure the right character separate topics, example if address is my/resource/path it will be converted to my.resource.path'
70+
),
6571
language: z.literal('typescript').optional().default('typescript')
6672
});
6773

0 commit comments

Comments
 (0)