types_from_serializers 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab46cb83091bc01087646a3e9c1eee590d4148ea16f86fcca2c83ad91b24d2a5
4
- data.tar.gz: 95e62afbb4b49ab897434fe33926322964439af03726c570bec6296eb4c51ca1
3
+ metadata.gz: 7bfb48892a066d214d5a96b814516a45fce439e17f39da5293b7d972f230ff37
4
+ data.tar.gz: 741fee0da243cc9c2d07b592c2d78f05dd6b6d736aae1f4212f62ccdbc4cfa7e
5
5
  SHA512:
6
- metadata.gz: 8280b0616181a1b13b4192bc6cd9ceb6b43498d31bd83b871d3da0bba924c63b52d67598df83df8d8ccac535999f81a99e42b530cbc0ab6afeddbfa9366928e2
7
- data.tar.gz: ee8d6f445603ef26932c631a2064f337186c6f27451771b2f31577df37c587f318b1abe22e9277e7db48f2d65d47ca7c62f1177a67cbc35df615e5277931bce1
6
+ metadata.gz: 12b4306f9d43f471a1755cbdce1d0b956c42b4ffeb4835aa5301c3d069b69d7336c8bbebd8524fa9f5f71a56af955f9dc35675873e5a796cff98a3a9d1d49986
7
+ data.tar.gz: 579a846b0a583d0eb4fa16b111a8aca26ce04abd26c2866a19fe9767763c66c2a6d7de20d27638b0a3955b4db22f60fec53f25e5ea4f84dfc34807cb90c0ebc3
data/CHANGELOG.md CHANGED
@@ -1,15 +1,21 @@
1
- # 0.1.0 (2022-07-12)
1
+ ## [0.1.1](https://github.com/ElMassimo/types_from_serializers/compare/types_from_serializers@0.1.0...types_from_serializers@0.1.1) (2022-07-12)
2
2
 
3
3
 
4
- ### Bug Fixes
5
4
 
6
- * handle non-ActiveRecord models and extract types from unions ([ea9b2a7](https://github.com/ElMassimo/types_from_serializers/commit/ea9b2a71cb85503ff691e5ef115ab73f89b005af))
5
+ # 0.1.0 (2022-07-12)
7
6
 
8
7
 
9
8
  ### Features
10
9
 
11
- * make the DSL is available without manually requiring ([04a4f3a](https://github.com/ElMassimo/types_from_serializers/commit/04a4f3ad3c96658639cbe75de07f19cc7f79f4c6))
12
- * support specifying base serializers and additional dirs to scan ([164cfe1](https://github.com/ElMassimo/types_from_serializers/commit/164cfe17bb0527c59cf95441381aef7bf797a568))
10
+ - Start simple, no additional syntax required
11
+ - Infers types from a related `ActiveRecord` model, using the SQL schema
12
+ - Understands JS native types and how to map SQL columns: `string`, `boolean`, etc
13
+ - Automatically types [associations](https://github.com/ElMassimo/oj_serializers#associations-dsl-), importing the generated types for the referenced serializers
14
+ - Detects [conditional attributes](https://github.com/ElMassimo/oj_serializers#rendering-an-attribute-conditionally) and marks them as optional: `name?: string`
15
+ - Fallback to a custom interface using `type_from`
16
+ - Supports custom types and automatically adds the necessary imports
17
+ - handle non-ActiveRecord models and extract types from unions ([ea9b2a7](https://github.com/ElMassimo/types_from_serializers/commit/ea9b2a71cb85503ff691e5ef115ab73f89b005af))
18
+ - support specifying base serializers and additional dirs to scan ([164cfe1](https://github.com/ElMassimo/types_from_serializers/commit/164cfe17bb0527c59cf95441381aef7bf797a568))
13
19
 
14
20
 
15
21
 
@@ -47,9 +47,10 @@ module TypesFromSerializers
47
47
  to_s.classify.safe_constantize
48
48
  end
49
49
 
50
- delegate :to_model, to: :to_s
50
+ def to_model
51
+ to_s.to_model
52
+ end
51
53
  end
52
- # rubocop:enable Rails/Delegate
53
54
 
54
55
  refine Class do
55
56
  # Internal: Name of the TypeScript interface.
@@ -2,5 +2,5 @@
2
2
 
3
3
  module TypesFromSerializers
4
4
  # Public: This library adheres to semantic versioning.
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: types_from_serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
@@ -142,6 +142,20 @@ dependencies:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
144
  version: '1.0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: rubocop
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
145
159
  - !ruby/object:Gem::Dependency
146
160
  name: rubocop-rails
147
161
  requirement: !ruby/object:Gem::Requirement