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

bxuip-ionic-live-update

v3.3.16

Published

bxuip-ionic-live-update

Downloads

42

Readme

bxuip-ionic-live-update

bxuip-ionic-live-update 는 모바일 스토어에 배포하지않고, 앱을 업데이트할 수 있는 기능을 제공합니다.

지원 플랫폼

iOS, Android

설치하기

npm 을 통해, 패키지를 설치합니다.

npm i --D bxuip-ionic-live-update

파일 생성

아래 명령을 통해, 업데이트를 위한, zip 파일을 생성합니다.

bxuip build --liveupdate

파일명 규칙

생성된 zip 파일명은 아래 규칙을 따릅니다.

[메이저 버전].[마이너 버전]-[env].zip
[메이저 버전].[마이너 버전]-[env]-full.zip

버전은 반드시 메이저 버전마이너 버전으로만 나뉩니다.

// [메이저 버전].[마이너 버전]-[env].zip
1.0-dev.zip
1.0-dev-full.zip
1.1-dev.zip
1.1-dev-full.zip
...
1.15-dev.zip
1.15-dev-full.zip

여기서 env 는, 파일이 생성된 빌드 환경을 나타냅니다.

// [메이저 버전].[마이너 버전]-[env].zip
1.0-dev.zip
1.0-prod.zip

full 은, 전체 압축 파일을 나타냅니다.

// [메이저 버전].[마이너 버전]-[env]-full.zip
1.0-dev-full.zip

버저닝 규칙

리소스 버전

  • 리소스 버전은 사용자 디바이스 버전과의 차이를 비교하기위해 사용됩니다.

  • 리소스 버전./config.xml 파일의 resource-version 속성 값을 따릅니다.

  • 리소스 버전은 반드시 1.0이상부터 시작해야합니다.

    // config.xml 파일
    
    <?xml version='1.0' encoding='utf-8'?>
    <widget xmlns:cdv="http://cordova.apache.org/ns/1.0" id="" resource-version="1.0" version="1.0.0" xmlns="http://www.w3.org/ns/widgets">
        <name>ionicExample</name>
        <description>
            BWG APP
        </description>
        ...

liveupdate.json 파일

  • 사용자 디바이스 버전리소스 버전 차이를 체크하기위해, ./liveupdate.json 파일을 사용합니다.

    [
      "1.1-dev",
      "1.5-dev",
      ...
    ]

메이저 버전

  • 메이저 버전이 올라갈 경우, [version]-[env]-full.zip(전체 압축 파일) 파일을 다운받아 앱을 업데이트합니다.

마이너 버전

  • 마이너 버전이 올라갈 경우, BxLiveUpdate 모듈에 설정된 versionInterval 값에 따라, 여러개의 [version]-[env].zip 또는 [version]-[env]-full.zip 파일을 다운받아 앱을 업데이트합니다.

  • 만약 사용자 디바이스 버전리소스 버전과의 차이가 versionInterval 값 미만인 경우, 그 차이 만큼의 [version]-[env].zip 파일들을 다운받아 앱을 업데이트합니다.

    사용자 디바이스 버전: 1.1
    liveupdate.json 버전: 1.5
    versionInterval 값: 5
    
    1.2-[env].zip ~ 1.5-[env].zip 파일들을 다운받아 앱을 업데이트합니다.
  • 만약 사용자 디바이스 버전과, 리소스 버전과의 차이가 versionInterval 값 이상인 경우, 리소스 버전[version]-[env]-full.zip 파일을 다운받아 앱을 업데이트합니다.

    사용자 디바이스 버전: 1.1
    liveupdate.json 버전: 1.6
    versionInterval 값: 5
    
    1.6-[env]-full.zip 파일을 다운받아 앱을 업데이트합니다.

프로세스 실행 순서

리소스 파일 생성 프로세스

enter image description here

  1. 프로젝트에서 bxuip build --liveupdate 명령을 통해 빌드를 진행합니다.
  2. 프로젝트 ROOT 경로에 liveupdate.json 및 업데이트를 위한, zip 파일이 생성됩니다.

Liveupdate 실행 프로세스

enter image description here

  1. 앱을 실행하면 앱 내부 소스에 포함된 liveupdate 모듈을 통해 liveupdate가 실행됩니다.
  2. 먼저, 디바이스의 현재 리소스 버전과, 서버의 liveupdate.json 파일을 통해 버전을 비교합니다.
  3. 버전을 비교하여 업데이트가 되었을 경우, onBeforeUpdate() callback을 실행합니다.
  4. 버전 업데이트에 따라 전체설치/부분설치가 진행됩니다.

전체설치

Major 버전이 업데이트 된 경우 (ex. 1.0 -> 2.0)

versionInterval의 값 보다 Minor 버전 차이 값이 큰 경우. (ex. versionInterval = 5, 1.0 -> 1.6)

  1. 전체 리소스가 포함된 [resource-version]-[env]-full.zip 파일을 서버에서 다운로드합니다.
  2. 다운로드가 진행되는 동안, onProgressUpdate() callback이 실행됩니다.
  3. 다운로드가 완료되면, zip 파일을 설치(압축 해제)합니다.
  4. 설치가 진행되는 동안, onProgressUnzip() callback이 실행됩니다.
  5. 설치가 완료되면, 다운받은 zip 파일 및 기타 필요없는 파일들을 삭제됩니다.
  6. onAfterUpdate() callback이 실행되고, 설치된 리소스로 앱을 새로고침합니다.

부분설치

Minor 버전이 업데이트 된 경우 (ex. 1.0 -> 1.1)

  1. 전체 리소스가 포함된 [resource-version]-[env].zip 파일을 서버에서 다운로드합니다.
  2. 다운로드가 진행되는 동안, onProgressUpdate() callback이 실행됩니다.
  3. 다운로드가 완료되면, zip 파일을 설치(압축 해제)합니다.
  4. 설치가 진행되는 동안, onProgressUnzip() callback이 실행됩니다.
  5. 설치가 완료되면, 다운받은 zip 파일 및 기타 필요없는 파일들을 삭제합니다.
  6. 버전 차이만큼 4-1 ~ 4-5 프로세스가 반복됩니다. (ex. 1.0 ~> 1.2의 경우 1.1, 1.2를 업데이트하기 위해 2번 반복된다)
  7. onAfterUpdate() callback이 실행되고, 설치된 리소스로 앱을 새로고침합니다.