FirebaseExtended / bolt

Bolt Compiler (Firebase Security and Modeling)
Apache License 2.0
896 stars 108 forks source link

Type imports #208

Open brewsoftware opened 6 years ago

brewsoftware commented 6 years ago

The following PR is designed to allow for splitting bolt rule definitions into multiple files. This should enable a few extra features in the bolt ecosystem including:

This has been requested by the community for some time (https://github.com/firebase/bolt/issues/63) and this is a second re-write of the original gulp-firebase-bolt plugin with a more ES6 spec. It is a complete end-to-end integration covering the parse & compiler.

I have explicitly left functions and paths out of this release as I'm running out of time to implement all of that. Not withstanding this there is value in the PR as is.

Example usages include:

import from './module' // import everything from sub module. import as types from './module' // import everything under the 'types' namespace import {Foo} from './module' // only import specific types import * from 'module' // global imports

type Bar is Foo {

}

Example usages include:

import from './module' // import everything from sub module. import as types from './module' // import everything under the 'types' namespace import {Foo} from './module' // only import specific types import * from 'module' // global imports

type Bar is Foo {

}

Documentation has been updated to include the new spec, tests should be parsing and a sample has been added. An additional fix to the master branch has been cherry picked from https://github.com/firebase/bolt/pull/209

Comments are welcome:

Cheers, Jason Brew Software.

ThadeuLuz commented 6 years ago

Please guys merge this. My current workflow concatenates files :/

wcandillon commented 6 years ago

I could really use this feature as well