mirror of
https://github.com/pesde-pkg/tooling.git
synced 2025-04-19 11:23:54 +01:00
chore(bins): sync asphalt
README
This commit is contained in:
parent
20755691c6
commit
0846ddf9d3
1 changed files with 39 additions and 39 deletions
|
@ -44,13 +44,9 @@ cargo install asphalt
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
### `asphalt init`
|
|
||||||
|
|
||||||
Guides you through setting up a new Asphalt project in the current directory.
|
|
||||||
|
|
||||||
### `asphalt sync`
|
### `asphalt sync`
|
||||||
|
|
||||||
Syncs all assets in `asset_dir`.
|
Syncs all of your assets defined in your inputs.
|
||||||
|
|
||||||
There are three targets you can use to sync assets:
|
There are three targets you can use to sync assets:
|
||||||
|
|
||||||
|
@ -58,7 +54,7 @@ There are three targets you can use to sync assets:
|
||||||
|
|
||||||
- `studio`: Syncs assets locally to Roblox Studio. This is useful for testing assets in Studio before uploading them to Roblox.
|
- `studio`: Syncs assets locally to Roblox Studio. This is useful for testing assets in Studio before uploading them to Roblox.
|
||||||
|
|
||||||
- `debug`: Syncs assets to an `.asphalt-debug` folder in the current directory.
|
- `debug`: Syncs assets to an `.asphalt-debug` folder in the current directory. You can use this option see how Asphalt will process your files.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
asphalt sync # Equivalent to --target cloud
|
asphalt sync # Equivalent to --target cloud
|
||||||
|
@ -66,19 +62,19 @@ asphalt sync --target studio
|
||||||
asphalt sync --target debug
|
asphalt sync --target debug
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also perform a dry run to verify which assets will be synced. This displays the assets that would be synced without syncing them.
|
You can also perform a dry run to verify which assets will be synced. This exits with a non-zero status code if any asset hashes have changed. You can use this for CI checks to ensure that your assets are up-to-date.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
asphalt sync --dry-run
|
asphalt sync --dry-run
|
||||||
```
|
```
|
||||||
|
|
||||||
### `asphalt list`
|
### `asphalt migrate-lockfile`
|
||||||
|
|
||||||
Lists asset paths from the lockfile and their corresponding Roblox asset IDs.
|
Will migrate over a pre-1.0 lockfile to the new format. See `asphalt migrate-lockfile --help` for more information.
|
||||||
|
|
||||||
### `asphalt migrate-tarmac-manifest`
|
### `asphalt upload`
|
||||||
|
|
||||||
Will migrate over an existing `tarmac-manifest.toml` to `asphalt.lock.toml`.
|
Uploads a single asset to Roblox. See `asphalt upload --help` for more information.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@ -88,21 +84,19 @@ Asphalt is configured with a project file called `asphalt.toml`. It is required
|
||||||
<summary>Example</summary>
|
<summary>Example</summary>
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
asset_dir = "assets/"
|
|
||||||
exclude_assets = ["**/*.txt", "**/*.DS_Store"]
|
|
||||||
|
|
||||||
write_dir = "src/shared/"
|
|
||||||
|
|
||||||
[codegen]
|
|
||||||
typescript = true
|
|
||||||
style = "flat"
|
|
||||||
output_name = "assets"
|
|
||||||
|
|
||||||
[creator]
|
[creator]
|
||||||
type = "user"
|
type = "user"
|
||||||
id = 9670971
|
id = 9670971
|
||||||
|
|
||||||
[existing]
|
[codegen]
|
||||||
|
typescript = true
|
||||||
|
style = "flat"
|
||||||
|
|
||||||
|
[inputs.assets]
|
||||||
|
path = "assets/**/*"
|
||||||
|
output_path = "src/shared"
|
||||||
|
|
||||||
|
[inputs.assets.web]
|
||||||
"some_sound_on_roblox.ogg" = { id = 123456789 }
|
"some_sound_on_roblox.ogg" = { id = 123456789 }
|
||||||
"some_image_on_roblox.png" = { id = 987654321 }
|
"some_image_on_roblox.png" = { id = 987654321 }
|
||||||
```
|
```
|
||||||
|
@ -111,17 +105,12 @@ id = 9670971
|
||||||
|
|
||||||
### Format
|
### Format
|
||||||
|
|
||||||
- `asset_dir`: path
|
|
||||||
- The directory of assets to upload to Roblox.
|
|
||||||
- `exclude_assets`: array<string> (optional)
|
|
||||||
- An array of glob patterns to exclude when processing the assets directory.
|
|
||||||
- `write_dir`: path
|
|
||||||
- The directory to output the generated code to. This should probably be somewhere in your game's source folder.
|
|
||||||
- `creator`: Creator
|
- `creator`: Creator
|
||||||
- The Roblox creator to upload the assets under.
|
- The Roblox creator to upload the assets under.
|
||||||
- `codegen`: Codegen
|
- `codegen`: Codegen
|
||||||
- Code generation options.
|
- Code generation options.
|
||||||
- `existing`: map<string, ExistingAsset> (optional)
|
- `inputs`: map<string, Input>
|
||||||
|
- A map of input names to input configurations.
|
||||||
|
|
||||||
#### Creator
|
#### Creator
|
||||||
|
|
||||||
|
@ -134,12 +123,18 @@ id = 9670971
|
||||||
- Generate a Typescript definition file.
|
- Generate a Typescript definition file.
|
||||||
- `style`: "flat" | "nested" (optional)
|
- `style`: "flat" | "nested" (optional)
|
||||||
- The code-generation style to use. Defaults to `flat`, which makes accessing assets feel like writing file paths. You may consider using `nested` if you are not a TypeScript user, however, as Luau does not support template literal types.
|
- The code-generation style to use. Defaults to `flat`, which makes accessing assets feel like writing file paths. You may consider using `nested` if you are not a TypeScript user, however, as Luau does not support template literal types.
|
||||||
- `output_name`: string (optional)
|
- `strip_extensions`: boolean (optional)
|
||||||
- The name for the generated files. Defaults to `assets`.
|
- Whether to strip the file extension. Defaults to `false` for the same reason described above.
|
||||||
- `strip_extension`: boolean (optional)
|
|
||||||
- Whether to strip the file extension. Defaults to `false`. We recommend `true` if using the `nested` codegen style.
|
|
||||||
|
|
||||||
#### ExistingAsset
|
#### Input
|
||||||
|
- `path`: glob
|
||||||
|
- A glob pattern to match files to upload.
|
||||||
|
- `output_path`: string
|
||||||
|
- The directory path to output the generated code.
|
||||||
|
- `web`: map<string, WebAsset>
|
||||||
|
- A map of paths relative to the input path to existing assets on Roblox.
|
||||||
|
|
||||||
|
#### WebAsset
|
||||||
|
|
||||||
- `id`: number
|
- `id`: number
|
||||||
|
|
||||||
|
@ -156,7 +151,12 @@ Therefore, it is recommended to add Asphalt's generated files to your linter/for
|
||||||
|
|
||||||
You will need an API key to sync with Asphalt. You can specify this using the `--api-key` argument, or the `ASPHALT_API_KEY` environment variable.
|
You will need an API key to sync with Asphalt. You can specify this using the `--api-key` argument, or the `ASPHALT_API_KEY` environment variable.
|
||||||
|
|
||||||
You can get one from the [Creator Dashboard](https://create.roblox.com/dashboard/credentials). Make sure you select the correct group and Asset-related permissions.
|
You can get one from the [Creator Dashboard](https://create.roblox.com/dashboard/credentials).
|
||||||
|
|
||||||
|
The following permissions are required:
|
||||||
|
- `asset:read`
|
||||||
|
- `asset:write`
|
||||||
|
- `legacy-asset:manage`
|
||||||
|
|
||||||
## Cookie
|
## Cookie
|
||||||
You will need a cookie to upload animations to Roblox. This is because the Open Cloud API does not support them. It will automatically detected from the current Roblox Studio installation. Otherwise, you can specify this using the `--cookie` argument, or the `ASPHALT_COOKIE` environment variable.
|
You will need a cookie to upload animations to Roblox. This is because the Open Cloud API does not support them. It will automatically detected from the current Roblox Studio installation. Otherwise, you can specify this using the `--cookie` argument, or the `ASPHALT_COOKIE` environment variable.
|
||||||
|
|
Loading…
Add table
Reference in a new issue