Skip to content

Commit e00a063

Browse files
authored
Merge pull request #11 from Lenni009/dev
change available file mime types
2 parents 9ce24d1 + 8674dfe commit e00a063

File tree

8 files changed

+59
-20
lines changed

8 files changed

+59
-20
lines changed

.github/workflows/check-version.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,38 @@ run-name: Check Version
44
on:
55
pull_request:
66
types: [opened, synchronize]
7+
branches: main
78

89
concurrency:
910
group: 'checkversion'
1011
cancel-in-progress: true
1112

1213
jobs:
14+
paths-filter:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
code-changed: ${{ steps.filter.outputs.src }}
18+
steps:
19+
- name: Checkout Repo
20+
uses: actions/checkout@v4
21+
22+
- name: Filter Changed Files
23+
uses: AurorNZ/paths-filter@v4
24+
id: filter
25+
with:
26+
filters: |
27+
src:
28+
- 'src/**/*'
29+
- '!src/**/*.spec.*'
30+
- '!src/**/*.test.*'
31+
1332
check-version:
33+
needs: paths-filter
34+
if: needs.paths-filter.outputs.code-changed == 'true'
1435
runs-on: ubuntu-latest
1536

1637
permissions:
38+
contents: write
1739
pull-requests: write
1840

1941
steps:
@@ -24,8 +46,6 @@ jobs:
2446

2547
- name: Checkout Repo
2648
uses: actions/checkout@v4
27-
with:
28-
ref: ${{ github.ref }}
2949

3050
- name: Get New Version
3151
run: |

.github/workflows/publish-github.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ run-name: Create GitHub Release
55
on:
66
push:
77
branches: ['main']
8+
paths:
9+
- 'src/**/*'
10+
- '!src/**/*.spec.*'
11+
- '!src/**/*.test.*'
812

913
concurrency:
1014
group: 'release'

.github/workflows/publish-npm.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ run-name: Publish NPM Package
55
on:
66
push:
77
branches: ['main']
8+
paths:
9+
- 'src/**/*'
10+
- '!src/**/*.spec.*'
11+
- '!src/**/*.test.*'
812

913
concurrency:
1014
group: 'publish'

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ import { imageTypes, compressImage } from 'simple-image-compressor';
5353

5454
```ts
5555
const imageTypes = {
56-
PNG: 'image/png',
56+
WEBP: 'image/webp',
5757
JPEG: 'image/jpeg',
58-
GIF: 'image/gif',
5958
}
6059
```
6160

package-lock.json

Lines changed: 24 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-image-compressor",
3-
"version": "1.4.2",
3+
"version": "1.5.0",
44
"type": "module",
55
"description": "Simple frontend JS library to compress images",
66
"main": "./dist/index.js",

src/imageTypes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export const imageTypes = {
2-
PNG: 'image/png',
2+
WEBP: 'image/webp',
33
JPEG: 'image/jpeg',
4-
GIF: 'image/gif',
54
} as const;

vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// vite.config.js
2-
import { resolve } from 'path';
2+
import { fileURLToPath } from 'node:url';
33
import { defineConfig } from 'vite';
44
import dts from 'vite-plugin-dts';
55

@@ -16,7 +16,7 @@ export default defineConfig({
1616
build: {
1717
lib: {
1818
// Could also be a dictionary or array of multiple entry points
19-
entry: resolve(__dirname, 'src/main.ts'),
19+
entry: fileURLToPath(new URL('src/main.ts', import.meta.url)),
2020
fileName: 'index',
2121
name: 'simple-image-compressor',
2222
formats: ['es'],

0 commit comments

Comments
 (0)