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
64 changes: 61 additions & 3 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Build and Push Docker Images
on:
push:
branches:
- main
- master
- development
Comment on lines 5 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore main to the workflow triggers

If this repository still accepts pushes or PRs against the existing main branch, this trigger no longer matches them: the workflow now only runs for master and development, while the previous workflow included main. That would skip the added lint jobs, tests, and Docker image publishing for main-targeted changes, so keep main in this list until that branch is actually retired.

Useful? React with 👍 / 👎.

paths:
- 'dashboard/**'
- 'src/**'
Expand All @@ -13,8 +13,8 @@ on:
- 'v*.*.*'
pull_request:
branches:
- main
- master
- development
paths:
- 'dashboard/**'
- 'src/**'
Expand All @@ -32,21 +32,78 @@ env:
DASHBOARD_IMAGE_NAME: ${{ github.repository_owner }}/simplens-dashboard

jobs:
# ============================================
# Lint: simplens-core
# ============================================
lint-core:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'

- name: Verify Node.js version
run: node --version

- name: Install dependencies
run: npm ci

- name: Run core lint
run: npm run lint:core

# ============================================
# Lint: simplens-dashboard
# ============================================
lint-dashboard:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'

- name: Verify Node.js version
run: node --version

- name: Install dependencies
run: npm ci

- name: Install dashboard dependencies
run: npm ci --prefix dashboard

- name: Run dashboard lint
run: npm run lint:dashboard

# ============================================
# Test: simplens-core
# ============================================
test-core:
runs-on: ubuntu-latest
needs:
- lint-core
- lint-dashboard
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
node-version: '22.x'
cache: 'npm'

- name: Verify Node.js version
run: node --version

- name: Install dependencies
run: npm ci

Expand Down Expand Up @@ -108,6 +165,7 @@ jobs:
# ============================================
build-dashboard:
runs-on: ubuntu-latest
needs: test-core
permissions:
contents: read
packages: write
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
35 changes: 35 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Repository Guidelines

## Project Structure & Module Organization
`src/` contains the TypeScript core service. HTTP routes live in `src/api/`, background execution in `src/workers/` and `src/processors/`, channel integrations in `src/plugins/`, and shared infrastructure in `src/config/`, `src/database/`, and `src/utils/`.

Tests are split between `tests/unit` and `tests/integration`, with helpers in `tests/testutil` and setup in `tests/setup.ts`. The Next.js admin UI lives in `dashboard/`. Docs and assets are in `api-docs/`, `architecture/`, and `assets/`.

## Build, Test, and Development Commands
Install dependencies with `npm install` and `npm install --prefix dashboard`.

- `npm run dev` starts the core API with `tsx` and `nodemon`.
- `npm run worker:dev`, `npm run processor:dev`, `npm run delayed-processor:dev`, and `npm run recovery:dev` start background services.
- `npm run build` compiles `src/` to `dist/` and rewrites path aliases.
- `npm run start` runs the compiled API from `dist/api/server.js`.
- `npm run test`, `npm run test:unit`, `npm run test:integration`, and `npm run test:coverage` run tests.
- `npm run lint:core` checks the core codebase; `npm run lint:dashboard` checks the dashboard.
- `npm run dev --prefix dashboard` starts the dashboard on port `3002`.

## Coding Style & Naming Conventions
Use TypeScript with strict typing and existing `@src/*` path aliases. Match current style: 2-space indentation, camelCase for variables and functions, PascalCase for types, classes, and React components, and filenames such as `notification.controller.test.ts`.

Plan changes before writing code. Follow low-level design principles: single responsibility, clear interfaces, useful dependency inversion, and explicit error handling. Do not duplicate logic; extract shared behavior into focused utilities, services, or test helpers.

## Testing Guidelines
Vitest is the test runner. Integration tests also use `supertest`, `mongodb-memory-server`, and Redis mocks. Name test files with `.test.ts`, for example `tests/unit/plugins/loader.test.ts`.

Every new feature or code path must include matching tests in `tests/`. Add unit suites for isolated logic and integration suites for API, persistence, plugin, processor, or worker behavior.

## Commit & Pull Request Guidelines
Use short Conventional Commit style messages such as `feat: add email retry policy`, `fix: handle missing template`, or `docs: update setup notes`. Keep commits focused.

PRs should include a summary, linked issue when applicable, test evidence, and screenshots or GIFs for `dashboard/` UI changes. Husky `pre-push` runs both lint commands.

## Security & Configuration Tips
Do not commit secrets. Use `.env.example` as the template for `.env`, and update it when adding configuration. For local full-stack work, prefer `docker-compose.dev.yaml`; for core-only work, start infrastructure with `docker compose -f docker-compose.infra.yaml up -d`.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Notes:
## Contribution Workflow

1. Look into the open issues on [simplens-core issues](https://github.com/SimpleNotificationSystem/simplens-core/issues) and choose an issue you like to solve.
2. Create a new branch (`<type_of_issue>-<name>`) from the `master` branch.
2. Create a new branch (`<type_of_issue>-<name>`) from the `development` branch.
3. Solve or complete the feature/bug mentioned in the issue.
4. Add or update tests for behavior changes.
5. Run lint + tests locally.
Expand Down
3 changes: 3 additions & 0 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "dashboard",
"version": "1.2.1",
"private": true,
"engines": {
"node": ">=22.0.0"
},
Comment on lines +5 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use Node 22 in the dashboard image

The dashboard package now declares node >=22, but the image built and pushed by this workflow still comes from dashboard/Dockerfile, whose deps, builder, and runner stages are all node:20-alpine (dashboard/Dockerfile:4, :15, :33). This ships the dashboard on a runtime the package says is unsupported; Node 22-only code or dependencies can pass local/CI lint under Node 22 but fail in the published container, so either update the Dockerfile to Node 22 or do not raise the dashboard engine requirement.

Useful? React with 👍 / 👎.

"scripts": {
"dev": "next dev -p 3002",
"build": "NODE_ENV=production next build",
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"description": "Open-source plugin-based notification orchestration engine for developers who value control ",
"main": "dist/api/server.js",
"type": "module",
"engines": {
"node": ">=22.0.0"
},
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
Expand Down
3 changes: 3 additions & 0 deletions packages/config-gen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "1.0.2",
"description": "CLI tool to generate simplens.config.yaml from plugin manifests",
"type": "module",
"engines": {
"node": ">=22.0.0"
},
"bin": {
"simplens-config": "./dist/index.js"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/create-simplens-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
],
"author": "",
"license": "MIT",
"engines": {
"node": ">=22.0.0"
},
"dependencies": {
"@clack/prompts": "^1.0.0",
"chalk": "^5.3.0",
Expand All @@ -44,9 +47,6 @@
"typescript": "^5.0.0",
"vitest": "^2.0.0"
},
"engines": {
"node": ">=18.0.0"
},
"files": [
"dist",
"README.md"
Expand Down
3 changes: 3 additions & 0 deletions packages/mcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"description": "Remote MCP server for SimpleNS notification orchestration engine",
"type": "module",
"main": "dist/index.js",
"engines": {
"node": ">=22.0.0"
},
"bin": {
"simplens-mcp": "dist/index.js"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/onboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "1.0.11",
"type": "module",
"main": "dist/index.js",
"engines": {
"node": ">=22.0.0"
},
"bin": {
"simplens-onboard": "./dist/index.js"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"engines": {
"node": ">=22.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true
"resolveJsonModule": true,
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
Expand Down
Loading