diff --git a/RELEASENOTES.md b/RELEASENOTES.md index adc1736..7af01cb 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,10 +1,13 @@ [Changes since {PREVIOUS_VERSION}](https://github.com/realm/react-realm-context/compare/{PREVIOUS_VERSION}...{CURRENT_VERSION}) ## Enhancements -- None + +* None ## Fixed -- None + +* Fixed the types by removing the `esModuleInterop` from the tsconfig.json. ([#15](https://github.com/realm/react-realm-context/pull/15), since 0.2.0) ## Internals -- None + +* None diff --git a/docs/RELEASENOTES.template.md b/docs/RELEASENOTES.template.md index adc1736..20ca4bc 100644 --- a/docs/RELEASENOTES.template.md +++ b/docs/RELEASENOTES.template.md @@ -1,10 +1,13 @@ [Changes since {PREVIOUS_VERSION}](https://github.com/realm/react-realm-context/compare/{PREVIOUS_VERSION}...{CURRENT_VERSION}) ## Enhancements -- None + +* None ## Fixed -- None + +* None ## Internals -- None + +* None diff --git a/package-lock.json b/package-lock.json index 4a62d7f..fc2d74d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -118,12 +118,6 @@ "integrity": "sha512-cDB930/7MbzaGF6U3IwSQp6XBru8xWajF5PV2YZZeV8DyiliTuld11afVztGI9+yJZ29il5E+NpGA6ooV/Cjkg==", "dev": true }, - "@types/memoize-one": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@types/memoize-one/-/memoize-one-4.1.0.tgz", - "integrity": "sha512-cmSgi6JMX/yBwgpVm4GooNWIH+vEeJoa8FAa6ExOhpJbC0Juq32/uYKiKb3VPSqrEA0aOnjvwZanla3O1WZMbw==", - "dev": true - }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -963,7 +957,7 @@ }, "deepmerge": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-2.1.0.tgz", + "resolved": "http://registry.npmjs.org/deepmerge/-/deepmerge-2.1.0.tgz", "integrity": "sha512-Q89Z26KAfA3lpPGhbF6XMfYAm3jIV3avViy6KOJ2JLzFbeWHOvPQUu5aSJIWXap3gDZC2y1eF5HXEPI2wGqgvw==", "dev": true }, @@ -3476,7 +3470,7 @@ "dependencies": { "commander": { "version": "2.8.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.8.1.tgz", "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", "dev": true, "requires": { diff --git a/package.json b/package.json index 2d1f9a0..5e25c11 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,6 @@ "@octokit/rest": "^16.2.0", "@types/debug": "^4.1.2", "@types/fs-extra": "^5.0.2", - "@types/memoize-one": "^4.1.0", "@types/mocha": "^5.2.0", "@types/node": "^11.9.5", "@types/react": "^16.3.14", diff --git a/src/@types/memoize-one/index.d.ts b/src/@types/memoize-one/index.d.ts new file mode 100644 index 0000000..8140f50 --- /dev/null +++ b/src/@types/memoize-one/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for memoize-one 4.1 +// Project: https://github.com/alexreardon/memoize-one#readme +// Definitions by: Karol Majewski , Frank Li +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'memoize-one' { + type EqualityFn = (a: any, b: any, index: number) => boolean; + + function memoizeOne any>( + resultFn: T, + isEqual?: EqualityFn, + ): T; + + namespace memoizeOne { + + } + + export = memoizeOne; +} diff --git a/src/RealmConnection.test.tsx b/src/RealmConnection.test.tsx index a033fe4..edc82e6 100644 --- a/src/RealmConnection.test.tsx +++ b/src/RealmConnection.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert, { rejects } from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { schema } from './test-utils/persons-realm'; import { withROS } from './test-utils/with-ros'; diff --git a/src/RealmConnection.tsx b/src/RealmConnection.tsx index 2c249c3..f1fd47b 100644 --- a/src/RealmConnection.tsx +++ b/src/RealmConnection.tsx @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////////////// -import React from 'react'; -import Realm from 'realm'; +import * as React from 'react'; +import * as Realm from 'realm'; import { IRealmContext } from '.'; diff --git a/src/RealmConsumer.test.tsx b/src/RealmConsumer.test.tsx index 1049225..944da27 100644 --- a/src/RealmConsumer.test.tsx +++ b/src/RealmConsumer.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { RealmConsumer, RealmProvider } from '.'; diff --git a/src/RealmConsumer.tsx b/src/RealmConsumer.tsx index ea62676..59d2fa0 100644 --- a/src/RealmConsumer.tsx +++ b/src/RealmConsumer.tsx @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////////////// -import React from 'react'; +import * as React from 'react'; import { IRealmContext } from '.'; diff --git a/src/RealmInitializer.test.tsx b/src/RealmInitializer.test.tsx index 9725424..12ea82c 100644 --- a/src/RealmInitializer.test.tsx +++ b/src/RealmInitializer.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/RealmInitializer.tsx b/src/RealmInitializer.tsx index 30c4c28..2761ab1 100644 --- a/src/RealmInitializer.tsx +++ b/src/RealmInitializer.tsx @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////////////// -import React from 'react'; -import Realm from 'realm'; +import * as React from 'react'; +import * as Realm from 'realm'; import { IRealmContext } from '.'; diff --git a/src/RealmProgress.test.tsx b/src/RealmProgress.test.tsx index 6abfc37..f999e96 100644 --- a/src/RealmProgress.test.tsx +++ b/src/RealmProgress.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert, { rejects } from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { schema } from './test-utils/persons-realm'; import { withROS } from './test-utils/with-ros'; diff --git a/src/RealmProgress.tsx b/src/RealmProgress.tsx index 018308e..2a887f9 100644 --- a/src/RealmProgress.tsx +++ b/src/RealmProgress.tsx @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////////////// -import React from 'react'; -import Realm from 'realm'; +import * as React from 'react'; +import * as Realm from 'realm'; import { IRealmContext } from '.'; diff --git a/src/RealmProvider.test.tsx b/src/RealmProvider.test.tsx index df1a858..4163acf 100644 --- a/src/RealmProvider.test.tsx +++ b/src/RealmProvider.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { RealmProvider } from '.'; diff --git a/src/RealmProvider.tsx b/src/RealmProvider.tsx index 3a049fb..6e0a8e2 100644 --- a/src/RealmProvider.tsx +++ b/src/RealmProvider.tsx @@ -16,10 +16,10 @@ // //////////////////////////////////////////////////////////////////////////// -import equal from 'fast-deep-equal'; -import memoizeOne from 'memoize-one'; -import React from 'react'; -import Realm from 'realm'; +import * as equal from 'fast-deep-equal'; +import * as memoizeOne from 'memoize-one'; +import * as React from 'react'; +import * as Realm from 'realm'; import { IRealmContext } from '.'; diff --git a/src/RealmQuery.1-basic.test.tsx b/src/RealmQuery.1-basic.test.tsx index d54dd9a..f7d6e6d 100644 --- a/src/RealmQuery.1-basic.test.tsx +++ b/src/RealmQuery.1-basic.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/RealmQuery.2-filter.test.tsx b/src/RealmQuery.2-filter.test.tsx index dcd0437..79c0617 100644 --- a/src/RealmQuery.2-filter.test.tsx +++ b/src/RealmQuery.2-filter.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/RealmQuery.3-sort.test.tsx b/src/RealmQuery.3-sort.test.tsx index aa322c2..5673a7a 100644 --- a/src/RealmQuery.3-sort.test.tsx +++ b/src/RealmQuery.3-sort.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/RealmQuery.4-type-prop.test.tsx b/src/RealmQuery.4-type-prop.test.tsx index 18b1b5e..7c6d49d 100644 --- a/src/RealmQuery.4-type-prop.test.tsx +++ b/src/RealmQuery.4-type-prop.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IDog, IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/RealmQuery.5-filter-prop.test.tsx b/src/RealmQuery.5-filter-prop.test.tsx index ae7e24d..725c4de 100644 --- a/src/RealmQuery.5-filter-prop.test.tsx +++ b/src/RealmQuery.5-filter-prop.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/RealmQuery.6-sort-prop.test.tsx b/src/RealmQuery.6-sort-prop.test.tsx index 750b538..3f841d0 100644 --- a/src/RealmQuery.6-sort-prop.test.tsx +++ b/src/RealmQuery.6-sort-prop.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/RealmQuery.7-swapped-realm.test.tsx b/src/RealmQuery.7-swapped-realm.test.tsx index 093fe2f..e546828 100644 --- a/src/RealmQuery.7-swapped-realm.test.tsx +++ b/src/RealmQuery.7-swapped-realm.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/RealmQuery.tsx b/src/RealmQuery.tsx index aff52d7..f4689d4 100644 --- a/src/RealmQuery.tsx +++ b/src/RealmQuery.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import memoizeOne from 'memoize-one'; -import React from 'react'; -import Realm from 'realm'; +import * as memoizeOne from 'memoize-one'; +import * as React from 'react'; +import * as Realm from 'realm'; import { IRealmContext } from '.'; diff --git a/src/index.test.tsx b/src/index.test.tsx index a9e70f6..16fc5ce 100644 --- a/src/index.test.tsx +++ b/src/index.test.tsx @@ -16,10 +16,10 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; -import Realm from 'realm'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; +import * as Realm from 'realm'; import { createRealmContext, diff --git a/src/index.tsx b/src/index.tsx index 8ff687a..8220b56 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////////////// -import React from 'react'; -import Realm from 'realm'; +import * as React from 'react'; +import * as Realm from 'realm'; import { generateRealmConnection } from './RealmConnection'; import { generateRealmConsumer, IRealmConsumerProps } from './RealmConsumer'; diff --git a/src/test-utils/realm-js-logging.ts b/src/test-utils/realm-js-logging.ts index 1752dd7..13ee4c1 100644 --- a/src/test-utils/realm-js-logging.ts +++ b/src/test-utils/realm-js-logging.ts @@ -1,5 +1,5 @@ import Debug from 'debug'; -import Realm from 'realm'; +import * as Realm from 'realm'; enum SyncLogLevel { all, diff --git a/src/test-utils/with-ros.ts b/src/test-utils/with-ros.ts index e1cdbfc..fd6f80c 100644 --- a/src/test-utils/with-ros.ts +++ b/src/test-utils/with-ros.ts @@ -1,5 +1,5 @@ import { ITestCallbackContext } from 'mocha'; -import Realm from 'realm'; +import * as Realm from 'realm'; import { v4 as uuid } from 'uuid'; const { REALM_OBJECT_SERVER_URL } = process.env; diff --git a/src/withRealm.test.tsx b/src/withRealm.test.tsx index e30bcbc..5baa3a3 100644 --- a/src/withRealm.test.tsx +++ b/src/withRealm.test.tsx @@ -16,9 +16,9 @@ // //////////////////////////////////////////////////////////////////////////// -import assert from 'assert'; -import React from 'react'; -import renderer from 'react-test-renderer'; +import * as assert from 'assert'; +import * as React from 'react'; +import * as renderer from 'react-test-renderer'; import { IPerson, schema } from './test-utils/persons-realm'; diff --git a/src/withRealm.tsx b/src/withRealm.tsx index 6f7da36..0a7606e 100644 --- a/src/withRealm.tsx +++ b/src/withRealm.tsx @@ -16,8 +16,8 @@ // //////////////////////////////////////////////////////////////////////////// -import React from 'react'; -import Realm from 'realm'; +import * as React from 'react'; +import * as Realm from 'realm'; import { IRealmConsumerProps } from '.'; diff --git a/tsconfig.json b/tsconfig.json index 6fd6117..90b91de 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,6 @@ "jsx": "react", "noImplicitAny": true, "declaration": true, - "esModuleInterop": true, "typeRoots": ["./src/@types", "./node_modules/@types"] }, "include": [