0.1.1 • Published 3 years ago

order-tracking-app v0.1.1

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

order-tracking-app

Vue app for Lumenpulse's Order Tracking

Prerequisites

The following are required:

  • Node (12.15.0 as of writing this)
  • Yarn (1.22.4 as of writing this)

Check currently installed versions of those requirement by running:

node --version && yarn --version

Node

To easily manage your Node versions, it is recommended to install nvm. Once nvm is installed, run the following command:

nvm install 12

This will install the latest iteration of Node 12 and enable it for your current session.

If you have Node 12 installed and just want to enable it for the current session, run:

nvm use 12

To set Node 12 as the default verion for subsequent sessions:

nvm alias default 12

Yarn

There are several ways to install Yarn. The easiest way is using Homebrew:

brew install yarn

To update Yarn to the latest version:

brew upgrade yarn

Get started

Once your environment is all set, install the project's dependencies:

cd order-tracking-app # cd in the project's dir if not done already
yarn # Install dependencies

Set local environment variables by copying .env.example to .env:

cp .env.example .env

Finally, start the development server:

yarn dev

Build Setup

# install dependencies
yarn

# serve with hot reload at localhost:8080
yarn dev

# build a production-ready bundle
yarn bundle

# build for production with minification
yarn build

# build for production and view the bundle analyzer report
yarn build --report

# run unit tests
yarn unit

# run e2e tests
yarn e2e

# run all tests
yarn test

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

Release

The release flow use yarn publish

Since these packages are currently privately published under @ax2 scope, make sure your machine is globally auhtenticated on NPM, or that you have an .npmrc containing a publish token in every module's directory.

Once you're ready to publish a pre-release for staging environnement:

Checkout develop branch and run this command

yarn pre-release

This do :

  • A new bundle for the release
  • Commit the bundle
  • Publish a new version with tag canary for staging environnement (user versionning vX.X.X-alpha.X)
  • Push actual branch (develop)

Then run yarn upgrade @ax2/order-tracking-app@canary in the lumenpulse repository in a working branch

Once you're ready to publish changed packages for live environnement:

Checkout master branch and run this command

yarn release

This do :

  • A new bundle for the release
  • Commit the bundle
  • Publish a new version with tag latest for live environnement (user versionning vX.X.X)
  • Push actual branch (master)

Then run yarn upgrade @ax2/order-tracking-app@latest in the lumenpulse repository in a working branch

Install

Use Yarn or NPM to install the app. Make sure the host machine is authorized to install packages from Ax2's scope.

yarn add @ax2/order-tracking-app

To upgrade the app when new releases are published:

yarn upgrade @ax2/order-tracking-app

To initialize the app, load app.bundle.js in the page and make sure you put a mounting point somewhere in the markup:

<div class="order-tracking-app-root" id="order-tracking-app">
  <App
    lang='{{ Config::get('app.locale') }}'
    token='{{ $user->token or '' }}'
  />
</div>

Configuration

The app can be configured via a .env file. To get started, copy the .env.example file to .env. Here are the available configuration options:

VariablePossible valuesDescription
APP_ENVdevelopment, productionIf set to development, the app will be run in debug mode which has the following effects: no redirect to first step when refreshing the page, tutorial overlay hidden by default
API_ROOTAPI root URLDefines the API's root endpoint, if window.ORDER_TRACKING_API_ROOT is defined, it will be used instead

Make sure you restart the app after changing your configuration.