Skip to content

Commit d108814

Browse files
authored
0.1.6 Release
2 parents 9668b61 + 3553c65 commit d108814

293 files changed

Lines changed: 43668 additions & 2907 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release-matrix.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ jobs:
4949
steps:
5050
- name: Checkout
5151
uses: actions/checkout@v4
52+
with:
53+
submodules: recursive
5254

5355
- name: Set Up Java
5456
uses: actions/setup-java@v4
@@ -188,26 +190,25 @@ jobs:
188190
python -m pip install --upgrade aqtinstall
189191
190192
$qtHost = "windows"
191-
$archOutput = python -m aqt list-qt $qtHost desktop --arch $env:QT_VERSION
192-
$archs = $archOutput -split '\s+' | Where-Object { $_ -ne '' }
193+
$archOutput = & python -m aqt list-qt $qtHost desktop --arch $env:QT_VERSION 2>&1
194+
if ($LASTEXITCODE -ne 0) { throw "list-qt --arch failed" }
195+
$archs = ($archOutput -join " ") -split '\s+' | Where-Object { $_ -ne '' }
193196
194197
$qtArch = $archs | Where-Object { $_ -match 'msvc' -and $_ -match '64' } | Select-Object -First 1
195-
if (-not $qtArch) {
196-
$qtArch = $archs | Where-Object { $_ -match '64' } | Select-Object -First 1
197-
}
198+
if (-not $qtArch) { $qtArch = $archs | Where-Object { $_ -match '64' } | Select-Object -First 1 }
199+
if (-not $qtArch) { throw "Unable to resolve Qt architecture. Available: $($archs -join ', ')" }
198200
$qtPlatform = "windows-x64"
199201
200-
if (-not $qtArch) {
201-
throw "Unable to resolve Qt architecture for windows/x64. Available: $($archs -join ', ')"
202-
}
203-
204-
$modulesOutput = python -m aqt list-qt $qtHost desktop --modules $env:QT_VERSION $qtArch
202+
$modulesOutput = & python -m aqt list-qt $qtHost desktop --modules $env:QT_VERSION $qtArch 2>&1
203+
if ($LASTEXITCODE -ne 0) { throw "list-qt --modules failed" }
205204
if ($modulesOutput -match '\bqtsvg\b') {
206205
Write-Host "Installing Qt with optional module qtsvg"
207-
python -m aqt install-qt $qtHost desktop $env:QT_VERSION $qtArch -m qtsvg -O "$PWD\\.qt"
206+
& python -m aqt install-qt $qtHost desktop $env:QT_VERSION $qtArch -m qtsvg -O "$PWD\\.qt"
207+
if ($LASTEXITCODE -ne 0) { throw "install-qt (with qtsvg) failed" }
208208
} else {
209-
Write-Host "qtsvg module not available for $qtHost/$qtArch on Qt $env:QT_VERSION; installing base Qt only"
210-
python -m aqt install-qt $qtHost desktop $env:QT_VERSION $qtArch -O "$PWD\\.qt"
209+
Write-Host "qtsvg module not available; installing base Qt only"
210+
& python -m aqt install-qt $qtHost desktop $env:QT_VERSION $qtArch -O "$PWD\\.qt"
211+
if ($LASTEXITCODE -ne 0) { throw "install-qt failed" }
211212
}
212213
213214
$qtRoot = "$PWD\\.qt\\$env:QT_VERSION"
@@ -495,7 +496,7 @@ jobs:
495496
permissions:
496497
contents: write
497498
needs: build
498-
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
499+
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch'))
499500
steps:
500501
- name: Checkout
501502
uses: actions/checkout@v4
@@ -560,7 +561,7 @@ jobs:
560561
needs: release
561562
permissions:
562563
contents: read
563-
if: needs.release.result == 'success' && github.event_name != 'pull_request' && !(github.event_name == 'workflow_dispatch' && github.event.inputs.prerelease == 'true')
564+
if: needs.release.result == 'success' && github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') && !(github.event_name == 'workflow_dispatch' && github.event.inputs.prerelease == 'true')
564565
steps:
565566
- name: Checkout
566567
uses: actions/checkout@v4
@@ -668,7 +669,7 @@ jobs:
668669
needs: release
669670
permissions:
670671
contents: read
671-
if: needs.release.result == 'success' && github.event_name != 'pull_request' && !(github.event_name == 'workflow_dispatch' && github.event.inputs.prerelease == 'true')
672+
if: needs.release.result == 'success' && github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') && !(github.event_name == 'workflow_dispatch' && github.event.inputs.prerelease == 'true')
672673
steps:
673674
- name: Download wingetcreate
674675
shell: pwsh

