Stumped on how to handle this situation: I have an Express app: @app. That app is using a package I made: @helper. @helper receives a variable app:Express from @app and does some stuff with it.
Should I have "express" installed on both @app and @helper? They would need the same version, and I don't know how I could enforce that. I could skip installing express on @helper and just keep @types/express, but I'd still have the same risk of @helper breaking if @app upgrades express.
Should I be trying to decouple @helper from express? @helper is doing a lot with the variable app:Express, and trying to swap-out everything express related with custom functions would be messy.
Any advice or guidance would be greatly appreciated!
For example:
@app index.ts:
import express from "express"
import { doStuff } from "@helper"
const app = express()
doStuff(app)
@helper index.ts:
export function doStuff( app: Express ) {
app.get("/route", (req, res) => { })
}