Skip to content

Commit d1e516a

Browse files
committed
Modernize tooling: highlight.js v11, package.json, CI workflows
* Update highlight.js from ancient pre-2015 to v11.11.1 * Add package.json to pin esbuild, highlight.js, and typescript versions * Split CI: test.yml (Ruby), typecheck.yml (TypeScript), gem_push.yml (RubyGems) * Add npm ecosystem to dependabot.yml * Remove legacy fix_permissions rake task
1 parent e339879 commit d1e516a

14 files changed

Lines changed: 757 additions & 277 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,14 @@ updates:
1717
update-types:
1818
- minor
1919
- patch
20+
- package-ecosystem: npm
21+
directory: /
22+
schedule:
23+
interval: daily
24+
cooldown:
25+
default-days: 7
26+
groups:
27+
minor-and-patch:
28+
update-types:
29+
- minor
30+
- patch

.github/workflows/gem_push.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Push gem to RubyGems
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
push:
13+
if: github.repository == 'simplecov-ruby/simplecov-html'
14+
runs-on: ubuntu-latest
15+
environment:
16+
name: rubygems.org
17+
url: https://rubygems.org/gems/simplecov-html
18+
permissions:
19+
contents: write
20+
id-token: write
21+
steps:
22+
- uses: actions/checkout@v6
23+
- uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ruby
26+
bundler-cache: true
27+
- uses: rubygems/configure-rubygems-credentials@v1.0.0
28+
- name: Update RubyGems
29+
run: gem update --system
30+
- name: Build gem
31+
run: bundle exec rake build
32+
- name: Sign gem with Sigstore
33+
run: gem exec sigstore-cli sign pkg/*.gem --bundle pkg/simplecov-html.gem.sigstore.json
34+
- name: Push gem
35+
run: gem push pkg/*.gem --attestation pkg/simplecov-html.gem.sigstore.json
36+
- name: Wait for release
37+
run: gem exec rubygems-await pkg/*.gem

.github/workflows/typecheck.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: typecheck
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
typecheck:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v6
10+
11+
- uses: actions/setup-node@v4
12+
with:
13+
node-version: '22'
14+
15+
- run: npm install
16+
17+
- run: npm run typecheck

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ tmtags
2020
## RUBYMINE
2121
.idea
2222

23+
## NODE
24+
node_modules
25+
2326
## PROJECT::GENERAL
2427
coverage
2528
rdoc

Rakefile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
require "bundler"
44
Bundler::GemHelper.install_tasks
55

6-
# See https://github.com/simplecov-ruby/simplecov/issues/171
7-
desc "Set permissions on all files so they are compatible with both user-local and system-wide installs"
8-
task :fix_permissions do
9-
system 'bash -c "find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;"'
10-
end
11-
# Enforce proper permissions on each build
12-
Rake::Task[:build].prerequisites.unshift :fix_permissions
13-
146
require "rake/testtask"
157
Rake::TestTask.new(:test) do |test|
168
test.libs << "lib" << "test"
@@ -34,10 +26,8 @@ namespace :assets do
3426
task :compile do
3527
puts "Compiling assets"
3628

37-
# JS: esbuild compiles TypeScript directly, then we concatenate with highlight.js and minify
38-
sh "esbuild src/app.ts --bundle --minify --target=es2015 " \
39-
"--banner:js=\"$(cat assets/javascripts/plugins/highlight.pack.js)\" " \
40-
"--outfile=public/application.js"
29+
# JS: esbuild bundles TypeScript + highlight.js and minifies
30+
sh "esbuild src/app.ts --bundle --minify --target=es2015 --outfile=public/application.js"
4131

4232
# CSS: concatenate in order and minify
4333
css = %w[

assets/javascripts/plugins/highlight.pack.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)