Skip to content

Commit 2b7f4be

Browse files
authored
Merge pull request #112 from KnorpelSenf/maintenance
chore: perform various maintenance tasks
2 parents dce2650 + a55e11a commit 2b7f4be

23 files changed

+520
-331
lines changed

.eslintrc.js

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

.github/workflows/run-tests.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44
name: Tests
55

66
on:
7-
push:
8-
branches: [ master ]
9-
pull_request:
10-
branches: [ master ]
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
1111

1212
jobs:
13-
build:
13+
build:
14+
runs-on: ubuntu-latest
1415

15-
runs-on: ubuntu-latest
16+
strategy:
17+
max-parallel: 2
18+
matrix:
19+
node-version: [20, 22, 23]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1621

17-
strategy:
18-
matrix:
19-
node-version: [16, 18, 20]
20-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21-
22-
steps:
23-
- uses: actions/checkout@v4
24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: ${{ matrix.node-version }}
28-
- run: npm install -d
29-
- run: npm run lint
30-
- run: npm test
31-
- run: npm run test-integration
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- run: npm install -d
29+
- run: npm run lint
30+
- run: npm test
31+
- run: npm run test-integration

.mocharc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"require": "tsx",
3+
"spec": [
4+
"tests/**/*.ts"
5+
]
6+
}

.eslintignore renamed to .prettierignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.DS_Store
2-
.idea
31
node_modules/
42
built/
53
package-lock.json

.prettierrc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"singleQuote": true,
3-
"trailingComma": "none",
4-
"htmlWhitespaceSensitivity": "ignore",
5-
"tabWidth": 4,
6-
"semi": true,
7-
"arrowParens": "avoid"
8-
}
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"htmlWhitespaceSensitivity": "ignore",
5+
"tabWidth": 4,
6+
"semi": true,
7+
"arrowParens": "avoid"
8+
}

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"editor.formatOnSave": true,
33
"editor.codeActionsOnSave": {
4-
"source.fixAll": true
4+
"source.fixAll": "explicit"
5+
},
6+
"[md]": {
7+
"editor.defaultFormatter": "esbenp.prettier-vscode"
8+
},
9+
"[typescript]": {
10+
"editor.defaultFormatter": "esbenp.prettier-vscode"
511
}
612
}

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cloudconvert-node
22

3-
This is the official Node.js SDK v2 for the [CloudConvert](https://cloudconvert.com/api/v2) **API v2**.
3+
This is the official Node.js SDK for the [CloudConvert](https://cloudconvert.com/api/v2) API v2.
44

55
[![Node.js Run Tests](https://github.com/cloudconvert/cloudconvert-node/actions/workflows/run-tests.yml/badge.svg)](https://github.com/cloudconvert/cloudconvert-node/actions/workflows/run-tests.yml)
66
[![npm](https://img.shields.io/npm/v/cloudconvert.svg)](https://www.npmjs.com/package/cloudconvert)
@@ -86,15 +86,15 @@ const job = await cloudConvert.jobs.create({
8686
}
8787
});
8888

89-
const uploadTask = job.tasks.filter(task => task.name === 'upload-my-file')[0];
89+
const uploadTask = job.tasks.find(task => task.name === 'upload-my-file');
9090

9191
const inputFile = fs.createReadStream('./file.pdf');
9292

9393
await cloudConvert.tasks.upload(uploadTask, inputFile, 'file.pdf');
9494
```
95-
> **Note on custom streams**:
96-
The length of the stream needs to be known prior to uploading. The SDK automatically detects the file size of file-based read streams. If you are using a custom stream, you need to pass a `filesize` as fourth parameter to the `upload()` method.
9795

96+
> **Note on custom streams**:
97+
The length of the stream needs to be known prior to uploading. The SDK tries to automatically detect the file size of file-based read streams. If you are using a custom stream, you might need to pass a `fileSize` as fourth parameter to the `upload()` method.
9898

9999
## Websocket Events
100100

@@ -242,5 +242,5 @@ and even auto-fix as many things as possible by running
242242

243243
## Resources
244244

245-
- [API v2 Documentation](https://cloudconvert.com/api/v2)
246-
- [CloudConvert Blog](https://cloudconvert.com/blog)
245+
- [API v2 Documentation](https://cloudconvert.com/api/v2)
246+
- [CloudConvert Blog](https://cloudconvert.com/blog)

eslint.config.mjs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { defineConfig, globalIgnores } from 'eslint/config';
2+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
3+
import globals from 'globals';
4+
import tsParser from '@typescript-eslint/parser';
5+
import path from 'node:path';
6+
import { fileURLToPath } from 'node:url';
7+
import js from '@eslint/js';
8+
import { FlatCompat } from '@eslint/eslintrc';
9+
10+
const __filename = fileURLToPath(import.meta.url);
11+
const __dirname = path.dirname(__filename);
12+
const compat = new FlatCompat({
13+
baseDirectory: __dirname,
14+
recommendedConfig: js.configs.recommended,
15+
allConfig: js.configs.all
16+
});
17+
18+
export default defineConfig([
19+
globalIgnores([
20+
'**/node_modules/',
21+
'**/built/',
22+
'**/package-lock.json',
23+
'**/package.json',
24+
'tests/unit/requests/',
25+
'tests/unit/responses/',
26+
'.vscode/',
27+
'tsconfig.json',
28+
'.mocharc.json'
29+
]),
30+
{
31+
extends: compat.extends(
32+
'eslint:recommended',
33+
'plugin:@typescript-eslint/recommended'
34+
),
35+
36+
plugins: {
37+
'@typescript-eslint': typescriptEslint
38+
},
39+
40+
languageOptions: {
41+
globals: {
42+
...globals.browser,
43+
...globals.node
44+
},
45+
46+
parser: tsParser,
47+
ecmaVersion: 'latest',
48+
sourceType: 'module'
49+
},
50+
51+
rules: {
52+
'@typescript-eslint/no-explicit-any': 'off'
53+
}
54+
}
55+
]);

0 commit comments

Comments
 (0)