From 30a5c6da060bfb3f74b537f33028e2f2e3d8428d Mon Sep 17 00:00:00 2001 From: paribaker <58012003+paribaker@users.noreply.github.com> Date: Thu, 3 Aug 2023 06:08:40 +0000 Subject: [PATCH] small fixes --- .../clients/mobile/react-native/package.json | 16 ++++++++-------- .../clients/mobile/react-native/yarn.lock | 2 +- .../clients/web/react/.env.example | 2 +- .../clients/web/react/package.json | 2 +- .../clients/web/react/src/services/base-model.ts | 4 ++-- .../web/react/src/services/user/models.ts | 8 ++++---- .../clients/web/vue3/package.json | 2 +- .../clients/web/vue3/src/services/base-model.js | 4 ++-- .../web/vue3/src/services/users/models.js | 6 ++++-- 9 files changed, 24 insertions(+), 22 deletions(-) diff --git a/{{cookiecutter.project_slug}}/clients/mobile/react-native/package.json b/{{cookiecutter.project_slug}}/clients/mobile/react-native/package.json index ad0f21dd2..8b414444a 100644 --- a/{{cookiecutter.project_slug}}/clients/mobile/react-native/package.json +++ b/{{cookiecutter.project_slug}}/clients/mobile/react-native/package.json @@ -6,15 +6,15 @@ "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "yarn run start:nc --clear", - "start:nc": "source .env npx expo start", - "start:prod": "source .env npx expo start --no-dev --minify", - "start:android": "source .env npx expo start --android", - "start:ios": "source .env npx expo start --ios", - "start:web": "source .env npx expo start --web", + "start:nc": "source .env && npx expo start", + "start:prod": "source .env && npx expo start --no-dev --minify", + "start:android": "source .env && npx expo start --android", + "start:ios": "source .env && npx expo start --ios", + "start:web": "source .env && npx expo start --web", "prebuild": "npx expo prebuild", - "run:android": "source .env npx expo run:android --clear", + "run:android": "source .env && npx expo run:android --clear", "run:android:release": "npx expo run:android --variant release", - "run:ios": "source .env npx expo run:ios --clear", + "run:ios": "source .env && npx expo run:ios --clear", "run:ios:release": "npx expo run:ios --configuration Release", "pub:web": "npx expo export:web && cd web-build && vercel --prod && cd ..", "format": "prettier --check ./src", @@ -35,7 +35,7 @@ "@tanstack/react-query": "^4.24.4", "@thinknimble/tn-forms": "^3.1.3", "@thinknimble/tn-forms-react": "^1.0.3", - "@thinknimble/tn-models-fp": "2.5.3", + "@thinknimble/tn-models-fp": "^2.13.0", "axios": "^1.3.2", "date-fns": "^2.29.3", "expo": "^48.0.9", diff --git a/{{cookiecutter.project_slug}}/clients/mobile/react-native/yarn.lock b/{{cookiecutter.project_slug}}/clients/mobile/react-native/yarn.lock index 20bd6f823..7737445fe 100644 --- a/{{cookiecutter.project_slug}}/clients/mobile/react-native/yarn.lock +++ b/{{cookiecutter.project_slug}}/clients/mobile/react-native/yarn.lock @@ -3272,7 +3272,7 @@ "@thinknimble/tn-models-fp@2.5.3": version "2.5.3" - resolved "https://registry.yarnpkg.com/@thinknimble/tn-models-fp/-/tn-models-fp-2.5.3.tgz#a95aa0346e3166ef26b2e26210138f6e93c95625" + resolved "https://registry.yarnpkg.com/@thinknimble/tn-models-fp/-/ac-2.5.3.tgz#a95aa0346e3166ef26b2e26210138f6e93c95625" integrity sha512-KkaJFGck4XGx9XOEqU7V7JPgG/ciZJ7T5EAyA51Ee29JnMBbiXdkusAEuBIsd/tZpg02Hh5CuajFS9Q2we/Rzg== dependencies: "@thinknimble/tn-utils" "^2.0.1" diff --git a/{{cookiecutter.project_slug}}/clients/web/react/.env.example b/{{cookiecutter.project_slug}}/clients/web/react/.env.example index 8f8f3b9fe..e6554c34d 100644 --- a/{{cookiecutter.project_slug}}/clients/web/react/.env.example +++ b/{{cookiecutter.project_slug}}/clients/web/react/.env.example @@ -1,3 +1,3 @@ # Only used on development. Add your backend URL to which you want to proxy your requests. Check proxy config in vite.config.js for more information -VITE_DEV_BACKEND_URL="http://localhost:8080" +VITE_DEV_BACKEND_URL="http://localhost:8000" diff --git a/{{cookiecutter.project_slug}}/clients/web/react/package.json b/{{cookiecutter.project_slug}}/clients/web/react/package.json index c9d07ee6d..7cd476eab 100644 --- a/{{cookiecutter.project_slug}}/clients/web/react/package.json +++ b/{{cookiecutter.project_slug}}/clients/web/react/package.json @@ -6,7 +6,7 @@ {% if cookiecutter.use_graphql == 'n' -%} "@tanstack/react-query": "^4.24.2", "axios": "^1.2.6", - "@thinknimble/tn-models-fp": "^2.11.4", + "@thinknimble/tn-models-fp": "^2.13.0", {% else -%} "@apollo/client": "^3.4.17", "graphql": "^16.0.1", diff --git a/{{cookiecutter.project_slug}}/clients/web/react/src/services/base-model.ts b/{{cookiecutter.project_slug}}/clients/web/react/src/services/base-model.ts index 96cec346b..1d3c45b65 100644 --- a/{{cookiecutter.project_slug}}/clients/web/react/src/services/base-model.ts +++ b/{{cookiecutter.project_slug}}/clients/web/react/src/services/base-model.ts @@ -1,8 +1,8 @@ import { z } from 'zod' -import {readonly} from '@thinkimble/tn-models-fp' + export const baseModelShape = { - id: readonly(z.string().uuid().optional()), + id: z.string().uuid(), datetimeCreated: readonly(z.string().datetime().optional()), lastEdited: readonly(z.string().datetime().optional()), } diff --git a/{{cookiecutter.project_slug}}/clients/web/react/src/services/user/models.ts b/{{cookiecutter.project_slug}}/clients/web/react/src/services/user/models.ts index 71006d44e..1fac1eb00 100644 --- a/{{cookiecutter.project_slug}}/clients/web/react/src/services/user/models.ts +++ b/{{cookiecutter.project_slug}}/clients/web/react/src/services/user/models.ts @@ -15,15 +15,15 @@ export const userShape = { email: z.string().email(), firstName: z.string(), lastName: z.string(), - token: readonly(z.string().nullable().optional()), + token: readonly(z.string().nullable()), } -export type UserShape = GetInferredFromRaw export const userCreateShape = { - ...userShape, + email: userShape.email, + firstName: userShape.firstName, + lastName:userShape.lastName, password: z.string(), } - export const forgotPasswordShape = { email: z.string().email(), } diff --git a/{{cookiecutter.project_slug}}/clients/web/vue3/package.json b/{{cookiecutter.project_slug}}/clients/web/vue3/package.json index 32254e9aa..f907cc927 100644 --- a/{{cookiecutter.project_slug}}/clients/web/vue3/package.json +++ b/{{cookiecutter.project_slug}}/clients/web/vue3/package.json @@ -18,7 +18,7 @@ "@thinknimble/tn-forms": "^2.0.9", "@thinknimble/tn-models": "1.2.1", "@thinknimble/tn-utils": "1.6.0", - "@thinknimble/tn-models-fp": "^2.12.1", + "@thinknimble/tn-models-fp": "^2.13.0", "autoprefixer": "^10.0.2", "axios": "^1.4.0", "core-js": "^3.6.5", diff --git a/{{cookiecutter.project_slug}}/clients/web/vue3/src/services/base-model.js b/{{cookiecutter.project_slug}}/clients/web/vue3/src/services/base-model.js index 32e3913ad..11625667f 100644 --- a/{{cookiecutter.project_slug}}/clients/web/vue3/src/services/base-model.js +++ b/{{cookiecutter.project_slug}}/clients/web/vue3/src/services/base-model.js @@ -1,8 +1,8 @@ import { z } from 'zod' -import {readonly} from '@thinknimble/tn-models-fp' + export const baseModelShape = { - id: readonly(z.string().uuid().optional()), + id: z.string().uuid(), datetimeCreated: readonly(z.string().datetime().optional()), lastEdited: readonly(z.string().datetime().optional()), } \ No newline at end of file diff --git a/{{cookiecutter.project_slug}}/clients/web/vue3/src/services/users/models.js b/{{cookiecutter.project_slug}}/clients/web/vue3/src/services/users/models.js index 843f653b2..62eddeb54 100644 --- a/{{cookiecutter.project_slug}}/clients/web/vue3/src/services/users/models.js +++ b/{{cookiecutter.project_slug}}/clients/web/vue3/src/services/users/models.js @@ -7,11 +7,13 @@ export const userShape = { email: z.string().email(), firstName: z.string(), lastName: z.string(), - token: readonly(z.string().nullable().optional()), + token: readonly(z.string().nullable()), } export const userCreateShape = { - ...userShape, + email: userShape.email, + firstName: userShape.firstName, + lastName:userShape.lastName, password: z.string(), }