custom_elements_manifest_parser 0.2.2 → 0.2.5

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: 6beaf37f8491efe1595f5096382d7a4a5411ee45d20b7cc11dba837b01fcab16
4
- data.tar.gz: e51611fe9a6d4e3a3367283659226d9b89721aadcc82276851b5835e4a42578b
3
+ metadata.gz: a3557d8f38d27fa11a194cf185062a9a9adaaf1beff7512315cb9949cecb0e3c
4
+ data.tar.gz: f497811d4fa9cb82402f31d35d35cd17e5dc2fbff1d8c01a925f5a3bd2971912
5
5
  SHA512:
6
- metadata.gz: 32b6e9d61f486610caf886e48022162398e4c6261319e1d9a6c59e7ab99cc256886b6c8b16f98a841fc0a94079c638a6146b513ce10de4f2d2ef632bc6ecb0f2
7
- data.tar.gz: f979bc0ce53a13bc4f81beda3c4371aa00e4579d871043926606719f39f845c679d50c2272d64488b4a812912fbdeece74c0cf5f8ec1e929234c476d9498f745
6
+ metadata.gz: 40d668edf4a5a02da803040b06aba2b355234470b799275529fc9593d12835aaa8e6982a9514811dc79a92688fb407023004ca7d63ea011f926c04c8f56846a3
7
+ data.tar.gz: 770abf6b66266559d35e5d6f426e427ad6b1c7e3aa13215dfce4924692295c106d2ca92ad5f01ae7a0831f1a2f6de3ab13191184c26a9b5707cfccaa457d45fe
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.5)
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
@@ -10,7 +10,7 @@ module CustomElementsManifestParser
10
10
 
11
11
  # @!attribute customElement
12
12
  # @return [True] - Distinguishes a regular JavaScript class from a custom element class
13
- attribute :customElement, Types::Strict::True
13
+ attribute :customElement, Types::Strict::True.optional.meta(required: false)
14
14
 
15
15
  # @!attribute tagName
16
16
  # @return [String, nil] -
@@ -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.5"
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.5
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-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct