Skip to content

Latest commit

 

History

History
 
 

README.md

Code.org Learning Platform Frontend

This directory contains packages and applications that power Code.org sites.

Note: Most of Code.org's Studio product (student experience, curriculum, teacher tools, etc.) is built in the top-level apps package and is not currently located in this directory. For the marketing sites application, go to the code-dot-org/marketing-sites repo.

What's inside?

This directory uses Turborepo to manage the monorepo and uses the following package structure:

  • apps: Applications or services (Contentful CMS, Storybook, etc.)
  • packages: Libraries, build tools, configurations (Shared linter configs, component library, etc.)

Apps

Open source Code.org applications:

Packages

Publicly available packages:

Getting Started

(!!!) If you're unable to find some information in this README.md, please refer to the documentation of package/app that you're working on. (e.g. go to packages/component-library/README.md, apps/studio/README.md, etc)

Prerequisites

Ensure that corepack is enabled.

corepack enable

Initialize the frontend package:

yarn install

Build

Turborepo will automatically detect changed sub-directories and appropriately cache to avoid duplicate work.

To build all apps and packages, run the following command:

yarn build

Develop

To develop on the studio application, run in the frontend directory

yarn dev

Changing any monorepo managed dependencies (such as labs) will automatically trigger a rebuild and be made available to the persistent dev server using Turborepo's watch feature.

Formatting, Linting. (Prettier, ESLint, Stylelint)

To format all files in all packages and apps, run the following command:

yarn lint:fix

You can also run this command for some specific package or app using yarn workspace:

yarn lint:fix --filter @code-dot-org/component-library

OR

yarn workspace @code-dot-org/component-library lint:fix

Pre-release Testing

To run all tests that the pull-request quality checks do:

yarn release:dryrun

This command executes all lint, test, and build commands.

Visual Snapshot Testing (Eyes)

The design system uses Applitools Eyes via their Storybook integration to take a visual snapshot of a storybook component and compare it with baselines. Visual snapshots on pull requests and during the CI build.

To run visual snapshots locally, first obtain an Applitools API Key.

Then, assign the API key to frontend/.env in the APPLITOOLS_API_KEY key. (If this file does not exist, copy it from frontend/.env.example)

To run the visual tests:

yarn workspace @code-dot-org/design-system-storybook eyes-storybook

If differences are detected, follow the baseline update guide to resolve.

Cleaning

To remove build artifacts, use the following commmand:

yarn clean