GithubHelp home page GithubHelp logo

khan / perseus Goto Github PK

View Code? Open in Web Editor NEW
1.4K 120.0 350.0 170.55 MB

Perseus is Khan Academy's exercise question editor and renderer.

Home Page: https://khan.github.io/perseus/

License: MIT License

HTML 0.06% JavaScript 5.36% CSS 0.52% Yacc 0.05% Less 1.73% Shell 0.13% TypeScript 92.15%

perseus's Introduction

Perseus

codecov npm Version License

perseus logo

Perseus Exercise Renderer

Perseus is Khan Academy's exercise system. This repo contains the code needed to take a problem in the Perseus format and present it, allow interaction, and grade the result of a learner's work.

sample of Perseus in use

This repo is a constellation of sub-repos for showing exercise content. Please see individual projects in in the packages/ folder for more information about each sub-project.

Getting started

Prerequisites

Installation

To install Perseus, you need to run the following commands:

yarn

Installs project dependencies and tooling

Using Storybook

The components and widgets of Perseus are developed using Storybook. After you clone the project and get dependencies installed, the next step is to start storybook by running yarn storybook. This will start a server and give you a playground to use each component.

Using Changesets

We use changesets to help manage our versioning/releases. Before pushing a new PR, add a changeset by running yarn changeset. Commit and submit that with the PR.

Updating Dependencies

If you want to use another library in Perseus, you will need up update the dependencies. Use peerDependencies and devDependencies for dependencies that webapp is already using, such as Wonder Blocks or React.

  1. cd into to the package in which you would like to update the dependency.
cd packages/[package-name]

// Example
cd packages/perseus-editor
  1. Run the following command to update the dev dependencies and the peer dependencies.
// All dependencies
yarn add --dev [dependency name]
// Include this too if webapp is using this dependency
yarn add --peer [dependency name]

// Example
yarn add --dev @khanacademy/wonder-blocks-button
yarn add --peer @khanacademy/wonder-blocks-button

Contributing

The Perseus project is not accepting external contributions. We’re releasing the code for others to refer to and learn from, but we are not open to pull requests or issues at this time.

KA Contribution Guide

For a slightly more detailed overview, see the "Shipping a Change to Perseus" document in Confluence.

Perseus is a monorepo - a single repository that ships multiple npm packages. Generally you can treat Perseus as a single code base; things should generally just work as you expect them to during the development process. We use scripts and a tool called changesets to keep package inter-dependencies organized, release the one repo to multiple npm packages, and version changes appropriately.

Working

  1. git checkout main; git pull

  2. git checkout -b [FEATURE_BRANCH_NAME]

  3. ☢️ We don’t use deploy branches in Perseus

  4. Start a dev server

    a. yarn start will start Storybook on localhost:6006

    b. yarn dev will start the custom Dev UI on localhost:5173

  5. Do stuff

  6. yarn test will run Jest/RTL tests; yarn cypress will run Cypress tests

  7. yarn changeset will walk you through creating a changeset (we generally stick to semver)

  8. ☢️ Empty changesets should be considered an exception to the rule and should generally be avoided

  9. git add and git commit

  10. git pull-request will walk you through creating a pull request

CI/CD aka Github

  1. When you create/update a PR, we run a series of checks against your code
    • Gerald requests reviewers (there’s a “perseus” user group that primary maintainers are in)
    • Linting/Types/Tests; checks to make sure code is properly covered
    • Check for a changeset
  2. 🍀 A snapshot release is made and can be used to check changes before merging/releasing
  3. Once checks pass and code is approved, land your changes into main using git land
  4. 🚨 main should always be releasable! Don’t land code to main that you’re not ready to ship!
  5. 🍀 Use stacked feature branches if you’re working on a big change that depends on multiple PRs

Releasing Perseus to npm

  1. Landing changes to main creates/updates a “Version Packages” PR
  2. To cut a Perseus release, approve and land the “Version Packages” PR (typically with git land)
  3. ☢️ If the CI/CD checks aren’t running, you might need to close and reopen the PR
  4. After the release script runs, you should see the new releases on the release page

License

MIT License

perseus's People

Contributors

aag avatar anakaren-rojas avatar benchristel avatar catandthemachines avatar daniellewhyte avatar dependabot[bot] avatar eamspoker avatar github-actions[bot] avatar handeyeco avatar ioanacrant avatar jaredly avatar jeanettehead avatar jeremywiebe avatar jeresig avatar kevinbarabash avatar khan-actions-bot avatar mark-fitzgerald avatar mpolyak avatar myranae avatar nedredmond avatar nicolecomputer avatar nishasy avatar nixterrimus avatar pmcgill88 avatar somewhatabstract avatar sonicscrewdriver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.