Giter Club home page Giter Club logo

butane's People

Contributors

aputinski avatar bendrucker avatar chinedufn avatar

Stargazers

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

Watchers

 avatar

butane's Issues

Error when running butane

I installed 2.0.4 and am getting the following error:

D:\temp> npm install -g butane
C:\Users\Mike2\AppData\Roaming\npm\butane -> C:\Users\Mike2\AppData\Roaming\npm\node_modules\butane\bin\butane.js
[email protected] C:\Users\Mike2\AppData\Roaming\npm\node_modules\butane
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
└── [email protected]
D:\temp> butane rules.yaml rules.json

module.js:340
throw err;
^
Error: Cannot find module 'require-relative-main'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:\Users\Mike2\AppData\Roaming\npm\node_modules\butane\bin\butane.js:3:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

Add convertString function?

It'd be great if we could have a convertString function that just takes a YAML string and returns the JSON string!

Functions behave unusually with conditionals

To me, it would seem that this...

.functions:
  isAuthed(): (auth !== null || auth.One)
  isOther(): (auth.Two || auth.Three) 
rules:
  .read: isAuthed() && isOther()'

... would evaluate to...

.read: "(auth !== null || auth.One) && (auth.Two || auth.Three)

... but it evaluates to...

.read: "auth !== null || auth.One && auth.Two || auth.Three"

... which has different results, however...

.read: (isAuthed()) && (isOther())

...does compile as expected. I think you could automatically wrap all function calls in parenthesis that way these logic issues are avoided. Thoughts?

Error when running butane

When running butane (v2.0.3) I am receiving the following error:

D:\temp> butane rules.yaml rules.json

module.js:340
throw err;
^
Error: Cannot find module 'babel-runtime/helpers/sliced-to-array'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:\Users\Mike2\AppData\Roaming\npm\node_modules\butane\dist\cli.js:3:22)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Use of replace function not generating .val()

This yaml:

root.users[next].email.replace('.', ',')

produces this:

root.child('users').child(newData.val()).child('email').replace('.', ',')

when it should .val() the ss before the replace:

root.child('users').child(newData.val()).child('email').val().replace('.', ',')

workaround is to explicitly include the .val() in the butane yaml

No error when using an unspecified function

Butane does not warn you when you attempt to use an undefined function. This seems error prone.

Current behavior

Input

.read: isWorker() # isWorker is not defined

Output

".read": "isWorker()"

Maybe throw an error here?

Support .indexOn

It would be nice to place .indexOn rules next to .read/.write/.validate rules. Currently I have to manually edit the generated JSON.

Error when running butane

I installed 2.0.4 and am getting the following error:

D:\temp> npm install -g butane
C:\Users\Mike2\AppData\Roaming\npm\butane -> C:\Users\Mike2\AppData\Roaming\npm\node_modules\butane\bin\butane.js
[email protected] C:\Users\Mike2\AppData\Roaming\npm\node_modules\butane
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected]
└── [email protected]
D:\temp> butane rules.yaml rules.json

module.js:340
throw err;
^
Error: Cannot find module 'require-relative-main'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:\Users\Mike2\AppData\Roaming\npm\node_modules\butane\bin\butane.js:3:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

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.