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

Feature/convert #324

Merged
merged 102 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
664d4f6
Convert HereMarker to TypeScript
JeffreyATW May 23, 2023
52e3732
Convert IntlProviderContainer to TypeScript
JeffreyATW May 23, 2023
6073c8c
Convert Layout to TypeScript
JeffreyATW May 24, 2023
b01fd45
Convert Link and Html to TypeScript
JeffreyATW May 24, 2023
9b56d85
Convert Loading to TypeScript
JeffreyATW May 24, 2023
a740860
Convert Menu to TypeScript
JeffreyATW May 24, 2023
18d5bb6
Convert NameFilterForm to TypeScript
JeffreyATW May 24, 2023
ad74d54
Convert Notification to TypeScript
JeffreyATW May 24, 2023
17cdd4d
Convert NotificationList to TypeScript
JeffreyATW May 24, 2023
de9cbe5
Convert PastDecisionsModal to TypeScript
JeffreyATW May 24, 2023
139607e
Convert Restaurant to TypeScript
JeffreyATW May 24, 2023
823f9ac
Convert RestaurantAddForm to TypeScript
JeffreyATW May 25, 2023
2fa613b
Convert RestaurantAddTagForm to TypeScript
JeffreyATW May 25, 2023
8606ae4
Convert RestaurantDecision to TypeScript
JeffreyATW May 25, 2023
a2c1575
Convert RestaurantDropdown to TypeScript
JeffreyATW May 25, 2023
c0ce7ff
Convert RestaurantList to TypeScript
JeffreyATW May 25, 2023
52f8017
Convert RestaurantMap to TypeScript
JeffreyATW May 25, 2023
82151e8
Convert RestaurantMapSettings to TypeScript
JeffreyATW May 26, 2023
0ac7c64
Convert RestaurantMarker to TypeScript
JeffreyATW May 26, 2023
3e1bf1b
Convert RestaurantNameForm to TypeScript
JeffreyATW May 26, 2023
13255b7
Convert RestaurantTagList to TypeScript
JeffreyATW May 26, 2023
be6fc23
Convert RestaurantVoteButton to TypeScript
JeffreyATW May 26, 2023
64512e5
Convert RestaurantVoteCount to TypeScript
JeffreyATW May 26, 2023
a135f30
Convert Tag to TypeScript
JeffreyATW May 26, 2023
6655888
Convert TagFilterForm to TypeScript
JeffreyATW May 26, 2023
7cce9bc
Convert TagManager to TypeScript
JeffreyATW May 26, 2023
729783e
Convert TagManagerItem, TeamForm, and TeamMap to TypeScript
JeffreyATW May 26, 2023
aa190ef
Convert TeamGeosuggest to TypeScript
JeffreyATW May 26, 2023
7c42298
Convert TempMarker to TypeScript
JeffreyATW May 26, 2023
9e45c1f
Convert TooltipUser to TypeScript
JeffreyATW May 26, 2023
086d925
Convert App component to TypeScript
JeffreyATW May 27, 2023
0f5d1e1
Convert constants to TypeScript
JeffreyATW May 27, 2023
64d42b4
Convert restaurant action tests to TypeScript
JeffreyATW May 27, 2023
58f437a
Convert tag action tests to TypeScript
JeffreyATW May 27, 2023
2ad793d
Convert teams actions to TypeScript
JeffreyATW May 27, 2023
bd9b0c7
Convert user action tests to TypeScript
JeffreyATW May 30, 2023
219f8dd
Convert websockets action tests to TypeScript
JeffreyATW May 30, 2023
be37054
Convert decisions API to TypeScript
JeffreyATW May 30, 2023
ba7c7f3
Convert user API to TypeScript
JeffreyATW May 30, 2023
6ea69ea
Convert users API to TypeScript
JeffreyATW May 30, 2023
fccb74e
Convert ApiClient tests to TypeScript
JeffreyATW May 31, 2023
a443f1f
Convert canChangeUser and TagAutosuggestHelper tests to TypeScript
JeffreyATW May 31, 2023
cc1eb9a
Convert canChangeRole to TypeScript
JeffreyATW May 31, 2023
0448306
Convert canOperateAtRole to TypeScript
JeffreyATW May 31, 2023
7ec5555
Convert generateMessageDescriptor to TypeScript
JeffreyATW May 31, 2023
0c8c241
Convert generateToken and generateUrl to TypeScript
JeffreyATW May 31, 2023
2be1d7b
Fix TS errors
JeffreyATW May 31, 2023
22a7c01
Add types to window.app
JeffreyATW May 31, 2023
b6dc054
Replace local get with lodash.get
JeffreyATW May 31, 2023
a4180a4
Convert getPasswordError and getRole to TypeScript
JeffreyATW May 31, 2023
66ef1df
Convert getUserPasswordUpdates to TypeScript
JeffreyATW May 31, 2023
5af7586
Convert googleMapOptions to TypeScript
JeffreyATW May 31, 2023
f8a677b
Convert transporter to TypeScript
JeffreyATW Jun 1, 2023
3c5cb55
Convert invitation middleware to TypeScript
JeffreyATW Jun 1, 2023
8b823b5
Fix GA tags
JeffreyATW Jun 1, 2023
37d0df1
Convert login middleware to TypeScript
JeffreyATW Jun 1, 2023
9b418ab
Convert password middleware to TypeScript
JeffreyATW Jun 1, 2023
c6b9ce3
Remove resetRestaurant
JeffreyATW Jun 2, 2023
0cbb74d
Remove setOrMerge
JeffreyATW Jun 2, 2023
738b686
Convert restaurants reducer tests to TypeScript
JeffreyATW Jun 2, 2023
1ad0647
Convert teams reducer tests to TypeScript
JeffreyATW Jun 2, 2023
dac56df
Convert user reducer tests to TypeScript
JeffreyATW Jun 2, 2023
3bea540
Convert users reducer tests to TypeScript
JeffreyATW Jun 2, 2023
e5ee169
Convert Login route to TypeScript
JeffreyATW Jun 2, 2023
bbd37c2
Convert About route to TypeScript
JeffreyATW Jun 2, 2023
dc139bb
Convert Account route to TypeScript
JeffreyATW Jun 2, 2023
cca686e
Convert invitation Create route to TypeScript
JeffreyATW Jun 2, 2023
50a187b
Convert invitation New route to TypeScript
JeffreyATW Jun 2, 2023
516b24e
Convert invitation route to TypeScript
JeffreyATW Jun 2, 2023
754c0e1
Convert landing route to TypeScript
JeffreyATW Jun 2, 2023
a4444ca
Convert main New Team route to TypeScript
JeffreyATW Jun 2, 2023
7f441a6
Convert password Create route to TypeScript
JeffreyATW Jun 2, 2023
c720bbc
Convert password Edit route to TypeScript
JeffreyATW Jun 2, 2023
4da27be
Convert password New route to TypeScript
JeffreyATW Jun 2, 2023
b2b3b34
Convert password route to TypeScript
JeffreyATW Jun 2, 2023
d85cb8c
Convert main Teams route to TypeScript
JeffreyATW Jun 2, 2023
1f6a26a
Convert users Create route to TypeScript
JeffreyATW Jun 2, 2023
381ace1
Convert users New route to TypeScript
JeffreyATW Jun 2, 2023
c119de5
Convert users route to TypeScript
JeffreyATW Jun 2, 2023
52f2e9d
Convert welcome route to TypeScript
JeffreyATW Jun 2, 2023
adc427c
Convert main route to TypeScript
JeffreyATW Jun 2, 2023
e5672f0
Convert not-found route to TypeScript
JeffreyATW Jun 2, 2023
7cb1ede
Convert team Home route to TypeScript
JeffreyATW Jun 5, 2023
2c78c09
Convert team Tags route to TypeScript
JeffreyATW Jun 5, 2023
ec66052
Convert team Team route to TypeScript
JeffreyATW Jun 5, 2023
8be0c7d
Convert team teams route to TypeScript
JeffreyATW Jun 5, 2023
ad11e9f
Convert decisions selectors to TypeScript
JeffreyATW Jun 5, 2023
99f88dc
Convert more selectors to TypeScript
JeffreyATW Jun 5, 2023
e281d9c
Convert users selectors to TypeScript
JeffreyATW Jun 5, 2023
4baf82d
Convert votes selectors to TypeScript
JeffreyATW Jun 5, 2023
21a3ba7
Convert selectors to TypeScript
JeffreyATW Jun 5, 2023
f830605
Convert some base source files to TypeScript
JeffreyATW Jun 5, 2023
80c42bb
Convert routes helpers to TypeScript
JeffreyATW Jun 5, 2023
0beaba1
Change babel-node to ts-node
JeffreyATW Jun 5, 2023
f9ebc31
Convert Mocha to TypeScript
JeffreyATW Jun 5, 2023
67fed48
Remove babel-loader
JeffreyATW Jun 6, 2023
b62b07e
Make nyc work with TypeScript
JeffreyATW Jun 6, 2023
91800ad
Remove Babel
JeffreyATW Jun 6, 2023
94d7154
Remove .flowconfig
JeffreyATW Jun 6, 2023
8aa48f5
Do not emit declaration files
JeffreyATW Jun 6, 2023
cbe5286
Remove stray Jest file
JeffreyATW Jun 6, 2023
10f2d6b
Remove unused Travis file
JeffreyATW Jun 6, 2023
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
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ GOOGLE_CLIENT_APIKEY=
GOOGLE_SERVER_APIKEY=

