Skip to content

Commit

Permalink
Miscellaneous Repo Improvements (#244)
Browse files Browse the repository at this point in the history
* Add typeguards

* Use typeguards with rune module

* Use typeguards with curve module

* Update other modules to have separate JSX components

* Update built build scripts

* Add new editor config to enforce CRLF

* Update build scripts

* Update scripts to work with updated typedoc

* Update tsconfigs

* Relocate binary_tree documentation

* Relocate curve documentation

* Relocate game documentation

* Relocate painter documentation

* Relocate pix_n_flix documentation

* Update rune documentation

* Update rune_in_words documentation

* Update scabble documentation

* Update sound documentation

* Update stereo_sound documentation

* Finish refactoring Sound and StereoSound tab

* Readd the missing readme to module docs

* Remove all script bin files

* Add a new management script for building scripts

* Update package versions and commands

* Make tabs build into default exports

* Add error handling to animation canvas

* Add error guard for non point returning curves

* Fix animation canvas elements being in the wrong place

* Add gitattributes

* Update multi item canvas to include item selector

* Update animation canvas to include error handling

* Add error handling to 3d curve animation canvas

* Reformatting curve

* Update names to follow typical tsx format

* Update import paths for new react components

* Relocate logging to be more interactive when linting

* Add documentation for script manager

* no message

* Merge changes from master

* Change hardcoded function names in rune

* Fix typo

* Fix some line encoding issue

* Complete merge

* Merging

* Move rune display functions to new file

* Add plugin to prevent context imports

* Move running of jest into scripts

* Change file extension

* Add new tests for curve and rune bundles and tabs

* Update typescript eslint

* Update test

* Fix formatting

* Change to a common tab type

* Remove unneeded packages

* Fix broken test

* Move scripts:build to postinstall

* Fix broken test

* Reverse the order of husky hooks

* Fix broken eslint config

* Ran eslint

* Add more tests to curves bundle

* Rename ModalDiv

* Resolve further merge conflicts

* Fix lint command not linting some files

* Update CI and Jest running code

* Update jest config for modules

* initial commit

* Dev server MVP

* Remove unnecessary styles

* Finish modelling frontend workspace

* Update ace-builds

* Fix repl bundle circular import

* Replace the require directive

* Allow modules to properly import context

* Use verbatimModuleSyntax

* Allow devserver to serve modules

* Allow dev server to serve manifest

* Add missing lodash package

* Update packages to match frontend

* Fix broken module building code

* Modify tsconfig to remove tests

* Remove unnecessary console log

* Add color option to CI tests

* Update CI to allow jest to use color

* Update packages

* Modify tsconfig to remove tests

(cherry picked from commit 05762c4)

* Add color option to CI tests

(cherry picked from commit ab87d90)

* Update CI to allow jest to use color

(cherry picked from commit 7ea5fa6)

* Fix broken script commands

* Fix incorrect snapshot name

* Update linting configuration

* Fix options not being passed to Jest properly

* Switch to using ES import for Repl

* Fix paths not working on posix environments

* Add tests for testing command

* Allow modules to use node style asserts

* Remove moved documentation

* Add type definitions to function params

* Change `throwIfNotRune` for rune_in_words

* Remove moved documentation

* Temporarily remove lodash and phaser from external packages until they can be added in js-slang and frontend

* Fix regression with low resolution heart rune

* Resolve merge conflict in unity_academy bundle

* Add documentation and fix broken devserver lint command

* Add tests for sound bundle

* Fix potential out of memory error

* Add code for husky hooks

* Update CI

* Fix broken and conflicting packages

* Move checks from git hook to github actions

* Update repl tab

* Update broken test

---------

Co-authored-by: Richard Dominick <[email protected]>
  • Loading branch information
leeyi45 and RichDom2185 authored Oct 28, 2023
1 parent 82dd645 commit cad8822
Show file tree
Hide file tree
Showing 259 changed files with 416,588 additions and 415,259 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*]
end_of_line = crlf
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Standardize line encodings
## Src: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#per-repository-settings
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Declare files that will always have CRLF line endings on checkout.
*.js text eol=crlf
*.ts text eol=crlf
*.tsx text eol=crlf
*.md text eol=crlf
*.cjs text eol=crlf
*.json text eol=crlf
92 changes: 46 additions & 46 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
---
name: Bug Report
about: Use this template for highlighting bugs.
title: '[FEATURE NAME]: [BUG SUMMARY]'
labels: bug
---

# Prerequisites

Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.**

- [ ] I am running the latest version
- [ ] I checked the documentation and found no answer
- [ ] I checked to make sure that this issue has not already been filed

# Expected Behavior

Please describe the behavior you are expecting

# Current Behavior

What is the current behavior?

# Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

## Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. you get it...

## Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

- Version used: <!-- Indicate the commit hash -->
- Browser Name and version:
- Operating System and version (desktop or mobile):

