puppeteer-bidi 0.0.1.beta3 → 0.0.1.beta4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a297f926102da482b6ffaecf8f894cb95dffb910f6743ebc75d0414f1aae00f
4
- data.tar.gz: 81c8b08b57b53ca739af7e864723686965278d60bd5d0d1197aff31dd37b299f
3
+ metadata.gz: 2d3afdcd6aeda92482fb530cab98075505ae8e6d9b76da6a8f65dc01d3f76ee6
4
+ data.tar.gz: 2c74ca2d812a27ad8051911cb213d008a6d4077781ca5ecf0b782a2a0f62d72e
5
5
  SHA512:
6
- metadata.gz: 519a8a8e1dccfc046de5c8bea356a59d3b5e40e79e8040f85fbbe370f1530170ccbd555b32a242841d132130ef4da85eeedc58bac3f554ab34159faa0b807826
7
- data.tar.gz: d60e4cb2eb5caf33a055d394861814f4ecd3f8b561796ff5cb69cce17a5efe59ae3e07cc98e9e5c46b90a68944f20090cfccb6726849cf774f0f0f015fbffaf1
6
+ metadata.gz: 0e900fd975d92973786eea9546f22f8b71afb2a856575c6ef15bba023285322abe888887c1b92458fa736d887cfff8192c0951738d75c91445d69cda46944740
7
+ data.tar.gz: 070afa10326ae5a789b70b40a55c5b5462dbb5599fc5b8e30b83cf8522752fe65d1c7959cc0e42d937d244a2e0fc23c050f0a48b89eb99f0c8fa5223bb924129
data/CLAUDE.md CHANGED
@@ -108,6 +108,10 @@ end
108
108
  - Public methods should have type annotations
109
109
  - **Do NOT use `@rbs!` blocks** - RubyMine IDE doesn't recognize them
110
110
  - **Use direct union types** instead of type aliases: `BrowserTarget | PageTarget | FrameTarget` not `target`
111
+ - **Do NOT use `**options` in public APIs** - RubyMine shows as `untyped`. Use explicit keyword arguments:
112
+ - Optional params: `param: nil`
113
+ - Boolean params with default: `headless: true` or `enabled: false`
114
+ - Internal/Core layer methods may still use `**options` for flexibility
111
115
 
112
116
  **Generate RBS files:**
