Coder Social home page Coder Social logo

modular's Introduction

Modular

Modular is a tool to help Transformice developers code their modules. It allows to write the code split in files as if it was a "normal" program; and it also allows to write and use libraries in a really simple way.

How it works

Internally, this uses luacheck and a slightly modified prepdir, plus a few custom scripts in order to lint the code and bundle it into a single file. The developer can code normally, using require calls and those will be detected and merged into a file that can be loaded in Transformice; maintaining the correct behavior.

How to use it

First, clone this repository and modify src/release.lua and src/init.lua at your will.

bundle-config.lua contains all the prepdir configuration. It has to return a table and each item in that table is a bundle configuration, and a bundle will be generated per each configuration.

Whenever you commit to your GitHub repository, prepdir will generate all the bundles and luacheck will lint them all. If you've modified src/release.lua, the linker will merge each bundle into a single file (one file per bundle) and it will then create a GitHub release, using the value of version in your release configuration as the name of the release.

Whenever you call require, it has to have the following structure: [schema+]path. schema defaults to file, which tells it to require from a local file in src.

If schema is github or gist, it will retrieve the content of the file from a github repository or gist at the moment of building bundles. The only file libraries can access is src/config.lua and it is shared between all libraries. In this case, the syntax would be schema+owner/repo[/path][@branch]; if path is not specified, it defaults to init, and if branch is not specified, it defaults to master in the case of a github repository, or an empty string in the case of a github gist.

Advantages

  • Customizable
  • Easy to set up
  • Easy to use
  • Automatically stay updated with as many lua libraries as you want

modular's People

Contributors

tocuto avatar

Stargazers

Seniru Pasan Indira avatar Lautenschlager avatar

Watchers

James Cloos avatar  avatar

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.