.gitignore

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ build/
55
!**/src/test/**/build/
66

77
### IntelliJ IDEA ###
8-
.idea/modules.xml
9-
.idea/jarRepositories.xml
10-
.idea/compiler.xml
11-
.idea/libraries/
8+
.idea/
129
*.iws
1310
*.iml
1411
*.ipr
@@ -47,4 +44,12 @@ bin/
4744
local.properties
4845

4946
src/main/resources/icons
50-
AppDir
47+
AppDir
48+
tools/registry-builder/target/
49+
CMakeCache.txt
50+
CMakeFiles/
51+
Makefile
52+
cmake_install.cmake
53+
/CompanionMod/
54+
hs_err_pid*.log
55+
/.architectury-transformer/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tree-sitter-javascript"]
2+
path = tree-sitter-javascript
3+
url = https://github.com/tree-sitter/tree-sitter-javascript.git

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## 0.1.6
2+
3+
---
4+
### New
5+
* Added an Animated Scrolling effect (**Experimental**, disabled by default).
6+
* Added a Keymap system.
7+
* Added a Rust utility which generates the Item database used by the Item Browser, and sets up KubeJS Typings.
8+
* Added Code Completion (JS only for now).
9+
* Added a Mod Config Editor Pane, which supports editing the following config types:
10+
* TOML
11+
* JSON, JSONC, JSON5
12+
* Properties
13+
* Yaml
14+
* Forge CFG
15+
* Added a Mod Browser Pane, currently supporting Modrinth. Curseforge implementation is on its way.
16+
* Added an Item Browser dock panel.
17+
* Added a ModPack detail dock panel.
18+
* Added a context menu for Project Files.
19+
* Added Project Files View Modes.
20+
* Added custom Tooltip backgrounds (**Experimental**, disabled by default).
21+
* KubeJS Extension. Provides Code Completion with dumped Typings, using FlatBuffers, with a Database as backup.
22+
* Added Seasonal Events.
23+
* Added ability to set a background image for the Project view.
24+
* Added Auto-save.
25+
* Added Rainbow Brackets (**Experimental**, disabled by default).
26+
* Added Extensions panel to Dashboard.
27+
28+
### Gradle
29+
* Added Tree-Sitter.
30+
* Added extra Serialization libs for Mod Config parsing.
31+
* Added some args to improve performance.
32+
33+
### Companion Mod
34+
* Improved WebSocket connections.
35+
* Added KubeJS Typings support.
36+
* Added an Item renderer which then dumps for use in Tritium's Item Browser.
37+
38+
### Other
39+
* General cleanup.
40+
* Settings View opens faster.
41+
* Listeners use Kotlin flows instead of array lists.
42+
* Added better logging handling for Qt runtime warnings.
43+
* Hopefully probably maybe possibly potentially fixed Icons DPR and scaling issues.
44+
* Fixed window state geometry getting corrupted to oblivion due to band affiliation.
45+
* LSPs work now, with support for JSON, XML and Python (needs some work on the installation / providing part).

build.gradle.kts

Lines changed: 132 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@ plugins {
77
alias(libs.plugins.kotlin)
88
alias(libs.plugins.serialization)
99
alias(libs.plugins.ksp)
10+
alias(libs.plugins.ktreesitter)
1011
idea
11-
id("com.github.johnrengelman.shadow") version "8.1.1"
12+
id("com.gradleup.shadow") version "9.2.0"
1213
}
1314

1415
ksp { arg("verbose", "true") }
1516

17+
val grammarDir = layout.projectDirectory.dir("tree-sitter-javascript").asFile
18+
19+
grammar {
20+
grammarName.set("javascript")
21+
baseDir.set(grammarDir)
22+
className.set("TreeSitterJavascript")
23+
packageName.set("io.github.tritium_launcher.launcher.ui.project.editor.treesitter.grammar")
24+
}
25+
1626
group = "io.github.tritium_launcher.launcher"
17-
version = "0.1.5"
27+
version = "0.1.6"
1828
val tritiumVersion = project.version.toString()
1929

