Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Kotlin] Missing "import" in segment.kt #315

Closed
zkovar opened this issue Feb 20, 2024 · 1 comment
Closed

[Kotlin] Missing "import" in segment.kt #315

zkovar opened this issue Feb 20, 2024 · 1 comment

Comments

@zkovar
Copy link

zkovar commented Feb 20, 2024

In the segment.kt file generated, there are two issues:

  1. The package is not the first line in the file (this is Android norm)
  2. The referenced Segment SDK is missing an import statement
  • Issue and steps to reproduce.

Run npx typewriter

typewriter.yml

#Segment Typewriter Configuration (https://segment.com/docs/protocols/typewriter)
#Just run `npx typewriter@next` to re-generate a client with the latest versions of these events.

client:
  #You can find more documentation on configuring this client in the Segment docs
  #See: https://segment.com/docs/protocols/typewriter
  language: kotlin
  sdk: kotlin
  languageOptions:
    package: com.my.package
trackingPlans:
  #Tracking Plan: App Rewrite - Tracking Plan
  #https://api.segmentapis.com/tracking-plans/tp_****
  - id: tp_****
    path: com.my.package

ACTUAL Output file:

com.segment.analytics.kotlin.core.Analytics
// This client was automatically generated by Segment Typewriter. ** Do Not Edit **
// To update this file, run:
//   npx typewriter

package com.my.package

import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*

...

EXPECTED Output file:

package com.my.package

// This client was automatically generated by Segment Typewriter. ** Do Not Edit **
// To update this file, run:
//   npx typewriter

import com.segment.analytics.kotlin.core.Analytics

import kotlinx.serialization.*
import kotlinx.serialization.json.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*

...

  • Versions: typewriter/9.1.0
  • Language: kotlin
@zkovar
Copy link
Author

zkovar commented Mar 13, 2024

Resolved in typewriter/9.2.0, thank you!

@zkovar zkovar closed this as completed Mar 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant