Skip to content

Commit

Permalink
Merge branch 'chore/cache-buster-plugins' into chore/object-hash-options
Browse files Browse the repository at this point in the history
  • Loading branch information
GoodBoyDigital committed Apr 29, 2024
2 parents cd905ad + 51a2ca9 commit 52323b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/image/src/mipmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function mipmap(_options: MipmapOptions = {}): AssetPipe<MipmapOptions>

return {
folder: true,
name: 'mip-compress',
name: 'mipmap',
defaultOptions,
test(asset: Asset, options)
{
Expand Down
15 changes: 3 additions & 12 deletions packages/spine/src/spineAtlasCacheBuster.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -20,15 +17,9 @@ export type SpineCacheBusterOptions = PluginOptions<'fix' | 'nc'> & MipmapOption
* @param _options
* @returns
*/
export function spineAtlasCacheBuster(_options?: SpineCacheBusterOptions): AssetPipe<SpineCacheBusterOptions>
export function spineAtlasCacheBuster(): AssetPipe
{
const defaultOptions = {
..._options,
tags: {
fix: 'fix',
..._options?.tags
},
};
const defaultOptions = {};

const atlasFileToFix: Asset[] = [];

Expand Down
18 changes: 3 additions & 15 deletions packages/texture-packer/src/texturePackerCacheBuster.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -19,18 +16,9 @@ export type SpineOptions = PluginOptions<'fix' | 'nc'> & MipmapOptions;
* @param _options
* @returns
*/
export function texturePackerCacheBuster(_options?: SpineOptions): AssetPipe<SpineOptions>
export function texturePackerCacheBuster(): AssetPipe
{
const defaultOptions = {
template: '@%%x',
resolutions: { default: 1, low: 0.5 },
fixedResolution: 'default',
..._options,
tags: {
fix: 'fix',
..._options?.tags
},
};
const defaultOptions = {};

const textureJsonFilesToFix: Asset[] = [];

Expand Down

0 comments on commit 52323b9

Please sign in to comment.