Commit Graph

74 Commits

Author SHA1 Message Date
Oliver Eyton-Williams
a128dd8fcd chore(api): compile TS into /dist (#49812
* chore: compile TS into /dist

Having the output co-located with the source meant that the js would be
imported by default. Given that we don't recompile on source changes,
this means the server got 'stuck' at the point of compilation and would
only register changes on build.

Also, compiling to a dist directory should make it easier to build when
we want to deploy. That said, the motivation is mostly DX.

* fix: put schema.prisma in the default location
2023-03-28 19:42:20 +05:30
renovate[bot]
afa246942e fix(deps): update dependency fastify to v4.15.0 2023-03-26 15:59:50 +00:00
renovate[bot]
7f21c5b4ae fix(deps): update dependency nodemon to v2.0.22 2023-03-26 03:01:14 +00:00
Niraj Nandish
1dcba784fd feat(api): API documentation with Swagger UI (#49791) 2023-03-24 10:00:51 +01:00
Oliver Eyton-Williams
a0f958189e chore: update api test suite and include it in run test (#49794) 2023-03-23 16:57:11 +00:00
Oliver Eyton-Williams
36b06be8ce chore: extend lint:ts to cover api (#49793)
* fix: include express-session types + suppress err

* chore: add api to lint:ts

* fix: remove unnecessary typeRoots config
2023-03-22 17:59:46 +05:30
renovate[bot]
607111978a fix(deps): update prisma monorepo to v4.11.0 (#49758)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-19 12:25:26 +05:30
Oliver Eyton-Williams
17d7fc0af5 feat(api): use pino-pretty for dev logging (#49713)
feat: use pino-pretty for dev logging
2023-03-16 15:42:01 +00:00
Tom
7aeb4ab76b feat(api): setup jest in new api (#49709)
* feat(api): setup jest in new api

* feat: sample tests
2023-03-16 20:33:40 +05:30
Oliver Eyton-Williams
c2d149ba85 feat(api): create a demo type provider for typebox (#49536)
* feat: create a demo type provider for typebox

* feat: validate reply + share type

* fix: prettify
2023-03-15 14:21:25 +00:00
Oliver Eyton-Williams
fa7955dc75 feat(api): add prisma as orm (#49413) 2023-03-14 17:29:55 +00:00
renovate[bot]
748dea033c fix(deps): update dependency fastify to v4.14.1 2023-03-11 19:45:28 +00:00
Niraj Nandish
4769a448e1 feat(api): sessions management (#49499)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-03-09 20:36:33 +05:30
renovate[bot]
933b909111 fix(deps): update dependency fastify to v4.14.0 2023-03-05 10:44:01 +00:00
renovate[bot]
72321ad76b fix(deps): update dependency nodemon to v2.0.21 2023-03-04 17:30:13 +00:00
Oliver Eyton-Williams
d7848ae01a feat: migrate to pnpm for better workspace DX (#49293)
* feat: npm -> pnpm 

This resolves the issues with the gatsby client (gatsby-plugin-pnpm
deals with the fact that gatsby is relying on its own dependencies
being de-duped)
and challenge-editor (which doesn't seem to want to automatically install
codemirror and needed its own eslint config)

* fix: correct mocha path for curriculum tests

* fix: use select workspace with -F not -w

* fix: reorganise packages and restrict hoisting

pnpm works best if the workspaces keep their own dependencies, since
dependencies are not flattened and then what node resolves from a
require is predictable.

@types seem to be a special case and more care is required to prevent
them getting smushed together in the root (hence the .npmrc)

* fix: add types for tools + root

* fix: decouple challenge-auditor from client

* fix: add ui-components types

* fix(client): use the latest types for react 16

* fix: prettify

* fix: prettierignore pnpm-lock

* fix: relax hoisting

Turns out pnpm works just fine with types. I don't know what was going
wrong before, but there are no-longer any type conflicts.

* fix: add @redux-saga/core to fix eslint issue

It seems to only be redux-saga that import/named can't cope with, so it
is probably okay to work around this one.

* chore: add chai to tools/scripts/build

* fix: add store to root for cypress

* fix: allow cypress to download binaries

If we want to keep preventing cypress from downloading binaries, we can
figure out a workaround, but I'm allowing it to ease the transition to
pnpm.

My guess about why this is happening is that npm triggers Cypress's
postinstall script, but pnpm does not (because pnpm install only
installs if necessary, perferring to link)

* chore: re-enable pre/post scripts

* fix: update build scripts for client

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* chore: update engines to use pnpm


* fix: enable choice of (super)block for tests

Only 'nix machines for now.

* chore: pin pnpm to version 7

* chore: remove last npms

Except web + curriculum-server. I'll update them when I start work on
them again.

* fix: lockfile check to catch any package-locks

* fix(action): install pnpm for upcoming tests

* chore: add nodemon to new api

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-02 18:17:44 +00:00
renovate[bot]
e0975e21e5 fix(deps): update dependency fastify to v4.13.0 2023-02-26 07:19:37 +00:00
renovate[bot]
b36bf511d5 fix(deps): update dependency @fastify/mongodb to v6.2.0 (#49512)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-25 17:49:32 +02:00
renovate[bot]
ab2b6907d2 fix(deps): update dependency fastify to v4.10.2 [security] 2023-02-24 22:43:58 +00:00
Mrugesh Mohapatra
7199f033fb feat(next-api): basic authentication setup (#49378)
* feat(next-api): add fastify-auth0-verify plugin

* feat(next-api): add fastify-jwt-authz plugin

* feat(next-api): accept privacy endpoint with scopes support

* fix(next-api): ignore eslint and ts errors

They will be fixed in a future PR when the package with errors has been updated

Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-02-24 17:26:40 +05:30
Oliver Eyton-Williams
f35ab4d0ba refactor: clean up types and tsconfig (#49360) 2023-02-24 17:25:53 +05:30
Shaun Hamilton
37ed23ef38 feat(api): add node:test (#48437) 2023-02-24 17:25:22 +05:30
Shaun Hamilton
f7644bec68 feat(api): example middleware (#48434)
* feat(api): add middleware example

* feat(api): add `@fastify/middie`, reorder for alphabetness

* [skip-ci] [skip ci]
2023-02-24 17:25:21 +05:30
Shaun Hamilton
6d46f61fe9 refactor(api): shiny new api (#48432) 2023-02-24 17:23:15 +05:30