@aofl/aofljs-cli
is a command line tool for running aofljs/0.6.0 local server and automate the build process of aofljs apps.
Last updated 2 years ago by ariankhosravi .
MIT · Original npm · Tarball · package.json
$ cnpm install @aofl/aofljs-cli -g
SYNC missed versions from official npm registry.

@aofl/aofljs-cli

aofljs-cli is a command line tool for running aofljs/0.6.0 local server and automate the build process of aofljs apps.

Installation

  1. Make sure you have the latest stable versions of git, node and npm installed
  2. Install as global package:
$ npm install -g @aofl/aofljs-cli

Usage

$ aofljs-cli [options]
$ aofljs-cli [command] [options]

Options:

-h, --help     output usage information
-V, --version  output the version number
Examples:
$ aofljs-cli --help
$ aofljs-cli --version

Commands:

build       runs r.js in a directory containing __build.js file.
server      start http server
help [cmd]  display help for [cmd]
Examples:
$ aofljs-cli build -r
$ aofljs-cli server -dl
$ aofljs-cli help build

help

Usage:
aofljs-cli help [options]
Options:
build     output usage information for the build command. Equivalent to aofljs-cli build -h.
server    output usage information for the server command. Equivalent to aofljs-cli server -h.

server

aofljs-cli comes with a web server based on express. It supports development mode and live reload functionality.

Install livereload extensions in your browser to use this functionality.

Usage:
aofljs-cli server [options]
Options:
-d, --dev              dev mode, *.js instead of *.min.js
-H, --host [host]      set hostname
--cors                 allow CORS
--https                enable https
--force-https          force redirect to https
-l, --livereload       livereload
-m, --market [market]  specify market
-p, --port [port]      set port. defaults to 3000
-c, --config <path>    path to config file. Apps configuration will be used to add redirect rules when dev mode is enabeled. Server will redirect requsts, to build director, to source directory.
-h, --help             output usage information
Examples:
$ aofljs-cli server
$ aofljs-cli server -dl -H example.localhost.com -p 3000
$ aofljs-cli server --https

build-app

aofljs-cli build-app will rebuild desired directories into the output directory. The following files/directories will be filtered out:

  • .git
  • .spec.js
  • node_modules
  • bower_components
  • karma.conf.js
  • main.karma.js
  • .md

If market is specified next files/directories will overwrite original(without market prefix) files:

  • index-{market}.html
  • __build-{market}.js
  • js/main-{market}.js
  • js/config/local-api-config-{market}.json
  • js/config/stage-api-config-{market}.json
  • js/config/state-routes-{market}.js

Names may be provided as additional arguments with a config file to filter desired apps within the config file.

Usage:
aofljs-cli build-app [options]
Options:
-h, --help  output usage information
-c, --config <path> path to config file
-o, --output <path> path to output directory
-m, --market [market] specify market
-e, --regexp [pattern]  Use pattern to include or exclude files
Examples:
$ aofljs-cli build-app
$ aofljs-cli build-app myDir -o path/to/output/dir 
$ aofljs-cli build-app -c path/to/config.json
$ aofljs-cli build-app -c path/to/config.json name_one name_two
$ aofljs-cli build-app myDir -o path/to/output/dir -m jp
$ aofljs-cli build-app myDir -o path/to/output/dir -m jp -e '!**/home_page/**' -e '!**/otherpattern*/**' -e '**/node_modules/**'

default regexp list

[
  '**/*',
  '!**/.git/**',
  '!**/.git*',
  '!**/*.spec.js',
  '!**/node_modules/**',
  '!**/bower_components/**',
  '!**/karma.conf.js',
  '!**/main.karma.js',
  '!**/*.md'
]

Config format:

{
  "apps": [
    {
      "name": "app_name",
      "src": "dir_to_copy",
      "output": "output_dir",
      "market": "jp"
    }, 
    {...}
  ]
}

build

aofljs-cli build command runs requirejs optimizer on __build.js file. The recursive option can be used to traverse the subdirectories of the working directory to optimize all __build.js scripts.

Usage:
aofljs-cli build [options]
Options:
-r                     recursive build. 
-m, --market [market]  specify market
-h, --help             output usage information
Examples:
$ aofljs-cli build
$ aofljs-cli build -r
$ aofljs-cli build -r path/to/dir1
$ aofljs-cli build -r path/to/dir1 path/to/dir2 ptah/to/dir3
note:*

main.js builds fail in some cases with Error: /abs/path/to/main.js does not exist. To fix this issue update mainConfigFile path.

mainConfigFile: './main.js',

to

mainConfigFile: '../../app-directory/js/main.js',

translate

aofljs-cli pot translates marked text within html elements that have a translate attribute.

Usage:
aofljs-cli pot
Examples:
$ aofljs-cli pot dir/to/translate

License

The MIT License (MIT) Copyright (c) 2017 Age of Learning

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 0.6.0-alpha.2                                ...           alpha.2 (3 years ago)
  • 0.6.0-beta.1                                ...           beta (3 years ago)
  • 0.6.10                                ...           latest (2 years ago)

27 Versions

  • 0.6.10                                ...           2 years ago
  • 0.6.9                                ...           2 years ago
  • 0.6.8                                ...           2 years ago
  • 0.6.7                                ...           2 years ago
  • 0.6.6                                ...           2 years ago
  • 0.6.5                                ...           2 years ago
  • 0.6.4                                ...           2 years ago
  • 0.5.12                                ...           2 years ago
  • 0.6.3                                ...           2 years ago
  • 0.6.2                                ...           2 years ago
  • 0.6.1                                ...           3 years ago
  • 0.6.0                                ...           3 years ago
  • 0.6.0-beta.1                                ...           3 years ago
  • 0.6.0-alpha.2                                ...           3 years ago
  • 0.6.0-alpha.1                                ...           3 years ago
  • 0.5.11                                ...           3 years ago
  • 0.5.10                                ...           3 years ago
  • 0.5.9                                ...           3 years ago
  • 0.5.8                                ...           3 years ago
  • 0.5.8-beta                                ...           3 years ago
  • 0.5.7                                ...           3 years ago
  • 0.5.6                                ...           3 years ago
  • 0.5.5                                ...           3 years ago
  • 0.5.4                                ...           3 years ago
  • 0.5.3                                ...           3 years ago
  • 0.5.2                                ...           3 years ago
  • 0.5.1                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 27
Last Month 83
Dependencies (26)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |