Compare commits

..

No commits in common. "56be45cc94a0ae31fe256db85cd4e8fc0d2839b2" and "737dbfa1e0329ed3d5380bd27de2a006ebfad884" have entirely different histories.

6 changed files with 20 additions and 31 deletions

View file

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

View file

@ -1,6 +1,6 @@
{ {
"name": "@BridgemanAccessible/ba-web-framework", "name": "@BridgemanAccessible/ba-web-framework",
"version": "1.0.10", "version": "1.0.6",
"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.", "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", "author": "Bridgeman Accessible <info@bridgemanaccessible.ca",
"repository": "https://github.com/Bridgeman-Accessible/ba-web-framework.git", "repository": "https://github.com/Bridgeman-Accessible/ba-web-framework.git",

View file

@ -98,6 +98,15 @@ export class Initializer {
// Setup global middleware // Setup global middleware
await this.setupMiddleware(app); 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) // Setup the static file resolver (how the app serves static files)
if(typeof this.staticFilesPath !== 'undefined') { if(typeof this.staticFilesPath !== 'undefined') {
await (new StaticFileResolver(this.staticFilesPath)).setup(app); await (new StaticFileResolver(this.staticFilesPath)).setup(app);
@ -118,14 +127,5 @@ export class Initializer {
else { else {
await (new Renderer()).setup(app); 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,9 +142,6 @@ 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(', ')}`); 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, { const client = await Client.setup(app.getExpressApp(), baseAppUrl, this.onAuth, this.saveSecret, appAbbrv, this.appName, this.scopes, {
contacts: this.contacts, contacts: this.contacts,
logo_url: this.logo_url, logo_url: this.logo_url,
@ -158,7 +155,6 @@ export class OAuthApp extends App {
}); });
client.getSetupRoutes().forEach((route) => { client.getSetupRoutes().forEach((route) => {
console.log(`Adding outside framework route: ${route}`);
app.getInitializer().getRouter().addOutsideFrameworkRoute(route); app.getInitializer().getRouter().addOutsideFrameworkRoute(route);
}); });
} }

View file

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

View file

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