Skip to content

Commit 336f122

Browse files
moar
1 parent 401ac00 commit 336f122

File tree

9 files changed

+45
-100
lines changed

9 files changed

+45
-100
lines changed

.github/workflows/format-check.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,21 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
prepare_matrix:
11-
runs-on: ubuntu-latest
12-
outputs:
13-
versions: ${{ steps.generate-matrix.outputs.lts }}
14-
steps:
15-
- name: Select all current LTS versions of Node.js
16-
id: generate-matrix
17-
uses: msimerson/node-lts-versions@v1
18-
1910
format-check:
2011
runs-on: macos-latest
21-
needs:
22-
- prepare_matrix
23-
strategy:
24-
fail-fast: false
25-
matrix:
26-
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
2712
steps:
2813
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v3
29-
- name: Use Node.js ${{ matrix.node-version }}
14+
- name: Use Node.js (LTS)
3015
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v3
3116
with:
32-
node-version: ${{ matrix.node-version }}
17+
node-version: 'lts/*'
3318
- name: Install dependencies
3419
run: npm install
35-
20+
3621
- name: Check formatting
3722
# Run prettier in check mode (doesn't modify files)
3823
run: npm run format:check
39-
24+
4025
- name: Format instructions (if check fails)
4126
if: ${{ failure() }}
4227
run: |
Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,17 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
prepare_matrix:
11-
runs-on: ubuntu-latest
12-
outputs:
13-
versions: ${{ steps.generate-matrix.outputs.lts }}
14-
steps:
15-
- name: Select all current LTS versions of Node.js
16-
id: generate-matrix
17-
uses: msimerson/node-lts-versions@v1
10+
node_matrix:
11+
uses: appium/appium-workflows/.github/workflows/node-lts-matrix.yml@main
1812

19-
lint-and-build:
13+
lint:
2014
runs-on: macos-latest
2115
needs:
22-
- prepare_matrix
16+
- node_matrix
2317
strategy:
2418
fail-fast: false
2519
matrix:
26-
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
20+
node-version: ${{ fromJSON(needs.node_matrix.outputs.versions) }}
2721
steps:
2822
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v3
2923
- name: Use Node.js ${{ matrix.node-version }}
@@ -32,9 +26,6 @@ jobs:
3226
node-version: ${{ matrix.node-version }}
3327
- name: Install dependencies
3428
run: npm install
35-
29+
3630
- name: Lint
3731
run: npm run lint
38-
39-
- name: Build
40-
run: npm run build

.github/workflows/pr-title.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,8 @@ on:
33
pull_request:
44
types: [opened, edited, synchronize, reopened]
55

6-
76
jobs:
87
lint:
9-
name: https://www.conventionalcommits.org
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: beemojs/conventional-pr-action@v3
13-
with:
14-
config-preset: angular
15-
env:
16-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8+
uses: appium/appium-workflows/.github/workflows/pr-title.yml@main
9+
with:
10+
config-preset: angular

.github/workflows/test-validation.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,17 @@ on:
77
branches: [ main ]
88

99
jobs:
10-
prepare_matrix:
11-
runs-on: ubuntu-latest
12-
outputs:
13-
versions: ${{ steps.generate-matrix.outputs.lts }}
14-
steps:
15-
- name: Select all current LTS versions of Node.js
16-
id: generate-matrix
17-
uses: msimerson/node-lts-versions@v1
18-
10+
node_matrix:
11+
uses: appium/appium-workflows/.github/workflows/node-lts-matrix.yml@main
12+
1913
validate-tests:
2014
runs-on: macos-latest
2115
needs:
22-
- prepare_matrix
16+
- node_matrix
2317
strategy:
2418
fail-fast: false
2519
matrix:
26-
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
20+
node-version: ${{ fromJSON(needs.node_matrix.outputs.versions) }}
2721
steps:
2822
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v3
2923
- name: Use Node.js ${{ matrix.node-version }}
@@ -32,9 +26,9 @@ jobs:
3226
node-version: ${{ matrix.node-version }}
3327
- name: Install dependencies
3428
run: npm install
35-
29+
3630
- name: Build project including tests
3731
run: npm run build
38-
32+
3933
- name: Run unit tests
4034
run: npm run test:unit

.mocharc.cjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
require: ['tsx/cjs'],
3+
'node-option': ['import=tsx'],
4+
forbidOnly: Boolean(process.env.CI),
5+
};

.mocharc.json

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

src/services/ios/afc/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -614,12 +614,14 @@ export class AfcService {
614614
const localDstIsDirectory = await this._isLocalDirectory(localDstDir);
615615

616616
if (!localDstIsDirectory) {
617-
const stat = await fsp.stat(localDstDir).catch((err) => {
618-
if (err.code === 'ENOENT') {
619-
return null;
620-
}
621-
throw err;
622-
});
617+
const stat = await fsp
618+
.stat(localDstDir)
619+
.catch((err: NodeJS.ErrnoException): null => {
620+
if (err.code === 'ENOENT') {
621+
return null;
622+
}
623+
throw err;
624+
});
623625
if (stat?.isFile()) {
624626
throw new Error(
625627
`Local destination exists and is a file, not a directory: ${localDstDir}`,

test/unit/apple-tv/encryption/opack2.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ describe('Apple TV Encryption - Opack2', () => {
130130
});
131131

132132
it('should handle objects with undefined values', () => {
133-
const obj = { a: 1, b: undefined, c: 3 };
133+
const obj: { a: number; b: undefined; c: number } = {
134+
a: 1,
135+
b: undefined,
136+
c: 3,
137+
};
134138
const result = Opack2.dumps(obj);
135139
expect(result[0]).to.equal(0xe3);
136140
});

tsconfig.json

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,14 @@
11
{
22
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "@appium/tsconfig/tsconfig.json",
34
"compilerOptions": {
4-
"module": "NodeNext",
5-
"target": "es2022",
6-
"preserveSymlinks": true,
7-
"rootDir": "./",
8-
95
"strict": true,
10-
"esModuleInterop": true,
11-
"skipLibCheck": true,
12-
"forceConsistentCasingInFileNames": true,
13-
14-
"outDir": "./build",
15-
"declaration": true,
16-
"declarationMap": true,
17-
"removeComments": false,
18-
"lib": ["es2023"],
19-
"types": ["node", "mocha", "chai"],
20-
21-
"allowSyntheticDefaultImports": true,
22-
"noImplicitAny": true,
23-
"noImplicitThis": false,
24-
"noUnusedParameters": false,
25-
"verbatimModuleSyntax": true,
6+
"strictNullChecks": false,
7+
"outDir": "build",
8+
"types": ["node", "mocha", "chai"]
269
},
27-
2810
"include": [
29-
"./src/**/*.ts",
30-
"./test/**/*.ts"
31-
],
32-
33-
"exclude": [
34-
"node_modules",
11+
"src",
12+
"test"
3513
]
36-
}
14+
}

0 commit comments

Comments
 (0)