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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mediafly/extension-cli

v2.1.1

Published

Development utility for Mediafly Extensions

Downloads

16

Readme

Mediafly Extensions CLI

Quick Start

Install extension-cli as a global dependency from npm:

$ npm install @mediafly/extension-cli -g

Initialize a new Extension project:

$ extension-cli init

Start developing locally:

$ extension-cli serve

Initialize

Run extension-cli init. See Explanation for required parameters for details on how to find information requested by this command.

Note: The init command creates mfly-interactive.config.json at the root of your Extension. mfly-interactive.config.json contains Airship user specific information. Be sure to add it to your .gitignore file.

Develop Locally

Run extension-cli serve. This command will start a new BrowserSync server which will proxy Viewer and serve local Extension files.

Please note that local changes to the Extension will not update the uploaded Extension. When finished making changes, you will need to upload the Extension in Airship again.

Testing on iOS

Note: You must include interactive-manifest.json at the root of the extension for this debugging setup to work. The contents of the file can simply be an empty object ({})

extension-cli can speed up testing of Extensions on iOS. Specifically it provides the following 2 features:

  1. Extension will live reload in the iOS app upon file save.
  2. JavaScript console messages from the iOS WebView will be shown in the terminal.

Steps to set this up:

  1. Ensure extension-cli serve command is running.
  2. Open the iOS app and tap Settings > More > About on the bottom.
  3. You should see a Select Server dialog. Select the correct server based on your IP address.
  4. Navigate to the specific Extension you are working on.
  5. Open the Extension.

Now you are set to test your Extension on iOS. Turn off the debugging proxy by following the same steps above.

Packaging an Extension

While the publish command will package and upload the Extension, extension-cli can only package the Extension as well by running:

$ extension-cli release

Publishing an Extension

Once you are ready to test the Extension on other platforms, or if you are ready to publish it for your users, you can publish it by using the following command.

$ extension-cli publish

Open Extension in Airship or Viewer

You can navigate to the Extension in Airship or Viewer by using the open command by running:

extension-cli open airship
extension-cli open viewer

Using multiple config files

When you are using build tools such as Grunt, or Gulp, and compiling your single page application to a folder such as dist, you may not want the mfly-interactive.config.json file in your dist folder. This folder could be deleted and recreated during a file watch trigger that recompiles the whole app. In this case, you can put your config file in the parent folder of the dist folder, and point extension-cli at that config file. You can supply a --config option to extension-cli. Another use case for being able to use multiple config files is when you are managing multiple Extension uploaded in Airship (for development, staging, production, etc.)

Below are some examples:

extension-cli serve --config ../mfly-interactive.config.json
extension-cli publish --config ../config/mfly-interactive-prod.config.json

Explanation for Required Parameters

  • Airship User ID and Password: Credentials used to log into https://airship.mediafly.com
  • Airship Folder Id: This is the Id for a folder in Airship where the Extension will be created. You can locate it by navigating to the item in Airship and extractig it from the URL. In the following example, the Airship folder Id is 0-411367-411368.
  • Company Code: Company code used in Viewer.

Reconfiguring

It is possible that the Airship Item Id or the Viewer slug of the your Extension changes. In this case, you will need to reconfigure the Extension. You can do this by runninig extension-cli init again.

A note on HTTPS

Your browser will show a warning about HTTPs. Ignore this warning.