Skip to content

Commit dc9477c

Browse files
authored
Merge pull request #156 from StevenAskwith/main
TypeScript Migration and Modern Build System Upgrade
2 parents a15bdef + 0cbe01a commit dc9477c

File tree

298 files changed

+19276
-5718
lines changed

Some content is hidden

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

298 files changed

+19276
-5718
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ bin/**/*.js
4141
test/**/*.js
4242
!jest.config.js
4343
*.d.ts
44+
!**/vite-env.d.ts
4445
node_modules
4546

4647
# CDK asset staging directory

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ local.config.docker: ## Setup local config based on branch
125125
cd $(overlaysSrcPath)/graphql/ && amplify codegen
126126
cd $(current_dir)
127127

128+
## Test targets
129+
130+
.PHONY: test test.website
131+
test: ## Run all tests
132+
cd website && npm test
133+
134+
test.website: ## Run website schema conformance tests
135+
cd website && npm test
136+
128137
local.config.python: ## Setup a Python .venv
129138
python3 -m venv --prompt drem .venv
130139
source .venv/bin/activate

lib/base-stack.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ export class BaseStack extends cdk.Stack {
137137
// Lambda
138138
// Common Config
139139
const lambda_architecture = awsLambda.Architecture.ARM_64;
140-
const lambda_runtime = awsLambda.Runtime.PYTHON_3_11;
141-
var lambda_bundling_image = DockerImage.fromRegistry('public.ecr.aws/sam/build-python3.11:latest');
140+
const lambda_runtime = awsLambda.Runtime.PYTHON_3_12;
141+
var lambda_bundling_image = DockerImage.fromRegistry('public.ecr.aws/sam/build-python3.12:latest');
142142
if (os.arch() === 'arm64') {
143-
lambda_bundling_image = DockerImage.fromRegistry('public.ecr.aws/sam/build-python3.11:latest-arm64');
143+
lambda_bundling_image = DockerImage.fromRegistry('public.ecr.aws/sam/build-python3.12:latest-arm64');
144144
}
145145

146146
// Layers

lib/cdk-pipeline-stack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { DeepracerEventManagerStack } from './drem-app-stack';
1212

1313
// Constants
1414
const NODE_VERSION = '22'; // other possible options: stable, latest, lts
15-
const CDK_VERSION = '2.1033.0'; // other possible options: latest
15+
const CDK_VERSION = '2.1106.0'; // other possible options: latest
1616
const AMPLIFY_VERSION = '12.14.4';
1717

1818
export interface InfrastructurePipelineStageProps extends cdk.StackProps {

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,38 @@
3030
]
3131
},
3232
"devDependencies": {
33+
"@babel/plugin-proposal-private-property-in-object": "^7.16.7",
3334
"@types/jest": "^29.5.14",
34-
"@types/node": "20.19.1",
35+
"@types/node": "20.19.33",
3536
"@typescript-eslint/eslint-plugin": "^6.21.0",
3637
"@typescript-eslint/parser": "^6.21.0",
37-
"@babel/plugin-proposal-private-property-in-object": "^7.16.7",
38-
"aws-cdk-lib": "2.202.0",
38+
"aws-cdk-lib": "2.225.0",
3939
"eslint": "^8.48.0",
4040
"eslint-config-node": "^4.1.0",
41-
"eslint-config-prettier": "^9.1.0",
41+
"eslint-config-prettier": "^9.1.2",
4242
"eslint-config-react-app": "^7.0.1",
4343
"eslint-import-resolver-typescript": "^3.10.1",
4444
"eslint-plugin-import": "^2.32.0",
4545
"eslint-plugin-jest": "^27.9.0",
4646
"eslint-plugin-jsx-a11y": "^6.10.2",
4747
"eslint-plugin-node": "^11.1.0",
48-
"eslint-plugin-prettier": "^5.5.0",
48+
"eslint-plugin-prettier": "^5.5.5",
4949
"eslint-plugin-react": "^7.37.5",
5050
"eslint-plugin-react-hooks": "^4.6.2",
5151
"jest": "^29.7.0",
52-
"prettier": "^3.6.0",
53-
"ts-jest": "^29.4.0",
52+
"prettier": "^3.8.1",
53+
"ts-jest": "^29.4.6",
5454
"ts-node": "^10.9.2",
55-
"typescript": "5.8.3"
55+
"typescript": "5.9.3"
5656
},
5757
"dependencies": {
58-
"@aws-cdk/aws-lambda-python-alpha": "^2.202.0-alpha.0",
59-
"aws-cdk-lib": "2.202.0",
60-
"awscdk-appsync-utils": "^0.0.769",
61-
"cdk-nag": "2.36.24",
58+
"@aws-cdk/aws-lambda-python-alpha": "^2.225.0-alpha.0",
59+
"@cloudscape-design/component-toolkit": "^1.0.0-beta.138",
60+
"aws-cdk-lib": "2.225.0",
61+
"awscdk-appsync-utils": "^0.0.858",
62+
"cdk-nag": "2.37.55",
6263
"cdk-serverless-clamscan": "^2.13.46",
63-
"constructs": "^10.4.2",
64+
"constructs": "^10.5.0",
6465
"source-map-support": "^0.5.21"
6566
}
6667
}

