Skip to content

Commit

Permalink
feat: bumping mikro-orm version, fixing hidden properties
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerKaiser committed Dec 12, 2023
1 parent 5168aea commit bcd9db9
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 49 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ In order to modify the content of the homepage and to make other modifications t
yarn workspace @hangar/api add @mikro-orm/core@^6.0 @mikro-orm/knex@^6.0 @mikro-orm/postgresql@^6.0 mikro-orm@^6.0

# DB
yarn workspace @hangar/database add @mikro-orm/cli@^6.0 @mikro-orm/core@^6.0 @mikro-orm/knex@^6.0 @mikro-orm/migrations@^6.0 @mikro-orm/postgresql@^6.0 @mikro-orm/seeder@^6.0 mikro-orm@^6.0
yarn workspace @hangar/database add @mikro-orm/cli@^6.0 @mikro-orm/core@^6.0 @mikro-orm/knex@^6.0 @mikro-orm/migrations@^6.0 @mikro-orm/postgresql@^6.0 @mikro-orm/seeder@^6.0 @mikro-orm/postgresql@^6.0 mikro-orm@^6.0
```

#### Restoring a Production DB locally
Expand Down
6 changes: 3 additions & 3 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"@hangar/database": "*",
"@hangar/shared": "*",
"@hangar/web": "*",
"@mikro-orm/core": "^6.0.0-rc.0",
"@mikro-orm/knex": "^6.0.0-rc.0",
"@mikro-orm/postgresql": "^6.0.0-rc.0",
"@mikro-orm/core": "^6.0.0-rc.2",
"@mikro-orm/knex": "^6.0.0-rc.2",
"@mikro-orm/postgresql": "^6.0.0-rc.2",
"@slack/bolt": "^3.11.0",
"@slack/web-api": "^6.6.0",
"axios": "^1.5.0",
Expand Down
14 changes: 7 additions & 7 deletions packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"dependencies": {
"@americanairlines/simple-env": "^1.0.4",
"@faker-js/faker": "^7.6.0",
"@mikro-orm/cli": "^6.0.0-rc.0",
"@mikro-orm/core": "^6.0.0-rc.0",
"@mikro-orm/knex": "^6.0.0-rc.0",
"@mikro-orm/migrations": "^6.0.0-rc.0",
"@mikro-orm/postgresql": "^6.0.0-rc.0",
"@mikro-orm/seeder": "^6.0.0-rc.0",
"@mikro-orm/cli": "^6.0.0-rc.2",
"@mikro-orm/core": "^6.0.0-rc.2",
"@mikro-orm/knex": "^6.0.0-rc.2",
"@mikro-orm/migrations": "^6.0.0-rc.2",
"@mikro-orm/postgresql": "^6.0.0-rc.2",
"@mikro-orm/seeder": "^6.0.0-rc.2",
"@mikro-orm/sql-highlighter": "^1.0.1",
"dayjs": "^1.11.9",
"dotenv-flow": "^3.2.0",
"mikro-orm": "^6.0.0-rc.0",
"mikro-orm": "^6.0.0-rc.2",
"readline-sync": "^1.4.10",
"seedrandom": "^3.0.5",
"uuid": "^9.0.0"
Expand Down
14 changes: 12 additions & 2 deletions packages/database/src/entities/Project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
/* istanbul ignore file */
import { Entity, Property, OneToMany, Collection, EntityDTO, raw } from '@mikro-orm/core';
import {
Entity,
Property,
OneToMany,
Collection,
EntityDTO,
raw,
HiddenProps,
} from '@mikro-orm/core';
import { EntityManager } from '@mikro-orm/postgresql';
import { v4 } from 'uuid';
import { ConstructorValues } from '../types/ConstructorValues';
Expand All @@ -23,7 +31,9 @@ type UpdateActiveJudgeCountArgs = ActiveJudgeCountModifierArgs & {

@Entity()
export class Project extends Node<Project> {
@Property({ columnType: 'text', unique: true })
[HiddenProps]?: 'inviteCode' | 'activeJudgeCount';

@Property({ columnType: 'text', unique: true, hidden: true })
inviteCode: string = v4();

@Property({ columnType: 'text' })
Expand Down
4 changes: 3 additions & 1 deletion packages/database/src/entities/User.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* istanbul ignore file */
import { Entity, Property, ManyToOne, Ref, EntityDTO } from '@mikro-orm/core';
import { Entity, Property, ManyToOne, Ref, EntityDTO, HiddenProps } from '@mikro-orm/core';
import { ConstructorValues } from '../types/ConstructorValues';
import { Project } from './Project';
import { Node } from './Node';
Expand All @@ -10,6 +10,8 @@ export type UserConstructorValues = ConstructorValues<User>;

@Entity()
export class User extends Node<User> {
[HiddenProps]?: 'email';

@Property({ columnType: 'text' })
firstName: string;

Expand Down
75 changes: 40 additions & 35 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2638,61 +2638,61 @@
npmlog "^6.0.2"
write-file-atomic "^4.0.1"

"@mikro-orm/cli@^6.0.0-rc.0":
version "6.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@mikro-orm/cli/-/cli-6.0.0-rc.0.tgz#1a87c20dc57a245641a6f21724dba53e50c9f993"
integrity sha512-GYnS+1+jGzCr9mPqT1UEPD3Z9YCCPermMe/0d2VY3PQ/NONZvdwlMTy/MoCHwWI0sf16bgLjnjm+gv1d9Bwk0w==
"@mikro-orm/cli@^6.0.0-rc.2":
version "6.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@mikro-orm/cli/-/cli-6.0.0-rc.2.tgz#a2bcf64c91f2dbda3d647838386b8f06073831f5"
integrity sha512-h6WebP/z3LNu9aGhjZrMAaUygfuHtspYJtbNhn7wJdYjSVapZV8hlShXYa+/jdxFy0CnwZuXSgp8YXFBb5LHmA==
dependencies:
"@jercle/yargonaut" "1.1.5"
"@mikro-orm/core" "6.0.0-rc.0"
"@mikro-orm/knex" "6.0.0-rc.0"
"@mikro-orm/core" "6.0.0-rc.2"
"@mikro-orm/knex" "6.0.0-rc.2"
fs-extra "11.1.1"
tsconfig-paths "4.2.0"
yargs "17.7.2"

"@mikro-orm/core@6.0.0-rc.0", "@mikro-orm/core@^6.0.0-rc.0":
version "6.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@mikro-orm/core/-/core-6.0.0-rc.0.tgz#7760433ac11de458ea31902bd9fffba8e92e09c9"
integrity sha512-CsWsPKPAt+zUvbPkxPG8Ehna9QtSW4yVa8Axg19W5+9fD8TFOZl2VKDrWOIXMPyhuLt/Us/Mn2PrdSooxi+wIw==
"@mikro-orm/core@6.0.0-rc.2", "@mikro-orm/core@^6.0.0-rc.2":
version "6.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@mikro-orm/core/-/core-6.0.0-rc.2.tgz#566a654f9d764aee65ca84a4ce4495fec84da437"
integrity sha512-1CXPbEi2rJvBIY0m9DI6CWikf+xxJgbZcQ1QNyd6eFF0A44FU8KefIBx/1gIAs+CkUqvmC7QueSNGAG221m2oA==
dependencies:
dataloader "2.2.2"
dotenv "16.3.1"
esprima "4.0.1"
fs-extra "11.1.1"
globby "11.1.0"
mikro-orm "6.0.0-rc.0"
mikro-orm "6.0.0-rc.2"
reflect-metadata "0.1.13"

"@mikro-orm/knex@6.0.0-rc.0", "@mikro-orm/knex@^6.0.0-rc.0":
version "6.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@mikro-orm/knex/-/knex-6.0.0-rc.0.tgz#b3e2b390c7308ddb4b3de3735fc0bea042269784"
integrity sha512-0uxe8BjsEt1wnpt6yqiALZGGKA1suVJ1OHaI06LSTb5bJyq9yIdKI0aRhRazGt1mPoxEv5umf2dPFChvVENoxw==
"@mikro-orm/knex@6.0.0-rc.2", "@mikro-orm/knex@^6.0.0-rc.2":
version "6.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@mikro-orm/knex/-/knex-6.0.0-rc.2.tgz#e6367fcdc91fb188de20db09634afa1cd67b609b"
integrity sha512-PhPEIWl0EcUsjAkXpEv4dQwftgpyn5nrbrdOWnrvBY7oUMs3B/eSLGSqcDqlzVlLyprsPswlI2vWm6Uf8q5ZkQ==
dependencies:
fs-extra "11.1.1"
knex "3.0.1"
sqlstring "2.3.3"

"@mikro-orm/migrations@^6.0.0-rc.0":
version "6.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@mikro-orm/migrations/-/migrations-6.0.0-rc.0.tgz#92cac100fed74e59e1599aa5ba1fd81f2ac1d1ee"
integrity sha512-ey4HqfsWCnlt7NCxPaSmjgr5oNuUkF0vqkZiN4N3hPdJREgZH7xXLAC1wCfu+kEbz4fBXTVmzBdlTNQ6hVUDXQ==
"@mikro-orm/migrations@^6.0.0-rc.2":
version "6.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@mikro-orm/migrations/-/migrations-6.0.0-rc.2.tgz#07e98737b39642b31e350ce8b25f889c6cefbf41"
integrity sha512-ilTWlVc5FJMMaoKUPaqgE0Ltc4pxvZB5r6oH1DEIXZcfPgZsdNMOFN88xrOlHl35G75mMOIfq6Dv34W/e0mM1Q==
dependencies:
"@mikro-orm/knex" "6.0.0-rc.0"
"@mikro-orm/knex" "6.0.0-rc.2"
fs-extra "11.1.1"
umzug "3.3.1"
umzug "3.4.0"

"@mikro-orm/postgresql@^6.0.0-rc.0":
version "6.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@mikro-orm/postgresql/-/postgresql-6.0.0-rc.0.tgz#d089f6d37015bc90ada50721174693c69352f362"
integrity sha512-lPsspzRmDbx//qk/HI9WKTRVd8bOuWKq2NnKl/qAS/r9qkXIGw5MlrTjDQxgmXV0UpDkafqnFV/IHrIDYzRfJQ==
"@mikro-orm/postgresql@^6.0.0-rc.2":
version "6.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@mikro-orm/postgresql/-/postgresql-6.0.0-rc.2.tgz#e55931c7bface79cb6ae4f168626ae9495ac440e"
integrity sha512-oEefUJhPKrwC6o4d7sIJLJuA9uWh24n7Sv+DjPeBfygogbl3qqsW4RdO9LO2ePDHCHkXfp223aKpKiyYXA0gNg==
dependencies:
"@mikro-orm/knex" "6.0.0-rc.0"
"@mikro-orm/knex" "6.0.0-rc.2"
pg "8.11.3"

"@mikro-orm/seeder@^6.0.0-rc.0":
version "6.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@mikro-orm/seeder/-/seeder-6.0.0-rc.0.tgz#4303f06f1107486ac40d49bc183e42001bab58cd"
integrity sha512-hqQ8ZqkGZdMdb5FAUfZDcc5S1v0ttjMZk36jLX1DDUO3faDeqBFIkZrt9Z1Z15cDCP33J4L3QY5jCJ1XCO8NFQ==
"@mikro-orm/seeder@^6.0.0-rc.2":
version "6.0.0-rc.2"
resolved "https://registry.yarnpkg.com/@mikro-orm/seeder/-/seeder-6.0.0-rc.2.tgz#f10e66abb7cc7aa9687ec33382520b248203e8e6"
integrity sha512-gvIB1CRkufAeBDIyOt95CWqNehQthWn/eeUN9DY4TZhoAtBgyM+jQvcu5Dujq0gIlGo8s29Tmwdw/MRPIRU9tQ==
dependencies:
fs-extra "11.1.1"
globby "11.1.0"
Expand Down Expand Up @@ -8414,7 +8414,12 @@ micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5:
braces "^3.0.2"
picomatch "^2.3.1"

mikro-orm@6.0.0-rc.0, mikro-orm@^6.0.0-rc.0:
mikro-orm@6.0.0-rc.2, mikro-orm@^6.0.0-rc.2:
version "6.0.0-rc.2"
resolved "https://registry.yarnpkg.com/mikro-orm/-/mikro-orm-6.0.0-rc.2.tgz#ffdac45c22c2ce0ef400b10c54ae5a3626d50b19"
integrity sha512-R2cH5uozUtIcXKRQbWFyMXNcNLn5K4H7UiaZGEl61Z7g1OCy9N/Mnt3VlsWS+CrRPHF6SGR9z+jPXa3d+rImJQ==

mikro-orm@^6.0.0-rc.0:
version "6.0.0-rc.0"
resolved "https://registry.yarnpkg.com/mikro-orm/-/mikro-orm-6.0.0-rc.0.tgz#a574119ee57a66ae05249ead329ca0fb114bf216"
integrity sha512-Ru4uTaStr3xSfWvPPXPEJNr7nviwPHh0ed/El2P/+xpma0qDBueAGkuK7CDjWyS3sIAxM3PrXjUCEE5fnLtNcg==
Expand Down Expand Up @@ -11135,10 +11140,10 @@ uglify-js@^3.1.4:
resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz"
integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==

umzug@3.3.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/umzug/-/umzug-3.3.1.tgz#4ed726e7ec216049d826623a9c4faf66d412eb61"
integrity sha512-jG3C35jti1YnCuH/k3fJEfHbnIG9c3Q9ITZ0B9eWwnXngh/AUd0mRHv8OdpE2Q9VoK7tB6xL990JrMCr0LtfNA==
umzug@3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/umzug/-/umzug-3.4.0.tgz#97819a2d2288c8ce2c156c3be8b18b02f2208423"
integrity sha512-bTen9ElCBoWU1mhcaXqVZWXxB1PojsBQBs/4vW0YV8f5CfhuhkfRjQZj6SCb6IuHWPkccDzF+T+RGZCYUiXaKg==
dependencies:
"@rushstack/ts-command-line" "^4.12.2"
emittery "^0.13.0"
Expand Down

0 comments on commit bcd9db9

Please sign in to comment.