Skip to content

Commit ad9185b

Browse files
committed
feat: add default timestamps for project fields and enhance deserialization
- Introduced a default timestamp function for `last_accessed` and `added_at` fields in the Project struct. - Updated the Project struct to use the default timestamp for `added_at` during deserialization. - Added a test to ensure projects can be deserialized without the `added_at` field, validating that it defaults correctly. docs: create scripts reference document - Added a new `scripts.md` file containing less frequently used scripts previously in `package.json`. - Organized sections for Publishing & Release, Documentation, Testing Variants, Rust Development, Desktop Development, UI Components, and Quick Reference. chore: update turbo.json for improved development workflow - Enhanced the `turbo.json` configuration to include `VITE_API_URL` in the environment variables for dev commands. - Added dependencies for `dev:desktop` to ensure UI components are built before desktop app development. - Configured outputs for `build:desktop` and `build-storybook` to manage build artifacts effectively.
1 parent 2f8141c commit ad9185b

File tree

9 files changed

+577
-548
lines changed

9 files changed

+577
-548
lines changed

Makefile

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
.PHONY: help dev dev-web dev-desktop build test typecheck format clean install
2+
3+
# Default target - show help
4+
help:
5+
@echo "LeanSpec Development Commands"
6+
@echo ""
7+
@echo "Daily Development:"
8+
@echo " make dev - Start full stack (Rust HTTP + Vite SPA)"
9+
@echo " make dev-web - Start Vite SPA only"
10+
@echo " make dev-desktop - Start Tauri desktop app"
11+
@echo ""
12+
@echo "Build & Test:"
13+
@echo " make build - Build all packages"
14+
@echo " make test - Run tests"
15+
@echo " make test-watch - Run tests in watch mode"
16+
@echo " make test-ui - Run tests with UI"
17+
@echo " make typecheck - Type check all packages"
18+
@echo ""
19+
@echo "Code Quality:"
20+
@echo " make format - Format all code"
21+
@echo " make lint - Lint all packages"
22+
@echo " make pre-release - Full pre-release validation"
23+
@echo ""
24+
@echo "Rust Development:"
25+
@echo " make rust-build - Build Rust binaries (release)"
26+
@echo " make rust-dev - Build Rust binaries (dev)"
27+
@echo " make rust-test - Run Rust tests"
28+
@echo " make rust-check - Check Rust code"
29+
@echo " make rust-fmt - Format Rust code"
30+
@echo " make rust-clean - Clean Rust build artifacts"
31+
@echo ""
32+
@echo "Documentation:"
33+
@echo " make docs - Start docs dev server"
34+
@echo " make docs-build - Build documentation"
35+
@echo ""
36+
@echo "Publishing:"
37+
@echo " make release - Prepare and validate release"
38+
@echo " make sync-ver - Sync versions across packages"
39+
@echo ""
40+
@echo "Utilities:"
41+
@echo " make install - Install dependencies"
42+
@echo " make clean - Clean all build artifacts"
43+
@echo " make cli - Run LeanSpec CLI (use: make cli ARGS='list')"
44+
45+
# Development
46+
dev:
47+
pnpm dev
48+
49+
dev-web:
50+
pnpm dev:web
51+
52+
dev-desktop:
53+
pnpm dev:desktop
54+
55+
dev-storybook:
56+
turbo run storybook --filter=@leanspec/ui-components
57+
58+
# Build & Test
59+
build:
60+
pnpm build
61+
62+
build-desktop:
63+
turbo run build:desktop --filter=@leanspec/desktop
64+
65+
test:
66+
pnpm test
67+
68+
test-watch:
69+
vitest
70+
71+
test-ui:
72+
vitest --ui
73+
74+
test-coverage:
75+
vitest run --coverage
76+
77+
typecheck:
78+
pnpm typecheck
79+
80+
# Code Quality
81+
format:
82+
pnpm format
83+
84+
lint:
85+
turbo run lint
86+
87+
pre-release:
88+
pnpm pre-release
89+
90+
# Rust Development
91+
rust-build:
92+
cargo build --release --manifest-path rust/Cargo.toml
93+
node scripts/copy-rust-binaries.mjs
94+
95+
rust-dev:
96+
cargo build --manifest-path rust/Cargo.toml
97+
node scripts/copy-rust-binaries.mjs
98+
99+
rust-build-http:
100+
cargo build --release --manifest-path rust/Cargo.toml -p leanspec-http
101+
102+
rust-test:
103+
cargo test --manifest-path rust/Cargo.toml
104+
105+
rust-test-watch:
106+
cargo watch -x 'test --manifest-path rust/Cargo.toml'
107+
108+
rust-check:
109+
cargo check --manifest-path rust/Cargo.toml
110+
111+
rust-clippy:
112+
cargo clippy --manifest-path rust/Cargo.toml -- -D warnings
113+
114+
rust-fmt:
115+
cargo fmt --manifest-path rust/Cargo.toml
116+
117+
rust-fmt-check:
118+
cargo fmt --manifest-path rust/Cargo.toml -- --check
119+
120+
rust-clean:
121+
cargo clean --manifest-path rust/Cargo.toml
122+
123+
# Documentation
124+
docs:
125+
pnpm --dir docs-site start
126+
127+
docs-build:
128+
pnpm --dir docs-site build
129+
130+
docs-serve:
131+
pnpm --dir docs-site serve
132+
133+
# Publishing
134+
release: pre-release
135+
@echo "Ready for release! Next steps:"
136+
@echo "1. Create and push tag: git tag v0.x.x && git push origin v0.x.x"
137+
@echo "2. Run: make publish"
138+
139+
sync-ver:
140+
tsx scripts/sync-versions.ts
141+
tsx scripts/sync-rust-versions.ts
142+
143+
prepare-publish:
144+
tsx scripts/prepare-publish.ts
145+
146+
publish-platforms:
147+
tsx scripts/publish-platform-packages.ts
148+
149+
publish-main:
150+
tsx scripts/publish-main-packages.ts
151+
152+
restore-packages:
153+
tsx scripts/restore-packages.ts
154+
155+
publish: prepare-publish publish-platforms publish-main restore-packages
156+
@echo "Publishing complete!"
157+
158+
# Utilities
159+
install:
160+
pnpm install
161+
162+
clean: rust-clean
163+
rm -rf node_modules
164+
rm -rf packages/*/node_modules
165+
rm -rf packages/*/dist
166+
rm -rf packages/*/.next
167+
rm -rf docs-site/node_modules
168+
rm -rf docs-site/build
169+
170+
cli:
171+
@node bin/lean-spec.js $(ARGS)
172+
173+
# Convenience aliases
174+
.PHONY: dev-full web desktop docs-dev test-w watch
175+
dev-full: dev
176+
web: dev-web
177+
desktop: dev-desktop
178+
docs-dev: docs
179+
test-w: test-watch
180+
watch: test-watch

package.json

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,15 @@
66
"description": "Lightweight spec methodology for AI-powered development (monorepo root)",
77
"packageManager": "pnpm@10.26.0",
88
"scripts": {
9-
"build": "turbo run build",
10-
"sync-versions": "tsx scripts/sync-versions.ts",
11-
"sync-rust-versions": "tsx scripts/sync-rust-versions.ts",
12-
"publish:platforms": "tsx scripts/publish-platform-packages.ts",
13-
"publish:main": "tsx scripts/publish-main-packages.ts",
14-
"dev": "turbo run dev --filter=@leanspec/ui-vite",
9+
"dev": "concurrently \"cargo run --manifest-path rust/Cargo.toml -p leanspec-http\" \"turbo run dev --filter=@leanspec/ui-vite\"",
1510
"dev:web": "turbo run dev --filter=@leanspec/ui-vite",
16-
"dev:cli": "turbo run dev --filter=lean-spec",
17-
"dev:desktop": "pnpm --filter @leanspec/desktop dev:desktop",
11+
"dev:desktop": "turbo run dev:desktop --filter=@leanspec/desktop",
12+
"build": "turbo run build",
13+
"test": "turbo run test:run",
1814
"typecheck": "turbo run typecheck",
1915
"format": "prettier --write .",
20-
"test": "turbo run test:run",
21-
"test:ui": "vitest --ui",
22-
"test:run": "vitest run",
23-
"test:coverage": "vitest run --coverage",
24-
"prepare-publish": "tsx scripts/prepare-publish.ts",
25-
"restore-packages": "tsx scripts/restore-packages.ts",
26-
"build:desktop": "pnpm --filter @leanspec/desktop build:desktop",
27-
"pre-release": "pnpm sync-versions && pnpm typecheck && pnpm test:run && pnpm build && node bin/lean-spec.js validate --warnings-only",
28-
"docs:dev": "pnpm --dir docs-site start",
29-
"docs:build": "pnpm --dir docs-site build",
30-
"docs:serve": "pnpm --dir docs-site serve",
31-
"rust:build": "cargo build --release --manifest-path rust/Cargo.toml && node scripts/copy-rust-binaries.mjs",
32-
"rust:build:dev": "cargo build --manifest-path rust/Cargo.toml && node scripts/copy-rust-binaries.mjs",
33-
"rust:build:all": "cargo build --release --manifest-path rust/Cargo.toml && node scripts/copy-rust-binaries.mjs --all",
34-
"rust:copy": "node scripts/copy-rust-binaries.mjs",
35-
"rust:test": "cargo test --manifest-path rust/Cargo.toml",
36-
"rust:test:watch": "cargo watch -x 'test --manifest-path rust/Cargo.toml'",
37-
"rust:check": "cargo check --manifest-path rust/Cargo.toml",
38-
"rust:clippy": "cargo clippy --manifest-path rust/Cargo.toml -- -D warnings",
39-
"rust:fmt": "cargo fmt --manifest-path rust/Cargo.toml",
40-
"rust:fmt:check": "cargo fmt --manifest-path rust/Cargo.toml -- --check",
41-
"rust:clean": "cargo clean --manifest-path rust/Cargo.toml",
42-
"cli": "node bin/lean-spec.js"
16+
"cli": "node bin/lean-spec.js",
17+
"pre-release": "pnpm sync-versions && pnpm typecheck && pnpm test && pnpm build && pnpm cli validate --warnings-only"
4318
},
4419
"keywords": [
4520
"spec",
@@ -63,6 +38,7 @@
6338
"@vitest/coverage-v8": "^4.0.6",
6439
"@vitest/ui": "^4.0.6",
6540
"baseline-browser-mapping": "^2.9.6",
41+
"concurrently": "^9.1.2",
6642
"next": "16.0.1",
6743
"prettier": "^3.1.1",
6844
"tsx": "^4.19.2",

packages/desktop/package.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
"type": "module",
66
"description": "LeanSpec Desktop app powered by Tauri",
77
"scripts": {
8-
"dev": "vite dev",
8+
"dev": "vite dev --port 1420",
99
"build": "vite build",
1010
"preview": "vite preview",
1111
"lint": "eslint .",
12+
"typecheck": "tsc --noEmit",
1213
"tauri": "tauri",
1314
"dev:desktop": "tauri dev",
1415
"build:desktop": "tauri build",
@@ -17,21 +18,32 @@
1718
"bundle:windows": "tauri build --bundles nsis"
1819
},
1920
"dependencies": {
21+
"@leanspec/ui-components": "workspace:*",
2022
"@tauri-apps/api": "^2.0.0",
23+
"@tauri-apps/plugin-dialog": "^2.0.0",
24+
"@tauri-apps/plugin-notification": "^2.0.0",
2125
"@tauri-apps/plugin-opener": "^2.0.0",
26+
"@tauri-apps/plugin-shell": "^2.0.0",
27+
"@tauri-apps/plugin-updater": "^2.0.0",
28+
"@tauri-apps/plugin-window-state": "^2.0.0",
2229
"clsx": "^2.1.1",
2330
"lucide-react": "^0.553.0",
2431
"react": "19.2.0",
2532
"react-dom": "19.2.0",
26-
"react-router-dom": "^7.10.1"
33+
"react-markdown": "^9.1.0",
34+
"react-router-dom": "^7.10.1",
35+
"rehype-raw": "^7.0.0",
36+
"remark-gfm": "^4.0.1",
37+
"tailwind-merge": "^3.4.0"
2738
},
2839
"devDependencies": {
2940
"@tauri-apps/cli": "^2.0.0",
41+
"@tailwindcss/typography": "^0.5.15",
3042
"@types/node": "^20",
3143
"@types/react": "^19",
3244
"@types/react-dom": "^19",
3345
"@vitejs/plugin-react": "^4.3.4",
34-
"@yao-pkg/pkg": "^6.11.0",
46+
"autoprefixer": "^10.4.20",
3547
"eslint": "^9.13.0",
3648
"eslint-config-prettier": "^9.1.0",
3749
"eslint-plugin-react-hooks": "^5.1.0-rc.0",

packages/ui-vite/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"private": true,
66
"type": "module",
77
"scripts": {
8-
"dev": "vite",
8+
"dev": "vite --port 3000",
99
"build": "tsc -b && vite build",
1010
"lint": "eslint .",
11-
"preview": "vite preview",
11+
"preview": "vite preview --port 3000",
1212
"typecheck": "tsc --noEmit"
1313
},
1414
"dependencies": {

packages/ui-vite/vite.config.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
import { defineConfig } from 'vite'
22
import react from '@vitejs/plugin-react'
3+
import path from 'path'
34

45
// https://vite.dev/config/
56
export default defineConfig({
67
plugins: [react()],
8+
resolve: {
9+
alias: {
10+
'@': path.resolve(__dirname, './src'),
11+
},
12+
},
13+
server: {
14+
port: 3000,
15+
proxy: {
16+
'/api': {
17+
target: process.env.VITE_API_URL || 'http://localhost:3001',
18+
changeOrigin: true,
19+
},
20+
},
21+
},
22+
define: {
23+
// Make environment variables available
24+
__API_URL__: JSON.stringify(process.env.VITE_API_URL || 'http://localhost:3001'),
25+
},
726
})

0 commit comments

Comments
 (0)