Skip to content

Commit

Permalink
Rename XP.XData to XpXData
Browse files Browse the repository at this point in the history
This makes this library conform to the official types released
from Enonic.

Closes: #43
  • Loading branch information
tajakobsen committed Nov 7, 2022
1 parent 2675a9c commit 0407530
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "no.item.xp.plugin"
version = "2.0.1"
version = "2.1.0"

java {
sourceCompatibility = JavaVersion.VERSION_11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ fun renderGlobalXDataMap(files: List<File>, appName: String): String {
"""export type ${getInterfaceName(it.nameWithoutExtension)} = import("./${it.nameWithoutExtension}").${getInterfaceName(it.nameWithoutExtension)}"""
}
val fieldList = files.joinToString("\n") {
""" ${escapeFieldName(it.nameWithoutExtension)}?: ${getInterfaceName(it.nameWithoutExtension)};"""
""" ${escapeFieldName(it.nameWithoutExtension)}?: ${getInterfaceName(it.nameWithoutExtension)};"""
}

return """
#$importList
#
#declare global {
# namespace XP {
# interface XData {
# "${snakeCase(appName)}"?: {
# interface XpXData {
# "${snakeCase(appName)}"?: {
#$fieldList
# }
# }
# }
#}
Expand Down

0 comments on commit 0407530

Please sign in to comment.