lutaml-model 0.8.201 → 0.8.203

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.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.github/scripts/test_installed_gem.rb +1 -13
  3. data/.github/workflows/dependent-tests.yml +59 -2
  4. data/.github/workflows/downstream-performance.yml +1 -22
  5. data/.github/workflows/performance.yml +1 -33
  6. data/.github/workflows/rake.yml +2 -6
  7. data/.rubocop.yml +0 -10
  8. data/.rubocop_todo.yml +0 -4
  9. data/Gemfile +0 -23
  10. data/README.adoc +25 -86
  11. data/Rakefile +2 -167
  12. data/docs/_guides/advanced-mapping.adoc +6 -6
  13. data/docs/_guides/character-encoding.adoc +0 -3
  14. data/docs/_guides/gem-integration.adoc +1 -1
  15. data/docs/_guides/index.adoc +0 -4
  16. data/docs/_guides/xml/type-namespaces.adoc +1 -1
  17. data/docs/_guides/xml-guide-0.8.0.adoc +2 -2
  18. data/docs/_guides/xml-namespaces.adoc +2 -3
  19. data/docs/_guides/xml_mappings/03_architecture.adoc +2 -2
  20. data/docs/_guides/xml_mappings/07_best_practices.adoc +2 -3
  21. data/docs/_guides/xml_mappings/08_troubleshooting.adoc +1 -9
  22. data/docs/_pages/comparison-with-shale.adoc +1 -1
  23. data/docs/_pages/configuration.adoc +6 -40
  24. data/docs/_pages/index.adoc +0 -1
  25. data/docs/_pages/serialization_adapters.adoc +4 -16
  26. data/docs/_references/architecture.adoc +1 -1
  27. data/docs/_references/lutaml-namespace-planning.md +1 -1
  28. data/docs/_references/plan-schema-spec.adoc +45 -18
  29. data/docs/_references/three-phase-namespace-architecture.adoc +1 -2
  30. data/docs/_references/xsd-generation-with-namespace-support.adoc +3 -8
  31. data/docs/_tutorials/lutaml-xml-architecture.adoc +2 -8
  32. data/docs/architecture.md +7 -11
  33. data/docs/conversion_caching.adoc +1 -1
  34. data/docs/index.adoc +0 -1
  35. data/docs/key_value_data_model.adoc +1 -1
  36. data/docs/namespace-management.adoc +4 -10
  37. data/lib/lutaml/json/format.rb +0 -1
  38. data/lib/lutaml/json/generator_options.rb +0 -1
  39. data/lib/lutaml/key_value/transform.rb +149 -37
  40. data/lib/lutaml/lml/document_builder.rb +2 -2
  41. data/lib/lutaml/lml/entity_types.rb +2 -2
  42. data/lib/lutaml/model/adapter_resolver.rb +5 -15
  43. data/lib/lutaml/model/attribute.rb +11 -6
  44. data/lib/lutaml/model/cached_type_resolver.rb +1 -7
  45. data/lib/lutaml/model/error/unknown_adapter_type_error.rb +1 -1
  46. data/lib/lutaml/model/global_context.rb +3 -5
  47. data/lib/lutaml/model/instrumentation.rb +0 -3
  48. data/lib/lutaml/model/mapping/mapping_rule.rb +6 -10
  49. data/lib/lutaml/model/register.rb +20 -31
  50. data/lib/lutaml/model/runtime_compatibility.rb +0 -92
  51. data/lib/lutaml/model/schema/class_loader.rb +2 -4
  52. data/lib/lutaml/model/schema/xml_compiler/spec_builder/simple_types.rb +2 -3
  53. data/lib/lutaml/model/serialize/attribute_definition.rb +10 -184
  54. data/lib/lutaml/model/serialize/conversion_caching.rb +1 -5
  55. data/lib/lutaml/model/serialize/deserialization_context.rb +21 -0
  56. data/lib/lutaml/model/serialize/initialization.rb +19 -9
  57. data/lib/lutaml/model/serialize/model_import.rb +0 -5
  58. data/lib/lutaml/model/serialize/value_mapping.rb +0 -3
  59. data/lib/lutaml/model/services/rule_value_extractor.rb +4 -7
  60. data/lib/lutaml/model/store.rb +10 -17
  61. data/lib/lutaml/model/toml.rb +0 -2
  62. data/lib/lutaml/model/transformation_registry.rb +3 -7
  63. data/lib/lutaml/model/version.rb +1 -1
  64. data/lib/lutaml/model.rb +3 -19
  65. data/lib/lutaml/toml/format.rb +4 -8
  66. data/lib/lutaml/xml/adapter/moxml_adapter.rb +1 -7
  67. data/lib/lutaml/xml/adapter.rb +0 -4
  68. data/lib/lutaml/xml/adapter_loader.rb +1 -6
  69. data/lib/lutaml/xml/builder/base.rb +0 -3
  70. data/lib/lutaml/xml/builder.rb +0 -8
  71. data/lib/lutaml/xml/data_model.rb +1 -1
  72. data/lib/lutaml/xml/doctype_extractor.rb +3 -3
  73. data/lib/lutaml/xml/format.rb +22 -74
  74. data/lib/lutaml/xml/leptris/plan_compiler.rb +1 -2
  75. data/lib/lutaml/xml/model_transform.rb +14 -24
  76. data/lib/lutaml/xml/polymorphic_value_handler.rb +1 -1
  77. data/lib/lutaml/xml/schema/builder/moxml.rb +1 -1
  78. data/lib/lutaml/xml/schema/builder.rb +6 -9
  79. data/lib/lutaml/xml/schema/relaxng_schema.rb +1 -1
  80. data/lib/lutaml/xml/xml_element.rb +3 -2
  81. data/lib/lutaml/xml/xsd_validator.rb +4 -11
  82. data/lib/lutaml/yaml/adapter/yeptris_adapter.rb +2 -2
  83. data/lib/lutaml/yamls/adapter_loader.rb +1 -5
  84. data/lib/tasks/performance_comparator.rb +1 -1
  85. data/lutaml-model.gemspec +3 -8
  86. data/spec/address_person_spec.rb +8 -0
  87. data/spec/address_spec.rb +4 -0
  88. data/spec/benchmarks/xml_parsing_benchmark_spec.rb +1 -1
  89. data/spec/lutaml/json/adapter/standard_adapter_spec.rb +6 -9
  90. data/spec/lutaml/key_value/group_instantiate_spec.rb +204 -1
  91. data/spec/lutaml/model/adapter_resolver_yeptris_switch_spec.rb +0 -2
  92. data/spec/lutaml/model/cached_type_resolver_spec.rb +2 -54
  93. data/spec/lutaml/model/cdata_spec.rb +2 -15
  94. data/spec/lutaml/model/encoding_spec.rb +0 -9
  95. data/spec/lutaml/model/except_spec.rb +0 -7
  96. data/spec/lutaml/model/json_spec.rb +0 -14
  97. data/spec/lutaml/model/mixed_content_spec.rb +6 -46
  98. data/spec/lutaml/model/ordered_content_spec.rb +0 -7
  99. data/spec/lutaml/model/processing_instruction_spec.rb +0 -6
  100. data/spec/lutaml/model/runtime_compatibility_spec.rb +0 -37
  101. data/spec/lutaml/model/serializable_spec.rb +0 -2
  102. data/spec/lutaml/model/serialize/deserialization_context_spec.rb +68 -0
  103. data/spec/lutaml/model/toml_spec.rb +0 -23
  104. data/spec/lutaml/xml/adapter/base_adapter_regression_spec.rb +0 -4
  105. data/spec/lutaml/xml/adapter/order_spec.rb +1 -1
  106. data/spec/lutaml/xml/adapter/xml_namespace_spec.rb +0 -7
  107. data/spec/lutaml/xml/attribute_namespace_disjointness_spec.rb +6 -6
  108. data/spec/lutaml/xml/builder/builder_spec.rb +0 -24
  109. data/spec/lutaml/xml/default_namespace_spec.rb +1 -8
  110. data/spec/lutaml/xml/doctype_preservation_spec.rb +0 -4
  111. data/spec/lutaml/xml/entity_fragmentation_spec.rb +0 -6
  112. data/spec/lutaml/xml/fpi_namespace_spec.rb +0 -21
  113. data/spec/lutaml/xml/mapping_spec.rb +8 -15
  114. data/spec/lutaml/xml/namespace_scope_vcard_spec.rb +0 -7
  115. data/spec/lutaml/xml/namespace_spec.rb +0 -13
  116. data/spec/lutaml/xml/prefix_control_spec.rb +0 -6
  117. data/spec/lutaml/xml/schema/builder_moxml_spec.rb +1 -1
  118. data/spec/lutaml/xml/xml_adapter_spec.rb +0 -7
  119. data/spec/lutaml/xml/xml_spec.rb +2 -88
  120. data/spec/spec_helper.rb +8 -28
  121. data/spec/support/test_adapter_config.rb +6 -6
  122. metadata +2 -32
  123. data/.github/workflows/js-pr-check.yml +0 -106
  124. data/.github/workflows/js-sync.yml +0 -55
  125. data/.github/workflows/opal.yml +0 -65
  126. data/.gitmodules +0 -6
  127. data/.rspec-opal +0 -5
  128. data/docs/_guides/opal.adoc +0 -232
  129. data/lib/compat/opal/generate_boot.rb +0 -137
  130. data/lib/compat/opal/js_bundle_entry.rb +0 -42
  131. data/lib/compat/opal/lutaml_model_boot.rb +0 -638
  132. data/lib/compat/opal/monitor.rb +0 -31
  133. data/lib/compat/opal/moxml/adapter/customized_rexml/entity_reference.rb +0 -9
  134. data/lib/compat/opal/moxml/adapter/customized_rexml/formatter.rb +0 -225
  135. data/lib/compat/opal/moxml/adapter/customized_rexml.rb +0 -11
  136. data/lib/compat/opal/moxml_boot.rb +0 -68
  137. data/lib/compat/opal/objectspace_shim.rb +0 -23
  138. data/lib/compat/opal/rexml/namespace.rb +0 -59
  139. data/lib/compat/opal/rexml/parsers/baseparser.rb +0 -1016
  140. data/lib/compat/opal/rexml/source.rb +0 -214
  141. data/lib/compat/opal/rexml/text.rb +0 -426
  142. data/lib/compat/opal/rexml/xmltokens.rb +0 -45
  143. data/lib/compat/opal/rexml_compat.rb +0 -85
  144. data/lib/compat/opal/yaml_compat.rb +0 -32
  145. data/lib/lutaml/model/cached_type_resolver/mutex_hash_cache.rb +0 -53
  146. data/lib/lutaml/model/schema/schema_builder/oga.rb +0 -92
  147. data/lib/lutaml/xml/schema/builder/oga.rb +0 -92
  148. data/spec/lutaml/model/boot_manifest_spec.rb +0 -30
  149. data/spec/lutaml/model/opal_smoke_spec.rb +0 -199
  150. data/spec/lutaml/model/serialize/attribute_definition_block_form_spec.rb +0 -244
  151. data/spec/lutaml/xml/adapter/oga_adapter_spec.rb +0 -135
  152. data/spec/lutaml/xml/opal_xml_spec.rb +0 -204
  153. data/spec/support/opal.rb +0 -9
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "liquid" unless RUBY_ENGINE == "opal"
3
+ require "liquid"
4
4
  require "rspec/matchers"
