-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
chore: bumping tabtab to 2.2.2 #595
Conversation
Folks, I can't simulate this issue on Travis-CI locally, the tests are passing for me. Could you take a look at that, please? NodeJS: |
c8f1760
to
91ae562
Compare
@willmendesneto Thanks for dealing with this issue. I really appreciate that. 👍 |
@mklabs My pleasure, mate. Do you know if the is there any system dependency that we need to install in this new version? |
12c7c0c
to
91ae562
Compare
@willmendesneto I don't think so. But maybe Travis prevents tabtab from touching files like |
@willmendesneto I'm available right now if you'd like to talk about this issue, if you can have a call I can hangout maybe. |
I forked your fork @willmendesneto Trying to run these tests on Windows 10 (git bash on windows) and got an error. |
8f3fd69
to
2dbae58
Compare
@mklabs If you don't mind, can we try that tomorrow? These tests are passing locally, but they're not passing on Travis-CI. I'm suspecting that can be related to some OS dependency that are not installed on Travis-CI agent. The problem is that I can't check that running on debug mode. In the meantime, that will be great if you can check the changes between the versions |
@willmendesneto No worries, we can do that tomorrow. Meanwhile, I'm trying to run them on Windows. I may open up a pull request on your repository to test out Travis. Have a great day or night ^^ |
After hours fighting against git bash and npm links, I finally managed to reproduce the error locally (with Bash on Windows). There is indeed an issue I can't figure out right now. I'll take a close look tomorrow. |
I'm still not sure what to do exactly, but it seems like we can't use both package.json completion and event emitter in https://github.com/willmendesneto/yo/blob/bumping-tabtab/lib/completion/index.js#L16 If I comment out this line, I get completion results based on package.json file. cmd: DEBUG="tabtab*" COMP_POINT="4" COMP_LINE="yo " COMP_CWORD="1" node /mnt/c/Users/mk/dev/yo/lib/completion/index.js completion -- yo
error null
OUTPUT -f
--force
--version
--no-color
--no-insight
--insight
--generators
STDERR Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete handle: options {"name":"yo","cache":true,"ttl":300000}
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete handle: env {"args":["completion","--","yo"],"complete":true,"words":1,"point":4,"line":"yo ","partial":"yo ","last":"","lastPartial":"","prev":"yo"}
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete handle: env.line yo
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete complete package {"args":["completion","--","yo"],"complete":true,"words":1,"point":4,"line":"yo ","partial":"yo ","last":"","lastPartial":"","prev":"yo"}
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete TEST Received ["-f","--force","--version","--no-color","--no-insight","--insight","--generators"]
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete completion item -f string
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete completion item --force string
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete completion item --version string
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete completion item --no-color string
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete completion item --no-insight string
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete completion item --insight string
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete completion item --generators string
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete TEST results ["-f","--force","--version","--no-color","--no-insight","--insight","--generators"]
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete results: ["-f","--force","--version","--no-color","--no-insight","--insight","--generators"] {"args":["completion","--","yo"],"complete":true,"words":1,"point":4,"
line":"yo ","partial":"yo ","last":"","lastPartial":"","prev":"yo"}
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete Sendind events yo
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete With env {"args":["completion","--","yo"],"complete":true,"words":1,"point":4,"line":"yo ","partial":"yo ","last":"","lastPartial":"","prev":"yo"}
Tue, 17 Jul 2018 14:06:39 GMT tabtab:complete Emit event (yo)
✓ Returns the completion candidates for both options and installed generators (1717ms) I need more time working on this, but I feel like those completion results should be handled in the completer file instead of in package.json |
Related pull request on @willmendesneto repository: willmendesneto#1 |
2dbae58
to
9c2a056
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
.travis.yml
Outdated
- npm install -s --no-progress | ||
before_script: | ||
- npm run tabtab-install | ||
- source /home/travis/.bashrc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell (now that I worked a bit on this, sorry for my previous answers), and unless I didn't understood the expected installation step, I'm not sure you need this anymore. It'll be done by yo completion
and up to the user to choose when and how to setup the bridge in its bashrc (or zshrc, or fish config).
The tests don't really test the autocompletion but the actual output of yo-completer (on yo completion -- yo <command or options>
)
lib/cli.js
Outdated
name: 'yo', | ||
completer: 'yo-complete' | ||
completer: 'yo-complete', | ||
cache: !process.env.YO_TEST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache was a nightmare to test and to prone for errors, I decided to remove this feature in the upcoming tabtab version
package.json
Outdated
@@ -19,6 +19,7 @@ | |||
"postupdate": "yodoctor", | |||
"pretest": "xo", | |||
"test": "nyc mocha --timeout=10000", | |||
"tabtab-install": "tabtab install --auto --name yo --completer yo-complete", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user is intended to use yo completion
command to install the completion mechanism, I think this is not needed anymore.
@@ -64,7 +65,7 @@ | |||
"root-check": "^1.0.0", | |||
"sort-on": "^3.0.0", | |||
"string-length": "^2.0.0", | |||
"tabtab": "^1.3.2", | |||
"tabtab": "^2.2.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As soon as it's ready (probably this weekend), it'll need to be bumped to ^3.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, we'll hold off merging until then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me 👍 I want to take a little bit more time. I won't be able to work much more this weekend, and I want to take time with Wilson to coordinate our efforts. Thanks @SBoudrias
test/completion.js
Outdated
@@ -29,28 +29,26 @@ describe('Completion', () => { | |||
}); | |||
|
|||
describe('Test completion STDOUT output', () => { | |||
it('Returns the completion candidates for both options and installed generators', done => { | |||
it.only('Returns the completion candidates for both options and installed generators', () => { | |||
const yocomplete = path.join(__dirname, '../lib/completion/index.js'); | |||
const yo = path.join(__dirname, '../lib/cli'); | |||
|
|||
let cmd = 'export cmd="yo" && YO_TEST=true DEBUG="tabtab*" COMP_POINT="4" COMP_LINE="$cmd" COMP_CWORD="$cmd"'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you probably need to add a space at the end of the line, otherwise the cmd will look like something along these lines:
... COMP_CWORD="$cmd"node ...
test/completion.js
Outdated
return; | ||
exec(cmd, (error, out, stderr) => { | ||
console.log('stdout: ', out); | ||
console.log('stderr: ', stderr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing and logging stderr here indeed helps a ton, you might get debugging statement this way.
Closing this pull request since it needs more time to apply some changes on |
Purpose of this pull request?
What changes did you make?
Upgrade
tabtab
to v2 and, since thedefault
the old method was deprecated, some code changes were applied to support this version.Is there anything you'd like reviewers to focus on?
Refers to #508
Ping @SBoudrias @mischah @mklabs @sindresorhus