# Google Analytics ID
GOOGLE_TRACKING_ID=
GOOGLE_MEASUREMENT_ID=

# JSON Web Token secret to encrypt ID token cookie
JWT_SECRET=
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ module.exports = {
"react/static-property-placement": "off",
"import/no-relative-packages": "off",
"import/no-import-module-exports": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
},

settings: {
Expand Down
11 changes: 0 additions & 11 deletions .flowconfig

This file was deleted.

7 changes: 0 additions & 7 deletions .mocharc.js

This file was deleted.

13 changes: 13 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extension": [
"ts"
],
"recursive": true,
"require": [
"ts-node/register",
"source-map-support/register",
"./test/setup.ts"
],
"exit": true,
"file": "./test/mocha-setup.ts"
}
16 changes: 10 additions & 6 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"require": ["@babel/register"],
"include": ["src"],
"reporter": ["lcov", "text"],
"sourceMap": false,
"instrument": false
}
"extends": "@istanbuljs/nyc-config-typescript",
"all": true,
"include": [
"src"
],
"reporter": [
"lcov",
"text"
]
}
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

37 changes: 0 additions & 37 deletions babel.config.js

This file was deleted.

9 changes: 9 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ declare const __DEV__: boolean;
/// <reference types="webpack-env" />
/// <reference types="chai-jsdom" />