5
- require "canon" unless RUBY_ENGINE == "opal"
5
+ require "canon"
6
6
 
7
7
  RSpec.configure do |config|
8
8
  # Enable flags like --only-failures and --next-failure
@@ -86,22 +86,6 @@ RSpec.configure do |config|
86
86
 
87
87
  end
88
88
  end
89
-
90
- # Under Opal, exclude specs that require native-only adapters,
91
- # filesystem, subprocess, schema compilation, or liquid templates.
92
- if RUBY_ENGINE == "opal"
93
- config.filter_run_excluding(
94
- :native_adapter,
95
- :native_fs,
96
- :subprocess,
97
- :performance,
98
- :examples,
99
- :consistency,
100
- :xsd_schema,
101
- :relaxng,
102
- :liquid,
103
- )
104
- end
105
89
  end
106
90
 
107
91
  # configuration example
@@ -114,21 +98,17 @@ require_relative "support/test_adapter_config"
114
98
  # require_relative "../lib/lutaml/model/toml_adapter/toml_rb_adapter"
115
99
 
116
100
  Lutaml::Model::Config.configure do |config|
117
- config.xml_adapter_type = if RUBY_ENGINE == "opal"
118
- :oga
119
- elsif ENV["XML_ADAPTER"]
120
- ENV["XML_ADAPTER"].to_sym
121
- else
122
- :nokogiri
123
- end
101
+ # No XML pin by default: the suite rides the production resolution —
102
+ # the moxml facade with the runtime default engine (leptris preferred,
103
+ # Nokogiri as fallback). XML_ADAPTER pins an engine for a run.
104
+ config.xml_adapter_type = ENV["XML_ADAPTER"].to_sym if ENV["XML_ADAPTER"]
124
105
  config.hash_adapter_type = :standard
