Skip to content

Move functionality from ptr-fe-core#45

Merged
barluq merged 20 commits intomainfrom
jan26-from-frontend-npm
Mar 3, 2026
Merged

Move functionality from ptr-fe-core#45
barluq merged 20 commits intomainfrom
jan26-from-frontend-npm

Conversation

@barluq
Copy link
Collaborator

@barluq barluq commented Feb 21, 2026

All code from ptr-fe-core was moved into this libray. The exception is OpenID, that has been moved, but need to be refactored first.

Solves:

Summary:
This pull request introduces several important improvements and refactorings across the codebase, focusing on error handling, dependency management, documentation, and build configuration. The main highlights are the centralization and expansion of error classes, updates to dependencies and installation instructions, and improved documentation for both developers and AI agents. Below are the most significant changes grouped by theme:

Error Handling and Refactoring:

  • Centralized error classes (InvalidRequestError, AuthorizationError, ServerError, SSROnlyError) into a new file src/node/api/models.errors.ts, replacing scattered definitions and updating all imports accordingly. This improves maintainability and consistency for error handling throughout the codebase. [1] [2] [3] [4] [5] [6] [7]
  • Added a new handleRouteError utility and moved the messageFromError function to src/node/api/parsing.errors.ts, standardizing API error responses.
  • Updated exports in src/index.node.ts to use the new centralized error classes and added exports for SQLite and OpenID Connect utilities. [1] [2]
  • Removed legacy error definitions from src/node/api/errors.api.ts.

Dependency Management and NPM Refresh:

  • Updated the peerDependencies and devDependencies in package.json to the latest major versions, and added new peer dependencies (openid-client, sqlite, sqlite3).
  • Improved the NPM refresh process instructions in .github/prompts/npmrefresh.prompt.md to clarify the use of the latest major versions and ensure peer dependencies remain in the correct section.
  • Added a new documentation file docs/npm-refresh-commands.md with clear commands for reinstalling peer and dev dependencies using the latest versions.

Documentation Improvements:

  • Rewrote and expanded Readme.md to clarify the build process, outputs, configuration, and usage for both frontend and backend applications. Added a section for AI agent instructions. [1] [2]
  • Removed the outdated AGENTS.md file, consolidating agent-related instructions into .github/ and the main README.

Build and Linting Configuration:

  • Improved ESLint configuration by adding an ignore block for build, test, and config files, ensuring cleaner linting results. [1] [2]

Other Changes:

  • Added commented-out (future-use) code for authentication handlers in src/node/auth/handlers.callbackFetch.ts and src/node/auth/handlers.logoutFetch.ts to support backend fetch operations. [1] [2]
  • Updated the package description in package.json to reflect support for SSR applications.

These changes collectively improve the maintainability, clarity, and reliability of the shared library, making it easier to use and extend for both backend and frontend Panther applications.

- Updated package.json to include sqlite and sqlite3 as peer dependencies.
- Added db.connection.ts to manage SQLite database connections and structure.
- Created db.commands.ts for saving application states with expiration handling.
- Introduced db.queries.ts for retrieving application states from the database.
- Defined db.defaults.ts for default database configurations and table names.
- Updated peerDependencies and devDependencies in package.json to latest versions.
- Added new documentation file npm-refresh-commands.md with instructions for reinstalling peer and dev dependencies using the latest published versions.
feat(auth): add session and logout fetch handlers
feat(auth): implement OpenID Connect server-side context
@LukasDufek LukasDufek self-requested a review February 24, 2026 15:53
Copy link

@LukasDufek LukasDufek left a comment

Choose a reason for hiding this comment

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

Maybe just fix the tests

@LukasDufek LukasDufek self-requested a review February 24, 2026 15:54
@barluq barluq merged commit 542bb43 into main Mar 3, 2026
1 check passed
@barluq barluq deleted the jan26-from-frontend-npm branch March 3, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants