Compare commits
11 commits
737dbfa1e0
...
56be45cc94
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56be45cc94 | ||
|
|
6ab565449a | ||
|
|
eb662a603d | ||
|
|
4d82f31c05 | ||
|
|
e5aad0db46 | ||
|
|
0c998767d0 | ||
|
|
ebe1532873 | ||
|
|
b32c58f292 | ||
|
|
96624325f3 | ||
|
|
bc5f0a7085 | ||
|
|
6014e910a6 |
6 changed files with 31 additions and 20 deletions
|
|
@ -7,7 +7,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout the repository
|
# Checkout the repository
|
||||||
|
|
@ -18,10 +18,6 @@ jobs:
|
||||||
- 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
|
||||||
|
|
||||||
# Set up NPM Auth Token
|
|
||||||
- name: Set up NPM Auth Token
|
|
||||||
run: echo "NODE_AUTH_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
# Set up Node.js
|
# Set up Node.js
|
||||||
- name: Set up Node.js version
|
- name: Set up Node.js version
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
|
|
@ -77,10 +73,18 @@ 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: |
|
||||||
git config user.name "GitHub Actions"
|
# Update remote URL to use the GITHUB_TOKEN for authentication
|
||||||
git config user.email "actions@github.com"
|
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 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
|
git push origin HEAD:main
|
||||||
|
|
||||||
# Publish to private NPM registry
|
# Publish to private NPM registry
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@BridgemanAccessible/ba-web-framework",
|
"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.",
|
"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",
|
||||||
|
|
|
||||||
|
|
@ -98,15 +98,6 @@ 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);
|
||||||
|
|
@ -127,5 +118,14 @@ 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -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(', ')}`);
|
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,
|
||||||
|
|
@ -155,6 +158,7 @@ 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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
import { BaseController } from './BaseController';
|
import { BaseController } from './BaseController';
|
||||||
|
import { ErrorController } from './ErrorController';
|
||||||
|
|
||||||
export { BaseController };
|
export { BaseController, ErrorController };
|
||||||
|
|
@ -3,13 +3,15 @@ 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';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue