Commit Graph

37 Commits (46be3ad28e953b18d20bd76b703d3fc7d4ede9ae)

Author SHA1 Message Date
Tom d05a2cb7d4
fix: comment dictionary with submodule (#55527)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2024-07-18 17:17:12 +02:00
Sem Bauke fde6a505fd
chore: delete web directory and curriculum server (#55071) 2024-06-04 12:34:58 +02:00
Sem Bauke 84b1a402a8
refactor: remove component library as internal dependency (#54322) 2024-04-08 19:35:30 +02:00
Oliver Eyton-Williams 074af6effb
chore: reorganise playwright config (#53884) 2024-02-26 19:56:54 +05:30
Oliver Eyton-Williams 2f6430a85e
chore: cleanup (prettier/git)ignore (#51558) 2023-09-18 10:00:53 -07:00
Oliver Eyton-Williams 391fc2e34d
refactor: create shared workspace (#51454) 2023-09-07 23:06:01 +05:30
Oliver Eyton-Williams c0719934ac
chore(config): migrate constants to TS (#51485) 2023-09-06 18:27:34 +05:30
Oliver Eyton-Williams 9885d1a779
refactor: move browser-script output into client (#51422) 2023-09-06 18:22:20 +05:30
Oliver Eyton-Williams b778eb568d
feat: generate types for ui-components (#51184) 2023-08-16 19:54:43 +05:30
Oliver Eyton-Williams e99154665e
refactor: convert is-audited to TypeScript (#51232) 2023-08-14 15:50:22 +05:30
Oliver Eyton-Williams 9441f781fd
refactor: move challenge types to config (#51027) 2023-07-24 13:12:47 -07:00
Ahmad Abdolsaheb eb22bc0a82
feat: use component library's dropdown component in learn (#50465)
Co-authored-by: Sboonny <muhammed@freecodecamp.org>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Bruce Blaser <bbsmooth@gmail.com>
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
2023-06-22 09:21:05 -05:00
Tom 167a8e7638
refactor: remove dasherize (#50620) 2023-06-07 23:28:56 -07:00
Tom 373e808938
refactor(config): superblocks and map (#50435) 2023-06-01 14:51:57 +02:00
Ahmad Abdolsaheb d3396a2017
feat(client): expose nav donate button for non-donor (#49705)
Co-authored-by: Muhammed Mustafa <muhammed@freecodecamp.org>
2023-03-21 13:31:44 +05:30
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
Tom Fattah 03fbf03c91
refactor(tools/scripts): convert validate and get-lines to TS (#48622)
* fix(tools/scripts) convert validate and get-lines to typescript files

* fix(tools/scripts) refactor validate and get-lines to typescript

* remove any type and eslint ignore

* Update utils/validate.ts

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* address comments

* update .ignore files to ignore newly generated utils files

* Update utils/get-lines.ts

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

* remove unneeded ErrorInterface

* add local type annotation to 'expected' variable

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-01-08 21:55:06 +00:00
Ahmad Abdolsaheb a73996c174
Revert "fix(client): expose donate button on navigation bar" (#48902)
Revert "fix(client): expose donate button on navigation bar (#48820)"

This reverts commit 959d667aeb.
2023-01-03 18:26:15 +05:30
Ahmad Abdolsaheb 959d667aeb
fix(client): expose donate button on navigation bar (#48820)
* feat: expose donate nav button

* feat: add the ignores

* fix: adjust tests

* feat: adjust nav button styles
2023-01-03 10:40:47 +01:00
Ahmad Abdolsaheb bff61255f9
feat(donation): simplify donation client (#46379)
* feat: unify post payment actions

* feat: handle stripe card error and add donation after auth

* feat: add donation saga stripe test

* feat: add more coverage to stripe tests

* feat: add initial stripe card saga test

* feat: finalize initial stripe card saga test

* feat: add patreon test saga

* feat: test clean up

* feat: do not show processing for Patreon

* feat: normalize donation settings

* feat: turn payment provider/contex to enum

* feat: remove donation-settings.js

* fix: git ignore generated config

* fix: ignore the generate config from everything

* fix: remove types.js

* fix: update linting to include types.js

Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
2022-12-20 18:03:06 +05:30
Tom 60d15e4631
feat: get footer from cdn (#47174)
Co-authored-by: ahmad abdolsaheb <ahmad.abdolsaheb@gmail.com>
Co-authored-by: scissorsneedfoodtoo <scissorsneedfoodtoo@gmail.com>
2022-12-01 15:23:17 +01:00
Mrugesh Mohapatra a4bf79fe0f
fix(lint): stop tripping over docs (#48447) 2022-11-10 13:58:53 +01:00
Tom 5f73773cd4
feat(client): move legacy rwd button to bottom of map (#47596)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Closes https://github.com/freeCodeCamp/freeCodeCamp/issues/46523
2022-11-08 21:00:46 +05:30
Mrugesh Mohapatra b393d88b9e
refactor: s/all-langs/i18n/g (#48258) 2022-10-26 10:08:27 -07:00
Valentin 4acaa58892
chore(utils): migrate block-nameify to TS and add unit tests (#48086) 2022-10-17 19:03:36 +01:00
Naomi Carrigan fba16b7dd1
fix: lint json (#47565)
* 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......
2022-09-20 13:57:34 +01:00
Palash Gupta a745fcb9b3
chore: utils/index.js is updated to .ts (#46556)
* test: utils index is updated to ts

* chore: utils.js is added into the .gitignore and .prettierignore
2022-07-25 09:20:14 +02:00
Oliver Eyton-Williams cf4b9a1557
feat: client overhaul proof of concept (#45844)
* 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>
2022-05-09 11:30:15 -05:00
palash-signoz 004c5b6fb6
chore(utils): ts-migration of utils/slugs (#44921)
* 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>
2022-03-29 08:51:13 -07:00
Oliver Eyton-Williams 7216ca55cc
refactor: organise TypeScript config and migrate helpers (#44747)
* 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
2022-01-25 11:34:16 +01:00
Vinay 5b61c8a56f
refactor(client): ts-migration of i18n/validate-keys.js (#44292)
* refactor - file extenstion change to .ts

* fix - imports syntax

* fix - migration complete

* fix - lint:prettier warn

* refactor - validate-keys in tools/scripts/lint/

* refactor - validate-keys.ts moved to tools/scripts/lint and added in tsconfig.json

* refactor - tsconfig.json file for tools

* fix - lint:ts script update and validate-keys.js added to .eslintignore

* fix - lint:prettier and ts compilation

* fix - ts compilation

* refactor - changes in .gitignore and validate-keys script
2021-11-30 08:37:00 -08:00
Shaun Hamilton d75e43a1e7
chore: use constants for superblocks (#43886)
* 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>
2021-11-19 19:49:40 +05:30
Nicholas Carrigan (he/him) 26319e0094
fix: ignore package-lock (#44148) 2021-11-10 08:05:05 +01:00
Oliver Eyton-Williams c8d7f0a782
feat(tools): remove eslint-plugin-prettier for prettier (#42438)
* 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
2021-10-06 21:02:21 +05:30
Nicholas Carrigan (he/him) 81a49ec94b
fix(learn): Disable prettier formatting on challenge files (#40370)
* Ignore challenge files

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>
2020-12-03 18:10:15 +01:00
Shaun Hamilton 493880ffaf
feat(learn): add mocha and chai instructions (#39976)
* feat(learn): add mocha and chai instructions

* test: added one new lesson

* rename added file and add tests

* add meta to prettierignore, fix formatting

* add unit-test numbering

* add examples from boilerplate

Co-authored-by: Randell Dawson <rdawson@onepathtech.com>

* remove code comments, add description

* elaborate test testStrings

Co-authored-by: Randell Dawson <rdawson@onepathtech.com>
2020-11-26 10:05:42 -08:00
Oliver Eyton-Williams b8bdbc7dc8 feat: Add scripts to format and lint with prettier 2019-07-19 15:30:17 +05:30