-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial support for tags and extra metadata on components #309
Merged
+222
−9
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
57384ec
Revert "remove ds files"
8fe6247
Revert "clean ups"
0703bfe
Add support for tags and additional metadata
pmecho ff908e7
Roll back git ignore change
pmecho f127b78
Roll back incorrect changes
pmecho 6786317
Delete .DS_Store
pmecho cb2f3bf
Delete .DS_Store
pmecho 1995db7
Delete .DS_Store
pmecho e65be96
Delete .DS_Store
pmecho 0392044
Formatting fix
pmecho 7e32f09
Formatting fix
pmecho 8bd6def
Fix detekt error
pmecho edc4f1d
Add metadata to the ShowkaseBrowserComponent
pmecho e69c3d4
Change to unstick CI
pmecho 37b1608
Add tags and metadata to screenshots
pmecho 6ffa4fa
Fix tests
pmecho 0f299ae
Suppress Detekt
pmecho File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
..._function_with_showkase_and_showkaseroot_with_tags_and_metadata/input/TestShowkaseRoot.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.airbnb.android.showkase_processor_testing | ||
|
||
import com.airbnb.android.showkase.annotation.ShowkaseComposable | ||
import androidx.compose.runtime.Composable | ||
import com.airbnb.android.showkase.annotation.ShowkaseRoot | ||
import com.airbnb.android.showkase.annotation.ShowkaseRootModule | ||
|
||
@ShowkaseRoot | ||
public class TestShowkaseRoot: ShowkaseRootModule { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...e_function_with_showkase_and_showkaseroot_with_tags_and_metadata/input/testComposables.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.airbnb.android.showkase_processor_testing | ||
|
||
import com.airbnb.android.showkase.annotation.ShowkaseComposable | ||
import androidx.compose.runtime.Composable | ||
|
||
@ShowkaseComposable("name", "group", tags = ["tag A", "tag B"], extraMetadata = ["meta A"]) | ||
@Composable | ||
public fun TestComposable() { | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...ags_and_metadata/output/ShowkaseMetadata_com_airbnb_android_showkase_processor_testing.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// This is an auto-generated file. Please do not edit/modify this file. | ||
package com.airbnb.android.showkase | ||
|
||
import com.airbnb.android.showkase.`annotation`.ShowkaseCodegenMetadata | ||
import kotlin.Unit | ||
|
||
public class ShowkaseMetadata_com_airbnb_android_showkase_processor_testing { | ||
@ShowkaseCodegenMetadata( | ||
showkaseName = "name", | ||
showkaseGroup = "group", | ||
packageName = "com.airbnb.android.showkase_processor_testing", | ||
packageSimpleName = "showkase_processor_testing", | ||
showkaseElementName = "TestComposable", | ||
insideObject = false, | ||
insideWrapperClass = false, | ||
showkaseKDoc = "", | ||
generatedPropertyName = "comairbnbandroidshowkaseprocessortestinggroupname", | ||
showkaseMetadataType = "COMPONENT", | ||
isDefaultStyle = false, | ||
tags = ["tag A", "tag B"], | ||
extraMetadata = ["meta A"], | ||
) | ||
public fun groupname(): Unit { | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...n_with_showkase_and_showkaseroot_with_tags_and_metadata/output/TestShowkaseRootCodegen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// This is an auto-generated file. Please do not edit/modify this file. | ||
package com.airbnb.android.showkase_processor_testing | ||
|
||
import com.airbnb.android.showkase.`annotation`.ShowkaseRootCodegen | ||
import com.airbnb.android.showkase.models.ShowkaseBrowserColor | ||
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent | ||
import com.airbnb.android.showkase.models.ShowkaseBrowserTypography | ||
import com.airbnb.android.showkase.models.ShowkaseProvider | ||
import kotlin.collections.List | ||
|
||
@ShowkaseRootCodegen( | ||
numComposablesWithoutPreviewParameter = 1, | ||
numComposablesWithPreviewParameter = 0, | ||
numColors = 0, | ||
numTypography = 0, | ||
) | ||
public class TestShowkaseRootCodegen : ShowkaseProvider { | ||
public override fun getShowkaseComponents(): List<ShowkaseBrowserComponent> { | ||
|
||
return listOf<ShowkaseBrowserComponent>( | ||
comairbnbandroidshowkaseprocessortestinggroupname, | ||
) | ||
} | ||
|
||
public override fun getShowkaseColors(): List<ShowkaseBrowserColor> { | ||
|
||
return listOf<ShowkaseBrowserColor>( | ||
) | ||
} | ||
|
||
public override fun getShowkaseTypography(): List<ShowkaseBrowserTypography> { | ||
|
||
return listOf<ShowkaseBrowserTypography>( | ||
) | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...seroot_with_tags_and_metadata/output/TestShowkaseRootShowkaseExtensionFunctionsCodegen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This is an auto-generated file. Please do not edit/modify this file. | ||
package com.airbnb.android.showkase_processor_testing | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import com.airbnb.android.showkase.models.Showkase | ||
import com.airbnb.android.showkase.models.ShowkaseElementsMetadata | ||
import com.airbnb.android.showkase.models.ShowkaseProvider | ||
import com.airbnb.android.showkase.ui.ShowkaseBrowserActivity | ||
|
||
/** | ||
* Helper function that's autogenerated and gives you an intent to start the ShowkaseBrowser. | ||
*/ | ||
public fun Showkase.getBrowserIntent(context: Context): Intent { | ||
val intent = Intent(context, ShowkaseBrowserActivity::class.java) | ||
intent.putExtra("SHOWKASE_ROOT_MODULE", | ||
"com.airbnb.android.showkase_processor_testing.TestShowkaseRoot") | ||
return intent | ||
} | ||
|
||
/** | ||
* Helper function that's give's you access to Showkase metadata. This contains data about the | ||
* composables, colors and typography in your codebase that's rendered in showkase. | ||
*/ | ||
public fun Showkase.getMetadata(): ShowkaseElementsMetadata { | ||
try { | ||
val showkaseComponentProvider = | ||
Class.forName("com.airbnb.android.showkase_processor_testing.TestShowkaseRootCodegen").newInstance() | ||
as ShowkaseProvider | ||
return showkaseComponentProvider.metadata() | ||
} catch(exception: ClassNotFoundException) { | ||
error("The class wasn't generated correctly. Make sure that you have setup Showkase correctly by following the steps here - https://github.com/airbnb/Showkase#Installation.") | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...seroot_with_tags_and_metadata/output/comairbnbandroidshowkaseprocessortestinggroupname.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// This is an auto-generated file. Please do not edit/modify this file. | ||
package com.airbnb.android.showkase_processor_testing | ||
|
||
import androidx.compose.runtime.Composable | ||
import com.airbnb.android.showkase.models.ShowkaseBrowserComponent | ||
|
||
public val comairbnbandroidshowkaseprocessortestinggroupname: ShowkaseBrowserComponent = | ||
ShowkaseBrowserComponent( | ||
group = "group", | ||
componentName = "name", | ||
componentKDoc = "", | ||
componentKey = """com.airbnb.android.showkase_processor_testing_null_group_name_0_null""", | ||
isDefaultStyle = false, | ||
tags = listOf("tag A", "tag B"), | ||
extraMetadata = listOf("meta A"), | ||
component = @Composable { TestComposable() } | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you want the extra metadata to be available here as well no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops I missed that the other classes were internal 🤦