113
117
  ```bash
@@ -69,18 +69,18 @@ module Puppeteer
69
69
  end
70
70
 
71
71
  # Launch a new Firefox browser instance
72
- # @rbs executable_path: String
73
- # @rbs user_data_dir: String
74
- # @rbs headless: bool
75
- # @rbs args: Array[String]
76
- # @rbs timeout: Numeric
72
+ # @rbs executable_path: String? -- Path to browser executable
73
+ # @rbs user_data_dir: String? -- Path to user data directory
74
+ # @rbs headless: bool -- Run browser in headless mode
75
+ # @rbs args: Array[String]? -- Additional browser arguments
76
+ # @rbs timeout: Numeric? -- Launch timeout in seconds
77
77
  # @rbs return: Browser -- Browser instance
78
- def self.launch(**options)
78
+ def self.launch(executable_path: nil, user_data_dir: nil, headless: true, args: nil, timeout: nil)
79
79
  launcher = BrowserLauncher.new(
80
- executable_path: options[:executable_path],
81
- user_data_dir: options[:user_data_dir],
82
- headless: options.fetch(:headless, true),
83
- args: options.fetch(:args, [])
80
+ executable_path: executable_path,
81
+ user_data_dir: user_data_dir,
82
+ headless: headless,
83
+ args: args || []
84
84
  )
85
85
 
86
86
  ws_endpoint = launcher.launch
@@ -90,7 +90,7 @@ module Puppeteer
90
90
 
91
91
  # Start transport connection in background thread with Sync reactor
92
92
  # Sync is the preferred way to run async code at the top level
93
- AsyncUtils.async_timeout(options.fetch(:timeout, 30) * 1000, transport.connect).wait
93
+ AsyncUtils.async_timeout((timeout || 30) * 1000, transport.connect).wait
94
94
 
95
95
  connection = Connection.new(transport)
96
96
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puppeteer
4
4
  module Bidi
5
- VERSION = "0.0.1.beta3"
5
+ VERSION = "0.0.1.beta4"
6
6
  end
7
7
  end
@@ -33,14 +33,20 @@ require "puppeteer/bidi/browser"
33
33
  module Puppeteer
34
34
  module Bidi
35
35
  # Launch a new browser instance
36
- # @rbs executable_path: String
37
- # @rbs user_data_dir: String
38
- # @rbs headless: bool
39
- # @rbs args: Array[String]
40
- # @rbs timeout: Numeric
36
+ # @rbs executable_path: String? -- Path to browser executable
37
+ # @rbs user_data_dir: String? -- Path to user data directory
38
+ # @rbs headless: bool -- Run browser in headless mode
39
+ # @rbs args: Array[String]? -- Additional browser arguments
40
+ # @rbs timeout: Numeric? -- Launch timeout in seconds
41
41
  # @rbs return: Browser -- Browser instance
42
- def self.launch(**options)
43
- Browser.launch(**options)
42
+ def self.launch(executable_path: nil, user_data_dir: nil, headless: true, args: nil, timeout: nil)
43
+ Browser.launch(
44
+ executable_path: executable_path,
45
+ user_data_dir: user_data_dir,
46
+ headless: headless,
47
+ args: args,
48
+ timeout: timeout
49
+ )
44
50
  end
45
51
 
46
52
  # Connect to an existing browser instance
@@ -23,13 +23,13 @@ module Puppeteer
23
23
  def initialize: (connection: Connection, launcher: BrowserLauncher?, core_browser: Core::Browser, session: Core::Session) -> void
24
24
 
25
25
  # Launch a new Firefox browser instance
26
- # @rbs executable_path: String
27
- # @rbs user_data_dir: String
28
- # @rbs headless: bool
29
- # @rbs args: Array[String]
30
- # @rbs timeout: Numeric
26
+ # @rbs executable_path: String? -- Path to browser executable
27
+ # @rbs user_data_dir: String? -- Path to user data directory
28
+ # @rbs headless: bool -- Run browser in headless mode
29
+ # @rbs args: Array[String]? -- Additional browser arguments
30
+ # @rbs timeout: Numeric? -- Launch timeout in seconds
31
31
  # @rbs return: Browser -- Browser instance
32
- def self.launch: (**untyped options) -> Browser
32
+ def self.launch: (?executable_path: String?, ?user_data_dir: String?, ?headless: bool, ?args: Array[String]?, ?timeout: Numeric?) -> Browser
33
33
 
34
34
  # Connect to an existing Firefox browser instance
35
35
  # @rbs ws_endpoint: String -- WebSocket endpoint URL
@@ -3,13 +3,13 @@
3
3
  module Puppeteer
4
4
  module Bidi
5
5
  # Launch a new browser instance
6
- # @rbs executable_path: String
7
- # @rbs user_data_dir: String
8
- # @rbs headless: bool
9
- # @rbs args: Array[String]
10
- # @rbs timeout: Numeric
6
+ # @rbs executable_path: String? -- Path to browser executable
7
+ # @rbs user_data_dir: String? -- Path to user data directory
8
+ # @rbs headless: bool -- Run browser in headless mode
9
+ # @rbs args: Array[String]? -- Additional browser arguments
10
+ # @rbs timeout: Numeric? -- Launch timeout in seconds
11
11
  # @rbs return: Browser -- Browser instance
12
- def self.launch: (**untyped options) -> Browser
12
+ def self.launch: (?executable_path: String?, ?user_data_dir: String?, ?headless: bool, ?args: Array[String]?, ?timeout: Numeric?) -> Browser
13
13
 
14
14
  # Connect to an existing browser instance
15
15
  # @rbs ws_endpoint: String -- WebSocket endpoint URL
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppeteer-bidi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta3
4
+ version: 0.0.1.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki