From acee94ccedbddb13d08f703b5abcd0ce4029c704 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Thu, 22 Aug 2024 15:59:41 -0700 Subject: [PATCH 1/9] Use mono_repo for package:web Splits package:web into two packages: - package:web - package:web_generator (not published) The latter contains our tooling to generate the former, and used to be the tool directory. Refactors code to point to new paths and moves directories like third_party to their appropriate locations. Moves the CI configurations to mono_repo.yaml and mono_pkg.yaml files, and is now generated as dart.yml. --- .github/workflows/build.yml | 103 ---- .github/workflows/dart.yml | 471 ++++++++++++++++++ .gitignore | 6 +- mono_repo.yaml | 11 + tool/ci.sh | 123 +++++ CHANGELOG.md => web/CHANGELOG.md | 2 +- LICENSE => web/LICENSE | 0 README.md => web/README.md | 6 +- .../analysis_options.yaml | 0 {example => web/example}/example.dart | 0 {example => web/example}/index.html | 0 {lib => web/lib}/fix_data.yaml | 0 {lib => web/lib}/helpers.dart | 0 {lib => web/lib}/src/dom.dart | 0 {lib => web/lib}/src/dom/accelerometer.dart | 0 .../lib}/src/dom/angle_instanced_arrays.dart | 0 .../src/dom/attribution_reporting_api.dart | 0 {lib => web/lib}/src/dom/background_sync.dart | 0 {lib => web/lib}/src/dom/battery_status.dart | 0 {lib => web/lib}/src/dom/clipboard_apis.dart | 0 {lib => web/lib}/src/dom/compression.dart | 0 {lib => web/lib}/src/dom/console.dart | 0 {lib => web/lib}/src/dom/cookie_store.dart | 0 .../lib}/src/dom/credential_management.dart | 0 {lib => web/lib}/src/dom/csp.dart | 0 {lib => web/lib}/src/dom/css_animations.dart | 0 .../lib}/src/dom/css_animations_2.dart | 0 {lib => web/lib}/src/dom/css_cascade.dart | 0 {lib => web/lib}/src/dom/css_cascade_6.dart | 0 {lib => web/lib}/src/dom/css_conditional.dart | 0 .../lib}/src/dom/css_conditional_5.dart | 0 {lib => web/lib}/src/dom/css_contain.dart | 0 .../lib}/src/dom/css_counter_styles.dart | 0 .../lib}/src/dom/css_font_loading.dart | 0 {lib => web/lib}/src/dom/css_fonts.dart | 0 .../lib}/src/dom/css_highlight_api.dart | 0 {lib => web/lib}/src/dom/css_masking.dart | 0 {lib => web/lib}/src/dom/css_paint_api.dart | 0 .../src/dom/css_properties_values_api.dart | 0 {lib => web/lib}/src/dom/css_transitions.dart | 0 .../lib}/src/dom/css_transitions_2.dart | 0 {lib => web/lib}/src/dom/css_typed_om.dart | 0 .../lib}/src/dom/css_view_transitions.dart | 0 .../lib}/src/dom/css_view_transitions_2.dart | 0 {lib => web/lib}/src/dom/cssom.dart | 0 {lib => web/lib}/src/dom/cssom_view.dart | 0 .../lib}/src/dom/digital_identities.dart | 0 {lib => web/lib}/src/dom/dom.dart | 0 {lib => web/lib}/src/dom/dom_parsing.dart | 0 {lib => web/lib}/src/dom/encoding.dart | 0 {lib => web/lib}/src/dom/encrypted_media.dart | 0 {lib => web/lib}/src/dom/entries_api.dart | 0 {lib => web/lib}/src/dom/event_timing.dart | 0 .../lib}/src/dom/ext_blend_minmax.dart | 0 .../lib}/src/dom/ext_color_buffer_float.dart | 0 .../src/dom/ext_color_buffer_half_float.dart | 0 .../src/dom/ext_disjoint_timer_query.dart | 0 .../dom/ext_disjoint_timer_query_webgl2.dart | 0 {lib => web/lib}/src/dom/ext_float_blend.dart | 0 {lib => web/lib}/src/dom/ext_frag_depth.dart | 0 .../lib}/src/dom/ext_shader_texture_lod.dart | 0 {lib => web/lib}/src/dom/ext_srgb.dart | 0 .../src/dom/ext_texture_compression_bptc.dart | 0 .../src/dom/ext_texture_compression_rgtc.dart | 0 .../dom/ext_texture_filter_anisotropic.dart | 0 .../lib}/src/dom/ext_texture_norm16.dart | 0 {lib => web/lib}/src/dom/fedcm.dart | 0 {lib => web/lib}/src/dom/fetch.dart | 0 {lib => web/lib}/src/dom/fido.dart | 0 {lib => web/lib}/src/dom/fileapi.dart | 0 {lib => web/lib}/src/dom/filter_effects.dart | 0 {lib => web/lib}/src/dom/fs.dart | 0 {lib => web/lib}/src/dom/fullscreen.dart | 0 {lib => web/lib}/src/dom/gamepad.dart | 0 {lib => web/lib}/src/dom/generic_sensor.dart | 0 {lib => web/lib}/src/dom/geolocation.dart | 0 {lib => web/lib}/src/dom/geometry.dart | 0 {lib => web/lib}/src/dom/gyroscope.dart | 0 {lib => web/lib}/src/dom/hr_time.dart | 0 {lib => web/lib}/src/dom/html.dart | 0 {lib => web/lib}/src/dom/image_capture.dart | 0 {lib => web/lib}/src/dom/indexeddb.dart | 0 .../lib}/src/dom/intersection_observer.dart | 0 .../src/dom/khr_parallel_shader_compile.dart | 0 .../src/dom/largest_contentful_paint.dart | 0 {lib => web/lib}/src/dom/mathml_core.dart | 0 .../lib}/src/dom/media_capabilities.dart | 0 .../lib}/src/dom/media_playback_quality.dart | 0 {lib => web/lib}/src/dom/media_source.dart | 0 .../src/dom/mediacapture_fromelement.dart | 0 .../lib}/src/dom/mediacapture_streams.dart | 0 .../lib}/src/dom/mediacapture_transform.dart | 0 {lib => web/lib}/src/dom/mediasession.dart | 0 .../lib}/src/dom/mediastream_recording.dart | 0 .../lib}/src/dom/mst_content_hint.dart | 0 .../lib}/src/dom/navigation_timing.dart | 0 {lib => web/lib}/src/dom/netinfo.dart | 0 {lib => web/lib}/src/dom/notifications.dart | 0 .../src/dom/oes_draw_buffers_indexed.dart | 0 .../lib}/src/dom/oes_element_index_uint.dart | 0 .../lib}/src/dom/oes_fbo_render_mipmap.dart | 0 .../src/dom/oes_standard_derivatives.dart | 0 .../lib}/src/dom/oes_texture_float.dart | 0 .../src/dom/oes_texture_float_linear.dart | 0 .../lib}/src/dom/oes_texture_half_float.dart | 0 .../dom/oes_texture_half_float_linear.dart | 0 .../lib}/src/dom/oes_vertex_array_object.dart | 0 .../lib}/src/dom/orientation_event.dart | 0 .../lib}/src/dom/orientation_sensor.dart | 0 {lib => web/lib}/src/dom/ovr_multiview2.dart | 0 {lib => web/lib}/src/dom/paint_timing.dart | 0 {lib => web/lib}/src/dom/payment_request.dart | 0 .../lib}/src/dom/performance_timeline.dart | 0 {lib => web/lib}/src/dom/permissions.dart | 0 .../lib}/src/dom/picture_in_picture.dart | 0 {lib => web/lib}/src/dom/pointerevents.dart | 0 {lib => web/lib}/src/dom/pointerlock.dart | 0 .../lib}/src/dom/private_network_access.dart | 0 {lib => web/lib}/src/dom/push_api.dart | 0 {lib => web/lib}/src/dom/referrer_policy.dart | 0 {lib => web/lib}/src/dom/remote_playback.dart | 0 {lib => web/lib}/src/dom/reporting.dart | 0 .../lib}/src/dom/requestidlecallback.dart | 0 {lib => web/lib}/src/dom/resize_observer.dart | 0 {lib => web/lib}/src/dom/resource_timing.dart | 0 .../lib}/src/dom/saa_non_cookie_storage.dart | 0 {lib => web/lib}/src/dom/sanitizer_api.dart | 0 {lib => web/lib}/src/dom/scheduling_apis.dart | 0 {lib => web/lib}/src/dom/screen_capture.dart | 0 .../lib}/src/dom/screen_orientation.dart | 0 .../lib}/src/dom/screen_wake_lock.dart | 0 .../src/dom/secure_payment_confirmation.dart | 0 {lib => web/lib}/src/dom/selection_api.dart | 0 {lib => web/lib}/src/dom/server_timing.dart | 0 {lib => web/lib}/src/dom/service_workers.dart | 0 {lib => web/lib}/src/dom/speech_api.dart | 0 {lib => web/lib}/src/dom/storage.dart | 0 {lib => web/lib}/src/dom/streams.dart | 0 {lib => web/lib}/src/dom/svg.dart | 0 {lib => web/lib}/src/dom/svg_animations.dart | 0 {lib => web/lib}/src/dom/touch_events.dart | 0 {lib => web/lib}/src/dom/trust_token_api.dart | 0 {lib => web/lib}/src/dom/trusted_types.dart | 0 {lib => web/lib}/src/dom/uievents.dart | 0 {lib => web/lib}/src/dom/url.dart | 0 {lib => web/lib}/src/dom/user_timing.dart | 0 {lib => web/lib}/src/dom/vibration.dart | 0 {lib => web/lib}/src/dom/video_rvfc.dart | 0 {lib => web/lib}/src/dom/wasm_js_api.dart | 0 {lib => web/lib}/src/dom/web_animations.dart | 0 .../lib}/src/dom/web_animations_2.dart | 0 {lib => web/lib}/src/dom/web_bluetooth.dart | 0 {lib => web/lib}/src/dom/web_locks.dart | 0 {lib => web/lib}/src/dom/web_otp.dart | 0 {lib => web/lib}/src/dom/web_share.dart | 0 {lib => web/lib}/src/dom/webaudio.dart | 0 {lib => web/lib}/src/dom/webauthn.dart | 0 {lib => web/lib}/src/dom/webcodecs.dart | 0 .../dom/webcodecs_av1_codec_registration.dart | 0 .../dom/webcodecs_avc_codec_registration.dart | 0 .../webcodecs_hevc_codec_registration.dart | 0 .../dom/webcodecs_vp9_codec_registration.dart | 0 {lib => web/lib}/src/dom/webcryptoapi.dart | 0 {lib => web/lib}/src/dom/webgl1.dart | 0 {lib => web/lib}/src/dom/webgl2.dart | 0 .../src/dom/webgl_color_buffer_float.dart | 0 .../dom/webgl_compressed_texture_astc.dart | 0 .../src/dom/webgl_compressed_texture_etc.dart | 0 .../dom/webgl_compressed_texture_etc1.dart | 0 .../dom/webgl_compressed_texture_pvrtc.dart | 0 .../dom/webgl_compressed_texture_s3tc.dart | 0 .../webgl_compressed_texture_s3tc_srgb.dart | 0 .../src/dom/webgl_debug_renderer_info.dart | 0 .../lib}/src/dom/webgl_debug_shaders.dart | 0 .../lib}/src/dom/webgl_depth_texture.dart | 0 .../lib}/src/dom/webgl_draw_buffers.dart | 0 .../lib}/src/dom/webgl_lose_context.dart | 0 .../lib}/src/dom/webgl_multi_draw.dart | 0 {lib => web/lib}/src/dom/webgpu.dart | 0 {lib => web/lib}/src/dom/webidl.dart | 0 {lib => web/lib}/src/dom/webmidi.dart | 0 {lib => web/lib}/src/dom/webrtc.dart | 0 .../src/dom/webrtc_encoded_transform.dart | 0 {lib => web/lib}/src/dom/webrtc_identity.dart | 0 {lib => web/lib}/src/dom/webrtc_priority.dart | 0 {lib => web/lib}/src/dom/websockets.dart | 0 {lib => web/lib}/src/dom/webtransport.dart | 0 {lib => web/lib}/src/dom/webvtt.dart | 0 {lib => web/lib}/src/dom/webxr.dart | 0 .../lib}/src/dom/webxr_hand_input.dart | 0 {lib => web/lib}/src/dom/xhr.dart | 0 {lib => web/lib}/src/helpers.dart | 0 {lib => web/lib}/src/helpers/enums.dart | 0 .../lib}/src/helpers/events/events.dart | 0 .../lib}/src/helpers/events/providers.dart | 0 .../lib}/src/helpers/events/streams.dart | 0 {lib => web/lib}/src/helpers/extensions.dart | 0 {lib => web/lib}/src/helpers/http.dart | 0 {lib => web/lib}/src/helpers/lists.dart | 0 {lib => web/lib}/src/helpers/renames.dart | 0 {lib => web/lib}/web.dart | 0 web/mono_pkg.yaml | 14 + web/pubspec.yaml | 11 + {test => web/test}/dart_fix_test.dart | 0 .../test}/element_constructor_test.dart | 0 {test => web/test}/helpers_test.dart | 0 {test => web/test}/smoke_test.dart | 0 {test_fixes => web/test_fixes}/README.md | 0 .../test_fixes}/analysis_options.yaml | 0 {test_fixes => web/test_fixes}/renames.dart | 0 .../test_fixes}/renames.dart.expect | 0 web_generator/CHANGELOG.md | 3 + web_generator/LICENSE | 26 + {tool => web_generator}/README.md | 16 +- {tool => web_generator}/generator/README.md | 4 +- .../generator/banned_names.dart | 0 {tool => web_generator}/generator/bcd.dart | 0 .../generator/dart_main.dart | 0 .../generator/doc_provider.dart | 2 +- .../generator/filesystem_api.dart | 0 .../generator/formatting.dart | 0 .../generator/generate_bindings.dart | 0 .../generator/js_type_supertypes.dart | 2 +- {tool => web_generator}/generator/main.mjs | 0 .../generator/package-lock.json | 0 .../generator/package.json | 0 .../generator/singletons.dart | 0 .../generator/translator.dart | 0 .../generator/type_aliases.dart | 0 .../generator/type_union.dart | 0 {tool => web_generator}/generator/util.dart | 0 .../generator/webidl_api.dart | 0 .../generator/webref_css_api.dart | 0 .../generator/webref_elements_api.dart | 0 .../generator/webref_idl_api.dart | 0 web_generator/mono_pkg.yaml | 13 + web_generator/package-lock.json | 6 + pubspec.yaml => web_generator/pubspec.yaml | 9 +- {tool => web_generator}/renames.md | 0 {tool => web_generator}/scrape_mdn.dart | 0 .../test}/generate_docs_test.dart | 2 +- .../test}/scrape_mdn_test.dart | 2 +- .../test}/type_union_test.dart | 2 +- .../third_party}/mdn/LICENSE | 0 .../third_party}/mdn/README.md | 0 .../third_party}/mdn/mdn.json | 0 {tool => web_generator}/update_bindings.dart | 10 +- 247 files changed, 710 insertions(+), 134 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/dart.yml create mode 100644 mono_repo.yaml create mode 100755 tool/ci.sh rename CHANGELOG.md => web/CHANGELOG.md (98%) rename LICENSE => web/LICENSE (100%) rename README.md => web/README.md (93%) rename analysis_options.yaml => web/analysis_options.yaml (100%) rename {example => web/example}/example.dart (100%) rename {example => web/example}/index.html (100%) rename {lib => web/lib}/fix_data.yaml (100%) rename {lib => web/lib}/helpers.dart (100%) rename {lib => web/lib}/src/dom.dart (100%) rename {lib => web/lib}/src/dom/accelerometer.dart (100%) rename {lib => web/lib}/src/dom/angle_instanced_arrays.dart (100%) rename {lib => web/lib}/src/dom/attribution_reporting_api.dart (100%) rename {lib => web/lib}/src/dom/background_sync.dart (100%) rename {lib => web/lib}/src/dom/battery_status.dart (100%) rename {lib => web/lib}/src/dom/clipboard_apis.dart (100%) rename {lib => web/lib}/src/dom/compression.dart (100%) rename {lib => web/lib}/src/dom/console.dart (100%) rename {lib => web/lib}/src/dom/cookie_store.dart (100%) rename {lib => web/lib}/src/dom/credential_management.dart (100%) rename {lib => web/lib}/src/dom/csp.dart (100%) rename {lib => web/lib}/src/dom/css_animations.dart (100%) rename {lib => web/lib}/src/dom/css_animations_2.dart (100%) rename {lib => web/lib}/src/dom/css_cascade.dart (100%) rename {lib => web/lib}/src/dom/css_cascade_6.dart (100%) rename {lib => web/lib}/src/dom/css_conditional.dart (100%) rename {lib => web/lib}/src/dom/css_conditional_5.dart (100%) rename {lib => web/lib}/src/dom/css_contain.dart (100%) rename {lib => web/lib}/src/dom/css_counter_styles.dart (100%) rename {lib => web/lib}/src/dom/css_font_loading.dart (100%) rename {lib => web/lib}/src/dom/css_fonts.dart (100%) rename {lib => web/lib}/src/dom/css_highlight_api.dart (100%) rename {lib => web/lib}/src/dom/css_masking.dart (100%) rename {lib => web/lib}/src/dom/css_paint_api.dart (100%) rename {lib => web/lib}/src/dom/css_properties_values_api.dart (100%) rename {lib => web/lib}/src/dom/css_transitions.dart (100%) rename {lib => web/lib}/src/dom/css_transitions_2.dart (100%) rename {lib => web/lib}/src/dom/css_typed_om.dart (100%) rename {lib => web/lib}/src/dom/css_view_transitions.dart (100%) rename {lib => web/lib}/src/dom/css_view_transitions_2.dart (100%) rename {lib => web/lib}/src/dom/cssom.dart (100%) rename {lib => web/lib}/src/dom/cssom_view.dart (100%) rename {lib => web/lib}/src/dom/digital_identities.dart (100%) rename {lib => web/lib}/src/dom/dom.dart (100%) rename {lib => web/lib}/src/dom/dom_parsing.dart (100%) rename {lib => web/lib}/src/dom/encoding.dart (100%) rename {lib => web/lib}/src/dom/encrypted_media.dart (100%) rename {lib => web/lib}/src/dom/entries_api.dart (100%) rename {lib => web/lib}/src/dom/event_timing.dart (100%) rename {lib => web/lib}/src/dom/ext_blend_minmax.dart (100%) rename {lib => web/lib}/src/dom/ext_color_buffer_float.dart (100%) rename {lib => web/lib}/src/dom/ext_color_buffer_half_float.dart (100%) rename {lib => web/lib}/src/dom/ext_disjoint_timer_query.dart (100%) rename {lib => web/lib}/src/dom/ext_disjoint_timer_query_webgl2.dart (100%) rename {lib => web/lib}/src/dom/ext_float_blend.dart (100%) rename {lib => web/lib}/src/dom/ext_frag_depth.dart (100%) rename {lib => web/lib}/src/dom/ext_shader_texture_lod.dart (100%) rename {lib => web/lib}/src/dom/ext_srgb.dart (100%) rename {lib => web/lib}/src/dom/ext_texture_compression_bptc.dart (100%) rename {lib => web/lib}/src/dom/ext_texture_compression_rgtc.dart (100%) rename {lib => web/lib}/src/dom/ext_texture_filter_anisotropic.dart (100%) rename {lib => web/lib}/src/dom/ext_texture_norm16.dart (100%) rename {lib => web/lib}/src/dom/fedcm.dart (100%) rename {lib => web/lib}/src/dom/fetch.dart (100%) rename {lib => web/lib}/src/dom/fido.dart (100%) rename {lib => web/lib}/src/dom/fileapi.dart (100%) rename {lib => web/lib}/src/dom/filter_effects.dart (100%) rename {lib => web/lib}/src/dom/fs.dart (100%) rename {lib => web/lib}/src/dom/fullscreen.dart (100%) rename {lib => web/lib}/src/dom/gamepad.dart (100%) rename {lib => web/lib}/src/dom/generic_sensor.dart (100%) rename {lib => web/lib}/src/dom/geolocation.dart (100%) rename {lib => web/lib}/src/dom/geometry.dart (100%) rename {lib => web/lib}/src/dom/gyroscope.dart (100%) rename {lib => web/lib}/src/dom/hr_time.dart (100%) rename {lib => web/lib}/src/dom/html.dart (100%) rename {lib => web/lib}/src/dom/image_capture.dart (100%) rename {lib => web/lib}/src/dom/indexeddb.dart (100%) rename {lib => web/lib}/src/dom/intersection_observer.dart (100%) rename {lib => web/lib}/src/dom/khr_parallel_shader_compile.dart (100%) rename {lib => web/lib}/src/dom/largest_contentful_paint.dart (100%) rename {lib => web/lib}/src/dom/mathml_core.dart (100%) rename {lib => web/lib}/src/dom/media_capabilities.dart (100%) rename {lib => web/lib}/src/dom/media_playback_quality.dart (100%) rename {lib => web/lib}/src/dom/media_source.dart (100%) rename {lib => web/lib}/src/dom/mediacapture_fromelement.dart (100%) rename {lib => web/lib}/src/dom/mediacapture_streams.dart (100%) rename {lib => web/lib}/src/dom/mediacapture_transform.dart (100%) rename {lib => web/lib}/src/dom/mediasession.dart (100%) rename {lib => web/lib}/src/dom/mediastream_recording.dart (100%) rename {lib => web/lib}/src/dom/mst_content_hint.dart (100%) rename {lib => web/lib}/src/dom/navigation_timing.dart (100%) rename {lib => web/lib}/src/dom/netinfo.dart (100%) rename {lib => web/lib}/src/dom/notifications.dart (100%) rename {lib => web/lib}/src/dom/oes_draw_buffers_indexed.dart (100%) rename {lib => web/lib}/src/dom/oes_element_index_uint.dart (100%) rename {lib => web/lib}/src/dom/oes_fbo_render_mipmap.dart (100%) rename {lib => web/lib}/src/dom/oes_standard_derivatives.dart (100%) rename {lib => web/lib}/src/dom/oes_texture_float.dart (100%) rename {lib => web/lib}/src/dom/oes_texture_float_linear.dart (100%) rename {lib => web/lib}/src/dom/oes_texture_half_float.dart (100%) rename {lib => web/lib}/src/dom/oes_texture_half_float_linear.dart (100%) rename {lib => web/lib}/src/dom/oes_vertex_array_object.dart (100%) rename {lib => web/lib}/src/dom/orientation_event.dart (100%) rename {lib => web/lib}/src/dom/orientation_sensor.dart (100%) rename {lib => web/lib}/src/dom/ovr_multiview2.dart (100%) rename {lib => web/lib}/src/dom/paint_timing.dart (100%) rename {lib => web/lib}/src/dom/payment_request.dart (100%) rename {lib => web/lib}/src/dom/performance_timeline.dart (100%) rename {lib => web/lib}/src/dom/permissions.dart (100%) rename {lib => web/lib}/src/dom/picture_in_picture.dart (100%) rename {lib => web/lib}/src/dom/pointerevents.dart (100%) rename {lib => web/lib}/src/dom/pointerlock.dart (100%) rename {lib => web/lib}/src/dom/private_network_access.dart (100%) rename {lib => web/lib}/src/dom/push_api.dart (100%) rename {lib => web/lib}/src/dom/referrer_policy.dart (100%) rename {lib => web/lib}/src/dom/remote_playback.dart (100%) rename {lib => web/lib}/src/dom/reporting.dart (100%) rename {lib => web/lib}/src/dom/requestidlecallback.dart (100%) rename {lib => web/lib}/src/dom/resize_observer.dart (100%) rename {lib => web/lib}/src/dom/resource_timing.dart (100%) rename {lib => web/lib}/src/dom/saa_non_cookie_storage.dart (100%) rename {lib => web/lib}/src/dom/sanitizer_api.dart (100%) rename {lib => web/lib}/src/dom/scheduling_apis.dart (100%) rename {lib => web/lib}/src/dom/screen_capture.dart (100%) rename {lib => web/lib}/src/dom/screen_orientation.dart (100%) rename {lib => web/lib}/src/dom/screen_wake_lock.dart (100%) rename {lib => web/lib}/src/dom/secure_payment_confirmation.dart (100%) rename {lib => web/lib}/src/dom/selection_api.dart (100%) rename {lib => web/lib}/src/dom/server_timing.dart (100%) rename {lib => web/lib}/src/dom/service_workers.dart (100%) rename {lib => web/lib}/src/dom/speech_api.dart (100%) rename {lib => web/lib}/src/dom/storage.dart (100%) rename {lib => web/lib}/src/dom/streams.dart (100%) rename {lib => web/lib}/src/dom/svg.dart (100%) rename {lib => web/lib}/src/dom/svg_animations.dart (100%) rename {lib => web/lib}/src/dom/touch_events.dart (100%) rename {lib => web/lib}/src/dom/trust_token_api.dart (100%) rename {lib => web/lib}/src/dom/trusted_types.dart (100%) rename {lib => web/lib}/src/dom/uievents.dart (100%) rename {lib => web/lib}/src/dom/url.dart (100%) rename {lib => web/lib}/src/dom/user_timing.dart (100%) rename {lib => web/lib}/src/dom/vibration.dart (100%) rename {lib => web/lib}/src/dom/video_rvfc.dart (100%) rename {lib => web/lib}/src/dom/wasm_js_api.dart (100%) rename {lib => web/lib}/src/dom/web_animations.dart (100%) rename {lib => web/lib}/src/dom/web_animations_2.dart (100%) rename {lib => web/lib}/src/dom/web_bluetooth.dart (100%) rename {lib => web/lib}/src/dom/web_locks.dart (100%) rename {lib => web/lib}/src/dom/web_otp.dart (100%) rename {lib => web/lib}/src/dom/web_share.dart (100%) rename {lib => web/lib}/src/dom/webaudio.dart (100%) rename {lib => web/lib}/src/dom/webauthn.dart (100%) rename {lib => web/lib}/src/dom/webcodecs.dart (100%) rename {lib => web/lib}/src/dom/webcodecs_av1_codec_registration.dart (100%) rename {lib => web/lib}/src/dom/webcodecs_avc_codec_registration.dart (100%) rename {lib => web/lib}/src/dom/webcodecs_hevc_codec_registration.dart (100%) rename {lib => web/lib}/src/dom/webcodecs_vp9_codec_registration.dart (100%) rename {lib => web/lib}/src/dom/webcryptoapi.dart (100%) rename {lib => web/lib}/src/dom/webgl1.dart (100%) rename {lib => web/lib}/src/dom/webgl2.dart (100%) rename {lib => web/lib}/src/dom/webgl_color_buffer_float.dart (100%) rename {lib => web/lib}/src/dom/webgl_compressed_texture_astc.dart (100%) rename {lib => web/lib}/src/dom/webgl_compressed_texture_etc.dart (100%) rename {lib => web/lib}/src/dom/webgl_compressed_texture_etc1.dart (100%) rename {lib => web/lib}/src/dom/webgl_compressed_texture_pvrtc.dart (100%) rename {lib => web/lib}/src/dom/webgl_compressed_texture_s3tc.dart (100%) rename {lib => web/lib}/src/dom/webgl_compressed_texture_s3tc_srgb.dart (100%) rename {lib => web/lib}/src/dom/webgl_debug_renderer_info.dart (100%) rename {lib => web/lib}/src/dom/webgl_debug_shaders.dart (100%) rename {lib => web/lib}/src/dom/webgl_depth_texture.dart (100%) rename {lib => web/lib}/src/dom/webgl_draw_buffers.dart (100%) rename {lib => web/lib}/src/dom/webgl_lose_context.dart (100%) rename {lib => web/lib}/src/dom/webgl_multi_draw.dart (100%) rename {lib => web/lib}/src/dom/webgpu.dart (100%) rename {lib => web/lib}/src/dom/webidl.dart (100%) rename {lib => web/lib}/src/dom/webmidi.dart (100%) rename {lib => web/lib}/src/dom/webrtc.dart (100%) rename {lib => web/lib}/src/dom/webrtc_encoded_transform.dart (100%) rename {lib => web/lib}/src/dom/webrtc_identity.dart (100%) rename {lib => web/lib}/src/dom/webrtc_priority.dart (100%) rename {lib => web/lib}/src/dom/websockets.dart (100%) rename {lib => web/lib}/src/dom/webtransport.dart (100%) rename {lib => web/lib}/src/dom/webvtt.dart (100%) rename {lib => web/lib}/src/dom/webxr.dart (100%) rename {lib => web/lib}/src/dom/webxr_hand_input.dart (100%) rename {lib => web/lib}/src/dom/xhr.dart (100%) rename {lib => web/lib}/src/helpers.dart (100%) rename {lib => web/lib}/src/helpers/enums.dart (100%) rename {lib => web/lib}/src/helpers/events/events.dart (100%) rename {lib => web/lib}/src/helpers/events/providers.dart (100%) rename {lib => web/lib}/src/helpers/events/streams.dart (100%) rename {lib => web/lib}/src/helpers/extensions.dart (100%) rename {lib => web/lib}/src/helpers/http.dart (100%) rename {lib => web/lib}/src/helpers/lists.dart (100%) rename {lib => web/lib}/src/helpers/renames.dart (100%) rename {lib => web/lib}/web.dart (100%) create mode 100644 web/mono_pkg.yaml create mode 100644 web/pubspec.yaml rename {test => web/test}/dart_fix_test.dart (100%) rename {test => web/test}/element_constructor_test.dart (100%) rename {test => web/test}/helpers_test.dart (100%) rename {test => web/test}/smoke_test.dart (100%) rename {test_fixes => web/test_fixes}/README.md (100%) rename {test_fixes => web/test_fixes}/analysis_options.yaml (100%) rename {test_fixes => web/test_fixes}/renames.dart (100%) rename {test_fixes => web/test_fixes}/renames.dart.expect (100%) create mode 100644 web_generator/CHANGELOG.md create mode 100644 web_generator/LICENSE rename {tool => web_generator}/README.md (72%) rename {tool => web_generator}/generator/README.md (76%) rename {tool => web_generator}/generator/banned_names.dart (100%) rename {tool => web_generator}/generator/bcd.dart (100%) rename {tool => web_generator}/generator/dart_main.dart (100%) rename {tool => web_generator}/generator/doc_provider.dart (97%) rename {tool => web_generator}/generator/filesystem_api.dart (100%) rename {tool => web_generator}/generator/formatting.dart (100%) rename {tool => web_generator}/generator/generate_bindings.dart (100%) rename {tool => web_generator}/generator/js_type_supertypes.dart (93%) rename {tool => web_generator}/generator/main.mjs (100%) rename {tool => web_generator}/generator/package-lock.json (100%) rename {tool => web_generator}/generator/package.json (100%) rename {tool => web_generator}/generator/singletons.dart (100%) rename {tool => web_generator}/generator/translator.dart (100%) rename {tool => web_generator}/generator/type_aliases.dart (100%) rename {tool => web_generator}/generator/type_union.dart (100%) rename {tool => web_generator}/generator/util.dart (100%) rename {tool => web_generator}/generator/webidl_api.dart (100%) rename {tool => web_generator}/generator/webref_css_api.dart (100%) rename {tool => web_generator}/generator/webref_elements_api.dart (100%) rename {tool => web_generator}/generator/webref_idl_api.dart (100%) create mode 100644 web_generator/mono_pkg.yaml create mode 100644 web_generator/package-lock.json rename pubspec.yaml => web_generator/pubspec.yaml (72%) rename {tool => web_generator}/renames.md (100%) rename {tool => web_generator}/scrape_mdn.dart (100%) rename {test => web_generator/test}/generate_docs_test.dart (98%) rename {test => web_generator/test}/scrape_mdn_test.dart (99%) rename {test => web_generator/test}/type_union_test.dart (96%) rename {third_party => web_generator/third_party}/mdn/LICENSE (100%) rename {third_party => web_generator/third_party}/mdn/README.md (100%) rename {third_party => web_generator/third_party}/mdn/mdn.json (100%) rename {tool => web_generator}/update_bindings.dart (96%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a7045873..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: Dart CI - -on: - # Run on PRs and pushes to the default branch. - push: - branches: [ main ] - pull_request: - branches: [ main ] - schedule: - # Run nightly. - - cron: "0 0 * * 0" - -env: - PUB_ENVIRONMENT: bot.github - -jobs: - # Check code formatting and static analysis on a single OS (linux) - # against Dart dev. - analyze: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - sdk: [dev, 3.4] - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: ${{ matrix.sdk }} - - id: install - name: Install dependencies - run: dart pub get - - name: Check formatting - run: dart format --output=none --set-exit-if-changed . - if: always() && steps.install.outcome == 'success' - - name: Analyze code - run: dart analyze --fatal-infos - if: always() && steps.install.outcome == 'success' - - # Run tests on a matrix of several SDK releases. - test: - needs: analyze - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - sdk: [dev, 3.4] - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: ${{ matrix.sdk }} - - name: Install dependencies - run: dart pub get - - name: Run Chrome tests - js - run: dart test --platform chrome - - name: Run Chrome tests - wasm - run: dart test --platform chrome --compiler dart2wasm - - # Ensure the generation script runs. - generation: - needs: analyze - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - sdk: [dev] - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: ${{ matrix.sdk }} - - name: Install Dart dependencies - run: dart pub get - - name: Install Node dependencies - run: npm install - working-directory: tool/generator - - name: Run the generator - run: dart tool/update_bindings.dart - - name: Analyze code - run: dart analyze --fatal-infos - - # Test the contributed `dart fix` fixes. - dart-fix: - needs: analyze - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - sdk: [main] - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: ${{ matrix.sdk }} - - name: Install Dart dependencies - run: dart pub get - - name: Test the declarative fixes - run: dart fix --compare-to-golden - working-directory: test_fixes diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 00000000..9c124e64 --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,471 @@ +# Created with package:mono_repo v6.6.2 +name: Dart CI +on: + push: + branches: + - main + - master + pull_request: + schedule: + - cron: "0 0 * * 0" +defaults: + run: + shell: bash +env: + PUB_ENVIRONMENT: bot.github +permissions: read-all + +jobs: + job_001: + name: mono_repo self validate + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: stable + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - name: mono_repo self validate + run: dart pub global activate mono_repo 6.6.2 + - name: mono_repo self validate + run: dart pub global run mono_repo generate --validate + job_002: + name: "analyze_and_format; Dart 3.4.0; PKG: web; `dart analyze --fatal-infos .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web;commands:analyze" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + needs: + - job_001 + job_003: + name: "analyze_and_format; Dart 3.4.0; PKG: web; `dart format --output=none --set-exit-if-changed .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web;commands:format" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart format --output=none --set-exit-if-changed ." + run: "dart format --output=none --set-exit-if-changed ." + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + needs: + - job_001 + job_004: + name: "analyze_and_format; Dart dev; PKGS: web, web_generator; `dart analyze --fatal-infos .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator;commands:analyze" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + job_005: + name: "analyze_and_format; Dart dev; PKGS: web, web_generator; `dart format --output=none --set-exit-if-changed .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator;commands:format" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart format --output=none --set-exit-if-changed ." + run: "dart format --output=none --set-exit-if-changed ." + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart format --output=none --set-exit-if-changed ." + run: "dart format --output=none --set-exit-if-changed ." + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + job_006: + name: "unit_test; Dart 3.4.0; PKG: web; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web;commands:test_1" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + run: "dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + job_007: + name: "unit_test; Dart 3.4.0; PKG: web; `dart test --test-randomize-ordering-seed=random -p chrome`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web;commands:test_0" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart test --test-randomize-ordering-seed=random -p chrome" + run: "dart test --test-randomize-ordering-seed=random -p chrome" + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + job_008: + name: "unit_test; Dart dev; PKGS: web, web_generator; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator;commands:test_1" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + run: "dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + run: "dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + job_009: + name: "unit_test; Dart dev; PKGS: web, web_generator; `dart test --test-randomize-ordering-seed=random -p chrome`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator;commands:test_0" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart test --test-randomize-ordering-seed=random -p chrome" + run: "dart test --test-randomize-ordering-seed=random -p chrome" + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart test --test-randomize-ordering-seed=random -p chrome" + run: "dart test --test-randomize-ordering-seed=random -p chrome" + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + job_010: + name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart analyze --fatal-infos .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator;commands:analyze" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + - job_006 + - job_007 + - job_008 + - job_009 + job_011: + name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart update_bindings.dart`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator;commands:command_1" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: web_generator; dart update_bindings.dart + run: dart update_bindings.dart + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + - job_006 + - job_007 + - job_008 + - job_009 + job_012: + name: "dart_fixes; Dart main; PKG: web; `dart fix --compare-to-golden test_fixes`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:web;commands:command_0" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:main + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: main + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart fix --compare-to-golden test_fixes" + run: dart fix --compare-to-golden test_fixes + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + - job_006 + - job_007 + - job_008 + - job_009 + - job_010 + - job_011 diff --git a/.gitignore b/.gitignore index dcebbe2b..23ff2067 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ doc/api/ pubspec.lock -tool/generator/*.js -tool/generator/*.js.* -tool/generator/node_modules/ +web_generator/generator/*.js +web_generator/generator/*.js.* +web_generator/generator/node_modules/ diff --git a/mono_repo.yaml b/mono_repo.yaml new file mode 100644 index 00000000..6c599012 --- /dev/null +++ b/mono_repo.yaml @@ -0,0 +1,11 @@ +# See https://github.com/google/mono_repo.dart for details on this file +self_validate: analyze + +github: + cron: "0 0 * * 0" + +merge_stages: + - analyze_and_format + - unit_test + - dart_fixes + - generate_and_analyze \ No newline at end of file diff --git a/tool/ci.sh b/tool/ci.sh new file mode 100755 index 00000000..a7661ce9 --- /dev/null +++ b/tool/ci.sh @@ -0,0 +1,123 @@ +#!/bin/bash +# Created with package:mono_repo v6.6.2 + +# Support built in commands on windows out of the box. + +# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") +# then "flutter pub" is called instead of "dart pub". +# This assumes that the Flutter SDK has been installed in a previous step. +function pub() { + if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then + command flutter pub "$@" + else + command dart pub "$@" + fi +} + +function format() { + command dart format "$@" +} + +# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") +# then "flutter analyze" is called instead of "dart analyze". +# This assumes that the Flutter SDK has been installed in a previous step. +function analyze() { + if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then + command flutter analyze "$@" + else + command dart analyze "$@" + fi +} + +if [[ -z ${PKGS} ]]; then + echo -e '\033[31mPKGS environment variable must be set! - TERMINATING JOB\033[0m' + exit 64 +fi + +if [[ "$#" == "0" ]]; then + echo -e '\033[31mAt least one task argument must be provided! - TERMINATING JOB\033[0m' + exit 64 +fi + +SUCCESS_COUNT=0 +declare -a FAILURES + +for PKG in ${PKGS}; do + echo -e "\033[1mPKG: ${PKG}\033[22m" + EXIT_CODE=0 + pushd "${PKG}" >/dev/null || EXIT_CODE=$? + + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo -e "\033[31mPKG: '${PKG}' does not exist - TERMINATING JOB\033[0m" + exit 64 + fi + + dart pub upgrade || EXIT_CODE=$? + + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo -e "\033[31mPKG: ${PKG}; 'dart pub upgrade' - FAILED (${EXIT_CODE})\033[0m" + FAILURES+=("${PKG}; 'dart pub upgrade'") + else + for TASK in "$@"; do + EXIT_CODE=0 + echo + echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m" + case ${TASK} in + analyze) + echo 'dart analyze --fatal-infos .' + dart analyze --fatal-infos . || EXIT_CODE=$? + ;; + command_0) + echo 'dart fix --compare-to-golden test_fixes' + dart fix --compare-to-golden test_fixes || EXIT_CODE=$? + ;; + command_1) + echo 'dart update_bindings.dart' + dart update_bindings.dart || EXIT_CODE=$? + ;; + format) + echo 'dart format --output=none --set-exit-if-changed .' + dart format --output=none --set-exit-if-changed . || EXIT_CODE=$? + ;; + test_0) + echo 'dart test --test-randomize-ordering-seed=random -p chrome' + dart test --test-randomize-ordering-seed=random -p chrome || EXIT_CODE=$? + ;; + test_1) + echo 'dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm' + dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm || EXIT_CODE=$? + ;; + *) + echo -e "\033[31mUnknown TASK '${TASK}' - TERMINATING JOB\033[0m" + exit 64 + ;; + esac + + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo -e "\033[31mPKG: ${PKG}; TASK: ${TASK} - FAILED (${EXIT_CODE})\033[0m" + FAILURES+=("${PKG}; TASK: ${TASK}") + else + echo -e "\033[32mPKG: ${PKG}; TASK: ${TASK} - SUCCEEDED\033[0m" + SUCCESS_COUNT=$((SUCCESS_COUNT + 1)) + fi + + done + fi + + echo + echo -e "\033[32mSUCCESS COUNT: ${SUCCESS_COUNT}\033[0m" + + if [ ${#FAILURES[@]} -ne 0 ]; then + echo -e "\033[31mFAILURES: ${#FAILURES[@]}\033[0m" + for i in "${FAILURES[@]}"; do + echo -e "\033[31m $i\033[0m" + done + fi + + popd >/dev/null || exit 70 + echo +done + +if [ ${#FAILURES[@]} -ne 0 ]; then + exit 1 +fi diff --git a/CHANGELOG.md b/web/CHANGELOG.md similarity index 98% rename from CHANGELOG.md rename to web/CHANGELOG.md index 03aa6f61..be748917 100644 --- a/CHANGELOG.md +++ b/web/CHANGELOG.md @@ -49,7 +49,7 @@ - Add support for `dart fix` migrations from `dart:html` classes to `package:web` classes. - Contribute a markdown file for the renamed classes from `dart:html` to - `package:web` (see [renames.md](tool/renames.md)). + `package:web` (see [renames.md](../web_generator/renames.md)). - Migrate classes to use interop extension types that implement `JSObject`. - Add generics to APIs that use `JSArray` and `JSPromise`. Typedefs of a Dart primitive type are instead replaced with their JS type equivalent if they diff --git a/LICENSE b/web/LICENSE similarity index 100% rename from LICENSE rename to web/LICENSE diff --git a/README.md b/web/README.md similarity index 93% rename from README.md rename to web/README.md index f846ecd4..ecb3e4d0 100644 --- a/README.md +++ b/web/README.md @@ -71,6 +71,6 @@ definitions: ## Generation and updating the package Most of the APIs in this package are generated from public assets. See -[tool/README.md](https://github.com/dart-lang/web/tree/main/tool) for -information on the spec and IDL versions the package was generated from, and for -the process for updating the package. +[web_generator/README.md](https://github.com/dart-lang/web/tree/main/web_generator) +for information on the spec and IDL versions the package was generated from, and +for the process for updating the package. diff --git a/analysis_options.yaml b/web/analysis_options.yaml similarity index 100% rename from analysis_options.yaml rename to web/analysis_options.yaml diff --git a/example/example.dart b/web/example/example.dart similarity index 100% rename from example/example.dart rename to web/example/example.dart diff --git a/example/index.html b/web/example/index.html similarity index 100% rename from example/index.html rename to web/example/index.html diff --git a/lib/fix_data.yaml b/web/lib/fix_data.yaml similarity index 100% rename from lib/fix_data.yaml rename to web/lib/fix_data.yaml diff --git a/lib/helpers.dart b/web/lib/helpers.dart similarity index 100% rename from lib/helpers.dart rename to web/lib/helpers.dart diff --git a/lib/src/dom.dart b/web/lib/src/dom.dart similarity index 100% rename from lib/src/dom.dart rename to web/lib/src/dom.dart diff --git a/lib/src/dom/accelerometer.dart b/web/lib/src/dom/accelerometer.dart similarity index 100% rename from lib/src/dom/accelerometer.dart rename to web/lib/src/dom/accelerometer.dart diff --git a/lib/src/dom/angle_instanced_arrays.dart b/web/lib/src/dom/angle_instanced_arrays.dart similarity index 100% rename from lib/src/dom/angle_instanced_arrays.dart rename to web/lib/src/dom/angle_instanced_arrays.dart diff --git a/lib/src/dom/attribution_reporting_api.dart b/web/lib/src/dom/attribution_reporting_api.dart similarity index 100% rename from lib/src/dom/attribution_reporting_api.dart rename to web/lib/src/dom/attribution_reporting_api.dart diff --git a/lib/src/dom/background_sync.dart b/web/lib/src/dom/background_sync.dart similarity index 100% rename from lib/src/dom/background_sync.dart rename to web/lib/src/dom/background_sync.dart diff --git a/lib/src/dom/battery_status.dart b/web/lib/src/dom/battery_status.dart similarity index 100% rename from lib/src/dom/battery_status.dart rename to web/lib/src/dom/battery_status.dart diff --git a/lib/src/dom/clipboard_apis.dart b/web/lib/src/dom/clipboard_apis.dart similarity index 100% rename from lib/src/dom/clipboard_apis.dart rename to web/lib/src/dom/clipboard_apis.dart diff --git a/lib/src/dom/compression.dart b/web/lib/src/dom/compression.dart similarity index 100% rename from lib/src/dom/compression.dart rename to web/lib/src/dom/compression.dart diff --git a/lib/src/dom/console.dart b/web/lib/src/dom/console.dart similarity index 100% rename from lib/src/dom/console.dart rename to web/lib/src/dom/console.dart diff --git a/lib/src/dom/cookie_store.dart b/web/lib/src/dom/cookie_store.dart similarity index 100% rename from lib/src/dom/cookie_store.dart rename to web/lib/src/dom/cookie_store.dart diff --git a/lib/src/dom/credential_management.dart b/web/lib/src/dom/credential_management.dart similarity index 100% rename from lib/src/dom/credential_management.dart rename to web/lib/src/dom/credential_management.dart diff --git a/lib/src/dom/csp.dart b/web/lib/src/dom/csp.dart similarity index 100% rename from lib/src/dom/csp.dart rename to web/lib/src/dom/csp.dart diff --git a/lib/src/dom/css_animations.dart b/web/lib/src/dom/css_animations.dart similarity index 100% rename from lib/src/dom/css_animations.dart rename to web/lib/src/dom/css_animations.dart diff --git a/lib/src/dom/css_animations_2.dart b/web/lib/src/dom/css_animations_2.dart similarity index 100% rename from lib/src/dom/css_animations_2.dart rename to web/lib/src/dom/css_animations_2.dart diff --git a/lib/src/dom/css_cascade.dart b/web/lib/src/dom/css_cascade.dart similarity index 100% rename from lib/src/dom/css_cascade.dart rename to web/lib/src/dom/css_cascade.dart diff --git a/lib/src/dom/css_cascade_6.dart b/web/lib/src/dom/css_cascade_6.dart similarity index 100% rename from lib/src/dom/css_cascade_6.dart rename to web/lib/src/dom/css_cascade_6.dart diff --git a/lib/src/dom/css_conditional.dart b/web/lib/src/dom/css_conditional.dart similarity index 100% rename from lib/src/dom/css_conditional.dart rename to web/lib/src/dom/css_conditional.dart diff --git a/lib/src/dom/css_conditional_5.dart b/web/lib/src/dom/css_conditional_5.dart similarity index 100% rename from lib/src/dom/css_conditional_5.dart rename to web/lib/src/dom/css_conditional_5.dart diff --git a/lib/src/dom/css_contain.dart b/web/lib/src/dom/css_contain.dart similarity index 100% rename from lib/src/dom/css_contain.dart rename to web/lib/src/dom/css_contain.dart diff --git a/lib/src/dom/css_counter_styles.dart b/web/lib/src/dom/css_counter_styles.dart similarity index 100% rename from lib/src/dom/css_counter_styles.dart rename to web/lib/src/dom/css_counter_styles.dart diff --git a/lib/src/dom/css_font_loading.dart b/web/lib/src/dom/css_font_loading.dart similarity index 100% rename from lib/src/dom/css_font_loading.dart rename to web/lib/src/dom/css_font_loading.dart diff --git a/lib/src/dom/css_fonts.dart b/web/lib/src/dom/css_fonts.dart similarity index 100% rename from lib/src/dom/css_fonts.dart rename to web/lib/src/dom/css_fonts.dart diff --git a/lib/src/dom/css_highlight_api.dart b/web/lib/src/dom/css_highlight_api.dart similarity index 100% rename from lib/src/dom/css_highlight_api.dart rename to web/lib/src/dom/css_highlight_api.dart diff --git a/lib/src/dom/css_masking.dart b/web/lib/src/dom/css_masking.dart similarity index 100% rename from lib/src/dom/css_masking.dart rename to web/lib/src/dom/css_masking.dart diff --git a/lib/src/dom/css_paint_api.dart b/web/lib/src/dom/css_paint_api.dart similarity index 100% rename from lib/src/dom/css_paint_api.dart rename to web/lib/src/dom/css_paint_api.dart diff --git a/lib/src/dom/css_properties_values_api.dart b/web/lib/src/dom/css_properties_values_api.dart similarity index 100% rename from lib/src/dom/css_properties_values_api.dart rename to web/lib/src/dom/css_properties_values_api.dart diff --git a/lib/src/dom/css_transitions.dart b/web/lib/src/dom/css_transitions.dart similarity index 100% rename from lib/src/dom/css_transitions.dart rename to web/lib/src/dom/css_transitions.dart diff --git a/lib/src/dom/css_transitions_2.dart b/web/lib/src/dom/css_transitions_2.dart similarity index 100% rename from lib/src/dom/css_transitions_2.dart rename to web/lib/src/dom/css_transitions_2.dart diff --git a/lib/src/dom/css_typed_om.dart b/web/lib/src/dom/css_typed_om.dart similarity index 100% rename from lib/src/dom/css_typed_om.dart rename to web/lib/src/dom/css_typed_om.dart diff --git a/lib/src/dom/css_view_transitions.dart b/web/lib/src/dom/css_view_transitions.dart similarity index 100% rename from lib/src/dom/css_view_transitions.dart rename to web/lib/src/dom/css_view_transitions.dart diff --git a/lib/src/dom/css_view_transitions_2.dart b/web/lib/src/dom/css_view_transitions_2.dart similarity index 100% rename from lib/src/dom/css_view_transitions_2.dart rename to web/lib/src/dom/css_view_transitions_2.dart diff --git a/lib/src/dom/cssom.dart b/web/lib/src/dom/cssom.dart similarity index 100% rename from lib/src/dom/cssom.dart rename to web/lib/src/dom/cssom.dart diff --git a/lib/src/dom/cssom_view.dart b/web/lib/src/dom/cssom_view.dart similarity index 100% rename from lib/src/dom/cssom_view.dart rename to web/lib/src/dom/cssom_view.dart diff --git a/lib/src/dom/digital_identities.dart b/web/lib/src/dom/digital_identities.dart similarity index 100% rename from lib/src/dom/digital_identities.dart rename to web/lib/src/dom/digital_identities.dart diff --git a/lib/src/dom/dom.dart b/web/lib/src/dom/dom.dart similarity index 100% rename from lib/src/dom/dom.dart rename to web/lib/src/dom/dom.dart diff --git a/lib/src/dom/dom_parsing.dart b/web/lib/src/dom/dom_parsing.dart similarity index 100% rename from lib/src/dom/dom_parsing.dart rename to web/lib/src/dom/dom_parsing.dart diff --git a/lib/src/dom/encoding.dart b/web/lib/src/dom/encoding.dart similarity index 100% rename from lib/src/dom/encoding.dart rename to web/lib/src/dom/encoding.dart diff --git a/lib/src/dom/encrypted_media.dart b/web/lib/src/dom/encrypted_media.dart similarity index 100% rename from lib/src/dom/encrypted_media.dart rename to web/lib/src/dom/encrypted_media.dart diff --git a/lib/src/dom/entries_api.dart b/web/lib/src/dom/entries_api.dart similarity index 100% rename from lib/src/dom/entries_api.dart rename to web/lib/src/dom/entries_api.dart diff --git a/lib/src/dom/event_timing.dart b/web/lib/src/dom/event_timing.dart similarity index 100% rename from lib/src/dom/event_timing.dart rename to web/lib/src/dom/event_timing.dart diff --git a/lib/src/dom/ext_blend_minmax.dart b/web/lib/src/dom/ext_blend_minmax.dart similarity index 100% rename from lib/src/dom/ext_blend_minmax.dart rename to web/lib/src/dom/ext_blend_minmax.dart diff --git a/lib/src/dom/ext_color_buffer_float.dart b/web/lib/src/dom/ext_color_buffer_float.dart similarity index 100% rename from lib/src/dom/ext_color_buffer_float.dart rename to web/lib/src/dom/ext_color_buffer_float.dart diff --git a/lib/src/dom/ext_color_buffer_half_float.dart b/web/lib/src/dom/ext_color_buffer_half_float.dart similarity index 100% rename from lib/src/dom/ext_color_buffer_half_float.dart rename to web/lib/src/dom/ext_color_buffer_half_float.dart diff --git a/lib/src/dom/ext_disjoint_timer_query.dart b/web/lib/src/dom/ext_disjoint_timer_query.dart similarity index 100% rename from lib/src/dom/ext_disjoint_timer_query.dart rename to web/lib/src/dom/ext_disjoint_timer_query.dart diff --git a/lib/src/dom/ext_disjoint_timer_query_webgl2.dart b/web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart similarity index 100% rename from lib/src/dom/ext_disjoint_timer_query_webgl2.dart rename to web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart diff --git a/lib/src/dom/ext_float_blend.dart b/web/lib/src/dom/ext_float_blend.dart similarity index 100% rename from lib/src/dom/ext_float_blend.dart rename to web/lib/src/dom/ext_float_blend.dart diff --git a/lib/src/dom/ext_frag_depth.dart b/web/lib/src/dom/ext_frag_depth.dart similarity index 100% rename from lib/src/dom/ext_frag_depth.dart rename to web/lib/src/dom/ext_frag_depth.dart diff --git a/lib/src/dom/ext_shader_texture_lod.dart b/web/lib/src/dom/ext_shader_texture_lod.dart similarity index 100% rename from lib/src/dom/ext_shader_texture_lod.dart rename to web/lib/src/dom/ext_shader_texture_lod.dart diff --git a/lib/src/dom/ext_srgb.dart b/web/lib/src/dom/ext_srgb.dart similarity index 100% rename from lib/src/dom/ext_srgb.dart rename to web/lib/src/dom/ext_srgb.dart diff --git a/lib/src/dom/ext_texture_compression_bptc.dart b/web/lib/src/dom/ext_texture_compression_bptc.dart similarity index 100% rename from lib/src/dom/ext_texture_compression_bptc.dart rename to web/lib/src/dom/ext_texture_compression_bptc.dart diff --git a/lib/src/dom/ext_texture_compression_rgtc.dart b/web/lib/src/dom/ext_texture_compression_rgtc.dart similarity index 100% rename from lib/src/dom/ext_texture_compression_rgtc.dart rename to web/lib/src/dom/ext_texture_compression_rgtc.dart diff --git a/lib/src/dom/ext_texture_filter_anisotropic.dart b/web/lib/src/dom/ext_texture_filter_anisotropic.dart similarity index 100% rename from lib/src/dom/ext_texture_filter_anisotropic.dart rename to web/lib/src/dom/ext_texture_filter_anisotropic.dart diff --git a/lib/src/dom/ext_texture_norm16.dart b/web/lib/src/dom/ext_texture_norm16.dart similarity index 100% rename from lib/src/dom/ext_texture_norm16.dart rename to web/lib/src/dom/ext_texture_norm16.dart diff --git a/lib/src/dom/fedcm.dart b/web/lib/src/dom/fedcm.dart similarity index 100% rename from lib/src/dom/fedcm.dart rename to web/lib/src/dom/fedcm.dart diff --git a/lib/src/dom/fetch.dart b/web/lib/src/dom/fetch.dart similarity index 100% rename from lib/src/dom/fetch.dart rename to web/lib/src/dom/fetch.dart diff --git a/lib/src/dom/fido.dart b/web/lib/src/dom/fido.dart similarity index 100% rename from lib/src/dom/fido.dart rename to web/lib/src/dom/fido.dart diff --git a/lib/src/dom/fileapi.dart b/web/lib/src/dom/fileapi.dart similarity index 100% rename from lib/src/dom/fileapi.dart rename to web/lib/src/dom/fileapi.dart diff --git a/lib/src/dom/filter_effects.dart b/web/lib/src/dom/filter_effects.dart similarity index 100% rename from lib/src/dom/filter_effects.dart rename to web/lib/src/dom/filter_effects.dart diff --git a/lib/src/dom/fs.dart b/web/lib/src/dom/fs.dart similarity index 100% rename from lib/src/dom/fs.dart rename to web/lib/src/dom/fs.dart diff --git a/lib/src/dom/fullscreen.dart b/web/lib/src/dom/fullscreen.dart similarity index 100% rename from lib/src/dom/fullscreen.dart rename to web/lib/src/dom/fullscreen.dart diff --git a/lib/src/dom/gamepad.dart b/web/lib/src/dom/gamepad.dart similarity index 100% rename from lib/src/dom/gamepad.dart rename to web/lib/src/dom/gamepad.dart diff --git a/lib/src/dom/generic_sensor.dart b/web/lib/src/dom/generic_sensor.dart similarity index 100% rename from lib/src/dom/generic_sensor.dart rename to web/lib/src/dom/generic_sensor.dart diff --git a/lib/src/dom/geolocation.dart b/web/lib/src/dom/geolocation.dart similarity index 100% rename from lib/src/dom/geolocation.dart rename to web/lib/src/dom/geolocation.dart diff --git a/lib/src/dom/geometry.dart b/web/lib/src/dom/geometry.dart similarity index 100% rename from lib/src/dom/geometry.dart rename to web/lib/src/dom/geometry.dart diff --git a/lib/src/dom/gyroscope.dart b/web/lib/src/dom/gyroscope.dart similarity index 100% rename from lib/src/dom/gyroscope.dart rename to web/lib/src/dom/gyroscope.dart diff --git a/lib/src/dom/hr_time.dart b/web/lib/src/dom/hr_time.dart similarity index 100% rename from lib/src/dom/hr_time.dart rename to web/lib/src/dom/hr_time.dart diff --git a/lib/src/dom/html.dart b/web/lib/src/dom/html.dart similarity index 100% rename from lib/src/dom/html.dart rename to web/lib/src/dom/html.dart diff --git a/lib/src/dom/image_capture.dart b/web/lib/src/dom/image_capture.dart similarity index 100% rename from lib/src/dom/image_capture.dart rename to web/lib/src/dom/image_capture.dart diff --git a/lib/src/dom/indexeddb.dart b/web/lib/src/dom/indexeddb.dart similarity index 100% rename from lib/src/dom/indexeddb.dart rename to web/lib/src/dom/indexeddb.dart diff --git a/lib/src/dom/intersection_observer.dart b/web/lib/src/dom/intersection_observer.dart similarity index 100% rename from lib/src/dom/intersection_observer.dart rename to web/lib/src/dom/intersection_observer.dart diff --git a/lib/src/dom/khr_parallel_shader_compile.dart b/web/lib/src/dom/khr_parallel_shader_compile.dart similarity index 100% rename from lib/src/dom/khr_parallel_shader_compile.dart rename to web/lib/src/dom/khr_parallel_shader_compile.dart diff --git a/lib/src/dom/largest_contentful_paint.dart b/web/lib/src/dom/largest_contentful_paint.dart similarity index 100% rename from lib/src/dom/largest_contentful_paint.dart rename to web/lib/src/dom/largest_contentful_paint.dart diff --git a/lib/src/dom/mathml_core.dart b/web/lib/src/dom/mathml_core.dart similarity index 100% rename from lib/src/dom/mathml_core.dart rename to web/lib/src/dom/mathml_core.dart diff --git a/lib/src/dom/media_capabilities.dart b/web/lib/src/dom/media_capabilities.dart similarity index 100% rename from lib/src/dom/media_capabilities.dart rename to web/lib/src/dom/media_capabilities.dart diff --git a/lib/src/dom/media_playback_quality.dart b/web/lib/src/dom/media_playback_quality.dart similarity index 100% rename from lib/src/dom/media_playback_quality.dart rename to web/lib/src/dom/media_playback_quality.dart diff --git a/lib/src/dom/media_source.dart b/web/lib/src/dom/media_source.dart similarity index 100% rename from lib/src/dom/media_source.dart rename to web/lib/src/dom/media_source.dart diff --git a/lib/src/dom/mediacapture_fromelement.dart b/web/lib/src/dom/mediacapture_fromelement.dart similarity index 100% rename from lib/src/dom/mediacapture_fromelement.dart rename to web/lib/src/dom/mediacapture_fromelement.dart diff --git a/lib/src/dom/mediacapture_streams.dart b/web/lib/src/dom/mediacapture_streams.dart similarity index 100% rename from lib/src/dom/mediacapture_streams.dart rename to web/lib/src/dom/mediacapture_streams.dart diff --git a/lib/src/dom/mediacapture_transform.dart b/web/lib/src/dom/mediacapture_transform.dart similarity index 100% rename from lib/src/dom/mediacapture_transform.dart rename to web/lib/src/dom/mediacapture_transform.dart diff --git a/lib/src/dom/mediasession.dart b/web/lib/src/dom/mediasession.dart similarity index 100% rename from lib/src/dom/mediasession.dart rename to web/lib/src/dom/mediasession.dart diff --git a/lib/src/dom/mediastream_recording.dart b/web/lib/src/dom/mediastream_recording.dart similarity index 100% rename from lib/src/dom/mediastream_recording.dart rename to web/lib/src/dom/mediastream_recording.dart diff --git a/lib/src/dom/mst_content_hint.dart b/web/lib/src/dom/mst_content_hint.dart similarity index 100% rename from lib/src/dom/mst_content_hint.dart rename to web/lib/src/dom/mst_content_hint.dart diff --git a/lib/src/dom/navigation_timing.dart b/web/lib/src/dom/navigation_timing.dart similarity index 100% rename from lib/src/dom/navigation_timing.dart rename to web/lib/src/dom/navigation_timing.dart diff --git a/lib/src/dom/netinfo.dart b/web/lib/src/dom/netinfo.dart similarity index 100% rename from lib/src/dom/netinfo.dart rename to web/lib/src/dom/netinfo.dart diff --git a/lib/src/dom/notifications.dart b/web/lib/src/dom/notifications.dart similarity index 100% rename from lib/src/dom/notifications.dart rename to web/lib/src/dom/notifications.dart diff --git a/lib/src/dom/oes_draw_buffers_indexed.dart b/web/lib/src/dom/oes_draw_buffers_indexed.dart similarity index 100% rename from lib/src/dom/oes_draw_buffers_indexed.dart rename to web/lib/src/dom/oes_draw_buffers_indexed.dart diff --git a/lib/src/dom/oes_element_index_uint.dart b/web/lib/src/dom/oes_element_index_uint.dart similarity index 100% rename from lib/src/dom/oes_element_index_uint.dart rename to web/lib/src/dom/oes_element_index_uint.dart diff --git a/lib/src/dom/oes_fbo_render_mipmap.dart b/web/lib/src/dom/oes_fbo_render_mipmap.dart similarity index 100% rename from lib/src/dom/oes_fbo_render_mipmap.dart rename to web/lib/src/dom/oes_fbo_render_mipmap.dart diff --git a/lib/src/dom/oes_standard_derivatives.dart b/web/lib/src/dom/oes_standard_derivatives.dart similarity index 100% rename from lib/src/dom/oes_standard_derivatives.dart rename to web/lib/src/dom/oes_standard_derivatives.dart diff --git a/lib/src/dom/oes_texture_float.dart b/web/lib/src/dom/oes_texture_float.dart similarity index 100% rename from lib/src/dom/oes_texture_float.dart rename to web/lib/src/dom/oes_texture_float.dart diff --git a/lib/src/dom/oes_texture_float_linear.dart b/web/lib/src/dom/oes_texture_float_linear.dart similarity index 100% rename from lib/src/dom/oes_texture_float_linear.dart rename to web/lib/src/dom/oes_texture_float_linear.dart diff --git a/lib/src/dom/oes_texture_half_float.dart b/web/lib/src/dom/oes_texture_half_float.dart similarity index 100% rename from lib/src/dom/oes_texture_half_float.dart rename to web/lib/src/dom/oes_texture_half_float.dart diff --git a/lib/src/dom/oes_texture_half_float_linear.dart b/web/lib/src/dom/oes_texture_half_float_linear.dart similarity index 100% rename from lib/src/dom/oes_texture_half_float_linear.dart rename to web/lib/src/dom/oes_texture_half_float_linear.dart diff --git a/lib/src/dom/oes_vertex_array_object.dart b/web/lib/src/dom/oes_vertex_array_object.dart similarity index 100% rename from lib/src/dom/oes_vertex_array_object.dart rename to web/lib/src/dom/oes_vertex_array_object.dart diff --git a/lib/src/dom/orientation_event.dart b/web/lib/src/dom/orientation_event.dart similarity index 100% rename from lib/src/dom/orientation_event.dart rename to web/lib/src/dom/orientation_event.dart diff --git a/lib/src/dom/orientation_sensor.dart b/web/lib/src/dom/orientation_sensor.dart similarity index 100% rename from lib/src/dom/orientation_sensor.dart rename to web/lib/src/dom/orientation_sensor.dart diff --git a/lib/src/dom/ovr_multiview2.dart b/web/lib/src/dom/ovr_multiview2.dart similarity index 100% rename from lib/src/dom/ovr_multiview2.dart rename to web/lib/src/dom/ovr_multiview2.dart diff --git a/lib/src/dom/paint_timing.dart b/web/lib/src/dom/paint_timing.dart similarity index 100% rename from lib/src/dom/paint_timing.dart rename to web/lib/src/dom/paint_timing.dart diff --git a/lib/src/dom/payment_request.dart b/web/lib/src/dom/payment_request.dart similarity index 100% rename from lib/src/dom/payment_request.dart rename to web/lib/src/dom/payment_request.dart diff --git a/lib/src/dom/performance_timeline.dart b/web/lib/src/dom/performance_timeline.dart similarity index 100% rename from lib/src/dom/performance_timeline.dart rename to web/lib/src/dom/performance_timeline.dart diff --git a/lib/src/dom/permissions.dart b/web/lib/src/dom/permissions.dart similarity index 100% rename from lib/src/dom/permissions.dart rename to web/lib/src/dom/permissions.dart diff --git a/lib/src/dom/picture_in_picture.dart b/web/lib/src/dom/picture_in_picture.dart similarity index 100% rename from lib/src/dom/picture_in_picture.dart rename to web/lib/src/dom/picture_in_picture.dart diff --git a/lib/src/dom/pointerevents.dart b/web/lib/src/dom/pointerevents.dart similarity index 100% rename from lib/src/dom/pointerevents.dart rename to web/lib/src/dom/pointerevents.dart diff --git a/lib/src/dom/pointerlock.dart b/web/lib/src/dom/pointerlock.dart similarity index 100% rename from lib/src/dom/pointerlock.dart rename to web/lib/src/dom/pointerlock.dart diff --git a/lib/src/dom/private_network_access.dart b/web/lib/src/dom/private_network_access.dart similarity index 100% rename from lib/src/dom/private_network_access.dart rename to web/lib/src/dom/private_network_access.dart diff --git a/lib/src/dom/push_api.dart b/web/lib/src/dom/push_api.dart similarity index 100% rename from lib/src/dom/push_api.dart rename to web/lib/src/dom/push_api.dart diff --git a/lib/src/dom/referrer_policy.dart b/web/lib/src/dom/referrer_policy.dart similarity index 100% rename from lib/src/dom/referrer_policy.dart rename to web/lib/src/dom/referrer_policy.dart diff --git a/lib/src/dom/remote_playback.dart b/web/lib/src/dom/remote_playback.dart similarity index 100% rename from lib/src/dom/remote_playback.dart rename to web/lib/src/dom/remote_playback.dart diff --git a/lib/src/dom/reporting.dart b/web/lib/src/dom/reporting.dart similarity index 100% rename from lib/src/dom/reporting.dart rename to web/lib/src/dom/reporting.dart diff --git a/lib/src/dom/requestidlecallback.dart b/web/lib/src/dom/requestidlecallback.dart similarity index 100% rename from lib/src/dom/requestidlecallback.dart rename to web/lib/src/dom/requestidlecallback.dart diff --git a/lib/src/dom/resize_observer.dart b/web/lib/src/dom/resize_observer.dart similarity index 100% rename from lib/src/dom/resize_observer.dart rename to web/lib/src/dom/resize_observer.dart diff --git a/lib/src/dom/resource_timing.dart b/web/lib/src/dom/resource_timing.dart similarity index 100% rename from lib/src/dom/resource_timing.dart rename to web/lib/src/dom/resource_timing.dart diff --git a/lib/src/dom/saa_non_cookie_storage.dart b/web/lib/src/dom/saa_non_cookie_storage.dart similarity index 100% rename from lib/src/dom/saa_non_cookie_storage.dart rename to web/lib/src/dom/saa_non_cookie_storage.dart diff --git a/lib/src/dom/sanitizer_api.dart b/web/lib/src/dom/sanitizer_api.dart similarity index 100% rename from lib/src/dom/sanitizer_api.dart rename to web/lib/src/dom/sanitizer_api.dart diff --git a/lib/src/dom/scheduling_apis.dart b/web/lib/src/dom/scheduling_apis.dart similarity index 100% rename from lib/src/dom/scheduling_apis.dart rename to web/lib/src/dom/scheduling_apis.dart diff --git a/lib/src/dom/screen_capture.dart b/web/lib/src/dom/screen_capture.dart similarity index 100% rename from lib/src/dom/screen_capture.dart rename to web/lib/src/dom/screen_capture.dart diff --git a/lib/src/dom/screen_orientation.dart b/web/lib/src/dom/screen_orientation.dart similarity index 100% rename from lib/src/dom/screen_orientation.dart rename to web/lib/src/dom/screen_orientation.dart diff --git a/lib/src/dom/screen_wake_lock.dart b/web/lib/src/dom/screen_wake_lock.dart similarity index 100% rename from lib/src/dom/screen_wake_lock.dart rename to web/lib/src/dom/screen_wake_lock.dart diff --git a/lib/src/dom/secure_payment_confirmation.dart b/web/lib/src/dom/secure_payment_confirmation.dart similarity index 100% rename from lib/src/dom/secure_payment_confirmation.dart rename to web/lib/src/dom/secure_payment_confirmation.dart diff --git a/lib/src/dom/selection_api.dart b/web/lib/src/dom/selection_api.dart similarity index 100% rename from lib/src/dom/selection_api.dart rename to web/lib/src/dom/selection_api.dart diff --git a/lib/src/dom/server_timing.dart b/web/lib/src/dom/server_timing.dart similarity index 100% rename from lib/src/dom/server_timing.dart rename to web/lib/src/dom/server_timing.dart diff --git a/lib/src/dom/service_workers.dart b/web/lib/src/dom/service_workers.dart similarity index 100% rename from lib/src/dom/service_workers.dart rename to web/lib/src/dom/service_workers.dart diff --git a/lib/src/dom/speech_api.dart b/web/lib/src/dom/speech_api.dart similarity index 100% rename from lib/src/dom/speech_api.dart rename to web/lib/src/dom/speech_api.dart diff --git a/lib/src/dom/storage.dart b/web/lib/src/dom/storage.dart similarity index 100% rename from lib/src/dom/storage.dart rename to web/lib/src/dom/storage.dart diff --git a/lib/src/dom/streams.dart b/web/lib/src/dom/streams.dart similarity index 100% rename from lib/src/dom/streams.dart rename to web/lib/src/dom/streams.dart diff --git a/lib/src/dom/svg.dart b/web/lib/src/dom/svg.dart similarity index 100% rename from lib/src/dom/svg.dart rename to web/lib/src/dom/svg.dart diff --git a/lib/src/dom/svg_animations.dart b/web/lib/src/dom/svg_animations.dart similarity index 100% rename from lib/src/dom/svg_animations.dart rename to web/lib/src/dom/svg_animations.dart diff --git a/lib/src/dom/touch_events.dart b/web/lib/src/dom/touch_events.dart similarity index 100% rename from lib/src/dom/touch_events.dart rename to web/lib/src/dom/touch_events.dart diff --git a/lib/src/dom/trust_token_api.dart b/web/lib/src/dom/trust_token_api.dart similarity index 100% rename from lib/src/dom/trust_token_api.dart rename to web/lib/src/dom/trust_token_api.dart diff --git a/lib/src/dom/trusted_types.dart b/web/lib/src/dom/trusted_types.dart similarity index 100% rename from lib/src/dom/trusted_types.dart rename to web/lib/src/dom/trusted_types.dart diff --git a/lib/src/dom/uievents.dart b/web/lib/src/dom/uievents.dart similarity index 100% rename from lib/src/dom/uievents.dart rename to web/lib/src/dom/uievents.dart diff --git a/lib/src/dom/url.dart b/web/lib/src/dom/url.dart similarity index 100% rename from lib/src/dom/url.dart rename to web/lib/src/dom/url.dart diff --git a/lib/src/dom/user_timing.dart b/web/lib/src/dom/user_timing.dart similarity index 100% rename from lib/src/dom/user_timing.dart rename to web/lib/src/dom/user_timing.dart diff --git a/lib/src/dom/vibration.dart b/web/lib/src/dom/vibration.dart similarity index 100% rename from lib/src/dom/vibration.dart rename to web/lib/src/dom/vibration.dart diff --git a/lib/src/dom/video_rvfc.dart b/web/lib/src/dom/video_rvfc.dart similarity index 100% rename from lib/src/dom/video_rvfc.dart rename to web/lib/src/dom/video_rvfc.dart diff --git a/lib/src/dom/wasm_js_api.dart b/web/lib/src/dom/wasm_js_api.dart similarity index 100% rename from lib/src/dom/wasm_js_api.dart rename to web/lib/src/dom/wasm_js_api.dart diff --git a/lib/src/dom/web_animations.dart b/web/lib/src/dom/web_animations.dart similarity index 100% rename from lib/src/dom/web_animations.dart rename to web/lib/src/dom/web_animations.dart diff --git a/lib/src/dom/web_animations_2.dart b/web/lib/src/dom/web_animations_2.dart similarity index 100% rename from lib/src/dom/web_animations_2.dart rename to web/lib/src/dom/web_animations_2.dart diff --git a/lib/src/dom/web_bluetooth.dart b/web/lib/src/dom/web_bluetooth.dart similarity index 100% rename from lib/src/dom/web_bluetooth.dart rename to web/lib/src/dom/web_bluetooth.dart diff --git a/lib/src/dom/web_locks.dart b/web/lib/src/dom/web_locks.dart similarity index 100% rename from lib/src/dom/web_locks.dart rename to web/lib/src/dom/web_locks.dart diff --git a/lib/src/dom/web_otp.dart b/web/lib/src/dom/web_otp.dart similarity index 100% rename from lib/src/dom/web_otp.dart rename to web/lib/src/dom/web_otp.dart diff --git a/lib/src/dom/web_share.dart b/web/lib/src/dom/web_share.dart similarity index 100% rename from lib/src/dom/web_share.dart rename to web/lib/src/dom/web_share.dart diff --git a/lib/src/dom/webaudio.dart b/web/lib/src/dom/webaudio.dart similarity index 100% rename from lib/src/dom/webaudio.dart rename to web/lib/src/dom/webaudio.dart diff --git a/lib/src/dom/webauthn.dart b/web/lib/src/dom/webauthn.dart similarity index 100% rename from lib/src/dom/webauthn.dart rename to web/lib/src/dom/webauthn.dart diff --git a/lib/src/dom/webcodecs.dart b/web/lib/src/dom/webcodecs.dart similarity index 100% rename from lib/src/dom/webcodecs.dart rename to web/lib/src/dom/webcodecs.dart diff --git a/lib/src/dom/webcodecs_av1_codec_registration.dart b/web/lib/src/dom/webcodecs_av1_codec_registration.dart similarity index 100% rename from lib/src/dom/webcodecs_av1_codec_registration.dart rename to web/lib/src/dom/webcodecs_av1_codec_registration.dart diff --git a/lib/src/dom/webcodecs_avc_codec_registration.dart b/web/lib/src/dom/webcodecs_avc_codec_registration.dart similarity index 100% rename from lib/src/dom/webcodecs_avc_codec_registration.dart rename to web/lib/src/dom/webcodecs_avc_codec_registration.dart diff --git a/lib/src/dom/webcodecs_hevc_codec_registration.dart b/web/lib/src/dom/webcodecs_hevc_codec_registration.dart similarity index 100% rename from lib/src/dom/webcodecs_hevc_codec_registration.dart rename to web/lib/src/dom/webcodecs_hevc_codec_registration.dart diff --git a/lib/src/dom/webcodecs_vp9_codec_registration.dart b/web/lib/src/dom/webcodecs_vp9_codec_registration.dart similarity index 100% rename from lib/src/dom/webcodecs_vp9_codec_registration.dart rename to web/lib/src/dom/webcodecs_vp9_codec_registration.dart diff --git a/lib/src/dom/webcryptoapi.dart b/web/lib/src/dom/webcryptoapi.dart similarity index 100% rename from lib/src/dom/webcryptoapi.dart rename to web/lib/src/dom/webcryptoapi.dart diff --git a/lib/src/dom/webgl1.dart b/web/lib/src/dom/webgl1.dart similarity index 100% rename from lib/src/dom/webgl1.dart rename to web/lib/src/dom/webgl1.dart diff --git a/lib/src/dom/webgl2.dart b/web/lib/src/dom/webgl2.dart similarity index 100% rename from lib/src/dom/webgl2.dart rename to web/lib/src/dom/webgl2.dart diff --git a/lib/src/dom/webgl_color_buffer_float.dart b/web/lib/src/dom/webgl_color_buffer_float.dart similarity index 100% rename from lib/src/dom/webgl_color_buffer_float.dart rename to web/lib/src/dom/webgl_color_buffer_float.dart diff --git a/lib/src/dom/webgl_compressed_texture_astc.dart b/web/lib/src/dom/webgl_compressed_texture_astc.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_astc.dart rename to web/lib/src/dom/webgl_compressed_texture_astc.dart diff --git a/lib/src/dom/webgl_compressed_texture_etc.dart b/web/lib/src/dom/webgl_compressed_texture_etc.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_etc.dart rename to web/lib/src/dom/webgl_compressed_texture_etc.dart diff --git a/lib/src/dom/webgl_compressed_texture_etc1.dart b/web/lib/src/dom/webgl_compressed_texture_etc1.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_etc1.dart rename to web/lib/src/dom/webgl_compressed_texture_etc1.dart diff --git a/lib/src/dom/webgl_compressed_texture_pvrtc.dart b/web/lib/src/dom/webgl_compressed_texture_pvrtc.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_pvrtc.dart rename to web/lib/src/dom/webgl_compressed_texture_pvrtc.dart diff --git a/lib/src/dom/webgl_compressed_texture_s3tc.dart b/web/lib/src/dom/webgl_compressed_texture_s3tc.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_s3tc.dart rename to web/lib/src/dom/webgl_compressed_texture_s3tc.dart diff --git a/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart b/web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart rename to web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart diff --git a/lib/src/dom/webgl_debug_renderer_info.dart b/web/lib/src/dom/webgl_debug_renderer_info.dart similarity index 100% rename from lib/src/dom/webgl_debug_renderer_info.dart rename to web/lib/src/dom/webgl_debug_renderer_info.dart diff --git a/lib/src/dom/webgl_debug_shaders.dart b/web/lib/src/dom/webgl_debug_shaders.dart similarity index 100% rename from lib/src/dom/webgl_debug_shaders.dart rename to web/lib/src/dom/webgl_debug_shaders.dart diff --git a/lib/src/dom/webgl_depth_texture.dart b/web/lib/src/dom/webgl_depth_texture.dart similarity index 100% rename from lib/src/dom/webgl_depth_texture.dart rename to web/lib/src/dom/webgl_depth_texture.dart diff --git a/lib/src/dom/webgl_draw_buffers.dart b/web/lib/src/dom/webgl_draw_buffers.dart similarity index 100% rename from lib/src/dom/webgl_draw_buffers.dart rename to web/lib/src/dom/webgl_draw_buffers.dart diff --git a/lib/src/dom/webgl_lose_context.dart b/web/lib/src/dom/webgl_lose_context.dart similarity index 100% rename from lib/src/dom/webgl_lose_context.dart rename to web/lib/src/dom/webgl_lose_context.dart diff --git a/lib/src/dom/webgl_multi_draw.dart b/web/lib/src/dom/webgl_multi_draw.dart similarity index 100% rename from lib/src/dom/webgl_multi_draw.dart rename to web/lib/src/dom/webgl_multi_draw.dart diff --git a/lib/src/dom/webgpu.dart b/web/lib/src/dom/webgpu.dart similarity index 100% rename from lib/src/dom/webgpu.dart rename to web/lib/src/dom/webgpu.dart diff --git a/lib/src/dom/webidl.dart b/web/lib/src/dom/webidl.dart similarity index 100% rename from lib/src/dom/webidl.dart rename to web/lib/src/dom/webidl.dart diff --git a/lib/src/dom/webmidi.dart b/web/lib/src/dom/webmidi.dart similarity index 100% rename from lib/src/dom/webmidi.dart rename to web/lib/src/dom/webmidi.dart diff --git a/lib/src/dom/webrtc.dart b/web/lib/src/dom/webrtc.dart similarity index 100% rename from lib/src/dom/webrtc.dart rename to web/lib/src/dom/webrtc.dart diff --git a/lib/src/dom/webrtc_encoded_transform.dart b/web/lib/src/dom/webrtc_encoded_transform.dart similarity index 100% rename from lib/src/dom/webrtc_encoded_transform.dart rename to web/lib/src/dom/webrtc_encoded_transform.dart diff --git a/lib/src/dom/webrtc_identity.dart b/web/lib/src/dom/webrtc_identity.dart similarity index 100% rename from lib/src/dom/webrtc_identity.dart rename to web/lib/src/dom/webrtc_identity.dart diff --git a/lib/src/dom/webrtc_priority.dart b/web/lib/src/dom/webrtc_priority.dart similarity index 100% rename from lib/src/dom/webrtc_priority.dart rename to web/lib/src/dom/webrtc_priority.dart diff --git a/lib/src/dom/websockets.dart b/web/lib/src/dom/websockets.dart similarity index 100% rename from lib/src/dom/websockets.dart rename to web/lib/src/dom/websockets.dart diff --git a/lib/src/dom/webtransport.dart b/web/lib/src/dom/webtransport.dart similarity index 100% rename from lib/src/dom/webtransport.dart rename to web/lib/src/dom/webtransport.dart diff --git a/lib/src/dom/webvtt.dart b/web/lib/src/dom/webvtt.dart similarity index 100% rename from lib/src/dom/webvtt.dart rename to web/lib/src/dom/webvtt.dart diff --git a/lib/src/dom/webxr.dart b/web/lib/src/dom/webxr.dart similarity index 100% rename from lib/src/dom/webxr.dart rename to web/lib/src/dom/webxr.dart diff --git a/lib/src/dom/webxr_hand_input.dart b/web/lib/src/dom/webxr_hand_input.dart similarity index 100% rename from lib/src/dom/webxr_hand_input.dart rename to web/lib/src/dom/webxr_hand_input.dart diff --git a/lib/src/dom/xhr.dart b/web/lib/src/dom/xhr.dart similarity index 100% rename from lib/src/dom/xhr.dart rename to web/lib/src/dom/xhr.dart diff --git a/lib/src/helpers.dart b/web/lib/src/helpers.dart similarity index 100% rename from lib/src/helpers.dart rename to web/lib/src/helpers.dart diff --git a/lib/src/helpers/enums.dart b/web/lib/src/helpers/enums.dart similarity index 100% rename from lib/src/helpers/enums.dart rename to web/lib/src/helpers/enums.dart diff --git a/lib/src/helpers/events/events.dart b/web/lib/src/helpers/events/events.dart similarity index 100% rename from lib/src/helpers/events/events.dart rename to web/lib/src/helpers/events/events.dart diff --git a/lib/src/helpers/events/providers.dart b/web/lib/src/helpers/events/providers.dart similarity index 100% rename from lib/src/helpers/events/providers.dart rename to web/lib/src/helpers/events/providers.dart diff --git a/lib/src/helpers/events/streams.dart b/web/lib/src/helpers/events/streams.dart similarity index 100% rename from lib/src/helpers/events/streams.dart rename to web/lib/src/helpers/events/streams.dart diff --git a/lib/src/helpers/extensions.dart b/web/lib/src/helpers/extensions.dart similarity index 100% rename from lib/src/helpers/extensions.dart rename to web/lib/src/helpers/extensions.dart diff --git a/lib/src/helpers/http.dart b/web/lib/src/helpers/http.dart similarity index 100% rename from lib/src/helpers/http.dart rename to web/lib/src/helpers/http.dart diff --git a/lib/src/helpers/lists.dart b/web/lib/src/helpers/lists.dart similarity index 100% rename from lib/src/helpers/lists.dart rename to web/lib/src/helpers/lists.dart diff --git a/lib/src/helpers/renames.dart b/web/lib/src/helpers/renames.dart similarity index 100% rename from lib/src/helpers/renames.dart rename to web/lib/src/helpers/renames.dart diff --git a/lib/web.dart b/web/lib/web.dart similarity index 100% rename from lib/web.dart rename to web/lib/web.dart diff --git a/web/mono_pkg.yaml b/web/mono_pkg.yaml new file mode 100644 index 00000000..a98731ce --- /dev/null +++ b/web/mono_pkg.yaml @@ -0,0 +1,14 @@ +sdk: + - dev + - pubspec + +stages: +- analyze_and_format: + - analyze: --fatal-infos . + - format: +- unit_test: + - test: --test-randomize-ordering-seed=random -p chrome + - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm +- dart_fixes: + - command: dart fix --compare-to-golden test_fixes + sdk: main \ No newline at end of file diff --git a/web/pubspec.yaml b/web/pubspec.yaml new file mode 100644 index 00000000..414e0388 --- /dev/null +++ b/web/pubspec.yaml @@ -0,0 +1,11 @@ +name: web +version: 1.1.0-wip +description: Lightweight browser API bindings built around JS interop. +repository: https://github.com/dart-lang/web + +environment: + sdk: ^3.4.0 + +dev_dependencies: + dart_flutter_team_lints: ^3.0.0 + test: ^1.24.4 diff --git a/test/dart_fix_test.dart b/web/test/dart_fix_test.dart similarity index 100% rename from test/dart_fix_test.dart rename to web/test/dart_fix_test.dart diff --git a/test/element_constructor_test.dart b/web/test/element_constructor_test.dart similarity index 100% rename from test/element_constructor_test.dart rename to web/test/element_constructor_test.dart diff --git a/test/helpers_test.dart b/web/test/helpers_test.dart similarity index 100% rename from test/helpers_test.dart rename to web/test/helpers_test.dart diff --git a/test/smoke_test.dart b/web/test/smoke_test.dart similarity index 100% rename from test/smoke_test.dart rename to web/test/smoke_test.dart diff --git a/test_fixes/README.md b/web/test_fixes/README.md similarity index 100% rename from test_fixes/README.md rename to web/test_fixes/README.md diff --git a/test_fixes/analysis_options.yaml b/web/test_fixes/analysis_options.yaml similarity index 100% rename from test_fixes/analysis_options.yaml rename to web/test_fixes/analysis_options.yaml diff --git a/test_fixes/renames.dart b/web/test_fixes/renames.dart similarity index 100% rename from test_fixes/renames.dart rename to web/test_fixes/renames.dart diff --git a/test_fixes/renames.dart.expect b/web/test_fixes/renames.dart.expect similarity index 100% rename from test_fixes/renames.dart.expect rename to web/test_fixes/renames.dart.expect diff --git a/web_generator/CHANGELOG.md b/web_generator/CHANGELOG.md new file mode 100644 index 00000000..3bdacffe --- /dev/null +++ b/web_generator/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0-wip + +- Initial publish of internal repo. \ No newline at end of file diff --git a/web_generator/LICENSE b/web_generator/LICENSE new file mode 100644 index 00000000..32e050b7 --- /dev/null +++ b/web_generator/LICENSE @@ -0,0 +1,26 @@ +Copyright 2023, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tool/README.md b/web_generator/README.md similarity index 72% rename from tool/README.md rename to web_generator/README.md index 75e90fc3..62fed582 100644 --- a/tool/README.md +++ b/web_generator/README.md @@ -8,7 +8,7 @@ documentation. To regenerate the package from the current IDL versions, run: ```shell -dart tool/update_bindings.dart +dart update_bindings.dart ``` ### Updating the dartdoc info from MDN @@ -18,35 +18,35 @@ package:web's dartdoc comments come from the to update to the latest version of the documentation, run: ```shell -dart tool/scrape_mdn.dart +dart scrape_mdn.dart ``` That will collect the MDN documentation into `third_party/mdn/mdn.json`; changes to that file should be committed to git. You'll need to run -`tool/update_bindings.dart` to produce Dart code using the updated documentation. +`update_bindings.dart` to produce Dart code using the updated documentation. ### Updating to use the latest Web IDL versions To re-generate the package from newer IDL versions, you can either run: ```shell -dart tool/update_bindings.dart --update +dart update_bindings.dart --update ``` -or, edit manually edit `tool/generator/package.json` to use specific IDL -versions, and re-run `tool/update_bindings.dart`. +or, edit manually edit `generator/package.json` to use specific IDL +versions, and re-run `update_bindings.dart`. ## Web IDL versions Based on: - + | Item | Version | | --- | --: | | `@webref/css` | [6.12.15](https://www.npmjs.com/package/@webref/css/v/6.12.15) | | `@webref/elements` | [2.3.0](https://www.npmjs.com/package/@webref/elements/v/2.3.0) | | `@webref/idl` | [3.49.0](https://www.npmjs.com/package/@webref/idl/v/3.49.0) | - + For instructions on re-generating the DOM bindings, see the [generator docs](generator/README.md). diff --git a/tool/generator/README.md b/web_generator/generator/README.md similarity index 76% rename from tool/generator/README.md rename to web_generator/generator/README.md index ed1d7326..b693a6c5 100644 --- a/tool/generator/README.md +++ b/web_generator/generator/README.md @@ -7,7 +7,7 @@ This tool is written in Dart, compiled to JavaScript, and run on Node. Run: ``` -dart tool/update_bindings.dart +dart update_bindings.dart ``` ## Update to the latest Web IDL versions and regenerate @@ -15,5 +15,5 @@ dart tool/update_bindings.dart Run: ``` -dart tool/update_bindings.dart --update +dart update_bindings.dart --update ``` diff --git a/tool/generator/banned_names.dart b/web_generator/generator/banned_names.dart similarity index 100% rename from tool/generator/banned_names.dart rename to web_generator/generator/banned_names.dart diff --git a/tool/generator/bcd.dart b/web_generator/generator/bcd.dart similarity index 100% rename from tool/generator/bcd.dart rename to web_generator/generator/bcd.dart diff --git a/tool/generator/dart_main.dart b/web_generator/generator/dart_main.dart similarity index 100% rename from tool/generator/dart_main.dart rename to web_generator/generator/dart_main.dart diff --git a/tool/generator/doc_provider.dart b/web_generator/generator/doc_provider.dart similarity index 97% rename from tool/generator/doc_provider.dart rename to web_generator/generator/doc_provider.dart index 3513ecde..65386799 100644 --- a/tool/generator/doc_provider.dart +++ b/web_generator/generator/doc_provider.dart @@ -14,7 +14,7 @@ import 'formatting.dart'; class DocProvider { static DocProvider create() { final content = fs.readFileSync( - p.join('..', '..', 'third_party', 'mdn', 'mdn.json').toJS, + p.join('..', 'third_party', 'mdn', 'mdn.json').toJS, JSReadFileOptions(encoding: 'utf8'.toJS), ) as JSString; diff --git a/tool/generator/filesystem_api.dart b/web_generator/generator/filesystem_api.dart similarity index 100% rename from tool/generator/filesystem_api.dart rename to web_generator/generator/filesystem_api.dart diff --git a/tool/generator/formatting.dart b/web_generator/generator/formatting.dart similarity index 100% rename from tool/generator/formatting.dart rename to web_generator/generator/formatting.dart diff --git a/tool/generator/generate_bindings.dart b/web_generator/generator/generate_bindings.dart similarity index 100% rename from tool/generator/generate_bindings.dart rename to web_generator/generator/generate_bindings.dart diff --git a/tool/generator/js_type_supertypes.dart b/web_generator/generator/js_type_supertypes.dart similarity index 93% rename from tool/generator/js_type_supertypes.dart rename to web_generator/generator/js_type_supertypes.dart index 121e8589..242ae1b0 100644 --- a/tool/generator/js_type_supertypes.dart +++ b/web_generator/generator/js_type_supertypes.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Updated by tool/update_bindings.dart. Do not modify by hand. +// Updated by update_bindings.dart. Do not modify by hand. const Map jsTypeSupertypes = { 'JSAny': null, diff --git a/tool/generator/main.mjs b/web_generator/generator/main.mjs similarity index 100% rename from tool/generator/main.mjs rename to web_generator/generator/main.mjs diff --git a/tool/generator/package-lock.json b/web_generator/generator/package-lock.json similarity index 100% rename from tool/generator/package-lock.json rename to web_generator/generator/package-lock.json diff --git a/tool/generator/package.json b/web_generator/generator/package.json similarity index 100% rename from tool/generator/package.json rename to web_generator/generator/package.json diff --git a/tool/generator/singletons.dart b/web_generator/generator/singletons.dart similarity index 100% rename from tool/generator/singletons.dart rename to web_generator/generator/singletons.dart diff --git a/tool/generator/translator.dart b/web_generator/generator/translator.dart similarity index 100% rename from tool/generator/translator.dart rename to web_generator/generator/translator.dart diff --git a/tool/generator/type_aliases.dart b/web_generator/generator/type_aliases.dart similarity index 100% rename from tool/generator/type_aliases.dart rename to web_generator/generator/type_aliases.dart diff --git a/tool/generator/type_union.dart b/web_generator/generator/type_union.dart similarity index 100% rename from tool/generator/type_union.dart rename to web_generator/generator/type_union.dart diff --git a/tool/generator/util.dart b/web_generator/generator/util.dart similarity index 100% rename from tool/generator/util.dart rename to web_generator/generator/util.dart diff --git a/tool/generator/webidl_api.dart b/web_generator/generator/webidl_api.dart similarity index 100% rename from tool/generator/webidl_api.dart rename to web_generator/generator/webidl_api.dart diff --git a/tool/generator/webref_css_api.dart b/web_generator/generator/webref_css_api.dart similarity index 100% rename from tool/generator/webref_css_api.dart rename to web_generator/generator/webref_css_api.dart diff --git a/tool/generator/webref_elements_api.dart b/web_generator/generator/webref_elements_api.dart similarity index 100% rename from tool/generator/webref_elements_api.dart rename to web_generator/generator/webref_elements_api.dart diff --git a/tool/generator/webref_idl_api.dart b/web_generator/generator/webref_idl_api.dart similarity index 100% rename from tool/generator/webref_idl_api.dart rename to web_generator/generator/webref_idl_api.dart diff --git a/web_generator/mono_pkg.yaml b/web_generator/mono_pkg.yaml new file mode 100644 index 00000000..2c104f59 --- /dev/null +++ b/web_generator/mono_pkg.yaml @@ -0,0 +1,13 @@ +sdk: +- dev + +stages: +- analyze_and_format: + - analyze: --fatal-infos . + - format: +- unit_test: + - test: --test-randomize-ordering-seed=random -p chrome + - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm +- generate_and_analyze: + - command: dart update_bindings.dart + - analyze: --fatal-infos . \ No newline at end of file diff --git a/web_generator/package-lock.json b/web_generator/package-lock.json new file mode 100644 index 00000000..639e42d2 --- /dev/null +++ b/web_generator/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "web_generator", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} \ No newline at end of file diff --git a/pubspec.yaml b/web_generator/pubspec.yaml similarity index 72% rename from pubspec.yaml rename to web_generator/pubspec.yaml index a2526d10..158be1ac 100644 --- a/pubspec.yaml +++ b/web_generator/pubspec.yaml @@ -1,10 +1,11 @@ -name: web -version: 1.1.0-wip -description: Lightweight browser API bindings built around JS interop. +name: web_generator +publish_to: none +version: 1.0.0-wip +description: Generator scripts for package:web. repository: https://github.com/dart-lang/web environment: - sdk: ^3.4.0 + sdk: ^3.6.0-0 dev_dependencies: analyzer: ^6.3.0 diff --git a/tool/renames.md b/web_generator/renames.md similarity index 100% rename from tool/renames.md rename to web_generator/renames.md diff --git a/tool/scrape_mdn.dart b/web_generator/scrape_mdn.dart similarity index 100% rename from tool/scrape_mdn.dart rename to web_generator/scrape_mdn.dart diff --git a/test/generate_docs_test.dart b/web_generator/test/generate_docs_test.dart similarity index 98% rename from test/generate_docs_test.dart rename to web_generator/test/generate_docs_test.dart index 00674a3a..b3bb3b47 100644 --- a/test/generate_docs_test.dart +++ b/web_generator/test/generate_docs_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; -import '../tool/generator/formatting.dart'; +import '../generator/formatting.dart'; void main() { group('formatDocs', () { diff --git a/test/scrape_mdn_test.dart b/web_generator/test/scrape_mdn_test.dart similarity index 99% rename from test/scrape_mdn_test.dart rename to web_generator/test/scrape_mdn_test.dart index 2c495c30..7b005222 100644 --- a/test/scrape_mdn_test.dart +++ b/web_generator/test/scrape_mdn_test.dart @@ -7,7 +7,7 @@ library; import 'package:test/test.dart'; -import '../tool/scrape_mdn.dart'; +import '../scrape_mdn.dart'; void main() { group('convertMdnToMarkdown', () { diff --git a/test/type_union_test.dart b/web_generator/test/type_union_test.dart similarity index 96% rename from test/type_union_test.dart rename to web_generator/test/type_union_test.dart index a29032d6..3e998a75 100644 --- a/test/type_union_test.dart +++ b/web_generator/test/type_union_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; -import '../tool/generator/type_union.dart'; +import '../generator/type_union.dart'; void main() { test('Non-JS types', () { diff --git a/third_party/mdn/LICENSE b/web_generator/third_party/mdn/LICENSE similarity index 100% rename from third_party/mdn/LICENSE rename to web_generator/third_party/mdn/LICENSE diff --git a/third_party/mdn/README.md b/web_generator/third_party/mdn/README.md similarity index 100% rename from third_party/mdn/README.md rename to web_generator/third_party/mdn/README.md diff --git a/third_party/mdn/mdn.json b/web_generator/third_party/mdn/mdn.json similarity index 100% rename from third_party/mdn/mdn.json rename to web_generator/third_party/mdn/mdn.json diff --git a/tool/update_bindings.dart b/web_generator/update_bindings.dart similarity index 96% rename from tool/update_bindings.dart rename to web_generator/update_bindings.dart index b540b96e..4f048f84 100644 --- a/tool/update_bindings.dart +++ b/web_generator/update_bindings.dart @@ -64,7 +64,7 @@ $_usage'''); } // Determine the set of previously generated files. - final domDir = Directory(p.join('lib', 'src', 'dom')); + final domDir = Directory(p.join('..', 'web', 'lib', 'src', 'dom')); final existingFiles = domDir.listSync(recursive: true).whereType().where((file) { if (!file.path.endsWith('.dart')) return false; @@ -79,7 +79,7 @@ $_usage'''); // Run app with `node`. await _runProc( 'node', - ['main.mjs', '../../lib/src'], + ['main.mjs', '../../web/lib/src'], workingDirectory: _bindingsGeneratorPath, ); @@ -133,13 +133,13 @@ String _packageLockVersion(String package) { return webRefIdl['version'] as String; } -final _bindingsGeneratorPath = p.join('tool', 'generator'); +const _bindingsGeneratorPath = 'generator'; const _webRefCss = '@webref/css'; const _webRefElements = '@webref/elements'; const _webRefIdl = '@webref/idl'; -const _thisScript = 'tool/update_bindings.dart'; +const _thisScript = 'update_bindings.dart'; const _startComment = ''; @@ -169,7 +169,7 @@ Future _runProc( Future _generateJsTypeSupertypes() async { // Use a file that uses `dart:js_interop` for analysis. final contextCollection = AnalysisContextCollection(includedPaths: [ - p.fromUri(Platform.script.resolve('../lib/src/dom.dart')) + p.fromUri(Platform.script.resolve('../web/lib/src/dom.dart')) ]); final dartJsInterop = (await contextCollection.contexts.single.currentSession .getLibraryByUri('dart:js_interop') as LibraryElementResult) From 7d2d6484f1b7f979609bc478dd1a7885d2641877 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Thu, 22 Aug 2024 18:25:37 -0700 Subject: [PATCH 2/9] Add path dev_dependency and fix license year --- web/pubspec.yaml | 1 + web_generator/LICENSE | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/web/pubspec.yaml b/web/pubspec.yaml index 414e0388..3a1a44ec 100644 --- a/web/pubspec.yaml +++ b/web/pubspec.yaml @@ -8,4 +8,5 @@ environment: dev_dependencies: dart_flutter_team_lints: ^3.0.0 + path: ^1.8.3 test: ^1.24.4 diff --git a/web_generator/LICENSE b/web_generator/LICENSE index 32e050b7..a69ac38d 100644 --- a/web_generator/LICENSE +++ b/web_generator/LICENSE @@ -1,4 +1,4 @@ -Copyright 2023, the Dart project authors. +Copyright 2024, the Dart project authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are From e47d2a964dfd1e75898b52f9bc91d2fa6557114c Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Fri, 23 Aug 2024 09:45:07 -0700 Subject: [PATCH 3/9] More renames and additional READMEs/LICENSEs/etc. --- .gitignore | 6 +- LICENSE | 26 +++++++ README.md | 1 + ...ysis_options.yaml => analysis_options.yaml | 2 +- mono_repo.yaml | 2 +- web/README.md | 45 ++---------- web/mono_pkg.yaml | 2 +- {web_generator => web}/renames.md | 0 web_generator/CHANGELOG.md | 2 +- web_generator/README.md | 70 +++++++++++++++---- web_generator/{ => bin}/scrape_mdn.dart | 2 +- web_generator/{ => bin}/update_bindings.dart | 12 ++-- web_generator/generator/README.md | 19 ----- .../{generator => lib/src}/banned_names.dart | 0 web_generator/{generator => lib/src}/bcd.dart | 0 .../{generator => lib/src}/dart_main.dart | 0 .../{generator => lib/src}/doc_provider.dart | 0 .../src}/filesystem_api.dart | 0 .../{generator => lib/src}/formatting.dart | 0 .../src}/generate_bindings.dart | 0 .../src}/js_type_supertypes.dart | 0 web_generator/{generator => lib/src}/main.mjs | 0 .../{generator => lib/src}/package-lock.json | 0 .../{generator => lib/src}/package.json | 0 .../{generator => lib/src}/singletons.dart | 0 .../{generator => lib/src}/translator.dart | 0 .../{generator => lib/src}/type_aliases.dart | 0 .../{generator => lib/src}/type_union.dart | 0 .../{generator => lib/src}/util.dart | 6 -- .../{generator => lib/src}/webidl_api.dart | 0 .../src}/webref_css_api.dart | 0 .../src}/webref_elements_api.dart | 0 .../src}/webref_idl_api.dart | 0 web_generator/mono_pkg.yaml | 2 +- web_generator/pubspec.yaml | 4 +- web_generator/test/generate_docs_test.dart | 2 +- web_generator/test/type_union_test.dart | 2 +- 37 files changed, 108 insertions(+), 97 deletions(-) create mode 100644 LICENSE create mode 100644 README.md rename web/analysis_options.yaml => analysis_options.yaml (97%) rename {web_generator => web}/renames.md (100%) rename web_generator/{ => bin}/scrape_mdn.dart (99%) rename web_generator/{ => bin}/update_bindings.dart (95%) delete mode 100644 web_generator/generator/README.md rename web_generator/{generator => lib/src}/banned_names.dart (100%) rename web_generator/{generator => lib/src}/bcd.dart (100%) rename web_generator/{generator => lib/src}/dart_main.dart (100%) rename web_generator/{generator => lib/src}/doc_provider.dart (100%) rename web_generator/{generator => lib/src}/filesystem_api.dart (100%) rename web_generator/{generator => lib/src}/formatting.dart (100%) rename web_generator/{generator => lib/src}/generate_bindings.dart (100%) rename web_generator/{generator => lib/src}/js_type_supertypes.dart (100%) rename web_generator/{generator => lib/src}/main.mjs (100%) rename web_generator/{generator => lib/src}/package-lock.json (100%) rename web_generator/{generator => lib/src}/package.json (100%) rename web_generator/{generator => lib/src}/singletons.dart (100%) rename web_generator/{generator => lib/src}/translator.dart (100%) rename web_generator/{generator => lib/src}/type_aliases.dart (100%) rename web_generator/{generator => lib/src}/type_union.dart (100%) rename web_generator/{generator => lib/src}/util.dart (90%) rename web_generator/{generator => lib/src}/webidl_api.dart (100%) rename web_generator/{generator => lib/src}/webref_css_api.dart (100%) rename web_generator/{generator => lib/src}/webref_elements_api.dart (100%) rename web_generator/{generator => lib/src}/webref_idl_api.dart (100%) diff --git a/.gitignore b/.gitignore index 23ff2067..e4377b96 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ doc/api/ pubspec.lock -web_generator/generator/*.js -web_generator/generator/*.js.* -web_generator/generator/node_modules/ +web_generator/lib/src/*.js +web_generator/lib/src/*.js.* +web_generator/lib/src/node_modules/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..a69ac38d --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ +Copyright 2024, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..e7a70e63 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +web/README.md diff --git a/web/analysis_options.yaml b/analysis_options.yaml similarity index 97% rename from web/analysis_options.yaml rename to analysis_options.yaml index a4687c44..b86d28fb 100644 --- a/web/analysis_options.yaml +++ b/analysis_options.yaml @@ -7,7 +7,7 @@ analyzer: strict-inference: true strict-raw-types: true exclude: - - test_fixes/** + - web/test_fixes/** errors: # 43 instances in generated code. diff --git a/mono_repo.yaml b/mono_repo.yaml index 6c599012..fb7c39ae 100644 --- a/mono_repo.yaml +++ b/mono_repo.yaml @@ -8,4 +8,4 @@ merge_stages: - analyze_and_format - unit_test - dart_fixes - - generate_and_analyze \ No newline at end of file + - generate_and_analyze diff --git a/web/README.md b/web/README.md index ecb3e4d0..8e144f51 100644 --- a/web/README.md +++ b/web/README.md @@ -33,44 +33,9 @@ long-term web interop solution. To learn how to migrate from `dart:html` APIs to `package:web`, see our [migration guide](https://dart.dev/go/package-web). -## Generation conventions +## Generation -The generator scripts use a number of conventions to consistently handle Web IDL -definitions: - -### Interfaces - -- Interfaces are emitted as extension types that wrap and implement `JSObject`. -- Interface inheritance is maintained using `implements` between extension - types. -- Members of partial interfaces, partial mixins, and mixins are added to the - interfaces that include them, and therefore do not have separate declarations. - -### Types - -- Generic types include the generic in the case of `JSArray` and `JSPromise`. -- Enums are typedef'd to `String`. -- Callbacks and callback interfaces are typedef'd to `JSFunction`. -- In general, we prefer the Dart primitive over the JS type equivalent wherever - possible. For example, APIs use `String` instead of `JSString`. -- If a type appears in a generic position and it was typedef'd to a Dart - primitive type, it is replaced with the JS type equivalent to respect the type - bound of `JSAny?`. -- Union types are computed by picking the least upper bound of the types in the - JS type hierarchy, where every interface is equivalent to `JSObject`. -- Dictionary and typedef types are only emitted if they're used by another API. - -### Compatibility - -- The generator uses the - [MDN compatibility data](https://github.com/mdn/browser-compat-data) to - determine what members, interfaces, and namespaces to emit. Currently, we only - emit code that is standards track and is not experimental to reduce the number - of breaking changes. - -## Generation and updating the package - -Most of the APIs in this package are generated from public assets. See -[web_generator/README.md](https://github.com/dart-lang/web/tree/main/web_generator) -for information on the spec and IDL versions the package was generated from, and -for the process for updating the package. +This package is generated by `web_generator`. See the +[`README`](https://github.com/dart-lang/web/tree/main/web_generator) for more +details on the conventions used to generate this package and how to run the +different tools to generate bindings and update various package dependencies. diff --git a/web/mono_pkg.yaml b/web/mono_pkg.yaml index a98731ce..18963f16 100644 --- a/web/mono_pkg.yaml +++ b/web/mono_pkg.yaml @@ -11,4 +11,4 @@ stages: - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm - dart_fixes: - command: dart fix --compare-to-golden test_fixes - sdk: main \ No newline at end of file + sdk: main diff --git a/web_generator/renames.md b/web/renames.md similarity index 100% rename from web_generator/renames.md rename to web/renames.md diff --git a/web_generator/CHANGELOG.md b/web_generator/CHANGELOG.md index 3bdacffe..d9c47969 100644 --- a/web_generator/CHANGELOG.md +++ b/web_generator/CHANGELOG.md @@ -1,3 +1,3 @@ ## 1.0.0-wip -- Initial publish of internal repo. \ No newline at end of file +- Initial separation of `web_generator` from `web`. \ No newline at end of file diff --git a/web_generator/README.md b/web_generator/README.md index 62fed582..110e07e3 100644 --- a/web_generator/README.md +++ b/web_generator/README.md @@ -1,16 +1,63 @@ -## Updating the package +## What's this? -The Dart code in this package is generated from Web IDL definitions and MDN API -documentation. +This package contains tools to generate +[`web`](https://github.com/dart-lang/web/tree/main/web) from Web IDL definitions +and MDN API documentation. ### Regenerating the package -To regenerate the package from the current IDL versions, run: +The tool to generate bindings is written in Dart, compiled to JavaScript, and +run on Node. + +To regenerate `web` bindings from the current IDL versions, run: ```shell dart update_bindings.dart ``` +## Update to the latest Web IDL versions and regenerate + +Run: + +``` +dart update_bindings.dart --update +``` + +## Generation conventions + +The generator scripts use a number of conventions to consistently handle Web IDL +definitions: + +### Interfaces + +- Interfaces are emitted as extension types that wrap and implement `JSObject`. +- Interface inheritance is maintained using `implements` between extension + types. +- Members of partial interfaces, partial mixins, and mixins are added to the + interfaces that include them, and therefore do not have separate declarations. + +### Types + +- Generic types include the generic in the case of `JSArray` and `JSPromise`. +- Enums are typedef'd to `String`. +- Callbacks and callback interfaces are typedef'd to `JSFunction`. +- In general, we prefer the Dart primitive over the JS type equivalent wherever + possible. For example, APIs use `String` instead of `JSString`. +- If a type appears in a generic position and it was typedef'd to a Dart + primitive type, it is replaced with the JS type equivalent to respect the type + bound of `JSAny?`. +- Union types are computed by picking the least upper bound of the types in the + JS type hierarchy, where every interface is equivalent to `JSObject`. +- Dictionary and typedef types are only emitted if they're used by another API. + +### Compatibility + +- The generator uses the + [MDN compatibility data](https://github.com/mdn/browser-compat-data) to + determine what members, interfaces, and namespaces to emit. Currently, we only + emit code that is standards track and is not experimental to reduce the number + of breaking changes. + ### Updating the dartdoc info from MDN package:web's dartdoc comments come from the @@ -33,20 +80,17 @@ To re-generate the package from newer IDL versions, you can either run: dart update_bindings.dart --update ``` -or, edit manually edit `generator/package.json` to use specific IDL -versions, and re-run `update_bindings.dart`. +or, manually edit `generator/package.json` to use specific IDL versions, and +re-run `update_bindings.dart`. ## Web IDL versions Based on: -| Item | Version | -| --- | --: | -| `@webref/css` | [6.12.15](https://www.npmjs.com/package/@webref/css/v/6.12.15) | +| Item | Version | +| ------------------ | --------------------------------------------------------------: | +| `@webref/css` | [6.12.15](https://www.npmjs.com/package/@webref/css/v/6.12.15) | | `@webref/elements` | [2.3.0](https://www.npmjs.com/package/@webref/elements/v/2.3.0) | -| `@webref/idl` | [3.49.0](https://www.npmjs.com/package/@webref/idl/v/3.49.0) | +| `@webref/idl` | [3.49.0](https://www.npmjs.com/package/@webref/idl/v/3.49.0) | - -For instructions on re-generating the DOM bindings, see the -[generator docs](generator/README.md). diff --git a/web_generator/scrape_mdn.dart b/web_generator/bin/scrape_mdn.dart similarity index 99% rename from web_generator/scrape_mdn.dart rename to web_generator/bin/scrape_mdn.dart index b0ab8058..9f7a8172 100644 --- a/web_generator/scrape_mdn.dart +++ b/web_generator/bin/scrape_mdn.dart @@ -77,7 +77,7 @@ Future main(List args) async { const encoder = JsonEncoder.withIndent(' '); - final file = File('third_party/mdn/mdn.json'); + final file = File('../third_party/mdn/mdn.json'); final json = { '__meta__': { 'source': '[MDN Web Docs]($mdnUrl)', diff --git a/web_generator/update_bindings.dart b/web_generator/bin/update_bindings.dart similarity index 95% rename from web_generator/update_bindings.dart rename to web_generator/bin/update_bindings.dart index 4f048f84..deb50e0c 100644 --- a/web_generator/update_bindings.dart +++ b/web_generator/bin/update_bindings.dart @@ -64,7 +64,7 @@ $_usage'''); } // Determine the set of previously generated files. - final domDir = Directory(p.join('..', 'web', 'lib', 'src', 'dom')); + final domDir = Directory(p.join('..', '..', 'web', 'lib', 'src', 'dom')); final existingFiles = domDir.listSync(recursive: true).whereType().where((file) { if (!file.path.endsWith('.dart')) return false; @@ -79,7 +79,7 @@ $_usage'''); // Run app with `node`. await _runProc( 'node', - ['main.mjs', '../../web/lib/src'], + ['main.mjs', '../../../web/lib/src'], workingDirectory: _bindingsGeneratorPath, ); @@ -93,7 +93,7 @@ $_usage'''); // Update readme. final readmeFile = File( - p.normalize(p.join(_bindingsGeneratorPath, '..', 'README.md')), + p.normalize(p.join(_bindingsGeneratorPath, '..', '..', 'README.md')), ); final sourceContent = readmeFile.readAsStringSync(); @@ -133,13 +133,13 @@ String _packageLockVersion(String package) { return webRefIdl['version'] as String; } -const _bindingsGeneratorPath = 'generator'; +const _bindingsGeneratorPath = '../lib/src'; const _webRefCss = '@webref/css'; const _webRefElements = '@webref/elements'; const _webRefIdl = '@webref/idl'; -const _thisScript = 'update_bindings.dart'; +const _thisScript = 'bin/update_bindings.dart'; const _startComment = ''; @@ -169,7 +169,7 @@ Future _runProc( Future _generateJsTypeSupertypes() async { // Use a file that uses `dart:js_interop` for analysis. final contextCollection = AnalysisContextCollection(includedPaths: [ - p.fromUri(Platform.script.resolve('../web/lib/src/dom.dart')) + p.fromUri(Platform.script.resolve('../../web/lib/src/dom.dart')) ]); final dartJsInterop = (await contextCollection.contexts.single.currentSession .getLibraryByUri('dart:js_interop') as LibraryElementResult) diff --git a/web_generator/generator/README.md b/web_generator/generator/README.md deleted file mode 100644 index b693a6c5..00000000 --- a/web_generator/generator/README.md +++ /dev/null @@ -1,19 +0,0 @@ -The bindings generator for `package:web`. - -This tool is written in Dart, compiled to JavaScript, and run on Node. - -## Generating the bindings - -Run: - -``` -dart update_bindings.dart -``` - -## Update to the latest Web IDL versions and regenerate - -Run: - -``` -dart update_bindings.dart --update -``` diff --git a/web_generator/generator/banned_names.dart b/web_generator/lib/src/banned_names.dart similarity index 100% rename from web_generator/generator/banned_names.dart rename to web_generator/lib/src/banned_names.dart diff --git a/web_generator/generator/bcd.dart b/web_generator/lib/src/bcd.dart similarity index 100% rename from web_generator/generator/bcd.dart rename to web_generator/lib/src/bcd.dart diff --git a/web_generator/generator/dart_main.dart b/web_generator/lib/src/dart_main.dart similarity index 100% rename from web_generator/generator/dart_main.dart rename to web_generator/lib/src/dart_main.dart diff --git a/web_generator/generator/doc_provider.dart b/web_generator/lib/src/doc_provider.dart similarity index 100% rename from web_generator/generator/doc_provider.dart rename to web_generator/lib/src/doc_provider.dart diff --git a/web_generator/generator/filesystem_api.dart b/web_generator/lib/src/filesystem_api.dart similarity index 100% rename from web_generator/generator/filesystem_api.dart rename to web_generator/lib/src/filesystem_api.dart diff --git a/web_generator/generator/formatting.dart b/web_generator/lib/src/formatting.dart similarity index 100% rename from web_generator/generator/formatting.dart rename to web_generator/lib/src/formatting.dart diff --git a/web_generator/generator/generate_bindings.dart b/web_generator/lib/src/generate_bindings.dart similarity index 100% rename from web_generator/generator/generate_bindings.dart rename to web_generator/lib/src/generate_bindings.dart diff --git a/web_generator/generator/js_type_supertypes.dart b/web_generator/lib/src/js_type_supertypes.dart similarity index 100% rename from web_generator/generator/js_type_supertypes.dart rename to web_generator/lib/src/js_type_supertypes.dart diff --git a/web_generator/generator/main.mjs b/web_generator/lib/src/main.mjs similarity index 100% rename from web_generator/generator/main.mjs rename to web_generator/lib/src/main.mjs diff --git a/web_generator/generator/package-lock.json b/web_generator/lib/src/package-lock.json similarity index 100% rename from web_generator/generator/package-lock.json rename to web_generator/lib/src/package-lock.json diff --git a/web_generator/generator/package.json b/web_generator/lib/src/package.json similarity index 100% rename from web_generator/generator/package.json rename to web_generator/lib/src/package.json diff --git a/web_generator/generator/singletons.dart b/web_generator/lib/src/singletons.dart similarity index 100% rename from web_generator/generator/singletons.dart rename to web_generator/lib/src/singletons.dart diff --git a/web_generator/generator/translator.dart b/web_generator/lib/src/translator.dart similarity index 100% rename from web_generator/generator/translator.dart rename to web_generator/lib/src/translator.dart diff --git a/web_generator/generator/type_aliases.dart b/web_generator/lib/src/type_aliases.dart similarity index 100% rename from web_generator/generator/type_aliases.dart rename to web_generator/lib/src/type_aliases.dart diff --git a/web_generator/generator/type_union.dart b/web_generator/lib/src/type_union.dart similarity index 100% rename from web_generator/generator/type_union.dart rename to web_generator/lib/src/type_union.dart diff --git a/web_generator/generator/util.dart b/web_generator/lib/src/util.dart similarity index 90% rename from web_generator/generator/util.dart rename to web_generator/lib/src/util.dart index c464df96..3b2dd0ad 100644 --- a/web_generator/generator/util.dart +++ b/web_generator/lib/src/util.dart @@ -10,12 +10,6 @@ import 'filesystem_api.dart'; @JS('Object.entries') external JSArray objectEntries(JSObject o); -// TODO(srujzs): Remove once this is in dart:js_interop. -extension JSArrayExtension on JSArray { - external T operator [](int i); - external int get length; -} - void ensureDirectoryExists(String dir) { if (!fs.existsSync(dir.toJS).toDart) { fs.mkdirSync(dir.toJS, JSMkdirOptions(recursive: true.toJS)); diff --git a/web_generator/generator/webidl_api.dart b/web_generator/lib/src/webidl_api.dart similarity index 100% rename from web_generator/generator/webidl_api.dart rename to web_generator/lib/src/webidl_api.dart diff --git a/web_generator/generator/webref_css_api.dart b/web_generator/lib/src/webref_css_api.dart similarity index 100% rename from web_generator/generator/webref_css_api.dart rename to web_generator/lib/src/webref_css_api.dart diff --git a/web_generator/generator/webref_elements_api.dart b/web_generator/lib/src/webref_elements_api.dart similarity index 100% rename from web_generator/generator/webref_elements_api.dart rename to web_generator/lib/src/webref_elements_api.dart diff --git a/web_generator/generator/webref_idl_api.dart b/web_generator/lib/src/webref_idl_api.dart similarity index 100% rename from web_generator/generator/webref_idl_api.dart rename to web_generator/lib/src/webref_idl_api.dart diff --git a/web_generator/mono_pkg.yaml b/web_generator/mono_pkg.yaml index 2c104f59..26326d30 100644 --- a/web_generator/mono_pkg.yaml +++ b/web_generator/mono_pkg.yaml @@ -10,4 +10,4 @@ stages: - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm - generate_and_analyze: - command: dart update_bindings.dart - - analyze: --fatal-infos . \ No newline at end of file + - analyze: --fatal-infos . diff --git a/web_generator/pubspec.yaml b/web_generator/pubspec.yaml index 158be1ac..66fb95da 100644 --- a/web_generator/pubspec.yaml +++ b/web_generator/pubspec.yaml @@ -1,5 +1,5 @@ name: web_generator -publish_to: none +publish_to: none # internal only for now version: 1.0.0-wip description: Generator scripts for package:web. repository: https://github.com/dart-lang/web @@ -7,7 +7,7 @@ repository: https://github.com/dart-lang/web environment: sdk: ^3.6.0-0 -dev_dependencies: +dependencies: analyzer: ^6.3.0 args: ^2.4.0 build_runner: ^2.4.6 diff --git a/web_generator/test/generate_docs_test.dart b/web_generator/test/generate_docs_test.dart index b3bb3b47..0e7c043e 100644 --- a/web_generator/test/generate_docs_test.dart +++ b/web_generator/test/generate_docs_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; -import '../generator/formatting.dart'; +import 'package:web_generator/src/formatting.dart'; void main() { group('formatDocs', () { diff --git a/web_generator/test/type_union_test.dart b/web_generator/test/type_union_test.dart index 3e998a75..464cbacc 100644 --- a/web_generator/test/type_union_test.dart +++ b/web_generator/test/type_union_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; -import '../generator/type_union.dart'; +import 'package:web_generator/src/type_union.dart'; void main() { test('Non-JS types', () { From 7f707a0c4867177c8bc07dd3b10e9f8e1d2b7f61 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Fri, 23 Aug 2024 09:57:29 -0700 Subject: [PATCH 4/9] path changes --- web_generator/README.md | 18 +++++++++--------- web_generator/bin/scrape_mdn.dart | 2 +- web_generator/lib/src/doc_provider.dart | 2 +- web_generator/lib/src/js_type_supertypes.dart | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/web_generator/README.md b/web_generator/README.md index 110e07e3..8f8f688e 100644 --- a/web_generator/README.md +++ b/web_generator/README.md @@ -12,7 +12,7 @@ run on Node. To regenerate `web` bindings from the current IDL versions, run: ```shell -dart update_bindings.dart +dart bin/update_bindings.dart ``` ## Update to the latest Web IDL versions and regenerate @@ -77,20 +77,20 @@ to that file should be committed to git. You'll need to run To re-generate the package from newer IDL versions, you can either run: ```shell -dart update_bindings.dart --update +dart bin/update_bindings.dart --update ``` -or, manually edit `generator/package.json` to use specific IDL versions, and +or, manually edit `lib/src/package.json` to use specific IDL versions, and re-run `update_bindings.dart`. ## Web IDL versions Based on: - -| Item | Version | -| ------------------ | --------------------------------------------------------------: | -| `@webref/css` | [6.12.15](https://www.npmjs.com/package/@webref/css/v/6.12.15) | + +| Item | Version | +| --- | --: | +| `@webref/css` | [6.12.15](https://www.npmjs.com/package/@webref/css/v/6.12.15) | | `@webref/elements` | [2.3.0](https://www.npmjs.com/package/@webref/elements/v/2.3.0) | -| `@webref/idl` | [3.49.0](https://www.npmjs.com/package/@webref/idl/v/3.49.0) | - +| `@webref/idl` | [3.49.0](https://www.npmjs.com/package/@webref/idl/v/3.49.0) | + diff --git a/web_generator/bin/scrape_mdn.dart b/web_generator/bin/scrape_mdn.dart index 9f7a8172..63b256e4 100644 --- a/web_generator/bin/scrape_mdn.dart +++ b/web_generator/bin/scrape_mdn.dart @@ -14,7 +14,7 @@ Future main(List args) async { final offline = args.length == 1 && args.first == '--offline'; // clone the repo - final repoDir = Directory(p.join('.dart_tool', 'mdn_content')); + final repoDir = Directory(p.join('..', '.dart_tool', 'mdn_content')); if (!repoDir.existsSync()) { await _run( 'git', diff --git a/web_generator/lib/src/doc_provider.dart b/web_generator/lib/src/doc_provider.dart index 65386799..3513ecde 100644 --- a/web_generator/lib/src/doc_provider.dart +++ b/web_generator/lib/src/doc_provider.dart @@ -14,7 +14,7 @@ import 'formatting.dart'; class DocProvider { static DocProvider create() { final content = fs.readFileSync( - p.join('..', 'third_party', 'mdn', 'mdn.json').toJS, + p.join('..', '..', 'third_party', 'mdn', 'mdn.json').toJS, JSReadFileOptions(encoding: 'utf8'.toJS), ) as JSString; diff --git a/web_generator/lib/src/js_type_supertypes.dart b/web_generator/lib/src/js_type_supertypes.dart index 242ae1b0..9878f768 100644 --- a/web_generator/lib/src/js_type_supertypes.dart +++ b/web_generator/lib/src/js_type_supertypes.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Updated by update_bindings.dart. Do not modify by hand. +// Updated by bin/update_bindings.dart. Do not modify by hand. const Map jsTypeSupertypes = { 'JSAny': null, From b4edd04d32e6e023df7bccdfb5bb4a8df165b10a Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Fri, 23 Aug 2024 10:30:26 -0700 Subject: [PATCH 5/9] Use resolved paths --- web_generator/README.md | 46 ++++++++++--------------- web_generator/bin/scrape_mdn.dart | 6 ++-- web_generator/bin/update_bindings.dart | 9 ++--- web_generator/package-lock.json | 6 ---- web_generator/third_party/mdn/README.md | 2 +- 5 files changed, 29 insertions(+), 40 deletions(-) delete mode 100644 web_generator/package-lock.json diff --git a/web_generator/README.md b/web_generator/README.md index 8f8f688e..0a90c095 100644 --- a/web_generator/README.md +++ b/web_generator/README.md @@ -17,12 +17,29 @@ dart bin/update_bindings.dart ## Update to the latest Web IDL versions and regenerate -Run: +To re-generate the package from newer IDL versions, you can either run: +```shell +dart bin/update_bindings.dart --update ``` -dart update_bindings.dart --update + +or, manually edit `lib/src/package.json` to use specific IDL versions, and +re-run `update_bindings.dart`. + +### Updating the dartdoc info from MDN + +package:web's dartdoc comments come from the +[MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web) project. In order +to update to the latest version of the documentation, run: + +```shell +dart bin/scrape_mdn.dart ``` +That will collect the MDN documentation into `third_party/mdn/mdn.json`; changes +to that file should be committed to git. You'll need to run +`update_bindings.dart` to produce Dart code using the updated documentation. + ## Generation conventions The generator scripts use a number of conventions to consistently handle Web IDL @@ -58,31 +75,6 @@ definitions: emit code that is standards track and is not experimental to reduce the number of breaking changes. -### Updating the dartdoc info from MDN - -package:web's dartdoc comments come from the -[MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web) project. In order -to update to the latest version of the documentation, run: - -```shell -dart scrape_mdn.dart -``` - -That will collect the MDN documentation into `third_party/mdn/mdn.json`; changes -to that file should be committed to git. You'll need to run -`update_bindings.dart` to produce Dart code using the updated documentation. - -### Updating to use the latest Web IDL versions - -To re-generate the package from newer IDL versions, you can either run: - -```shell -dart bin/update_bindings.dart --update -``` - -or, manually edit `lib/src/package.json` to use specific IDL versions, and -re-run `update_bindings.dart`. - ## Web IDL versions Based on: diff --git a/web_generator/bin/scrape_mdn.dart b/web_generator/bin/scrape_mdn.dart index 63b256e4..996a600d 100644 --- a/web_generator/bin/scrape_mdn.dart +++ b/web_generator/bin/scrape_mdn.dart @@ -14,7 +14,8 @@ Future main(List args) async { final offline = args.length == 1 && args.first == '--offline'; // clone the repo - final repoDir = Directory(p.join('..', '.dart_tool', 'mdn_content')); + final repoDir = + Directory(Platform.script.resolve('../.dart_tool/mdn_content').path); if (!repoDir.existsSync()) { await _run( 'git', @@ -77,7 +78,8 @@ Future main(List args) async { const encoder = JsonEncoder.withIndent(' '); - final file = File('../third_party/mdn/mdn.json'); + final file = + File(Platform.script.resolve('../third_party/mdn/mdn.json').path); final json = { '__meta__': { 'source': '[MDN Web Docs]($mdnUrl)', diff --git a/web_generator/bin/update_bindings.dart b/web_generator/bin/update_bindings.dart index deb50e0c..0735b5b7 100644 --- a/web_generator/bin/update_bindings.dart +++ b/web_generator/bin/update_bindings.dart @@ -64,7 +64,8 @@ $_usage'''); } // Determine the set of previously generated files. - final domDir = Directory(p.join('..', '..', 'web', 'lib', 'src', 'dom')); + final domDir = + Directory(Platform.script.resolve('../../web/lib/src/dom').path); final existingFiles = domDir.listSync(recursive: true).whereType().where((file) { if (!file.path.endsWith('.dart')) return false; @@ -79,7 +80,7 @@ $_usage'''); // Run app with `node`. await _runProc( 'node', - ['main.mjs', '../../../web/lib/src'], + ['main.mjs', Platform.script.resolve('../../web/lib/src').path], workingDirectory: _bindingsGeneratorPath, ); @@ -93,7 +94,7 @@ $_usage'''); // Update readme. final readmeFile = File( - p.normalize(p.join(_bindingsGeneratorPath, '..', '..', 'README.md')), + p.normalize(Platform.script.resolve('../README.md').path), ); final sourceContent = readmeFile.readAsStringSync(); @@ -133,7 +134,7 @@ String _packageLockVersion(String package) { return webRefIdl['version'] as String; } -const _bindingsGeneratorPath = '../lib/src'; +final _bindingsGeneratorPath = Platform.script.resolve('../lib/src').path; const _webRefCss = '@webref/css'; const _webRefElements = '@webref/elements'; diff --git a/web_generator/package-lock.json b/web_generator/package-lock.json deleted file mode 100644 index 639e42d2..00000000 --- a/web_generator/package-lock.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "web_generator", - "lockfileVersion": 3, - "requires": true, - "packages": {} -} \ No newline at end of file diff --git a/web_generator/third_party/mdn/README.md b/web_generator/third_party/mdn/README.md index 14eb1eb0..ff28e54d 100644 --- a/web_generator/third_party/mdn/README.md +++ b/web_generator/third_party/mdn/README.md @@ -10,5 +10,5 @@ See [LICENSE](./LICENSE) for the license this content is under. ## Process -See [the script](../../tool/scrape_mdn.dart) which collects the documentation +See [the script](../../bin/scrape_mdn.dart) which collects the documentation information. From f6d06b1a15bc47469b077edced17c64f8935beea Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Fri, 23 Aug 2024 10:56:52 -0700 Subject: [PATCH 6/9] change self_validate task and fix path in CHANGELOG --- .github/workflows/dart.yml | 8 -------- mono_repo.yaml | 2 +- web/CHANGELOG.md | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 9c124e64..478382a0 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -69,8 +69,6 @@ jobs: run: dart analyze --fatal-infos . if: "always() && steps.web_pub_upgrade.conclusion == 'success'" working-directory: web - needs: - - job_001 job_003: name: "analyze_and_format; Dart 3.4.0; PKG: web; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest @@ -101,8 +99,6 @@ jobs: run: "dart format --output=none --set-exit-if-changed ." if: "always() && steps.web_pub_upgrade.conclusion == 'success'" working-directory: web - needs: - - job_001 job_004: name: "analyze_and_format; Dart dev; PKGS: web, web_generator; `dart analyze --fatal-infos .`" runs-on: ubuntu-latest @@ -142,8 +138,6 @@ jobs: run: dart analyze --fatal-infos . if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" working-directory: web_generator - needs: - - job_001 job_005: name: "analyze_and_format; Dart dev; PKGS: web, web_generator; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest @@ -183,8 +177,6 @@ jobs: run: "dart format --output=none --set-exit-if-changed ." if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" working-directory: web_generator - needs: - - job_001 job_006: name: "unit_test; Dart 3.4.0; PKG: web; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm`" runs-on: ubuntu-latest diff --git a/mono_repo.yaml b/mono_repo.yaml index fb7c39ae..5b9a450d 100644 --- a/mono_repo.yaml +++ b/mono_repo.yaml @@ -1,5 +1,5 @@ # See https://github.com/google/mono_repo.dart for details on this file -self_validate: analyze +self_validate: analyze_and_format github: cron: "0 0 * * 0" diff --git a/web/CHANGELOG.md b/web/CHANGELOG.md index 7770273c..78374285 100644 --- a/web/CHANGELOG.md +++ b/web/CHANGELOG.md @@ -51,7 +51,7 @@ - Add support for `dart fix` migrations from `dart:html` classes to `package:web` classes. - Contribute a markdown file for the renamed classes from `dart:html` to - `package:web` (see [renames.md](../web_generator/renames.md)). + `package:web` (see [renames.md](renames.md)). - Migrate classes to use interop extension types that implement `JSObject`. - Add generics to APIs that use `JSArray` and `JSPromise`. Typedefs of a Dart primitive type are instead replaced with their JS type equivalent if they From 193530e15e5981517a6591782e49f0b49779dd24 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Fri, 23 Aug 2024 11:00:30 -0700 Subject: [PATCH 7/9] Change path in scrape_mdn_test --- web_generator/test/scrape_mdn_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_generator/test/scrape_mdn_test.dart b/web_generator/test/scrape_mdn_test.dart index 7b005222..ba93a9d8 100644 --- a/web_generator/test/scrape_mdn_test.dart +++ b/web_generator/test/scrape_mdn_test.dart @@ -7,7 +7,7 @@ library; import 'package:test/test.dart'; -import '../scrape_mdn.dart'; +import '../bin/scrape_mdn.dart'; void main() { group('convertMdnToMarkdown', () { From 55ae417efc9d6a9334c0ea09b47f43d2093c9722 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Fri, 23 Aug 2024 11:04:42 -0700 Subject: [PATCH 8/9] Fix path to update_bindings.dart in mono_repo.yaml --- .github/workflows/dart.yml | 6 +++--- tool/ci.sh | 4 ++-- web_generator/mono_pkg.yaml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 478382a0..03caf814 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -380,7 +380,7 @@ jobs: - job_008 - job_009 job_011: - name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart update_bindings.dart`" + name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart bin/update_bindings.dart`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies @@ -405,8 +405,8 @@ jobs: run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" working-directory: web_generator - - name: web_generator; dart update_bindings.dart - run: dart update_bindings.dart + - name: web_generator; dart bin/update_bindings.dart + run: dart bin/update_bindings.dart if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" working-directory: web_generator needs: diff --git a/tool/ci.sh b/tool/ci.sh index a7661ce9..ef15b46c 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -72,8 +72,8 @@ for PKG in ${PKGS}; do dart fix --compare-to-golden test_fixes || EXIT_CODE=$? ;; command_1) - echo 'dart update_bindings.dart' - dart update_bindings.dart || EXIT_CODE=$? + echo 'dart bin/update_bindings.dart' + dart bin/update_bindings.dart || EXIT_CODE=$? ;; format) echo 'dart format --output=none --set-exit-if-changed .' diff --git a/web_generator/mono_pkg.yaml b/web_generator/mono_pkg.yaml index 26326d30..0570b3a2 100644 --- a/web_generator/mono_pkg.yaml +++ b/web_generator/mono_pkg.yaml @@ -9,5 +9,5 @@ stages: - test: --test-randomize-ordering-seed=random -p chrome - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm - generate_and_analyze: - - command: dart update_bindings.dart + - command: dart bin/update_bindings.dart - analyze: --fatal-infos . From ff8abf3a13ece5e7fef42728f89d545ebe9f0bd9 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Fri, 23 Aug 2024 12:09:59 -0700 Subject: [PATCH 9/9] Review comments --- LICENSE | 2 +- README.md | 2 +- {web_generator/third_party => third_party}/mdn/LICENSE | 0 {web_generator/third_party => third_party}/mdn/README.md | 4 ++-- {web_generator/third_party => third_party}/mdn/mdn.json | 0 web_generator/bin/scrape_mdn.dart | 2 +- web_generator/lib/src/doc_provider.dart | 2 +- 7 files changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 120000 README.md rename {web_generator/third_party => third_party}/mdn/LICENSE (100%) rename {web_generator/third_party => third_party}/mdn/README.md (75%) rename {web_generator/third_party => third_party}/mdn/mdn.json (100%) diff --git a/LICENSE b/LICENSE index a69ac38d..32e050b7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2024, the Dart project authors. +Copyright 2023, the Dart project authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/README.md b/README.md deleted file mode 100644 index e7a70e63..00000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -web/README.md diff --git a/README.md b/README.md new file mode 120000 index 00000000..84abb5c6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +web/README.md \ No newline at end of file diff --git a/web_generator/third_party/mdn/LICENSE b/third_party/mdn/LICENSE similarity index 100% rename from web_generator/third_party/mdn/LICENSE rename to third_party/mdn/LICENSE diff --git a/web_generator/third_party/mdn/README.md b/third_party/mdn/README.md similarity index 75% rename from web_generator/third_party/mdn/README.md rename to third_party/mdn/README.md index ff28e54d..5cae374f 100644 --- a/web_generator/third_party/mdn/README.md +++ b/third_party/mdn/README.md @@ -10,5 +10,5 @@ See [LICENSE](./LICENSE) for the license this content is under. ## Process -See [the script](../../bin/scrape_mdn.dart) which collects the documentation -information. +See [the script](../web_generator/bin/scrape_mdn.dart) which collects the +documentation information. diff --git a/web_generator/third_party/mdn/mdn.json b/third_party/mdn/mdn.json similarity index 100% rename from web_generator/third_party/mdn/mdn.json rename to third_party/mdn/mdn.json diff --git a/web_generator/bin/scrape_mdn.dart b/web_generator/bin/scrape_mdn.dart index 996a600d..fc64321d 100644 --- a/web_generator/bin/scrape_mdn.dart +++ b/web_generator/bin/scrape_mdn.dart @@ -79,7 +79,7 @@ Future main(List args) async { const encoder = JsonEncoder.withIndent(' '); final file = - File(Platform.script.resolve('../third_party/mdn/mdn.json').path); + File(Platform.script.resolve('../../third_party/mdn/mdn.json').path); final json = { '__meta__': { 'source': '[MDN Web Docs]($mdnUrl)', diff --git a/web_generator/lib/src/doc_provider.dart b/web_generator/lib/src/doc_provider.dart index 3513ecde..05df73f2 100644 --- a/web_generator/lib/src/doc_provider.dart +++ b/web_generator/lib/src/doc_provider.dart @@ -14,7 +14,7 @@ import 'formatting.dart'; class DocProvider { static DocProvider create() { final content = fs.readFileSync( - p.join('..', '..', 'third_party', 'mdn', 'mdn.json').toJS, + p.join('..', '..', '..', 'third_party', 'mdn', 'mdn.json').toJS, JSReadFileOptions(encoding: 'utf8'.toJS), ) as JSString;