diff --git a/.flowconfig b/.flowconfig index 0af244f88bc7..78b40a0ece25 100644 --- a/.flowconfig +++ b/.flowconfig @@ -4,6 +4,7 @@ compiler/** **/*/node_modules/** packages/relay-e2e-test/** **/node_modules/resolve/test/resolver/malformed_package_json/package.json +**/node_modules/invariant/** [options] builtin_lib=core-only @@ -13,6 +14,7 @@ module.system=haste module.system.haste.paths.excludes=.*/__tests__/.* module.system.haste.paths.excludes=.*/__mocks__/.* module.system.haste.paths.includes=/node_modules/fbjs/lib/.* +module.system.haste.paths.excludes=/node_modules/fbjs/lib/invariant.* munge_underscores=true ; https://fburl.com/code/h2jnts20 - to match internval value @@ -32,4 +34,4 @@ untyped-import untyped-type-import [version] -^0.336.0 +^0.337.0 diff --git a/flow-typed/npm/invariant_v2.x.x.js b/flow-typed/npm/invariant_v2.x.x.js new file mode 100644 index 000000000000..74cb0815afc9 --- /dev/null +++ b/flow-typed/npm/invariant_v2.x.x.js @@ -0,0 +1,23 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + */ + +declare module 'invariant' { + declare module.exports: ( + condition: unknown, + format?: string, + ...args: Array + ) => asserts condition; +} + +declare module 'invariant/invariant' { + import typeof Invariant from 'invariant'; + + declare module.exports: Invariant; +} diff --git a/package.json b/package.json index a98d64d450f0..98f9630134a6 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "eslint-plugin-relay": "1.8.3", "eslint-plugin-relay-internal": "link:./packages/eslint-plugin-relay-internal", "fbjs": "^3.0.2", - "flow-bin": "^0.336.0", + "flow-bin": "^0.337.0", "flow-eslint": "0.336.0", "flow-parser": "0.336.0", "graphql": "17.0.2", diff --git a/yarn.lock b/yarn.lock index 3fb40b55918c..f7852cf1501e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3699,10 +3699,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.6.tgz#022e9218c637f9f3fc9c35ab9c9193f05add60b2" integrity sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ== -flow-bin@^0.336.0: - version "0.336.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.336.0.tgz#ac946f9cdf134b83ab4f7a98a0de34324f6b94f4" - integrity sha512-I5sPg/GISpXH4W14eGWgiIsrDKY0uvvvXjlEDOI2t0pguEwbMgpnaYzMMMBoHZcYYtNJIF/0eGsbPnN7uP2zOQ== +flow-bin@^0.337.0: + version "0.337.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.337.0.tgz#419252403924033308160351e95f723bcf42597c" + integrity sha512-rpr+WvY30RdXPNHbioErMM8tLKUOKJ8/neXPpsDYRBp9z7WDkl4bpTBUMZiqh9ozfdcDWEACBTXwIl94h/ZA0A== flow-eslint@0.336.0: version "0.336.0"