Skip to content

Commit 1d11bce

Browse files
committed
[js] Enabling API docs in Rakefile
Fixes SeleniumHQ#10185
1 parent 4e1fd04 commit 1d11bce

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Rakefile

+14-3
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,20 @@ namespace :node do
507507
desc 'Release Node npm package'
508508
task deploy: :release
509509

510-
desc 'Generate Node documentation — currently not working'
510+
desc 'Generate Node documentation'
511511
task :docs, [:skip_update] do |_task, arguments|
512-
puts "WARNING — Cannot currently update API Docs for JavaScript bindings"
512+
FileUtils.rm_rf('build/docs/api/javascript/')
513+
begin
514+
sh 'npm run generate-docs --prefix javascript/node/selenium-webdriver || true', verbose: true
515+
rescue StandardError
516+
puts 'Ensure that npm is installed on your system'
517+
raise
518+
end
519+
520+
unless arguments[:skip_update]
521+
puts "Updating JavaScript documentation"
522+
puts update_gh_pages ? "JavaScript Docs updated!" : "JavaScript Doc update cancelled"
523+
end
513524
end
514525

515526
desc 'Update JavaScript changelog'
@@ -1308,7 +1319,7 @@ def update_gh_pages
13081319
retry
13091320
end
13101321

1311-
%w[java rb py dotnet].each do |language|
1322+
%w[java rb py dotnet javascript].each do |language|
13121323
if Dir.exist?("build/docs/api/#{language}") && !Dir.empty?("build/docs/api/#{language}")
13131324
puts "Deleting #{language} directory in docs/api since corresponding directory in build/docs/api is not empty"
13141325
FileUtils.rm_rf("docs/api/#{language}")

0 commit comments

Comments
 (0)