Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
589a95b
feat(database): implement SQLite integration for state management
barluq Jan 23, 2026
56167f8
refactor(database): restructure SQLite integration and move enums to …
barluq Jan 23, 2026
2dbbb0d
feat(sqlite): add enums and default constants for SQLite integration
barluq Jan 23, 2026
4b9d450
chore: update dependencies and add npm refresh commands documentation
barluq Jan 23, 2026
3333c23
refactor(errors): move error classes to models.errors and update imports
barluq Jan 23, 2026
8f8d848
feat(dependencies): add openid-client as a peer dependency
barluq Jan 24, 2026
e80c971
feat(auth): implement OpenID Connect functionality and update handlers
barluq Feb 19, 2026
eb088d7
refactor(docs): update README for clarity and remove AGENTS.md
barluq Feb 19, 2026
327535c
refactor(docs): update README structure for clarity and improve confi…
barluq Feb 19, 2026
baec643
feat(auth): enhance OpenID handling with PKCE and add tests for autho…
barluq Feb 23, 2026
2853872
refactor(auth): remove unused OpenID handlers and clean up related code
barluq Feb 24, 2026
6795a08
refactor(auth): remove OpenID Connect export for server-side rendering
barluq Feb 24, 2026
e46834f
feat(workflows): add testing workflows for code and push events
barluq Mar 2, 2026
77f538c
feat(workflows): enhance CI workflows with permissions and concurrenc…
barluq Mar 2, 2026
f2a1ce6
feat(auth): add OpenID Connect SSR context for authorization code gra…
barluq Mar 2, 2026
966429b
refactor(workflows): rename workflow for clarity and consistency
barluq Mar 2, 2026
bcd7a96
refactor(auth): remove OpenID Connect SSR context and related tests
barluq Mar 2, 2026
48dcb0a
refactor(tests): remove unused docker-build job from tests workflow
barluq Mar 2, 2026
1777784
refactor(tests): replace code-test workflow with inline steps for cla…
barluq Mar 2, 2026
22ad10f
refactor(workflows): remove obsolete testing-push workflow
barluq Mar 2, 2026
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
4 changes: 2 additions & 2 deletions .github/prompts/npmrefresh.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Process:
1. delete `node_modules` folder
2. delete `package-lock.json` file
3. read `package.json` and prepare two CLIs:
- one for installing all dependencies in `peerDependencies` with `npm install <packages_in_peerDependencies> --save`
- second for installing all devDependencies in `devDependencies` with `npm install <packages_in_devDependencies> --save-dev`
- one for installing all dependencies in `peerDependencies` with `npm install <packages_in_peerDependencies> --save`. Use newest major versions. Dependencies must stay in `peerDependencies`, not in `dependencies`.
- second for installing all devDependencies in `devDependencies` with `npm install <packages_in_devDependencies> --save-dev`. Focus on newest major versions.
5. save both CLIs into `docs/npm-refresh-commands.md` file with header "NPM Refresh Commands" and short description of the process
6. execute both CLIs
7. check if `package.json` needs to be restructured according to `.github/instructions/package-json.instructions.md` file, if yes, restructure it
Expand Down
41 changes: 23 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,34 @@ on:
- dev
- rc

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
code:
tests-and-linting:
runs-on: ubuntu-latest

timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: npm install
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '24'

- name: Run tests
run: npm test
- name: Install dependencies
run: npm install

build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run linter (ESLint)
run: npm run lint

- name: Install dependencies
run: npm install
- name: Build project
run: npm run build

- name: Build project
run: npm run build
- name: Run tests
run: npm run test
46 changes: 43 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
node_modules
dist
.rollup.cache
.DS_Store
Thumbs.db

# Node
node_modules/
npm-debug.log
yarn-error.log
package-lock.json
yarn.lock
pnpm-lock.yaml
yalc.lock
.yalc/

# TypeScript / build output
dist/
build/
*.tsbuildinfo

# Environment files
.env
.env.local
.env.*

# Logs
logs
*.log
.nyc_output
coverage/

