custom_elements_manifest_parser 0.2.2 → 0.2.4

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: 6beaf37f8491efe1595f5096382d7a4a5411ee45d20b7cc11dba837b01fcab16
4
- data.tar.gz: e51611fe9a6d4e3a3367283659226d9b89721aadcc82276851b5835e4a42578b
3
+ metadata.gz: cbdac277ddc19dbfe7f4c67022644caccbf23ce436e06b4cf9791b2838c8fae8
4
+ data.tar.gz: 9f7523aff92f0abea19802bdddd3340eabf036607ec51b535e8764d4fef97c32
5
5
  SHA512:
6
- metadata.gz: 32b6e9d61f486610caf886e48022162398e4c6261319e1d9a6c59e7ab99cc256886b6c8b16f98a841fc0a94079c638a6146b513ce10de4f2d2ef632bc6ecb0f2
7
- data.tar.gz: f979bc0ce53a13bc4f81beda3c4371aa00e4579d871043926606719f39f845c679d50c2272d64488b4a812912fbdeece74c0cf5f8ec1e929234c476d9498f745
6
+ metadata.gz: e6220b7424d3bfb1d6296d5f7c808ce35f8f1e0b0789426cec85eacf5ef1f0323f7ba4c6e3777230651043906f9f05f4644480ec61f380f071a8b40a0da0f084
7
+ data.tar.gz: de8ed5232c950fdd5e25672c0c654206bc8db5ce9b8099072c0fbda9c94ce30fdf563dc8e01555d839a5e16cf740b2189bc663d92778a0107cd6644c95b6782c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Unreleased
2
2
 
3
+ ## [0.2.3] - 10/08/2023
4
+
5
+ - Fixed a bug where `ClassLikeStruct` was not getting properly serialized.
6
+ - Fixed a bug with `static` types on members.
7
+ - Fixed a bug with inconsistent naming of `inheritedFrom` on data_types.
8
+
3
9
  ## [0.2.2] - 10/08/2023
4
10
 
5
11
  - Fixed a bug where `ClassDeclaration` wasn't properly serializing it's data types.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- custom_elements_manifest_parser (0.2.2)
4
+ custom_elements_manifest_parser (0.2.4)
5
5
  dry-struct (~> 1.0)
6
6
  dry-types (~> 1.0)
7
7
  dry-validation (~> 1.0)
@@ -47,7 +47,7 @@ module CustomElementsManifestParser
47
47
 
48
48
  def visit(parser:)
49
49
  hash = {}
50
- hash[:inheritedFrom] = parser.data_types[:inheritedFrom].new(inheritedFrom).visit(parser: parser) unless inheritedFrom.nil?
50
+ hash[:inheritedFrom] = parser.data_types[:inherited_from].new(inheritedFrom).visit(parser: parser) unless inheritedFrom.nil?
51
51
  hash[:type] = parser.data_types[:type].new(type).visit(parser: parser) unless type.nil?
52
52
  hash[:resolveInitializer] = parser.data_types[:resolve_initializer].new(resolveInitializer).visit(parser: parser) unless resolveInitializer.nil?
53
53
  new(hash)
@@ -16,8 +16,8 @@ module CustomElementsManifestParser
16
16
  attribute :kind, Types.Value("field")
17
17
 
18
18
  # @!attribute privacy
19
- # @return ["protected", "public", "private", nil]
20
- attribute :static, Types.privacy.optional.meta(required: false)
19
+ # @return [Boolean, nil]
20
+ attribute :static, Types::Strict::Bool.optional.meta(required: false)
21
21
 
22
22
  # @!attribute inheritedFrom
23
23
  # @return [Reference, nil]
@@ -39,8 +39,8 @@ module CustomElementsManifestParser
39
39
  hash[:source] = parser.data_types[:source].new(source).visit(parser: parser) unless source.nil?
40
40
 
