Code Monkey home page Code Monkey logo

grunt-shared-config's Introduction

grunt-shared-config's People

Contributors

awirick avatar barraq avatar benib avatar ceee avatar danielkcz avatar jonespen avatar lucalanca avatar meodai avatar roboshoes 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

Watchers

 avatar  avatar  avatar  avatar

grunt-shared-config's Issues

Namespace variables

Hi

Maybe I've missed it, but for now it seems to be impossible to namespace variable.

It would be great to use options.name or additional options value for that purpose, so in result we could get instead of

$car-blue: blue;
$car-red: red;

namespaced variables, like:

$myJSON-car-blue: blue;
$myJSON-car-red: red;

Unquoted strings in Sass maps

Hi

First of all, thanks for great product!

It seems that Sass maps generation has some issues due to lack of quotes.

For example, following generated Sass map will through an error:

$grunt-data: (
    site: (
        lang: en,
        name: Kotsu,
        title: Clean, opinionated foundation for new projects โ€” to boldly go where no man has gone before,
        version: 0.5.3
    )
);
Error: Invalid CSS after "...has gone before": expected ":", was ","
        on line 5 of C:\Working\Kotsu\temp\styles\config.scss
        from line 34 of source/styles/style.scss

Output format of arrays in Sass maps

getStyleSafeValue doesn't produce the expected output for arrays when output to the value of a key in a Sass map

Consider this source data:

// with options.name = 'grids' & options.useSassMaps = true
{
    "base": {
        "gutter": 15,
        "columns": 12,
        "output": [ 2, 10, 12 ]
    }
};

This currently results in the Sass output:

$grids: (
    base: (
        gutter: 15,
        columns: 12,
        output: 2,10,12
    )
);

This will cause a parse error in Sass, as , is used both as a list separator, and to denote the end of a map key's value.

The expected output would wrap list/array output in parens to avoid this ambiguity:

$grids: (
    base: (
        gutter: 15,
        columns: 12,
        output: (2,10,12)
    )
);

Happy to take a crack at this one if a PR would be considered, but #25 suggests you're looking refactoring getStyleSafeValue anyway, so thought I'd open an issue first.

Pretty print Sass Maps

Sass Maps are currently produced in an almost minified manner. Since the JS formats are printed in formatted style, so should the sass maps.

Strings translate to null in JavaScript output

When using a string as a value in the src JSON file,

{ "key": "value" }

the string "value" will be output as null in the generated javascript file.

define( function() { return { "key": null } });

Can the script be updated to correctly translate strings to the javascript output?

Extend to support wildcard src / dest

I think it would be great to be able to specify wildcards in source/destination:

src: "config/*.yml",
   dest: [
      "styles/config/*.sass",
      "scripts/config/*.json"
   ]

The expected behaviour would be that for each yml file, a sass and json file (with the same name) would be created as well.

What do you think?

Remove a dep.

You can remove a dep, mout, if you wanted as your usage is covered by grunt.util._ and grunt.util._.str. If you're interested I can do a PR.

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.