Commit graph

292 commits

Author SHA1 Message Date
Renovate Bot
62be6ff78d chore(deps): update dependency @types/node to v10.5.5 2018-08-01 12:43:22 +00: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
Renovate Bot
6710575e6f chore(deps): update dependency prettier to v1.14.0 2018-07-30 09:40:27 +00:00
Renovate Bot
7f19fc239e chore(deps): update dependency @types/node to v10.5.4 2018-07-28 10:17:15 +00:00
Renovate Bot
46bd6fcb19 chore(deps): update dependency @types/node to v10.5.3 2018-07-25 07:26:16 +00:00
Renovate Bot
6e0fe2483e chore(deps): update dependency sinon to v6.1.4 2018-07-23 11:52:01 +00:00
Martijn Walraven
4f7b6e0ca1 Revert Lerna to 2.x to avoid CI build failures 2018-07-18 14:35:18 -07:00
Martijn Walraven
8f85252949 Update to Lerna 3.0 2018-07-18 08:43:47 -07:00
Evans Hauser
9518c0ff1a
Publish
- apollo-cache-control@0.2.0-rc.3
 - apollo-datasource-rest@0.1.0-rc.10
 - apollo-datasource@0.1.0-rc.10
 - apollo-engine-reporting@0.0.0-rc.4
 - apollo-server-caching@0.1.0-rc.10
 - apollo-server-cloudflare@2.0.0-rc.10
 - apollo-server-core@2.0.0-rc.10
 - apollo-server-env@2.0.0-rc.10
 - apollo-server-errors@2.0.0-rc.10
 - apollo-server-express@2.0.0-rc.10
 - apollo-server-hapi@2.0.0-rc.10
 - apollo-server-integration-testsuite@2.0.0-rc.10
 - apollo-server-koa@2.0.0-rc.10
 - apollo-server-lambda@2.0.0-xrc.10
 - apollo-server-memcached@0.1.0-rc.10
 - apollo-server-micro@2.0.0-rc.10
 - apollo-server-redis@0.1.0-rc.10
 - apollo-server@2.0.0-rc.10
 - apollo-tracing@0.2.0-rc.3
 - graphql-extensions@0.1.0-rc.4
