npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@inexorgame/inexor-flex

v0.9.35

Published

Scripting environment for Inexor.

Downloads

36

Readme

Inexor Flex

package version Build Status Build status Dependency Status NSP Status

Inexor Flex is platform for managing Inexor Core instances and the Inexor Tree API and provides a scripting environment for servers and clients. Inexor Flex also makes multiple user interfaces using web technologies available.

The reference documentation can be found at GitHub pages Further introduction and overview: https://github.com/inexorgame/inexor-core/wiki/Inexor-Flex

Introduction

  • we wanted to create a way in which we can easily configure and extend our game
  • that's why we created the tree. It means that all the settings (variables) in the game can be edited in real-time in a tree structure
  • but this tree was hard to access. It's sent over the wire in a compressed format, that's hard to work with for "casual users"
  • next: we created inexor-flex. It makes this tree available via a web service (and webviewer). On your local computer.
  • not only can you edit the game in real time with inexor-flex, it also does a bunch of things for you
    • read configuration. e.g for maps, or servers
    • read the server list
    • only your imagination is the limit (...)

How to set up Flex

If you don't want to contribute to Flex itself, you can install it via

  • yarn global add @inexorgame/inexor-flex
  • now you can start Flex via inexor-flex

NOTE: If you're curious what the graphical installer does. No suprise. Exactly the same.

If you are considering to contribute to Flex:

  • clone this repository
  • open a terminal/shell within the Flex repository directory
  • install Flex via yarn install
  • you can start Flex via yarn start

What's this "instances" thing?

Since nowadays, all configuration is done via inexor-flex, we have introduced a system called instances. Each Inexor client or server is an instance. You can have multiple clients (or servers), with different configurations, even running different versions of the game.

Now let's go fancy. Right at your browser.

If you want to be little bit more of a power user, we also ship a graphical interface for flex. Right there. When you download it.

Just go to http://localhost:31416/api/v1/interfaces/ui-flex And even more fancy. You can see the Inexor Tree at http://localhost:31416/api/v1/interfaces/ui-flex/#/instances/31417

Developer section

The command line

inexor-flex brings a verbose command line that can easily be accessed with it's name. Just call inexor-flex from your command line (shell, prompt, terminal), and you can have a lot of options to configure flex from the command line.

Folder structure

Flex is structure in two main folders:

  • src is where the utilities of Flex reside
  • server is where the actual Flex server resides. The web server is started here, and all run-time functionality (such as paths) are determined here.

All of the above components are wired together using the Application Context module.

After the "wire" individual components, such as the package manager are started.

The API is exposed as a RESTfull API.

Architectual

Inexor Flex was initially born to serve the tree of Inexor Core and this is how it works nowadays.

  • we create a mother Inexor root node using the @inexorgame/tree module
  • each instance of Inexor Core has a src/instances/Connector attached
  • this Connector will create a tree at /instance/INSTANCEID
  • other modules can be hooked in other namespaces than /instances. e.g for the ReleaseManager, the namespace is /releases

Interfaces

Interfaces are graphical user interfaces for Inexor Flex and Inexor Core. An interfaces is basically just HTML5/CSS/JavaScript folders, which will be made available via the REST API.

Below is a list of the default interfaces shipped with Flex:

Adding an own interface

An interface should follow the below directory structure:

  • Your interface must expose a dist folder with all it's assets
  • package.json
  • dist
    • img
    • js
    • css
    • index.html
    • (...)
  • Your dependencies will be served from http(s)://flex_url/static
  • Your interface will be served from http(s)://flex_url/api/v1/interfaces/NAME

You can then use the interfaces command line to add your newly written.

Documentation and style guide

We use JSDoc for documentation. All modules from src and server are automatically added to the documentation, when following the standards.

We endorse the eslint:recommended rule set, combined with some custom rules. You can make sure your module matches our standard by running yarn run lint in the main directory.

When writting a module, please keep the following in mind

  • if you write a larger block of code or seperate functionality, consider creating a new module
  • by default unit tests with mocha are done for any file that matches *_test.js, though it is highly recommended to add a test folder to your module
  • if necessary (for important or big modules), we urge that you add a separate README.md to the respective module

We also try to apply the changes detected by the [security/recommended] standard.

The REST API

The REST API (v1) is wired together in server/api/v1/index.js.

Writing an own module

Essentially to write your very first own module, you should go like this

  • create a new directory src/YOURMODULE
  • execute yarn init within your module directory, which will ask you a bunch of questions
  • the name of your module has to be @inexorgame/YOURMODULE
  • your module should export a index.js file with it's functionality
  • YOU HAVE TO add your new module to the fileDependencies in the root package.json
  • after this execute yarn install again within the root directory

Later on your module can be used via

const yourmodule = require('@inexorgame/yourmodule')

You can have a look at the src/types module, for a very simple and basic module example.

Using the API

We have specifically designed the module @inexorgame/treeclient to work with the v1 API. You can have a look at one of the many command-line tasks in server/commands/cli/ which will give a fine example on how to use the treeclient library.