Commit graph

33 commits

Author SHA1 Message Date
Martijn Walraven
cef701e6c1 Remove test dependencies from non-test tsconfig.json files 2018-10-11 12:58:03 +02:00
Martijn Walraven
16400909b6 Specify empty include in umbrella tsconfig files 2018-10-11 11:15:36 +02:00
Martijn Walraven
f5d5981ffc Add TypeScript and Jest projects for tests in individual packages 2018-10-11 04:33:23 +02:00
Martijn Walraven
e928adfdfc Simplify plugin API and fix circular dependency issues
We compile `requestPipelineAPI.ts` as a separate TypeScript project to avoid circular dependency issues from the `apollo-server-plugin-base` package depending on the types in `apollo-server-core`.
2018-10-06 06:59:32 +02:00
Martijn Walraven
11a13cd3dd Remove apollo-server-env as a project reference
We can't use `apollo-server-env` as a project reference because that requires `composite: true`, and that implies `declaration: true`, which doesn't work for `apollo-server-env` because we need to write our own declaration files for re-exported imports.

This commit also removes `apollo-engine-reporting-protobuf` as a reference, which errored out because it doesn't actually contain any TypeScript code.
2018-10-05 23:05:49 +02:00
Martijn Walraven
8932091e67 Add root level tsconfig.json as entry point 2018-10-05 21:48:49 +02:00
Martijn Walraven
fcaa6ad79d Enable TypeScript project references 2018-10-05 17:47:29 +02:00
Hugh Willson
dd86fa8a29 Re-enable Typescript esModuleInterop (#1699)
`esModuleInterop` was enabled in
e4164c8892
to help with importing from packages that use default exports.
Those changes were reverted in
https://github.com/apollographql/apollo-server/pull/1210
to work around a few reported issues. Those issues are no longer
relevant, so this commit re-enables `esModuleInterop`, and
updates all default imports to use the more common (standard)
import syntax.
2018-09-21 16:43:33 +03:00
Martijn Walraven
b9876b75bf Remove forceConsistentCasingInFileNames from tsconfig.json 2018-09-01 11:51:48 +02:00
Martijn Walraven
2369b06be2 Use strict top-level tsconfig and fix type issues or override per-package 2018-08-11 16:45:03 +02:00
Martijn Walraven
14348e2913 Enable forceConsistentCasingInFileNames in tsconfig.json 2018-08-11 16:45:03 +02:00
Evans Hauser
9dd1fec766
Mocha to Jest Test Conversion (#1453)
* import jest

* remove mocha, chai, sinon

* fix JSON parsing for package.json

* replace import mocha, chai, sinon with jest

* add jest as test npm script

* remove dependency on mocha types

* errors: remove unused jest tests

* move tests to __tests__ folders

* add jest types to root tsconfig

* fix tsconfig include excludes

* .to.equal -> toEqual

* .true -> .toBe(true)

* .to.deep.equal -> .toEqual

* .to.exist -> .toBeDefined()

* .to.contain -> .toMatch

* .to.match -> .toMatch

* to.be.undefined -> .toBeUndefined()

* not.toBeDefined -> .toBeUndefined

* bring integration test up to date with past changes

* remove message from expect

* .null -> .toBe(null)

* expect.fail -> done.fail

* callsFake -> jest.fn

* mocha mock calls -> jest

* .not.to.exist -> .toBeUndefined()

* callCount -> mocks.calls.length

* returns -> jest.fn()

* .equals -> .toEqual

* fix relative imports

* remove string in expects and place as comment

* remove Fibers from runQuery

* restore -> mockRestore

* before -> beforeAll

* after -> afterAll

* fix async_hooks test and Promise await

* remove jest from testsuite package json

* remove unnecessary apollo-server-env setup

* add start of cloudflare tests

* this.timeout -> timeout argument

* express: fix relative require

* import gql tag properly

* .to.throw -> .toThrow

* .to.be.instanceof -> .toBeInstanceOf

* remove console log check test

* done(Error) -> done.fail(Error)

* done -> done.fail

* change port numbers, since jest runs in parallel

* fix toBeUndefined for null checks

* make engine port unique in testsuite

* make data source rest endpoint port unique

* add coverage scripts

* travis npm script -> cricle script

* make engine port random

* change ports to not conflict across integrations

* increase node version for apollo-server-hapi

* add node versioning to prevent hapi tests from running

* move jest dependencies to the root package.json

* make hapi port unique

* fix port reference in hapi tests
2018-07-31 15:40:03 -07:00
Martijn Walraven
c2e4dfb265 Import graphql-extensions+apollo-engine-reporting/no global apollo-server-env (#1259)
* Export polyfills and types separately

* More imports from apollo-server-env

* Initial commit

* Add .npmignore to avoid ignoring lib when publishing

* 0.0.2

* Reorganize code and clean up GraphQLExtension interface

* 0.0.3

* Add support for timing callbacks and add GraphQLExtensionStack

* 0.0.4

* Downgrade target in tsconfig.json from es2015 to es5

* 0.0.5

* Bump `graphql` peerDependency. (#3)

* 0.0.6

* Update dependencies

* 0.0.7

* whenResultIsFinished fix for array results (#4)

* 0.0.8

* [apollo-bot] Update the Issue/PR Templates with auto label (#6)

* Bump `graphql` peerDependency. (#7)

* Update `graphql` peer dependency range to allow 0.13.x. (#8)

* Update `devDependencies` to latest versions. (#9)

* dev: Update TypeScript to latest version, v2.7.2.

* dev: Update `graphql` to latest version, v0.13.2.

* dev: Update jest & dependencies to latest versions.

* dev: Update type definitions for `graphql`, `node` and `jest`.

* Allow `undefined` return values to `GraphQLExtension`'s `format()`. (#10)

In some cases, it's conceivable that the `format()` method may need to abort
its decision to provide extension information at runtime, in the event that
it doesn't have the proper information to return a full-result.

The `format` method already removed false-y results, so this simply changes
the types to allow the same.

* 0.0.9

* Fix lifecycle method invocations on extensions

* 0.0.10

* Add changelog

* Upgrade to TypeScript 2.8

Makes my editor integration happier (a bugfix in tsserver I think)

* Add tslint and prettier

Same configuration as apollo-engine-js

* Remove magic from GraphQLExtensionStack constructor

It's not hard to consistently pass in an actual extension object to this
low-level API.

* New extension API: didStart handlers return didEnd handlers

This is a backwards-incompatible change: GraphQLExtension implementations and
users of GraphQLExtensionStack (ie apollo-server-core) must change their
implementations, if they implement any of the xDidStart/xDidEnd APIs.

This allows "didEnd" handlers to refer to closure variables from the "didStart"
handler rather than needing to store state on the extension.

The new "didEnd" handlers run in the opposite order of the "didStart" handlers,
so that they properly nest.

* 0.1.0-beta.0

* Changelog

* Add magic back into GraphQLExtensionStack constructor

But now it actually gets more context (the execution arguments) and doesn't have
to be a constructor.

* 0.1.0-beta.1

* Export more types

* 0.1.0-beta.2

* Fix lifecycle handlers to pass proper "this"

* 0.1.0-beta.3

* Pass options directly to start handlers; eliminate factory again

* 0.1.0-beta.4

* error handling in didEnd

* 0.1.0-beta.5

* pass multiple errors to EndHandler

* 0.1.0-beta.6

* add willSendResponse

* 0.1.0-beta.7

* prettier

* setFieldResolver for custom fieldResolver

* reverse

* get more initial options into requestDidStart

* 0.1.0-beta.8

* 0.1.0-beta.9

* Actually, we already get the fieldResolver!

* 0.1.0-beta.10

* work without extensionStack

* 0.1.0-beta.11

* 0.1.0-beta.12

* Send errors to willResolveField callback

* 0.1.0-beta.13

* willSendResponse can return a result

* 0.1.0-beta.14

* Revert 1063be8..56912fc

This reverts commit 1063be8..56912fc.

* add PQ options to requestDidStart

* 0.1.0-beta.14

* 0.1.0-beta.15

* Initialize an empty TypeScript/Jest package

Template based on apollo-engine-js

* Basic trace node structure building

* basic timing

* Checkpoint towards signature implementation

The new signature implementation does not try to compress whitespace.

* Basic signature implementation

* progress towards actual reporting

* basic checkpoint for reporting

* 0.0.0-beta.1

* pull in @types/long, since it is in the external api

* 0.0.0-beta.2

* get rid of Long

* 0.0.0-beta.3

* debug log request what happened

* 0.0.0-beta.4

* 0.0.0-beta.5

* correct url

* 0.0.0-beta.6

* request headers

* 0.0.0-beta.7

* leave out a few headers

* 0.0.0-beta.8

* prettier

* move stuff into multiple files, and stop exporting the extension

* lots of doc comments

* address agent.ts XXX comments

* implement privateVariables

simplify API by removing flush() and allowing flush-ers to just call sendReport
directly

* privateHeaders and error tracking

* gzip, signals

* fix test

* 0.0.0-beta.9

* Error handling for reports

* 0.0.0-beta.10

* no need to include boring stacktrace

* 0.0.0-beta.11

* tweak error reporting

* 0.0.0-beta.12

* package-lock update (npm@6?)

* Reduce target report size to 512KB from 4MB.

Load testing revealed that protobuf encoding for large FullTraceReports could
tie up CPU and reduce p99 request latency (eg, to 200ms from 10ms). Reducing the
default target report size spreads out the encoding time and mitigates the
impact on latency.  If this is not acceptable for all users, we may have to
investigate reintroducing agent-side stats aggregation to keep report sizes
small.

* 0.0.0-beta.13

* Encode Traces as they come in

This improves p99 times with little effect on p50 times. It also lets us get rid
of the heuristic average trace size estimation.

* 0.0.0-beta.14

* support PQ fields

* npm audit fix

* 0.0.0-beta.15

* ignore coverage

* Make the default signature more aggressive

We'd rather tell people confused by literal removal to tweak the signature than
tell people causing outages to do so.

* 0.0.0-beta.16

* Remove obsolete files from graphql-extensions and apollo-engine-reporting

* Fix dependencies and configs

* Fix apollo-server-cloudflare to import from apollo-server-env

* Fix compilation and test configs

* Get all tests passing again

* Switch to Lerna independent versioning

* Polyfill promisify for Node < 8 and load polyfills in tests

* ES2016 exponentiation operator is only supported in Node > 6

* add dependency cache for circle

* add missing env dependencies in REST datasource
2018-06-27 16:29:00 -07:00
Evans Hauser
9af856c2c8
Typescript Improvements and esModuleInterop fix (#1210)
* add string input to gql tag

* remove esModuleInterop, tested locally

* change IMPORT_FUNCTION to something real

* fix the rest of the tests
2018-06-20 16:21:50 -07:00
Martijn Walraven
685d3399db Apollo Server 2.0 - Caching + RESTDataSource (#1163)
* Enable declarationMap in tsconfig.json

See http://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html

* Add apollo-server-caching package and improve typings

* Remove superfluous test steps

* Add .npmignore to apollo-server-caching

* Add apollo-server-env and apollo-datasource-rest packages

* Fix broken imports

* Use prepublish instead of prepare

* cache is now passed to data sources from ApolloServer constructor

* fix Object.values to use the object passed in rather than this

* add initial datasource test

* docs: initial data source documentation

* docs: initial data source documentation

* compiles and documentation now highlights code in data-sources.md

* Some changes to the data source docs
2018-06-14 23:13:33 -07:00
Evans Hauser
e66f6db413
fix: support Node 6 (#1171) 2018-06-13 14:56:09 -07:00
Martijn Walraven
e4164c8892 Enable esModuleInterop and fix imports
See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html
2018-06-11 14:25:59 +02:00
Martijn Walraven
0aff6c8c40 Update compilation target to ES2017 and fix issus 2018-06-11 13:06:31 +02:00
David Glasser
836616bd04 Turn on noUnusedLocals and noUnusedParameters (#1126) 2018-06-01 15:16:16 -07:00
Evans Hauser
072aef410b
tsconfig: remove typeRoots from tsconfig and automatic retreival of node types 2018-05-21 15:29:37 -07:00
Evans Hauser
04006e4bb4
build: skipLibraryChecks when compiling 2018-05-20 21:05:52 -07:00
Evans Hauser
138a0b55f2
build: readd @types/node and type configuration for tsconfig 2018-05-20 21:05:11 -07:00
Evans Hauser
aad7c39001
build: update dependencies and remove extra node typings 2018-05-20 03:52:54 -07:00
James Baxley
68dec79529
clean up and move pieces around 2018-05-11 15:53:14 -07:00
Laurin Quast
df51fd90da Setup prettier (#724)
* Setup prettier and precommit hooks

* Format code with prettier

* Use husky because it works...

* Move prettier config to .prettierrc file

* Implement fixing markdown file formatting when running lint-fix script

* Format markdown files

* Add .json file formatting

* Fixes json file formatting

* Add pretteir linting step

* Remove tslint

* Use gitignore for prettier

* Fix linting errors

* Ignore submodule folder
2018-01-08 15:08:01 -08:00
Mikhail Novikov
c51fc65da8 Add ability to provide default field resolvers (#482) 2017-08-02 12:20:10 +02:00
Kamil Kisiela
924d13c970 Use one central typescript configuration 2017-01-25 13:54:11 +01:00
Hagai Cohen
0c3ba91964 chore(monorepo): refactor files locations and reference 2016-10-18 09:14:32 +03:00
Nick Nance
f6f25c611e Core refactor hapi (#36)
* Revert "get supertest working for TS"

This reverts commit 300b32fa5a.

* initial hapi plugin

* working hapi server

* update exports for es6 support
2016-06-18 10:19:51 -07:00
Nick Nance
4e9bf5cc61 update tsc build to use es5 2016-06-14 12:04:28 -07:00
nnance
1f26bbaecc improve typings config 2016-06-12 22:28:36 -07:00
James Baxley
b7df901124 adjusted target environment, added chai typings, and fixed a couple typescript bugs 2016-06-10 20:47:22 -04:00
Jonas Helfer
d19f31331d initial attempt at core refactor with typescript 2016-06-10 17:05:39 -07:00