Skip to content

Commit 0f513a9

Browse files
feat: Initial release
1 parent 144bd66 commit 0f513a9

21 files changed

Lines changed: 761 additions & 129 deletions

.github/ISSUE_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**Warning:**
2+
3+
These issues are not tracked. Please create new issues in the main Appium
4+
repository: https://github.com/appium/appium/issues/new

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "11:00"
8+
open-pull-requests-limit: 10
9+
commit-message:
10+
prefix: "chore"
11+
include: "scope"

.github/workflows/pr-title.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Conventional Commits
2+
on:
3+
pull_request:
4+
types: [opened, edited, synchronize, reopened]
5+
6+
7+
jobs:
8+
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 }}

.github/workflows/publish.js.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ master ]
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
issues: write
12+
13+
jobs:
14+
build:
15+
runs-on: macos-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: lts/*
21+
check-latest: true
22+
- run: npm install --no-package-lock
23+
name: Install dev dependencies
24+
- run: npm run build
25+
name: Run build
26+
- run: npm run test
27+
name: Run test
28+
- run: npx semantic-release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
name: Release

.github/workflows/unit-test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Unit Tests
2+
3+
on: [pull_request, push]
4+
5+
6+
jobs:
7+
prepare_matrix:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
versions: ${{ steps.generate-matrix.outputs.lts }}
11+
steps:
12+
- name: Select LTS versions of Node.js
13+
id: generate-matrix
14+
uses: msimerson/node-lts-versions@v1
15+
16+
test:
17+
needs:
18+
- prepare_matrix
19+
strategy:
20+
matrix:
21+
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
22+
runs-on: macos-latest
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- run: npm install --no-package-lock
29+
name: Install dev dependencies
30+
- run: npm run lint
31+
name: Run linter
32+
- run: npm run test
33+
name: Run unit tests

.gitignore

Lines changed: 25 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,36 @@
1-
# Logs
2-
logs
3-
*.log
1+
# Dependencies
2+
node_modules/
3+
package-lock.json*
44
npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
337

34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# Snowpack dependency directory (https://snowpack.dev/)
45-
web_modules/
46-
47-
# TypeScript cache
8+
# Build outputs
9+
build/
10+
dist/
4811
*.tsbuildinfo
4912

50-
# Optional npm cache directory
51-
.npm
13+
# IDE
14+
.vscode/
15+
.idea/
16+
*.swp
17+
*.swo
5218

53-
# Optional eslint cache
54-
.eslintcache
19+
# OS
20+
.DS_Store
21+
Thumbs.db
5522

56-
# Optional stylelint cache
57-
.stylelintcache
58-
59-
# Optional REPL history
60-
.node_repl_history
61-
62-
# Output of 'npm pack'
63-
*.tgz
23+
# Logs
24+
logs/
25+
*.log
6426

65-
# Yarn Integrity file
66-
.yarn-integrity
27+
# Coverage
28+
coverage/
29+
.nyc_output/
6730

68-
# dotenv environment variable files
31+
# Environment
6932
.env
70-
.env.*
71-
!.env.example
72-
73-
# parcel-bundler cache (https://parceljs.org/)
74-
.cache
75-
.parcel-cache
76-
77-
# Next.js build output
78-
.next
79-
out
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and not Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# vuepress v2.x temp and cache directory
95-
.temp
96-
.cache
97-
98-
# Sveltekit cache directory
99-
.svelte-kit/
100-
101-
# vitepress build output
102-
**/.vitepress/dist
103-
104-
# vitepress cache directory
105-
**/.vitepress/cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# Firebase cache directory
120-
.firebase/
121-
122-
# TernJS port file
123-
.tern-port
124-
125-
# Stores VSCode versions used for testing VSCode extensions
126-
.vscode-test
127-
128-
# yarn v3
129-
.pnp.*
130-
.yarn/*
131-
!.yarn/patches
132-
!.yarn/plugins
133-
!.yarn/releases
134-
!.yarn/sdks
135-
!.yarn/versions
136-
137-
# Vite logs files
138-
vite.config.js.timestamp-*
139-
vite.config.ts.timestamp-*
33+
.env.local
34+
.env.development.local
35+
.env.test.local
36+
.env.production.local

.mocharc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
require: ['ts-node/register'],
3+
timeout: 60000,
4+
exit: true,
5+
recursive: true,
6+
spec: [
7+
'./test/unit/**/*-specs.ts',
8+
'./test/e2e/**/*-specs.ts'
9+
]
10+
};

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
registry=https://registry.npmjs.org/
2+
package-lock=false

.releaserc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"plugins": [
3+
["@semantic-release/commit-analyzer", {
4+
"preset": "angular",
5+
"releaseRules": [
6+
{"type": "chore", "release": "patch"}
7+
]
8+
}],
9+
["@semantic-release/release-notes-generator", {
10+
"preset": "conventionalcommits",
11+
"presetConfig": {
12+
"types": [
13+
{"type": "feat", "section": "Features"},
14+
{"type": "fix", "section": "Bug Fixes"},
15+
{"type": "perf", "section": "Performance Improvements"},
16+
{"type": "revert", "section": "Reverts"},
17+
{"type": "chore", "section": "Miscellaneous Chores"},
18+
{"type": "refactor", "section": "Code Refactoring"},
19+
{"type": "docs", "section": "Documentation", "hidden": true},
20+
{"type": "style", "section": "Styles", "hidden": true},
21+
{"type": "test", "section": "Tests", "hidden": true},
22+
{"type": "build", "section": "Build System", "hidden": true},
23+
{"type": "ci", "section": "Continuous Integration", "hidden": true}
24+
]
25+
}
26+
}],
27+
["@semantic-release/changelog", {
28+
"changelogFile": "CHANGELOG.md"
29+
}],
30+
"@semantic-release/npm",
31+
["@semantic-release/git", {
32+
"assets": ["docs", "package.json", "CHANGELOG.md"],
33+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
34+
}],
35+
"@semantic-release/github"
36+
]
37+
}

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
11
# node-devicectl
2-
Node.js wrapper over Xcode's devicectl tool
2+
3+
Node.js wrapper around Apple's `devicectl` tool, the command-line utility to control iOS devices. `devicectl` is run as a sub-command of xcrun and requires Xcode 15+ and iOS 17+.
4+
5+
## Installation
6+
7+
Install through npm.
8+
9+
```bash
10+
npm install node-devicectl
11+
```
12+
13+
## API
14+
15+
The module exports a single class `Devicectl`. This class contains methods which wrap various devicectl subcommands.
16+
17+
### Advanced Usage
18+
19+
Any devicectl subcommand could be called via `execute` method,
20+
which accepts the subcommand itself as the first argument and the set of options. For example:
21+
22+
```typescript
23+
import { Devicectl } from 'node-devicectl';
24+
25+
const devicectl = new Devicectl('device-udid');
26+
const processes = await devicectl.listProcesses();
27+
await devicectl.launchApp('com.example.app', {
28+
env: { DEBUG: '1' },
29+
terminateExisting: true
30+
});
31+
```
32+
33+
## Requirements
34+
35+
- Xcode 15+
36+
- iOS 17+
37+
- Node.js 20.19.0+ || 22.12.0+ || 24.0.0+
38+
39+
## License
40+
41+
Apache-2.0

0 commit comments

Comments
 (0)