Compare commits

..

2 commits

Author SHA1 Message Date
Alan Bridgeman
f79ed4d7e4 Merge branch 'main' of https://git.bridgemanaccessible.ca/Bridgeman-Accessible/ba-web-framework
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 30s
2026-01-08 13:46:11 -06:00
Alan Bridgeman
358fbfcc76 Further work to move from CJS to ESM as well as better use of import type ... rather than generic import ... 2026-01-08 13:45:41 -06:00
19 changed files with 35 additions and 28 deletions

View file

@ -35,7 +35,7 @@
"create-ba-web-app": "node ./bin/create-project.js"
},
"dependencies": {
"@BridgemanAccessible/ba-auth": "^1.0.10",
"@BridgemanAccessible/ba-auth": "^1.0.11",
"@BridgemanAccessible/ba-logging": "^1.0.1",
"express": "^4.19.2",
"fs-extra": "^11.2.0",

View file

@ -1,5 +1,5 @@
import 'reflect-metadata';
import { Application } from 'express';
import type { Application } from 'express';
import { logMessage, LogLevel } from '@BridgemanAccessible/ba-logging';

View file

@ -1,6 +1,9 @@
import path from 'path';
import fse from 'fs-extra';
import { JSDOM } from 'jsdom';
import jsdom from 'jsdom';
import type { JSDOM as JSDocument } from 'jsdom';
const { JSDOM } = jsdom;
/** The inputs for setting up the meta tags */
type SetupMetaTagInputs = {
@ -33,7 +36,7 @@ export class BaseTemplateCreator {
private output: string;
/** The DOM of the template */
private dom: JSDOM;
private dom: JSDocument;
/** The document of the template */
private document: Document;

View file

@ -1,4 +1,5 @@
import express, { Application, RequestHandler } from 'express';
import express from 'express';
import type { Application, RequestHandler } from 'express';
import { Router } from './Router.js';
import { StaticFileResolver } from './StaticFileResolver.js';

View file

@ -1,6 +1,7 @@
import { Application } from 'express';
import type { Application } from 'express';
import { Scopes } from '@BridgemanAccessible/ba-auth';
import Client, { OnAuthCallback } from '@BridgemanAccessible/ba-auth/client';
import Client from '@BridgemanAccessible/ba-auth/client';
import type { OnAuthCallback } from '@BridgemanAccessible/ba-auth/client';
import { logMessage, LogLevel } from '@BridgemanAccessible/ba-logging';
import { App } from './App.js';

View file

@ -1,8 +1,9 @@
import { existsSync, statSync } from 'fs';
import path from 'path';
import { Application } from 'express';
import type { Application } from 'express';
import { BaseTemplateInputs, BaseTemplateCreator } from './BaseTemplateCreator.js';
import { BaseTemplateCreator } from './BaseTemplateCreator.js';
import type { BaseTemplateInputs } from './BaseTemplateCreator.js';
export class Renderer {
/** The default folder name for the views */

View file

@ -1,5 +1,5 @@
import path from 'path';
import { Application } from 'express';
import type { Application } from 'express';
import fse from 'fs-extra';
import { logMessage, LogLevel } from '@BridgemanAccessible/ba-logging';

View file

@ -1,6 +1,7 @@
import { existsSync, statSync } from 'fs';
import path from 'path';
import express, { Application } from 'express';
import express from 'express';
import type { Application } from 'express';
/**
* A class that wraps around Express's static file serving functionality.

View file

@ -1,4 +1,4 @@
import { Application } from 'express';
import type { Application } from 'express';
export abstract class BaseController {
static setup(app: Application) {}

View file

@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
export abstract class ErrorController {
/** A human readable string to describe the error this controller handles. */

View file

@ -1,4 +1,4 @@
import { Application, Request, Response, NextFunction } from 'express';
import type { Application, Request, Response, NextFunction } from 'express';
import { BaseController } from '../controllers/BaseController.js';

View file

@ -1,5 +1,5 @@
import { NextFunction } from 'express';
import { NextHandleFunction } from 'connect';
import type { NextFunction } from 'express';
import type { NextHandleFunction } from 'connect';
export const DELETE_METADATA_KEY = 'Delete';

View file

@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import { ErrorController } from '../controllers/ErrorController.js';

View file

@ -1,5 +1,5 @@
import { NextFunction } from 'express';
import { NextHandleFunction } from 'connect';
import type { NextFunction } from 'express';
import type { NextHandleFunction } from 'connect';
export const POST_METADATA_KEY = 'Put';

View file

@ -1,5 +1,5 @@
import { NextFunction } from 'express';
import { NextHandleFunction } from 'connect';
import type { NextFunction } from 'express';
import type { NextHandleFunction } from 'connect';
export const PUT_METADATA_KEY = 'Put';

View file

@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
// Response type guard
function isResponse(obj) {

View file

@ -1,4 +1,4 @@
import { Request, Response, NextFunction, RequestHandler } from 'express';
import type { Request, Response, NextFunction, RequestHandler } from 'express';
/**
* Class that creates middleware to set global template values for all pages.

View file

@ -1,4 +1,4 @@
import { Request, Response, NextFunction, RequestHandler } from 'express';
import type { Request, Response, NextFunction, RequestHandler } from 'express';
export enum HealthCheckStatus {
OK = 'ok',

View file

@ -2,10 +2,10 @@
# yarn lockfile v1
"@BridgemanAccessible/ba-auth@^1.0.10":
version "1.0.10"
resolved "https://npm.pkg.bridgemanaccessible.ca/@BridgemanAccessible/ba-auth/-/ba-auth-1.0.10.tgz#423b14799c8b34d22e39ac36b46f945d31ac3690"
integrity sha512-pvQ79lo+9vHL9Um4FDWnRZIX+uVkFhCeZqwYhYLb6ixNZ+RTYhmuIrcMV6VfRI6S1ozSkgIK4S6htHspExoylQ==
"@BridgemanAccessible/ba-auth@^1.0.11":
version "1.0.11"
resolved "https://npm.pkg.bridgemanaccessible.ca/@BridgemanAccessible/ba-auth/-/ba-auth-1.0.11.tgz#fd32e23bacef1985a2eac017e8aabe9a0b8a4d0d"
integrity sha512-GctJaXhWthvn6UZCq8Ymc9IQbUy1Ew9fj4XoVdh6vGDlum4H399SdM2arBkv6t8QBHyVBe1Y+LuABb8nWOoNPw==
dependencies:
"@BridgemanAccessible/ba-logging" "^1.0.1"
"@azure/identity" "^4.0.1"