## Failure Logs

Please include any relevant log snippets or files here.
---
name: Bug Report
about: Use this template for highlighting bugs.
title: '[FEATURE NAME]: [BUG SUMMARY]'
labels: bug
---

# Prerequisites

Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.**

- [ ] I am running the latest version
- [ ] I checked the documentation and found no answer
- [ ] I checked to make sure that this issue has not already been filed

# Expected Behavior

Please describe the behavior you are expecting

# Current Behavior

What is the current behavior?

# Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

## Steps to Reproduce

Please provide detailed steps for reproducing the issue.

1. step 1
2. step 2
3. you get it...

## Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

- Version used: <!-- Indicate the commit hash -->
- Browser Name and version:
- Operating System and version (desktop or mobile):

## Failure Logs

Please include any relevant log snippets or files here.
30 changes: 15 additions & 15 deletions .github/ISSUE_TEMPLATE/documentation_request.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
name: Wiki Documentation Request
about: Use this template for requesting documentation on a feature in the wiki.
title: '[Wiki]: [FEATURE]'
labels: documentation
---

# Feature

Please briefly describe the feature that needs documentation.

## Checklist

- [ ] I checked the documentation and found that it does not already exist
- [ ] I checked to make sure that this issue has not already been filed
---
name: Wiki Documentation Request
about: Use this template for requesting documentation on a feature in the wiki.
title: '[Wiki]: [FEATURE]'
labels: documentation
---

# Feature

Please briefly describe the feature that needs documentation.

## Checklist

- [ ] I checked the documentation and found that it does not already exist
- [ ] I checked to make sure that this issue has not already been filed
64 changes: 32 additions & 32 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

- [ ] Test A
- [ ] Test B

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

- [ ] Test A
- [ ] Test B

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
17 changes: 12 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run tests
run: yarn test && yarn test:scripts

- name: Build all
- name: Build bundles and tabs
run: yarn build --tsc --lint

- name: Test bundles and tabs
run: yarn test --color

- name: Test and lint scripts
run: yarn scripts:tsc && yarn scripts:lint && yarn scripts:test --color

- name: Check and Lint Devserver
run: yarn devserver:tsc && yarn devserver:lint

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
###################
*~
node_modules/
devserver/node_modules
build/*
/package-lock.json
coverage/

scripts/build/database.json
scripts/bin.js

# Compiled source #
###################
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn build --tsc --lint
yarn test --color
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn test
yarn build --lint --tsc
32 changes: 16 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"configurations": [
{
"type": "node",
"name": "Test Scripts",
"request": "launch",
"args": [
"test",
"--runInBand",
"--config=${cwd}/scripts/src/jest.config.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"runtimeExecutable": "yarn"
}
]
{
"configurations": [
{
"type": "node",
"name": "Test Scripts",
"request": "launch",
"args": [
"test",
"--runInBand",
"--config=${cwd}/scripts/src/jest.config.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"runtimeExecutable": "yarn"
}
]
}
13 changes: 7 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"eslint.workingDirectories": [
"src",
"scripts/src"
],
"files.eol": "\r\n",
{
"eslint.workingDirectories": [
"src",
"scripts/src",
"devserver"
],
"files.eol": "\r\n",
}
4 changes: 2 additions & 2 deletions __mocks__/chalk.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default new Proxy({}, {
get: () => (input) => input,
export default new Proxy({}, {
get: () => (input) => input,
})
23 changes: 23 additions & 0 deletions devserver/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"root": true,
"env": { "browser": true, "es2020": true },
"extends": [ "../.eslintrc.base.cjs" ],
"ignorePatterns": ["dist", ".eslintrc.cjs"],
"parser": "@typescript-eslint/parser",
"plugins": ["react", "@typescript-eslint"],
"rules": {
"func-style": 0,
"no-empty-function": 0,
"@typescript-eslint/no-unused-vars": [
1, // Was 2
{
// vars: "all",
// args: "after-used",
// ignoreRestSiblings: false,
"argsIgnorePattern": "^_",
"caughtErrors": "all", // Was "none"
"caughtErrorsIgnorePattern": "^_"
}
]
}
}
5 changes: 5 additions & 0 deletions devserver/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Source Academy Tab Development Server

This server relies on [`Vite`](https://vitejs.dev) to create a server that automatically reloads when it detects file system changes. This allows Source Academy developers to make changes to their tabs without having to use the frontend, and have it render code changes live.

The server is designed to be run using `yarn devserver` from the repository's root directory, hence `vite.config.ts` is not located within this folder.
12 changes: 12 additions & 0 deletions devserver/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Source Academy Tab Development Server</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Binary file added devserver/public/favicon.ico
Binary file not shown.
Binary file added devserver/src/assets/academy_background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cad8822

Please sign in to comment.