Skip to content

Commit 78d3781

Browse files
committed
Miscellanous changes
1 parent ef48e95 commit 78d3781

File tree

7 files changed

+28
-56
lines changed

7 files changed

+28
-56
lines changed

.github/actions/vitest.setup.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
import type { summary } from '@actions/core';
21
import { vi } from 'vitest';
32

4-
vi.mock(import('@actions/core'), async importOriginal => {
5-
const original = await importOriginal();
6-
const outputObject: Record<string, any> = {};
7-
8-
const summaryObject: typeof summary = {
9-
addList() { return this; },
10-
addHeading() { return this; },
11-
write() {
12-
return Promise.resolve(this);
13-
}
14-
} as any;
15-
16-
return {
17-
...original,
18-
info: vi.fn(console.info),
19-
error: vi.fn(console.error),
20-
outputObject,
21-
setOutput: (p, v) => {
22-
outputObject[p] = JSON.stringify(v);
23-
},
24-
summary: summaryObject
25-
};
26-
});
27-
283
vi.mock(import('@actions/exec'));

README.md

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,24 @@ This repository contains the default modules of the Source Academy and their doc
66

77
The [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.
88

9+
If you are looking for the documentation for the default modules, that can be found [here](https://source-academy.github.io/modules/documentation).
10+
11+
If you are a developer looking to do things like create a new bundle or work with the repository, the developer documentation can be found [here](https://source-academy.github.io/devdocs).
12+
913
## Quick Links
14+
1015
| Site | Link |
1116
| ---- | ---- |
1217
| Source Academy | https://sourceacademy.org |
1318
| Default Modules Deployment | https://source-academy.github.io/modules |
1419
| Default Modules Documentation | https://source-academy.github.io/modules/documentation |
15-
| Developer Wiki | https://github.com/source-academy/modules/wiki |
20+
| Developer Documentation | https://source-academy.github.io/devdocs |
1621
| `js-slang` | https://github.com/source-academy/js-slang |
1722
| Frontend | https://github.com/source-academy/frontend |
1823

19-
If you are looking for the documentation for the default modules, they can be found [here](https://source-academy.github.io/modules/documentation).
20-
21-
If you are a developer working with this repository, the developer documentation can be found [here](https://github.com/source-academy/modules/wiki)
22-
23-
## Repository Structure
24-
The repository is designed as a monorepo, managed using Yarn workspaces.
25-
26-
```txt
27-
.
28-
├── .github // Configuration for issue templates and workflows
29-
├── .husky // Configuration for code that runs on Git Hooks
30-
├── .vscode // Configuration for VSCode integration
31-
├── build // Output directory for compiled assets
32-
├── devserver // Modules Development Server
33-
├── docs // Developer Documentation and Server
34-
├── lib
35-
│ ├── buildtools // Scripts for compiling bundles and tabs
36-
│ ├── lintplugin // ESLint Plugin for SA Modules
37-
│ └── modules-lib // Common utilities and React components for SA Modules
38-
├── src
39-
│ ├── bundles // Source code for Bundles
40-
│ ├── tabs // Source code for Tabs
41-
│ └── java // Assets for Source Java
42-
├── eslint.config.js // ESLint configuration for the entire repository
43-
├── vitest.config.js // Vitest configuration for the entire repository
44-
└── yarn.config.cjs // Yarn constraints configuration
45-
```
24+
## Building the documentation server
25+
26+
1. Run the command: `yarn workspaces focus @sourceacademy/modules-docserver`
27+
2. `cd` into the `docs` directory and run `yarn dev`.
28+
29+
You should now have a local copy of the modules' developer documentation running on your machine.

docs/src/modules/1-getting-started/2-start.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ A stable version of [NodeJS](https://nodejs.org/en/) is required on your local d
1010

1111
You can use [nvm](https://github.com/creationix/nvm#installation) _(macOS/Linux)_ or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) _(windows)_ to switch Node versions between different projects.
1212

13+
> [!INFO]
14+
> The tooling in the repository is intended to work with both Posix-Compliant systems (macOS/Linux/WSL) _and_ Windows.
15+
> If you encounter any compatibility issues do open an issue with the respository.
16+
1317
## 2. Clone this Repository
1418

1519
Clone the modules repository to your local machine using `git` or your tool of choice.

docs/src/modules/2-bundle/6-compiling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ yarn build --tsc
2525
This will run the TypeScript compiler before compiling your bundle. If there are any type errors, it will be displayed in the command line
2626
and your bundle will not be compiled.
2727

28-
The output for your bundle will be placed at `/build/bundles/[your_bundle_name].js`.
28+
The output for your bundle will be placed at `build/bundles/[your_bundle_name].js`.
2929

3030
## For Other Bundles
3131

docs/src/modules/4-testing/1-desktop.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ You will need to change which module backend is in use using the `--modulesBacke
77

88
If your package already depends on `js-slang`, then you can already run `js-slang` from the command line using `yarn js-slang`.
99

10-
If not, you can either add `js-slang` to your dev dependencies, or you can install the root repository package.
10+
If not, you can either:
11+
- Add `js-slang` to your dev dependencies
12+
- Install the root repository package.
13+
- Use the [`yarn dlx` command](https://yarnpkg.com/cli/dlx)
1114

1215
## The Modules Server
1316

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export default tseslint.config(
118118
}
119119
}
120120
},
121-
122121
{
123122
extends: [js.configs.recommended],
124123
name: 'Global JS/TS Stylistic Rules',

yarn.config.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,12 @@ module.exports = defineConfig({
3131
dep.update('workspace:^');
3232
}
3333
}
34+
35+
// Repotools should not be allowed to depend on any other packages in this
36+
// repository
37+
const [repotools] = Yarn.workspaces({ ident: '@sourceacademy/modules-repotools' });
38+
for (const dep of Yarn.dependencies({ workspace: repotools })) {
39+
if (dep.ident.startsWith('@sourceacademy/modules')) dep.update(undefined);
40+
}
3441
}
3542
});

0 commit comments

Comments
 (0)