It would be great if type definitions could be exported automatically whenever assets are compiled in Rails.
dry-typesript could hook into the Rails asset compilation process and call Dry::Typescript.export before assets are compiled.
We would, however, need some way of specifying the output file path. Maybe use dry-configurable?
# config/initializers/dry-typescript.rb
Dry::Typescript.configure do |config|
config.file_path = Rails.root.join("app", "javascript", "app", "dry-types.d.ts")
end