Skip to content

Commit 1fa0005

Browse files
committed
refactor: migrate on TypeScript
BREAKING CHANGE: remove FlowType support. Drop old builds `node8`, `es`, `mjs` – they were created several years ago and no need to prepare them for node v10.
1 parent 348d09d commit 1fa0005

File tree

84 files changed

+249
-22632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+249
-22632
lines changed

.babelrc

-77
This file was deleted.

.eslintrc

-44
This file was deleted.

.eslintrc.js

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint', 'prettier'],
6+
extends: [
7+
'plugin:@typescript-eslint/recommended',
8+
'prettier/@typescript-eslint',
9+
'plugin:prettier/recommended',
10+
],
11+
parserOptions: {
12+
sourceType: 'module',
13+
useJSXTextNode: true,
14+
project: [path.resolve(__dirname, 'tsconfig.json')],
15+
},
16+
rules: {
17+
'no-underscore-dangle': 0,
18+
'arrow-body-style': 0,
19+
'no-unused-expressions': 0,
20+
'no-plusplus': 0,
21+
'no-console': 0,
22+
'func-names': 0,
23+
'comma-dangle': [
24+
'error',
25+
{
26+
arrays: 'always-multiline',
27+
objects: 'always-multiline',
28+
imports: 'always-multiline',
29+
exports: 'always-multiline',
30+
functions: 'ignore',
31+
},
32+
],
33+
'no-prototype-builtins': 0,
34+
'prefer-destructuring': 0,
35+
'no-else-return': 0,
36+
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
37+
'@typescript-eslint/explicit-member-accessibility': 0,
38+
'@typescript-eslint/no-explicit-any': 0,
39+
'@typescript-eslint/no-inferrable-types': 0,
40+
'@typescript-eslint/explicit-function-return-type': 0,
41+
'@typescript-eslint/no-use-before-define': 0,
42+
'@typescript-eslint/no-empty-function': 0,
43+
'@typescript-eslint/camelcase': 0,
44+
'@typescript-eslint/ban-ts-comment': 0,
45+
},
46+
env: {
47+
jasmine: true,
48+
jest: true,
49+
},
50+
};

.flowconfig

-49
This file was deleted.

.travis.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ notifications:
1010
node_js:
1111
- "10"
1212
- "12"
13+
- "14"
1314
script:
14-
- yarn run test
15-
- yarn run build
15+
- yarn test
16+
- yarn build
1617
after_success:
1718
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
1819
- python travis_after_all.py

AUTHORS

-1
This file was deleted.

CHANGELOG.md

+2-66
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,3 @@
1-
## master
1+
## 0.0.0-semantically-released
22

