lib/generators/templates/ts_schema.rb in ts_schema-0.2.1 vs lib/generators/templates/ts_schema.rb in ts_schema-1.0.0
- old
+ new
@@ -1,21 +1,20 @@
+# frozen_string_literal: true
+
TsSchema.setup do |config|
# Case options for field names: camel|snake|pascal
#
# config.case = :camel
-
# Customize output path and file name
#
# config.output = Rails.root.join('app', 'assets', 'javascripts', 'schema.d.ts')
-
# Whether to generate the schema file after running migrations
#
# config.auto_generate = true
-
# Add custom type mappings or overrides (as strings or symbols)
#
# Default type mappings:
# string: string
# text: string
@@ -35,40 +34,39 @@
# inet: string
# cidr: string
# macaddr: string
#
# config.custom_types = {
- #
+ #
# }
+ # Include null type for optional fields
+ #
+ # export_nulls = false
# Default type for unrecognized types
#
# config.default_type = :string
-
# Whether to generate types for associated models
#
# config.include_associated = true
-
# Parent classes of models to generate (as strings or symbols)
# Only classes inheriting from those in this list will have types generated
#
# config.parent_classes = [
# "ApplicationRecord",
# ]
-
- # Additional models to generate schema from, such as those added by other gems
+ # Additional models to generate schema from, such as those added by other gems
# which don't have a model file. (as strings or symbols)
#
# config.additional_models = [
- #
+ #
# ]
-
# Ignore certain fields, omitting them from the generated schema: :optional|(string)|false
# Key is the name of the field to override options for.
#
# [:optional] will make this an optional field by adding '?' to the defintion (example: password?: string)
# [(string)] enter a field name override, for instance rename encrypted_password to password
@@ -80,30 +78,26 @@
# password: :optional,
# }
# Override types for fields by field name. This is globally applied.
# Useful for polymorphic associations which would otherwise be of type string, e.g.:
- # commentable_type: "'Product'|'Review'"
+ # commentable_type: "'Product'|'Review'"
# config.field_type_overrides: {
# }
-
# Namespace for generated types
#
# config.namespace = :schema
-
# Output schema as types or interfaces: type|interface
#
# config.schema_type = :interface
-
# Indentation options: tab|space
#
# config.indent = :tab
-
# If indent is spaces, specify how many
#
# config.spaces = 2
end