* test: increase timeouts for slow operations
* test: ignore ChunkLoadErrors again
* test: clean up commands
* Revert "fix(cypress): disable electron due to timeouts (#46231)"
This reverts commit 2b884d9dd9.
* test: various minor refactors
* chore(deps): Included dependency review
> Dependency Review GitHub Action in your repository to enforce dependency reviews on your pull requests.
> The action scans for vulnerable versions of dependencies introduced by package version changes in pull requests,
> and warns you about the associated security vulnerabilities.
> This gives you better visibility of what's changing in a pull request,
> and helps prevent vulnerabilities being added to your repository.
https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
* Update .github/workflows/dependency-review.yml
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* 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: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissionshttps://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissionshttps://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
* Update .github/workflows/codeql-analysis.yml
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* Update .github/workflows/labeler.yaml
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* Update .github/workflows/node.js-tests-upcoming.yml
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* Update .github/workflows/node.js-tests.yml
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* Update .github/workflows/codeql-analysis.yml
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* Update .github/workflows/labeler.yaml
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* Update .github/workflows/labeler.yaml
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
* fix: fallback to english challenges
All challenges will use the english version if a translated file is not
available. SHOW_NEW_CURRICULUM still gates what's shown in the client.
* refactor: use closures to simplify createChallenge
* refactor: remove messy destructure
* refactor: add meta via helper
* fix: fallback to [] for meta.required
* fix: repair challenge.block
* refactor: use CONST_CASE for meta + challenge dirs
* fix: catch empty superblocks immediately
* fix: clean up path.resolves
* fix: invalid syntax in JS project steps
* fix: default to english comments and relax tests
Instead of always throwing errors when a comment is not translated, the
tests now warn while SHOW_UPCOMING_CHANGES is true, so that tests will
pass while we're developing and allow translators time to work.
They still throw when SHOW_UPCOMING_CHANGES is false to catch issues
in production
* test: update createCommentMap test
* refactor: delete stale comment
* refactor: clarify validate with explanatory consts
* feat: throw if audited cert falls back to english
* fix: stop testing upcoming localized curriculum
* 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
* fix: handle missing solutions correctly
Rather than creating an [[]] the parser now creates [] which isEmpty().
This makes the test suite check the next challenge for a solution.
In addition, the logic for testing solutions was fixed.
* chore: update snapshots
* test: build new superblock in node.js-tests CI
* test: allow forward slash in superblock slug
* fix: borked tests oops
* test: ignore duplicated projects
* fix: i did not break these shaun did :)
* fix: idIndex is index of id not id
Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
* test: login more directly
* test: separate login from other visits
In a single test, Cypress can only visit within a single domain, hence
the separation.
* chore: fail slowly for all strategies
* test: user certified user for showing cert
* test: fix and cleanup certifications
* 👷 CodeSee now works with PRs in forks
This change updates the CodeSee Architecture Diagram workflow to enable PR diagrams from forks.
* Adds back in the run condition
Missed this bit when I was copying over the updated template, adding it back in.
* Ran prettier on the workflow file
* 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
* test: check that JS projects can be submitted.
* refactor: remove stale workflow comments
* refactor: remove redundant build
* chore: update Cypress version in CI
* test: create separate electron-only workflow
* test: put data-cy on correct button
* test: drop mailhog from electron CI
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
* refactor: update differences comment
* test: separate toggling from logging in
* test: check solutions can be viewed on cert
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
* chore: rename APIs and Microservices to include "Backend" (#42515)
* fix typo
* fix typo
* undo change
* Corrected grammar mistake
Corrected a grammar mistake by removing a comma.
* change APIs and Microservices cert title
* update title
* Change APIs and Microservices certi title
* Update translations.json
* update title
* feat(curriculum): rename apis and microservices cert
* rename folder structure
* rename certificate
* rename learn Markdown
* apis-and-microservices -> back-end-development-and-apis
* update backend meta
* update i18n langs and cypress test
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
* fix: add development to front-end libraries (#42512)
* fix: added-the-word-Development-to-front-end-libraries
* fix/added-the-word-Development-to-front-end-libraries
* fix/added-word-development-to-front-end-libraries-in-other-related-files
* fix/added-the-word-Development-to-front-end-and-all-related-files
* fix/removed-typos-from-last-commit-in-index.md
* fix/reverted-changes-that-i-made-to-dependecies
* fix/removed xvfg
* fix/reverted changes that i made to package.json
* remove unwanted changes
* front-end-development-libraries changes
* rename backend certSlug and README
* update i18n folder names and keys
* test: add legacy path redirect tests
This uses serve.json from the client-config repo, since we currently use
that in production
* fix: create public dir before moving serve.json
* fix: add missing script
* refactor: collect redirect tests
* test: convert to cy.location for stricter tests
* rename certificate folder to 00-certificates
* change crowdin config to recognise new certificates location
* allow translations to be used
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
* add forwards slashes to path redirects
* fix cypress path tests again
* plese cypress
* fix: test different challenge
Okay so I literally have no idea why this one particular challenge
fails in Cypress Firefox ONLY. Tom and I paired and spun a full build
instance and confirmed in Firefox the page loads and redirects as
expected. Changing to another bootstrap challenge passes Cypress firefox
locally. Absolutely boggled by this.
AAAAAAAAAAAAAAA
* fix: separate the test
Okay apparently the test does not work unless we separate it into
a different `it` statement.
>:( >:( >:( >:(
Co-authored-by: Sujal Gupta <55016909+heysujal@users.noreply.github.com>
Co-authored-by: Noor Fakhry <65724923+NoorFakhry@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>