Giter Club home page Giter Club logo

gramps-cli's Introduction

gramps-cli's People

Contributors

cknabe avatar ecwyne avatar greenkeeper[bot] avatar jlengstorf avatar loganmccaul avatar ryanomackey avatar timrs2998 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gramps-cli's Issues

can't fork empty repo

@jlengstorf Unfortunately I can't fork this repo while it's empty nor do I have write privileges so I can't push to a non-master branch either.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

`dev` command fails in Git bash on Windows

Several things appear to be going wrong in the git bash shell on Windows. I'm unable to confirm any of these because I don't have a Windows machine, so this is just me repeating what I've been told.

del.sync hangs infinitely

Despite the fact it should be Windows-compatible, del.sync() seems to hang forever in git bash.

mkdirp doesn't work

Similarly, mkdirp seems to be failing in git bash

Relative paths are converted to absolute paths

The temporary directory path is being set to something like this:

C:\Users\dev\git\graphql-data-source-test\node_modules\@gramps\cli\dist\.tmp\C:\Users\dev\git\graphql-data-source-test

According to the dev having these issues, if del.sync is omitted, mkdirp is omitted, and a hard-coded temp dir path is used, the CLI works as intended.

@kbrandwijk, if you have a chance to take a look at this when you're free, I'd really appreciate it.

Unable to load data-sources.

I'm unable to load data-sources using cli.

dataSources = [], ^^^^^^^^^^^^^^^^ SyntaxError: Invalid shorthand property initializer at Object.exports.runInThisContext (vm.js:76:16)

Also won't this always equal false?

const handler = exports.handler = async ({
  dataSources = [],
  mock = false,
  gateway,
  transpile
}) => {
  (0, _logger.warn)('The GrAMPS CLI is intended for local development only.');

  let dataSourcePaths = [];
  let loadedDataSources = [];
  if (dataSources.length) {

[1.0] Finalize CLI API

Per the discussion that started on #4, we need to finalize the actual API of this tool. We know what it should do, but need to agree on how to actually expose the commands.

I'm porting the last comment from #4 to here:

@corycook @ecwyne To try and consolidate things, let me do a recap of where we are so far:

Cory’s Proposal

API

gramps [<datasource> [<datasource> ...]] [--live | --mock] [--gateway=<gateway>]

Examples

# run the current data source with the built-in dev server
gramps

# run the current data source with the built-in dev server in live mode
gramps --live

# run the current data source + an additional data source
gramps ./ ../otherSource

# run the current source + a custom gateway
gramps --gateway ../gateway

Additional Recommendation from Cory: Don’t Transpile

I'm personally against this because it's moving us further and further from a plug-and-play solution, but I'd be down to have an opt-out flag (e.g. gramps --no-transpile). A requirement to set up additional tools (e.g. concurrently) for dev seems like more overhead than is necessary. For advanced users, I think an opt-out is fine, but for someone who's new to this I think they should be able to just run gramps dev and see some data in GraphiQL.

Eric’s Proposal

API

gramps dev [<datasource> [<datasource> ...]] [--live | --mock]
gramps serve <gateway> [--override=<datasource> [--override=<datasource> ...]] [--live | --mock]

Examples

# run the current data source with the built-in dev server
gramps dev

# run the current data source with the built-in dev server in live mode
gramps dev --live

# run the current data source + an additional data source
gramps dev . ../otherSource

# run the current source + a custom gateway
gramps serve ../gateway --override ./

Jason’s Proposal

API

gramps dev [<gateway>] [--data-source=<datasource> [--data-source=<datasource> ...]] [--live | --mock] [--gateway=<gateway>]

Examples

# run the current data source with the built-in dev server
gramps dev --data-source .

# run the current data source with the built-in dev server in live mode
gramps dev --data-source . --live

# run the current data source + an additional data source
gramps dev --data-source . --data-source ../otherSource

# run the current source + a custom gateway
gramps dev ../gateway --data-source .

The Good Stuff

I think we've all got good ideas and good rationale behind them, so I want to see if I can walk through our main points of contention

Positional vs. Explicit Args

My preference is to remain explicit. Positional arguments are confusing to me, because it's not clear if ./one ./two is an input > output arg, or a "use both of these" arg. I think it's easier to reason about code that tells you what it does with descriptive options.

Command Name

I think @ecwyne had a great idea to change the command from gramps to something more clear: gramps dev. We may want to add new commands in the future (e.g. new data source creation), plus it makes it more obvious that this is only intended for development.

Pulling It All Together

Based on the three options, I've got two suggestions:

  1. An API with named args (my preference)
  2. An API with positional args

Potential Named Args API

gramps dev [--data-source=<datasource> [--data-source=<datasource> ...]] [--live | --mock] [--gateway=<gateway>] [--no-transpile]

Examples

# run the built-in dev server with no data sources (for "hello world" testing)
gramps dev

# run the current data source with the built-in dev server
gramps dev --data-source .

# run the current data source with the built-in dev server in live mode
gramps dev --data-source . --live

# run the current data source + an additional data source
gramps dev --data-source . --data-source ../otherSource

# run the current source + a custom gateway
gramps dev --data-source . --gateway ../gateway

# run the current source + custom gateway in live mode with no transpilation
gramps dev --data-source . --gateway ../gateway --live --no-transpile

Potential Positional API

gramps dev [<datasource> [<datasource> ...]] [--live | --mock] [--gateway=<gateway>] [--no-transpile]

Examples

# run the built-in dev server with no data sources (for "hello world" testing)
gramps dev

# run the current data source with the built-in dev server
gramps dev .

# run the current data source with the built-in dev server in live mode
gramps dev . --live

# run the current data source + an additional data source
gramps dev . ../otherSource

# run the current source + a custom gateway
gramps dev . --gateway ../gateway

# run the current source + custom gateway in live mode with no transpilation
gramps dev . --gateway ../gateway --live --no-transpile

What does everyone think of this?

[Feature Request] Allow user to specify port

I'd like a -p or --port flag in the CLI to specify the port. I like that get-port has a preferred port option, although port 8080 is a pretty popular port so being able to change the default yarn dev port would be useful for local development and testing.

[1.0] Add support for custom gateway during development

We need #9 to be completed before we can do this. During development, we need to the ability to provide a gateway start script.

This needs to:

  • Start a GraphQL gateway server
  • Allow overriding installed data sources with local data sources (dev only)

[1.0] Update the README

Once the 1.0 release is ready and the docs are written, we need to update the README with a new quickstart and docs links.

[1.0] Make data sources fully self-contained on export

After a discussion today with @schickling, @kbrandwijk, and @nikolasburk about how GrAMPS data sources will fit with external tools (such as Graphcool and qewl), a couple things came up:

  1. GrAMPS data sources should be exporting an executable schema, and not the typeDefs/resolvers/mocks as I was previously pushing for
  2. GrAMPS data sources should not require the context to be attached externally (meaning there should be no intermediate step to attach a data source context to its resolvers)

(@ecwyne and @corycook, you're going to say, "I told you so.") 😄

An in-range update of @gramps/gramps is breaking the build 🚨

The dependency @gramps/gramps was updated from 1.4.0 to 1.5.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@gramps/gramps is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes for v1.5.0

1.5.0 (2018-10-17)

Features

Commits

The new version differs by 1 commits.

  • 9bf76af feat: add Upload scalar/resolver (#107)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[1.0] Feature Checklist

Let's get this thing to 1.0!

For the CLI, here's what we need to do:

  • Design: Finalize the API #9
  • Refactor: Start data source(s) with a local dev server (this should already work, but needs to be refactored to the formate in #9) #11
  • Feature: Add support for using a custom gateway during local dev #10
  • Docs: Write CLI docs #6
  • Docs: Update the README #13

- [ ] Feature: Move to Typescript #8 <-- let's do this, but not block the 1.0 release for it.

@ecwyne @corycook Am I missing anything here?

Move to Typescript

A discussion with @schickling suggested the use of Typescript, since the majority of the GraphQL tooling ecosystem is written in Typescript.

I'm on board with this for the core of GrAMPS, but want to make sure that data sources don't require Typescript. (Doing so would be a huge onboarding problem within my team; it's not possible to just proclaim, "Okay, everyone needs to learn Typescript now!")

@corycook, you've got Typescript experience, right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.