website-leaderboard/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/docker/library/node:18-alpine
1+
FROM public.ecr.aws/docker/library/node:22-alpine
22

33
# Install packages
44
RUN apk update && apk add --update --no-cache \
@@ -30,4 +30,4 @@ RUN npm install
3030

3131
ENV PORT=3000
3232

33-
CMD ["npm", "start"]
33+
CMD ["npx", "vite", "--host"]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import js from '@eslint/js';
2+
import prettier from 'eslint-config-prettier';
3+
import reactHooks from 'eslint-plugin-react-hooks';
4+
import reactRefresh from 'eslint-plugin-react-refresh';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{ ignores: ['build/**', 'node_modules/**'] },
9+
js.configs.recommended,
10+
...tseslint.configs.recommended,
11+
{
12+
plugins: {
13+
'react-hooks': reactHooks,
14+
'react-refresh': reactRefresh,
15+
},
16+
rules: {
17+
...reactHooks.configs.recommended.rules,
18+
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
19+
'@typescript-eslint/no-unused-vars': 'warn',
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
},
22+
},
23+
prettier
24+
);

website-leaderboard/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta name="description" content="DeepRacer Event Manager (DREM)" />
9+
<link rel="apple-touch-icon" href="/logo192.png" />
10+
<link rel="manifest" href="/manifest.json" />
11+
<title>DeepRacer Event Manager - Leaderboard</title>
12+
</head>
13+
<body>
14+
<noscript>You need to enable JavaScript to run this app.</noscript>
15+
<div id="root"></div>
16+
<script type="module" src="/src/index.tsx"></script>
17+
</body>
18+
</html>

website-leaderboard/package.json