2030
val os: OperatingSystem = OperatingSystem.current()
@@ -27,6 +37,8 @@ val qtOs = when {
2737
else -> "unknown"
2838
}
2939

40+
dependencyLocking { lockAllConfigurations() }
41+
3042
repositories {
3143
mavenCentral()
3244
}
@@ -45,9 +57,17 @@ configurations.configureEach {
4557
}
4658

4759
dependencies {
48-
// Kotlin
60+
// Serialization
4961
implementation(libs.kotlinx.serialization.json)
5062
implementation(libs.kotlinx.serialization.hocon)
63+
implementation(libs.kotlinx.serialization.properties)
64+
implementation(libs.kotlin.json5)
65+
implementation(libs.ktoml.core)
66+
implementation(libs.ktoml.file)
67+
implementation(libs.yamlkt)
68+
implementation(libs.knbt)
69+
70+
// Coroutines
5171
implementation(libs.kotlinx.coroutines.core)
5272

5373
// KSP
@@ -82,10 +102,10 @@ dependencies {
82102

83103
// MSAL4j
84104
implementation(libs.msal4j)
105+
implementation(libs.jultoslf4j)
85106

86107
// Logback
87108
implementation(libs.logback.classic)
88-
implementation(libs.kotlin.reflect)
89109

90110
// LSP
91111
implementation(libs.lsp4j)
@@ -94,11 +114,88 @@ dependencies {
94114
implementation(libs.jna)
95115
implementation(libs.jna.platform)
96116

117+
// CommonMark
118+
implementation(libs.commonmark)
119+
implementation(libs.commonmark.ext.gfm.tables)
120+
implementation(libs.commonmark.ext.gfm.strikethrough)
121+
implementation(libs.commonmark.ext.task.list.items)
122+
implementation(libs.commonmark.ext.image.attributes)
123+
implementation(libs.sqlite.jdbc)
124+
implementation(libs.flatbuffers)
125+
126+
// Kotlin
127+
implementation(libs.kotlin.reflect)
128+
129+
// KTreeSitter
130+
implementation(libs.ktreesitter)
131+
97132
/* Test */
98133

99134
testImplementation(libs.bundles.test)
100135
}
101136

137+
val nativeLibDir = layout.buildDirectory.dir("native/grammar")
138+
val generatedGrammarDir = layout.buildDirectory.dir("generated")
139+
val grammarCmakeLists = generatedGrammarDir.map { it.file("CMakeLists.txt") }
140+
val grammarSourceDir = layout.projectDirectory.dir("tree-sitter-javascript/src")
141+
val nativeGrammarLibName: String = when {
142+
os.isWindows -> "ktreesitter-javascript.dll"
143+
os.isMacOsX -> "libktreesitter-javascript.dylib"
144+
else -> "libktreesitter-javascript.so"
145+
}
146+
147+
val patchCmakeLists by tasks.registering {
148+
description = "Fix CMakeLists.txt include path for tree-sitter header"
149+
dependsOn(tasks.named("generateGrammarFiles"))
150+
inputs.file(grammarCmakeLists)
151+
outputs.file(grammarCmakeLists)
152+
doLast {
153+
val cmakeFile = grammarCmakeLists.get().asFile
154+
val content = cmakeFile.readText().replace('\\', '/')
155+
val fixed = content.replace(
156+
"../../tree-sitter-javascript/bindings/c",
157+
"../../tree-sitter-javascript/bindings/c ../../tree-sitter-javascript/bindings/c/tree_sitter"
158+
)
159+
if (fixed != content) {
160+
cmakeFile.writeText(fixed)
161+
}
162+
}
163+
}
164+
165+
val compileGrammarNative by tasks.registering {
166+
description = "Compile tree-sitter JavaScript grammar via CMake"
167+
dependsOn(tasks.named("generateGrammarFiles"), patchCmakeLists)
168+
val cmakeBuildDir = nativeLibDir.get().asFile
169+
val srcDir = generatedGrammarDir.get().asFile
170+
inputs.dir(grammarSourceDir).optional()
171+
inputs.dir(srcDir.resolve("src/jni"))
172+
inputs.file(srcDir.resolve("CMakeLists.txt"))
173+
outputs.file(cmakeBuildDir.resolve(nativeGrammarLibName))
174+
onlyIf {
175+
grammarSourceDir.asFile.exists()
176+
}
177+
doLast {
178+
cmakeBuildDir.mkdirs()
179+
val javaHome = System.getProperty("java.home")
180+
val cmakeEnv = mapOf("JAVA_HOME" to javaHome)
181+
val configure = ProcessBuilder("cmake", srcDir.path, "-DCMAKE_BUILD_TYPE=Release")
182+
.directory(cmakeBuildDir)
183+
.inheritIO()
184+
.apply { environment().putAll(cmakeEnv) }
185+
.start()
186+
if (configure.waitFor() != 0) {
187+
throw GradleException("cmake configuration failed for tree-sitter-javascript grammar")
188+
}
189+
val build = ProcessBuilder("cmake", "--build", ".", "--target", "ktreesitter-javascript", "--parallel")
190+
.directory(cmakeBuildDir)
191+
.inheritIO()
192+
.start()
193+
if (build.waitFor() != 0) {
194+
throw GradleException("cmake build failed for tree-sitter-javascript grammar")
195+
}
196+
}
197+
}
198+
102199
sourceSets["main"].java.srcDirs("src/main/kotlin")
103200

104201
idea {
@@ -113,10 +210,29 @@ tasks.test {
113210
}
114211

115212
tasks.processResources {
213+
dependsOn(compileGrammarNative)
214+
215+
val nativeSubdir = when {
216+
os.isWindows -> if (isArm64) "windows/arm64" else "windows/x64"
217+
os.isMacOsX -> if (isArm64) "macos/arm64" else "macos/x64"
218+
else -> if (isArm64) "linux/arm64" else "linux/x64"
219+
}
220+
221+
doFirst {
222+
val libFile = nativeLibDir.get().file(nativeGrammarLibName).asFile
223+
if (!libFile.exists()) {
224+
logger.warn("Native grammar library not found at ${libFile}; JS syntax highlighting disabled")
225+
}
226+
}
227+
116228
inputs.property("version", tritiumVersion)
117229
filesMatching("version.txt") {
118230
expand("version" to tritiumVersion)
119231
}
232+
233+
from(nativeLibDir.map { it.file(nativeGrammarLibName) }) {
234+
into("lib/$nativeSubdir")
235+
}
120236
}
121237

122238
tasks.jar {
@@ -154,7 +270,17 @@ val preparePackageInput by tasks.registering(Sync::class) {
154270
val compileKotlin: KotlinCompile by tasks
155271
compileKotlin.apply {
156272
compilerOptions {
157-
freeCompilerArgs.set(listOf("-Xcontext-parameters"))
158-
allWarningsAsErrors = true
273+
incremental = true
274+
freeCompilerArgs.set(listOf("-Xcontext-parameters", "-progressive"))
159275
}
160276
}
277+
278+
val compileJava: JavaCompile by tasks
279+
compileJava.apply {
280+
options.isIncremental = true
281+
}
282+
283+
tasks.clean {
284+
delete(nativeLibDir)
285+
delete(generatedGrammarDir)
286+
}

gradle.properties

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
kotlin.code.style=official
2-
kotlin.incremental=true
1+
org.gradle.jvmargs=-Xmx4g -Xms512m \
2+
-XX:+UseG1GC \
3+
-XX:SoftRefLRUPolicyMSPerMB=50 \
4+
-XX:+HeapDumpOnOutOfMemoryError \
5+
-XX:+OptimizeStringConcat \
6+
-XX:ReservedCodeCacheSize=512m \
7+
-Dfile.encoding=UTF-8
8+
9+
10+
org.gradle.parallel=true
311
org.gradle.caching=true
412
org.gradle.daemon=true
5-
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m
6-
org.gradle.parallel=true
7-
org.gradle.workers.max=6
8-
org.gradle.vfs.watch=true
9-
ksp.incremental=false
13+
14+
kotlin.code.style=official
15+
kotlin.incremental=true
16+
kotlin.build.report.output=file
17+
ksp.incremental=true

0 commit comments

Comments
 (0)