Skip to content

Commit 06e42eb

Browse files
committed
fixes
1 parent 1c44cfa commit 06e42eb

File tree

3 files changed

+46
-35
lines changed

3 files changed

+46
-35
lines changed

.github/workflows/deploy-site.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ jobs:
4242
cache: yarn
4343
cache-dependency-path: site/yarn.lock
4444

45+
- name: Install site dependencies
46+
run: cd site && yarn install
47+
4548
- name: Setup Pages
4649
uses: actions/configure-pages@v4
4750
with:

.github/workflows/test.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,21 @@ jobs:
2020
ruby-version: ".ruby-version"
2121
bundler-cache: true
2222

23-
- name: Setup Node.js (root)
23+
- name: Setup Node.js
2424
uses: actions/setup-node@v4
2525
with:
2626
node-version: 20
2727
cache: "yarn"
28-
cache-dependency-path: "yarn.lock"
29-
30-
- name: Setup Node.js (site)
31-
uses: actions/setup-node@v4
32-
with:
33-
node-version: 20
34-
cache: "yarn"
35-
cache-dependency-path: "site/yarn.lock"
28+
cache-dependency-path: |
29+
yarn.lock
30+
site/yarn.lock
3631
3732
- name: Install dependencies
3833
run: |
34+
# Install root and site yarn dependencies
35+
yarn install
36+
cd site && yarn install && cd ..
37+
3938
# Make sure bundler is using the correct Ruby version
4039
ruby -v
4140
@@ -183,6 +182,9 @@ jobs:
183182
cache: "yarn"
184183
cache-dependency-path: "site/yarn.lock"
185184

185+
- name: Install site dependencies
186+
run: cd site && yarn install
187+
186188
- name: Export TypeScript types
187189
run: |
188190
ruby scripts/export_typescript_types.rb

tasks/yard.rake

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
# frozen_string_literal: true
22

3-
require "yard"
4-
require "yard-sorbet"
5-
6-
YARD::Rake::YardocTask.new(:yard) do |t|
7-
t.files = ["lib/**/*.rb"]
8-
t.options = ["--no-private",
9-
"--protected",
10-
"--markup=markdown",
11-
"--markup-provider=redcarpet",
12-
"--readme=README.md",
13-
"--title=LogStruct YARD Documentation",
14-
"--output-dir=site/public/yard"]
15-
t.stats_options = ["--list-undoc"]
16-
end
17-
18-
desc "Generate YARD documentation and open in browser"
19-
task :'yard:open' => :yard do
20-
require "launchy"
21-
Launchy.open("site/public/yard/index.html")
3+
begin
4+
require "yard"
5+
require "yard-sorbet"
226
rescue LoadError
23-
puts "Install the 'launchy' gem to open docs automatically"
7+
# Yard not available (e.g. from bundle install --without development on CI)
248
end
259

26-
desc "Clean YARD documentation directory"
27-
task :'yard:clean' do
28-
FileUtils.rm_rf("site/public/yard")
29-
end
10+
if defined?(YARD::Rake::YardocTask)
11+
YARD::Rake::YardocTask.new(:yard) do |t|
12+
t.files = ["lib/**/*.rb"]
13+
t.options = ["--no-private",
14+
"--protected",
15+
"--markup=markdown",
16+
"--markup-provider=redcarpet",
17+
"--readme=README.md",
18+
"--title=LogStruct YARD Documentation",
19+
"--output-dir=site/public/yard"]
20+
t.stats_options = ["--list-undoc"]
21+
end
3022

31-
desc "Regenerate YARD documentation"
32-
task :'yard:regen' => [:'yard:clean', :yard]
23+
desc "Generate YARD documentation and open in browser"
24+
task "yard:open": :yard do
25+
require "launchy"
26+
Launchy.open("site/public/yard/index.html")
27+
rescue LoadError
28+
puts "Install the 'launchy' gem to open docs automatically"
29+
end
30+
31+
desc "Clean YARD documentation directory"
32+
task :"yard:clean" do
33+
FileUtils.rm_rf("site/public/yard")
34+
end
35+
36+
desc "Regenerate YARD documentation"
37+
task "yard:regen": [:"yard:clean", :yard]
38+
end

0 commit comments

Comments
 (0)