Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts Refactor #296

Merged
merged 57 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
c10f444
Relocate script configuration files
leeyi45 Mar 16, 2024
55c3b22
Update template scripts to use commander with extra typings
leeyi45 Mar 16, 2024
7d3e5cc
Scripts v3
leeyi45 Mar 18, 2024
5e6c8b6
Update eslint configuration to work with new scripts folder layout
leeyi45 Mar 18, 2024
8b7a058
Merge commit '040e4fce88a2bc65cae4cc6fdf688cb6ef22e9f3' into scripts-…
leeyi45 Mar 18, 2024
43e299f
Fix bundle tests
leeyi45 Mar 19, 2024
a8b6a84
Fix jest setup for scripts
leeyi45 Mar 19, 2024
29a9a47
Fix prebuild tests
leeyi45 Mar 19, 2024
c498319
Fixed bug where jsons were not writing descriptions for functions
leeyi45 Mar 19, 2024
756d352
Relocate retrieveManifest to make it easier to mock during testing
leeyi45 Mar 19, 2024
c6baa27
Fixing broken tests
leeyi45 Mar 19, 2024
d6b3163
Update jest and astring packages
leeyi45 Mar 19, 2024
c8901af
Standardize tests for commands
leeyi45 Mar 19, 2024
e21a537
Fix tsc tests
leeyi45 Mar 20, 2024
072a3da
Temporarily skip json tests
leeyi45 Mar 20, 2024
5e42eca
Update linting for modules
leeyi45 Mar 20, 2024
0ba0068
Merge commit '37793417faf4d8781a02c5b1be1f6a2e99f6534f' into scripts-…
leeyi45 Mar 20, 2024
7866a58
Update CI to use node 20
leeyi45 Mar 20, 2024
40bab4a
Update CI to install dependencies required by gl
leeyi45 Mar 20, 2024
af5343b
Fix linting errors
leeyi45 Mar 20, 2024
e78495f
Fix bug where return types of functions were not being generated corr…
leeyi45 Mar 20, 2024
86a00be
Add handling case for unknown types generated by typedoc
leeyi45 Mar 21, 2024
d0073de
Use array for function parameters to respect parameter order
leeyi45 Mar 21, 2024
bdab4d5
Update to flat config for ESLint configuration
leeyi45 Mar 21, 2024
a94d995
Update dependencies
leeyi45 Mar 21, 2024
ff6e633
Fix tests and standardize commands
leeyi45 Mar 22, 2024
a550f8b
Fix linting with new eslint configuration
leeyi45 Mar 22, 2024
7e10ed3
Fix regression where linter wasn't properly linting all files
leeyi45 Mar 22, 2024
4880ff1
Fix issue where jsons were being generated with invalid types
leeyi45 Mar 22, 2024
f2023af
Use import attributes instead of assertions and update linting config…
leeyi45 Mar 22, 2024
24673df
Update linting configuration to use spaces instead of tabs uniformly
leeyi45 Mar 22, 2024
18ee471
Disable Prettier for project
RichDom2185 Mar 23, 2024
a22b2ef
Add .node-version file
RichDom2185 Mar 23, 2024
9dd20c9
Add tests for template command and fix template command bugs
leeyi45 Mar 24, 2024
d3e73f2
Fix the issue where the scripts wouldn't exit automatically after exe…
leeyi45 Mar 24, 2024
f1f085b
Remove some uh, idk what this is supposed to be
leeyi45 Mar 24, 2024
c8b2c28
Update linting packages and configurations
leeyi45 Mar 24, 2024
3d82187
Fix linting again :(
leeyi45 Mar 24, 2024
7d82ca4
Run linting with updated config
leeyi45 Mar 24, 2024
9877bd5
Bump CI workflow dependencies
RichDom2185 Mar 25, 2024
03c53f6
Reformat
RichDom2185 Mar 25, 2024
6927513
Update eslint configuration again
leeyi45 Mar 25, 2024
07abe01
Run linting with updated configuration
leeyi45 Mar 25, 2024
d0a3e8f
Merge branch 'scripts-refactor' of https://github.com/source-academy/…
leeyi45 Mar 25, 2024
ec39bb6
Run linter
leeyi45 Mar 25, 2024
7320886
Fix incorrect comment location
leeyi45 Mar 25, 2024
0b17239
Fix the import order for @src imports
leeyi45 Mar 26, 2024
f861deb
Change import duplicates lint rule setting to not prefer inline type …
leeyi45 Mar 26, 2024
3ca2112
Replace magic numbers with constants
RichDom2185 Mar 26, 2024
7de465a
Remove remaining stray tab characters
RichDom2185 Mar 26, 2024
9914e6a
Enforce semicolons
RichDom2185 Mar 26, 2024
8108b2d
Merge branch 'master' of https://github.com/source-academy/modules in…
RichDom2185 Mar 26, 2024
c552a8a
Fix lockfile post-merge
RichDom2185 Mar 26, 2024
7fd9561
Deduplicate dependencies
RichDom2185 Mar 26, 2024
0e4f126
Fix lint post-merge
RichDom2185 Mar 26, 2024
ab7988b
Fix lint error post-merge
RichDom2185 Mar 26, 2024
0807b67
Fix test compile error
RichDom2185 Mar 26, 2024
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
504 changes: 0 additions & 504 deletions .eslintrc.base.cjs

This file was deleted.

12 changes: 0 additions & 12 deletions .eslintrc.test.cjs

This file was deleted.

17 changes: 11 additions & 6 deletions .github/workflows/pages-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node.js 💻
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: 20
cache: yarn

- name: Install Dependencies 📦
- name: Install dependencies (apt)
run: |
yarn --frozen-lockfile
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends libxi-dev libgl1-mesa-dev

- name: Install Dependencies 📦
run: yarn install --frozen-lockfile

- name: Build Modules 🔧
run: yarn run build --tsc --lint
run: yarn build --tsc --lint

- name: Deploy 🚀
uses: peaceiris/actions-gh-pages@v3
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node.js 💻
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: 20
cache: yarn

- name: Install dependencies (apt)
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends libxi-dev libgl1-mesa-dev

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.1
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# We don't use Prettier for this project
*
6 changes: 1 addition & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"eslint.workingDirectories": [
"src",
"scripts/src",
"devserver"
],
"eslint.experimental.useFlatConfig": true,
"files.eol": "\r\n",
}
3 changes: 0 additions & 3 deletions __mocks__/chalk.js

