* Export `GraphQLOptions` type directly from `apollo-server-express`.
Directly export `GraphQLOptions` from the `apollo-server-express` (and
synonymously, `graphql-server-express`) main module, rather than exporting
it only from `./expressApollo`.
By using CircleCI 2.0's new Workflow feature, we can more delicately
orchestrate how the test suite runs.
Specifically, we can have individual groups of tests report their status
independently to pull-requests, and react accordingly. For example, rather
than the linting tests being lumped into the individual tests ran on each
Node.js platform version, we can now run them on their own (and also avoid
unnecessarily running them over and over again for each Node.js version!).
Each jobs test results will be reported to the pull-request directly and, if
desired, the repository's branch merge rules can be modified to allow specific
types of test failures (like linting) to be allowed.
This need for greater test granularity became quite relevant recently when many
of the outstanding PRs on this repository were failing because of "prettier"
failures which were not directly related to the files changed by the PR but
by other changes on the `master` branch. In order to confidently review and
merge those PRs, it was necessary to look through each PRs four platform
test runs and ensure _each_ was a prettier failure and not something more
substantial. This manual step left way too much room for error and was not
a confidence builder, at all!
I've also added a new test for the documentation generation to ensure that
no changes in the PR have caused the documentation to not generate, which
would result in stale documentation since the existing documentation would
simply remain in place until the problem was eventually noticed.
As a last benefit, in my observations so far, CircleCI is running more
tests, more quickly and with greater parallelisation than our previous test
provider. Recently I've seen tests finishing in about two minutes rather than
what was sometimes 5 minutes.
With a lack of comments and a fairly strict structure, it's arguable if JSON
files were ever meant to be pretty, but the method we're using right now is
a bit futile, especially considering that tools that we use to automatically
update JSON (specifically, package.json) don't run prettier themselves.
The most problematic rule is the 80 characters line limit.
Lines in JSON can be wrapped in, at most, one place: after the colon in the
key. This means that as soon as a single npm-script declaration exceeds the
line-length rule a second time, it can't be wrapped again, resulting in a
violation of the very rule being enforced.
Clearly, I've always thought that prettying JSON is a bit silly, but the
straw that broke the camel's back here is automated package.json changes by
bots which update the repository via their automated PRs.
Perhaps in a day where the JavaScript package manifest finds a new file
extension (.js?, .yaml, .toml?), it will be able to reap the glitz and glamour
of being eloquently formatted, but until then we'll have to use long-line
wrapping in our editors.
...or shorten our npm scripts.
For reasons unbeknownst to me, the changes below were only being complained
about in the CI environment but _not_ when I ran `npm run lint` locally.
It seems partially related to the OS its ran on, so I imagine there might be
some other sub-dependency at play here. In an effort to fix this, I just
spawned a Ubuntu docker image, checked out this repository and ran the same
`npm run lint`. This produced identical results to Travis, so I ran
`npm run lint-fix`, then saved the `git diff` results and have applied this
locally.
This should allow us to re-enable `prettier` in CI, though I have plans to
separate that from the actual `npm test` runs. This should result in a better
workflow for managing PRs.
* Pin `lint-staged` to maintain Node.js 4 support.
The newer version of `lint-staged` (v7) drops support for Node.js 4, a version of Node.js which is still under Maintenance LTS support and therefore we still need to test against. Since this npm would be used in our Node.js 4 test matrix, it's imperative that we not jump to v7.
Primarily because the results that prettier is giving on Travis are not the
same as those that are exhibited locally. Namely, the result of running the
`npm run lint` command locally returns different files than on TravisCI.
This makes it almost entirely impossible to determine what is wrong with the
files. It's likely enough that it's running in post-commit, but I'd be
happy to re-introduce this commit if someone can figure out what is wrong!
For now though, it's interfering with the ability to merge PRs.
As another option, perhaps CircleCI workflows would allow us to have
separate fail badges for Lint tests rather than testing the linting in every
Node.js version of the build matrix and polluting the true success and
failure of the unarguably more important tests themselves (rather than the
formatting of the code which is being tested).
While this file is actually ignored by a `.gitignore` which lives inside the
`docs` directory (as is consistent with the various docs repositories or
sub-trees), prettier is being told to ignore files in the top-level
`.gitignore` and only supports a single `--ignore-path` file.
This will allow it to skip trying to format this `.json` file.
* docs: Use `devDependencies` instead of `dependencies`.
It's safe to mark all dependencies of this theme as 'dev' dependencies, as
none of them are needed to be installed in a production setting.
This was done automatically, so in some cases, this merges existing
`devDependencies`, and may also have added a missing `nodemon` `devDependency`
in cases where it was missing. In other cases, this commit may not have
made such a change.
* docs: Remove _config.yml options now covered by global theme config.
* docs: Add `_multiconfig.yml`, a build artifact, to docs `.gitignore`.
* docs: Use theme from npm, rather than submodule, using `chexo`.
The theme which the docs in this repository are based on
([`hexo-theme-meteor`](https://github.com/meteor/hexo-theme-meteor)) has been
published to npm.
Additionally, most of the configuration which was once present in this
repository's `_config.yml` file, has been moved into an Apollo-centric theme
configuration npm,
[`apollo-hexo-config`](https://www.npmjs.com/package/apollo-hexo-config) (and
similarly, [GitHub](https://github.com/apollographql/apollo-hexo-config)).
The theme bundled in this npm is a converged version of the two `apollo`
and `master` branches on the `hexo-theme-meteor` repository, which is a result
of the work undertaken in https://github.com/meteor/hexo-theme-meteor/pull/51.
Lastly, this makes use of a new `chexo` npm which acts as a wrapper for `hexo`
but permits the use of an inherited configuration from npm, rather than a
statically defined CLI file parameter (previously with `--config a,b`).
* docs: Upgrade Hexo generator/tag/server dependencies.
* docs: Add missing `meteor-theme-hexo` package.
This was apparently missed, only on this repository (???) in my automated
commits, probably due to my own error.
* Fix sample in Azure function README.md
The sample was missing a parameter in the calls to the apollo server. I also added a note about a current issue with local development of Azure functions on Macs.
* docs(apollo-server-azure): Remove schema option from graphiql
* Remove testing note Re: Azure functions on macOS.