GithubHelp home page GithubHelp logo

gawkermedia / soy-grunt-task Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hitsthings/soy-grunt-task

0.0 59.0 0.0 50.34 MB

Grunt task to compile Soy / Closure Templates

Home Page: http://www.noiregrets.com

License: MIT License

JavaScript 97.86% Java 1.64% Batchfile 0.25% HTML 0.25%

soy-grunt-task's Introduction

soy-grunt-task

Grunt task to compile Soy / Closure Templates

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-soy

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-soy');

Configure the soy task in your initConfig call (everything is optional, these are the defaults):

grunt.initConfig({
    ...
    soy : {
    	myTargetName : {
	    	src: [ '**/*.soy' ],
	    	inputPrefix : '',
	    	outputPathFormat : 'public/{INPUT_DIRECTORY}/{INPUT_FILE_NAME}.js',
		    codeStyle : 'stringbuilder',
		    locales : [],
		    messageFilePathFormat : undefined,
		    shouldGenerateJsdoc : false,
		    shouldProvideRequireSoyNamespaces : false,
		    compileTimeGlobalsFile : undefined,
		    shouldGenerateGoogMsgDefs : false,
		    bidiGlobalDir : 0, //accepts 1 (ltr) or -1 (rtl)
		    
		    // Options missing from documentation
		    cssHandlingScheme : undefined, // 'literal', 'reference', 'goog'
		    googMsgsAreExternal : false,
		    isUsingIjData : undefined,
		    messagePluginModule : undefined, //full class reference
		    pluginModules: [], // array of full class reference strings.
		    shouldDeclareTopLevelNamespaces : undefined,
		    useGoogIsRtlForBidiGlobalDir : false,

		    // classpath with which to run the compiler. Used in conjunction with messagePluginModule and pluginModules
		    classpath : ''
    	}
	}
	...
});
  • src : an array of glob patterns for finding input files. matches standard GruntMultiTask syntax.
  • inputPrefix : your src patterns will be resolved against this. It will also be passed to the compiler such that the {INPUT_DIRECTORY} format variable is relative to inputPrefix
  • All other options are passed directly to the compiler - use [Closure Template docs][https://developers.google.com/closure/templates/docs/javascript_usage#compilation] and the jsSrcCompiler's help text as a reference for these options.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

0.2.0 - basic support - src, inputPrefix, and outputPathPrefix 0.3.0 - supports all compiler flags.

Roadmap

  • Include MsgExtractor support? Might be conflating two different tools...
  • Separate SoyToJsSrcCompiler.jar to reduce package size? Worth the added complexity to use grunt-soy?

License

Copyright (c) 2012 Adam Ahmed
Licensed under the MIT license.

soy-grunt-task's People

Contributors

balagez avatar treshugart avatar ostronom avatar

Watchers

Dustin Anderson avatar Robin Ting avatar Patrick avatar Gáspár Körtesi avatar Thomas Plunkett avatar Ben Regenspan avatar Chris Sprehe avatar Michael Butkovic avatar Ashton G. avatar David Judik avatar James Cloos avatar Sam Scherer avatar  avatar Péter Szász avatar Brandon Comerford avatar  avatar Jamie Levinson avatar Nehéz-Posony Ferenc avatar peter avatar eteleilles avatar Eric Mittelhammer avatar Gawker Operations Team Bot avatar Alexandre Thomas avatar gergely avatar Kyle Lucovsky avatar Adam Homolya avatar Margaret Taormina avatar Janos Hegymegi avatar Andras Szatmari avatar Csaba Schreiner avatar Dima avatar Justin avatar Tibor Botos avatar Kún Ákos avatar Kelly Monson avatar Ferenc Tóth avatar  avatar Jennifer Bruno avatar Mylo28 avatar  avatar Cameron Lowe avatar Kelly Bishop avatar  avatar  avatar  avatar Jessica avatar  avatar  avatar Nick Eckhart avatar Melissa Patterson avatar  avatar Gyorgy Bokros avatar  avatar Levente Molnar avatar  avatar Grace Robertson avatar Michelle avatar Tyler Alicea avatar  avatar

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.