Further work to move from CJS to ESM as well as better use of import type ... rather than generic import ...
This commit is contained in:
parent
1ae24c01b0
commit
358fbfcc76
19 changed files with 35 additions and 28 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import 'reflect-metadata';
|
||||
import { Application } from 'express';
|
||||
import type { Application } from 'express';
|
||||
|
||||
import { logMessage, LogLevel } from '@BridgemanAccessible/ba-logging';
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Application } from 'express';
|
||||
import type { Application } from 'express';
|
||||
|
||||
export abstract class BaseController {
|
||||
static setup(app: Application) {}
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Request, Response, NextFunction } from 'express';
|
||||
import type { Request, Response, NextFunction } from 'express';
|
||||
|
||||
import { ErrorController } from '../controllers/ErrorController.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Request, Response, NextFunction } from 'express';
|
||||
import type { Request, Response, NextFunction } from 'express';
|
||||
|
||||
// Response type guard
|
||||
function isResponse(obj) {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Request, Response, NextFunction, RequestHandler } from 'express';
|
||||
import type { Request, Response, NextFunction, RequestHandler } from 'express';
|
||||
|
||||
export enum HealthCheckStatus {
|
||||
OK = 'ok',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue