Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ coverage/
target/
release/
build/
/bin/

# ==========================
# Logs
Expand Down
27 changes: 27 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Ignore Rust backend and build files
src-tauri/
target/
out/
rustc_checker.py

# Ignore local configuration and developer tools
.agents/
.antigravitycli/
.cargo_home/
.codex/
.rustup/
.rustup_copy/
.rustup_home/
.vite-web/
.env*
logs/

# Ignore documentation and guidelines
docs/
BUILD_AND_RELEASE.md
CONTRIBUTING.md
TAURI_MIGRATION.md

# Ignore installer scripts
install.sh
install.ps1
16 changes: 16 additions & 0 deletions BUILD_AND_RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,19 @@ runs publish a GitHub Release.
The updater requires a configured release endpoint, a public key in the Tauri config, and signed
release artifacts. Exercise update installation against the published endpoint before promoting a
release.

## Publish to npm

To publish the repository package to the npm registry as a public scoped package:

1. **Log in to npm** (if not already logged in):
```bash
npm login
```

2. **Publish the package** (since `@pheem49/mint` is a scoped package, you must specify public access):
```bash
npm publish --access public
```

*Note: You must bump the version number in `package.json` before publishing a new version.*
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
resolver = "2"

[workspace.package]
version = "1.6.0"
version = "1.6.2"
edition = "2024"
license = "AGPL-3.0-only"

Expand Down
34 changes: 29 additions & 5 deletions crates/mint-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -947,12 +947,36 @@ async fn launch_mint_target(target: String) -> Result<()> {
println!(
"{MINT}Launching Web App (vite) in background...{RESET} {DIM}(Vite Dev UI at http://localhost:9000){RESET}"
);
let project_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.and_then(|p| p.parent())
.ok_or_else(|| anyhow::anyhow!("Failed to find project root directory"))?;
let project_root = {
let mut found = None;
if let Ok(exe_path) = std::env::current_exe() {
let mut path = exe_path.parent();
while let Some(p) = path {
if p.join("package.json").exists() {
found = Some(p.to_path_buf());
break;
}
path = p.parent();
}
}
if found.is_none() {
if let Ok(cwd) = std::env::current_dir() {
let mut path = Some(cwd.as_path());
while let Some(p) = path {
if p.join("package.json").exists() {
found = Some(p.to_path_buf());
break;
}
path = p.parent();
}
}
}
found.ok_or_else(|| {
anyhow::anyhow!("Failed to find project root directory containing package.json")
})?
};
std::process::Command::new("npm")
.current_dir(project_root)
.current_dir(&project_root)
.args(&["run", "dev:web"])
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
Expand Down
28 changes: 20 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pheem49/mint",
"version": "1.6.0",
"version": "1.6.2",
"description": "A native Tauri desktop AI assistant with a Rust backend and React UI.",
"scripts": {
"dev:web": "vite --config vite.config.web.ts",
Expand All @@ -24,29 +24,41 @@
"preview": "vite preview",
"start": "tauri dev",
"test": "cargo test -p mint-core -p mint-cli",
"cli": "cargo run -p mint-cli --"
"cli": "cargo run -p mint-cli --",
"postinstall": "cargo build -p mint-cli --release && mkdir -p bin && cp target/release/mint bin/mint"
},
"keywords": [],
"repository": {
"type": "git",
"url": "git+https://github.com/Pheem49/Mint.git"
},
"bugs": {
"url": "https://github.com/Pheem49/Mint/issues"
},
"homepage": "https://github.com/Pheem49/Mint#readme",
"author": {
"name": "Pheem49",
"email": "killerpheem13@gmail.com"
},
"license": "AGPL-3.0-only",
"type": "commonjs",
"bin": {
"mint": "src/bin/index.js"
},
"dependencies": {
"@tauri-apps/api": "^2.0.0",
"pixi-live2d-display": "^0.4.0",
"pixi.js": "^6.5.10",
"react": "^19.2.5"
},
"devDependencies": {
"@tauri-apps/cli": "^2.0.0",
"@vitejs/plugin-react": "^6.0.1",
"material-icon-theme": "^5.35.0",
"pixi-live2d-display": "^0.4.0",
"pixi.js": "^6.5.10",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"typescript": "^6.0.3",
"vite": "^8.0.10"
},
"devDependencies": {
"@tauri-apps/cli": "^2.0.0"
},
"overrides": {
"gh-pages": "^5.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Mint",
"version": "1.6.0",
"version": "1.6.2",
"identifier": "com.pheem49.mint",
"build": {
"beforeDevCommand": "npm run dev:desktop",
Expand Down
16 changes: 16 additions & 0 deletions src/bin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node

const { spawn } = require('child_process');
const path = require('path');

// ชี้ไปยังไฟล์ Rust Binary ที่คอมไพล์สำเร็จแล้วในเครื่องผู้ใช้
const binaryPath = path.join(__dirname, '..', '..', 'bin', 'mint');

// สั่งทำงานไฟล์ Binary โดยส่งอาร์กิวเมนต์ทั้งหมดต่อเข้าไป
const child = spawn(binaryPath, process.argv.slice(2), {
stdio: 'inherit'
});

child.on('close', (code) => {
process.exit(code);
});
Loading