Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSpyce committed May 23, 2018
1 parent cfb5ac3 commit a87a2a5
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# Thiq

>The scripts repository for the Spigot plugin [Thiq](https://github.com/Thiq/Thiq)
|Dependencies|Version|
|---|---|
|Thiq.jar|v1.0.2+|
|Thiq.jar|v3.0.0+|

Thiq is 1 part Java and 1 part JavaScript. For one to work, one needs the other. Within Thiq, there are core JS libraries that ensure a constant system within the JS environment. "Why not do everything there?" The point of Thiq was to make fast, simple, and scalable solutions for plugin development within Spigot, one that Java does neither fast nor simple. One can say that it's easy to create a plugin, but what steps do you have to take? Create the project, assign dependencies, configure Maven, configure where the src sits at, and you haven't even started coding yet. Thiq makes it simple. It's a simple `create`, `write`, and `reload`.

### Items of Importance and Loading
When Thiq initializes, it loads the internal core repository, to ensure that nothing funky happens across multiple servers. It allows a consistency, almost like Google's V8 engine (except not because it's not that impressive). The core repository includes things like `logger`, `require`, `promise`, `tts`, `events`, etc. All the core things to allow for a full JS environment. After those are loaded, the following events happen in order:
## Items of Importance and Loading

If you're familiar with NodeJS, then you'll be able to easily get started with Thiq. It follows the same directory and file structure out of the box, with the intent for a Node developer to easily use this environment with as little hassle as possible. If you're not familiar with Node, then you can either look up how to setup a project in it or read the next section.

1: `./Thiq/thiq.json` is read. This contains information about the current environment that we should included in the `process` module, but also what libraries to load into the environment.
```
{
"libraries": [
"myLib.js"
]
}
```
### First things first: loading process

2: `./libs/` This is where all of the libraries that affect gameplay are kept (ideally). In reality, you could really keep anything in there, but for the sake of structure, if a library doesn't directly expose an API or is not a module, it goes in this directory.
When Thiq is initialized, it first creates a compiler to be used. Our environment is then given some methods to allow direct transpiling and execution, but it essentially amounts to the common JS function `eval`. After that's done, the internal JS files are loaded and modules are initialized. These are done to create a Node-replicating environment. Once that is done, the bootstrapper reads from `package.json["main"]` to determine the entry point. If the field doesn't exist, it is defaulted to `index.js` within `plugins/Thiq`.

3: `./modules/` This is where all of the modules reside. If you're doing simple plugins, you most likely won't have to touch anything in here. Any API or ThiqJS module that your library uses will likely reside in here.
### The Entry File
Think of this file as the `int main()` of the environment. Once the environment is finished initializing, this is called. Once this file is finished executing, Thiq is considered finished loading.

4: `./startup.js` After everything in the `libs` folder is loaded, this file is called. For any plugins or modules that require initialization on startup, this is the file where you wanna do it. Once `startup.js` is finished being called, Thiq is finished loading and is ready for the fight.
### Dependencies

Dependencies are resolved at startup through TPM (Thiq Package Manager). For documentation and tutorials on how to use TPM, [check out the docs](). Dependencies that Thiq is allowed to use is installed locally at `package.json["modules_dir"]`. This is unlike Node in the fact that Node is allowed to install packages globally on the host machine.

## [Documentation](http://docs.thiq.org)

## Contributing

Contributions are always welcome. The main goal is to recreate the NodeJS environment within the JavaEE stack, so core module updates are recommended. To contribute, just pull the code and submit a pull request with ${USERNAME}-{FEATURENAME}.

## License

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FThiq%2Fscripts.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FThiq%2Fscripts?ref=badge_large)

0 comments on commit a87a2a5

Please sign in to comment.