npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

mobify-progressive-app-sdk

3.0.6 • Public • Published
                                ▓
                             ▄▓▓▓▌
                            ▓▓▓▓▓▌
                          ▓▓▓▓▓▓▓▌
                        ▄▓▓▓▓▓▓▓▓▓▄▄▄▄
                      ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
                    ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄
                 ▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓
                ▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▄▀▓▓▓▓▄
               ▓▀▀ ▐▓▓▓▓██▀▀▀█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░█▓▓▓▄
             ▐▓     ▀▀         █▓▓▓▓▓▓▓▓▓▓▓▓▓▌ ▓▓▓▓▄
             ▓                   ▀▓▓▓▓▓▓▓▓▓▓▓▓▄▓▓▓▓▓▓▓▄▄▄▄
            ▓▌                     ▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█
            ▐▌                       █▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▀
            ▐▌                        ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▀
            ▐▌                      ▄▄▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▀
             ▓                      ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀
             ▓                       ▓█▀▀   ▀█▓█▀
            ▐▌                      ▐         ▓
             ▓                               ▐▓
              ▀▄                            ▄▀
                ▀▒▄▄              ▄▄▄▀▀▄▄▄▀▀
                    ▀▀▒▄▄▄▄▄▄▒▀▀▀


             █████╗ ███████╗████████╗██████╗  ██████╗
            ██╔══██╗██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗
            ███████║███████╗   ██║   ██████╔╝██║   ██║
            ██╔══██║╚════██║   ██║   ██╔══██╗██║   ██║
            ██║  ██║███████║   ██║   ██║  ██║╚██████╔╝
            ╚═╝  ╚═╝╚══════╝   ╚═╝   ╚═╝  ╚═╝ ╚═════╝

Astro

An SDK that makes it easy to leverage native or web UI for building amazing iOS and Android apps.


BuddyBuild - iOS

BuddyBuild - Android


Related projects

Additional Documents

Table of Contents

Documentation

You can find the Astro documentation at astro.mobify.com or you can view it locally (see Making Changes). We currently publish the documentation for all versions of Astro since v0.5.

The documentation is organized by Astro release in folders. docs/public/ contains one folder for each release of Astro plus a special dev folder for changes related to an unreleased version of Astro. See the release checklist for more information.

You can create "perma-links" to the latest version of Astro documentation by using http://astro.mobify.com/latest/.

Installation

We use Harp to build our docs. Harp is an npm dependency and so is installed when you run npm install in the root of the Astro repo.

Making Changes

Most of our documentation is written in markdown. Changes to any tutorials or reference guides should be changed in /docs.

To preview your changes, run the following:

$ npm run docs:serve

Then browse to http://localhost:9000.

Publishing

The Astro documentation is hosted on S3 at http://astro.mobify.com.s3-website-us-east-1.amazonaws.com, which is the origin for http://astro.mobify.com.

All Astro documentation is published every time a pull request is merged into the develop branch.

Should you need to deploy the docs manually, docs, you will need permission to deploy to the astro.mobify.com S3 bucket (ask in #it on Slack). If you have the correct permissions, ensure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables are set, and run the following to deploy the updated docs site:

$ npm run docs:upload

Installing

Clone the repo: git clone git@github.com:mobify/astro.git

Prerequisites

NPM dependencies

  1. Install npm dependencies (push libraries) by running:
npm install

Android

  1. Download and install Android Studio.
  2. Open Android Studio.
  3. Click Open an existing Android project, and select the astro/sandbox/android folder. Android Studio will open both the Astro Android source code and the Sandbox Android app source code.
  4. Create an Android Virtual Device if you haven't already.
  5. Follow these instructions to install SDK packages.
  6. Run the Sandbox app!

iOS

  1. Download and install Xcode
  2. Run open sandbox/ios/Sandbox.xcworkspace in your Terminal. It will open both the Astro iOS source code and the Sandbox iOS app source code.
  3. Run the Sandbox app!

How to create and ship a change

In order to ship a change to Astro, follow our Contributing guidelines.

Testing

Running Tests

JS

  1. Install the dependencies needed for testing, run npm install.
  2. To run the tests on the command line, run npm test.
  3. To run the tests in the browser, run open js/tests/index.html.

iOS

  1. Start the server required for testing by running npm run fixture-server
  2. In Xcode, select the "Astro" workspace in the workspace dropdown.
  3. Go to Product -> Test (⌘U)

Android

  1. Go to Run -> Edit Configurations
  2. Click on the "+" on the top left, and select "Android Tests"
  3. Label it "Astro Tests", choose the module "astro", and click OK.
  4. Select "Show chooser dialog"
  5. In the drop down next to the green play button, select "Astro Tests" and click the play button.
  6. Watch the tests run!

Writing Tests

Android

The testing framework we use is jUnit 3.

The mocking library we use is Mockito.

Test Coverage

Android

Run the following command to generate the test coverage report:

cd android; ./gradlew createDebugCoverageReport

Then, open the report index.html file to have a look at the coverage:

open android/build/outputs/reports/coverage/debug/index.html

iOS

Currently we are not measuring test coverage in iOS :(

JS

Currently we are not measuring test coverage in JS :(

Publishing a new version

The release process for Astro (and dependent projects) is outlined in RELEASE.md.

Structure

  • android/ - Contains the source code for the Astro Android library
  • ios/ - Contains the source code for the Astro iOS library
  • js/ - Contains the source code for the Astro JavaScript library
  • sandbox/ - Contains the source code for the demonstration sandbox (aka Catalogue).

JS

When you're developing an Astro application, there are a few key pieces of JS to know about:

  1. app.js
  2. astro-base.js
  3. astro-client.js
  4. astro-full.js
  5. webViewPlugin.js, drawerPlugin.js, and other plugins

app.js

app.js is your main entry point to developing an Astro project. This is where the main business logic of you application lives. The app logic is handled in a persistent WebView that lives throughout the lifecycle of your application (otfen referred to as "the worker"). It's also the place where you import/require modules (controllers, plugins, etc.) that you need for your application.

A sample app.js lives inside of sandbox/app/.

You can learn more about how to build and develop the sandbox here.

astro-base.js

astro-base.js is the module that allows communication between JavaScript and the native bridge. astro-client.js and astro-full.js extend from this module. In general, as a user of the Astro SDK you should never have to require this module directly.

astro-client.js

astro-client.js is the library which provides the ability for web views to communicate with app.js.

astro-full.js

astro-full.js is the library which provides the ability for app.js to communicate with native Astro components. It's the library that SDK plugin developers should import in order to create a plugin.

Plugins

iOS

TODO

Android

TODO

JS

Most native plugins have a corresponding JavaScript plugin that you will use to instantiate and use different plugins in your app.js file.

All plugins can be found inside of android/src/main/java/com/mobify/astro/plugins. You can learn more about how to build and develop Astro plugins here.

Keywords

none

install

npm i mobify-progressive-app-sdk

Downloadsweekly downloads

203

version

3.0.6

license

SEE LICENSE IN LICENSE

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability