Giter Club home page Giter Club logo

generator-buildabanner's Introduction

generator-buildabanner

This is a Yeoman generator to get a starter standard, AdWords, Sizmek or DoubleClick banner scaffolded out quickly.

2.1.0 and later adds Docker comptatibilty

The 2.1.0) version of Build A Banner is nearly identical to version 2.0.15 except that has had modifications to make it work inside a Docker container. See https://hub.docker.com/r/johnfmorton/yo-buildabanner for more information about using Build A Banner in Docker.

  1. I've removed the "gulp-notify" plugin since when run within a Docker container, those messages were not reaching the host operating system. The messages that were generated in a notification now happen in the console.
  2. Attempting to open the browser window when running the gulp command would cause an error when Build A Banner was running in a container so that has been removed. You now must open your browswer window manually.
  3. Lastly, to allow the Docker container to expose the dev server's port, the host has changed from "localhost" to "0.0.0.0".

Version 2

After 37 releases, Build A Banner has jumped to the 2.0 version. There was never a version 1 in all the previous 37 releases. It had always been version 0 although at some point it should have graduated to version 1. It just didn't happen.

In the Version 2, the Yeoman generator has been rewritten. It has moved to Gulp 4. How you use BAB should remain basically the same though. There have been a lot of updating of the tools behind the scenes to keep current.

Let me show you how this works.

Click the image for a video walk through.

Video Walk Thru

Notes

This is an evolving work in progress. I refine it as I discover better processes. It is an opinionated workflow to speed the production of building a banner. It includes options for HTML banners for standard, AdWords, or DoubleClick HTML banners.

Basic usage

You may install this Yeoman workflow through npm.

npm install -g generator-buildabanner

You may also link this workflow locally into your own NPM installation using npm link when you are in the generator-buildabanner directory from within your terminal.

To get started use yo buildabanner and answer the prompts.

gulp commands

gulp : This is the most basic command. It will spin up a server in your 'dev' folder. It will compile your SCSS into CSS. It will also watch for changes in the index.html, scripts.js and style.scss files and reload Google Chrome.

gulp check : This command is useful to check for some basic consistency in your banner. It will confirm that the metadata ad.size matches the size of your backup image. It also checks to see if you have a single image in the backImage directory.

gulp build : This command will create a 'dist' folder and fill it with minified versions of your files. It will also compress these same files into a zip file in the 'delivery' folder. NOTE: If you've used files starting with "comp", like "comp1.png" or "comp2.jpg", which can be used for positioning elements in your banner, they will not be included in your 'dist' folder. This is important to know if you happen to have a file called "competition.jpg" in your banner build because it will excluded.

gulp archive : This command will create an 'archive' folder and a single zip file that contains the contents of your dev, dist and delivery directories plus your package.json, gulpfile.js and your Sublime Text project file. These are the necessary files to archive your banner once it is finished. (Your node_modules directory can be recreated later with npm install.)

gulp ba : This is a shortcut for running check, build, archive in sequence.

gulp man : Will provide info on the available comands.

About offline usage

The workflow offers to download a copy of the Greensock library for off-line use. Since Greensock is offered via npm, it will be placed in the 'node_modules' folder.

Working on a DoubleClick banner requires that you have an Internet connection to load the Enabler.js. The workflow offers to download a copy of the Enabler.js. If you choose to do this, it places a copy of Enabler.js in a folder called "offline". (This option is only present if you choose to build a DoubleClick banner.)

Both of these prompts for offline use default to "yes". The downloaded code is not referenced in the HTML though. You will need to manually update the HTML to load them. I've included the download of these files because I sometimes find that I need to work on these projects when having a stable Internet connection isn't possible. Having the files downloaded into my project is a failsafe for those situations.

Roadmap

Below are some goal posts for the future of this workflow.

  1. I plan on adding an option to inline the CSS and JS into the main index.html file.

Tips

Be sure to check out the gulp check command. If you make resizes by duplicating a banner’s folder the metadata ad.size value is easy to overlook and this will help you catch that error. That's what prompted the creation of that command.

But it doesn't work

Be sure you have the latest Gulp command line interface installed. See the gulp-cli homepage.

npm install gulp-cli -g

You may also need to update your Yeoman installation as well.

License

MIT

generator-buildabanner's People

Contributors

dependabot[bot] avatar jeffreybarke avatar johnfmorton avatar nada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generator-buildabanner's Issues

Error: Task ba requires a function that is a function

Love this build by the way...

On line 200 of the gulpfile I keep getting this error that says:
Error: Task ba requires a function that is a function

I've remedied it by simplifying the injection like so
gulp.task('ba', ['build', 'archive']);

I'm unsure what the intended functionality is but I hope this helps anyone having this issue.

Builds are throwing error - not happened before

Mac osX Mojave
node via NVM: lts/dubnium - v10.17.0 - OR - lts/erbium -> v12.13.0`
npm: 6.13.0

I'm unable to fully run yo buildabanner due to the following error. This is a recent issue, I have been able to build previously on the same mac:

events.js:187
throw er; // Unhandled 'error' event
^

TypeError: Download is not a constructor
at module.exports.writing (/Users/myusername/.nvm/versions/node/v12.13.0/lib/node_modules/generator-buildabanner/generators/app/index.js:313:13)
at Object. (/Users/myusername/.nvm/versions/node/v12.13.0/lib/node_modules/generator-buildabanner/node_modules/yeoman-generator/lib/index.js:424:27)
at /Users/myusername/.nvm/versions/node/v12.13.0/lib/node_modules/generator-buildabanner/node_modules/run-async/index.js:25:25
at new Promise ()
at /Users/myusername/.nvm/versions/node/v12.13.0/lib/node_modules/generator-buildabanner/node_modules/run-async/index.js:24:19
at /Users/myusername/.nvm/versions/node/v12.13.0/lib/node_modules/generator-buildabanner/node_modules/yeoman-generator/lib/index.js:425:13
at processImmediate (internal/timers.js:439:21)
Emitted 'error' event on Generator instance at:
at Immediate. (/Users/myusername/.nvm/versions/node/v12.13.0/lib/node_modules/generator-buildabanner/node_modules/yeoman-generator/lib/index.js:433:22)
at processImmediate (internal/timers.js:439:21)

Issue with async loading of CSS

Hi, I've developed a banner using the DoubleClick template and in testing of the banner we ran into a very strange issue with our animations (using tweenmax), sometimes (1/5 of the time for argument sake) in sandbox testing, the animation would lose it's baring and incorrectly calculate positions of elements - not calculating top and bottom positions correctly. After hours and hours of attempting 5-10 completely different approaches to the CSS and animation I found that nothing would have any impact on the issue whatsoever.

In the end the solution was to remove the async loading of style.css and switched back to a traditional LINK REL tag to reference the css.

It's worth noting that this issue never shows up during local development, even when simulating throttling. We are not using offline mode FYI.

Add a template .gitignore

Similar to the template .editorconfig and .jshintrc, I think this would be a nice template file to have.

Update: I wanted to label this Enhancement, but I guess you have to be a contributor to do that.

Fix failing unit test

The buildabanner:app creates files: test fails because the test is looking for a bower.json file that is not (and no longer should) be created.

The fix will be to no longer look for that file. I'll have a PR for this shortly.

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.