Skip to content

Commit a571fd4

Browse files
authored
Merge branch 'wpilibsuite:main' into add_ts_errors_check
2 parents a620b9f + 998f4fe commit a571fd4

Some content is hidden

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

45 files changed

+2448
-1954
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # or master
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '20' # or your preferred Node.js version
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Build package
24+
run: npm run build # Replace with your build command, outputting to e.g., 'dist'
25+
26+
- name: Deploy to GitHub Pages
27+
uses: peaceiris/actions-gh-pages@v4
28+
with:
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
publish_dir: ./dist # Directory containing your built output
31+
publish_branch: gh-pages

src/App.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ import * as editor from './editor/editor';
3838
import { extendedPythonGenerator } from './editor/extended_python_generator';
3939

4040
import * as commonStorage from './storage/common_storage';
41+
import * as storageModule from './storage/module';
42+
import * as storageProject from './storage/project';
4143
import * as clientSideStorage from './storage/client_side_storage';
4244

4345
import * as CustomBlocks from './blocks/setup_custom_blocks';
@@ -129,7 +131,7 @@ const App: React.FC = (): React.JSX.Element => {
129131
* App wrapper that manages project state and provides it to UserSettingsProvider.
130132
*/
131133
const AppWithUserSettings: React.FC<{ storage: commonStorage.Storage }> = ({ storage }) => {
132-
const [project, setProject] = React.useState<commonStorage.Project | null>(null);
134+
const [project, setProject] = React.useState<storageProject.Project | null>(null);
133135

134136
return (
135137
<UserSettingsProvider
@@ -145,16 +147,16 @@ const AppWithUserSettings: React.FC<{ storage: commonStorage.Storage }> = ({ sto
145147
* Inner application content component that has access to UserSettings context.
146148
*/
147149
interface AppContentProps {
148-
project: commonStorage.Project | null;
149-
setProject: React.Dispatch<React.SetStateAction<commonStorage.Project | null>>;
150+
project: storageProject.Project | null;
151+
setProject: React.Dispatch<React.SetStateAction<storageProject.Project | null>>;
150152
}
151153

152154
const AppContent: React.FC<AppContentProps> = ({ project, setProject }): React.JSX.Element => {
153155
const { t, i18n } = useTranslation();
154156
const { settings, updateLanguage, updateTheme, storage, isLoading } = useUserSettings();
155157

156158
const [alertErrorMessage, setAlertErrorMessage] = React.useState('');
157-
const [currentModule, setCurrentModule] = React.useState<commonStorage.Module | null>(null);
159+
const [currentModule, setCurrentModule] = React.useState<storageModule.Module | null>(null);
158160
const [messageApi, contextHolder] = Antd.message.useMessage();
159161
const [generatedCode, setGeneratedCode] = React.useState<string>('');
160162
const [toolboxSettingsModalIsOpen, setToolboxSettingsModalIsOpen] = React.useState(false);
@@ -340,7 +342,7 @@ const AppContent: React.FC<AppContentProps> = ({ project, setProject }): React.J
340342
};
341343

342344
/** Changes current module with automatic saving if modified. */
343-
const changeModule = async (module: commonStorage.Module | null): Promise<void> => {
345+
const changeModule = async (module: storageModule.Module | null): Promise<void> => {
344346
if (currentModule && areBlocksModified()) {
345347
await saveBlocks();
346348
}
@@ -359,7 +361,7 @@ const AppContent: React.FC<AppContentProps> = ({ project, setProject }): React.J
359361
};
360362

361363
/** Creates tab items from project data. */
362-
const createTabItemsFromProject = (projectData: commonStorage.Project): Tabs.TabItem[] => {
364+
const createTabItemsFromProject = (projectData: storageProject.Project): Tabs.TabItem[] => {
363365
const tabs: Tabs.TabItem[] = [
364366
{
365367
key: projectData.robot.modulePath,

0 commit comments

Comments
 (0)