Skip to content

Repository Structure

Lee Yi edited this page Feb 16, 2023 · 4 revisions

This page serves to contain up-to-date information on this repository's file structure.

Current File Structure

.
├── .github                # Github related files (Pull request & issue templates and workflows)
├── .husky                 # Husky related files for managing git hooks
├── .vscode                # Configuration files for VSCode users
├── build                  # Automatically generated files after transpilation of src directory
├── scripts                # Scripts for creating and building modules
│   ├── bin                # Executable versions of the build scripts
│   ├── src                # Source files for build scripts/
│   │   ├── build          # Scripts related to building bundles, tabs and documentation
│   │   ├── prebuild       # Scripts for linting and type checking
│   │   └── templates      # Interactive scripts for module and tab creation
│   ├── jest.setup.ts      # Setup code for jest testing
│   ├── jest.config.js     # Configuration for script testing
│   ├── .eslintrc.cjs      # ESLint configuration for scripts
│   └── tsconfig.json      # Typescript configuration for scripts
├── src                    # Source code for Source modules/
│   ├── bundles            # Module bundle's files
│   ├── tabs               # Module tab's files
│   ├── typings            # Types for the Source Modules system
│   ├── .eslintrc.cjs      # ESLint configuration for modules
│   ├── jest.config.js     # Jest configuration for testing modules
│   └── tsconfig.json      # Typescript configuration for modules
├── .gitignore             # Contains files to be ignored by Git version control system
├── LICENSE
├── README.md
├── modules.json           # Contains metadata regarding Source modules
├── package.json           # Project settings
└── yarn.lock              # Data related to project dependencies

The root directory contains a few main folders and files elaborated on in the table below:

Name Description
build These files are the output of executing the build script which transpiles the files in the src directory and modules.json. The result is the files in the build directory which is intended to be served in its entirety in the Source Modules static server for Source Academy users to consume as Source Modules and a Source Module API documentation page.
src In this folder lies the two main subdirectories bundles and tabs. Each Source Module Bundle will have a folder of the same name inside the bundle subdirectory which will house the implementation of the Source Module's provided Source functions. Each Source Module Tab will also have a folder inside the tabs subdirectory which will house the implementation of the Source Module Tab's user interface to be rendered as part of the Source Academy side content tabs.

Note: Within each of the Source Module Bundle/Tab root folders within the src directory, the folder and file structure is left to the discretion of the Source Module authors.
modules.json The modules.json file contains all the data related to the relationship between the Source Module, its bundle and the tabs that it contains. Currently, each Source Module is stored as a key in the modules.json object that contains the property tabs which is an array of the Source Module's tab names that it includes.

Example

Below is an example of the src directory with the pix_n_flix Source Module.

src                          # Source code for Source Modules
 ├── bundles                 # Source Module bundle's files
      ├── pix_n_flix         # Source Module pix_n_flix bundle's root directory
           ├── index.ts      # Source Module pix_n_flix bundle's entry point
 ├── tabs                    # Source Module tab's files
      ├── Pixnflix           # Source Module pix_n_flix tab PixNFlix's root directory
           ├── index.tsx     # Source Module pix_n_flix tab PixNFlix's entry point

Below is an example of modules.json with the pix_n_flix Source Module.

{
  "pix_n_flix": {
    "tabs": [ "Pixnflix" ]
  }
}
Clone this wiki locally