Giter Site home page Giter Site logo

gen_editor's Introduction

GenEditor

gen_dsl integration with Kino for Livebook. It contains a collection of Smart Cells for configuring and executing Phoenix project templates in terms of code generation Mix Tasks.

Phoenix mix phx.gen commands are powerful but uncomfortable. They are repetitive, error-prone, lack good in-terminal documentation and don't lend themselves to an iterative design process. With GenEditor you can bring them into Livebook and enjoy its benefits (ease of documentation, suitable for version control, collaborative editor, persist artifacts).

Installation

To bring GenEditor to Livebook all you need to do is Mix.install/2:

Mix.install([
  {:gen_editor, "~> 0.3.2"}
])

Use and examples

GenEditor is an alternative way to define and execute Phoenix Mix commands for code generation. It allows you to use Smart Cells to configure a template file containing all the desired Mix commands, and execute it within Livebook.

Each cell configures a mix phx.gen task, with the exception of the Context and Module cells, used to share resource namespaces between elements.

At the moment you can only configure a single template file and application per Livebook notebook. Each notebook must contains at least a cell of type App and cell of type Blueprint to generate a template file.

App

app

Blueprint

image (1)

gen_editor's People

Contributors

beltranaceves avatar

Stargazers

虹村晴好 avatar

Watchers

 avatar

gen_editor's Issues

Generable Element cells do not remember the state of the help-box

Describe the bug
When reloading the notebook or the runtime, cells regress to the default true state for isHelpBoxHidden, even though the attribute is included in the to_source and to_attrs functions

To Reproduce
Steps to reproduce the behavior:

  1. Open notebook
  2. Add a Generable Element cell
  3. Click on the help box icon to open quick docs
  4. Reload runtima

Expected behavior
isHelpBoxHidden state is persisten

Setup CI/CD

Setup pipeline to automatically test on every commit and publish to hex.com on commit to release

Feedback for missing dependencies when generating a blueprint

Is your feature request related to a problem? Please describe.
Since projects are generated with the no_install flag in the gen_dsl call, dependencies should be installed by Livebook. The popup included by default cells is not available to 3rd party developers, but we should still inform the user

Describe the solution you'd like
Before calling gen_dsl, read the dependencies included in the current blueprint and ensure they are loaded. If they are not, stop execution and give feedback to the user.

Add element references to Schema field types

Is your feature request related to a problem? Please describe.
Add the option of reference type when configuring an Schema field

Describe the solution you'd like
Add to the current dropdown select references to predefined schemas in the blueprint

Text input elements trigger navigation on enter

Describe the bug
Text input elements trigger navigation on enter to a blank page

To Reproduce
Steps to reproduce the behavior:

  1. Add a module cell
  2. Select the text input element
  3. Press enter
  4. See error

Expected behavior
nothing happens on enter press

Mark optional and mandatory fields in each cell

Is your feature request related to a problem? Please describe.
Somehow clearly mark optional and mandatory fields in each smart cell

Describe the solution you'd like
Either add input coloring or mark fields with a colored asterisk next to their label.

Tests

Implement a test suite for multi-user input from collaborative editing

Integrate code generation

Implement a mechanism to generate code from a template within Livebook and download the zipped project directly from the browser

Transition package into kino_gen

Is your feature request related to a problem? Please describe.
There is a common naming scheme for packages intended for Smart Cells use, which use the kino prefix.

Describe the solution you'd like
Once ready, retire the current :gen_editor package and create a new :kino_gen package

Reconfigure GH Actions

Change pipeline behaviour to only deploy on release commits. Try to auto increment version number somehow

Add simple map/array types to Schema fields

Is your feature request related to a problem? Please describe.
Allow for simple map/array types when typing an Schema field

Describe the solution you'd like
When map/array is selected from the dropdown, another select show up for the inner typ

Describe alternatives you've considered
When map/array is selected from the dropdown, an arbitrary text input shows up

Documentation link in each cell for the appropiate type

Is your feature request related to a problem? Please describe.
Allow for quick documentation access for each Generable Element to the right type

Describe the solution you'd like
Add an Icon Link in each cell to its hexdocs address

Describe alternatives you've considered
Add a short description of each input parameter when hovering, possible todo.

Smart Cell form validation

Describe the solution you'd like
Add form validation to each of the inputs and the hole cell. Eg. when 1 field is populated other fields become mandatory.
Both inline coloring and messaging are suitable as well as help-box messages

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.