charlypoly / graphql-to-json-schema

GraphQL Schema to JSON Schema
MIT License
202 stars 25 forks source link

Change node engine requirement to ">=8" and update tsconfig accordingly #31

Closed newhouse closed 3 years ago

newhouse commented 3 years ago

When using this package as a dependency in a project that a version of Node that's less than 14, I received the following error:

error graphql-2-json-schema@0.3.1: The engine "node" is incompatible with this module. Expected version "^14". Got "8.17.0"
error Found incompatible module.

I think the issue is that this change. While the other version-related changes enforce/encourage development of this package using Node v14, the package.json.engines.node entry defines requirements for this package to run.

Assuming that the release process includes a tsc compilation using the tsconfig.json in this repo, the resulting .js files were already being transpiled for ES3 targets (it's the default).

However, since ES3 is as old as dirt, and since the docs say the following:

Modern browsers support all ES6 features, so ES6 is a good choice.

I figured we may as well use a target of ES6/ES2015 since Node v8.0+ appears to support just about all of its features. Actually, it looks probably safe to go back as far as v6.5+, but I think anyone who's touching their dependencies these days will be running at least 8.

So, I set the engines.node to >=8 and explicitly compile the ts down to ES2015.

newhouse commented 3 years ago

Bump @wittydeveloper If I was sure you were ok with this and was also 100% sure about the deploy procedure, I would merge and publish this on my own...but I'm not 100% sure. Perhaps we can walk through this one? Feel free to e-mail me!

charlypoly commented 3 years ago

@newhouse published in graphql-2-json-schema@0.5.1

charlypoly commented 3 years ago

@newhouse I should take time to set up a proper CD system that deploys when merging in master