From 57ae4fc2915abe73f6574641990c443ae1737c99 Mon Sep 17 00:00:00 2001 From: Zyie <24736175+Zyie@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:56:25 +0100 Subject: [PATCH 1/3] rename --- packages/image/src/mipmap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/image/src/mipmap.ts b/packages/image/src/mipmap.ts index 7895807..e16a8d5 100644 --- a/packages/image/src/mipmap.ts +++ b/packages/image/src/mipmap.ts @@ -38,7 +38,7 @@ export function mipmap(_options: MipmapOptions = {}): AssetPipe return { folder: true, - name: 'mip-compress', + name: 'mipmap', defaultOptions, test(asset: Asset, options) { From d1633ed1f8f3e15e861bc07148e8215bb4e42059 Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Mon, 29 Apr 2024 11:38:19 +0100 Subject: [PATCH 2/3] fix options --- packages/spine/src/spineAtlasCacheBuster.ts | 17 +++------------- .../src/texturePackerCacheBuster.ts | 20 +++---------------- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/packages/spine/src/spineAtlasCacheBuster.ts b/packages/spine/src/spineAtlasCacheBuster.ts index 48c15c0..c549e49 100644 --- a/packages/spine/src/spineAtlasCacheBuster.ts +++ b/packages/spine/src/spineAtlasCacheBuster.ts @@ -1,10 +1,7 @@ -import type { Asset, PluginOptions } from '@play-co/assetpack-core'; +import type { Asset } from '@play-co/assetpack-core'; import { checkExt, type AssetPipe, findAssetsWithFileName } from '@play-co/assetpack-core'; import { AtlasView } from './AtlasView'; import { removeSync, writeFileSync } from 'fs-extra'; -import type { MipmapOptions } from '@play-co/assetpack-plugin-image'; - -export type SpineCacheBusterOptions = PluginOptions<'fix' | 'nc'> & MipmapOptions; /** * This should be used after the cache buster plugin in the pipes. @@ -20,22 +17,14 @@ export type SpineCacheBusterOptions = PluginOptions<'fix' | 'nc'> & MipmapOption * @param _options * @returns */ -export function spineAtlasCacheBuster(_options?: SpineCacheBusterOptions): AssetPipe +export function spineAtlasCacheBuster(): AssetPipe { - const defaultOptions = { - ..._options, - tags: { - fix: 'fix', - ..._options?.tags - }, - }; - const atlasFileToFix: Asset[] = []; return { folder: false, name: 'spine-cache-buster', - defaultOptions, + defaultOptions: null, test(asset: Asset, _options) { return checkExt(asset.path, '.atlas'); diff --git a/packages/texture-packer/src/texturePackerCacheBuster.ts b/packages/texture-packer/src/texturePackerCacheBuster.ts index cfd8424..3138ccf 100644 --- a/packages/texture-packer/src/texturePackerCacheBuster.ts +++ b/packages/texture-packer/src/texturePackerCacheBuster.ts @@ -1,10 +1,7 @@ -import type { Asset, PluginOptions } from '@play-co/assetpack-core'; +import type { Asset } from '@play-co/assetpack-core'; import { checkExt, type AssetPipe, findAssetsWithFileName } from '@play-co/assetpack-core'; -import type { MipmapOptions } from '@play-co/assetpack-plugin-image'; import { removeSync, writeFileSync } from 'fs-extra'; -export type SpineOptions = PluginOptions<'fix' | 'nc'> & MipmapOptions; - /** * This should be used after the cache buster plugin in the pipes. * As it relies on the cache buster plugin to have already cache busted all files. @@ -19,25 +16,14 @@ export type SpineOptions = PluginOptions<'fix' | 'nc'> & MipmapOptions; * @param _options * @returns */ -export function texturePackerCacheBuster(_options?: SpineOptions): AssetPipe +export function texturePackerCacheBuster(): AssetPipe { - const defaultOptions = { - template: '@%%x', - resolutions: { default: 1, low: 0.5 }, - fixedResolution: 'default', - ..._options, - tags: { - fix: 'fix', - ..._options?.tags - }, - }; - const textureJsonFilesToFix: Asset[] = []; return { folder: false, name: 'texture-packer-cache-buster', - defaultOptions, + defaultOptions: null, test(asset: Asset, _options) { return asset.allMetaData.tps && checkExt(asset.path, '.json'); From 51a2ca9307619a52d1f3223e4d53a10dbe950dff Mon Sep 17 00:00:00 2001 From: Mat Groves Date: Mon, 29 Apr 2024 11:39:23 +0100 Subject: [PATCH 3/3] fix options --- packages/spine/src/spineAtlasCacheBuster.ts | 6 ++++-- packages/texture-packer/src/texturePackerCacheBuster.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/spine/src/spineAtlasCacheBuster.ts b/packages/spine/src/spineAtlasCacheBuster.ts index c549e49..7b8d309 100644 --- a/packages/spine/src/spineAtlasCacheBuster.ts +++ b/packages/spine/src/spineAtlasCacheBuster.ts @@ -17,14 +17,16 @@ import { removeSync, writeFileSync } from 'fs-extra'; * @param _options * @returns */ -export function spineAtlasCacheBuster(): AssetPipe +export function spineAtlasCacheBuster(): AssetPipe { + const defaultOptions = {}; + const atlasFileToFix: Asset[] = []; return { folder: false, name: 'spine-cache-buster', - defaultOptions: null, + defaultOptions, test(asset: Asset, _options) { return checkExt(asset.path, '.atlas'); diff --git a/packages/texture-packer/src/texturePackerCacheBuster.ts b/packages/texture-packer/src/texturePackerCacheBuster.ts index 3138ccf..be334eb 100644 --- a/packages/texture-packer/src/texturePackerCacheBuster.ts +++ b/packages/texture-packer/src/texturePackerCacheBuster.ts @@ -16,14 +16,16 @@ import { removeSync, writeFileSync } from 'fs-extra'; * @param _options * @returns */ -export function texturePackerCacheBuster(): AssetPipe +export function texturePackerCacheBuster(): AssetPipe { + const defaultOptions = {}; + const textureJsonFilesToFix: Asset[] = []; return { folder: false, name: 'texture-packer-cache-buster', - defaultOptions: null, + defaultOptions, test(asset: Asset, _options) { return asset.allMetaData.tps && checkExt(asset.path, '.json');