2018-07-17 10:55:45 -07:00
Renovate Bot
fc95bcbf68 chore(deps): update dependency @types/mocha to v5.2.5 2018-07-17 08:51:26 +00:00
renovate[bot]
3b3c50a1ab chore(deps): pin dependencies (#1346) 2018-07-16 09:56:51 -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
Martijn Walraven
7496eb034d Run test in apollo-datasource-rest as part of monorepo tests 2018-06-18 11:57:19 +02:00
Evans Hauser
e66f6db413
fix: support Node 6 (#1171) 2018-06-13 14:56:09 -07:00
Martijn Walraven
4a068cff74 Add engines field with node >= 8 in package.json 2018-06-11 13:21:51 +02:00
Martijn Walraven
5a1598c99a Remove deprecated supertest-as-promised 2018-06-11 12:17:10 +02:00
Martijn Walraven
1e1b49ec29 Update devDependencies, including typescript 2018-06-11 12:13:03 +02:00
Evans Hauser
582698c09c
package.json: update @types/graphql 2018-05-21 16:54:46 -07:00
Evans Hauser
84e763358e
package.json: remove node and graphql types from root and unnecessary variants 2018-05-21 15:31:57 -07:00
Evans Hauser
aad7c39001
build: update dependencies and remove extra node typings 2018-05-20 03:52:54 -07:00
Renovate Bot
70a09df2c8
chore(deps): update dependency @types/sinon to v4.3.3 2018-05-11 15:54:24 -07:00
Renovate Bot
6457b1a3a1
chore(deps): update dependency @types/node to v9.6.15 2018-05-11 15:54:23 -07:00
Renovate Bot
7b781333f2
chore(deps): update dependency @types/sinon to v4.3.2 2018-05-11 15:54:22 -07:00
Renovate Bot
3fff064387
chore(deps): update dependency @types/node to v9.6.14 2018-05-11 15:54:22 -07:00
Renovate Bot
98ec318109
chore(deps): update dependency sinon to v5.0.7 2018-05-11 15:54:21 -07:00
Renovate Bot
f6fc411b55
chore(deps): update dependency sinon to v5.0.6 2018-05-11 15:54:21 -07:00
Renovate Bot
5e3b64263f
chore(deps): update dependency sinon to v5.0.5 2018-05-11 15:54:20 -07:00
Renovate Bot
95d23e7868
chore(deps): update dependency @types/node to v9.6.12 2018-05-11 15:54:20 -07:00
Renovate Bot
e18e23119f
chore(deps): update dependency @types/node to v9.6.11 2018-05-11 15:54:20 -07:00
Evans Hauser
0cccdb9cc5
root: add @types/graphql to package.json to fix cache-control compilation error 2018-05-11 15:53:13 -07:00
Renovate Bot
22d13f2ec8
chore(deps): update dependency @types/node to v9.6.9 2018-05-11 15:53:07 -07:00
Renovate Bot
f9d919c31e
chore(deps): update dependency sinon to v5.0.3 2018-05-11 15:53:06 -07:00
Renovate Bot
b7595b30e3
chore(deps): update dependency sinon to v5.0.2 2018-05-11 15:53:06 -07:00
Renovate Bot
040737ac03
chore(deps): update dependency @types/node to v9.6.8 2018-05-11 15:53:06 -07:00
renovate[bot]
8915ef82f4
chore(deps): update dependency sinon to v5 (#1010) 2018-05-11 15:53:06 -07:00
Renovate Bot
1a0e27e0e7
chore(deps): update dependency @types/node to v9.6.7 2018-05-11 15:53:05 -07:00
Jesse Rosenberger
9ab4f9d0f8
Merge pull request #942 from apollographql/docs-overhaul
[Work in Progress] 2.0 Documentation
2018-05-02 17:41:48 -07:00
Renovate Bot
c43d9bda04 chore(deps): update dependency remap-istanbul to v0.11.1 2018-04-26 07:02:11 +00:00
Renovate Bot
297e501231 chore(deps): update dependency lerna to v2.11.0 2018-04-25 11:02:21 +00:00
Jesse Rosenberger
c65b7a57bf
Merge remote-tracking branch 'origin/master' into docs-overhaul 2018-04-23 15:28:29 +03:00
Renovate Bot
d74f5e78e6 chore(deps): update dependency @types/chai to v4.1.3 2018-04-21 06:56:11 +00:00
Renovate Bot
591b0f2cae chore(deps): update dependency typescript to v2.8.3 2018-04-20 10:02:15 +00:00
Renovate Bot
cc579227c8 chore(deps): update dependency @types/node to v9.6.6 2018-04-20 08:02:16 +00:00
Renovate Bot
64a01c94f8 chore(deps): update dependency @types/mocha to v5.2.0 2018-04-20 06:48:48 +00:00
Renovate Bot
5bebbf12b1 chore(deps): update dependency mocha to v5.1.1 2018-04-19 07:06:26 +00:00
renovate[bot]
625bf7ba8e chore(deps): update dependency mocha to v5.1.0 (#908) 2018-04-18 15:47:39 +03:00
Jesse Rosenberger
0c6b1bd358
Remove dev-dependency on npm-check-updates. (#959)
It appears that the intention of including `npm-check-updates` in this
repository was to provide an easy way to update dependent packages from the
console.  This was originally introduced in [Ref 0].

Unfortunately, the `npm-check-updates` package has an explicit dependency on
`npm@3`, which means that it includes the entire `npm` in its
`node_modules`.

I originally observed this when analyzing the test failures in [Ref 1] and
[Ref 2] which indicated (in its npm error) that the npm version was v3.10.10.

The explanation for this is relatively straight-forward: Older versions of
npm uses an nested tree of `node_modules` directories while newer versions
hoist `node_modules` (i.e. flatten) to the highest location possible and
only nesting dependencies to meet conflicting version constraints.

Unfortunately, that means that once `npm@3` was installed by the newer
`npm@5` as a dependency of `npm-check-updates`, it was hoisted to the
top-level `node_modules` directory, exposing `npm@3` to `npm-scripts` which
directly call `npm` commands on the nested packages, as is done on this
monorepo (with, for example the `postinstall` script which runs `npm run
compile` in each of the server middleware packages). :face_palm:

Overall, this package doesn't seem to provide enough value for us to
continue to include it, especially since we have Renovate - coupled with the
same information being available from `npm outdated` and `npm update`
commands.  I'm not sure why we would want to install newer versions than our
"package.json" allows.

Futhermore, looking at the issue tracker on `npm-check-updates`, I'm
assuming this is the reason I've seen "`dezalgo`" install errors [Ref 3] on
this repository recently and _possibly_ even a bizarrely corrupted npm cache
I encountered recently (though admittedly, that could be a stretch).

See also: [Ref 4].

[Ref 0]: https://github.com/apollographql/apollo-server/commit/d7ca07f7
[Ref 1]: https://circleci.com/gh/apollographql/apollo-server/1915
[Ref 2]: https://app.netlify.com/sites/apollo-server-docs/deploys/5acdd3b7
[Ref 3]: https://github.com/tjunnone/npm-check-updates/issues/420
[Ref 4]: https://github.com/tjunnone/npm-check-updates/issues/423
2018-04-17 22:59:00 +03:00
Renovate Bot
c87cce9a2b chore(deps): update dependency prettier to v1.12.1 2018-04-17 16:02:50 +00:00
Renovate Bot
05222b121b chore(deps): update dependency lerna to v2.10.2 2018-04-17 14:02:35 +00:00
Renovate Bot
e1cfd83124 chore(deps): update dependency @types/node to v9.6.5 2018-04-14 07:02:46 +00:00