Giter Site home page Giter Site logo

roger's People

Contributors

edwinvdgraaf avatar flurin avatar hkrutzer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

roger's Issues

Simplify partial rendering

There are two issues with partial rendering:

  1. To pass variables you always have to use partial "XYZ", locals: { key: "value" }. That extra locals key is unnecessary.
  2. There are two ways to use locals within the partial. Directly using the locals[] Hash or by using the generated local variables based on the keys in the hash. One method should suffice.

Add plugin generator

Likewise the generator for generators, we should make a plugin generator, make it as seemless as possible to extract additional functionality into a gem.

release.getfiles also returns directories

In the Roger::Release::Injector class release.getfiles(@options[:into]) is called, see https://github.com/DigitPaint/roger/blob/master/lib/roger/release/injector.rb#L49. I've a mockup and In the mockupfile the injector is called to inject a banner into the pattern **/*.js,**/*.css.

The thing is in a certain mockup I've a JS library file placed at '/vendor/raf.js/raf.min.js', yes that's correct a folder named 'raf.js'. The injector tries to retrieve all the files with this pattern, by calling release.getfiles. This getfiles function uses the glob to get all files and it also founds the folder 'raf.js', because it's not checking/validating wether it's a file. (https://github.com/DigitPaint/roger/blob/master/lib/roger/release.rb#L206). So its missing a check to validate it collects only files at the function 'getfiles'. :)

Another solution could be to exclude the 'vendor' folder for the injector, but the injector doesn't support a exclude/skip array.

Verbose mode is ignored in roger test

Invoking roger test -v to get verbose mode, doesn't currently work.

$ bundle exec roger test -v
ERROR: "roger all" was called with arguments ["-v"]
Usage: "roger all"

Add roger command to show current version

Right now it's not possible to check which version of roger is used.
So we can execute the command bundle exec roger -v (or --version), and it will display the current version of roger that's used.

Front-Matter data merging in renderer is a bit naïve

Front-Matter data merging is a bit naïve; we just update the data hash everytime we encounter a new front-matter. As all templates are now created equal it means that you can now theoretically put front-matter in partials as well. But as long as you don't everything should work as before.

roger generate new PROJECT_DIR is not working

The flow 'Get started' is not currently working:

$ gem install roger
...
$ roger generate new example
/Users/joran/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:198:in `rescue in root': Could not locate Gemfile or .bundle/ directory (Bundler::GemfileNotFound)
    from /Users/joran/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:194:in `root'
    from /Users/joran/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:106:in `bundle_path'
    from /Users/joran/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:425:in `configure_gem_home_and_path'
    from /Users/joran/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:92:in `configure'
    from /Users/joran/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:153:in `definition'
    from /Users/joran/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:123:in `setup'
    from /Users/joran/.rvm/gems/ruby-2.2.2@global/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
    from /Users/joran/.rvm/gems/ruby-2.2.2@example/gems/roger-1.4.6/lib/roger/cli.rb:4:in `<top (required)>'
    from /Users/joran/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/joran/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/joran/.rvm/gems/ruby-2.2.2@example/gems/roger-1.4.6/bin/roger:3:in `<top (required)>'
    from /Users/joran/.rvm/gems/ruby-2.2.2@example/bin/roger:23:in `load'
    from /Users/joran/.rvm/gems/ruby-2.2.2@example/bin/roger:23:in `<main>'
    from /Users/joran/.rvm/gems/ruby-2.2.2@example/bin/ruby_executable_hooks:15:in `eval'
    from /Users/joran/.rvm/gems/ruby-2.2.2@example/bin/ruby_executable_hooks:15:in `<main>'

A workaround is the following:

$ echo "gem 'roger'" > Gemfile
$ roger generate new example

Apparently, there is a misplaced Gemfile check when creating a new project. This check can probably be removed.

Sass files getting processed by Tilt

This causes source mapping using external files to fail, because these files cannot be rendered separately nor should they be (the original source should be returned).

Binary files are passed through the renderer as well (unsure if this is a problem), e.g.:

00:59:10 roger.1 | Rendering template #<Pathname:something.jpg> ("/something.jpg")

I think we can either:

  1. Filter certain extensions here and not pass them to the template renderer
  2. Filter certain extensions inside the resolver to match no files
  3. Solve it in the libsass plugin by having it serve .scss files as well
  4. Unregister Sass from Tilt

Add ability to add layouts and partial via plugins

While this is already possible in the Mockupfile (see below), it should be able to append paths to this array in plugins.

mockup.project.partial_path = [mockup.project.path + "partials", mockup.project.path + "libs/website-shared/partials"]

Rethink changelog and documentation deliverables

The generation of documentation, TOC and changelog that are delivered are still depended on copy-paste from earlier projects. To ease the process, we should reconsider how we work with this. As an artefact of earlier mockup versions we still rely on injecting the changelog, we could leverage Tilt here for example. Currently we lack syntax highlighting for example. This is just an example however, I am interested in the problems people experience while using roger in their workflow.

For the moment I will focus my effort on creating a generate command for these _doc files, however feedback is very appreciated!

  • Make packages available via download #18
  • create generate command for _doc template
  • Syntax highlighting
  • TOC
  • html diffs?

Remove the extractor

It has been deprecated in favour of Template for a while now. Old project code should be updated.

Increase test coverage

These components have no tests yet:

  • injector
  • scm/git
  • finalizers/dir
  • mockupfile

These components need better/more tests:

  • release
  • finalizers/git_branch (add test for manually using find_git_remote)

Log as JSON

Sometimes the output of Roger needs to be parsed by other tooling. A commandline flag to get JSON logs instead of just standard logging would be nice.

Make register functions work consistently

Allow generator registration to pass a name for the generator just like all other register functions.

Check if all register functions have consistent signatures.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.