Skip to content

Commit 10140ee

Browse files
authored
Refactor (#20)
* Move to typescript * Add Tests and Lint * Also build before lint
1 parent 6c4495e commit 10140ee

File tree

15 files changed

+1002
-154
lines changed

15 files changed

+1002
-154
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
dist

.eslintrc.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

.eslintrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 2019,
4+
"sourceType": "module"
5+
},
6+
"env": {
7+
"es6": true
8+
},
9+
"extends": ["airbnb-base"]
10+
}

.github/workflows/test-lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test & Lint
2+
3+
on: pull_request
4+
5+
jobs:
6+
test:
7+
name: Test
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Check out Git repository
12+
uses: actions/checkout@v2
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 14
18+
19+
- name: Install Node.js dependencies
20+
run: npm ci
21+
22+
- name: Run Lint
23+
run: npm run lint
24+
25+
- name: Run Tests
26+
run: npm run test

.mocharc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"spec": ["test/**/*.spec.js"]
3+
}

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.idea
2+
.github
3+
4+
src
5+
test
6+
7+
rollup.config.js

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
forceUpscale: false,
2727
skipExisting: true,
2828
maxParallel: 4,
29+
outputManifest: 'static/images-manifest.json'
2930
})
3031
]
3132
}
@@ -52,5 +53,7 @@ Note: All output files are named in the pattern `<original-filename>@<size>w.<fi
5253

5354
`maxParallel` (default: 4 | `int`): the max number of parallel images that can be processed concurrently.
5455

56+
`outputManifest` (default: null | `string`): the file to output a json containing all the images this plugin generated.
57+
5558
## License
5659
MIT

0 commit comments

Comments
 (0)