Commit Graph

38 Commits

Author SHA1 Message Date
hayaksi1 03c330ee07 Rename PreviewParameterProvider subclasses to the PreviewParam suffix
The `Provider` suffix reads as a dependency provider rather than as preview
data, and it collides with the real providers in the codebase — `StringProvider`,
`PickerProvider`, the login feature's `AccountProvider` — so the name says
nothing about which of the two a class is. `PreviewParam` says it.

195 classes are renamed, along with the 185 files named after them, the konsist
rule that enforces the convention, the presentation-class file templates and the
onboarding documentation.

This cannot be split. `Konsist.scopeFromProduction()` scans the whole project, so
flipping the assertion before every class has moved leaves the rule red, and a
rule that accepted either suffix during a transition would be exactly the kind of
compatibility layer this convention change is meant to remove.

Two judgement calls in the rule itself. The `name.endsWith("PreviewProvider")`
exclusion is dropped: its only job was to reject a redundant `Preview` before
`Provider`, and the new suffix already contains it; no class currently ends with
`PreviewProvider`, so removing it changes nothing today. And
`EditableAvatarViewUriProvider` is renamed rather than deleted from the exclusion
list even though no such class exists in this repository, since it presumably
comes from the modules overlaid for the enterprise build.

Nothing keyed off the old suffix: no snapshot filename contains a provider class
name, so no Paparazzi image changes, and the Kover variants match on `*Presenter`,
`*State` and `*ViewKt`, so coverage bounds are unaffected.
2026-08-17 17:40:33 +03:00
hayaksi1 5140b7c3c8 Fix the feature module template writing the impl build script into the api module
Generating a feature with the Generate Module from Template plugin produced a
module that could not build: features/<name>/api/build.gradle.kts was written
from the impl template, giving the api module a dependency on itself and an
impl namespace.

FeatureModule.json declared BUILD_GRADLE_API and BUILD_GRADLE_IMPL, both
defaulting to build.gradle.kts, and used them as fileTemplates keys. The plugin
resolves keys to filenames before matching, so both collapsed to one key and
the second overwrote the first. The same matching code falls back to a suffix
match on the path, so DefaultXEntryPoint also matched the key XEntryPoint and
was generated from the api template.

Key both by directory, which the plugin supports for exactly this case, and
drop the two now-unused placeholders. The file templates themselves were
correct and are unchanged. The onboarding doc gains a note that an already
imported template must be removed before re-importing, since the plugin keeps
its own copy.
2026-08-09 15:10:00 +03:00
Benoit Marty eb31505dc7 Copyright: Add Element Creations Ltd. copyright 2025-11-10 11:05:05 +01:00
Benoit Marty f86431e663 Copyright: Add final period 2025-11-10 10:13:41 +01:00
Benoit Marty c99068c60e Update the template to use the singular form for Event interface. 2025-11-07 13:39:56 +01:00
Benoit Marty 2625c75ac9 Update the template. 2025-11-07 12:44:59 +01:00
Benoit Marty 07b6148035 Remove context(parentNode: Node) and provide the parent Node as a parameter. 2025-10-31 12:04:57 +01:00
Benoit Marty f174084942 Use context parameter for the parentNode 2025-10-30 16:32:53 +01:00
Benoit Marty 02dc71c4c3 Remove NodeBuilder to ensure that Params and Callback are always provided. 2025-10-30 16:32:52 +01:00
Benoit Marty 1013c08b08 Cleanup template. 2025-10-22 19:12:48 +02:00
Benoit Marty 263e761907 Remove @Inject, not necessary anymore when class is annotated with @ContributesBinding 2025-10-22 18:52:37 +02:00
Benoit Marty 26683bd939 Remove comment. Default values will be detected by the existing Konsist test Data class state MUST not have default value 2025-10-14 14:31:19 +02:00
renovate[bot] 5b9ce7a210 Update metro to v0.6.7 (#5416)
* Update metro to v0.6.7

* Replace `@Inject` with `@AssistedInject` where needed

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jorge Martín <jorgem@element.io>
2025-09-26 08:16:36 +00:00
Benoit Marty 574c2cb2b5 Remove empty line. 2025-09-16 14:38:32 +02:00
Benoit Marty a575019760 Use DependencyHandlerScope.testCommonDependencies() 2025-09-16 14:38:31 +02:00
Benoit Marty e88743bd6a Rename anvil modules to annotations and codegen 2025-09-05 14:26:27 +02:00
Jorge Martín b76a71ebf5 Start migrating Anvil KSP to Metro 2025-09-04 16:48:34 +02:00
Benoit Marty 9411cad0a7 Fix typo. 2025-02-06 15:10:15 +01:00
Benoit Marty 07d4778ae5 Use ElementTheme instead of MaterialTheme 2025-02-06 15:10:15 +01:00
Benoit Marty 97f3be3dc5 Apply dual licenses: AGPL + Element Commercial to file headers.
2 replace all actions have been performed:
- "SPDX-License-Identifier: AGPL-3.0-only" to "SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial"
- "Please see LICENSE in the repository root for full details." to "Please see LICENSE files in the repository root for full details."
2025-01-07 10:05:04 +01:00
torrybr 804506b91d fix: import path broken in module template (#3710) 2024-10-21 14:33:59 +02:00
Jorge Martin Espinosa 48a4a9d69b Update Gradle impl module template with setupAnvil() call (#3563) 2024-09-30 14:28:06 +02:00
Benoit Marty 66aa78d822 Migrate license to AGPL - sh files. 2024-09-06 17:50:45 +02:00
Jorge Martin Espinosa b0cebf5ca0 Improve screenshot testing with ComposablePreviewScanner (#3125)
* Use ComposablePreviewScanner to rework how screenshot testing works
* Add test sharding
* Update screenshots
* Fixes for Element Gallery

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
Co-authored-by: Benoit Marty <benoit@matrix.org>
2024-07-03 13:05:06 +02:00
Benoit Marty 31cfae0578 Run shellcheck autofix. 2024-06-11 15:27:02 +02:00
Benoit Marty 89c2130c1d Ensure tmp folder exists 2023-10-03 15:21:16 +02:00
Benoit Marty 1bd281be16 rename the script to match the doc. 2023-10-03 15:18:06 +02:00
Benoit Marty a202b2dedc Template: Improve end of files. 2023-10-03 15:16:24 +02:00
Benoit Marty a65eb36e7b Template: Use PreviewsDayNight 2023-10-03 15:15:35 +02:00
Benoit Marty 301f237917 Template: data object 2023-10-03 15:13:08 +02:00
Benoit Marty 9a57350071 Remove extra space in filename 2023-10-02 17:12:21 +02:00
Benoit Marty 29d38f2947 Update the recipe to set up the template 2023-10-02 14:19:17 +02:00
Benoit Marty bd1547cb0f Remove previous Suppress and its TODO, in the code and in the template. 2023-10-02 14:02:53 +02:00
Benoit Marty eab6a4957f Remove binary file file_templates.zip, and commit its content in the folder files. 2023-10-02 14:01:44 +02:00
ganfra d5bc8923b9 [Templates] changes after review 2023-03-27 17:43:02 +02:00
ganfra 019aa0ecca [Templates] Re-export with some fixes 2023-03-27 16:19:21 +02:00
ganfra cc476a4f47 [Template] Reexport file templates 2023-03-27 12:56:52 +02:00
ganfra 61eae879d4 Share the template files and update documentation about it. 2023-03-24 17:24:06 +01:00