This file was deleted.

23 changes: 0 additions & 23 deletions devserver/.eslintrc.json

This file was deleted.

74 changes: 37 additions & 37 deletions devserver/src/components/ControlButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AnchorButton, Button, Icon, type IconName, Intent } from "@blueprintjs/core";
import React from "react";
import { AnchorButton, Button, Icon, type IconName, Intent } from '@blueprintjs/core';
import React from 'react';

type ButtonOptions = {
className: string;
Expand All @@ -8,7 +8,7 @@
iconOnRight: boolean;
intent: Intent;
minimal: boolean;
type?: "submit" | "reset" | "button";
type?: 'submit' | 'reset' | 'button';

Check warning on line 11 in devserver/src/components/ControlButton.tsx

View workflow job for this annotation

GitHub Actions / Verify all tests pass and build success

Union type constituents must be sorted
};

type ControlButtonProps = {
Expand All @@ -20,45 +20,45 @@
};

const defaultOptions = {
className: "",
fullWidth: false,
iconOnRight: false,
intent: Intent.NONE,
minimal: true
className: '',
fullWidth: false,
iconOnRight: false,
intent: Intent.NONE,
minimal: true
};

const ControlButton: React.FC<ControlButtonProps> = ({
label = "",
icon,
onClick,
options = {},
isDisabled = false
label = '',
icon,
onClick,
options = {},
isDisabled = false
}) => {
const buttonOptions: ButtonOptions = {
...defaultOptions,
...options
};
const iconElement = icon && <Icon icon={icon} color={buttonOptions.iconColor} />;
// Refer to #2417 and #2422 for why we conditionally
// set the button component. See also:
// https://blueprintjs.com/docs/#core/components/button
const ButtonComponent = isDisabled ? AnchorButton : Button;
const buttonOptions: ButtonOptions = {
...defaultOptions,
...options
};
const iconElement = icon && <Icon icon={icon} color={buttonOptions.iconColor} />;
// Refer to #2417 and #2422 for why we conditionally
// set the button component. See also:
// https://blueprintjs.com/docs/#core/components/button
const ButtonComponent = isDisabled ? AnchorButton : Button;

return (
<ButtonComponent
disabled={isDisabled}
fill={buttonOptions.fullWidth}
intent={buttonOptions.intent}
minimal={buttonOptions.minimal}
className={buttonOptions.className}
type={buttonOptions.type}
onClick={onClick}
icon={!buttonOptions.iconOnRight && iconElement}
rightIcon={buttonOptions.iconOnRight && iconElement}
>
{label}
</ButtonComponent>
);
return (
<ButtonComponent
disabled={isDisabled}
fill={buttonOptions.fullWidth}
intent={buttonOptions.intent}
minimal={buttonOptions.minimal}
className={buttonOptions.className}
type={buttonOptions.type}
onClick={onClick}
icon={!buttonOptions.iconOnRight && iconElement}
rightIcon={buttonOptions.iconOnRight && iconElement}
>
{label}
</ButtonComponent>
);
};

export default ControlButton;
Loading
Loading