125
106
  config.json_adapter_type = :standard
126
107
  config.yaml_adapter_type = :standard
127
- # toml_rb uses native ext; not registered as a lutaml format under Opal.
128
- config.toml_adapter_type = :toml_rb unless RUBY_ENGINE == "opal"
108
+ config.toml_adapter_type = :toml_rb
129
109
  end
130
110
 
131
- # Configure Canon for XML equivalence testing (Canon is not loaded under Opal)
111
+ # Configure Canon for XML equivalence testing
132
112
  if defined?(Canon::Config)
133
113
  Canon::Config.configure do |config|
134
114
  config.xml.match.profile = :spec_friendly
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # Implements Adapter First Strategy:
6
6
  # - Start with primary adapter (Nokogiri)
7
- # - Enable other adapters (Ox, Oga) incrementally once they pass full test suite
7
+ # - Enable other adapters (Ox) incrementally once they pass full test suite
8
8
  #
9
9
  # Usage:
10
10
  # # Enable only Nokogiri (primary)
@@ -42,7 +42,7 @@ class TestAdapterConfig
42
42
  end
43
43
 
44
44
  # Enable an adapter for testing
45
- # @param name [Symbol] Adapter name (:nokogiri, :ox, :oga)
45
+ # @param name [Symbol] Adapter name (:nokogiri, :ox)
46
46
  def enable_adapter(name)
