Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
282e8fc
Fix incorrect doc tags
leeyi45 Dec 23, 2025
1f12e20
Add validation for example tags and hide type guards in generated docs
leeyi45 Dec 23, 2025
3370426
Update docs about documentation
leeyi45 Dec 23, 2025
175ab4e
Continue updating docs
leeyi45 Dec 25, 2025
1dd8cde
Add linting for code examples
leeyi45 Dec 25, 2025
bbc6970
Add compile command
leeyi45 Dec 25, 2025
5754a29
Fix bug where markdown directory trees weren't being aligned properly
leeyi45 Dec 28, 2025
54c4eed
Add tests for the markdown tree transformer
leeyi45 Dec 28, 2025
49cbc9a
Run format
leeyi45 Dec 28, 2025
44d5dc3
Move buildtools to use tsc compile and typecheck separately
leeyi45 Jan 10, 2026
ddcd384
Add tests for ensuring that typedoc paths are processed correctly
leeyi45 Jan 10, 2026
5a8b123
Add tests to ensure that typeguards are properly rendered
leeyi45 Jan 10, 2026
e87456f
Add the compile command to bundles
leeyi45 Jan 10, 2026
8a1f40c
Update eslint-plugin-json version
leeyi45 Jan 10, 2026
68dee49
Update code examples to comply with linting
leeyi45 Jan 10, 2026
989eba9
Fix code example from plotly
leeyi45 Jan 10, 2026
f44cfba
Update vitest eslint plugin
leeyi45 Jan 10, 2026
d0b1422
Change reference to tsc command to instead refer to compile command
leeyi45 Jan 10, 2026
7bca240
Fix incorrect eslint rules
leeyi45 Jan 15, 2026
875adf5
Merge remote-tracking branch 'origin/master' into plugins
leeyi45 Jan 21, 2026
7afa0fd
Update typescript-eslint versions
leeyi45 Jan 21, 2026
7d3a5b4
Fix spelling
leeyi45 Jan 21, 2026
5794b53
Update blueprintjs versions and add it to packages that didn't specif…
leeyi45 Jan 23, 2026
6947174
Fix eslint import paths
leeyi45 Jan 23, 2026
915d8e8
Add lodash and @types/lodash to packages that were missing them
leeyi45 Jan 23, 2026
22e2127
Disable import/no-unresolved when running in CI
leeyi45 Jan 23, 2026
4b2ef02
Update vitest packages
leeyi45 Jan 23, 2026
6f5c1f4
Fix incorrect classname in test
leeyi45 Jan 23, 2026
88298ee
Fix omit call
leeyi45 Jan 24, 2026
cb7973f
Merge from master
leeyi45 Feb 5, 2026
b56d392
Update lodash packages
leeyi45 Feb 5, 2026
4d8d168
Add callback parameter checking for curve bundle
leeyi45 Feb 5, 2026
55a111e
Update incorrect curve function implementations
leeyi45 Feb 6, 2026
5957436
Merge remote-tracking branch 'origin/master' into plugins
leeyi45 Feb 7, 2026
4e64fab
Merge branch 'master' of https://github.com/source-academy/modules in…
RichDom2185 Feb 7, 2026
70ffeb3
Fix bp6 namespace
RichDom2185 Feb 7, 2026
23dab3c
Fix lockfile post-merge
RichDom2185 Feb 7, 2026
acffe64
Merge branch 'master' of https://github.com/source-academy/modules in…
RichDom2185 Feb 7, 2026
ce99536
Format markdown files
RichDom2185 Feb 7, 2026
bb3f681
Merge branch 'master' of https://github.com/source-academy/modules in…
RichDom2185 Feb 8, 2026
f05933a
Update lockfile post-merge
RichDom2185 Feb 8, 2026
4bfd69f
Merge branch 'plugins' of github.com:source-academy/modules into plugins
leeyi45 Feb 10, 2026
b639551
Fix incorrect curve drawer implementations and add tests
leeyi45 Feb 11, 2026
ef9a367
Add a documentation section regarding checking callback parameters
leeyi45 Feb 11, 2026
7af0cc1
Add overloads to the isFunctionOfLength callback
leeyi45 Feb 11, 2026
03c2867
Move type checking into its own section for docs
leeyi45 Feb 14, 2026
af5966b
Add isFunctionOfLength utility function
leeyi45 Feb 14, 2026
8a8db52
Update constraints file and node version
leeyi45 Feb 14, 2026
9a35743
Bump dependencies
RichDom2185 Feb 14, 2026
f4293d2
Fix format
RichDom2185 Feb 14, 2026
5443917
Revert js-slang due to breaking changes
RichDom2185 Feb 14, 2026
b3e0d77
Fix lint issues
RichDom2185 Feb 14, 2026
f646686
Update lib/buildtools/src/build/modules/__tests__/building.test.ts
RichDom2185 Feb 14, 2026
f3b9bf8
Add yarn checksum
RichDom2185 Feb 14, 2026
6d1fafd
Use a new error type to unify errors thrown by type guards
leeyi45 Feb 14, 2026
7afaec2
Merge remote-tracking branch 'origin/plugins' into better-type-guards
leeyi45 Feb 14, 2026
039f3b5
Merge branch 'master' into better-type-guards
leeyi45 Feb 14, 2026
ec87a3b
Add the callback type checks to sound bundle
leeyi45 Feb 14, 2026
a952439
Linting fixes
leeyi45 Feb 15, 2026
7db632c
General documentation updates
leeyi45 Feb 26, 2026
4efc5a5
Merge remote-tracking branch 'origin/master' into better-type-guards
leeyi45 Feb 26, 2026
c43178b
Update linting and documentation
leeyi45 Feb 28, 2026
d39bb8f
Bump fast-xml-parser from 5.3.6 to 5.4.1
dependabot[bot] Feb 28, 2026
6f0ec17
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/fast-xml…
leeyi45 Mar 2, 2026
47cb851
Remove extraneous line
leeyi45 Mar 2, 2026
463784a
Merge remote-tracking branch 'origin/master' into better-type-guards
leeyi45 Mar 3, 2026
4bc2449
Fix missing lodash package in Unittest tab
leeyi45 Mar 3, 2026
45557b9
Add missing dependencies to vitest optimizeDeps for modules-lib
leeyi45 Mar 3, 2026
eeefeb3
Change some errors to use InvalidTypeParameterError
leeyi45 Mar 3, 2026
7ddda5c
Add InvalidCallbackError to Rune animations
leeyi45 Mar 3, 2026
884a8a9
Add some missing functionality to midi
leeyi45 Mar 3, 2026
0e87bc0
Add type checks to repeat
leeyi45 Mar 7, 2026
595b52c
Add type checking to repeat bundle
leeyi45 Mar 7, 2026
8d7328c
Add more type guard checks to unittest and fix broken tests
leeyi45 Mar 7, 2026
494826f
Merge remote-tracking branch 'origin/master' into better-type-guards
leeyi45 Mar 7, 2026
0f28aea
Update some documentation
leeyi45 Mar 8, 2026
2f178b7
Add documentation about bp css styles
leeyi45 Mar 8, 2026
580da06
Update modules-lib to use blueprint/core iconnames
leeyi45 Mar 9, 2026
eb0d025
Update devserver to use blueprint core icons
leeyi45 Mar 9, 2026
bd69a3a
Change which iconname modules-lib refers to
leeyi45 Mar 9, 2026
f9b7ebb
Remove blueprint icons where unnecessary
leeyi45 Mar 9, 2026
88379d9
Update some documentation
leeyi45 Mar 9, 2026
200cef7
Update documentation config for modules-lib for better organization
leeyi45 Mar 9, 2026
20902e4
Add direct nav link to modules-lib docs
leeyi45 Mar 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions devserver/src/components/Playground.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Button, Classes, Intent, OverlayToaster, Popover, Tooltip, type ToastProps } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import classNames from 'classnames';
import { SourceDocumentation, getNames, runInContext, type Context } from 'js-slang';
// Importing this straight from js-slang doesn't work for whatever reason
import createContext from 'js-slang/dist/createContext';
import { ModuleInternalError } from 'js-slang/dist/modules/errors';
import { setModulesStaticURL } from 'js-slang/dist/modules/loader';
import { Chapter, Variant } from 'js-slang/dist/types';
import { stringify } from 'js-slang/dist/utils/stringify';
Expand Down Expand Up @@ -159,6 +159,12 @@ const Playground: React.FC = () => {
value: stringify(result.value)
});
} else if (result.status === 'error') {
codeContext.errors.forEach(error => {
if (error instanceof ModuleInternalError) {
console.error(error);
}
});

setReplOutput({
type: 'errors',
errors: codeContext.errors,
Expand Down Expand Up @@ -210,7 +216,7 @@ const Playground: React.FC = () => {
<Tooltip content="Settings">
<Button
{...targetProps}
icon={IconNames.SETTINGS}
icon='settings'
/>
</Tooltip>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import ControlButton from '../ControlButton';

type Props = {
Expand All @@ -9,7 +8,7 @@ type Props = {
export const ControlBarClearButton = (props: Props) => <Tooltip content="Clear the editor and context">
<ControlButton
label="Clear"
icon={IconNames.Trash}
icon='trash'
onClick={props.onClick}
/>
</Tooltip>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import ControlButton from '../ControlButton';

type Props = {
Expand All @@ -9,7 +8,7 @@ type Props = {
export const ControlBarRefreshButton = (props: Props) => <Tooltip content="Manually refresh the side content">
<ControlButton
onClick={props.onClick}
icon={IconNames.Refresh}
icon='refresh'
label="Refresh"
/>
</Tooltip>;
3 changes: 1 addition & 2 deletions devserver/src/components/controlBar/ControlBarRunButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Position, Tooltip } from '@blueprintjs/core';
import { IconNames } from '@blueprintjs/icons';
import React from 'react';

import ControlButton from '../ControlButton';
Expand All @@ -22,7 +21,7 @@ export const ControlBarRunButton: React.FC<ControlButtonRunButtonProps> = (props
<Tooltip content={tooltipContent} placement={Position.TOP}>
<ControlButton
label="Run"
icon={IconNames.PLAY}
icon='play'
onClick={props.handleEditorEval}
options={{
iconColor: props.color,
Expand Down
14 changes: 10 additions & 4 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,18 @@ const vitepressOptions: UserConfig = {
text: 'Libraries',
items: [
{
text: 'Common Libraries',
link: '/lib'
}, {
text: 'Common Library',
link: '/lib/modules-lib'
},
{
text: 'Developer Docs',
link: '/lib/dev'
}]
},
{
text: 'Lint Plugin',
link: '/lib/lintplugin/1-overview'
}
]
},
{
text: 'Dev Tools',
Expand Down
2 changes: 2 additions & 0 deletions docs/src/modules/1-getting-started/1-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ children:

- name: src
children:
- name: archive
comment: Archived bundles and tabs
- name: bundles
comment: Directories containing bundles
- name: tabs
Expand Down
9 changes: 8 additions & 1 deletion docs/src/modules/2-bundle/4-conventions/2-abstractions.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,14 @@ interface TextOptions {
color: string;
size: number;
}
export function create_text_options(color: string, size: number): TextOptions;
export function create_text_options(color: string, size: number): TextOptions {
return {
color,
size,
// Of course, don't forget to implement `ReplResult`:
toReplString: () => '<TextOptions>'
};
}
export function change_text_options(options: TextOptions): void;

// Used like this:
Expand Down
43 changes: 42 additions & 1 deletion docs/src/modules/2-bundle/4-conventions/3-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,45 @@ Then, the error can be thrown with the correct function name. Otherwise, cadets
that is visible to them. Many other functions might rely on `throwIfNotRune`. If they were all called in the same program, it doesn't tell the cadet which function the error was thrown from
(was it `show`? or `anaglyph`? or something else?)

An important use for error handling is when it comes to validating types. More information about type checking can be found in the next section.
An important use for error handling is when it comes to validating types. More information about type checking can be found in the [next](./4-types) section.

> [!WARNING] Undefined Name Property
>
> It's possible to create functions without names using anonymous expressions:
>
> ```ts
> function getFunc(value: string) {
> return () => value;
> }
>
> export const getFoo = getFunc('foo');
>
> // getFoo.name is undefined!
> console.log(getFoo.name);
> ```
>
> A common case (especially if you are using type maps) is using an expression when defining a class function. This causes an anonymous function to be assigned to that property:
>
> ```ts
> class Functions {
> static bar = () => 'bar';
> }
>
> // the name is also undefined!
> console.log(Functions.bar.name);
> ```
>
> In such a case, you should take care to define the `name` property manually (at least on the exported version):
>
> ```ts
> function getFunc(value: string, func_name: string) {
> const func = () => value;
> Object.defineProperty(func, 'name', { value: func_name });
> return func;
> }
>
> export const getFoo = getFunc('foo', 'foo');
>
> // Now correctly prints foo!
> console.log(getFoo.name);
> ```
Loading
Loading