Commit Graph

48 Commits (67ff9af1c293a9ef5491b18926808327a11f029c)

Author SHA1 Message Date
Sem Bauke eb84dce6ca
chore: remove Cypress (#55056) 2024-06-14 10:09:40 -07: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
Muhammed Mustafa 49b728d31b
refactor: disable naming-convenction rule (#51685) 2023-09-30 20:23:39 +07:00
Oliver Eyton-Williams 391fc2e34d
refactor: create shared workspace (#51454) 2023-09-07 23:06:01 +05:30
Mrugesh Mohapatra b5c86d4b9c
feat(e2e): adding playwright and migrate landing page e2e tests (#51216)
Co-authored-by: Ahmad <57593864+Ahmadkashif@users.noreply.github.com>
Co-authored-by: Hassaan Pasha <pasha.hassaan@gmail.com>
2023-08-11 14:10:10 +05:30
Naomi Carrigan 0aa1ad0d09
feat: require JSDoc in new api (#50429)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-08-03 21:50:54 +05:30
Oliver Eyton-Williams 69d6ee32bf
feat: python in the browser (#50913)
Co-authored-by: Beau Carnes <1513130+beaucarnes@users.noreply.github.com>
2023-07-28 07:36:25 +02:00
Oliver Eyton-Williams 9441f781fd
refactor: move challenge types to config (#51027) 2023-07-24 13:12:47 -07:00
Jacques Metevier 1f9c1e9d21
chore(deps): upgrade eslint (#50614)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-06-06 17:58:27 +02:00
Mrugesh Mohapatra c97cae27e1 feat(tools): add warnings for filename-convention 2023-03-18 22:12:47 +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
Oliver Eyton-Williams f35ab4d0ba
refactor: clean up types and tsconfig (#49360) 2023-02-24 17:25:53 +05:30
Sem Bauke 12fd5c4d32
feat: enable TypeScript for Cypress (#48701)
* feat: enable TypeScript for Cypress

* fix: run both js and ts in workflow
2022-12-10 17:12:42 +02:00
Shaun Hamilton ec3ee856ec
feat(tools): ignore no-unused-vars on underscore (#48386) 2022-11-04 10:43:46 +05:30
Niraj Nandish 53164e71f1
fix: circular dependencies (#46638)
* fix: circular dependency in formHelpers

* fix: circular dependency in Flash

* fix: circular dependency in helpers

* fix: circular dependency in current-challenge-saga (1/2)

* fix: circular dependency in code-lock-epic

* feat: eslint rule for circular dependencies

* fix: circular dependency in tools

* fix: import error and more circular dependencies in formHelpers

* fix prettier error

* fix: circular dependency in danger-zone-saga

* fix: circular dependency in update-email-saga

* fix: circular dependency in settings-saga

* fix: circular dependency in accept-terms-saga

* fix: circular dependency in codeally-saga

TODO: make a separate file for selectors

* fix: ci lint error

* fix: ci lint:prettier error

* fix: circular dependency in current-challenge-saga

* fix: cricular dependency in Challenges/redux

* fix: circular dependency in redux/settings

* fix: circular dependency in root redux

* fix: lint errors

* chore: remove unecessary comment

* chore: remove unused export

* fix: clear out actions and selectors

* revert changes to package.json

* test ci with maxDepth of 1

* fix: fallback to empty object

* test action if it will run for maxDepth of 2
2022-10-05 18:08:40 +01:00
Oliver Eyton-Williams 9a46590a8a
fix: allow arbitrary names if they are quoted (#46619) 2022-06-23 00:54:07 +05:30
Oliver Eyton-Williams effe4d41d6
chore: add no-only-tests to eslint (#46595) 2022-06-21 20:08:20 +04: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
Huyen Nguyen 06a1aa39b2
chore(ui-components): minor adjustments in Button component (#45480) 2022-03-23 11:23:26 +03: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
Oliver Eyton-Williams 60258d40c9
fix: order import (again) (#44670)
* refactor: reenable import ordering

* refactor: require alphabetic ordered imports
2022-01-05 16:05:50 -06:00
Oliver Eyton-Williams efba2e777d
chore: simplify eslint configuration (#44347)
* chore: extend import/recommended

* chore: use recommended lint rules

* refactor: apply lint rules

* chore: drop used config
2021-12-02 00:01:12 +00: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
Oliver Eyton-Williams 89c94e54e7
chore(client): add and apply naming convention (#44110)
* refactor: remove unused types

* chore: add naming-convention lint rule

* refactor: rename redux proptypes

* chore: remove Type suffix from prop-types

* chore: apply conventions to ajax

* chore: apply convention to create-types

* chore: apply convention to show-project-links

* chore: search-bar

* chore: Hotkeys

* chore: privacy

* chore: portfolio

* chore: search-page-hits

* chore: search-suggestion

* chore: search-hits

* chore: no-hits-suggestion

* chore: timeline-pagination

* chore: various profile files

* chore: heat-map

* chore: portfolio

* chore: certifications

* chore: landing-top

* chore: certifications

* chore: campers-image

* chore: big-call-to-action

* chore: paypal related files

* chore: show-user

* chore: show-settings

* chore: show-certification

* test: rename profile snap

* fix: ignore snake case for stripe card form

* refactor: remove duplicate type declarations

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

* fix: handle null solutions in Timeline

* test: add remaining Profile props

* refactor: revert accidental rename

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-11-11 10:09:50 -08:00
RobertoMSousa cb0a502d82
chore: tree shaking - unused / redundant code (#43867) 2021-10-15 13:13:43 +05:30
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
Hamza Waleed ebec6705a3
feat(typescript): Add typescript support for UI components library (#43541)
* Add TS configs and improve dir structure

* Add TS configs and improve dir structure

* Fix components exports from index

* chore: prettier

* Add tsconfig and then fix the linter warnings

* Add @babel/preset-typescript

* Fix eslint rule and update btn component to fix storybook

* Fix TS and Jest configs

Converted all remaining files to TS as well

* Remove TS ignored rules and fixed some TS & jest stuff

* Revert to old directory structure

* Use absolute versions in package.json

* enable ts strict to infer types

Co-authored-by: Hamza Waleed <hamza.waleed@arbisoft.com>
2021-09-28 14:06:21 +03:00
Christian Z. Tamayo e2d6639773
feat(e2e): Add cypress globals to eslint overrides (#43234)
fix(docs): Remove cypress eslint note on e2e docs
2021-08-24 16:29:00 +02:00
Anirudh Modi ef3b7ec955
chore(eslint): enables recommended eslint rules for `testing-library` and `jest-dom` (#42817) 2021-07-20 21:21:16 +07:00
Huyen Nguyen 52b61c736d
chore(eslint): use recommended configs for jsx-a11y (#42818) 2021-07-10 21:06:47 +01:00
Huyen Nguyen 2c16234853
chore: add jest global variables (#42573) 2021-06-20 09:14:42 +02:00
Oliver Eyton-Williams bd4d46915a
feat(curriculum): add project creation tool (#42410)
* refactor: extract help category map as JSON

* refactor: extract block names as json

* feat: add create-project script

* fix: correct case for tsconfig target

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

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2021-06-09 00:57:45 +05:30
Huyen Nguyen fdf1de38e5
feat(tools): setup react testing library in ui-components (#42221)
* feat(tools): setup react testing library in ui-components

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2021-06-07 09:01:20 +02:00
Oliver Eyton-Williams 9c6701bf10
fix: eslint config (#42228)
The typescript parser does not work properly on pure JS and is only
needed for TS files, so this commit restricts @typescript-eslint/parser
to .ts and .tsx files
2021-05-24 17:45:39 +07:00
Oliver Eyton-Williams 66dae77fc5
feat: use TypeScript in the client (#42124) 2021-05-18 00:23:41 +05:30
Mrugesh Mohapatra 6c91f81b0e chore(deps): upgrade eslint, prettier & related packages 2021-03-11 12:19:42 +05:30
Patrick Lehmann 4c242505b7
fix(eslint): meld into main repo (#40182)
Co-authored-by: Pat Lehmann <patrick.lehmann@homes.com>
2020-11-21 23:36:46 +05:30
Oliver Eyton-Williams 0a4316b0ae fix(client): update eslint and fix issues
The eslint config now includes rules that have been added to Gatsby.
This uncovered some problems with missing labels that have been fixed.
2020-09-24 16:29:55 +05:30
Oliver Eyton-Williams 58bd0b5ce4
chore(tools): add jsx-a11y Eslint plugin (#38438)
* chore(tools): add a11y eslint plugin

* fix: use Gatsby's a11y eslint rules

* fix(search): remove unnecessary mouse listeners
2020-03-26 10:25:47 +05:30
Oliver Eyton-Williams f50ac6e115 chore: extend linting to cover react hooks (#36725) 2019-08-30 21:10:23 +05:30
Valeriy S 1faa8dc0c1 fix: set a max-len rule for eslint 2019-02-26 00:18:46 +05:30
Valeriy be36915605 feat: use prettier with eslint 2019-02-19 14:30:27 +05:30
Bouncey 7a30a5c2dd fix: Remedy review comments 2019-02-19 14:30:27 +05:30
Bouncey 8e0237d042 chore: Apply linting fixes 2019-02-19 14:30:27 +05:30
Bouncey 36d150cbe1 chore: Install update freecodecamp eslint config 2019-02-19 14:30:27 +05:30