Skip to content

v4: Drop Node 18 and older, rewrite in TypeScript, update deps #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 5, 2025
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
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
labels:
- "automerge"
- "dependencies"
schedule:
interval: "daily"
time: "02:34"
32 changes: 0 additions & 32 deletions .github/workflows/build.yml

This file was deleted.

75 changes: 59 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,79 @@
name: Publish
on:
release:
types: [ created ]
types: [published]

jobs:
build-intel:
name: Build Intel binary
runs-on: macos-13

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: 'https://registry.npmjs.org'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm check

- name: Build
run: pnpm build

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: intel-prebuild
path: prebuilds/darwin-x64/node-ios-device.node

publish:
runs-on: macos-latest
name: Publish
needs: build-intel
runs-on: macos-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: 22
registry-url: 'https://registry.npmjs.org'

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install dependencies
run: yarn install --frozen-lockfile
run: pnpm install

- name: Lint
run: pnpm check

- name: Build
run: pnpm build

- name: Download artifact
uses: actions/download-artifact@v4
with:
name: intel-prebuild
path: prebuilds/darwin-x64

- name: Publish to npm
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish

- name: Archive pre-built bindings
uses: actions/upload-artifact@v3
with:
name: prebuilds
path: prebuilds/**
run: npm publish --tag ${{ github.event.release.prerelease && 'next' || 'latest' }}
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Tests

on:
push:
branches:
- main
pull_request:

concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
test:
name: Test on Node.js ${{ matrix.node }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
node: [20, 22]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm check

- name: Build
run: pnpm build

- name: Run tests
run: pnpm coverage
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
._*
.DS_Store
.nyc_output
.vscode
*.tgz
binding
/build
dist
env.properties
junit.xml
node_modules
npm-debug.log*
/prebuilds
Expand All @@ -16,4 +16,5 @@ xcuserdata/
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcworkspace/contents.xcworkspacedata
yarn-error.log
.pnpm-debug.log
*.tsbuildinfo
18 changes: 0 additions & 18 deletions .npmignore

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v4.0.0

* BREAKING CHANGE: Require Node.js 20.18.1 or newer
* feat: Rewrote in TypeScript.
* chore: Updated dependencies.

# v3.2.1 (Mar 20, 2021)

* build: Moved CI jobs from Jenkins to GitHub actions.
Expand Down
34 changes: 33 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright 2012-2022 by Axway, Inc.
Copyright TiDev, Inc. 4/7/2022-Present
Copyright 2014-2020 by Appcelerator, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -11,3 +12,34 @@ Copyright 2012-2022 by Axway, Inc.
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-------------------------------------------------------------------------------

lib/certs.js contains code from the "forge" project.
https://github.com/digitalbazaar/forge

New BSD License (3-clause)
Copyright (c) 2010, Digital Bazaar, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Digital Bazaar, Inc. nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL DIGITAL BAZAAR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 changes: 36 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# node-ios-device
<br>
<div align="center">
<img width="640" height="200" src="media/banner.jpg" alt="node-ios-device">
</div>
<br>

Queries connected iOS devices, installs apps, and relays log output.

## Prerequisites

`node-ios-device` only works on macOS 10.11 or newer. It use N-API version 3 and requires Node.js
10.13.0 LTS or newer.

## Installation

npm install node-ios-device
Expand All @@ -19,15 +18,13 @@ $ node-ios-device
USAGE: node-ios-device <command> [options]

COMMANDS:
forward Connects to a port on an device and relays messages
i, install Install an app on the specified device
ls, list, devices Lists connected devices
watch, track-devices Listens for devices to be connected/disconnected

GLOBAL OPTIONS:
--no-color Disable colors
-h, --help Displays the help screen
-v, --version Outputs the version
forward <port> <udid> Connects to a port on an device and relays messages
i, install <appPath> <udid> Install an app on the specified device
ls, list Lists connected devices
watch Listens for devices to be connected/disconnected

OPTIONS:
-v, --version Outputs the version
```

## Example
Expand All @@ -48,7 +45,6 @@ handle.on('error', console.error);

// install an iOS app
iosDevice.install('<device udid>', '/path/to/my.app');
console.log('Success!');

// relay output from a TCP port created by an iOS app
iosDevice
Expand Down Expand Up @@ -168,15 +164,32 @@ handy when filing a bug.
iosDevice.on('log', msg => console.log(msg));
```

Alternatively, `node-ios-device` uses the amazing [snooplogg][2] debug logger where you simply
Alternatively, `node-ios-device` uses the amazing [snooplogg](https://www.npmjs.com/package/snooplogg) debug logger where you simply
set the `SNOOPLOGG` environment variable to `node-ios-device` (or `*`) and it will print the debug
log to stdout.

## License
## Contributing

Interested in contributing? There are several ways you can help contribute to this project.

### New Features, Improvements, Bug Fixes, & Documentation

Source code contributions are always welcome! Before we can accept your pull request, you must sign a Contributor License Agreement (CLA). Please visit https://tidev.io/contribute for more information.

### Donations

Please consider supporting this project by making a charitable [donation](https://tidev.io/donate). The money you donate goes to compensate the skilled engineeers and maintainers that keep this project going.

### Code of Conduct

TiDev wants to provide a safe and welcoming community for everyone to participate. Please see our [Code of Conduct](https://tidev.io/code-of-conduct) that applies to all contributors.

## Security

If you find a security related issue, please send an email to [security@tidev.io](mailto:security@tidev.io) instead of publicly creating a ticket.

## Stay Connected

This project is open source and provided under the Apache Public License (version 2). Please make
sure you see the [LICENSE][1] file included in this distribution for more details on the license. Also,
please take notice of the privacy notice at the end of the file.
For the latest information, please find us on X: [Titanium SDK](https://x.com/titaniumsdk) and [TiDev](https://x.com/tidevio).

[1]: https://github.com/tidev/node-ios-device/blob/master/LICENSE
[2]: https://www.npmjs.com/package/snooplogg
Join our growing Slack community by visiting https://slack.tidev.io!
Loading