Giter Club home page Giter Club logo

fork-blueprints's Introduction

fork-blueprints*

Ember CLI doesn't provide the ability to --skip-test or upon each generator instance specify a --test-type=(acceptance|integration|unit). The goal of this addon is to facilitate, along with traditional blueprints, those types of customizations. Combining that with adept usage of pods, and you should be able to be 100% in control of your default file structure.

This addon currently just copies/forks any (legacy) ember blueprints into your app's blueprint folder.

Installing (local/pre-npm)

  • git clone <repository-url> this repository
  • cd fork-blueprints
  • npm install
  • npm link
  • cd ../my-app
  • npm link fork-blueprints

Disable default, but access later

You may want to disable default tests for a route, but have the option to generate them later. By forking the route-test blueprint, renaming it, and overriding the default, we can do just that.

  • ember g fork-blueprints route-test
  • mv blueprints/route-test blueprints/route-test-legacy
  • ember g blueprint route-test

Now you can access the default route-test generator with ember g route-test-legacy myRoute.

Change default test types

If you want to generate an acceptance test that corresponds to the generated route:

  • ember g fork-blueprints acceptance-test
  • mv blueprints/acceptance-test blueprints/route-test

Because the acceptance test relies on a relative module, we bring that along as well:

  • cp node_modules/ember-cli-legacy-blueprints/blueprints/test-framework-detector.js blueprints/

Now, running ember g route login will create your route, template, and an acceptance test named "login".

Other Thoughts ๐Ÿšฟ

  • This assumes you still use --pod or .ember-cli to manage your preferred file structure, but you can of course change the structure in a forked blueprint.
  • Forking entire blueprints is less than ideal in terms of maintainance upstream, but my attempt to use symlinks have not worked so far. Hope to have a better solution to the maintenance aspect eventually.

Please submit issues with any suggestions about what you think this could/should (or should not) be :)

*does not yet have a cool name

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.