Lines changed: 37 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,46 @@
22
"name": "leaderboard",
33
"version": "0.1.0",
44
"private": true,
5+
"type": "module",
56
"dependencies": {
6-
"@aws-amplify/ui-react": "^5.3.1",
7-
"@cloudscape-design/components": "^3.0.409",
8-
"@cloudscape-design/global-styles": "^1.0.13",
9-
"@testing-library/jest-dom": "^6.1.2",
10-
"@testing-library/react": "^14.0.0",
11-
"@testing-library/user-event": "^14.5.1",
12-
"aws-amplify": "^5.3.11",
13-
"aws-rum-web": "^1.15.0",
14-
"classnames": "^2.3.2",
15-
"i18next-browser-languagedetector": "^7.1.0",
16-
"i18next-xhr-backend": "^3.2.2",
17-
"qrcode.react": "^3.1.0",
18-
"react": "^18.2.0",
19-
"react-dom": "^18.2.0",
20-
"react-i18next": "^13.3.0",
21-
"react-router-dom": "^6.17.0",
22-
"react-scripts": "^5.0.1",
23-
"web-vitals": "^3.5.0"
24-
},
25-
"scripts": {
26-
"start": "ESLINT_NO_DEV_ERRORS='true' react-scripts start",
27-
"build": "DISABLE_ESLINT_PLUGIN='true' react-scripts build",
28-
"test": "react-scripts test",
29-
"eject": "react-scripts eject"
30-
},
31-
"eslintConfig": {
32-
"extends": [
33-
"react-app",
34-
"react-app/jest"
35-
]
36-
},
37-
"browserslist": {
38-
"production": [
39-
">0.2%",
40-
"not dead",
41-
"not op_mini all"
42-
],
43-
"development": [
44-
"last 1 chrome version",
45-
"last 1 firefox version",
46-
"last 1 safari version"
47-
]
7+
"@cloudscape-design/components": "^3.0.1205",
8+
"@cloudscape-design/global-styles": "^1.0.50",
9+
"aws-amplify": "^6.16.2",
10+
"aws-rum-web": "^1.25.0",
11+
"classnames": "^2.5.1",
12+
"i18next": "^25.8.11",
13+
"i18next-browser-languagedetector": "^8.2.1",
14+
"i18next-http-backend": "^3.0.2",
15+
"qrcode.react": "^3.2.0",
16+
"react": "^18.3.1",
17+
"react-dom": "^18.3.1",
18+
"react-i18next": "^15.7.4",
19+
"react-router-dom": "^6.30.3",
20+
"web-vitals": "^4.2.4"
4821
},
4922
"devDependencies": {
50-
"@babel/plugin-proposal-private-property-in-object": "^7.21.1",
51-
"@typescript-eslint/eslint-plugin": "^6.8.0",
52-
"@typescript-eslint/parser": "^6.8.0",
53-
"eslint": "^8.51.0",
54-
"eslint-config-prettier": "^9.0.0",
55-
"eslint-config-react-app": "^7.0.1",
56-
"eslint-import-resolver-typescript": "^3.6.1",
57-
"eslint-plugin-import": "^2.28.1",
58-
"eslint-plugin-jest": "^27.4.2",
59-
"eslint-plugin-jsx-a11y": "^6.7.1",
60-
"eslint-plugin-prettier": "^5.0.1",
61-
"eslint-plugin-react": "^7.33.2",
62-
"eslint-plugin-react-hooks": "^4.6.0",
63-
"prettier": "^3.4.2",
64-
"typescript": "5.2.2"
23+
"@eslint/js": "^9.39.2",
24+
"@types/jest": "^30.0.0",
25+
"@testing-library/jest-dom": "^6.9.1",
26+
"@testing-library/react": "^14.3.1",
27+
"@testing-library/user-event": "^14.6.1",
28+
"@types/node": "^22.19.11",
29+
"@types/react": "^18.3.28",
30+
"@types/react-dom": "^18.3.7",
31+
"@vitejs/plugin-react": "^5.1.4",
32+
"eslint": "^9.39.2",
33+
"eslint-config-prettier": "^10.1.8",
34+
"eslint-plugin-react-hooks": "^5.2.0",
35+
"eslint-plugin-react-refresh": "^0.5.0",
36+
"prettier": "^3.8.1",
37+
"typescript": "5.9.3",
38+
"typescript-eslint": "^8.56.0",
39+
"vite": "^7.3.1"
6540
},
66-
"overrides": {
67-
"react-scripts": {
68-
"typescript": "^5"
69-
},
70-
"react-refresh": "^0.14.0"
41+
"scripts": {
42+
"start": "vite",
43+
"build": "tsc --noEmit && vite build",
44+
"preview": "vite preview",
45+
"lint": "eslint ."
7146
}
7247
}

website-leaderboard/public/index.html

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

0 commit comments

Comments
 (0)