{"id":18989401,"url":"https://github.com/source-academy/modules","last_synced_at":"2025-06-22T11:06:46.905Z","repository":{"id":40254292,"uuid":"174501177","full_name":"source-academy/modules","owner":"source-academy","description":"Modules that can be imported by programs in Source Academy, an online experiential environment for computational thinking","archived":false,"fork":false,"pushed_at":"2025-06-21T14:48:27.000Z","size":148946,"stargazers_count":8,"open_issues_count":47,"forks_count":31,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-22T11:06:32.920Z","etag":null,"topics":["source-academy","source-language"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/source-academy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-03-08T08:47:05.000Z","updated_at":"2025-06-13T23:32:26.000Z","dependencies_parsed_at":"2023-10-23T15:28:53.857Z","dependency_job_id":"df44ff13-bf09-4f80-8352-968f325f1998","html_url":"https://github.com/source-academy/modules","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/source-academy/modules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/source-academy%2Fmodules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/source-academy%2Fmodules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/source-academy%2Fmodules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/source-academy%2Fmodules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/source-academy","download_url":"https://codeload.github.com/source-academy/modules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/source-academy%2Fmodules/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261282322,"owners_count":23134939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["source-academy","source-language"],"created_at":"2024-11-08T17:06:35.430Z","updated_at":"2025-06-22T11:06:46.855Z","avatar_url":"https://github.com/source-academy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Modules\n\n![License](https://img.shields.io/badge/License-Apache%202.0-brightgreen) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/source-academy/modules/github%20pages?label=Build)\n\nThis repository contains the default modules of the Source Academy and their documentation, deployed to the default module site at \u003chttps://source-academy.github.io/modules\u003e.\n\nThe [Source Academy](https://sourceacademy.org) and [Source Academy @ NUS](https://sourceacademy.nus.edu.sg) are configured to access the default module site when evaluating `import` directives.\n\n[Documentation of Source Academy modules](https://source-academy.github.io/modules/documentation).\n\n## Information for Module Developers\n\nSee the modules [wiki](https://github.com/source-academy/modules/wiki) for more details.\n\n### Terminology\n\n| **Term**   | **Description**                                                    |\n| ---------- | ------------------------------------------------------------------ |\n| **Module** | A set of **one** bundle _with the same name_ and **some/no** tabs. |\n| **Bundle** | The suite of functions that are provided by the module.            |\n| **Tab**    | A user interface used by the module.                               |\n\n### Getting Started\n\nThe following set of instructions explain how to clone and set up a copy of the `modules` code repository on your local development machine. Following the steps below will create a  `modules` directory in your local development machine and install the necessary dependencies of the project.\n\nThe recommended version of [Node.js](https://nodejs.org/en/) for local development is Node.js 20. You may use a Node.js version manager such as [nvm](https://github.com/creationix/nvm#installation) _(macOS/Linux)_ or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node.js versions between different projects.\n\nThis project also uses [Yarn](https://yarnpkg.com/) as a package manager. You may install and enable Yarn by running the following command.\n```bash\ncorepack enable\n```\n\nIf the above does not work, you can manually install the Yarn package manager through [NPM](https://www.npmjs.com/) using the following command.\n\n```bash\nnpm install -g yarn\n```\n\nYou may also require [Python](https://www.python.org/downloads/) to run build scripts and install project dependencies. We recommend either using Python 2.7 or Python 3.8-3.11.\n\nClone the repository on your local development machine and navigate to it using your favourite command line or shell tool.\n\n```bash\ngit clone https://github.com/source-academy/modules.git\ncd modules\n```\n\nInstall all the dependencies of the project into `node_modules` in the root folder of your project directory.\n\n```bash\nyarn install\n```\n\nIf you encounter errors with esbuild dependencies like the following while building:\n\n```plaintext\nError: The package \"@esbuild/darwin-arm64\" could not be found, and is needed by esbuild.\n```\n\nYou will need to delete the `node_modules` folder and rerun `yarn install` to fix the issue.\n\n### Serve Modules\n\nThe following set of instructions explain how to transpile and serve the modules from your local development machine's code repository. Following the steps below will transpile all the modules in your project directory into JavaScript files located in the `build` folder. Thereafter, you will serve all the contents of the build folder in a server on your local development machine.\n\nTo transpile the modules' files from `src` into JavaScript files in `build`, run the following command.\n\n```bash\nyarn run build\n```\n\nTo start the server that serves all the contents of the `build` folder in the root directory of the project, run the following command. By default, running this command serves the contents of the `build` folder on \u003chttp://localhost:8022\u003e.\n\n```bash\nyarn run serve\n```\n\n### Development with Source Academy `frontend`\n\nThe following set of instructions explains how to use a local copy of the Source Academy [frontend](https://github.com/source-academy/frontend) with a local copy of the modules code repository. Following the steps below will configure the environment of the Source Academy frontend to use your locally served modules instead of the publicly available ones. Doing this will allow you to develop and modify modules without affecting the currently publicly available ones.\n\nYou will need to already have a local instance of Source Academy frontend set up. If you do not, you can follow the instructions [here](https://github.com/source-academy/frontend#getting-started) to setup an instance of Source Academy frontend on your local development machine.\n\nEnsure that the environment variable `REACT_APP_MODULE_BACKEND_URL` in the `.env` file of the Source Academy frontend is configured to the URL of the module site that you are trying to retrieve modules from. At the same time, make sure that the server hosting the modules site is running. By default, the local server started by running `yarn run serve` is on \u003chttp://localhost:8022\u003e. The default modules are implemented in the repository \u003chttps://github.com/source-academy/modules\u003e and deployed to the modules site \u003chttps://source-academy.github.io/modules\u003e.\n\nUpon starting the local instance of Source Academy frontend, the Source Academy will connect to the configured modules site.\n\n### Development Guide\n\nPlease refer to the Modules Development Guide located in the modules wiki [here](https://github.com/source-academy/modules/wiki/Development-Guide) for more information regarding how to create your own module including its own bundle and tab.\n\n## License\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nAll sources in this repository are licensed under the [Apache License Version 2][apache2].\n\n[apache2]: https://www.apache.org/licenses/LICENSE-2.0.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsource-academy%2Fmodules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsource-academy%2Fmodules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsource-academy%2Fmodules/lists"}