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

CLI: use .hyper.js from repo root dir when running in dev mode #2792

Merged
merged 5 commits into from
Apr 20, 2018
Merged

CLI: use .hyper.js from repo root dir when running in dev mode #2792

merged 5 commits into from
Apr 20, 2018

Conversation

tool3
Copy link
Contributor

@tool3 tool3 commented Mar 28, 2018

Ready to be merged automatically.

I went with process.env.NODE_ENV because it is set automatically to 'production' when running in..well..production.

Thank you so much ! if I missed anything be sure to let me know please :)

1st contribution!

@tool3 tool3 mentioned this pull request Mar 28, 2018
@chabou
Copy link
Contributor

chabou commented Mar 28, 2018

Thank you for this first contribution 🙏

But some part must be modified:

We don't need a new config file. We need to have exactly same behavior with CLI than with Hyper. If it is in dev mode, it checks the existence of config file .hyper.js in repository root directory. If it exists, it uses this and not the one in user home directory

Copy link
Contributor

@chabou chabou left a comment

Choose a reason for hiding this comment

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

Remove new config file and use a potential one in repository root directory

@tool3 tool3 closed this Mar 28, 2018
@tool3 tool3 reopened this Mar 28, 2018
@tool3
Copy link
Contributor Author

tool3 commented Mar 28, 2018

oops... sorry about that 👼 ..please see latest commit

@tool3 tool3 changed the title added .hyper-dev.js when running in dev mode use .hyper.js from root dir when running in dev mode Mar 28, 2018
@chabou chabou added this to the 2.1.0 milestone Mar 28, 2018
Copy link
Contributor

@chabou chabou left a comment

Choose a reason for hiding this comment

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

For now, it works when you execute cli.js in bin directory. But executing: node bin/cli.js doesn't work, due to relative path usage

cli/api.js Outdated
@@ -5,7 +5,12 @@ const registryUrl = require('registry-url')();
const pify = require('pify');
const recast = require('recast');

const fileName = `${os.homedir()}/.hyper.js`;
const devConfigFileName = '../.hyper.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to resolve this path with something like __dirname. It should not be impacted by the current working directory.

@tool3
Copy link
Contributor Author

tool3 commented Mar 29, 2018

Used __dirname with path.join to be relative to the root directory. Please check 🤞

@chabou chabou changed the title use .hyper.js from root dir when running in dev mode CLI: use .hyper.js from repo root dir when running in dev mode Apr 20, 2018
@chabou chabou merged commit b5c221f into vercel:canary Apr 20, 2018
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.

2 participants