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

Subfolders to Dependencies #115

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

ishitamed19
Copy link

Requirements

Description of the Change

    1. lib/output/eval.js [5] : Fixed a typo you => *your
    1. lib/output/prefs.js [33]: Fixed a typo
    1. Changed the subfolders to dependencies using the given naming structure

screenshot 2019-01-22 at 6 21 19 pm

Benefits

Resolves issue #104

Possible Drawbacks

Multiple Views support

Copy link
Member

@prasadtalasila prasadtalasila left a comment

Choose a reason for hiding this comment

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

@ishitamed19
Thanks for a quick PR. The overall changes look good. I have a few suggestions.

  1. Is there a way to avoid repeating the defaultPrefPath in all the modules? What if we use the global technique?

  2. Please open a PR to dev branch from a feature branch. The recommended PR process is outlined here. The only modification to the given advice is not to squash your commits.

  3. The file permissions are being changed from 644 to 755. Since all of the files are interpreted by Node.js interpreter and the launch point controlled by npm via package.json, there is no advantage to having an executable permission to any of the files. Please keep the default file permissions at 644.

  4. You are using the complete file name for constructing the alias. Instead if you use only to directory level (say @input ---> cli/input), then we get two advantages:

    1. Less number of aliases
    2. Less number of directories in input/ and output/
    3. Fewer package.json files.
  5. version numbers for all aliases is looking tedious and repetitive. Please remove them.

@@ -1,5 +1,5 @@
const program = require('caporal');
const preferenceManager = require('../utils/preference-manager');
const preferenceManager = require('@utils/preference-manager');

Copy link
Member

Choose a reason for hiding this comment

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

If we use the globals technique, then
global.__defaultPrefPath = path.join(__dirname, '../../../../default-prefs.json');
statement can be placed here and removed from every where else.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This would be a good idea, sir. We can also read a json into the global scope.

"caporal": "^0.9.0",
"chalk": "^2.3.0",
"cli-spinner": "^0.2.8",
"cli-table": "^0.3.1",
"controller": "file:lib/controller",
Copy link
Member

Choose a reason for hiding this comment

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

how is this used?

Copy link
Author

Choose a reason for hiding this comment

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

It is a single dependency for all the files inside lib/controller folder. Will rename it to @controller for better readability

Copy link
Collaborator

Choose a reason for hiding this comment

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

To add to what @ishitamed19 said. Whenever we import the folder as a module directly, it takes index.js file as the entry point. Therefore, there is no need to add such a dependency on package.json.
That said, it would be recommended to have an alias such as @controller as we import the contents of the modulle in the tests.

@prasadtalasila
Copy link
Member

@mukkachaitanya Please review the PR. Also there is a build failure. It is good to resolve the failure in this PR itself.

@mukkachaitanya
Copy link
Collaborator

@mukkachaitanya Please review the PR. Also there is a build failure. It is good to resolve the failure in this PR itself.

Yes Sir. I am testing it out.

@prasadtalasila prasadtalasila changed the base branch from master to dev January 26, 2019 11:44
@prasadtalasila
Copy link
Member

@ishitamed19 Please rebase your code to the latest commit of the dev branch.

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

Successfully merging this pull request may close these issues.

3 participants