Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compressed textures plugin #56

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
946 changes: 909 additions & 37 deletions package-lock.json

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions packages/compressed-textures/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# @assetpack/plugin-compressed-textures

AssetPack plugin for generation compressed textures.

## Installation

```sh
npm install --save-dev @assetpack/plugin-compressed-textures
```

## Usage

```js
import { generateAstc, generateBc, generateEtc } from '@assetpack/compressed-textures';

export default {
...
plugins: {
...
generateAstc: generateAstc(),
generateBc: generateBc(),
generateEtc: generateEtc(),
},
};
```

## Options

### generateAstc

- compression: Any settings supported by [@gpu-tex-enc/astc](https://www.npmjs.com/package/@gpu-tex-enc/astc)
- `tags` - An object containing the tags to use for the plugin. Defaults to `{ nc: "nc" }`.
- `nc` - The tag used to denote that the image should not be compressed. Can be placed on a folder or file.

### generateBc

- compression: Any settings supported by [@gpu-tex-enc/bc](https://www.npmjs.com/package/@gpu-tex-enc/bc)
- `tags` - An object containing the tags to use for the plugin. Defaults to `{ nc: "nc" }`.
- `nc` - The tag used to denote that the image should not be compressed. Can be placed on a folder or file.

### generateEtc

- compression: Any settings supported by [@gpu-tex-enc/etc](https://www.npmjs.com/package/@gpu-tex-enc/etc)
- `tags` - An object containing the tags to use for the plugin. Defaults to `{ nc: "nc" }`.
- `nc` - The tag used to denote that the image should not be compressed. Can be placed on a folder or file.
10 changes: 10 additions & 0 deletions packages/compressed-textures/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const sharedConfig = require('../../jest.config');

module.exports = {
...sharedConfig,
rootDir: './',
moduleNameMapper: {
'^@assetpack/plugin-(.*)$': '<rootDir>/../$1/src',
'^@assetpack/(.*)$': '<rootDir>/../$1/src',
},
};
47 changes: 47 additions & 0 deletions packages/compressed-textures/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "@assetpack/plugin-compressed-textures",
"version": "0.8.0",
"description": "",
"homepage": "https://github.com/pixijs/assetpack/tree/master/packages/compressed-textures/#readme",
"bugs": "https://github.com/pixijs/assetpack/issues",
"repository": {
"url": "pixijs/assetpack",
"directory": "packages/compressed-textures"
},
"license": "MIT",
"author": "ddenysiuk",
"exports": {
"import": "./dist/es/index.js",
"types": "./dist/types/index.d.ts",
"default": "./dist/cjs/index.js"
},
"main": "./dist/cjs/index.js",
"module": "./dist/es/index.js",
"types": "./dist/types/index.d.ts",
"files": [
"dist",
"*.d.ts"
],
"scripts": {
"prebuild": "rimraf dist",
"build": "rollup -c",
"test": "npx jest --config ./jest.config.js",
"test:types": "tsc --noEmit"
},
"dependencies": {
"fs-extra": "^11.1.0",
"gpu-tex-enc": "^1.1.3"
},
"devDependencies": {
"@assetpack/core": "0.8.0"
},
"peerDependencies": {
"@assetpack/core": ">=0.0.0"
},
"engines": {
"node": ">=16.0.0"
},
"publishConfig": {
"access": "public"
}
}
7 changes: 7 additions & 0 deletions packages/compressed-textures/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { readFileSync } from 'fs';

import { createConfig } from '../../shared/rollup.config.mjs';

export default createConfig({
pkg: JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
});
Loading