Skip to content

Commit ccad4b5

Browse files
authored
Merge pull request #1 from rockthejvm/hkt
2 parents e6a41f0 + e3f5c29 commit ccad4b5

File tree

7 files changed

+166
-249
lines changed

7 files changed

+166
-249
lines changed

.DS_Store

-6 KB
Binary file not shown.

.github/workflows/publish-blog.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Publish Blog to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main, hkt ]
6+
paths:
7+
- 'src/main/resources/blog/**'
8+
- 'src/main/scala/blog/**'
9+
- '.github/workflows/publish-blog.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: true
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Setup JDK
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: 'temurin'
32+
java-version: '17'
33+
cache: 'sbt'
34+
35+
- name: Install SBT
36+
run: |
37+
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
38+
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
39+
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
40+
sudo apt-get update
41+
sudo apt-get install -y sbt
42+
43+
- name: Build blog with SBT
44+
run: sbt "runMain blog.BlogExpanded buildBlog"
45+
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v4
48+
49+
- name: Upload artifact
50+
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: './src/main/resources/blog_out_v2'
53+
54+
deploy:
55+
environment:
56+
name: github-pages
57+
url: ${{ steps.deployment.outputs.page_url }}
58+
runs-on: ubuntu-latest
59+
needs: build
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 14 additions & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -1,190 +1,19 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/scala,sbt,metals,intellij,java,maven
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=scala,sbt,metals,intellij,java,maven
1+
.idea
2+
.fleet
3+
.bloop
4+
.bsp
5+
.vscode
6+
.eclipse
7+
.metals
8+
.scala
39

4-
### Intellij ###
5-
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
6-
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
7-
8-
# User-specific stuff
9-
.idea/**/workspace.xml
10-
.idea/**/tasks.xml
11-
.idea/**/usage.statistics.xml
12-
.idea/**/dictionaries
13-
.idea/**/shelf
14-
15-
# AWS User-specific
16-
.idea/**/aws.xml
17-
18-
# Generated files
19-
.idea/**/contentModel.xml
20-
21-
# Sensitive or high-churn files
22-
.idea/**/dataSources/
23-
.idea/**/dataSources.ids
24-
.idea/**/dataSources.local.xml
25-
.idea/**/sqlDataSources.xml
26-
.idea/**/dynamic.xml
27-
.idea/**/uiDesigner.xml
28-
.idea/**/dbnavigator.xml
29-
30-
# Gradle
31-
.idea/**/gradle.xml
32-
.idea/**/libraries
33-
34-
# Gradle and Maven with auto-import
35-
# When using Gradle or Maven with auto-import, you should exclude module files,
36-
# since they will be recreated, and may cause churn. Uncomment if using
37-
# auto-import.
38-
# .idea/artifacts
39-
# .idea/compiler.xml
40-
# .idea/jarRepositories.xml
41-
# .idea/modules.xml
42-
# .idea/*.iml
43-
# .idea/modules
44-
# *.iml
45-
# *.ipr
46-
47-
# CMake
48-
cmake-build-*/
49-
50-
# Mongo Explorer plugin
51-
.idea/**/mongoSettings.xml
52-
53-
# File-based project format
54-
*.iws
55-
56-
# IntelliJ
57-
out/
58-
59-
# mpeltonen/sbt-idea plugin
60-
.idea_modules/
61-
62-
# JIRA plugin
63-
atlassian-ide-plugin.xml
64-
65-
# Cursive Clojure plugin
66-
.idea/replstate.xml
67-
68-
# SonarLint plugin
69-
.idea/sonarlint/
70-
71-
# Crashlytics plugin (for Android Studio and IntelliJ)
72-
com_crashlytics_export_strings.xml
73-
crashlytics.properties
74-
crashlytics-build.properties
75-
fabric.properties
76-
77-
# Editor-based Rest Client
78-
.idea/httpRequests
79-
80-
# Android studio 3.1+ serialized cache file
81-
.idea/caches/build_file_checksums.ser
82-
83-
### Intellij Patch ###
84-
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
85-
86-
# *.iml
87-
# modules.xml
88-
# .idea/misc.xml
89-
# *.ipr
90-
91-
# Sonarlint plugin
92-
# https://plugins.jetbrains.com/plugin/7973-sonarlint
93-
.idea/**/sonarlint/
94-
95-
# SonarQube Plugin
96-
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
97-
.idea/**/sonarIssues.xml
98-
99-
# Markdown Navigator plugin
100-
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
101-
.idea/**/markdown-navigator.xml
102-
.idea/**/markdown-navigator-enh.xml
103-
.idea/**/markdown-navigator/
104-
105-
# Cache file creation bug
106-
# See https://youtrack.jetbrains.com/issue/JBR-2257
107-
.idea/$CACHE_FILE$
108-
109-
# CodeStream plugin
110-
# https://plugins.jetbrains.com/plugin/12206-codestream
111-
.idea/codestream.xml
112-
113-
# Azure Toolkit for IntelliJ plugin
114-
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
115-
.idea/**/azureSettings.xml
10+
target/
11+
logs
11612

117-
### Java ###
118-
# Compiled class file
11913
*.class
120-
121-
# Log file
12214
*.log
15+
*.args
16+
*.iml
17+
metals.sbt
12318

124-
# BlueJ files
125-
*.ctxt
126-
127-
# Mobile Tools for Java (J2ME)
128-
.mtj.tmp/
129-
130-
# Package Files #
131-
*.jar
132-
*.war
133-
*.nar
134-
*.ear
135-
*.zip
136-
*.tar.gz
137-
*.rar
138-
139-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
140-
hs_err_pid*
141-
replay_pid*
142-
143-
### Maven ###
144-
target/
145-
pom.xml.tag
146-
pom.xml.releaseBackup
147-
pom.xml.versionsBackup
148-
pom.xml.next
149-
release.properties
150-
dependency-reduced-pom.xml
151-
buildNumber.properties
152-
.mvn/timing.properties
153-
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
154-
.mvn/wrapper/maven-wrapper.jar
155-
156-
# Eclipse m2e generated files
157-
# Eclipse Core
158-
.project
159-
# JDT-specific (Eclipse Java Development Tools)
160-
.classpath
161-
162-
### Metals ###
163-
.metals/
164-
.bloop/
165-
project/**/metals.sbt
166-
167-
### SBT ###
168-
# Simple Build Tool
169-
# http://www.scala-sbt.org/release/docs/Getting-Started/Directories.html#configuring-version-control
170-
171-
dist/*
172-
lib_managed/
173-
src_managed/
174-
project/boot/
175-
project/plugins/project/
176-
.history
177-
.cache
178-
.lib/
179-
180-
### SBT Patch ###
181-
.bsp/
182-
183-
### Scala ###
184-
185-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
186-
187-
# End of https://www.toptal.com/developers/gitignore/api/scala,sbt,metals,intellij,java,maven
188-
189-
*.jpg
190-
.idea/
19+
.DS_Store

.scalafmt.conf

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
version = "3.5.9"
2+
runner.dialect = scala3
23

3-
align.preset = more
44
maxColumn = 120
5-
runner.dialect = scala3
5+
project.git = true
6+
align.preset = more
7+
8+
align.tokens = [
9+
"=>", "->", "<-", ":=", "//", "%", "%%", "%%%", "+=",
10+
{
11+
"code" = "=",
12+
"owners" = [{ regex = ".*" }]
13+
},
14+
{
15+
"code" = ":",
16+
"owners" = [{ regex = ".*" }]
17+
},
18+
{
19+
"code" = "=>"
20+
"owners" = [{ regex = "(Importee.Rename|Case)" }]
21+
}
22+
]

build.sbt

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ version := "0.1"
55
scalaVersion := "3.3.4"
66

77
libraryDependencies ++= Seq(
8-
"com.lihaoyi" %% "requests" % "0.9.0",
9-
"com.lihaoyi" %% "upickle" % "4.1.0",
10-
"com.lihaoyi" %% "os-lib" % "0.11.4",
8+
"com.lihaoyi" %% "requests" % "0.9.0",
9+
"com.lihaoyi" %% "upickle" % "4.1.0",
10+
"com.lihaoyi" %% "os-lib" % "0.11.4",
1111
"com.lihaoyi" %% "scalatags" % "0.13.1",
12-
"com.lihaoyi" %% "cask" % "0.10.2",
12+
"com.lihaoyi" %% "cask" % "0.10.2",
1313
// Java libraries
1414
// scraping
1515
"org.jsoup" % "jsoup" % "1.19.1",
@@ -18,35 +18,34 @@ libraryDependencies ++= Seq(
1818
// http apis
1919
"org.asynchttpclient" % "async-http-client" % "3.0.2",
2020
// mandelbrot
21-
"org.openjfx" % "javafx-base" % "24.0.1",
21+
"org.openjfx" % "javafx-base" % "24.0.1",
2222
"org.openjfx" % "javafx-controls" % "24.0.1",
23-
"org.openjfx" % "javafx-fxml" % "24.0.1",
24-
"org.openjfx" % "javafx-swing" % "24.0.1",
25-
23+
"org.openjfx" % "javafx-fxml" % "24.0.1",
24+
"org.openjfx" % "javafx-swing" % "24.0.1"
2625
)
2726

2827
// blog build pipeline
2928

3029
// Custom tasks
3130
lazy val blogResourceDir = settingKey[File]("Directory containing blog resources")
32-
lazy val buildBlog = taskKey[Unit]("Build the blog")
33-
lazy val runBlog = taskKey[Unit]("Run the blog on a local server")
34-
lazy val watchBlog = taskKey[Unit]("Watch for changes and rebuild blog")
31+
lazy val buildBlog = taskKey[Unit]("Build the blog")
32+
lazy val runBlog = taskKey[Unit]("Run the blog on a local server")
33+
lazy val watchBlog = taskKey[Unit]("Watch for changes and rebuild blog")
3534

3635
// Set resource directory
3736
blogResourceDir := (Compile / resourceDirectory).value
3837

3938
// Build blog task
4039
buildBlog := {
41-
(Compile / runMain).toTask(" blog.Blog_V2 buildBlog").value
40+
(Compile / runMain).toTask(" blog.BlogExpanded buildBlog").value
4241
}
4342

4443
// Watch and reload task
4544
watchBlog := {
46-
val log = streams.value.log
45+
val log = streams.value.log
4746
val resourceDir = blogResourceDir.value
4847
val markdownDir = resourceDir / "blog"
49-
val state = Keys.state.value // Get the current state
48+
val state = Keys.state.value // Get the current state
5049

5150
log.info(s"Watching for changes in $markdownDir")
5251

@@ -72,4 +71,4 @@ runBlog := {
7271

7372
log.info("Starting blog server...")
7473
(Compile / runMain).toTask(" blog.RunServer").value
75-
}
74+
}

src/main/resources/.DS_Store

-6 KB
Binary file not shown.

0 commit comments

Comments
 (0)