Skip to content

Commit 0128673

Browse files
leeyi45RichDom2185
andauthored
Scripts Refactor (#296)
* Relocate script configuration files * Update template scripts to use commander with extra typings * Scripts v3 * Update eslint configuration to work with new scripts folder layout * Fix bundle tests * Fix jest setup for scripts * Fix prebuild tests * Fixed bug where jsons were not writing descriptions for functions * Relocate retrieveManifest to make it easier to mock during testing * Fixing broken tests * Update jest and astring packages * Standardize tests for commands * Fix tsc tests * Temporarily skip json tests * Update linting for modules * Update CI to use node 20 * Update CI to install dependencies required by gl * Fix linting errors * Fix bug where return types of functions were not being generated correctly * Add handling case for unknown types generated by typedoc * Use array for function parameters to respect parameter order * Update to flat config for ESLint configuration * Update dependencies * Fix tests and standardize commands * Fix linting with new eslint configuration * Fix regression where linter wasn't properly linting all files * Fix issue where jsons were being generated with invalid types * Use import attributes instead of assertions and update linting configuration to ignore more files * Update linting configuration to use spaces instead of tabs uniformly * Disable Prettier for project Prevents conflicts when VS Code already has format-on-save set up. * Add .node-version file * Add tests for template command and fix template command bugs * Fix the issue where the scripts wouldn't exit automatically after execution * Remove some uh, idk what this is supposed to be * Update linting packages and configurations * Fix linting again :( * Run linting with updated config * Bump CI workflow dependencies * Reformat * Update eslint configuration again * Run linting with updated configuration * Run linter * Fix incorrect comment location * Fix the import order for @src imports * Change import duplicates lint rule setting to not prefer inline type modifier * Replace magic numbers with constants For better code readability. * Remove remaining stray tab characters * Enforce semicolons * Fix lockfile post-merge * Deduplicate dependencies * Fix lint post-merge * Fix lint error post-merge * Fix test compile error --------- Co-authored-by: Richard Dominick <[email protected]>
1 parent ce5b07e commit 0128673

File tree

221 files changed

+5526
-7448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+5526
-7448
lines changed

.eslintrc.base.cjs

Lines changed: 0 additions & 504 deletions
This file was deleted.

.eslintrc.test.cjs

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/pages-deploy.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout 🛎️
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414

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

20-
- name: Install Dependencies 📦
21+
- name: Install dependencies (apt)
2122
run: |
22-
yarn --frozen-lockfile
23+
sudo apt-get update && \
24+
sudo apt-get install -y --no-install-recommends libxi-dev libgl1-mesa-dev
25+
26+
- name: Install Dependencies 📦
27+
run: yarn install --frozen-lockfile
2328

2429
- name: Build Modules 🔧
25-
run: yarn run build --tsc --lint
30+
run: yarn build --tsc --lint
2631

2732
- name: Deploy 🚀
2833
uses: peaceiris/actions-gh-pages@v3

.github/workflows/pull-request.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Check out source code
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414

1515
- name: Use Node.js 💻
16-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v4
1717
with:
18-
node-version: '16.x'
18+
node-version: 20
19+
cache: yarn
20+
21+
- name: Install dependencies (apt)
22+
run: |
23+
sudo apt-get update && \
24+
sudo apt-get install -y --no-install-recommends libxi-dev libgl1-mesa-dev
1925
2026
- name: Install dependencies
2127
run: yarn install --frozen-lockfile

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.11.1

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# We don't use Prettier for this project
2+
*

.vscode/settings.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
2-
"eslint.workingDirectories": [
3-
"src",
4-
"scripts/src",
5-
"devserver"
6-
],
2+
"eslint.experimental.useFlatConfig": true,
73
"files.eol": "\r\n",
84
}

__mocks__/chalk.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

devserver/.eslintrc.json

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { AnchorButton, Button, Icon, type IconName, Intent } from "@blueprintjs/core";
2-
import React from "react";
1+
import { AnchorButton, Button, Icon, type IconName, Intent } from '@blueprintjs/core';
2+
import React from 'react';
33

44
type ButtonOptions = {
55
className: string;
@@ -8,7 +8,7 @@ type ButtonOptions = {
88
iconOnRight: boolean;
99
intent: Intent;
1010
minimal: boolean;
11-
type?: "submit" | "reset" | "button";
11+
type?: 'button' | 'reset' | 'submit';
1212
};
1313

1414
type ControlButtonProps = {
@@ -20,45 +20,45 @@ type ControlButtonProps = {
2020
};
2121

2222
const defaultOptions = {
23-
className: "",
24-
fullWidth: false,
25-
iconOnRight: false,
26-
intent: Intent.NONE,
27-
minimal: true
23+
className: '',
24+
fullWidth: false,
25+
iconOnRight: false,
26+
intent: Intent.NONE,
27+
minimal: true
2828
};
2929

3030
const ControlButton: React.FC<ControlButtonProps> = ({
31-
label = "",
32-
icon,
33-
onClick,
34-
options = {},
35-
isDisabled = false
31+
label = '',
32+
icon,
33+
onClick,
34+
options = {},
35+
isDisabled = false
3636
}) => {
37-
const buttonOptions: ButtonOptions = {
38-
...defaultOptions,
39-
...options
40-
};
41-
const iconElement = icon && <Icon icon={icon} color={buttonOptions.iconColor} />;
42-
// Refer to #2417 and #2422 for why we conditionally
43-
// set the button component. See also:
44-
// https://blueprintjs.com/docs/#core/components/button
45-
const ButtonComponent = isDisabled ? AnchorButton : Button;
37+
const buttonOptions: ButtonOptions = {
38+
...defaultOptions,
39+
...options
40+
};
41+
const iconElement = icon && <Icon icon={icon} color={buttonOptions.iconColor} />;
42+
// Refer to #2417 and #2422 for why we conditionally
43+
// set the button component. See also:
44+
// https://blueprintjs.com/docs/#core/components/button
45+
const ButtonComponent = isDisabled ? AnchorButton : Button;
4646

47-
return (
48-
<ButtonComponent
49-
disabled={isDisabled}
50-
fill={buttonOptions.fullWidth}
51-
intent={buttonOptions.intent}
52-
minimal={buttonOptions.minimal}
53-
className={buttonOptions.className}
54-
type={buttonOptions.type}
55-
onClick={onClick}
56-
icon={!buttonOptions.iconOnRight && iconElement}
57-
rightIcon={buttonOptions.iconOnRight && iconElement}
58-
>
59-
{label}
60-
</ButtonComponent>
61-
);
47+
return (
48+
<ButtonComponent
49+
disabled={isDisabled}
50+
fill={buttonOptions.fullWidth}
51+
intent={buttonOptions.intent}
52+
minimal={buttonOptions.minimal}
53+
className={buttonOptions.className}
54+
type={buttonOptions.type}
55+
onClick={onClick}
56+
icon={!buttonOptions.iconOnRight && iconElement}
57+
rightIcon={buttonOptions.iconOnRight && iconElement}
58+
>
59+
{label}
60+
</ButtonComponent>
61+
);
6262
};
6363

6464
export default ControlButton;

0 commit comments

Comments
 (0)