Skip to content

Commit 8d13a38

Browse files
committed
Ralph Wiggums
1 parent 898a296 commit 8d13a38

Some content is hidden

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

51 files changed

+6408
-3562
lines changed

.cursor/commands/prepare-npm.md

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +0,0 @@
1-
# Prepare MotelyJAML npm packages
2-
3-
**Canonical workflow:** [docs/BUILD_NPM_PACKAGES_WORKFLOW.md](../docs/BUILD_NPM_PACKAGES_WORKFLOW.md). Follow it exactly. Both motely-wasm and motely-node, same version, every time. No optional steps.
4-
5-
Goal: bump version if requested, build both packages (WASM + Node addon), then stop with publish-ready output. Do **not** publish unless the user explicitly asks.
6-
7-
**Rules (do not break):**
8-
- Do **not** add `main` or `exports` to `Motely.NodeAddon/package.json` — the SDK writes those during publish.
9-
- Do **not** create any hand-written loader JS files for motely-node.
10-
- Publish **both** RIDs for motely-node: win-x64 and linux-x64 (Vercel needs linux).
11-
12-
---
13-
14-
## Version (Phase A)
15-
16-
- **Single source:** `Directory.Packages.props``<MotelyVersion>`. Do not edit any package.json or jaml.schema.json by hand.
17-
- If user provides a version: set it in Directory.Packages.props only. No separate sync — `dotnet build`/`dotnet publish` runs `sync-version.mjs` automatically (Directory.Build.props).
18-
- If no version provided: read `<MotelyVersion>` from Directory.Packages.props, auto-increment patch (e.g. 3.14.2 → 3.14.3), set it in Directory.Packages.props only.
19-
- Print the version. The next dotnet publish in Phase B or C will sync both Motely.npm and Motely.NodeAddon package.json.
20-
21-
---
22-
23-
## Workflow (Phases B → C → D)
24-
25-
Execute in order. See [BUILD_NPM_PACKAGES_WORKFLOW.md](../docs/BUILD_NPM_PACKAGES_WORKFLOW.md) for full steps.
26-
27-
### Phase B: motely-wasm
28-
29-
- Remove `Motely.npm\_framework` if present.
30-
- `dotnet publish Motely.BrowserWasm/Motely.BrowserWasm.csproj -c Release` then `node stage-packages.mjs browser`.
31-
- `cd Motely.npm && npm install && npm run build`.
32-
33-
### Phase C: motely-node
34-
35-
- **win-x64:** `dotnet publish Motely.NodeAddon/Motely.NodeAddon.csproj -c Release -r win-x64`
36-
Confirm: `Motely.NodeAddon\bin\win-x64\Motely.NodeAddon.node` exists.
37-
- **linux-x64:** `.\build-linux.ps1` (Windows) or `./build-linux.sh` (Unix).
38-
Confirm: `Motely.NodeAddon\bin\linux-x64\Motely.NodeAddon.node` exists. Do not consider the package ready without the linux binary.
39-
- **Pack:** The SDK runs `npm pack` during publish (`PackNpmPackage`). After both RIDs, the final `.tgz` is in `Motely.NodeAddon\pkg`. Optionally run `cd Motely.NodeAddon && npm pack` to regenerate the tarball for inspection. Confirm the tarball contains both `bin/win-x64/` and `bin/linux-x64/` with `.node` files.
40-
41-
### Phase D
42-
43-
- If user asked to publish: `npm publish` in Motely.npm (motely-wasm) and in Motely.NodeAddon (motely-node). Then in JAMMY: `pnpm add motely-node@<V> motely-wasm@<V>` and `pnpm run build`.
44-
- If user did not ask: stop after pack and print the publish commands and JAMMY update command.
45-
46-
---
47-
48-
## Final output (when not publishing)
49-
50-
```text
51-
Both npm packages are ready. Version: <V>
52-
53-
1. Publish motely-wasm:
54-
cd <REPO_ROOT>\Motely.npm
55-
npm publish
56-
57-
2. Publish motely-node:
58-
cd <REPO_ROOT>\Motely.NodeAddon
59-
npm publish
60-
61-
3. Update JAMMY:
62-
pnpm add motely-node@<V> motely-wasm@<V>
63-
pnpm run build
64-
```
65-
66-
Use the actual repo root path (e.g. `X:\JammySeedFinder\src\MotelyJAML`). Then stop and wait for the user to confirm publish.

Directory.Build.targets

Lines changed: 0 additions & 2 deletions
This file was deleted.

Directory.Packages.props

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
<Project>
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4-
<MotelyVersion>3.15.27</MotelyVersion>
4+
<MotelyVersion>3.15.35</MotelyVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<!-- MinVer: auto-version from git tags -->
8-
<PackageVersion Include="MinVer" Version="6.0.0" />
9-
<!-- Node API for .NET addon: https://microsoft.github.io/node-api-dotnet/scenarios/js-dotnet-module.html (CPM requires fixed version) -->
107
<PackageVersion Include="Microsoft.JavaScript.NodeApi" Version="0.9.19" />
118
<PackageVersion Include="Microsoft.JavaScript.NodeApi.Generator" Version="0.9.19" />
129
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
13-
<PackageVersion Include="DuckDB.NET.Data.Full" Version="1.4.4" />
10+
<PackageVersion Include="DuckDB.NET.Data.Full" Version="1.5.0" />
1411
<PackageVersion Include="Terminal.Gui" Version="2.0.0-develop.5185" />
1512
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.3" />
1613
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.3" />

