-
Notifications
You must be signed in to change notification settings - Fork 28
Creating a Bundle
This page contains a guide for Source Module authors to create their very own Source Module Bundle as well as details and explanations on the structure of a Source Module Bundle.
A Source Module Bundle is the implementation of the suite of functions that are provided by the module.
For example, the
binary_tree
module may want to provide an abstraction for Source programs to interact with the Binary Tree data structure. Thus, thebinary_tree
module would expose functions such asmake_tree
,left_branch
andright_branch
to be used in Source programs.
The Source Module Bundle folder will then contain the TypeScript logic that is responsible for the implementation of the suite of functions.
export function make_tree(value: any, left: BinaryTree, right: BinaryTree): BinaryTree {
return [left, value, right];
}
...
The main structure of the entry point file to the Source Module Bundle looks like this.
1 import { ... } from '...';
2 ...
3 export default (__params) => {
4 ...
5 return { ... }
6 });
Line | Description |
---|---|
1 | The import declarations of the various dependencies used by this file. |
2 | The truncated implementation of the Source Module Bundle. |
3 | The default export function of the Source Module Bundle. |
4 | The truncated implementation of the Source Module Bundle. |
5 | The JavaScript object of functions provided by the Source Module Bundle. |
- Home
- Overview
- System Implementation
-
Development Guide
- Getting Started
- Repository Structure
-
Creating a New Module
- Creating a Bundle
- Creating a Tab
- Writing Documentation
- Developer Documentation (TODO)
- Build System
- Source Modules
- FAQs
Try out Source Academy here.
Check out the Source Modules generated API documentation here.