diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51002e8..12b30fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [18.x] + node-version: [20.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml new file mode 100644 index 0000000..a7b1d50 --- /dev/null +++ b/.github/workflows/version-check.yml @@ -0,0 +1,46 @@ +name: Version Check + +on: + pull_request: + branches: [master] + +jobs: + check-version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get PR version + id: pr_version + run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT + + - name: Get base branch version + id: base_version + run: | + git fetch origin ${{ github.base_ref }} + BASE_VERSION=$(git show origin/${{ github.base_ref }}:package.json | node -p "JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')).version") + echo "version=$BASE_VERSION" >> $GITHUB_OUTPUT + + - name: Compare versions + run: | + PR="${{ steps.pr_version.outputs.version }}" + BASE="${{ steps.base_version.outputs.version }}" + echo "Base (main): $BASE" + echo "PR: $PR" + + node -e " + const semver = (v) => v.split('.').map(Number); + const [bM, bm, bp] = semver('$BASE'); + const [pM, pm, pp] = semver('$PR'); + const isHigher = + pM > bM || + (pM === bM && pm > bm) || + (pM === bM && pm === bm && pp > bp); + if (!isHigher) { + console.error('Version must be bumped. Run npm run bump:patch/minor/major before pushing.'); + process.exit(1); + } + console.log('Version bump detected. OK.'); + " \ No newline at end of file diff --git a/README.md b/README.md index 0c571b8..a2932a9 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,49 @@ -# Minimal Template +# Simple Notepad -This is a [React Native](https://reactnative.dev/) project built with [Expo](https://expo.dev/) and [React Native Reusables](https://reactnativereusables.com). +A lightweight cross-platform notes and checklist app built with [React Native](https://reactnative.dev/) and [Expo](https://expo.dev/). Create, manage, and organize your notes and checklists with persistent local storage via SQLite. -It was initialized using the following command: +## Features -```bash -npx @react-native-reusables/cli@latest init -t simple-notepad -``` +- ✍️ Create and edit notes with a clean, intuitive interface +- ☑️ Create and manage checklist items with check/uncheck functionality +- 💾 All data persisted locally in SQLite database +- 🎨 Responsive UI powered by Tailwind CSS via NativeWind +- 📱 Runs seamlessly on iOS, Android, and Web +- 🔥 Edge-to-Edge display support ## Getting Started -To run the development server: +### Running the App + +Start the development server: ```bash - npm run dev - # or - yarn dev - # or - pnpm dev - # or - bun dev +npm run dev ``` -This will start the Expo Dev Server. Open the app in: +Then open the app in your preferred platform: - **iOS**: press `i` to launch in the iOS simulator _(Mac only)_ - **Android**: press `a` to launch in the Android emulator - **Web**: press `w` to run in a browser -You can also scan the QR code using the [Expo Go](https://expo.dev/go) app on your device. This project fully supports running in Expo Go for quick testing on physical devices. +Alternatively, you can scan the QR code using the [Expo Go](https://expo.dev/go) app on your physical device. + +### Available Scripts + +From `package.json`: + +```bash +npm run dev # Start development server +npm run android # Build and run on Android +npm run prebuild # Generate native projects +npm run test-watch # Run tests in watch mode +npm run test-ci # Run tests (CI mode) +npm run clean # Clean build artifacts and dependencies +npm run bump:patch # Bump patch version +npm run bump:minor # Bump minor version +npm run bump:major # Bump major version +``` ## Adding components @@ -51,23 +66,20 @@ If you don't specify any component names, you'll be prompted to select which com - 🔥 Edge to Edge enabled - 📱 Runs on iOS, Android, and Web +## Architecture + +- **Routing**: File-based routing with [Expo Router](https://expo.dev/router) under `app/` directory +- **Storage**: Local SQLite database via `expo-sqlite` with automated migrations +- **State Management**: React hooks and component state +- **Data Layer**: Centralized CRUD helpers in `lib/dataStorage.ts` + ## Learn More To dive deeper into the technologies used: - [React Native Docs](https://reactnative.dev/docs/getting-started) - [Expo Docs](https://docs.expo.dev/) +- [Expo Router Guide](https://expo.dev/router) - [Nativewind Docs](https://www.nativewind.dev/) - [React Native Reusables](https://reactnativereusables.com) - -## Deploy with EAS - -The easiest way to deploy your app is with [Expo Application Services (EAS)](https://expo.dev/eas). - -- [EAS Build](https://docs.expo.dev/build/introduction/) -- [EAS Updates](https://docs.expo.dev/eas-update/introduction/) -- [EAS Submit](https://docs.expo.dev/submit/introduction/) - ---- - -If you enjoy using React Native Reusables, please consider giving it a ⭐ on [GitHub](https://github.com/founded-labs/react-native-reusables). Your support means a lot! +- [SQLite with Expo](https://docs.expo.dev/versions/latest/sdk/sqlite/) diff --git a/app.json b/app.json index 7ae5249..5c657c5 100644 --- a/app.json +++ b/app.json @@ -2,7 +2,7 @@ "expo": { "name": "simple-notepad", "slug": "simple-notepad", - "version": "1.2.0", + "version": "1.2.1", "orientation": "portrait", "icon": "./assets/images/icon.png", "scheme": "simple-notepad", @@ -25,7 +25,7 @@ "backgroundColor": "#ffffff" }, "package": "com.pgarr.simplenotepad", - "versionCode": 14 + "versionCode": 15 }, "web": { "bundler": "metro", @@ -44,7 +44,7 @@ "projectId": "9e3820b7-558b-4bd2-a1b2-e49561e741e6" } }, - "runtimeVersion": "1.2.0", + "runtimeVersion": "1.2.1", "updates": { "url": "https://u.expo.dev/9e3820b7-558b-4bd2-a1b2-e49561e741e6" } diff --git a/package-lock.json b/package-lock.json index ab9d761..50c1125 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-notepad", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-notepad", - "version": "1.2.0", + "version": "1.2.1", "dependencies": { "@react-navigation/native": "^7.0.0", "@rn-primitives/portal": "~1.3.0", diff --git a/package.json b/package.json index af50436..a7413e3 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,13 @@ { "name": "simple-notepad", "main": "expo-router/entry", - "version": "1.2.0", + "version": "1.2.1", "scripts": { "prebuild": "expo prebuild --clean", + "dev": "expo start", "android": "expo run:android", + "ios": "expo run:ios", + "web": "expo run:web", "test-watch": "jest --watchAll", "test-ci": "jest --no-watchman --runInBand", "clean": "rm -rf .expo node_modules",