Skip to content

Commit

Permalink
fix: switch class validator (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajwootto authored Jan 31, 2024
1 parent 235f7a0 commit a6d011f
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 83 deletions.
86 changes: 47 additions & 39 deletions e2e/nextjs/app-router/app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,78 +15,68 @@ __metadata:
linkType: hard

"@devcycle/bucketing@file:../../../../dist/lib/shared/bucketing::locator=app%40workspace%3A.":
version: 1.7.7
resolution: "@devcycle/bucketing@file:../../../../dist/lib/shared/bucketing#../../../../dist/lib/shared/bucketing::hash=4bb41b&locator=app%40workspace%3A."
version: 1.11.0
resolution: "@devcycle/bucketing@file:../../../../dist/lib/shared/bucketing#../../../../dist/lib/shared/bucketing::hash=e8e31c&locator=app%40workspace%3A."
dependencies:
"@devcycle/types": "npm:^1.4.6"
"@devcycle/types": "npm:^1.8.0"
lodash: "npm:^4.17.21"
murmurhash: "npm:^2.0.0"
ua-parser-js: "npm:^1.0.36"
checksum: 754e0fd14f31b3dc1801d667c4a60c445ecd428372ccab843457a20583029612d595a59e6cc740fec1f6d04c356677eeed7d8eca9d8f1ddc8b992b0a57b997f6
checksum: ada816a5bca81b386b95c5bf88d2349862a862c6964f4589a93b8df4b819f88a941409a51cdd0ad10aed300cabb6beda88c228c9fe76583cf6bb82eccaf2751a
languageName: node
linkType: hard

"@devcycle/js-client-sdk@file:../../../../dist/sdk/js::locator=app%40workspace%3A.":
version: 1.16.6
resolution: "@devcycle/js-client-sdk@file:../../../../dist/sdk/js#../../../../dist/sdk/js::hash=43a538&locator=app%40workspace%3A."
version: 1.20.0
resolution: "@devcycle/js-client-sdk@file:../../../../dist/sdk/js#../../../../dist/sdk/js::hash=0a85f4&locator=app%40workspace%3A."
dependencies:
"@devcycle/types": "npm:^1.4.6"
"@devcycle/types": "npm:^1.8.0"
axios: "npm:^1.0.0"
axios-retry: "npm:^3.3.1"
lodash: "npm:^4.17.21"
ua-parser-js: "npm:^1.0.36"
uuid: "npm:^8.3.2"
checksum: b7fcfa181dcacefd0da6cc57c909f5f9bf1f3c0de06a591282af0d1c1cbedee6d13ad51b9e7451eff40d73b95e6eb094e3e62ff2f610acc5105a9df5effee297
checksum: ec32dcb52f628b46da4d3cb398281c95724a745e2abaaf78a3d622124626ab954b0fc2d5d595ef783530733d8c626126740c5abf4b955dad318a6ae2fbc8d98a
languageName: node
linkType: hard

"@devcycle/nextjs-sdk@file:../../../../dist/sdk/nextjs::locator=app%40workspace%3A.":
version: 1.0.0
resolution: "@devcycle/nextjs-sdk@file:../../../../dist/sdk/nextjs#../../../../dist/sdk/nextjs::hash=8e3789&locator=app%40workspace%3A."
version: 1.4.0
resolution: "@devcycle/nextjs-sdk@file:../../../../dist/sdk/nextjs#../../../../dist/sdk/nextjs::hash=2d9f58&locator=app%40workspace%3A."
dependencies:
"@devcycle/bucketing": "npm:^1.7.7"
"@devcycle/js-client-sdk": "npm:^1.16.6"
"@devcycle/react-client-sdk": "npm:^1.14.6"
"@devcycle/types": "npm:^1.4.6"
"@devcycle/bucketing": "npm:^1.11.0"
"@devcycle/js-client-sdk": "npm:^1.20.0"
"@devcycle/react-client-sdk": "npm:^1.18.0"
"@devcycle/types": "npm:^1.8.0"
hoist-non-react-statics: "npm:^3.3.2"
server-only: "npm:^0.0.1"
checksum: cb51ef310f1fdf42be3ca85a5e030589064c41b2f7a12ace8d6c959f6ead4bf44abd793cf7f8041481cf690c4f40111469599ab7835d9d35eb62ff3db745fb49
checksum: 33d91407d69ac41f8c2eeb0e32dafe1d4e199634c32ed7afbcb2b2a925878bcda2e4ea6c60f67c631ec4eb23927785128e4941e014ebf3467366110251e2d275
languageName: node
linkType: hard

"@devcycle/react-client-sdk@file:../../../../dist/sdk/react::locator=app%40workspace%3A.":
version: 1.14.6
resolution: "@devcycle/react-client-sdk@file:../../../../dist/sdk/react#../../../../dist/sdk/react::hash=74c96f&locator=app%40workspace%3A."
version: 1.18.0
resolution: "@devcycle/react-client-sdk@file:../../../../dist/sdk/react#../../../../dist/sdk/react::hash=ea1ee4&locator=app%40workspace%3A."
dependencies:
"@devcycle/js-client-sdk": "npm:^1.16.6"
"@devcycle/types": "npm:^1.4.6"
"@devcycle/js-client-sdk": "npm:^1.20.0"
"@devcycle/types": "npm:^1.8.0"
hoist-non-react-statics: "npm:^3.3.2"
peerDependencies:
react: ">=16.8.0"
checksum: 5a6d1ff022225a8ab7f9571d2060ba4d494afa320544679406e26f7b83d5d96517d4ce01e03b322bfb9860dd85d945be331a69cfbcdb9e69a2e7fadaea9db20e
checksum: b130c0c487ce9f8a2e859603addf4d9c064bd648ae1e95eb69eda18d72a7257dfa7e51a625a6fe13fd4e85770a092968542d4a212bad79a0c385938f0ccbe1d6
languageName: node
linkType: hard

"@devcycle/types@file:../../../../dist/lib/shared/types::locator=app%40workspace%3A.":
version: 1.4.6
resolution: "@devcycle/types@file:../../../../dist/lib/shared/types#../../../../dist/lib/shared/types::hash=9c2d1a&locator=app%40workspace%3A."
version: 1.8.0
resolution: "@devcycle/types@file:../../../../dist/lib/shared/types#../../../../dist/lib/shared/types::hash=6360ed&locator=app%40workspace%3A."
dependencies:
"@nestjs/class-validator": "npm:^0.13.4"
class-transformer: "npm:0.5.1"
class-validator: "npm:0.14.1"
iso-639-1: "npm:^2.1.13"
lodash: "npm:^4.17.21"
reflect-metadata: "npm:^0.1.13"
checksum: b220dc7f0e41efd79a28c531dac99923cd26cac506340499840f0d84d45c61a638243d757de4aa1f033bc6e8591ee9d9b9391dc444b6cc3196dd3904909dece0
languageName: node
linkType: hard

"@nestjs/class-validator@npm:^0.13.4":
version: 0.13.4
resolution: "@nestjs/class-validator@npm:0.13.4"
dependencies:
libphonenumber-js: "npm:^1.9.43"
validator: "npm:^13.7.0"
checksum: 755211eb8153b8efdc845875cafa799b29341afdf3b65df39a613f1b0e6f25cec5b0c479795c2a814841b7d84b921bdbaf1f3aa3f59b0abe08dfe23ab63e68df
checksum: b1a61e6a4cd9ee3425e077bad762e9ec8e1ba8e27e1429315f8265db7406e15b9cbbb1c72923591ff7474f157d5c14ad4e664477c4c4deb06f3021d6c9549195
languageName: node
linkType: hard

Expand Down Expand Up @@ -212,6 +202,13 @@ __metadata:
languageName: node
linkType: hard

"@types/validator@npm:^13.11.8":
version: 13.11.8
resolution: "@types/validator@npm:13.11.8"
checksum: 27cba3b43d79cff40c57703225944efacb9c4954379640a8f1ba29cdae07f36fc1115deed08dada9f6d7ff09f205540d04c435e27999dc1ce78d26fd3d8867a0
languageName: node
linkType: hard

"app@workspace:.":
version: 0.0.0-use.local
resolution: "app@workspace:."
Expand Down Expand Up @@ -278,6 +275,17 @@ __metadata:
languageName: node
linkType: hard

"class-validator@npm:0.14.1":
version: 0.14.1
resolution: "class-validator@npm:0.14.1"
dependencies:
"@types/validator": "npm:^13.11.8"
libphonenumber-js: "npm:^1.10.53"
validator: "npm:^13.9.0"
checksum: 0c34592a1cbdd5e9c35cd02f4babd94120339e875fc7627aa2bf5dffb45ecc373275e854389c6ff3d39781cddb85a18193b4e9e8f4d77d6d90e445fd0b8b8e11
languageName: node
linkType: hard

"client-only@npm:0.0.1":
version: 0.0.1
resolution: "client-only@npm:0.0.1"
Expand Down Expand Up @@ -366,10 +374,10 @@ __metadata:
languageName: node
linkType: hard

"libphonenumber-js@npm:^1.9.43":
version: 1.10.53
resolution: "libphonenumber-js@npm:1.10.53"
checksum: 206a324c064572741ec2a949cddd2d36ada2da0e54889dbf67fe525e17a66cdfffd6deaaff773133bfae9aed4359bb7dd41bfee77cb620abe5c788ff2726db47
"libphonenumber-js@npm:^1.10.53":
version: 1.10.54
resolution: "libphonenumber-js@npm:1.10.54"
checksum: 29b0826d3fe3de6c9ea2c58a5acac5e30220c560486a3e5fc8c8907b42094f7ff50191a60679177828cca7b008ce3d5c97f3f55b03920babf444d7ccadbbdcc8
languageName: node
linkType: hard

Expand Down Expand Up @@ -641,7 +649,7 @@ __metadata:
languageName: node
linkType: hard

"validator@npm:^13.7.0":
"validator@npm:^13.9.0":
version: 13.11.0
resolution: "validator@npm:13.11.0"
checksum: 4bf094641eb71729c06a42d669840e7189597ba655a8264adabac9bf03f95cd6fde5fbc894b0a13ee861bd4a852f56d2afdc9391aeaeb3fc0f9633a974140e12
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-native-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"private": true,
"dependencies": {
"@babel/plugin-proposal-decorators": "*",
"@nestjs/class-validator": "*",
"@react-native-async-storage/async-storage": "*",
"@react-native/metro-config": "0.72.11",
"@testing-library/jest-dom": "*",
Expand All @@ -13,6 +12,7 @@
"axios": "*",
"axios-retry": "*",
"class-transformer": "*",
"class-validator": "*",
"hoist-non-react-statics": "*",
"iso-639-1": "*",
"jest-mock": "*",
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/types/__tests__/clientSDKAPI.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { plainToInstance } from 'class-transformer'
import { DVCAPIUser } from '../src/types/apis/sdk/clientSDKAPI'
import { validate } from '@nestjs/class-validator'
import { validate } from 'class-validator'

const date = new Date()
const testUserData = {
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}
},
"dependencies": {
"@nestjs/class-validator": "^0.13.4",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
"iso-639-1": "^2.1.13",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13"
Expand Down
7 changes: 1 addition & 6 deletions lib/shared/types/src/types/apis/events/eventsAPI.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
IsNotEmpty,
IsNumber,
IsOptional,
IsString,
} from '@nestjs/class-validator'
import { IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator'
import { DVCAPIUser } from '../sdk/clientSDKAPI'
import 'reflect-metadata'

Expand Down
2 changes: 1 addition & 1 deletion lib/shared/types/src/types/apis/sdk/clientSDKAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
IsIn,
IsNotEmpty,
IsISO31661Alpha2,
} from '@nestjs/class-validator'
} from 'class-validator'
import { Transform, Type } from 'class-transformer'
import 'reflect-metadata'
import { IsDVCCustomDataJSONObject } from '../../validators/dvcCustomDataJSON'
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/types/src/types/apis/sdk/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
IsOptional,
IsString,
ValidateNested,
} from '@nestjs/class-validator'
} from 'class-validator'
import { Type } from 'class-transformer'

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/types/src/types/validators/dvcCustomDataJSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import isBoolean from 'lodash/isBoolean'
import isPlainObject from 'lodash/isPlainObject'
import isNull from 'lodash/isNull'
import isUndefined from 'lodash/isUndefined'
import { registerDecorator, ValidationOptions } from '@nestjs/class-validator'
import { registerDecorator, ValidationOptions } from 'class-validator'