3-
## 0.0.0-semantically-released (September 12, 2016)
4-
This package publishing automated by [semantic-release](https://github.com/semantic-release/semantic-release).
5-
[Changelog](https://github.com/nodkz/graphql-compose/releases) is generated automatically and can be found here: https://github.com/nodkz/graphql-compose/releases
6-
7-
## 1.0.12 (September 6, 2016)
8-
- fix: Resolvers now return mongoose documents. It's useful for your resolver wrappers. Now you have access to virtual fields, model methods via `source` or `source.record`.
9-
- Update dependencies
10-
- Update order of imported modules, due eslint warnings
11-
- Flow 0.32
12-
13-
## 1.0.11 (September 5, 2016)
14-
- Add support for `mongoose.Schema.Types.Mixed` type. Many thanks to @taion for his [graphql-type-json](https://github.com/taion/graphql-type-json) package.
15-
16-
## 1.0.10 (August 25, 2016)
17-
- Resolvers `findOne` and `findById` now by default return object with data, not mongoose document.
18-
19-
## 1.0.9 (August 15, 2016)
20-
- fix: babel build via the workaround https://phabricator.babeljs.io/T2877#78089 Huh, it's too tricky to use Map/Set in ES5.
21-
22-
## 1.0.8 (August 13, 2016)
23-
- fix: babel build process
24-
25-
## 1.0.7 (August 10, 2016)
26-
- Update packages, add `babel-plugin-transform-runtime` for build process. Fix [issue](https://github.com/nodkz/graphql-compose-connection/issues/2) for vanilla node.js users without babel (thanks @jacobbubu).
27-
28-
## 1.0.6 (August 8, 2016)
29-
- Fix `projection` extraction from `record` for `updateById` and `updateOne` resolvers.
30-
- Intermediate types now passed to TypeStorage (Enums, SubSchemas) when converting mongoose models.
31-
32-
## 1.0.5 (July 22, 2016)
33-
- Added typeStorage. If you create resolver in second time, it should reuse existed internal types
34-
35-
## 1.0.4 (July 20, 2016)
36-
* Expose `fieldsConverter` methods
37-
* Fix filterHelper: if `filter` InputType without fields, then do not add it to args
38-
* Fix projectionHelper: make projection flat, before passing to mongoose
39-
* Add `convertSchemaToGraphQL` method for creating cached graphql type from MongooseSchema
40-
41-
## 1.0.3 (July 18, 2016)
42-
* HotFix for connection resolver
43-
* HotFix for operators' types in `filter` helper
44-
45-
## 1.0.1 (July 18, 2016)
46-
* Fix `peerDependencies`
47-
* Update `flow` till 0.29
48-
* Other small fixes
49-
50-
## 1.0.0 (July 15, 2016)
51-
* Add connection resolver
52-
* Add support for filtering with operators $gt, $gte, $lt, $lte, $ne, $in, $nin
53-
* Small fixes
54-
55-
## 0.0.6 (July 08, 2016)
56-
* Rename `input` argument to `record` for mutations (due `graphql-compose-relay` compatibility).
57-
`input` is a reserved name for mutations' arg in Relay, and may contains not only document/record data (eg. clientMutationId, sort and filter args). So better solution for `graphql-compose-mongoose` do not use this name, cause `graphql-compose-relay` get all args from mongoose resolvers and put them to `input` arg.
58-
59-
## 0.0.5 (July 07, 2016)
60-
* Refactor Resolvers due changes in graphql-compose api
61-
* Exports flow annotations
62-
63-
## 0.0.3 (July 01, 2016)
64-
* First beta version
65-
66-
## 0.0.1 (June 07, 2016)
67-
* Initial commit
3+
This package publishing automated by [semantic-release](https://github.com/semantic-release/semantic-release). Changelog is generated automatically and can be found here: https://github.com/graphql-compose/graphql-compose-mongoose/releases

README.md

+1-16
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ If you want to add additional resolvers [`connection`](https://github.com/graphq
2424
npm install graphql-compose-connection graphql-compose-pagination --save
2525
```
2626

27-
### Different builds
28-
29-
This library contains different builds for any purposes:
30-
31-
```js
32-
// Default import for using under node v6 and above
33-
import { composeWithMongoose } from 'graphql-compose-mongoose';
34-
35-
// For using node 8 and above (native async/await)
36-
import { composeWithMongoose } from 'graphql-compose-mongoose/node8';
37-
38-
// Source code without FlowType declarations
39-
import { composeWithMongoose } from 'graphql-compose-mongoose/es';
40-
```
41-
4227
## Intro video
4328

4429
Viktor Kjartansson created a quite solid intro for graphql-compose-mongoose in comparison with graphql-tools:
@@ -209,7 +194,7 @@ Variable Namings
209194
}
210195
};
211196
const DroidTC = CharacterDTC.discriminator(DroidModel, droidTypeConverterOptions);
212-
const PersonTC = CharacterDTC.discriminator(PersonModel); // baseOptions -> customisationsOptions applied
197+
const PersonTC = CharacterDTC.discriminator(PersonModel); // baseOptions -> customizationsOptions applied
213198

214199
// You may now use CharacterDTC to add fields to all Discriminators
215200
// Use DroidTC, `PersonTC as any other ObjectTypeComposer.

0 commit comments

Comments
 (0)