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

Moves spinner and logError to utils #140

Merged
merged 3 commits into from Apr 25, 2018
Merged

Moves spinner and logError to utils #140

merged 3 commits into from Apr 25, 2018

Conversation

campionfellin
Copy link
Collaborator

Continuing work on #133

Signed-off-by: campionfellin campionfellin@gmail.com

  • npm run test succeeds.
  • Appropriate changes to README are included in PR.

Signed-off-by: campionfellin <campionfellin@gmail.com>
src/utils.ts Outdated
@@ -5,6 +5,8 @@ const splitLines = require('split-lines');
import * as fs from 'fs';
const dotf = require('dotf');
const read = require('read-file');
import { Spinner } from 'cli-spinner';
import { ERROR } from '../index.js';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a huge fan of importing things into Utils from the main script. I'd rather have ERROR in src/utils.ts or in src/commands and import from there if needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is creating a cyclic dependency.

Please move the ERRORs into utils.

@coveralls
Copy link

coveralls commented Apr 25, 2018

Pull Request Test Coverage Report for Build 104

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • 297 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.09%) to 10.891%

Files with Coverage Reduction New Missed Lines %
src/utils.js 17 22.86%
index.js 280 6.95%
Totals Coverage Status
Change from base Build 103: 0.09%
Covered Lines: 103
Relevant Lines: 708

💛 - Coveralls

2 similar comments
@coveralls
Copy link

Pull Request Test Coverage Report for Build 104

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • 297 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.09%) to 10.891%

Files with Coverage Reduction New Missed Lines %
src/utils.js 17 22.86%
index.js 280 6.95%
Totals Coverage Status
Change from base Build 103: 0.09%
Covered Lines: 103
Relevant Lines: 708

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 104

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • 297 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.09%) to 10.891%

Files with Coverage Reduction New Missed Lines %
src/utils.js 17 22.86%
index.js 280 6.95%
Totals Coverage Status
Change from base Build 103: 0.09%
Covered Lines: 103
Relevant Lines: 708

💛 - Coveralls

Copy link
Contributor

@grant grant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather export LOG/ERROR in utils than index.
LGTM after addressing comments.

src/utils.ts Outdated
@@ -5,6 +5,8 @@ const splitLines = require('split-lines');
import * as fs from 'fs';
const dotf = require('dotf');
const read = require('read-file');
import { Spinner } from 'cli-spinner';
import { ERROR } from '../index.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is creating a cyclic dependency.

Please move the ERRORs into utils.

src/utils.ts Outdated
@@ -72,4 +74,32 @@ export const DOTFILE = {
// See `login`: Stores { accessToken, refreshToken }
RC: dotf(DOT.RC.DIR, DOT.RC.NAME),
RC_LOCAL: dotf(DOT.RC.LOCAL_DIR, DOT.RC.NAME),
};

// Utils
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove // Utils, the filename now indicates this.

index.ts Outdated
@@ -110,7 +109,7 @@ const LOG = {
};

// Error messages (some errors take required params)
const ERROR = {
export const ERROR = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not export ERROR in index.ts.
I think LOG and ERROR can be exported in utils.ts despite what I said earlier.

Signed-off-by: campionfellin <campionfellin@gmail.com>
@grant
Copy link
Contributor

grant commented Apr 25, 2018

Merge conflict.

@campionfellin
Copy link
Collaborator Author

Conflict resolved.

@grant grant merged commit d12ea1b into google:master Apr 25, 2018
@campionfellin campionfellin deleted the utils branch April 25, 2018 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants