diff --git a/AGENTS.md b/AGENTS.md index 1b4c6c2..4099d0f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,11 +1,5 @@ # AI Agents Instructions (simple-notepad) -## Mission - -This repo is a small Expo + React Native app (using Expo Router and NativeWind/Tailwind) for creating, listing, and editing "notes" and "checklist lists", persisted in a local SQLite database. - -When you (or another AI agent) are asked to implement a change, prefer working through the existing route/components structure and the centralized SQLite data layer in `lib/dataStorage.ts`. - ## Quick Safety Checklist (do not break invariants) - Do not remove/skip the `migrateDbIfNeeded` hook from `SQLiteProvider` in `app/_layout.tsx`. @@ -25,6 +19,22 @@ Key points for agents: - Do **not** run `expo prebuild --clean` — use `expo prebuild` (no `--clean`) to preserve widget files. - After any write operation in `lib/dataStorage.ts`, call `syncAndroidNoteListWidgetFromApp()` (already defined there) so the widget refreshes. All existing CRUD helpers already do this. +## Mission + +This repo is a small Expo + React Native app (using Expo Router and NativeWind/Tailwind) for creating, listing, and editing "notes" and "checklist lists", persisted in a local SQLite database. + +When you (or another AI agent) are asked to implement a change, prefer working through the existing route/components structure and the centralized SQLite data layer in `lib/dataStorage.ts`. + +## Before creating a PR + +Always bump the version before opening a pull request. Choose the bump type based on the nature of the changes: + +- **patch** (`npm run bump:patch`) — bug fixes, small tweaks, copy changes +- **minor** (`npm run bump:minor`) — new user-visible features, non-breaking additions +- **major** (`npm run bump:major`) — breaking changes, major UX overhauls + +Run the bump command, then include the resulting `app.json` and `package.json` changes in the same commit or PR. Never open a PR without a version bump — the CI check enforces this. + ## When implementing a feature (agent playbook) 1. **Locate the route** to change/add under `app/`. @@ -41,14 +51,6 @@ Key points for agents: ## SQLite Database Model (most important invariants) -### Where the DB is initialized - -`app/_layout.tsx` wraps the router with: - -- `` - -So the migration function in `lib/dataStorage.ts` is responsible for keeping schema compatible across app updates. - ### Schema and versioning @lib/dataStorage.ts @@ -71,29 +73,9 @@ Important rule: updating list items uses `UPDATE content SET note = ? WHERE id = ## Repo Layout (where things live) -- `app/`: screens/routes (Expo Router) - - `app/index.tsx`: notes list screen - - `app/add-note.tsx`: create note - - `app/edit-note/[id].tsx`: edit note by numeric id - - `app/note/[id].tsx`: view note by numeric id - - `app/add-list.tsx`: create list - - `app/edit-list/[id].tsx`: edit list by numeric id - - `app/list/[id].tsx`: view list by numeric id -- `components/`: reusable UI pieces - - `components/NoteForm.tsx`: shared note create/edit form - - `components/ListForm.tsx`: shared list create/edit form - - `components/AddContentDropdown.tsx`: "add note or list" UI - - `components/navigation/HeaderBackButton.tsx`: back arrow button for screen headers - - `components/state/`: `ScreenLoadingState` and `ScreenNotFoundState` - - `components/ui/`: primitive UI components — `button`, `card`, `icon`, `input`, `textarea`, `text` -- `lib/`: non-UI logic - - `lib/dataStorage.ts`: SQLite schema, migrations, and CRUD helpers - - `lib/theme.ts`: navigation theme colors - - `lib/utils.ts`: `cn()` utility for className merging -- `hooks/`: small hooks used by screens - - `useParsedNumericRouteParam`: parses numeric `[id]` params safely - - `useHardwareBackHandler`: handles Android back navigation - - `useKeyboardOffset`: tracks keyboard visibility on Android to compute bottom padding +Routes under `app/`, reusable UI under `components/`, non-UI logic under `lib/`, custom hooks under `hooks/`. + +@README.md ## Tech Stack (what to assume) @@ -122,8 +104,7 @@ Expo ~54, Expo Router, NativeWind v4, expo-sqlite, TypeScript strict — see @pa ## Code Style / Quality Bar - Use type narrowing (not !) for nullable fields and 'loading' states. Always unwrap numeric route params via useParsedNumericRouteParam — never cast useLocalSearchParams() output directly. -- Follow Prettier config expectations: - - single quotes, `printWidth: 100`, Tailwind plugin support. +- Run `npx prettier --check .` before committing (single quotes, `printWidth: 100`, Tailwind plugin). CI enforces this. - All SQL lives in lib/dataStorage.ts. No exceptions. ## Running the app (for humans/agents) diff --git a/app.json b/app.json index 92b935a..8a5e4d6 100644 --- a/app.json +++ b/app.json @@ -2,7 +2,7 @@ "expo": { "name": "simple-notepad", "slug": "simple-notepad", - "version": "1.4.0", + "version": "1.4.1", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "simple-notepad", @@ -24,7 +24,7 @@ "backgroundColor": "#ffffff" }, "package": "com.pgarr.simplenotepad", - "versionCode": 17 + "versionCode": 18 }, "web": { "bundler": "metro", @@ -43,7 +43,7 @@ "projectId": "9e3820b7-558b-4bd2-a1b2-e49561e741e6" } }, - "runtimeVersion": "1.4.0", + "runtimeVersion": "1.4.1", "updates": { "url": "https://u.expo.dev/9e3820b7-558b-4bd2-a1b2-e49561e741e6" } diff --git a/eas.json b/eas.json index 57b1403..530ba93 100644 --- a/eas.json +++ b/eas.json @@ -1,7 +1,7 @@ { "cli": { "version": ">= 18.3.0", - "appVersionSource": "remote" + "appVersionSource": "local" }, "build": { "development": { @@ -14,7 +14,6 @@ "channel": "preview" }, "production": { - "autoIncrement": true, "channel": "production", "android": { "image": "latest" diff --git a/package-lock.json b/package-lock.json index 078c720..20fb527 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-notepad", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-notepad", - "version": "1.4.0", + "version": "1.4.1", "dependencies": { "@react-navigation/native": "^7.0.0", "@rn-primitives/portal": "~1.3.0", diff --git a/package.json b/package.json index 3da96f8..33d1627 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "simple-notepad", "main": "expo-router/entry", - "version": "1.4.0", + "version": "1.4.1", "scripts": { "prebuild": "expo prebuild", "dev": "expo start",