Skip to content

Commit b02dd06

Browse files
authored
Merge pull request #58 from TrueNine/dev
Dev
2 parents 8c9adf0 + 55b8a59 commit b02dd06

298 files changed

Lines changed: 6638 additions & 25285 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/actions/setup-tauri/action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ runs:
1818
shell: bash
1919
run: |
2020
sudo apt-get update
21-
sudo apt-get install -y \
21+
sudo apt-get install -y --no-install-recommends \
22+
libgtk-3-dev \
23+
libglib2.0-dev \
24+
pkg-config \
2225
libwebkit2gtk-4.1-dev \
2326
libappindicator3-dev \
2427
librsvg2-dev \
@@ -48,7 +51,7 @@ runs:
4851
restore-keys: |
4952
${{ runner.os }}-cargo-
5053
51-
- name: Sync Tauri version from CLI
54+
- name: Sync Tauri version
5255
shell: bash
5356
run: |
5457
version="${{ inputs.version }}"
@@ -63,4 +66,7 @@ runs:
6366

6467
- name: Clean old bundle artifacts
6568
shell: bash
66-
run: rm -rf gui/src-tauri/target/**/bundle
69+
run: |
70+
if [ -d "gui/src-tauri/target" ]; then
71+
find gui/src-tauri/target -type d -name bundle -prune -exec rm -rf {} +
72+
fi

.github/workflows/build-gui-all.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,40 @@ jobs:
1818
include:
1919
- os: windows-latest
2020
platform: windows
21+
rust-targets: ''
22+
tauri-command: pnpm tauri build
2123
- os: ubuntu-24.04
2224
platform: linux
25+
rust-targets: ''
26+
tauri-command: pnpm tauri build
2327
- os: macos-14
2428
platform: macos
29+
rust-targets: aarch64-apple-darwin,x86_64-apple-darwin
30+
tauri-command: pnpm tauri build --target universal-apple-darwin
2531
runs-on: ${{ matrix.os }}
2632
steps:
2733
- uses: actions/checkout@v4
2834
- uses: ./.github/actions/setup-node-pnpm
2935
- uses: ./.github/actions/setup-tauri
3036
with:
37+
rust-targets: ${{ matrix.rust-targets }}
3138
version: ${{ inputs.version }}
3239

3340
- name: Build GUI
3441
working-directory: ./gui
3542
env:
3643
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
3744
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
38-
run: pnpm tauri build
45+
run: ${{ matrix.tauri-command }}
3946

4047
- name: Upload Windows artifacts
4148
if: matrix.platform == 'windows'
4249
uses: actions/upload-artifact@v4
4350
with:
4451
name: gui-${{ matrix.os }}
4552
path: |
46-
target/*/release/bundle/**/*.exe
47-
target/release/bundle/**/*.exe
53+
gui/src-tauri/target/*/release/bundle/**/*.exe
54+
gui/src-tauri/target/release/bundle/**/*.exe
4855
if-no-files-found: error
4956

5057
- name: Upload Linux artifacts
@@ -53,12 +60,12 @@ jobs:
5360
with:
5461
name: gui-${{ matrix.os }}
5562
path: |
56-
target/*/release/bundle/**/*.AppImage
57-
target/*/release/bundle/**/*.deb
58-
target/*/release/bundle/**/*.rpm
59-
target/release/bundle/**/*.AppImage
60-
target/release/bundle/**/*.deb
61-
target/release/bundle/**/*.rpm
63+
gui/src-tauri/target/*/release/bundle/**/*.AppImage
64+
gui/src-tauri/target/*/release/bundle/**/*.deb
65+
gui/src-tauri/target/*/release/bundle/**/*.rpm
66+
gui/src-tauri/target/release/bundle/**/*.AppImage
67+
gui/src-tauri/target/release/bundle/**/*.deb
68+
gui/src-tauri/target/release/bundle/**/*.rpm
6269
if-no-files-found: error
6370

6471
- name: Upload macOS artifacts
@@ -67,6 +74,6 @@ jobs:
6774
with:
6875
name: gui-${{ matrix.os }}
6976
path: |
70-
target/*/release/bundle/**/*.dmg
71-
target/release/bundle/**/*.dmg
77+
gui/src-tauri/target/*/release/bundle/**/*.dmg
78+
gui/src-tauri/target/release/bundle/**/*.dmg
7279
if-no-files-found: error

.github/workflows/pull-request.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
branches:
66
- main
7-
types: [opened, synchronize, reopened, closed]
7+
types: [opened, synchronize, reopened, ready_for_review]
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
@@ -13,39 +13,26 @@ concurrency:
1313
jobs:
1414
check:
1515
runs-on: ubuntu-24.04
16-
if: github.event.pull_request.merged == false
1716
steps:
1817
- uses: actions/checkout@v4
1918

20-
- name: Cache apt packages
21-
uses: actions/cache@v4
22-
with:
23-
path: /var/cache/apt/archives
24-
key: apt-gtk-${{ runner.os }}-${{ hashFiles('.github/workflows/pull-request.yml') }}
25-
restore-keys: apt-gtk-${{ runner.os }}-
26-
27-
- name: Install GTK development dependencies
28-
run: |
29-
sudo apt-get update
30-
sudo apt-get install -y libgtk-3-dev libglib2.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf pkg-config
31-
3219
- uses: ./.github/actions/setup-node-pnpm
3320

34-
- name: Build
35-
run: pnpm exec turbo run build
36-
3721
- uses: ./.github/actions/setup-rust
3822
with:
3923
cache-key: pr
4024

41-
- name: Generate Tauri icons
42-
run: pnpm -F @truenine/memory-sync-gui run generate:icons
25+
- name: Build
26+
run: pnpm run build
27+
28+
- name: Lint
29+
run: pnpm run lint
4330

44-
- name: Generate route tree
45-
run: pnpm -F @truenine/memory-sync-gui run generate:routes
31+
- name: Typecheck
32+
run: pnpm run typecheck
4633

4734
- name: Run tests
48-
run: pnpm exec turbo run test
35+
run: pnpm run test
4936

5037
- name: Rust tests (excluding GUI)
5138
run: cargo test --workspace --exclude memory-sync-gui --lib --bins --tests

.github/workflows/release-cli.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
version: ${{ steps.check.outputs.version }}
2323
steps:
2424
- uses: actions/checkout@v4
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 25
2528

2629
- name: Check if should publish
2730
id: check
@@ -103,20 +106,31 @@ jobs:
103106
sudo apt-get update
104107
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
105108
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
106-
- name: Build all napi libraries
109+
- name: Build all napi native modules
107110
shell: bash
108111
run: |
109-
for lib in logger md-compiler config init-bundle; do
110-
echo "Building napi for $lib..."
111-
(cd "libraries/$lib" && pnpm exec napi build --platform --release --target ${{ matrix.target.rust }} --output-dir dist -- --features napi)
112+
module_dirs=(libraries/logger libraries/md-compiler cli)
113+
for module_dir in "${module_dirs[@]}"; do
114+
echo "Building napi in ${module_dir}..."
115+
(
116+
cd "${module_dir}" && \
117+
pnpm exec napi build --platform --release --target ${{ matrix.target.rust }} --output-dir dist -- --features napi
118+
)
112119
done
113120
- name: Collect .node files into CLI platform package
114121
shell: bash
115122
run: |
116123
target_dir="cli/npm/${{ matrix.target.suffix }}"
117124
mkdir -p "$target_dir"
118-
for lib in logger md-compiler config init-bundle; do
119-
cp libraries/$lib/dist/*.node "$target_dir/"
125+
shopt -s nullglob
126+
module_dirs=(libraries/logger libraries/md-compiler cli)
127+
for module_dir in "${module_dirs[@]}"; do
128+
node_files=("${module_dir}"/dist/*.node)
129+
if [ "${#node_files[@]}" -eq 0 ]; then
130+
echo "ERROR: no .node files found in ${module_dir}/dist"
131+
exit 1
132+
fi
133+
cp "${node_files[@]}" "$target_dir/"
120134
done
121135
echo "Contents of $target_dir:"
122136
ls -la "$target_dir/"
@@ -185,7 +199,7 @@ jobs:
185199
node-version: 25
186200
registry-url: https://registry.npmjs.org/
187201
- name: Build
188-
run: pnpm exec turbo run build --filter=@truenine/memory-sync-cli...
202+
run: pnpm -F @truenine/memory-sync-cli run build
189203
- name: Publish to npm
190204
working-directory: ./cli
191205
run: pnpm publish --access public --no-git-checks
@@ -228,7 +242,7 @@ jobs:
228242
- name: Build plugin-runtime
229243
shell: bash
230244
run: |
231-
pnpm exec turbo run build --filter=@truenine/memory-sync-cli...
245+
pnpm -F @truenine/memory-sync-cli run build
232246
ls -la cli/dist/plugin-runtime.mjs
233247
- uses: ./.github/actions/setup-rust
234248
with:

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ members = [
44
"cli",
55
"libraries/logger",
66
"libraries/md-compiler",
7-
"libraries/config",
8-
"libraries/plugin-shared",
9-
"libraries/input-plugins",
10-
"libraries/init-bundle",
117
"gui/src-tauri",
128
]
139

@@ -23,10 +19,6 @@ repository = "https://github.com/TrueNine/memory-sync"
2319
tnmsc = { path = "cli" }
2420
tnmsc-logger = { path = "libraries/logger" }
2521
tnmsc-md-compiler = { path = "libraries/md-compiler" }
26-
tnmsc-config = { path = "libraries/config" }
27-
tnmsc-plugin-shared = { path = "libraries/plugin-shared" }
28-
tnmsc-input-plugins = { path = "libraries/input-plugins" }
29-
tnmsc-init-bundle = { path = "libraries/init-bundle" }
3022

3123
# Serialization
3224
serde = { version = "1", features = ["derive"] }

cli/Cargo.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ repository.workspace = true
1010
[lib]
1111
name = "tnmsc"
1212
path = "src/lib.rs"
13+
crate-type = ["rlib", "cdylib"]
1314

1415
[[bin]]
1516
name = "tnmsc"
@@ -18,22 +19,24 @@ path = "src/main.rs"
1819
[features]
1920
default = []
2021
embedded-runtime = []
22+
napi = ["dep:napi", "dep:napi-derive"]
2123

2224
[dependencies]
2325
tnmsc-logger = { workspace = true }
2426
tnmsc-md-compiler = { workspace = true }
25-
tnmsc-config = { workspace = true }
26-
tnmsc-plugin-shared = { workspace = true }
27-
tnmsc-input-plugins = { workspace = true }
28-
tnmsc-init-bundle = { workspace = true }
2927
serde = { workspace = true }
3028
serde_json = { workspace = true }
3129
thiserror = "2"
3230
clap = { workspace = true }
3331
dirs = { workspace = true }
32+
sha2 = { workspace = true }
33+
napi = { workspace = true, optional = true }
34+
napi-derive = { workspace = true, optional = true }
3435
reqwest = { version = "0.13", default-features = false, features = ["blocking", "json", "rustls", "rustls-native-certs"] }
3536

3637
[dev-dependencies]
3738
proptest = "1"
3839
tempfile = "3"
39-
tnmsc-config = { workspace = true }
40+
41+
[build-dependencies]
42+
napi-build = { workspace = true }

0 commit comments

Comments
 (0)