47
47
  adapters_to_test << name unless adapters_to_test.include?(name)
48
48
  end
@@ -56,7 +56,7 @@ class TestAdapterConfig
56
56
 
57
57
  # Get the adapter lane for an engine: the one moxml adapter
58
58
  # pinned to that engine.
59
- # @param name [Symbol] Engine name (:nokogiri, :ox, :oga, :rexml, :leptris)
59
+ # @param name [Symbol] Engine name (:nokogiri, :ox, :rexml, :leptris)
60
60
  # @return [Class] The pinned adapter class
61
61
  def adapter_class(name)
62
62
  Lutaml::Xml::Adapter::MoxmlAdapter.for_engine(name)
@@ -65,7 +65,7 @@ class TestAdapterConfig
65
65
  # Get list of all available adapter names
66
66
  # @return [Array<Symbol>] List of all adapter names
67
67
  def all_adapters
68
- %i[nokogiri ox oga rexml]
68
+ %i[nokogiri ox rexml]
69
69
  end
70
70
 
71
71
  # Get engine name by adapter class
@@ -79,7 +79,7 @@ class TestAdapterConfig
79
79
  end
80
80
 
81
81
  # Initial configuration: Primary adapter (Nokogiri) only
82
- # Enable other adapters (Ox, Oga) incrementally once they pass full test suite
82
+ # Enable other adapters (Ox) incrementally once they pass full test suite
83
83
  TestAdapterConfig.configure do |config|
84
- config.enabled_adapters = %i[nokogiri oga]
84
+ config.enabled_adapters = %i[nokogiri]
85
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.201
4
+ version: 0.8.203
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -176,18 +176,13 @@ files:
176
176
  - ".github/workflows/dependent-tests.yml"
177
177
  - ".github/workflows/docs.yml"
178
178
  - ".github/workflows/downstream-performance.yml"
179
- - ".github/workflows/js-pr-check.yml"
180
- - ".github/workflows/js-sync.yml"
181
- - ".github/workflows/opal.yml"
182
179
  - ".github/workflows/performance.yml"
183
180
  - ".github/workflows/rake.yml"
