* fix: lint these json again
* broken: check for failures on trailing comma
* revert: remove intentionally broken commit for ci demonstration
This reverts commit 526187df2f.
* fix: maybe this is why we had it turned off......
* chore: initial setup of web package
This is *not* a workspace, yet, because it would be nice to use the
latest React, but /client can't migrate (yet).
Having two React versions creates issues in workspaces since /.bin/next
gets hoisted to root... and finds the root React version :(
* feat: add config for next
* fix: use jsx-runtime for web linting
* chore: init curriculum-server with json-server
* chore: integrate curriculum-server with TS/eslint
* feat: add patch script
json-server doesn't like keys with '/'s in so, for now I'm just patching
them out.
This lets us keep a strong separation between this WIP and the rest of
the code.
* fix: use port 8000 to avoid conflicts
* feat: crude ISR demo using challenge pages
* feat: extend ISR demo to use params
* feat: return props for specific superblocks
* chore: re-organise folders
* refactor: put data fetching in a single module
* refactor: challenge page slightly
* feat: add link to test ISR
You can see that, if you run next dev, the linked page gets regenerated
whenever you navigate to it. However, if you run next build that is no
longer the case and the page has to be reloaded for the user to see the
latest version.
The implication is that we'll need another method (Web worker, probably)
to detect if the page needs to be updated.
* feat: render static paths for rwd
* feat: add monaco Editor
* feat: send less data via props
Rather than sending superblocks, this now sends blocks. Next step, just
the challenge!
* fix: only send individual challenge's data
* feat: send /learn/stuff/<id> to the challenge page
* fix: redirect to path with trailing id
* fix: handle all possible path prefixes
* feat: add superblocks with trailing ids
* chore: rename block -> blockOrId
* chore: remove logs
* fix: return notFound if page id is missing
* chore: add a note about increasing TS strictness
* feat: serverside redirects
This should be a touch more performant, but mostly it separates the
concerns.
Since the server already has the responsibility of choosing what pages
to render, redirects fit naturally with its concerns.
* refactor: clean up param validation
* feat: create list of blocks in superblock
* feat: add challenge links to map
* feat: link to full path, not just id
* refactor: ensure props match getStaticProps
By specifying the props for GetStaticProps we ensure that it returns the
expected data and use InferGetStaticPropsType to get the type out again
for use in the component
* feat: improve and document dev experience
* refactor: separate routing from rendering
* refactor: extract routing logic into functions
* refactor: naming consistency
* refactor: move data wrangling into get-curriculum
* refactor: align blockOrId and id
* chore: remove the server from workspaces
* chore: remove the lock
* docs: paths
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
* chore: install before linting
* fix: create env.json before installing new client
* chore: ignore generated json file
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
* chore: utils is added in the tsconfig
* test(util): test and test function is updated to typescript
* chore: add tsconfig for utils
* fix: exclude files importing from client/
* fix: refactor to just export functions
* chore: add emitted files to prettierignore
* fix: add new tsconfig to eslint project
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* feat: allow more 1000 steps to be created at once
* refactor: start migrating to typescript
* refactor: delete-step to ts
* refactor: migrated some helpers
* refactor: migrate create-empty-steps
* refactor: migrate create-step-between
* refactor: finish migrating to TS
* refactor: migrate tests
* fix: ensure mock.restore is done after each test
* fix: prevent double-tscing
* fix: repair the tests
* chore: use ts-node for scripts
We don't need the performance boost of incremental compilation and
ts-node is easier to work with
* refactor: consolidate tsconfigs
* refactor: replace gulp
* fix: use ts-node for build-curriculum
* fix: allow ts compilation of config
* feat: create and use create:config script
* fix: add /config to eslint projects
* fix: remove gulp script
* chore: use constants for superblocks
* add prettier ts dec to challenge-helper-scripts
* config/ to ts. broken
* typescripterise tools/ and config/
* create global tsconfig, remove alternate configs
* delete temp ts->js, add to gitignore
* fix gitignore
* re-import SuperBlocks in super-block-intro.tsx
* remove renamed files added again
* fix config
* remove accidental files
* remove snap
* delete built files
* adjust eslintrc for enums
* add node types to root
* ignore build files in lint and prettier
* fix tools/ in tsconfig
* ignore annoying ts warnings
* prettierise Map/index.tsx
* fix enum to match lint rule
* rejig Map to render RWD superblock
* 'pretty minor' - implicitly tsc within root
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* fix client/package.json for Gitpod
* broken: migrate @types to root
* fix: use typeRoots to prevent duplication
* fix show.tsx, try typeroots in root
* silly fix for duplicate node_modules types
* remove typeRoots from root
* fix: tsconfig or not tsconfig, that is the...
* fix: ...question: Whether 'tis nobler in the mind
to suffer the slings and arrows of outrageous configs...
* fix: Or to take Arms against a Sea of lint errors
And by opposing end them
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* feat: remove eslint-plugin-prettier for prettier
This removes the annoying lint warnings when all that needs to change is
formatting
* fix: use .js lint-staged config to ignore properly
* fix: lint everything if a lot of files are changed
It's faster than making lots of individual linter calls
* chore: apply prettier
* fix: ignore code in curriculum-file-structure