# IDE / devcontainer
.vscode/
.idea/
.devcontainer/

# Misc
*.nogit.*
CHANGELOG.md
CONTRIBUTING.md

# AI Agent Specific
GEMINI.md
CLAUDE.md
AGENTS.md
50 changes: 0 additions & 50 deletions AGENTS.md

This file was deleted.

35 changes: 31 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Shared Library for Panther Backend
This repository contains source of shared functionalities across Panther backend services.
# NPM Library for Panther Backends
NPM package with shared functionalities across Panther projects (FE and BE).

## Build and Outputs
The NPM contains two standalone builds made from Typescript by Rollup.

- Globals NPM (FE + BE):
- From `index.browser.ts` containing exports from `src/globals/**/*`.
- This is shared functionality between FE and BE services like models, code helpers etc..

- Node NPM:
- Containes all from globals
- By `index.node.ts` containing exports from `src/node/**/*`. This is Node JS only funtionality. Everything with peer dependency to Node.js packages should be here.

Production build and publishing is realised by Github Workflow.

## Configuration Files
As mentioned, Rollup set up in `rollup.config.js` make two standalone builds named by purpose.

Important is setup in `package.json`
- `type` with value `module`
- `exports`, each for one NPM target
- Empty `dependencies`.
- All required dependencies defined in `peerDependencies` field.

Each build platform has defined standalone `tsconfig` in the repository root. Final `tsconfig.json` is merged together by platform or purpose.

## Installation (DEV)
- Install Node and NPM
Expand All @@ -12,11 +36,14 @@ This repository contains source of shared functionalities across Panther backend
- Run `npm run dev` for development mode with Rollup build watcher and auto yalc publishing.

## Usage in Applications
- FE based apps should use imports from `@gisatcz/ptr-be-core/browser`
- NodeJS based apps should use imports from `@gisatcz/ptr-be-core/node`
- FE apps (in browser) should use imports from `@gisatcz/ptr-be-core/browser`
- Node.js apps and NextJS backend routes should use imports from `@gisatcz/ptr-be-core/node`

## Resources
- YALC (local NPM): https://github.com/wclr/yalc
- Vitest (testing): https://vitest.dev
- Barrelsby (TS Imports into one `index.ts`): https://github.com/bencoveney/barrelsby
- Rollup (NPM package build): https://rollupjs.org

## AI Agents (Important)
Please folow instructions in `.github/` for better code results.
17 changes: 17 additions & 0 deletions docs/npm-refresh-commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# NPM Refresh Commands

Short description: commands to reinstall peer and dev dependencies using the newest published majors. The peer-dependency install uses `--no-save` to avoid moving peer entries into `dependencies`.

1) Install peer dependencies (use latest published versions, do not modify package.json):

```
npm install lodash@latest luxon@latest pino@latest sqlite@latest sqlite3@latest --no-save
```

2) Install devDependencies (use latest published versions and save to `devDependencies`):

```
npm install @rollup/plugin-json@latest @rollup/plugin-node-resolve@latest @rollup/plugin-typescript@latest @types/lodash@latest @types/luxon@latest @types/node@latest @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest eslint@latest eslint-plugin-node@latest rollup@latest rollup-plugin-dts@latest ts-node@latest tsc-alias@latest tsconfig-paths@latest tslib@latest tsx@latest typescript@latest typescript-eslint@latest vite@latest vite-tsconfig-paths@latest vitest@latest --save-dev
```

Run these two commands from the repository root to refresh packages.
13 changes: 10 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

export default defineConfig([
{
ignores: [
'**/dev/*',
'**/dist/*',
'**/tests/*',
'tsconfig.json',
]
},
{
files: ["**/*.ts"],
ignores: ["**/node_modules/**", "**/dist/**", "vitest.config.ts"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
Expand All @@ -16,10 +23,10 @@ export default defineConfig([
"@typescript-eslint": tseslint.plugin,
},
extends: [
"@typescript-eslint/recommended",
"@typescript-eslint/recommended",
],
rules: {
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-explicit-any": "off",
},
},
]);
Loading