Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a location for informal discussion? #269

Closed
Etherian opened this issue Apr 10, 2017 · 10 comments
Closed

Is there a location for informal discussion? #269

Etherian opened this issue Apr 10, 2017 · 10 comments
Labels

Comments

@Etherian
Copy link

Is there a location, such as an IRC channel, for discussion of Fly difficulties or issues that are not significant enough to warrant a Github Issue? If so, it would be helpful to mention it in the README; if not, it might be worthwhile to create one.

@lukeed
Copy link
Owner

lukeed commented Apr 10, 2017

Technically, there is a slack, but we've never really used it. Github issues are fine for questions. 👍

@Etherian
Copy link
Author

Thank you for your rapid reply! I'll open another issue with my question unless you would prefer I ask here.

@lukeed
Copy link
Owner

lukeed commented Apr 10, 2017

No problem -- whichever you prefer 😉

@Etherian
Copy link
Author

Etherian commented Apr 11, 2017

Alright. Here, then. 😊 I have a couple questions:

  1. When I have a folder that is empty or containing only dotfiles (which I assume Fly ignores?) in the source location, the folder is copied into the target location as a file with the text 'null' in it. Is this expected behavior?

  2. When I run the copyFiles task in this flyfile in my project, the files mentioned in extraJS (vendor files in node_modules) do not copy. And when I run the release task, a folder named release is not created and the contents of the draft folder are not copied. Any idea what I'm doing wrong?

Oh, and I am trying to build on Windows 7 x64, if that matters.

@lukeed
Copy link
Owner

lukeed commented Apr 11, 2017

  1. You have to specify dot:true in your fly.source options. It's a node-glob built-in behavior.

  2. The extraJS won't copy because node_modules is not inside src/**/* (srcPath).

Also, you're better off changing your globs from foo/**/* to foo/**/*.* or foo/**. This should fix your release task & likely iron out some other issues you're having.

@Etherian
Copy link
Author

Etherian commented Apr 11, 2017

Thank you for your help. Changing my globs from foo/**/* to foo/** did not persuade the files and folders to copy in the copyFiles and release tasks, but pulling the misbehaving lines into their own tasks did!

To clarify,

export async function copyFiles(fly) {
  await fly.source(`${srcPath}/**`, {
            ignore: [...jsGlobPatterns, ...cssGlobPatterns, ...htmlGlobPatterns]
          })
          .target(draftPath)

  //FIXME: This line fails to copy anything
  await fly.source(extraJS).target(`${draftPath}/js`)
}

became

export async function copyFiles(fly) {
  await fly.source(`${srcPath}/**`, {
            ignore: [...jsGlobPatterns, ...cssGlobPatterns, ...htmlGlobPatterns]
          })
          .target(draftPath)

  // This works!
  await fly.start('copyExtraJS')
}

export async function copyExtraJS(fly) {
  await fly.source(extraJS).target(`${draftPath}/js`)
}

So, if I understand your response and this behavior, source location(s) can only be set once per task. Further calls to source do not change the source location(s). Is that right?

If that is the case, I do have one other question: why was release (below) also fixed by having its fly.source(...).target(...) line pulled into a separate task? The non-functioning version only contains the one call to source.

export async function release(fly) {
  await fly.clear(draftPath)
  await fly.start('build')
  await fly.start('test')

  await fly.start('cleanRelease')
  //FIXME: This line fails to copy anything
  await fly.source(`${draftPath}/**`).target(releasePath)
}

became

export async function release(fly) {
  await fly.clear(draftPath)
  await fly.start('build')
  await fly.start('test')

  await fly.start('cleanRelease')
  // works now
  await fly.start('copyToRelease')
}

export async function copyToRelease(fly) {
  await fly.source(`${draftPath}/**`).target(releasePath)
}

@lukeed
Copy link
Owner

lukeed commented Apr 11, 2017

Hmm.. I just cloned your current repo & ran each task individually as is -- works fine for me on my Mac. Unfortunately I'm on the road right now & don't have access to a Windows machine.

Strange though -- we run all our tests on Window too (automatically) & they pass.

/cc @hzlmn Are you still running that Windows VM? Do you mind checking out the project (commit) & seeing what's happening?

Thanks!

@lukeed
Copy link
Owner

lukeed commented Apr 11, 2017

@Etherian I find it odd that nothing happens.

But yes, there is a confirmed bug here. Unfortunately there's an inconsistency in "sourcing" after starting tasks from inside other tasks. (See also taskrjs/fly-ava#13.)

Generally though, regardless of the bug, a Task should encapsulate a single action & then you chain them together (as serial or parallel) in "parent" Tasks.

You pretty much discovered this with your latest edits. I'd clean it up further by:

export async function clean(fly) {
  await fly.clear([draftPath, releasePath])
}

export async function release(fly) {
  await fly.start('clean').parallel(['build', 'test', 'copyRelease'])
}

@Etherian
Copy link
Author

Etherian commented Apr 11, 2017

It is odd, isn't it? Yet, those two lines consistently did not copy anything. At one point, I considered that it would be helpful to peek into the data moving between operations. That might be a good idea for a plugin.

Anyway, thank you again for your help. 😄 I can easily work around the trouble now.

@jorgebucaran
Copy link
Contributor

@Etherian Is there a location, such as an IRC channel, for discussion of Fly difficulties or issues that are not significant enough to warrant a Github Issue?

Nope. But issues are welcome any time. I may consider revamping the Slack channel in the future though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants