Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions frontend/@types/jquery/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
interface JQuery<Element extends HTMLElement> {
addClass(
className_function:
| JQuery.TypeOrArray<string>
| ((this: TElement, index: number, currentClassName: string) => string)
| (null | undefined | never | false)
): this;

html(
htmlString_function:
| JQuery.htmlString
| JQuery.Node
| ((
this: TElement,
index: number,
oldhtml: JQuery.htmlString
) => JQuery.htmlString | JQuery.Node)
| (null | undefined | never | false)
): this;
text(
text_function:
| string
| number
| boolean
| ((
this: TElement,
index: number,
text: string
) => string | number | boolean)
| (null | undefined | never | false)
): this;
attr(
attributeName: string,
value_function:
| string
| number
| null
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
| ((
this: TElement,
index: number,
attr: string
) => string | number | void | undefined)
| (null | undefined | never | false)
): this;
}
10 changes: 6 additions & 4 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ In 3 terminals (in the root of `nightscout/cgm-remote-monitor`), run:
- `caddy run` Runs `caddy` to reverse proxy frontend/backend onto same port (`3000`)

## To run tests
- `npm run build:tsc` will build the project with `tsc`, compiling all the typescript and javascript into `./dist`. At the moment it requires the additional flags `--module commonjs --moduleResolution node` for mocha to run. Migrating everything to ES modules would fix this. I _think_ that if we used `vitest` instead, this build step would not be necessary
- `npm run test` will run mocha on files matching `./dist/*.test`

- `npm run test` will run the tests and exit.
- `npm run test:watch` will rerun the tests as they change.

Dont forget to set your env!

## Aims
- Reduce build time for both hmr in development and building for production.

- Reduce build time for both hmr in development and building for production.
- Allow for incremental migration from `function init()`s to `class`es
- Get "go to definition" working as much as possible
- Use typescript wherever possible

In general, my aim is to migrate to a more modern tech stack to make it easier and more enjoyable to work on.
In general, my aim is to migrate to a more modern tech stack to make it easier and more enjoyable to work on.
Loading