184
181
  - ".github/workflows/release.yml"
185
182
  - ".gitignore"
186
- - ".gitmodules"
187
183
  - ".irbrc"
188
184
  - ".pryrc"
189
185
  - ".rspec"
190
- - ".rspec-opal"
191
186
  - ".rubocop.yml"
192
187
  - ".rubocop_todo.yml"
193
188
  - CODE_OF_CONDUCT.md
@@ -239,7 +234,6 @@ files:
239
234
  - docs/_guides/missing-values-handling.adoc
240
235
  - docs/_guides/native-engines.adoc
241
236
  - docs/_guides/ooxml-examples.adoc
242
- - docs/_guides/opal.adoc
243
237
  - docs/_guides/rdf-serialization.adoc
244
238
  - docs/_guides/schema-generation.adoc
245
239
  - docs/_guides/schema-import.adoc
@@ -339,22 +333,6 @@ files:
339
333
  - exe/lutaml-model
340
334
  - flake.lock
341
335
  - flake.nix
342
- - lib/compat/opal/generate_boot.rb
343
- - lib/compat/opal/js_bundle_entry.rb
344
- - lib/compat/opal/lutaml_model_boot.rb
345
- - lib/compat/opal/monitor.rb
346
- - lib/compat/opal/moxml/adapter/customized_rexml.rb
347
- - lib/compat/opal/moxml/adapter/customized_rexml/entity_reference.rb
348
- - lib/compat/opal/moxml/adapter/customized_rexml/formatter.rb
349
- - lib/compat/opal/moxml_boot.rb
350
- - lib/compat/opal/objectspace_shim.rb
351
- - lib/compat/opal/rexml/namespace.rb
352
- - lib/compat/opal/rexml/parsers/baseparser.rb
353
- - lib/compat/opal/rexml/source.rb
354
- - lib/compat/opal/rexml/text.rb
355
- - lib/compat/opal/rexml/xmltokens.rb
356
- - lib/compat/opal/rexml_compat.rb
357
- - lib/compat/opal/yaml_compat.rb
358
336
  - lib/lutaml/hash_format.rb
359
337
  - lib/lutaml/hash_format/adapter.rb
360
338
  - lib/lutaml/hash_format/adapter/document.rb
@@ -545,7 +523,6 @@ files:
545
523
  - lib/lutaml/model/attribute_validator.rb
546
524
  - lib/lutaml/model/cached_type_resolver.rb
547
525
  - lib/lutaml/model/cached_type_resolver/concurrent_map_cache.rb
548
- - lib/lutaml/model/cached_type_resolver/mutex_hash_cache.rb
549
526
  - lib/lutaml/model/choice.rb
550
527
  - lib/lutaml/model/cli.rb
551
528
  - lib/lutaml/model/collection.rb
@@ -735,7 +712,6 @@ files:
735
712
  - lib/lutaml/model/schema/rng_compiler/rng_helpers.rb
736
713
  - lib/lutaml/model/schema/rng_compiler/value_type_resolver.rb
737
714
  - lib/lutaml/model/schema/schema_builder/nokogiri.rb
738
- - lib/lutaml/model/schema/schema_builder/oga.rb
739
715
  - lib/lutaml/model/schema/shared_methods.rb
740
716
  - lib/lutaml/model/schema/templates.rb
741
717
  - lib/lutaml/model/schema/templates/model.erb
@@ -981,7 +957,6 @@ files:
981
957
  - lib/lutaml/xml/schema/builder.rb
982
958
  - lib/lutaml/xml/schema/builder/moxml.rb
983
959
  - lib/lutaml/xml/schema/builder/nokogiri.rb
984
- - lib/lutaml/xml/schema/builder/oga.rb
985
960
  - lib/lutaml/xml/schema/builtin_types.rb
986
961
  - lib/lutaml/xml/schema/relaxng_schema.rb
987
962
  - lib/lutaml/xml/schema/vc_namespace.rb
@@ -2047,7 +2022,6 @@ files:
2047
2022
  - spec/lutaml/model/attribute_spec.rb
2048
2023
  - spec/lutaml/model/attributes_memo_clear_race_spec.rb
2049
2024
  - spec/lutaml/model/binary_attribute_value_spec.rb
2050
- - spec/lutaml/model/boot_manifest_spec.rb
2051
2025
  - spec/lutaml/model/cached_type_resolver_spec.rb
2052
2026
  - spec/lutaml/model/cardinality_strict_spec.rb
2053
2027
  - spec/lutaml/model/cast_element_form_spec.rb
@@ -2139,7 +2113,6 @@ files:
2139
2113
  - spec/lutaml/model/namespace_autoload_spec.rb
2140
2114
  - spec/lutaml/model/namespace_versioning_spec.rb
2141
2115
  - spec/lutaml/model/one_entry_cache_spec.rb
2142
- - spec/lutaml/model/opal_smoke_spec.rb
2143
2116
  - spec/lutaml/model/optimization_spec.rb
2144
2117
  - spec/lutaml/model/ordered_content_spec.rb
2145
2118
  - spec/lutaml/model/parse_dispatch_hoist_spec.rb
@@ -2179,8 +2152,8 @@ files:
2179
2152
  - spec/lutaml/model/serializable_spec.rb
2180
2153
  - spec/lutaml/model/serializable_validation_spec.rb
2181
2154
  - spec/lutaml/model/serialization_profiles_spec.rb
2182
- - spec/lutaml/model/serialize/attribute_definition_block_form_spec.rb
2183
2155
  - spec/lutaml/model/serialize/builder_spec.rb
2156
+ - spec/lutaml/model/serialize/deserialization_context_spec.rb
2184
2157
  - spec/lutaml/model/serialize_perf_guard_spec.rb
2185
2158
  - spec/lutaml/model/services/transformer_spec.rb
2186
2159
  - spec/lutaml/model/simple_model_spec.rb
@@ -2285,7 +2258,6 @@ files:
2285
2258
  - spec/lutaml/xml/adapter/empty_document_diagnostics_spec.rb
2286
2259
  - spec/lutaml/xml/adapter/moxml_lane_spec.rb
2287
2260
  - spec/lutaml/xml/adapter/nokogiri_adapter_spec.rb
2288
- - spec/lutaml/xml/adapter/oga_adapter_spec.rb
2289
2261
  - spec/lutaml/xml/adapter/order_spec.rb
2290
2262
  - spec/lutaml/xml/adapter/over_cap_parse_spec.rb
2291
2263
  - spec/lutaml/xml/adapter/ox_adapter_spec.rb
@@ -2371,7 +2343,6 @@ files:
2371
2343
  - spec/lutaml/xml/namespace_three_phase_spec.rb
2372
2344
  - spec/lutaml/xml/nil_optional_element_namespace_spec.rb
2373
2345
  - spec/lutaml/xml/ooxml_namespace_spec.rb
2374
- - spec/lutaml/xml/opal_xml_spec.rb
2375
2346
  - spec/lutaml/xml/ordered_method_spec.rb
2376
2347
  - spec/lutaml/xml/out_of_namespace_parsing_spec.rb
2377
2348
  - spec/lutaml/xml/parse_dom_retention_spec.rb
@@ -2467,7 +2438,6 @@ files:
2467
2438
  - spec/person_spec.rb
2468
2439
  - spec/sample_model_spec.rb
2469
2440
  - spec/spec_helper.rb
2470
- - spec/support/opal.rb
2471
2441
  - spec/support/test_adapter_config.rb
2472
2442
  - spec/support/test_namespaces.rb
2473
2443
  - spec/support/trace_helper.rb
@@ -1,106 +0,0 @@
1
- name: js-pr-check
2
-
3
- # On PRs that touch lib/, Gemfile, Rakefile, or .gitmodules, fire a
4
- # repository_dispatch at lutaml-model-js so it builds a test artifact
5
- # and runs the JS smoke tests against the PR head. Does NOT publish.
6
- # Catches JS regressions before the Ruby PR merges.
7
- #
8
- # PAT token: LUTAML_CI_PAT_TOKEN must have `repo` scope on
9
- # lutaml/lutaml-model-js. Note that PRs from forks of lutaml/lutaml-model
10
- # will not have access to the PAT (GitHub masks secrets on fork PRs);
11
- # those builds will be skipped — contributors from forks should run
12
- # `gh workflow run js-pr-check` manually after pushing to a branch on
13
- # the origin repo.
14
-
15
- on:
16
- pull_request:
17
- paths:
18
- - 'lib/**'
19
- - 'Gemfile'
20
- - 'gemspec'
21
- - 'Rakefile'
22
- - '.gitmodules'
23
- - '.github/workflows/js-pr-check.yml'
24
- workflow_dispatch:
25
- inputs:
26
- pr_number:
27
- description: PR number to test (for manual reruns).
28
- required: true
29
-
30
- permissions:
31
- contents: read
32
- pull-requests: write
33
-
34
- concurrency:
35
- group: js-pr-check-${{ github.ref }}
36
- cancel-in-progress: true
37
-
38
- jobs:
39
- trigger:
40
- runs-on: ubuntu-latest
41
- if: ${{ github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == 'lutaml/lutaml-model' }}
42
- steps:
43
- - uses: actions/checkout@v6
44
- with:
45
- # Need the PR head, not the merge commit, so the SHA the JS
46
- # build pulls matches what reviewers see.
47
- ref: ${{ github.event.pull_request.head.sha || github.sha }}
48
- fetch-depth: 0
49
-
50
- - name: Resolve PR inputs
51
- id: pr
52
- uses: actions/github-script@v7
53
- with:
54
- script: |
55
- const prNumber = context.payload.inputs?.pr_number
56
- ? parseInt(context.payload.inputs.pr_number, 10)
57
- : context.payload.pull_request?.number;
58
- if (!prNumber) {
59
- core.setFailed("No PR number available");
60
- return;
61
- }
62
- const { data: pr } = await github.rest.pulls.get({
63
- owner: context.repo.owner,
64
- repo: context.repo.repo,
65
- pull_number: prNumber,
66
- });
67
- core.setOutput("number", String(prNumber));
68
- core.setOutput("sha", pr.head.sha);
69
- core.setOutput("ref", pr.head.ref);
70
- core.setOutput("repo", pr.head.repo.full_name);
71
-
72
- - name: Notify lutaml-model-js
73
- uses: peter-evans/repository-dispatch@v3
74
- with:
75
- token: ${{ secrets.LUTAML_CI_PAT_TOKEN }}
76
- repository: lutaml/lutaml-model-js
77
- event-type: js-pr-check
78
- client-payload: |-
79
- {
80
- "pr_number": ${{ steps.pr.outputs.number }},
81
- "sha": "${{ steps.pr.outputs.sha }}",
82
- "ref": "${{ steps.pr.outputs.ref }}",
83
- "repo": "${{ steps.pr.outputs.repo }}"
84
- }
85
-
86
- - name: Annotate PR with build link
87
- if: ${{ github.event_name == 'pull_request' }}
88
- uses: actions/github-script@v7
89
- with:
90
- script: |
91
- const body = [
92
- "### JS build check",
93
- "",
94
- "Triggered [`js-pr-check`]",
95
- `(https://github.com/lutaml/lutaml-model-js/actions/workflows/pr-check.yml)`,
96
- "against this PR's head (`" + context.payload.pull_request.head.sha.substring(0, 7) + "`).",
97
- "",
98
- "The result will appear as a `lutaml-model-js / pr-check` status check",
99
- "on this PR once the workflow run completes.",
100
- ].join("\n");
101
- await github.rest.issues.createComment({
102
- owner: context.repo.owner,
103
- repo: context.repo.repo,
104
- issue_number: context.payload.pull_request.number,
105
- body,
106
- });
@@ -1,55 +0,0 @@
1
- name: js-sync
2
-
3
- # On every push to main, fire a repository_dispatch at lutaml-model-js
4
- # so it rebuilds and publishes under the npm `next` dist-tag. This
5
- # closes the dev-build gap: JS consumers can track Ruby main without
6
- # waiting for a stable gem release.
7
- #
8
- # PAT token: LUTAML_CI_PAT_TOKEN must have `repo` scope on
9
- # lutaml/lutaml-model-js. Same token already used by release.yml.
10
-
11
- on:
12
- push:
13
- branches: [main]
14
- workflow_dispatch:
15
- inputs:
16
- sha:
17
- description: Specific SHA to build from (defaults to HEAD on main).
18
- required: false
19
-
20
- permissions:
21
- contents: read
22
-
23
- concurrency:
24
- group: js-sync-${{ github.ref }}
25
- cancel-in-progress: true
26
-
27
- jobs:
28
- trigger:
29
- runs-on: ubuntu-latest
30
- steps:
31
- - uses: actions/checkout@v6
32
- with:
33
- fetch-depth: 0
34
-
35
- - name: Resolve SHA
36
- id: sha
37
- run: |
38
- if [ -n "${{ github.event.inputs.sha }}" ]; then
39
- echo "sha=${{ github.event.inputs.sha }}" >> "$GITHUB_OUTPUT"
40
- else
41
- echo "sha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
42
- fi
43
-
44
- - name: Notify lutaml-model-js
45
- uses: peter-evans/repository-dispatch@v3
46
- with:
47
- token: ${{ secrets.LUTAML_CI_PAT_TOKEN }}
48
- repository: lutaml/lutaml-model-js
49
- event-type: js-sync-main
50
- client-payload: |-
51
- {
52
- "sha": "${{ steps.sha.outputs.sha }}",
53
- "ref": "${{ github.ref }}",
54
- "ruby_ref": "main"
55
- }
@@ -1,65 +0,0 @@
1
- # DEPRECATED: the Opal lane is on the deprecation path (the moxml-ts
2
- # wasm binding is the JavaScript endgame). The lane stays green — the
3
- # boot repair chain lives in lib/compat/opal — but it is
4
- # maintenance-only and non-gating; removal is planned for a future
5
- # release.
6
- name: opal
7
-
8
- on:
9
- push:
10
- branches: [main]
11
- tags: [ v* ]
12
- pull_request:
13
-
14
- permissions:
15
- contents: read
16
-
17
- concurrency:
18
- group: opal-${{ github.ref }}
19
- cancel-in-progress: true
20
-
21
- jobs:
22
- test:
23
- runs-on: ubuntu-latest
24
- env:
25
- # The Opal leg is the ONLY consumer of the vendored
26
- # Opal-compatibility forks (#835 step 2): MRI legs run released
27
- # oga/ruby-ll.
28
- LUTAML_OPAL_FORKS: "1"
29
- steps:
30
- - uses: actions/checkout@v6
31
- with:
32
- submodules: "recursive"
33
-
34
- - name: Set up Ruby
35
- uses: ruby/setup-ruby@v1
36
- with:
37
- ruby-version: "3.4"
38
- # bundler-cache disabled: the path-source oga and ruby-ll forks
39
- # need ragel + ruby-ll outputs generated (rake vendor:prepare)
40
- # before their C extensions can compile.
41
- bundler-cache: false
42
-
43
- - name: Set up Node.js
44
- uses: actions/setup-node@v4
45
- with:
46
- node-version: "18"
47
-
48
- - name: Install ragel
49
- run: sudo apt-get update && sudo apt-get install -y ragel
50
-
51
- - name: Install ruby-ll (for rake vendor:prepare)
52
- run: gem install ruby-ll --no-document
53
-
54
- - name: Generate ragel / ruby-ll outputs in vendored forks
55
- # Run before bundle install: the path-source oga/ruby-ll forks
56
- # gitignore their generated .rb/.c files. bundle install compiles
57
- # the C extensions via each fork's extconf.rb, which needs
58
- # ext/c/lexer.c to exist.
59
- run: rake vendor:prepare
60
-
61
- - name: Install dependencies
62
- run: bundle install
63
-
64
- - name: Run Opal tests
65
- run: bundle exec rake spec:opal
data/.gitmodules DELETED
@@ -1,6 +0,0 @@
1
- [submodule "vendor/opal-oga"]
2
- path = vendor/opal-oga
3
- url = https://github.com/lutaml/opal-oga.git
4
- [submodule "vendor/opal-ruby-ll"]
5
- path = vendor/opal-ruby-ll
6
- url = https://github.com/lutaml/opal-ruby-ll.git
data/.rspec-opal DELETED
@@ -1,5 +0,0 @@
1
- --default-path=spec
2
- --pattern='spec/lutaml/model/opal_smoke_spec.rb,spec/lutaml/xml/opal_xml_spec.rb'
3
- -I lib
4
- --require=spec_helper
5
- --require=support/opal