gentle-sugar-52379
09/21/2022, 6:24 PM./pants export-codegen
is exporting a css file.
but somehow i'm to stupid to get that into my python project. i have a dependency defined in my python_sources pointing to my custom tailwind_sources rule
i am surely missing something, but i dont get it after reading the pants sourcehundreds-father-404
09/21/2022, 6:25 PMbut somehow i'm to stupidNot at all. This stuff isn't necessarily intuitive, and I'm glad you reached out for help 🙂 What does your
GenerateSourcesRequest
subclass look like?gentle-sugar-52379
09/21/2022, 6:26 PMclass TailwindSourcesField(MultipleSourcesField):
expected_file_extensions = (".js", ".scss")
help = "tada"
class GenerateCssFromTailwindRequest(GenerateSourcesRequest):
input = TailwindSourcesField
output = SingleSourceField
dependencies = DependenciesField
class TailwindTarget(Target):
alias = "tailwind_sources"
core_fields = (*COMMON_TARGET_FIELDS, TailwindSourcesField, Dependencies, Tags)
help = "todo... :("
bitter-ability-32190
09/21/2022, 6:26 PMFileSourceField
generator? If so file
sources aren't "embedded".
Try out ResourceSourceField
hundreds-father-404
09/21/2022, 6:26 PMSingleSourceField
to be ResourceSourceField
, probablygentle-sugar-52379
09/21/2022, 6:27 PMhundreds-father-404
09/21/2022, 6:27 PMenable_codegen=True
)gentle-sugar-52379
09/21/2022, 6:28 PMgentle-sugar-52379
09/21/2022, 6:32 PMhundreds-father-404
09/21/2022, 6:33 PMgentle-sugar-52379
09/21/2022, 6:34 PMclass TailwindCompiler(ExternalTool):
options_scope = "tailwind-compiler"
help = "tailwind compiler cli tool"
default_version = "v3.1.8"
default_known_versions = [
"v3.1.8|macos_arm64 |839470b477af349a91cb72fd20da03820a9ce50d3b20095e039d7de19e4b1c3e|45868800",
...
gentle-sugar-52379
09/21/2022, 6:35 PMwide-midnight-78598
09/21/2022, 6:41 PMwide-midnight-78598
09/21/2022, 6:41 PMwide-midnight-78598
09/21/2022, 6:42 PMhappy-kitchen-89482
09/21/2022, 7:30 PMhappy-kitchen-89482
09/21/2022, 7:31 PMgentle-sugar-52379
09/21/2022, 9:38 PMgentle-sugar-52379
09/21/2022, 9:40 PMgentle-sugar-52379
09/21/2022, 9:41 PMwide-midnight-78598
09/21/2022, 11:49 PMtoday i realised that some bigger open source projects are using pantsI'd be interested in seeing these too. A lot of plugins end up in mainline Pants already, but maybe there are a bunch that are just less discoverable I have a few here (heads up that main might not build anymore, as I'm mid-refactoring) - but as mentioned, a bunch just ended up in mainline 🙂 https://github.com/sureshjoshi/pants-plugins
bitter-ability-32190
09/22/2022, 12:34 AMwide-midnight-78598
09/22/2022, 1:01 AM