declare interface Window {
swUpdate?: boolean;
}

type Dispose = () => void;
type InsertCssItem = () => Dispose;
type GetCSSItem = () => string;
Expand All @@ -30,3 +34,8 @@ declare module "*.png" {
const value: string;
export default value;
}

declare module "*.svg" {
const value: string;
export default value;
}
8 changes: 0 additions & 8 deletions jest/fileTransformer.js

This file was deleted.

68 changes: 26 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"@honeybadger-io/js": "^5.0.0",
"@popperjs/core": "^2.11.7",
"@reduxjs/toolkit": "^1.9.2",
"@sendgrid/helpers": "^7.7.0",
"@sendgrid/mail": "^7.7.0",
"bcrypt": "^5.1.0",
"body-parser": "^1.18.3",
"bootstrap": "^5.2.3",
Expand All @@ -23,7 +25,6 @@
"connect-flash": "^0.1.1",
"connect-session-sequelize": "^7.1.5",
"cookie-parser": "^1.4.6",
"core-js": "^3.30.2",
"cors": "^2.8.3",
"dayjs": "^1.11.7",
"dotenv": "^2.0.0",
Expand All @@ -37,24 +38,24 @@
"fastclick": "^1.0.6",
"fbjs": "^3.0.4",
"fetch-mock": "^9.11.0",
"flip-toolkit": "^7.1.0",
"google-map-react": "^2.2.0",
"history": "^5.3.0",
"immutability-helper": "^3.1.1",
"isomorphic-fetch": "^3.0.0",
"isomorphic-style-loader": "^5.3.2",
"jsonwebtoken": "^9.0.0",
"lodash.get": "^4.4.2",
"method-override": "^3.0.0",
"mocha-junit-reporter": "^2.2.0",
"morgan": "^1.10.0",
"node-fetch": "^2.6.9",
"normalizr": "^3.2.2",
"passport": "^0.6.0",
"passport-google-oauth20": "^2.0.0",
"passport-local": "^1.0.0",
"pg": "^8.9.0",
"pretty-error": "^3.0.4",
"prop-types": "^15.8.1",
"query-string": "^7.1.3",
"qs": "^6.11.2",
"react": "^18.2.0",
"react-autosuggest": "^10.0.2",
"react-bootstrap": "^2.7.0",
Expand All @@ -72,31 +73,16 @@
"reserved-usernames": "^1.0.3",
"robust-websocket": "^0.2.1",
"rotating-file-stream": "^3.1.0",
"sendgrid": "^5.2.3",
"sequelize": "^6.29.0",
"sequelize-cli": "^6.6.0",
"sequelize-typescript": "^2.1.5",
"serialize-javascript": "^6.0.1",
"source-map-support": "^0.5.9",
"sqlite3": "^5.1.5",
"universal-router": "^8.1.0",
"uuid": "^9.0.0",
"whatwg-fetch": "^3.0.0"
"uuid": "^9.0.0"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/eslint-parser": "^7.19.1",
"@babel/node": "^7.20.7",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.21.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-modules-commonjs": "^7.20.11",
"@babel/plugin-transform-react-constant-elements": "^7.20.2",
"@babel/plugin-transform-react-inline-elements": "^7.18.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.0",
"@babel/register": "^7.18.9",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@jedmao/redux-mock-store": "^3.0.5",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@redux-devtools/extension": "^3.2.5",
Expand All @@ -116,15 +102,20 @@
"@types/google-map-react": "^2.1.7",
"@types/google.analytics": "^0.0.42",
"@types/google.maps": "^3.52.1",
"@types/lodash.get": "^4.4.7",
"@types/method-override": "^0.0.32",
"@types/mocha": "^10.0.1",
"@types/morgan": "^1.9.4",
"@types/node-fetch": "^2.6.2",
"@types/node": "^20.2.5",
"@types/passport": "^1.0.11",
"@types/passport-google-oauth20": "^2.0.11",
"@types/passport-local": "^1.0.35",
"@types/proxyquire": "^1.3.28",
"@types/react-autosuggest": "^10.1.6",
"@types/react-dom": "^18.2.4",
"@types/react-geosuggest": "^2.7.13",
"@types/react-scroll": "^1.8.7",
"@types/serialize-javascript": "^5.0.2",
"@types/sinon": "^10.0.15",
"@types/supertest": "^2.0.12",
"@types/uuid": "^9.0.0",
Expand All @@ -134,10 +125,6 @@
"@typescript-eslint/parser": "^5.59.1",
"assets-webpack-plugin": "^7.1.1",
"autoprefixer": "^9.1.5",
"babel-loader": "^9.1.0",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-transform-react-remove-prop-types": "^0.4.18",
"babel-plugin-transform-typescript-metadata": "^0.3.2",
"browser-sync": "2.29.1",
"chai": "4.3.7",
"chai-jsdom": "^0.2.3",
Expand Down Expand Up @@ -188,6 +175,7 @@
"sass-loader": "^13.2.0",
"sequelize-mock": "^0.7.0",
"sinon": "^15.1.0",
"source-map-support": "^0.5.21",
"style-loader": "^0.13.2",
"stylelint": "^15.6.2",
"stylelint-config-standard-scss": "^9.0.0",
Expand All @@ -196,7 +184,7 @@
"svg-url-loader": "^8.0.0",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "^5.0.4",
"typescript": "^5.1.3",
"url-loader": "^4.1.1",
"webpack": "^5.76.0",
"webpack-assets-manifest": "^5.1.0",
Expand All @@ -220,21 +208,17 @@
"git add --force"
]
},
"nyc": {
"sourceMap": false,
"instrument": false
},
"scripts": {
"lint-js": "eslint --ignore-path .gitignore --ignore-pattern \"!**/.*\" .",
"lint-css": "stylelint \"src/**/*.{css,less,styl,scss,sass,sss}\"",
"lint": "npm run lint-js && npm run lint-css",
"fix-js": "npm run lint-js -- --fix",
"fix-css": "npm run lint-css -- --fix",
"fix": "npm run fix-js && npm run fix-css",
"test-file": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
"test-file": "mocha",
"test-file-ci": "npm run test-file --reporter mocha-junit-reporter",
"test": "npm run test-file \"./src/**/*.test.{js,ts}\"",
"test-ci": "npm run test-file-ci \"./src/**/*.test.{js,ts}\"",
"test": "npm run test-file \"./src/**/*.test.ts\"",
"test-ci": "npm run test-file-ci \"./src/**/*.test.ts\"",
"test-watch": "npm run test --watch --notify",
"test-cover": "nyc npm run test",
"coverage": "npm run test-cover && open-cli coverage/lcov-report/index.html",
Expand All @@ -254,15 +238,15 @@
"integration-file": "cross-env NODE_ENV=test npm-run-all integration-setup -r -p serve \"cypress:run-file {1}\" --",
"integration-interactive": "cross-env NODE_ENV=test npm-run-all integration-setup -r -p serve cypress:open",
"integration-test-ci": "cross-env NODE_ENV=test npm-run-all integration-setup -r -p serve cypress:run-integration",
"clean": "babel-node tools/run clean",
"copy": "babel-node tools/run copy",
"bundle": "babel-node tools/run bundle",
"build": "babel-node tools/run build",
"clean": "ts-node tools/run clean",
"copy": "ts-node tools/run copy",
"bundle": "ts-node tools/run bundle",
"build": "ts-node tools/run build",
"build-stats": "npm run build -- --release --analyse",
"deploy": "babel-node tools/run deploy",
"render": "babel-node tools/run render",
"serve": "babel-node tools/run runServer || true",
"start": "babel-node tools/run start",
"deploy": "ts-node tools/run deploy",
"render": "ts-node tools/run render",
"serve": "ts-node tools/run runServer || true",
"start": "ts-node tools/run start",
"prepare": "husky install"
},
"packageManager": "[email protected]"
Expand Down
16 changes: 11 additions & 5 deletions src/DOMUtils.js → src/DOMUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
* LICENSE.txt file in the root directory of this source tree.
*/

