From 0036bcb7dbd0c8b76c909159d9794a253b9d0bfb Mon Sep 17 00:00:00 2001 From: Zyie <24736175+Zyie@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:58:33 +0100 Subject: [PATCH] fix docs --- package.json | 3 ++- packages/assetpack/src/core/Asset.ts | 4 ++-- packages/docs/docs/guide/configuration.md | 6 +++--- .../docs/docs/guide/getting-started/installation.mdx | 10 +++++----- .../docs/docs/guide/getting-started/programmatic.md | 2 +- packages/docs/docs/guide/getting-started/vite.md | 2 +- packages/docs/docs/guide/pipes/cache-buster.mdx | 2 +- packages/docs/docs/guide/pipes/overview.mdx | 4 ++-- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index a243f0a..f9612b0 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "test:watch": "vitest", "watch": "npm run --ws watch --if-present", "deploy": "npm run deploy --workspace @assetpack/docs", - "docs:start": "npm run start --workspace @assetpack/docs" + "docs:start": "npm run start --workspace @assetpack/docs", + "docs:build": "npm run build --workspace @assetpack/docs" }, "husky": { "hooks": { diff --git a/packages/assetpack/src/core/Asset.ts b/packages/assetpack/src/core/Asset.ts index 1ea3fb1..9c5888e 100644 --- a/packages/assetpack/src/core/Asset.ts +++ b/packages/assetpack/src/core/Asset.ts @@ -110,7 +110,7 @@ export class Asset { if (this.isFolder) { - Logger.warn('[AssetPack] folders should not have buffers!. Contact the developer of Assetpack'); + Logger.warn('[AssetPack] folders should not have buffers!. Contact the developer of AssetPack'); } if (!this._buffer) @@ -132,7 +132,7 @@ export class Asset { if (this.isFolder) { - Logger.warn('[AssetPack] folders should not have hashes. Contact the developer of the Assetpack'); + Logger.warn('[AssetPack] folders should not have hashes. Contact the developer of the AssetPack'); } this._hash ??= getHash(this.buffer); diff --git a/packages/docs/docs/guide/configuration.md b/packages/docs/docs/guide/configuration.md index 52ece5f..04b7f2c 100644 --- a/packages/docs/docs/guide/configuration.md +++ b/packages/docs/docs/guide/configuration.md @@ -28,7 +28,7 @@ The directory where you want your optimised assets to be outputted to. | ---------- | ------- | -------- | | `string[]` | | No | -An optional array of ignore patterns. Any file path matching the patterns will not be processed by assetpack. +An optional array of ignore patterns. Any file path matching the patterns will not be processed by AssetPack. ### cache @@ -58,9 +58,9 @@ An optional string to set the log level. | Type | Default | Required | | -------- | ------- | -------- | -| `Pipe[]` | | No | +| `Plugin[]` | | No | -An array of pipes to use. For examples of pipes, see [Pipes](/docs/guide/pipes/overview#concepts). +An array of pipes to use. For examples of pipes, see [Plugins](/docs/guide/pipes/overview#plugins). ### assetSettings diff --git a/packages/docs/docs/guide/getting-started/installation.mdx b/packages/docs/docs/guide/getting-started/installation.mdx index 709390b..6011e05 100644 --- a/packages/docs/docs/guide/getting-started/installation.mdx +++ b/packages/docs/docs/guide/getting-started/installation.mdx @@ -15,10 +15,10 @@ It uses a plugin based system to allow you to create your own plugins to do what ## Installation -To install AssetPack, you need to install the `assetpack` package. +To install AssetPack, you need to install the `@assetpack/core` package. ```bash -npm install --save-dev assetpack +npm install --save-dev @assetpack/core ``` :::info COMPATIBILITY NOTE @@ -35,7 +35,7 @@ First create a `.assetpack.js` file in the root of your project. This file shoul ```js // .assetpack.js -import { compress } from 'assetpack'; +import { compress } from '@assetpack/core'; export default { entry: './raw-assets', @@ -52,7 +52,7 @@ Then to run AssetPack, you can use the CLI, run programatically, or use a build - [Programmatic](/docs/guide/getting-started/programmatic) - [Vite](/docs/guide/getting-started/vite) -AssetPack has a number of built-in pipes for you to use, to see the full list of pipes, see the [Pipes](/docs/guide/pipes) page. +AssetPack has a number of built-in pipes for you to use, to see the full list of pipes, see the [Pipes](/docs/guide/pipes/overview) page. ### PixiJS Setup @@ -60,7 +60,7 @@ If you are using AssetPack with PixiJS, you can use the `pixiPipes` function to ```js // .assetpack.js -import { compress, pixiPipes } from 'assetpack'; +import { compress, pixiPipes } from '@assetpack/core'; export default { entry: './raw-assets', diff --git a/packages/docs/docs/guide/getting-started/programmatic.md b/packages/docs/docs/guide/getting-started/programmatic.md index a3c6b94..5ace56a 100644 --- a/packages/docs/docs/guide/getting-started/programmatic.md +++ b/packages/docs/docs/guide/getting-started/programmatic.md @@ -14,7 +14,7 @@ To see a full list of configuration options, see the [API Reference](/docs/guide To use AssetPack programmatically, you need to import the `assetpack` function from the `assetpack` package, and call it with the following options: ```js -import { AssetPack } from 'assetpack'; +import { AssetPack } from '@assetpack/core'; const assetpack = new AssetPack({ entry: './raw-assets', diff --git a/packages/docs/docs/guide/getting-started/vite.md b/packages/docs/docs/guide/getting-started/vite.md index ca550bd..2a0d294 100644 --- a/packages/docs/docs/guide/getting-started/vite.md +++ b/packages/docs/docs/guide/getting-started/vite.md @@ -12,7 +12,7 @@ To see a full list of configuration options, see the [API Reference](/docs/guide ```ts // vite.config.mts import { defineConfig, type Plugin, type ResolvedConfig } from 'vite'; -import { AssetPack } from 'assetpack'; +import { AssetPack } from '@assetpack/core'; function assetpackPlugin(): Plugin { const apConfig = { diff --git a/packages/docs/docs/guide/pipes/cache-buster.mdx b/packages/docs/docs/guide/pipes/cache-buster.mdx index 899f991..0ab1335 100644 --- a/packages/docs/docs/guide/pipes/cache-buster.mdx +++ b/packages/docs/docs/guide/pipes/cache-buster.mdx @@ -34,7 +34,7 @@ export default { ## Spine and Texture Packer -When integrating with the [`texturePacker`](/docs/guides/pipes/texture-packer) plugin or your porject has spine atlas files, +When integrating with the [`texturePacker`](/docs/guide/pipes/texture-packer) plugin or your porject has spine atlas files, you need to add the `texturePackerCacheBuster` / `spineAtlasCacheBuster` pipes immediately after the `cacheBuster` pipe. The `texturePackerCacheBuster` ensures that the JSON files internally update their asset names to reflect the newly hashed file names. diff --git a/packages/docs/docs/guide/pipes/overview.mdx b/packages/docs/docs/guide/pipes/overview.mdx index c702dd8..be273fc 100644 --- a/packages/docs/docs/guide/pipes/overview.mdx +++ b/packages/docs/docs/guide/pipes/overview.mdx @@ -17,8 +17,8 @@ The order of the plugins in the pipe is important, as each plugin processes the ## Plugins - [Cache Buster](/docs/guide/pipes/cache-buster): Adds hashes to file names to ensure that assets are correctly updated when they change. -- [Audio](/docs/guide/pipes/audio): Converts and compresses audio files using FFmpeg. -- [FFmpeg](/docs/guide/pipes/audio): Converts files to any other file type using the FFmpeg API. +- [Audio](/docs/guide/pipes/ffmpeg): Converts and compresses audio files using FFmpeg. +- [FFmpeg](/docs/guide/pipes/ffmpeg): Converts files to any other file type using the FFmpeg API. - [Compression](/docs/guide/pipes/compress): Compresses images into different formats. - [Mipmaps](/docs/guide/pipes/mipmap): Generates mipmaps for images. - [JSON](/docs/guide/pipes/json): Minifies JSON files.