From 2f139964b567cdb5c5d203b90a7677a1c07dff0b Mon Sep 17 00:00:00 2001 From: Sarah Date: Thu, 12 Oct 2023 15:41:49 +0200 Subject: [PATCH] 2026: add missing types and improve typescript setup --- .circleci/config.yml | 2 +- .circleci/src/jobs/check.yml | 2 +- .pnp.cjs | 6 +++++- api-client/package.json | 7 ++++--- e2e-tests/native/capabilities.ts | 2 +- native/tsconfig.json | 1 + native/yarn.lock | 2 +- package.json | 2 +- tsconfig.json | 11 ++++++++++- web/package.json | 1 + yarn.lock | 6 ++++-- 11 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 064ea281d9..862b27697b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -477,7 +477,7 @@ jobs: command: yarn workspace web stylelint name: Stylelint - run: - command: yarn workspaces foreach run tsc --build + command: yarn workspaces foreach --verbose run tsc --build name: TS check - run: command: yarn tsc --build diff --git a/.circleci/src/jobs/check.yml b/.circleci/src/jobs/check.yml index 560b0d32b6..df27a371bf 100644 --- a/.circleci/src/jobs/check.yml +++ b/.circleci/src/jobs/check.yml @@ -23,7 +23,7 @@ steps: command: yarn workspace web stylelint - run: name: TS check - command: yarn workspaces foreach run tsc --build + command: yarn workspaces foreach --verbose run tsc --build - run: name: TS check native command: yarn tsc --build diff --git a/.pnp.cjs b/.pnp.cjs index 598bce90b3..70dbc12e6b 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -5015,6 +5015,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["@types/md5", "npm:2.3.3"],\ ["@types/normalize-path", "npm:3.0.0"],\ ["@types/react", "npm:18.2.23"],\ + ["@types/rrule", null],\ ["@types/seedrandom", "npm:3.0.6"],\ ["@types/uuid", "npm:9.0.4"],\ ["entities", "npm:4.5.0"],\ @@ -5034,8 +5035,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { "packagePeers": [\ "@types/luxon",\ "@types/react",\ + "@types/rrule",\ "luxon",\ - "react"\ + "react",\ + "rrule"\ ],\ "linkType": "SOFT"\ }],\ @@ -19545,6 +19548,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) { ["react-refresh-typescript", "virtual:42b1ed7d3a3ef35c42ac579b760bc4a57b4d9efe82aa857be421d347a9d5eb77b93f1eefdf7c38f1138ec18d742a002770af95542f0d242dcc89856cb39b7f23#npm:2.0.9"],\ ["react-router-dom", "virtual:42b1ed7d3a3ef35c42ac579b760bc4a57b4d9efe82aa857be421d347a9d5eb77b93f1eefdf7c38f1138ec18d742a002770af95542f0d242dcc89856cb39b7f23#npm:6.16.0"],\ ["react-spring-bottom-sheet", "virtual:42b1ed7d3a3ef35c42ac579b760bc4a57b4d9efe82aa857be421d347a9d5eb77b93f1eefdf7c38f1138ec18d742a002770af95542f0d242dcc89856cb39b7f23#npm:3.4.1"],\ + ["rrule", "npm:2.7.2"],\ ["schema-dts", "virtual:42b1ed7d3a3ef35c42ac579b760bc4a57b4d9efe82aa857be421d347a9d5eb77b93f1eefdf7c38f1138ec18d742a002770af95542f0d242dcc89856cb39b7f23#npm:1.1.2"],\ ["style-loader", "virtual:42b1ed7d3a3ef35c42ac579b760bc4a57b4d9efe82aa857be421d347a9d5eb77b93f1eefdf7c38f1138ec18d742a002770af95542f0d242dcc89856cb39b7f23#npm:3.3.3"],\ ["styled-components", "virtual:42b1ed7d3a3ef35c42ac579b760bc4a57b4d9efe82aa857be421d347a9d5eb77b93f1eefdf7c38f1138ec18d742a002770af95542f0d242dcc89856cb39b7f23#npm:5.3.11"],\ diff --git a/api-client/package.json b/api-client/package.json index 50ae305233..f361d3b1d2 100644 --- a/api-client/package.json +++ b/api-client/package.json @@ -8,7 +8,8 @@ "peerDependencies": { "@types/luxon": "3", "luxon": ">=3.4", - "react": "^18.2" + "react": "^18.2", + "rrule": "2" }, "dependencies": { "@turf/distance": "^6.5.0", @@ -17,7 +18,6 @@ "lodash": "^4.17.21", "normalize-path": "^3.0.0", "normalize-strings": "^1.1.1", - "rrule": "2.7.2", "seedrandom": "^3.0.5", "uuid": "^9.0.0" }, @@ -36,6 +36,7 @@ "jest-mock": "^29.7.0", "luxon": "^3.4.2", "md5": "^2.3.0", - "react": "^18.2.0" + "react": "^18.2.0", + "rrule": "^2.7.2" } } diff --git a/e2e-tests/native/capabilities.ts b/e2e-tests/native/capabilities.ts index 48b51be8cd..579bb94299 100644 --- a/e2e-tests/native/capabilities.ts +++ b/e2e-tests/native/capabilities.ts @@ -3,7 +3,7 @@ import { Capabilities } from '@wdio/types' import { getGitBranch, getGitHeadReference } from '../shared/git' const browserstackCaps = ( - config: Capabilities.AppiumW3CCapabilities | Capabilities.AppiumXCUITestCapabilities, + config: Capabilities.AppiumCapabilities | Capabilities.AppiumXCUITestCapabilities, platformName: 'ios' | 'android', ): Capabilities.Capabilities => { // is set by circleci https://github.com/circleci/circleci-docs/blob/master/jekyll/_cci1/environment-variables.md diff --git a/native/tsconfig.json b/native/tsconfig.json index 7ee4cb473c..a34d8c0ff3 100644 --- a/native/tsconfig.json +++ b/native/tsconfig.json @@ -10,6 +10,7 @@ "module": "es2020", "outDir": "dist", "paths": { + "react-native": ["./node_modules/@types/react-native"], "normalize-strings": ["../api-client/src/@types/normalize-strings"], "@dr.pogodin/react-native-static-server": ["src/@types/react-native-static-server"], "@react-native-async-storage/async-storage/jest/async-storage-mock": ["src/@types/untyped"] diff --git a/native/yarn.lock b/native/yarn.lock index c0e62ee7fe..225ffc0423 100644 --- a/native/yarn.lock +++ b/native/yarn.lock @@ -3947,13 +3947,13 @@ __metadata: lodash: ^4.17.21 normalize-path: ^3.0.0 normalize-strings: ^1.1.1 - rrule: 2.7.2 seedrandom: ^3.0.5 uuid: ^9.0.0 peerDependencies: "@types/luxon": 3 luxon: ">=3.4" react: ^18.2 + rrule: 2 languageName: node linkType: soft diff --git a/package.json b/package.json index d0d3b25849..0212234c12 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "circleci:update-config": "cd $PROJECT_CWD && { cat .circleci/autogenerated_header.yml; circleci config pack .circleci/src; } > .circleci/config.yml && circleci config validate", "prettier:check": "cd $PROJECT_CWD && prettier --ignore-path .prettierignore --check $PWD", "prettier:write": "cd $PROJECT_CWD && prettier --ignore-path .prettierignore --write $PWD", - "ts:check": "cd $INIT_CWD && yarn run -T tsc --build", + "ts:check": "tsc --build", ":native": "cd $PROJECT_CWD/native && yarn", "postinstall": "husky install" }, diff --git a/tsconfig.json b/tsconfig.json index 8648823ab5..1900441ca3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,5 +13,14 @@ "target": "ESNext", "useDefineForClassFields": false }, - "include": ["jest.config.ts", ".prettierrc.js", ".eslintrc.js"] + "include": ["jest.config.ts", ".prettierrc.js", ".eslintrc.js"], + "references": [ + { "path": "api-client" }, + { "path": "build-configs"}, + { "path": "e2e-tests"}, + { "path": "native"}, + { "path": "tools"}, + { "path": "translations"}, + { "path": "web"} + ] } diff --git a/web/package.json b/web/package.json index de41093a11..e216cd549c 100644 --- a/web/package.json +++ b/web/package.json @@ -50,6 +50,7 @@ "react-map-gl": "^7.1.5", "react-router-dom": "^6.15.0", "react-spring-bottom-sheet": "^3.4.1", + "rrule": "^2.7.2", "schema-dts": "^1.1.2", "styled-components": "^5.3.11", "translations": "workspace:*", diff --git a/yarn.lock b/yarn.lock index 6e6d31c931..60f8b0c428 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3732,13 +3732,14 @@ __metadata: normalize-path: ^3.0.0 normalize-strings: ^1.1.1 react: ^18.2.0 - rrule: 2.7.2 + rrule: ^2.7.2 seedrandom: ^3.0.5 uuid: ^9.0.0 peerDependencies: "@types/luxon": 3 luxon: ">=3.4" react: ^18.2 + rrule: 2 languageName: unknown linkType: soft @@ -13528,7 +13529,7 @@ __metadata: languageName: node linkType: hard -"rrule@npm:2.7.2": +"rrule@npm:^2.7.2": version: 2.7.2 resolution: "rrule@npm:2.7.2" dependencies: @@ -15812,6 +15813,7 @@ __metadata: react-refresh-typescript: ^2.0.9 react-router-dom: ^6.15.0 react-spring-bottom-sheet: ^3.4.1 + rrule: ^2.7.2 schema-dts: ^1.1.2 style-loader: ^3.3.3 styled-components: ^5.3.11