export function updateTag(tagName, keyName, keyValue, attrName, attrValue) {
export function updateTag(
tagName: string,
keyName: string,
keyValue: string,
attrName: string,
attrValue: string
) {
const node = document.head.querySelector(
`${tagName}[${keyName}="${keyValue}"]`
);
if (node && node.getAttribute(attrName) === attrValue) return;

// Remove and create a new tag in order to make it work with bookmarks in Safari
if (node) {
node.parentNode.removeChild(node);
node.parentNode?.removeChild(node);
}
if (typeof attrValue === "string") {
const nextNode = document.createElement(tagName);
Expand All @@ -25,14 +31,14 @@ export function updateTag(tagName, keyName, keyValue, attrName, attrValue) {
}
}

export function updateMeta(name, content) {
export function updateMeta(name: string, content: string) {
updateTag("meta", "name", name, "content", content);
}

export function updateCustomMeta(property, content) {
export function updateCustomMeta(property: string, content: string) {
updateTag("meta", "property", property, "content", content);
}

export function updateLink(rel, href) {
export function updateLink(rel: string, href: string) {
updateTag("link", "rel", rel, "href", href);
}
2 changes: 1 addition & 1 deletion src/actions/decisions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ThunkAction } from "@reduxjs/toolkit";
import { processResponse, credentials, jsonHeaders } from "../core/ApiClient";
import { Action, Decision, State } from "../interfaces";

export function invalidateDecisions() {
export function invalidateDecisions(): Action {
return { type: "INVALIDATE_DECISIONS" };
}

Expand Down
Loading