Giter Club home page Giter Club logo

Comments (10)

kennethormandy avatar kennethormandy commented on July 3, 2024

I started on this, but I think I decided it’s beyond my abilities since it wouldn’t just be a preprocesor. It would have to support harp.cson, _data.cson, etc. But there are failing tests in that branch if someone else wants to take a crack at it.

from terraform.

sintaxi avatar sintaxi commented on July 3, 2024

I would hold off on CSON. I think HJSON suits our needs much better.

http://laktak.github.io/hjson/

from terraform.

sorahn avatar sorahn commented on July 3, 2024

@kennethormandy I got all the valid CSON tests passing in my branch. It doesn't support harp.cson yet, but wouldn't you simply be able to edit harp to use terraform to parse it's own config file? Hopefully this helps!

from terraform.

sorahn avatar sorahn commented on July 3, 2024

@sintaxi CSON is currently switching their parser (coffescript) for a static one (cson-safe). Is there any reason to not finish the CSON one and then add HJSON as a 'data' parser too? After that YAML could probably be plugged in as well. YAML isn't really a pre-processor.

from terraform.

kennethormandy avatar kennethormandy commented on July 3, 2024

Woah, looks promising! Failing tests 1–3 are because I thought CSON would need to error like the other preprocessors: by showing something in the browser. (This stuff happens in lib/javascript etc.)

I supposed you could argue that it should follow what JSON does right now and just fail and throw an error outright. In that case, those tests would need to be different. Otherwise, CSON would kind of need to be implemented in two places: once as a preprocessor and once for the _data.json files, etc.

The last failing test looks related to that. Because you can go examplefile.json.jade to output a JSON file, some part of this implementation is conflicting with that (I think exports.isDataFile is too aggressive)

I’m glad you’re working on this, we seem to have a pretty solid group of people who want whitespace significant everything. I’m definitely onboard, and personally I think adding comments or not breaking when JSON doesn’t have comments doesn’t conflict with adding CSON.

from terraform.

sorahn avatar sorahn commented on July 3, 2024

@kennethormandy OK, I'll probably be able to take another stab at this sometime later this weekend. Feel free to run with some of the work I did if you want to poke around some more.

I've got CSON in 2 places right now, where it's used for _data.json I'm just running it through the regular CSON parser, instead of the render function. Kind of a stop gap to just see if I could get it working. Ideally every parsed file could just be requested through the normal render.

Re: isDataFile, yeah, you're right, I'll clean that up to only match the extension.

from terraform.

valtido avatar valtido commented on July 3, 2024

@drbrts https://github.com/atom/season I think, this should be simple enough to read a file, then export it as .json. Hope it helps.

from terraform.

rwxrob avatar rwxrob commented on July 3, 2024

What's the state of this. I have a course catalog organized as an _data directory that currently I build into _data.json so that Harp serves it properly. Harp handles the .coffeescript and I wonder if building directly into a single .coffee would be better since it gets served up as a single .js file. The goal for me is to just save edits to the individual .cson files and have them be compiled, cached, etc automatically (without any db saves of course).

from terraform.

og2t avatar og2t commented on July 3, 2024

+1, since CSON is essentially CoffeeScript, it shouldn't be an issue? Or?

from terraform.

vbwx avatar vbwx commented on July 3, 2024

HJSON sounds like a great idea! I'll give it a try this weekend, I think.

from terraform.

Related Issues (20)

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.