Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,21 @@ jobs:
version: latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Bump version and push commit
- name: Bump version
id: bump
run: |
new_version=$(pnpm version ${{ inputs.version }} --no-git-tag-version | tail -n 1)
echo "version=$new_version" >> $GITHUB_OUTPUT
- name: Commit version bump
run: |
pnpm version ${{ inputs.version }} --no-git-tag-version
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git commit -a -m "Bumped v${{ inputs.version }}"
git commit -a -m "Bumped ${{ steps.bump.outputs.version }}"
git push origin HEAD:${{ github.ref }}
- name: Publish new version
run: |
npm install npm -g
npm publish --access public --tag ${{ inputs.prerelease == true && 'next' || 'latest' }}
- name: Create release notes
run: |
npx @matteo.collina/release-notes -a ${{ secrets.GITHUB_TOKEN }} -t v${{ inputs.version }} -r ${{ github.repository }} ${{ github.event.inputs.prerelease == 'true' && '-p' || '' }} -c ${{ github.ref }}
npx @matteo.collina/release-notes -a ${{ secrets.GITHUB_TOKEN }} -t ${{ steps.bump.outputs.version }} -r ${{ github.repository }} ${{ github.event.inputs.prerelease == 'true' && '-p' || '' }} -c ${{ github.ref }}
7 changes: 4 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { create as createService, platformaticService, transform as serviceTransform } from '@platformatic/service'
import fp from 'fastify-plugin'
import { defaultDlqTopic } from './definitions.js'
import { plugin } from './plugin.js'
import { schema } from './schema.js'
Expand All @@ -8,8 +9,8 @@ export async function kafkaHooks (app, stackable) {
await app.register(plugin, stackable)
}

export async function transform (config, schema, options) {
config = await serviceTransform(config, schema, options)
export async function transform (config, ...args) {
config = await serviceTransform(config, ...args)

for (const topic of config.kafka.topics) {
if (topic.dlq === true) {
Expand All @@ -21,7 +22,7 @@ export async function transform (config, schema, options) {
}

export async function create (configOrRoot, sourceOrConfig, context) {
return createService(configOrRoot, sourceOrConfig, { schema, applicationFactory: kafkaHooks, transform, ...context })
return createService(configOrRoot, sourceOrConfig, { schema, applicationFactory: fp(kafkaHooks), transform, ...context })
}

export { Generator } from './generator.js'
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
"helpers:kafka-monitor": "MAIN=true node test/fixtures/kafka-monitor.js"
},
"dependencies": {
"@platformatic/foundation": "^3.0.2",
"@platformatic/kafka": "^1.8.0",
"@platformatic/foundation": "^3.0.0",
"@platformatic/service": "^3.0.0",
"@platformatic/service": "^3.0.2",
"fastify-plugin": "^5.0.1",
"http-errors-enhanced": "^3.0.2",
"hwp": "^0.4.1",
"undici": "^7.8.0"
Expand Down
Loading