https://github.com/sharparam/cc-api
https://github.com/sharparam/cc-api
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sharparam/cc-api
- Owner: Sharparam
- License: mpl-2.0
- Created: 2024-04-12T18:16:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-27T18:13:43.000Z (about 2 years ago)
- Last Synced: 2025-01-08T01:52:29.524Z (over 1 year ago)
- Language: Lua
- Size: 210 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Cc::Api
Work-in-progress project to generate LuaLS library files for CC: Tweaked (and some supported mods).
Currently (2024-04-12), all the library files are handwritten, sometimes with some help from generator tools.
## Installation
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
Install the gem and add to the application's Gemfile by executing:
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
## Usage
### LuaLS
Add the path to the `api` folder in this repo to your Lua settings in VS Code:
```json
{
"Lua.workspace.library": [
"/path/to/this/repo/api"
]
}
```
## Mod support
- CC APIs from Mekanism
## Development
After checking out the repo, run `bin/setup` to install dependencies.
Then, run `rake spec` to run the tests.
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`.
To release a new version, update the version number in `version.rb`,
and then run `bundle exec rake release`, which will create a git tag for the version,
push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
### Generating Mekanism API files
In-game, in a CC computer, run the dump script in `vendor/mekanism/dump.lua`
to generate the help files for all necessary Mekanism blocks.
Then extract the Lua files it generated by going into the world save folder,
finding the folder for the computer you were using, and grabbing the files
from the `dump` folder.
Place them into the `vendor/mekanism` folder in this repo to update them.
Run `bundle exec exe/cc-api` to generate new API files to `out/mekanism`.
Then check if any of the existing mekanism files in `api/mekanism` need updating.
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/Sharparam/cc-api.
## License
Copyright © 2024 by [Adam Hellberg][sharparam].
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
[sharparam]: https://sharparam.com