graphql-boilerplates / graphql-boilerplate-install

5 stars 2 forks source link

How can I test local changes to the install flow? #10

Open marktani opened 6 years ago

marktani commented 6 years ago

For example, right now I want to add a new folder: string parameter to the deploy command, for the react-fullstack-graphql-basic boilerplate:

- export async function deploy(silent: boolean) {
+ export async function deploy(silent: boolean, folder = '') {
  const options = { stdio: silent ? 'pipe' : 'inherit' }

- return spawn('graphcool', [`deploy`], options)
+ return spawn('graphcool', [`deploy ${folder}`], options)
    .then(res => {
      if (!silent) {
        console.log(res)
      }
    })
    .catch(err => console.error(err))
}

but before pushing I'd like to actually test that this does what I want 🙂

I know that I can use yarn link usually, but I typically invoke this install flow using graphql create, which doesn't use my local dependency 🤔

kbrandwijk commented 6 years ago

That's a bit tricky right now. What you could do is run graphql create with the currently broken --no-install (oops...), link your local boilerplate-install version in the .install folder, then create a small test script that calls .install\index.js. Because --no-install was not added correctly, the only alternative is to break the create command while it's install dependencies.