node package manager

peach-cli

Peach-CLI

Command Line tool for Peach App development

Features

  • Version Upgrade detection to ensure you are aware of any updates
  • Development environment utilizing your PeachWorks credentials
  • Build tools for production releases
  • Unit Test runners utilizing Karma and WebPack with complete code coverage reports
  • ES6 support. All code will automatically be transpiled utilizing Webpack and Babel

Install Peach-CLI globally without sudo

To prevent issues, you will want to ensure that you are able to install packages globally using npm, and without having to use sudo. If you are unable to do this, follow the link here to learn how to configure your system for this.

npm global installs without sudo

Install

Being a CLI tool, Peach is intended to be installed as a global node module. You can install it easily with:

$ npm install -g peach-cli

Update

Occasionally, we will release new features into the tool. To make this exposure easy to see, you will receive a message when you run any Peach command notifying you of a new release. You can update just as easily as installing with:

$ npm install -g peach-cli

Build

The build command will clean out your dist/ directory and rebuild all files and assets for production release.

Note: The dist/ directory is required for CDN hosting, so do not add it to your .gitignore or your app will fail to work!

$ peach build

Test

The test command will use your /client/app/tests.webpack.js file in order to compile and test your project. The setup supports writing your unit tests in ES6, utilizing Mocha and Sinon-Chai within the Karma framework.

Refer:

$ peach test

Develop

The dev command will require PeachWorks Developer credentials in order to run. It will gather information regarding your app from the Developer Portal registry, in order to give you the ability to test against permissions, locations, and other features

ESLint is integrated and configured by default. To override rules, create a .eslintrc file in the root of your project and refer to the below ESLint rules documentation in the link provided.

Refer:

$ peach dev

Serve

The serve command will require PeachWorks Developer credentials in order to run. It will gather information regarding your app from the Developer Portal registry, and serve the contents of your dist/ directory onto a local Express server. This will give you the ability to preview your fully compiled project before committing it for release.

$ peach serve

Adding Pages

In order for a new page to be added to your app and to function properly against permissions, you will need to first add it to the app in the Developer Portal. After creating the page through the UI, you can create the files and add the route with a structure similar to:

.when('/my-new-page', {
    name: 'My New Page',
    position: 0,
    template: require('./components/myNewPage/myNewPage.html'),
    controller: 'MyNewPageController',
    controllerAs: 'myNewPage',
    is_hidden: true | false,      // Hides the page from navigation
    is_settings_page: true | false,
    is_welcome_page: true | false
  })

Note: If the page is a settings page, the route must be prefixed with /settings

About PeachWorks

Visit PeachWorks for details on how to create an account and use apps. Visit PeachWorks Developer Portal for details on how to become a PeachWorks developer.