Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Zyie committed Jul 8, 2024
1 parent 813c161 commit 54ca31e
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 120 deletions.
18 changes: 9 additions & 9 deletions packages/docs/docs/guide/pipes/compress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ import { ImageToggle } from '@site/src/components/ImageToggle';

The compress plugin uses the Sharp library to compress images into different formats, such as JPEG, PNG, WebP, and AVIF. This helps reduce file sizes while maintaining image quality, ensuring faster load times and better performance.

## API

| Option | Type | Description |
| ------ | ----------------- | -------------------------------------------------------------------------------------------------------------------- |
| jpg | `object \| false` | Any settings supported by [sharp jpeg](https://sharp.pixelplumbing.com/api-output#jpeg). |
| png | `object \| false` | Any settings supported by [sharp png](https://sharp.pixelplumbing.com/api-output#png). |
| webp | `object \| false` | Any settings supported by [sharp webp](https://sharp.pixelplumbing.com/api-output#webp). |
| avif | `object \| false` | Any settings supported by [sharp avif](https://sharp.pixelplumbing.com/api-output#avif). <br /> Defaults to `false`. |

## Example

<ImageToggle image={'compress/compress'} height={350} />
Expand All @@ -38,6 +29,15 @@ export default {
};
```

## API

| Option | Type | Description |
| ------ | ----------------- | -------------------------------------------------------------------------------------------------------------------- |
| jpg | `object \| false` | Any settings supported by [sharp jpeg](https://sharp.pixelplumbing.com/api-output#jpeg). |
| png | `object \| false` | Any settings supported by [sharp png](https://sharp.pixelplumbing.com/api-output#png). |
| webp | `object \| false` | Any settings supported by [sharp webp](https://sharp.pixelplumbing.com/api-output#webp). |
| avif | `object \| false` | Any settings supported by [sharp avif](https://sharp.pixelplumbing.com/api-output#avif). <br /> Defaults to `false`. |

## Tags

| Tag | Folder/File | Description |
Expand Down
21 changes: 11 additions & 10 deletions packages/docs/docs/guide/pipes/ffmpeg.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ export default {

The `ffmpeg` plugin exposes the full FFmpeg API, allowing for the conversion of any file type to any other file type. This provides a high level of customization and control over the conversion process, enabling a wide range of media processing tasks.

## API

| Option | Type | Description |
| ------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------- |
| inputs | `string[]` | An array of file extensions to be processed. |
| outputs | `object[]` | An array of objects containing the output formats and options for each format. |
| outputs.formats | `string[]` | An array of file extensions to be output. |
| outputs.recompress | `boolean` | A boolean value indicating whether the input file should be compressed if the output format is the same as the input format. |
| outputs.options | `object` | An object containing the FFmpeg options for the output file. |

### Example

```ts
Expand Down Expand Up @@ -77,3 +67,14 @@ export default {
],
};
```

## API

| Option | Type | Description |
| ------------------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------- |
| inputs | `string[]` | An array of file extensions to be processed. |
| outputs | `object[]` | An array of objects containing the output formats and options for each format. |
| outputs.formats | `string[]` | An array of file extensions to be output. |
| outputs.recompress | `boolean` | A boolean value indicating whether the input file should be compressed if the output format is the same as the input format. |
| outputs.options | `object` | An object containing the FFmpeg options for the output file. |

9 changes: 0 additions & 9 deletions packages/docs/docs/guide/pipes/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@ sidebar_position: 3

AssetPack plugin for minifying JSON files. This plugin simplifies JSON files by removing whitespace, reducing file size and improving load times.

## API
N/A for this plugin.

## Example

TODO: add ToggleImage example

```js
import { json } from "@assetpack/core";

Expand All @@ -24,7 +19,3 @@ export default {
},
};
```

## Tags

N/A for this plugin.
26 changes: 14 additions & 12 deletions packages/docs/docs/guide/pipes/manifest.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
sidebar_position: 5
---
import { ImageToggle } from '@site/src/components/ImageToggle';

# Manifest

Expand All @@ -10,18 +11,11 @@ The plugin also allows you to create bundles of assets by using tags in your fol

We believe this plugin is a must-have for any PixiJS project, as it simplifies the process of loading assets and helps you manage your project more efficiently.

## API

| Option | Type | Description |
| --------------- | --------- | ---------------------------------------------------------------------------------------------- |
| output | `string` | The path to the manifest file.<br />Defaults to the output folder defined in your config. |
| createShortcuts | `boolean` | Whether to create the shortest possible alias for an asset.<br />Defaults to `false`. |
| trimExtensions | `boolean` | Whether to trim the extensions from the asset aliases. <br />Defaults to `false`. |
| includeMetaData | `boolean` | Whether to include the tags the asset has used in the manifest file. <br />Defaults to `true`. |

## Example

<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', paddingBottom: '24px' }}>
<ImageToggle image={'manifest/manifest-tags'} height={750} />

{/* <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', paddingBottom: '24px' }}>
<img
src={'/assetpack/screenshots/manifest/manifest-tags.png'}
alt="Tags Example"
Expand All @@ -30,7 +24,7 @@ We believe this plugin is a must-have for any PixiJS project, as it simplifies t
boxShadow: '0 0 20px hsla(192, 84%, 40%, 0.5)',
}}
/>
</div>
</div> */}

```js
import { pixiManifest } from "@assetpack/core";
Expand All @@ -51,14 +45,22 @@ export default {
};
```

## API

| Option | Type | Description |
| --------------- | --------- | ---------------------------------------------------------------------------------------------- |
| output | `string` | The path to the manifest file.<br />Defaults to the output folder defined in your config. |
| createShortcuts | `boolean` | Whether to create the shortest possible alias for an asset.<br />Defaults to `false`. |
| trimExtensions | `boolean` | Whether to trim the extensions from the asset aliases. <br />Defaults to `false`. |
| includeMetaData | `boolean` | Whether to include the tags the asset has used in the manifest file. <br />Defaults to `true`. |

## Tags

| Tag | Folder/File | Description |
| --------- | ----------- | ----------------------------------------------- |
| `m` | `folder` | Generates a bundle entry in the manifest file. |
| `mIgnore` | `both` | Ignores the folder/file from the manifest file. |


---

## Usage with Spine plugin
Expand Down
16 changes: 8 additions & 8 deletions packages/docs/docs/guide/pipes/mipmap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ The mipmap plugin generates mipmaps for images, creating multiple resolutions of
When generating multiple resolutions, the plugin assumes that the original image is at the highest resolution. The plugin will then generate lower-resolution versions of the image based on the specified template and resolutions.
:::

## API

| Option | Type | Description |
| --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| template | `string` | A template for denoting the resolution of the images.<br />Defaults to `@%%x`. |
| resolutions | `object` | An object containing the resolutions that the images will be resized to.<br />Defaults to `{ default: 1, low: 0.5 }`. |
| fixedResolution | `string` | A resolution used if the fix tag is applied e.g.<br />Resolution must match one found in resolutions.<br />Defaults to `default`. |

## Example

<ImageToggle image={'mipmap/mipmap'} height={350} />
Expand Down Expand Up @@ -59,6 +51,14 @@ export default {
};
```

## API

| Option | Type | Description |
| --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| template | `string` | A template for denoting the resolution of the images.<br />Defaults to `@%%x`. |
| resolutions | `object` | An object containing the resolutions that the images will be resized to.<br />Defaults to `{ default: 1, low: 0.5 }`. |
| fixedResolution | `string` | A resolution used if the fix tag is applied e.g.<br />Resolution must match one found in resolutions.<br />Defaults to `default`. |

## Tags

| Tag | Folder/File | Description |
Expand Down
12 changes: 6 additions & 6 deletions packages/docs/docs/guide/pipes/spine.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ The `spineAtlasCompress` plugin uses the Sharp library to compress images into d

This plugin should be used in conjunction with the [compress](/docs/guide/pipes/compress) plugin to ensure that the atlas file is compressed as well as the images.

### API

See [Compression API](/docs/guide/pipes/compress) for more information.

You will want to make sure you are passing the same options to the `compress` plugin as you are to the `spineAtlasCompress` plugin.

### Example

<ImageToggle image={"spine/spine-atlas-compress"} />
Expand All @@ -44,6 +38,12 @@ export default {
};
```

### API

See [Compression API](/docs/guide/pipes/compress) for more information.

You will want to make sure you are passing the same options to the `compress` plugin as you are to the `spineAtlasCompress` plugin.

### Tags

| Tag | Folder/File | Description |
Expand Down
Loading

0 comments on commit 54ca31e

Please sign in to comment.