Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/devicectl.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {exec, SubProcess} from 'teen_process';
import logger from '@appium/logger';
import type {DevicectlOptions, ExecuteOptions, ExecuteResult} from './types';
import * as processMixins from './mixins/process';
import * as infoMixins from './mixins/info';
import * as copyMixins from './mixins/copy';
import * as listMixins from './mixins/list';
import {log as logger} from '@appium/logger';
import type {DevicectlOptions, ExecuteOptions, ExecuteResult} from './types.js';
import * as processMixins from './mixins/process.js';
import * as infoMixins from './mixins/info.js';
import * as copyMixins from './mixins/copy.js';
import * as listMixins from './mixins/list.js';

const XCRUN = 'xcrun';
const LOG_TAG = 'Devicectl';
Expand Down
4 changes: 2 additions & 2 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export {Devicectl} from './devicectl';
export type * from './types';
export {Devicectl} from './devicectl.js';
export type * from './types.js';
4 changes: 2 additions & 2 deletions lib/mixins/copy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {ListFilesOptions, PullFileOptions} from '../types';
import type {Devicectl} from '../devicectl';
import type {ListFilesOptions, PullFileOptions} from '../types.js';
import type {Devicectl} from '../devicectl.js';

/**
* Lists files at a specified path on the device
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/info.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {AppInfo, ProcessInfo} from '../types';
import type {Devicectl} from '../devicectl';
import type {AppInfo, ProcessInfo} from '../types.js';
import type {Devicectl} from '../devicectl.js';

/**
* Retrieves the list of installed apps from the device
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/list.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {DeviceInfo} from '../types';
import type {Devicectl} from '../devicectl';
import type {DeviceInfo} from '../types.js';
import type {Devicectl} from '../devicectl.js';

/**
* Retrieves the list of connected device infos.
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/process.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {LaunchAppOptions, ProcessInfo, TerminateAppOptions} from '../types';
import type {Devicectl} from '../devicectl';
import type {LaunchAppOptions, ProcessInfo, TerminateAppOptions} from '../types.js';
import type {Devicectl} from '../devicectl.js';

/**
* Simulates memory warning for the process with the given PID
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"format": "prettier -w ./lib ./test",
"format:check": "prettier --check ./lib ./test",
"prepare": "npm run build",
"test": "node --test --test-timeout=60000 \"./build/test/unit/**/*.spec.js\"",
"e2e-test": "node --test --test-force-exit --test-concurrency=1 --test-timeout=300000 \"./build/test/e2e/**/*.spec.js\""
"test": "node --enable-source-maps --test --test-timeout=60000 \"./build/test/unit/**/*.spec.js\"",
"e2e-test": "node --enable-source-maps --test --test-force-exit --test-concurrency=1 --test-timeout=300000 \"./build/test/e2e/**/*.spec.js\""
},
"prettier": {
"bracketSpacing": false,
Expand All @@ -66,5 +66,13 @@
"prettier": "^3.0.0",
"semantic-release": "^25.0.2",
"typescript": "^6.0.2"
},
"type": "module",
"exports": {
".": {
"types": "./build/lib/index.d.ts",
"import": "./build/lib/index.js"
},
"./package.json": "./package.json"
}
}
2 changes: 1 addition & 1 deletion test/e2e/sudo-execution.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import {Devicectl} from '../../lib/devicectl';
import {Devicectl} from '../../lib/devicectl.js';
import {describe, it, type TestContext} from 'node:test';

describe('manual sudo execution e2e', function () {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/devicectl.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert/strict';
import {Devicectl} from '../../lib/devicectl';
import {appUrlToFilesystemPath, escapeProcessFilterValue} from '../../lib/mixins/process';
import {Devicectl} from '../../lib/devicectl.js';
import {appUrlToFilesystemPath, escapeProcessFilterValue} from '../../lib/mixins/process.js';
import {describe, it, beforeEach} from 'node:test';

describe('Devicectl', function () {
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"checkJs": true,
"esModuleInterop": true,
"types": ["node"],
"strict": true
"strict": true,
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
"include": ["lib", "test"]
}