Skip to content

Commit 26df9e7

Browse files
committed
Merge branch 'main' of github.com:AutomateThePlanet/appium-novawindows-driver
2 parents ccdc927 + 1ff6505 commit 26df9e7

File tree

10 files changed

+168
-5
lines changed

10 files changed

+168
-5
lines changed

.gitignore

Lines changed: 141 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,142 @@
1-
node_modules
2-
build
1+
# Logs
2+
logs
33
*.log
4-
.vscode
5-
package-lock.json*
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variable files
76+
.env
77+
.env.development.local
78+
.env.test.local
79+
.env.production.local
80+
.env.local
81+
82+
# parcel-bundler cache (https://parceljs.org/)
83+
.cache
84+
.parcel-cache
85+
86+
# Next.js build output
87+
.next
88+
out
89+
90+
# Nuxt.js build / generate output
91+
.nuxt
92+
dist
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# vitepress build output
108+
**/.vitepress/dist
109+
110+
# vitepress cache directory
111+
**/.vitepress/cache
112+
113+
# Docusaurus cache and generated files
114+
.docusaurus
115+
116+
# Serverless directories
117+
.serverless/
118+
119+
# FuseBox cache
120+
.fusebox/
121+
122+
# DynamoDB Local files
123+
.dynamodb/
124+
125+
# TernJS port file
126+
.tern-port
127+
128+
# Stores VSCode versions used for testing VSCode extensions
129+
.vscode-test
130+
131+
# yarn v2
132+
.yarn/cache
133+
.yarn/unplugged
134+
.yarn/build-state.yml
135+
.yarn/install-state.gz
136+
.pnp.*
137+
138+
# NovaWindows driver build directory
139+
build/
140+
141+
# Ignore package-lock.json in favour of npm-shrinkwrap.json for npm publishing
142+
package-lock.json*

eslint.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import { config, configs } from 'typescript-eslint';
5+
import appiumConfig from '@appium/eslint-config-appium-ts';
6+
7+
8+
export default config(
9+
...appiumConfig,
10+
eslint.configs.recommended,
11+
configs.recommended,
12+
);

lib/commands/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ type KeyAction = {
9494
down?: boolean,
9595
}
9696

97+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9798
export async function execute(this: NovaWindowsDriver, script: string, args: any[]) {
9899
if (script.startsWith(PLATFORM_COMMAND_PREFIX)) {
99100
script = script.replace(PLATFORM_COMMAND_PREFIX, '').trim();

lib/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Commands = {
2222
};
2323

2424
declare module '../driver' {
25+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
2526
interface NovaWindowsDriver extends Commands {}
2627
}
2728

lib/commands/powershell.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ export async function startPowerShellSession(this: NovaWindowsDriver): Promise<v
1515
powerShell.stdout.setEncoding('utf8');
1616
powerShell.stdout.setEncoding('utf8');
1717

18+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1819
powerShell.stdout.on('data', (chunk: any) => {
1920
this.powerShellStdOut += chunk.toString();
2021
});
2122

23+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2224
powerShell.stderr.on('data', (chunk: any) => {
2325
this.powerShellStdErr += chunk.toString();
2426
});
@@ -86,6 +88,7 @@ export async function sendPowerShellCommand(this: NovaWindowsDriver, command: st
8688
powerShell.stdin.write(`${command}\n`);
8789
powerShell.stdin.write(/* ps1 */ `Write-Output $([char]0x${magicNumber.toString(16)})\n`);
8890

91+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8992
const onData: Parameters<typeof powerShell.stdout.on>[1] = ((chunk: any) => {
9093
const magicChar = String.fromCharCode(magicNumber);
9194
if (chunk.toString().includes(magicChar)) {

lib/enums.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] exte
44

55
type IntRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>> | T
66

7+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
78
type AllFlagsValue<N extends number, A extends any[] = []> = [N] extends [Partial<A>['length']] ? A['length'] : UnionFlags<N, [0, ...A, ...A]>;
9+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
810
type UnionFlags<N extends number, A extends any[] = []> = IntRange<0, AllFlagsValue<N, A>>;
911

1012
export type Enum<T> = T[keyof T];

lib/powershell/conditions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export class FalseCondition extends Condition {
162162
}
163163
}
164164

165+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
165166
function assertPSObjectType(obj: PSObject, type: new (...args: any[]) => PSObject) {
166167
if (!(obj instanceof type)) {
167168
throw new errors.InvalidArgumentError(`Property expected type ${type.name} but got ${(obj as object)?.constructor.name}.`);

lib/powershell/core.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function pwsh(strings: TemplateStringsArray, ...values: string[]): string
2020
export function pwsh$(literals: TemplateStringsArray, ...substitutions: number[]) {
2121
const templateInstance = $(literals, ...substitutions);
2222
const defaultFormat = templateInstance.format.bind(templateInstance);
23+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2324
templateInstance.format = (...args: any[]) => {
2425
const command = defaultFormat(...args);
2526
return /* ps1 */ `(Invoke-Expression -Command ([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${btoa(command)}'))))`;

lib/util.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export class DeferredStringTemplate {
4141
});
4242
}
4343

44+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4445
format(...args: any[]): string {
4546
const out: string[] = [];
4647
for (let i = 0, k = 0; i < this.literals.length; i++, k++) {

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
"@appium/eslint-config-appium-ts": "^1.0.3",
3333
"@appium/tsconfig": "^0.3.5",
3434
"@appium/types": "^0.25.2",
35-
"@types/node": "^22.14.0"
35+
"@types/node": "^22.14.0",
36+
"@eslint/js": "^9.23.0",
37+
"eslint": "^9.23.0",
38+
"typescript": "^5.8.2",
39+
"typescript-eslint": "^8.28.0"
3640
}
3741
}

0 commit comments

Comments
 (0)