Dockerfile.alpine-aot

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Build static linux-x64 native AOT binary using Alpine + musl
2+
# Produces a fully static binary with NO glibc dependency - runs anywhere including Vercel
3+
4+
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
5+
6+
# Install native AOT build dependencies for Alpine
7+
RUN apk add --no-cache clang lld musl-dev zlib-static
8+
9+
WORKDIR /src
10+
11+
# Copy project files
12+
COPY Directory.Build.props Directory.Build.targets Directory.Packages.props ./
13+
COPY Motely/Motely.csproj Motely/
14+
COPY Motely.Orchestration/Motely.Orchestration.csproj Motely.Orchestration/
15+
COPY Motely.NodeAddon/Motely.NodeAddon.csproj Motely.NodeAddon/
16+
17+
# Restore
18+
RUN dotnet restore Motely.NodeAddon/Motely.NodeAddon.csproj -r linux-musl-x64
19+
20+
# Copy source
21+
COPY Motely/ Motely/
22+
COPY Motely.Orchestration/ Motely.Orchestration/
23+
COPY Motely.NodeAddon/ Motely.NodeAddon/
24+
25+
# Publish with static linking
26+
RUN dotnet publish Motely.NodeAddon/Motely.NodeAddon.csproj \
27+
-c Release \
28+
-r linux-musl-x64 \
29+
-o /out \
30+
-p:PublishAot=true \
31+
-p:StripSymbols=true \
32+
-p:InvariantGlobalization=true
33+
34+
# Output stage - just copy the .node file
35+
FROM scratch AS export
36+
COPY --from=build /out/*.node /
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
2+
<PropertyGroup>
3+
<TargetFramework>net10.0-browser</TargetFramework>
4+
<Version>$(MotelyVersion)</Version>
5+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
6+
<Nullable>enable</Nullable>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
9+
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
10+
<RunAOTCompilation>true</RunAOTCompilation>
11+
<PublishReadyToRun>false</PublishReadyToRun>
12+
13+
<!-- Single-thread: NO threading, NO SharedArrayBuffer -->
14+
<WasmBuildNative>true</WasmBuildNative>
15+
<WasmEnableThreads>false</WasmEnableThreads>
16+
<WasmEnableSIMD>true</WasmEnableSIMD>
17+
18+
<!-- Trimming & Optimization -->
19+
<PublishTrimmed>true</PublishTrimmed>
20+
<TrimMode>full</TrimMode>
21+
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
22+
23+
<!-- SIZE REDUCTION -->
24+
<WasmIncludeFullSymbols>false</WasmIncludeFullSymbols>
25+
<WasmDebugLevel>0</WasmDebugLevel>
26+
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
27+
<WasmEmitCompressedAssets>false</WasmEmitCompressedAssets>
28+
29+
<InvariantGlobalization>true</InvariantGlobalization>
30+
<WasmRunWasmOpt>true</WasmRunWasmOpt>
31+
</PropertyGroup>
32+
33+
<ItemGroup>
34+
<ProjectReference Include="..\Motely\Motely.csproj" />
35+
<ProjectReference Include="..\Motely.Orchestration\Motely.Orchestration.csproj" />
36+
</ItemGroup>
37+
</Project>

Motely.BrowserWasm/Motely.BrowserWasm.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<RunAOTCompilation>true</RunAOTCompilation>
1212
<PublishReadyToRun>false</PublishReadyToRun>
1313

14-
<!-- AOT & Naive Build -->
14+
<!-- AOT & Native Build -->
1515
<WasmBuildNative>true</WasmBuildNative>
1616
<!-- Pass -p:SingleThread=true to publish without threading (browsers without SharedArrayBuffer) -->
1717
<SingleThread Condition="'$(SingleThread)' == ''">false</SingleThread>
@@ -24,11 +24,10 @@
2424
<TrimMode>full</TrimMode>
2525
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
2626

27-
<!-- SIZE REDUCTION: Disable symbols, debug levels, and default compression -->
27+
<!-- SIZE REDUCTION -->
2828
<WasmIncludeFullSymbols>false</WasmIncludeFullSymbols>
2929
<WasmDebugLevel>0</WasmDebugLevel>
3030
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
31-
3231
<WasmEmitCompressedAssets>false</WasmEmitCompressedAssets>
3332

3433
<!-- Globalization: Search doesn't need ICU data (~2.5MB saved) -->
@@ -42,4 +41,4 @@
4241
<ProjectReference Include="..\Motely\Motely.csproj" />
4342
<ProjectReference Include="..\Motely.Orchestration\Motely.Orchestration.csproj" />
4443
</ItemGroup>
45-
</Project>
44+
</Project>

Motely.BrowserWasm/MotelyJAML.code-workspace

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)