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

respect lineman config files.browserify.entrypoint #13

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

jasonkarns
Copy link
Member

implementation for #12

items for discussion:

  • we are unable to generate a default entrypoint file if the configuration has been customized, but the file doesn't already exist. it was mentioned that we just use grunt.file.expand, but that only expands patterns to an array of files that already exist. It does nothing to give is a potential filename that would match the pattern, but doesn't already exist. so instead we just emit a warning/error message
  • now emits a console message for the noop state. (entrypoint exists, nothing to do) this at least explains what the postinstall script is doing/was supposed to do
  • now uses grunt's api for logging to console in order to get colorized output: (green when creating the default entrypoint file; red when the configuration has been modified but entrypoint file doesn't exist; no color for the noop message)
  • we use substack/node-chdir to change to the project root directory for the duration of the postinstall script. ensures that cwd is restored at the end. (removes the need for path.joins everywhere)
  • currently using mgutz/execSync to run the lineman config command synchronously. this could be refactored to use node core child_process asynchronously
  • there is currently no error handling around the lineman config system call. this needs added

@iamjochem
Copy link

any chance this is going to be merged ... having this module write an entrypoint.coffee every time it is installed is breaking stuff (in my case I don't use coffee files, and there is an automated build system that does npm install; lineman build)

maybe the file creation should only be triggered by lineman init ?

it is also worth considering that a bit of documentation might beat trying to 'do the right thing' with regards to creating a default entrypoint file ...

maybe the default entrypoint file should only be created if the js dir is empty? (and otherwise just output a message saying something along the lines of "please define your entrypoint file in your lineman config.")

@searls
Copy link
Member

searls commented Apr 15, 2014

@jasonkarns is this ready to merge?

@iamjochem
Copy link

thought I'd mention that the lineman-less plugin suffers from the same problem with regard to dumping an unwanted main.less into an existing project (I happened to have configured my main less file as 'style.less')

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