Skip to content

Commit acceea0

Browse files
committed
st support
1 parent a7aebb9 commit acceea0

File tree

15 files changed

+140
-349
lines changed

15 files changed

+140
-349
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
<MotelyVersion>3.15.39</MotelyVersion>
4+
<MotelyVersion>3.20.0</MotelyVersion>
55
</PropertyGroup>
66
<ItemGroup>
77
<PackageVersion Include="Microsoft.JavaScript.NodeApi" Version="0.9.19" />

Motely.NodeAddon/jaml-schema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export const JAML_SCHEMA_VERSION = "3.15.38";
1+
export const JAML_SCHEMA_VERSION = "3.20.0";
22
export const jamlSchema = {
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"$id": "https://seedfinder.app/jaml.schema.json",
5-
"version": "3.15.38",
5+
"version": "3.20.0",
66
"title": "JAML - Jimbo\u0027s Ante Markup Language",
77
"description": "Schema for Balatro seed filter configuration files (.jaml)",
88
"type": "object",

Motely.NodeAddon/jaml.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://seedfinder.app/jaml.schema.json",
4-
"version": "3.15.38",
4+
"version": "3.20.0",
55
"title": "JAML - Jimbo\u0027s Ante Markup Language",
66
"description": "Schema for Balatro seed filter configuration files (.jaml)",
77
"type": "object",

build-and-pack.ps1

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#!/usr/bin/env pwsh
2+
# Build and pack motely-wasm and motely-node packages
3+
# Version is controlled by Directory.Packages.props
4+
5+
$ErrorActionPreference = "Stop"
6+
7+
Write-Host "=== MOTELY BUILD AND PACK ===" -ForegroundColor Cyan
8+
9+
# Get version
10+
$propsPath = "Directory.Packages.props"
11+
if (-not (Test-Path $propsPath)) {
12+
throw "Directory.Packages.props not found"
13+
}
14+
15+
$propsContent = Get-Content $propsPath -Raw
16+
if ($propsContent -match '<MotelyVersion>([^<]+)</MotelyVersion>') {
17+
$version = $matches[1].Trim()
18+
Write-Host "Version: $version" -ForegroundColor Green
19+
} else {
20+
throw "Could not find MotelyVersion in Directory.Packages.props"
21+
}
22+
23+
# Phase B: motely-wasm
24+
Write-Host "`n=== Phase B: motely-wasm ===" -ForegroundColor Cyan
25+
26+
# Clean old framework folders
27+
Write-Host "Cleaning old _framework folders..." -ForegroundColor Yellow
28+
if (Test-Path "motely-wasm\_framework") { Remove-Item "motely-wasm\_framework" -Recurse -Force }
29+
if (Test-Path "motely-wasm\_framework_st") { Remove-Item "motely-wasm\_framework_st" -Recurse -Force }
30+
31+
# Build single-thread WASM
32+
Write-Host "Building single-thread WASM..." -ForegroundColor Yellow
33+
dotnet clean Motely.BrowserWasm/Motely.BrowserWasm.csproj -c Release
34+
dotnet publish Motely.BrowserWasm/Motely.BrowserWasm.csproj -c Release -p:SingleThread=true
35+
if ($LASTEXITCODE -ne 0) { throw "Single-thread WASM build failed" }
36+
37+
# Stage single-thread
38+
Write-Host "Staging single-thread framework..." -ForegroundColor Yellow
39+
node stage-packages.mjs browser
40+
if ($LASTEXITCODE -ne 0) { throw "Stage single-thread failed" }
41+
42+
# Rename to _framework_st
43+
if (Test-Path "motely-wasm\_framework") {
44+
Move-Item "motely-wasm\_framework" "motely-wasm\_framework_st"
45+
}
46+
47+
# Build multi-thread WASM (skip if YamlDotNet atomics error)
48+
Write-Host "Building multi-thread WASM..." -ForegroundColor Yellow
49+
dotnet clean Motely.BrowserWasm/Motely.BrowserWasm.csproj -c Release
50+
$multiThreadSuccess = $true
51+
try {
52+
dotnet publish Motely.BrowserWasm/Motely.BrowserWasm.csproj -c Release
53+
if ($LASTEXITCODE -ne 0) {
54+
Write-Host "Multi-thread build failed (YamlDotNet atomics issue), using single-thread only" -ForegroundColor Yellow
55+
$multiThreadSuccess = $false
56+
} else {
57+
node stage-packages.mjs browser
58+
if ($LASTEXITCODE -ne 0) { throw "Stage multi-thread failed" }
59+
}
60+
} catch {
61+
Write-Host "Multi-thread build failed: $_" -ForegroundColor Yellow
62+
$multiThreadSuccess = $false
63+
}
64+
65+
# If multi-thread failed, copy single-thread to _framework
66+
if (-not $multiThreadSuccess) {
67+
Write-Host "Copying single-thread to _framework (fallback)..." -ForegroundColor Yellow
68+
Copy-Item "motely-wasm\_framework_st" "motely-wasm\_framework" -Recurse
69+
}
70+
71+
# Build motely-wasm package
72+
Write-Host "Building motely-wasm package..." -ForegroundColor Yellow
73+
Push-Location motely-wasm
74+
npm install
75+
npm run build
76+
if ($LASTEXITCODE -ne 0) { throw "motely-wasm build failed" }
77+
78+
# Pack motely-wasm
79+
Write-Host "Packing motely-wasm..." -ForegroundColor Yellow
80+
npm pack
81+
if ($LASTEXITCODE -ne 0) { throw "motely-wasm pack failed" }
82+
Pop-Location
83+
84+
Write-Host "✓ motely-wasm-$version.tgz ready" -ForegroundColor Green
85+
86+
# Phase C: motely-node
87+
Write-Host "`n=== Phase C: motely-node ===" -ForegroundColor Cyan
88+
89+
# Build linux-x64 addon
90+
Write-Host "Building linux-x64 addon via Docker..." -ForegroundColor Yellow
91+
.\build-linux.ps1
92+
if ($LASTEXITCODE -ne 0) { throw "Linux build failed" }
93+
94+
# Verify binary exists
95+
$nodeBinary = "motely-node\bin\linux-x64\Motely.NodeAddon.node"
96+
if (-not (Test-Path $nodeBinary)) {
97+
throw "Linux binary not found: $nodeBinary"
98+
}
99+
Write-Host "✓ Linux binary exists: $nodeBinary" -ForegroundColor Green
100+
101+
# Copy jaml-schema files
102+
Write-Host "Copying jaml-schema files..." -ForegroundColor Yellow
103+
Copy-Item "motely-wasm\jaml-schema.js" "motely-node\" -Force
104+
Copy-Item "motely-wasm\jaml-schema.d.ts" "motely-node\" -Force
105+
Copy-Item "motely-wasm\jaml.schema.json" "motely-node\" -Force
106+
107+
# Pack motely-node
108+
Write-Host "Packing motely-node..." -ForegroundColor Yellow
109+
Push-Location motely-node
110+
npm pack
111+
if ($LASTEXITCODE -ne 0) { throw "motely-node pack failed" }
112+
Pop-Location
113+
114+
Write-Host "✓ motely-node-$version.tgz ready" -ForegroundColor Green
115+
116+
# Summary
117+
Write-Host "`n=== BUILD COMPLETE ===" -ForegroundColor Cyan
118+
Write-Host "Version: $version" -ForegroundColor Green
119+
Write-Host "Packages ready:" -ForegroundColor Green
120+
Write-Host " - motely-wasm\motely-wasm-$version.tgz" -ForegroundColor White
121+
Write-Host " - motely-node\motely-node-$version.tgz" -ForegroundColor White
122+
Write-Host "`nTo publish:" -ForegroundColor Yellow
123+
Write-Host " cd motely-wasm && npm publish motely-wasm-$version.tgz --access public" -ForegroundColor White
124+
Write-Host " cd motely-node && npm publish motely-node-$version.tgz --access public" -ForegroundColor White
125+
Write-Host "`nTo update JAMMY:" -ForegroundColor Yellow
126+
Write-Host " cd x:\JAMMY && pnpm add motely-wasm@$version motely-node@$version" -ForegroundColor White

jaml.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://seedfinder.app/jaml.schema.json",
4-
"version": "3.15.38",
4+
"version": "3.20.0",
55
"title": "JAML - Jimbo\u0027s Ante Markup Language",
66
"description": "Schema for Balatro seed filter configuration files (.jaml)",
77
"type": "object",

motely-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "motely-node",
3-
"version": "3.15.39",
3+
"version": "3.20.0",
44
"description": "MotelyJAML for Node.js - Balatro seed analyzer and JAML filter engine using .NET 10 Native AOT",
55
"main": "index.cjs",
66
"types": "./index.d.ts",

motely-wasm/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
function resolveFrameworkUrl(baseUrl, frameworkFolder) {
55
if (baseUrl) {
66
const base = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
7-
return frameworkFolder === "_framework_st" ? base + "-st" : base;
7+
return frameworkFolder === "_framework_st" ? `${base}-st` : `${base}/${frameworkFolder}`;
88
}
99
return new URL(`./${frameworkFolder}/dotnet.js`, import.meta.url).href.replace(/\/dotnet\.js$/, "");
1010
}

motely-wasm/jaml-schema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
export const JAML_SCHEMA_VERSION = "3.15.38";
1+
export const JAML_SCHEMA_VERSION = "3.20.0";
22
export const jamlSchema = {
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"$id": "https://seedfinder.app/jaml.schema.json",
5-
"version": "3.15.38",
5+
"version": "3.20.0",
66
"title": "JAML - Jimbo\u0027s Ante Markup Language",
77
"description": "Schema for Balatro seed filter configuration files (.jaml)",
88
"type": "object",

motely-wasm/jaml.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://seedfinder.app/jaml.schema.json",
4-
"version": "3.15.38",
4+
"version": "3.20.0",
55
"title": "JAML - Jimbo\u0027s Ante Markup Language",
66
"description": "Schema for Balatro seed filter configuration files (.jaml)",
77
"type": "object",

motely-wasm/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)