npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bentest-target-adder

v0.0.2

Published

Example Capacitor plugin: add extra iOS targets (e.g. a widget) to an OutSystems-built app, with per-target provisioning profiles delivered as App Resources

Downloads

162

Readme

bentest-target-adder

An example Capacitor plugin that adds extra iOS targets — such as a WidgetKit widget — to an OutSystems-built mobile app, with each target bound to its own provisioning profile. It runs entirely at build time via a capacitor:sync:before hook; it has no runtime API and contributes no native module (so it never touches the app's Podfile/Package.swift).

Provided as-is, as a working reference. It is not an OutSystems product and is not supported as one.

How it works

During npx cap sync ios (which the OutSystems build pipeline runs on every build):

  1. Profiles — every .mobileprovision found in the web dir (delivered as App Resources) is decoded with security cms and installed into ~/Library/MobileDevice/Provisioning Profiles/<UUID>.mobileprovision, the directory Xcode reads at signing time. Profiles are identified by the App ID inside them, never by filename — App Resource delivery renames files.
  2. Payload — every .zip in the web dir is extracted; a zip containing a directory that matches a payloadDir from scripts/targets.json is treated as that target's payload (Sources/, Info.plist, optional *.entitlements and Resources/) and staged under ios/App/<TargetName>/. Loose files are supported as a fallback, classified by extension.
  3. Targetscripts/add_target.rb (Ruby, using the xcodeproj gem — the only complete API for editing project.pbxproj) creates the target, sets its bundle ID (<appId>.<bundleIdSuffix>), Manual signing against the matched profile, sources/resources phases, the host-app dependency, and the kind-appropriate embed phase. If the payload carries an App Group entitlement, the group is also merged into the host app's entitlements.

Everything is idempotent — repeated syncs never duplicate targets, phases, or profiles — and a build with no payload present is left untouched (the hook exits 0).

Declaring targets

Edit scripts/targets.json. Example:

{
  "targets": [
    {
      "name": "TestWidget",
      "kind": "app_extension",
      "bundleIdSuffix": "widget",
      "payloadDir": "widgetpayload",
      "entitlements": true
    }
  ]
}

kind accepts any Xcodeproj product-type symbol (app_extension, messages_extension, sticker_pack, tv_extension, application_on_demand_install_capable, …). An unknown kind fails with the full list of supported symbols.

What to upload as App Resources

  • One .zip per target: <payloadDir>/Sources/**, <payloadDir>/Info.plist (use $(...) build-setting variables for identity values so the file needs no per-app edits), optional <payloadDir>/*.entitlements and <payloadDir>/Resources/**.
  • Each extra target's provisioning profile as a bare .mobileprovision (outside the zip), so renewing a profile is a one-file re-upload.

Prerequisites (Apple Developer portal)

  • An explicit App ID per target: <app's App ID>.<bundleIdSuffix>, under the same team whose certificate signs the app in the OutSystems build.
  • One provisioning profile per App ID, of the type matching the build (e.g. ad-hoc), backed by that same distribution certificate.
  • For App Groups: assign the group to both the host and extension App IDs and regenerate both profiles.

Build-log markers

Successful runs log, in order: [target-adder] cwd=…extracted App Resource zip …installed profile …matched profile … by App ID → the created target's resolved build settings. Later in the build, fastlane's Detected provisioning profile mapping: line should list every bundle ID with its profile.