/**
* Validates that JSON Object is a valid JSON Object with only
Expand Down
6 changes: 1 addition & 5 deletions lib/shared/types/src/types/validators/isIso6391.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
ValidationOptions,
ValidateBy,
buildMessage,
} from '@nestjs/class-validator'
import { ValidationOptions, ValidateBy, buildMessage } from 'class-validator'
import ISO6391 from 'iso-639-1'

export const IS_ISO6391 = 'isISO6391'
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/types/src/types/validators/isNotBlank.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { registerDecorator, ValidationOptions } from '@nestjs/class-validator'
import { registerDecorator, ValidationOptions } from 'class-validator'

/**
* Validates that string is not filled with spaces
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"affected:e2e": "nx affected --base=origin/main --head=HEAD --target=e2e",
"npm-publish": "nx affected --base=origin/main~1 --target=npm-publish",
"prettier:format": "yarn prettier --write .",
"build": "nx build",
"start": "nx serve",
"lerna:version": "scripts/lerna-version.sh",
"local-registry": "./scripts/local-registry.sh",
Expand All @@ -28,7 +29,6 @@
"dependencies": {
"@altack/nx-bundlefy": "^0.16.0",
"@devcycle/assemblyscript-json": "^2.0.0",
"@nestjs/class-validator": "^0.13.4",
"@openfeature/core": "^0.0.24",
"@openfeature/server-sdk": "^1.10.0",
"@openfeature/web-sdk": "^0.4.11",
Expand All @@ -38,6 +38,7 @@
"axios-retry": "^3.3.1",
"bootstrap": "5.1.3",
"class-transformer": "0.5.1",
"class-validator": "^0.14.1",
"core-js": "^3.6.5",
"cross-fetch": "^3.1.8",
"eslint-plugin-lodash": "^7.4.0",
Expand Down
51 changes: 26 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5275,8 +5275,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@devcycle/types@workspace:lib/shared/types"
dependencies:
"@nestjs/class-validator": ^0.13.4
class-transformer: 0.5.1
class-validator: 0.14.1
iso-639-1: ^2.1.13
lodash: ^4.17.21
reflect-metadata: ^0.1.13
Expand Down Expand Up @@ -7633,16 +7633,6 @@ __metadata:
languageName: node
linkType: hard

"@nestjs/class-validator@npm:*, @nestjs/class-validator@npm:^0.13.4":
version: 0.13.4
resolution: "@nestjs/class-validator@npm:0.13.4"
dependencies:
libphonenumber-js: ^1.9.43
validator: ^13.7.0
checksum: 375f3a699ff4d4c801613df3968e13aad29bbca40955f085327f332a055777a3b048fa048c4b9813ced21fc8b501faa62e9a5cfaecc1bf2fb7d6aba2e0b821cc
languageName: node
linkType: hard

"@next/env@npm:14.0.0":
version: 14.0.0
resolution: "@next/env@npm:14.0.0"
Expand Down Expand Up @@ -11159,6 +11149,13 @@ __metadata:
languageName: node
linkType: hard

"@types/validator@npm:^13.11.8":
version: 13.11.8
resolution: "@types/validator@npm:13.11.8"
checksum: 9e8e8a0e95c3acac60e740d10729076e810350a5975523560c0232bb3c414f381fb7f246405fda3454db694fa5a1c0f00d7e9070023a078abee036b8d7b67770
languageName: node
linkType: hard

"@types/warning@npm:^3.0.0":
version: 3.0.0
resolution: "@types/warning@npm:3.0.0"
Expand Down Expand Up @@ -14009,6 +14006,17 @@ __metadata:
languageName: node
linkType: hard

"class-validator@npm:*, class-validator@npm:0.14.1, class-validator@npm:^0.14.1":
version: 0.14.1
resolution: "class-validator@npm:0.14.1"
dependencies:
"@types/validator": ^13.11.8
libphonenumber-js: ^1.10.53
validator: ^13.9.0
checksum: bea808145c81ba3b185e1174d92f97a2d6ffef0558261217042552e9027222eadb9a9731a4418a07eaaa72ac334347df7a1079ff48eaadaa3ee6848a6a88995c
languageName: node
linkType: hard

"classnames@npm:^2.3.1":
version: 2.3.1
resolution: "classnames@npm:2.3.1"
Expand Down Expand Up @@ -15697,7 +15705,6 @@ __metadata:
"@commitlint/cli": ^16.2.3
"@commitlint/config-conventional": ^18.6.0
"@devcycle/assemblyscript-json": ^2.0.0
"@nestjs/class-validator": ^0.13.4
"@nrwl/js": 16.10.0
"@nrwl/rollup": 16.10.0
"@nx/cypress": 16.10.0
Expand Down Expand Up @@ -15757,6 +15764,7 @@ __metadata:
babel-jest: 29.4.3
bootstrap: 5.1.3
class-transformer: 0.5.1
class-validator: ^0.14.1
core-js: ^3.6.5
cross-env: ^7.0.3
cross-fetch: ^3.1.8
Expand Down Expand Up @@ -17499,7 +17507,6 @@ __metadata:
resolution: "example-react-native-app@workspace:examples/react/react-native-app"
dependencies:
"@babel/plugin-proposal-decorators": "*"
"@nestjs/class-validator": "*"
"@react-native-async-storage/async-storage": "*"
"@react-native/metro-config": 0.72.11
"@testing-library/jest-dom": "*"
Expand All @@ -17508,6 +17515,7 @@ __metadata:
axios: "*"
axios-retry: "*"
class-transformer: "*"
class-validator: "*"
hoist-non-react-statics: "*"
iso-639-1: "*"
jest-mock: "*"
Expand Down Expand Up @@ -22746,10 +22754,10 @@ __metadata:
languageName: node
linkType: hard

"libphonenumber-js@npm:^1.9.43":
version: 1.9.53
resolution: "libphonenumber-js@npm:1.9.53"
checksum: 36eb4078fbfb2c1f43b6af7709c13d41776396fb3358c6dd5d7177105c296bafe9a9afa891b95f77d484e40200b40b09df3acc49a08a96390cf092c426d5a428
"libphonenumber-js@npm:^1.10.53":
version: 1.10.54
resolution: "libphonenumber-js@npm:1.10.54"
checksum: 248483404b6972eb812fce92398c46723debd3e3121b3e5e906c0b2f693dc095c490c566e8b37f6e4d563cd6874ccd41dd5120ca9297b3d232f3a39646f6fce8
languageName: node
linkType: hard

Expand Down Expand Up @@ -32168,7 +32176,7 @@ __metadata:
languageName: node
linkType: hard

"validator@npm:13.11.0":
"validator@npm:13.11.0, validator@npm:^13.9.0":
version: 13.11.0
resolution: "validator@npm:13.11.0"
checksum: d1e0c27022681420756da25bc03eb08d5f0c66fb008f8ff02ebc95812b77c6be6e03d3bd05cf80ca702e23eeb73dadd66b4b3683173ea2a0bc7cc72820bee131
Expand All @@ -32182,13 +32190,6 @@ __metadata:
languageName: node
linkType: hard

"validator@npm:^13.7.0":
version: 13.7.0
resolution: "validator@npm:13.7.0"
checksum: 2b83283de1222ca549a7ef57f46e8d49c6669213348db78b7045bce36a3b5843ff1e9f709ebf74574e06223461ee1f264f8cc9a26a0060a79a27de079d8286ef
languageName: node
linkType: hard

"vary@npm:^1, vary@npm:~1.1.2":
version: 1.1.2
resolution: "vary@npm:1.1.2"
Expand Down

0 comments on commit a6d011f

Please sign in to comment.