From b4b7713fefaf59a943c7687b2edefa7dc10d0a1f Mon Sep 17 00:00:00 2001 From: Ilya Pakhomov Date: Mon, 24 Nov 2025 20:03:40 +0600 Subject: [PATCH 1/6] ci: setup github workflows --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/validate.yml | 33 +++++++++++++++++++++++++++++++++ package.json | 5 +++-- 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..63bfa1d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release to NPM + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org/" + + - name: Install dependencies + run: npm ci + + - name: Build package + run: npm run build --if-present + + - name: Publish to NPM + run: npm run release + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..a41de46 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,33 @@ +name: Validate + +on: + pull_request: + branches: [main, master, development] + push: + branches: [main, master, development] + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Run linting + run: npm run lint --if-present + + - name: Run tests + run: npm test --if-present + + - name: Run build + run: npm run build --if-present diff --git a/package.json b/package.json index c3bcb74..0d31146 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ronas-it/rtkq-entity-api", - "version": "0.5.0", + "version": "1.0.0-alpha.1", "description": "Wrapper utilities for CRUD operations with REST APIs entities using RTK Query", "license": "MIT", "author": "Ronas IT", @@ -29,9 +29,10 @@ "dist" ], "scripts": { - "lint": "eslint ./", + "lint": "npx tsc && npx eslint ./", "format": "npx prettier --write . && npm run lint -- --fix", "build": "tsup-node", + "release": "npm publish", "prepack": "npm run build", "prepare": "husky" }, From 69742671b5a9c1ddb5e80f3a8b1eb4cc36ad1b12 Mon Sep 17 00:00:00 2001 From: Ilya Pakhomov Date: Mon, 24 Nov 2025 20:18:07 +0600 Subject: [PATCH 2/6] docs: added contributing guide --- CONTRIBUTING.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..984e0fa --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,58 @@ +# Contributing + +This document provides guidelines for contributing to this project. + +## Getting started + +1. Fork or clone the repository +2. Install dependencies: `npm install` + +## Development workflow + +1. **Create a feature branch** from `main` +2. **Make your changes** following the [coding standards](#coding-standards) +3. **Test your changes** thoroughly +4. **Update documentation** if needed +5. **Run code checks**: `lint` and `test` (if available) +6. **Submit a pull request** with a clear description + +## Coding standards + +### Branch naming + +Use descriptive branch names and follow [Conventional Branch](https://conventional-branch.github.io/) guidelines. + +### Commit messages + +Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format + +### Code checks + +Repository has pre-commit code style and correctness checks. You can run them manually using `lint` and `format` scripts. + +## Releases + +To create a new release: + +1. **Bump the version**: Run `npm version {patch|minor|major}` to update the version number in `package.json` and create a Git commit and tag + + - `patch`: Bug fixes (0.2.0 → 0.2.1) + - `minor`: New features (0.2.0 → 0.3.0) + - `major`: Breaking changes (0.2.0 → 1.0.0) + +2. **Push changes**: Push the commit and tag to the repository: + + ```bash + git push && git push --tags + ``` + +3. **Create GitHub release**: Go to the [GitHub Releases](../../releases) page and: + + - Click "Create a new release" + - Select the tag created in step 1 + - Add release notes describing the changes + - Click "Publish release" + +4. **Automatic npm publication**: Once the GitHub release is published, the package will be automatically published to npm via GitHub Actions workflow. + +> **Note**: Make sure you have the `NPM_TOKEN` secret configured in your repository settings for the npm publication to work. From 9959b5f3da9cd761397d40263bee3237411fe1bd Mon Sep 17 00:00:00 2001 From: Ilya Pakhomov Date: Mon, 24 Nov 2025 20:31:59 +0600 Subject: [PATCH 3/6] fix(ci): include optional deps for installation --- .github/workflows/release.yml | 2 +- .github/workflows/validate.yml | 2 +- package-lock.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63bfa1d..f643b4d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: registry-url: "https://registry.npmjs.org/" - name: Install dependencies - run: npm ci + run: npm ci --include=optional - name: Build package run: npm run build --if-present diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a41de46..07a9b87 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,7 +21,7 @@ jobs: cache: "npm" - name: Install dependencies - run: npm ci + run: npm ci --include=optional - name: Run linting run: npm run lint --if-present diff --git a/package-lock.json b/package-lock.json index 462ef53..33cc721 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ronas-it/rtkq-entity-api", - "version": "0.5.0", + "version": "1.0.0-alpha.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@ronas-it/rtkq-entity-api", - "version": "0.5.0", + "version": "1.0.0-alpha.1", "license": "MIT", "dependencies": { "@reduxjs/toolkit": "^2.9.0", From 218e1c0bdb7b313fcfbb4635032c13f19983e718 Mon Sep 17 00:00:00 2001 From: Ilya Pakhomov Date: Mon, 24 Nov 2025 20:33:43 +0600 Subject: [PATCH 4/6] ci: switch to npm install from npm ci --- .github/workflows/release.yml | 2 +- .github/workflows/validate.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f643b4d..0a45f27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: registry-url: "https://registry.npmjs.org/" - name: Install dependencies - run: npm ci --include=optional + run: npm install - name: Build package run: npm run build --if-present diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 07a9b87..c5d073a 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -21,7 +21,7 @@ jobs: cache: "npm" - name: Install dependencies - run: npm ci --include=optional + run: npm install - name: Run linting run: npm run lint --if-present From 1b43448db5360278a00fec1623324e21ef3abbe0 Mon Sep 17 00:00:00 2001 From: Ilya Pakhomov Date: Mon, 24 Nov 2025 20:41:30 +0600 Subject: [PATCH 5/6] ci: update Node.js version to 24 and switch to npm ci for dependency installation --- .github/workflows/release.yml | 4 ++-- .github/workflows/validate.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0a45f27..fb0d930 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,11 +15,11 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24" registry-url: "https://registry.npmjs.org/" - name: Install dependencies - run: npm install + run: npm ci - name: Build package run: npm run build --if-present diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c5d073a..6eafa3a 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,11 +17,11 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "22" + node-version: "24" cache: "npm" - name: Install dependencies - run: npm install + run: npm ci - name: Run linting run: npm run lint --if-present From 15a68359274dfae68951dea1c2f0590bfc26823e Mon Sep 17 00:00:00 2001 From: Ilya Pakhomov Date: Mon, 24 Nov 2025 20:47:12 +0600 Subject: [PATCH 6/6] ci: update Node.js version to 22 and add optional dependencies for Rollup --- .github/workflows/release.yml | 2 +- .github/workflows/validate.yml | 2 +- package-lock.json | 268 +++++++++++++++++++++++++++++++++ package.json | 3 + 4 files changed, 273 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb0d930..dc8296b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "24" + node-version: "22" registry-url: "https://registry.npmjs.org/" - name: Install dependencies diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 6eafa3a..a41de46 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "24" + node-version: "22" cache: "npm" - name: Install dependencies diff --git a/package-lock.json b/package-lock.json index 33cc721..fdc44aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,9 @@ "typescript": "~5.4.5", "typescript-eslint": "^8.18.2" }, + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "*" + }, "peerDependencies": { "@react-native-community/netinfo": "^11.4.0" }, @@ -3499,6 +3502,34 @@ } } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.29.1.tgz", + "integrity": "sha512-ssKhA8RNltTZLpG6/QNkCSge+7mBQGUqJRisZ2MDQcEGaK93QESEgWK2iOpIDZ7k9zPVkG5AS3ksvD5ZWxmItw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.29.1.tgz", + "integrity": "sha512-CaRfrV0cd+NIIcVVN/jx+hVLN+VRqnuzLRmfmlzpOzB87ajixsN/+9L5xNmkaUUvEbI5BmIKS+XTwXsHEb65Ew==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, "node_modules/@rollup/rollup-darwin-arm64": { "version": "4.29.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.29.1.tgz", @@ -3513,6 +3544,229 @@ "darwin" ] }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.29.1.tgz", + "integrity": "sha512-j/Ej1oanzPjmN0tirRd5K2/nncAhS9W6ICzgxV+9Y5ZsP0hiGhHJXZ2JQ53iSSjj8m6cRY6oB1GMzNn2EUt6Ng==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.29.1.tgz", + "integrity": "sha512-91C//G6Dm/cv724tpt7nTyP+JdN12iqeXGFM1SqnljCmi5yTXriH7B1r8AD9dAZByHpKAumqP1Qy2vVNIdLZqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.29.1.tgz", + "integrity": "sha512-hEioiEQ9Dec2nIRoeHUP6hr1PSkXzQaCUyqBDQ9I9ik4gCXQZjJMIVzoNLBRGet+hIUb3CISMh9KXuCcWVW/8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.29.1.tgz", + "integrity": "sha512-Py5vFd5HWYN9zxBv3WMrLAXY3yYJ6Q/aVERoeUFwiDGiMOWsMs7FokXihSOaT/PMWUty/Pj60XDQndK3eAfE6A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.29.1.tgz", + "integrity": "sha512-RiWpGgbayf7LUcuSNIbahr0ys2YnEERD4gYdISA06wa0i8RALrnzflh9Wxii7zQJEB2/Eh74dX4y/sHKLWp5uQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.29.1.tgz", + "integrity": "sha512-Z80O+taYxTQITWMjm/YqNoe9d10OX6kDh8X5/rFCMuPqsKsSyDilvfg+vd3iXIqtfmp+cnfL1UrYirkaF8SBZA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.29.1.tgz", + "integrity": "sha512-fOHRtF9gahwJk3QVp01a/GqS4hBEZCV1oKglVVq13kcK3NeVlS4BwIFzOHDbmKzt3i0OuHG4zfRP0YoG5OF/rA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.29.1.tgz", + "integrity": "sha512-5a7q3tnlbcg0OodyxcAdrrCxFi0DgXJSoOuidFUzHZ2GixZXQs6Tc3CHmlvqKAmOs5eRde+JJxeIf9DonkmYkw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.29.1.tgz", + "integrity": "sha512-9b4Mg5Yfz6mRnlSPIdROcfw1BU22FQxmfjlp/CShWwO3LilKQuMISMTtAu/bxmmrE6A902W2cZJuzx8+gJ8e9w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.29.1.tgz", + "integrity": "sha512-G5pn0NChlbRM8OJWpJFMX4/i8OEU538uiSv0P6roZcbpe/WfhEO+AT8SHVKfp8qhDQzaz7Q+1/ixMy7hBRidnQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.29.1.tgz", + "integrity": "sha512-WM9lIkNdkhVwiArmLxFXpWndFGuOka4oJOZh8EP3Vb8q5lzdSCBuhjavJsw68Q9AKDGeOOIHYzYm4ZFvmWez5g==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.53.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.3.tgz", + "integrity": "sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.29.1.tgz", + "integrity": "sha512-xufkSNppNOdVRCEC4WKvlR1FBDyqCSCpQeMMgv9ZyXqqtKBfkw1yfGMTUTs9Qsl6WQbJnsGboWCp7pJGkeMhKA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.29.1.tgz", + "integrity": "sha512-F2OiJ42m77lSkizZQLuC+jiZ2cgueWQL5YC9tjo3AgaEw+KJmVxHGSyQfDUoYR9cci0lAywv2Clmckzulcq6ig==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.29.1.tgz", + "integrity": "sha512-rYRe5S0FcjlOBZQHgbTKNrqxCBUmgDJem/VQTCcTnA2KCabYSWQDrytOzX7avb79cAAweNmMUb/Zw18RNd4mng==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.29.1.tgz", + "integrity": "sha512-+10CMg9vt1MoHj6x1pxyjPSMjHTIlqs8/tBztXvPAx24SKs9jwVnKqHJumlH/IzhaPUaj3T6T6wfZr8okdXaIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", @@ -11344,6 +11598,20 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup/node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.29.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.29.1.tgz", + "integrity": "sha512-87xYCwb0cPGZFoGiErT1eDcssByaLX4fc0z2nRM6eMtV9njAfEE6OW3UniAoDhX4Iq5xQVpE6qO9aJbCFumKYQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", diff --git a/package.json b/package.json index 0d31146..5ced969 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,9 @@ "optional": true } }, + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "*" + }, "devDependencies": { "@eslint/compat": "^1.2.4", "@eslint/eslintrc": "^3.2.0",