Skip to content

Commit

Permalink
refactor: migrate on TypeScript
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nodkz committed Aug 16, 2020
1 parent 348d09d commit 1fa0005
Show file tree
Hide file tree
Showing 84 changed files with 249 additions and 22,632 deletions.
77 changes: 0 additions & 77 deletions .babelrc

This file was deleted.

44 changes: 0 additions & 44 deletions .eslintrc

This file was deleted.

50 changes: 50 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const path = require('path');

module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
parserOptions: {
sourceType: 'module',
useJSXTextNode: true,
project: [path.resolve(__dirname, 'tsconfig.json')],
},
rules: {
'no-underscore-dangle': 0,
'arrow-body-style': 0,
'no-unused-expressions': 0,
'no-plusplus': 0,
'no-console': 0,
'func-names': 0,
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
'no-prototype-builtins': 0,
'prefer-destructuring': 0,
'no-else-return': 0,
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/ban-ts-comment': 0,
},
env: {
jasmine: true,
jest: true,
},
};
49 changes: 0 additions & 49 deletions .flowconfig

This file was deleted.

5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ notifications:
node_js:
- "10"
- "12"
- "14"
script:
- yarn run test
- yarn run build
- yarn test
- yarn build
after_success:
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
- python travis_after_all.py
Expand Down
1 change: 0 additions & 1 deletion AUTHORS

This file was deleted.

68 changes: 2 additions & 66 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,3 @@
## master
## 0.0.0-semantically-released

## 0.0.0-semantically-released (September 12, 2016)
This package publishing automated by [semantic-release](https://github.com/semantic-release/semantic-release).
[Changelog](https://github.com/nodkz/graphql-compose/releases) is generated automatically and can be found here: https://github.com/nodkz/graphql-compose/releases

## 1.0.12 (September 6, 2016)
- 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`.
- Update dependencies
- Update order of imported modules, due eslint warnings
- Flow 0.32

## 1.0.11 (September 5, 2016)
- 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.

## 1.0.10 (August 25, 2016)
- Resolvers `findOne` and `findById` now by default return object with data, not mongoose document.

## 1.0.9 (August 15, 2016)
- fix: babel build via the workaround https://phabricator.babeljs.io/T2877#78089 Huh, it's too tricky to use Map/Set in ES5.

## 1.0.8 (August 13, 2016)
- fix: babel build process

## 1.0.7 (August 10, 2016)
- 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).

## 1.0.6 (August 8, 2016)
- Fix `projection` extraction from `record` for `updateById` and `updateOne` resolvers.
- Intermediate types now passed to TypeStorage (Enums, SubSchemas) when converting mongoose models.

## 1.0.5 (July 22, 2016)
- Added typeStorage. If you create resolver in second time, it should reuse existed internal types

## 1.0.4 (July 20, 2016)
* Expose `fieldsConverter` methods
* Fix filterHelper: if `filter` InputType without fields, then do not add it to args
* Fix projectionHelper: make projection flat, before passing to mongoose
* Add `convertSchemaToGraphQL` method for creating cached graphql type from MongooseSchema

## 1.0.3 (July 18, 2016)
* HotFix for connection resolver
* HotFix for operators' types in `filter` helper

## 1.0.1 (July 18, 2016)
* Fix `peerDependencies`
* Update `flow` till 0.29
* Other small fixes

## 1.0.0 (July 15, 2016)
* Add connection resolver
* Add support for filtering with operators $gt, $gte, $lt, $lte, $ne, $in, $nin
* Small fixes

## 0.0.6 (July 08, 2016)
* Rename `input` argument to `record` for mutations (due `graphql-compose-relay` compatibility).
`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.

## 0.0.5 (July 07, 2016)
* Refactor Resolvers due changes in graphql-compose api
* Exports flow annotations

## 0.0.3 (July 01, 2016)
* First beta version

## 0.0.1 (June 07, 2016)
* Initial commit
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
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,6 @@ If you want to add additional resolvers [`connection`](https://github.com/graphq
npm install graphql-compose-connection graphql-compose-pagination --save
```

### Different builds

This library contains different builds for any purposes:

```js
// Default import for using under node v6 and above
import { composeWithMongoose } from 'graphql-compose-mongoose';

// For using node 8 and above (native async/await)
import { composeWithMongoose } from 'graphql-compose-mongoose/node8';

// Source code without FlowType declarations
import { composeWithMongoose } from 'graphql-compose-mongoose/es';
```

## Intro video

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

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

0 comments on commit 1fa0005

Please sign in to comment.