41
41
  hash = hash.merge(
42
- Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: struct),
43
- Structs::PropertyLikeStruct.build_hash(parser: parser, struct: struct)
42
+ Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: self),
43
+ Structs::PropertyLikeStruct.build_hash(parser: parser, struct: self)
44
44
  )
45
45
 
46
46
  new(hash)
@@ -44,8 +44,8 @@ module CustomElementsManifestParser
44
44
  hash[:source] = parser.data_types[:source].new(source).visit(parser: parser) unless source.nil?
45
45
 
46
46
  hash = hash.merge(
47
- Structs::FunctionLikeStruct.build_hash(parser: parser, struct: struct),
48
- Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: struct)
47
+ Structs::FunctionLikeStruct.build_hash(parser: parser, struct: self),
48
+ Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: self)
49
49
  )
50
50
 
51
51
  new(hash)
@@ -47,7 +47,7 @@ module CustomElementsManifestParser
47
47
  slot: DataTypes::Slot,
48
48
  type: DataTypes::Type,
49
49
  type_reference: DataTypes::TypeReference,
50
- inheritedFrom: DataTypes::Reference,
50
+ inherited_from: DataTypes::Reference,
51
51
  resolve_initializer: DataTypes::ResolveInitializer,
52
52
  reference: DataTypes::Reference
53
53
  }
@@ -65,7 +65,7 @@ module CustomElementsManifestParser
65
65
  attribute :mixins, Types::Strict::Array.optional.meta(required: false)
66
66
 
67
67
  # @!attribute members
68
- # @return [Array<ClassField, ClassMethod>, nil]
68
+ # @return [Array<Nodes::CustomElementField, Nodes::ClassMethod>, nil]
69
69
  attribute :members, Types::Strict::Array.optional.meta(required: false)
70
70
 
71
71
  # @!attribute source
@@ -80,9 +80,9 @@ module CustomElementsManifestParser
80
80
 
81
81
  def self.build_hash(parser:, struct:)
82
82
  hash = {}
83
- hash[:superclass] = struct.parser.data_types[:superclass].new(superclass).visit(parser: parser) unless struct.superclass.nil?
83
+ hash[:superclass] = parser.data_types[:superclass].new(struct.superclass).visit(parser: parser) unless struct.superclass.nil?
84
84
  hash[:mixins] = struct.mixins.map { |mixin| parser.data_types[:mixin].new(mixin).visit(parser: parser) } unless struct.mixins.nil?
85
- hash[:source] = struct.parser.data_types[:source].new(source).visit(parser: parser) unless struct.source.nil?
85
+ hash[:source] = parser.data_types[:source].new(struct.source).visit(parser: parser) unless struct.source.nil?
86
86
 
87
87
  hash[:members] = struct.members.map { |member| parser.visit_node(member) } unless struct.members.nil?
88
88
  hash
@@ -57,6 +57,7 @@ module CustomElementsManifestParser
57
57
  hash[:slots] = struct.slots.map { |slot| parser.data_types[:slot].new(slot).visit(parser: parser) } unless struct.slots.nil?
58
58
  hash[:events] = struct.events.map { |event| parser.data_types[:event].new(event).visit(parser: parser) } unless struct.events.nil?
59
59
 
60
+ hash = hash.merge(ClassLikeStruct.build_hash(parser: parser, struct: struct))
60
61
  hash
61
62
  end
62
63
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CustomElementsManifestParser
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.4"
5
5
  end
@@ -6,6 +6,7 @@ module CustomElementsManifestParser
6
6
  Dir["#{__dir__}/custom_elements_manifest_parser/**/*.rb"].each { |file| require file }
7
7
 
8
8
  # Shortuct for `CustomElementsManifestParser::Parser.new().parse()`
9
+ # @return [CustomElementsManifestParser::Parser]
9
10
  def self.parse(hash)
10
11
  Parser.new(hash).parse
11
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: custom_elements_manifest_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - konnorrogers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-08 00:00:00.000000000 Z
11
+ date: 2023-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct