custom_elements_manifest_parser 0.2.1 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b034129185a15c3ecc863a4dbad481f9a74dd3c56dfdacae153388233afd274b
4
- data.tar.gz: d1117275df17115129e2252d8b460b4cee37122785e8c0e7fe3b62ad3e5d43ba
3
+ metadata.gz: cbdac277ddc19dbfe7f4c67022644caccbf23ce436e06b4cf9791b2838c8fae8
4
+ data.tar.gz: 9f7523aff92f0abea19802bdddd3340eabf036607ec51b535e8764d4fef97c32
5
5
  SHA512:
6
- metadata.gz: 4baa54509b17090097ba88f6b13027d286b6a78203109e944cacef0b80bd88c9504fbc82b7b28226a89411c99ddacfd13404e35e0b0180ed2f9192db41326058
7
- data.tar.gz: 75f9b399a7b70b82c058c21b3c821aa3b2d593e54ead8912f7843b1c37d3f66d5b4eb161bbf863c7b725d1cafccdb4131dc9d19976befe32ecd6f31658c56fba
6
+ metadata.gz: e6220b7424d3bfb1d6296d5f7c808ce35f8f1e0b0789426cec85eacf5ef1f0323f7ba4c6e3777230651043906f9f05f4644480ec61f380f071a8b40a0da0f084
7
+ data.tar.gz: de8ed5232c950fdd5e25672c0c654206bc8db5ce9b8099072c0fbda9c94ce30fdf563dc8e01555d839a5e16cf740b2189bc663d92778a0107cd6644c95b6782c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
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
+
9
+ ## [0.2.2] - 10/08/2023
10
+
11
+ - Fixed a bug where `ClassDeclaration` wasn't properly serializing it's data types.
12
+
3
13
  ## [0.2.1] - 10/07/2023
4
14
 
5
15
  - Added a `Parser#find_all_tag_names` method to the parser that returns a Hash keyed off the tag name.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- custom_elements_manifest_parser (0.2.1)
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)
@@ -29,7 +29,7 @@ module CustomElementsManifestParser
29
29
 
30
30
  hash = hash.merge(
31
31
  Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: self),
32
- Structs::DeclarableNodeStruct.build_hash(parser: parser, struct: self)
32
+ Structs::CustomElementLikeStruct.build_hash(parser: parser, struct: self)
33
33
  )
34
34
 
35
35
  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.1"
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.1
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-07 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