-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Update CLI and API #50
Conversation
Added a commit to remove the |
Two questions have to be answered before we can land this.
I vote for |
Thanks @bclinkinbeard! I'm happy to switch over to opting in to For minifying - I'd like to keep that opt-out for the build step. One thing that Idyll does now that I'd like to keep is to default to best-practices unless you explicitly opt out of them. I'd also vote to keep the option named as |
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.
Looks much cleaner! I'm going to do a bit of testing locally
src/index.js
Outdated
const getPath = getPathFactory(inputDir); | ||
const inputPkg = require(getPath('package.json')); | ||
const inputCfg = (inputPkg.idyll || {components: {}}); | ||
for (let key in inputCfg.components) { |
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.
Small style thing - can we keep things like inputCfg
spelled out like inputConfig
, this makes the code more friendly and readable.
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.
Yep, will fix that
bin/idyll.js
Outdated
|
||
idyll(path.resolve(argv._[0]), options); |
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.
I added this path.resolve
in to resolve some weird bug when using idyll linked locally. Will test this to make sure everything still works.
bin/idyll.js
Outdated
.describe('theme', 'Name of (or path to) the theme to use') | ||
.default('theme', 'idyll') | ||
.alias('h', 'help') | ||
.argv; |
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.
👍 so much cleaner
We'll need to update the project generator too to match this |
I'm getting some weird behavior locally - This is running the script with idyll linked locally:
|
Hmm, I admittedly use Regarding the CLI, you want to minify by default and turn it off with |
Or maybe |
👍 |
All issues addressed, except the |
Implements the changes discussed in #40.
Also includes a good amount of path code cleanup. I think it's a good idea to centralize and quarantine the code that deals with paths as much as possible. The CLI doesn't do anything with paths now, its sole responsibility is providing and documenting the CLI API. It doesn't do anything besides passing the options to the JS function.
This also brings all of the various ways to specify options into harmony by way of matching names. Options specified on the command line and/or passed in the options object to the function override options specified in package.json override default options. See the
alias
method in the bin file for a list of option names that is easy to read and review.