Compare commits

..

11 commits

Author SHA1 Message Date
Alan Bridgeman
56be45cc94 Changed automation from GitHub to Forgejo + some small improvements
Some checks failed
Publish to Private NPM Registry / publish (push) Failing after 1m24s
2025-06-18 05:03:17 -05:00
Alan Bridgeman
6ab565449a An order of operations oversight in terms of needing a route to not 404 before/during the registration rather than setting it up after 2025-05-01 12:57:47 -05:00
GitHub Actions
eb662a603d [Github Actions] Update version to v1.0.10 2025-05-01 17:24:23 +00:00
Alan Bridgeman
4d82f31c05 Merge new package version number back 2025-05-01 12:23:24 -05:00
Alan Bridgeman
e5aad0db46 Forgot to export OAuthApp class 2025-05-01 12:22:54 -05:00
GitHub Actions
0c998767d0 [Github Actions] Update version to v1.0.9 2025-05-01 03:03:25 +00:00
Alan Bridgeman
ebe1532873 Reordered how things are setup in the Intializer so that static files get treated properly 2025-04-30 22:02:59 -05:00
GitHub Actions
b32c58f292 [Github Actions] Update version to v1.0.8 2025-04-30 22:22:59 +00:00
Alan Bridgeman
96624325f3 Updated the version 2025-04-30 17:21:31 -05:00
Alan Bridgeman
bc5f0a7085 Forgot to export one of the classes 2025-04-30 17:21:20 -05:00
GitHub Actions
6014e910a6 [Github Actions] Update version to v1.0.7 2025-04-30 20:02:03 +00:00
6 changed files with 31 additions and 20 deletions

View file

@ -7,17 +7,13 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
runs-on: default
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Set up NPM Auth Token
- name: Set up NPM Auth Token
run: echo "NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
# Set up NPM Auth Token
- name: Set up NPM Auth Token
run: echo "NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
@ -77,10 +73,18 @@ jobs:
- name: Commit Version Change (if needed)
if: steps.version_check.outputs.version_changed == 'true'
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
# Update remote URL to use the GITHUB_TOKEN for authentication
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@git.bridgemanaccessible.ca/${{ github.repository }}.git
# Setup git user details for committing the version change
git config user.name "Forgejo Actions"
git config user.email "actions@git.bridgemanaccessible.ca"
# Commit the version change to the `package.json` file
git add package.json
git commit -m "[Github Actions] Update version to ${{ env.new_version }}"
git commit -m "[Forgejo Actions] Update version to ${{ env.new_version }}"
# Push the changes to the repository
git push origin HEAD:main
# Publish to private NPM registry

View file

@ -1,6 +1,6 @@
{
"name": "@BridgemanAccessible/ba-web-framework",
"version": "1.0.6",
"version": "1.0.10",
"description": "A framework for web apps built atop Node, Express and other libraries and utilties that makes creating and maintaining Bridgeman Accessible web apps easier.",
"author": "Bridgeman Accessible <info@bridgemanaccessible.ca",
"repository": "https://github.com/Bridgeman-Accessible/ba-web-framework.git",

View file

@ -98,15 +98,6 @@ export class Initializer {
// Setup global middleware
await this.setupMiddleware(app);
// Setup the router (how the app handles requests)
if(typeof this.controllersPath !== 'undefined') {
this.router = new Router(this.controllersPath);
}
else {
this.router = new Router();
}
await this.router.setup(app);
// Setup the static file resolver (how the app serves static files)
if(typeof this.staticFilesPath !== 'undefined') {
await (new StaticFileResolver(this.staticFilesPath)).setup(app);
@ -127,5 +118,14 @@ export class Initializer {
else {
await (new Renderer()).setup(app);
}
// Setup the router (how the app handles requests)
if(typeof this.controllersPath !== 'undefined') {
this.router = new Router(this.controllersPath);
}
else {
this.router = new Router();
}
await this.router.setup(app);
}
}

View file

@ -142,6 +142,9 @@ export class OAuthApp extends App {
console.log(`Attempting to create/register the app:\n\tApp Base URL: ${baseAppUrl}\n\tApp Abbreviation: ${appAbbrv}\n\tApp Name: ${typeof this.appName === 'undefined' ? 'uses APP_NAME environment variable (' + process.env.APP_NAME + ')' : this.appName}\n\tScopes: ${typeof this.scopes === 'undefined' ? 'uses SCOPES environment variable (' + process.env.SCOPES + ')' : this.scopes.join(', ')}`);
// Because we need this for registration to work properly. It make sense to put it here
app.getInitializer().getRouter().addOutsideFrameworkRoute('/.well-known/jwks.json');
const client = await Client.setup(app.getExpressApp(), baseAppUrl, this.onAuth, this.saveSecret, appAbbrv, this.appName, this.scopes, {
contacts: this.contacts,
logo_url: this.logo_url,
@ -155,6 +158,7 @@ export class OAuthApp extends App {
});
client.getSetupRoutes().forEach((route) => {
console.log(`Adding outside framework route: ${route}`);
app.getInitializer().getRouter().addOutsideFrameworkRoute(route);
});
}

View file

@ -1,3 +1,4 @@
import { BaseController } from './BaseController';
import { ErrorController } from './ErrorController';
export { BaseController };
export { BaseController, ErrorController };

View file

@ -3,13 +3,15 @@ import { Initializer } from './Initializer';
import { Router } from './Router';
import { Renderer } from './Renderer';
import { StaticFileResolver } from './StaticFileResolver';
import { OAuthApp } from './OAuthApp';
export {
App,
Initializer,
Router,
Renderer,
StaticFileResolver
StaticFileResolver,
OAuthApp
};
export * from './controllers';
export * from './decorators';