Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thinknathan/ts-defold-tstl-trim-extensions
TypeScript-to-Lua plugin that strips the final extension from files with nested extensions. Dedicated to @ts-defold
https://github.com/thinknathan/ts-defold-tstl-trim-extensions
defold defold-game-engine gamedev lua tstl tstl-plugin typescript
Last synced: 14 days ago
JSON representation
TypeScript-to-Lua plugin that strips the final extension from files with nested extensions. Dedicated to @ts-defold
- Host: GitHub
- URL: https://github.com/thinknathan/ts-defold-tstl-trim-extensions
- Owner: thinknathan
- License: mit
- Created: 2023-05-27T06:07:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-01T21:53:27.000Z (about 1 month ago)
- Last Synced: 2024-10-04T22:08:16.357Z (about 1 month ago)
- Topics: defold, defold-game-engine, gamedev, lua, tstl, tstl-plugin, typescript
- Language: JavaScript
- Homepage: https://ts-defold.dev/
- Size: 267 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tstl-trim-extensions
[![CI](https://github.com/thinknathan/ts-defold-tstl-trim-extensions/actions/workflows/ci.yml/badge.svg)](https://github.com/thinknathan/ts-defold-tstl-trim-extensions/actions/workflows/ci.yml) ![GitHub License](https://img.shields.io/github/license/thinknathan/ts-defold-tstl-trim-extensions)
TypeScriptToLua plugin that strips the final extension from files with nested extensions.
Used by [@ts-defold](https://github.com/ts-defold).
## Installation
1. Install this plugin.
```bash
yarn add tstl-trim-extensions -D
# or
npm install tstl-trim-extensions --save-dev
```2. Add this plugin to the `tstl.luaPlugins` section of `tsconfig.json`.
```diff
"tstl": {
"luaPlugins": [
{
+ "name": "tstl-trim-extensions"
}
]
}
```### Update an existing TS-Defold project
1. Install this plugin as described above.
2. Update `TypeScriptToLua` to v1.5.0 or newer.
3. Remove `"trimExtensions": true` from the `tstl` section of `tsconfig.json`.```diff
{
"tstl": {
- "trimExtensions": true,
}
}
```## Example
Files with multiple nested extensions will have their final extension (`.lua` by default) stripped.
`player.script.ts` will be output as `player.script`
Files without multiple extensions will not be changed by this plugin.
`player.ts` will be output as `player.lua` as usual.
TypeScript :heart: Defold## License
MIT