liveview-native / live_view_native_stylesheet

MIT License
10 stars 4 forks source link

Format paths and re-render fix #44

Closed bcardarella closed 7 months ago

bcardarella commented 7 months ago

Now the path patterns will be looked up via the format, so each format can declare it's own path pattern. For example:

config :live_view_native_stylesheet, content: [
  swiftui: [
    "lib/**/*swiftui*",
    {:live_view_native_swiftui_components, "lib/**/*"}
  ],
  jetpack: [
    "lib/**/*jetpack*"
  ]
]

This will allow for greater control over the pattern to prevent bloating of the stylesheet for class names that may share names between platforms but aren't being used.

In addition, this also introduces extracting class names from deps. You just add {otp_name, pattern} and the dep's paths will be scanned.

This PR also fixes stylesheets not being re-rendered if the template changed. Now the layout component that the stylesheet is being compiled into will have all of the files that match the patterns provided as @external_resource