@canner/canner-tools
canner tools
Last updated 3 years ago by abz53378 .
Apache-2.0 · Original npm · Tarball · package.json
$ cnpm install @canner/canner-tools 
SYNC missed versions from official npm registry.

canner-tools

These are the Canner Command Line Interface (CLI) Tools

Installation

$ npm install -g canner-tools

Usage

canner --help

Get Started

example

Commands

The command canner --help lists the available commands and canner <command> --help shows more details for and individual command.

Remeber to login first before you start to use these commands.

Administrative Commands

Command Description
login Log in to canner. Required before using other commands
logout Log out from canner.
init Create .cannerrc configureation file in your current directory. Also you can use this to change the configureation if you want.

App Commands

Command Description
app:list List all your apps their infos.

Schema Commands

Command Description
schema:deploy Deploy your canner.schema.js to the default app url which setted in .cannerrc, or you can use option -u <url>, --url <url> to deploy schema to the specific app.

Data Commands

Command Description Options
data:import Import your canner.data.js to the default app url which setted in .cannerrc. 在 Canner 與 Firebase 上的表現有些許差異。
  • 在 Canner 上如果是 object 會直接覆蓋資料,如果是 array 會 append 在原本資料後面。
  • 在 Firebase 上只要有相同 key 的資料,就無法 import。 必須使用 -d, --drop-first
  • -u <url<, --url <url> to import data to the specific app.
  • -d, --drop-first to drop the data before import. Be careful to use this option
  • Statics Commands

    You can use Canner to host your statics files, like html, css, js, image and etc. Just upload them to the app.

    html files have to be placed in pages, and others in statics

    • pages
      • index.html
      • other.html
      • otherFolder
        • other1.html
    • statics
      • anyfiles
    Command Description
    serve This will serve the current folder. Before you upload statics files to app, you could use this command to confirm the result is correct.
    statics:upload Upload the directories, pages and statics to the default app url which setted in .cannerrc, or you can use option -u <url<, --url <url> to upload statics files to the specific app.

    Files

    .cannerrc

    The file created when you use command canner init. You can also create this manually.

    {
      "app": {
        "default": "<your app url>"
      }
    }
    

    canner.schema.js

    This file declares the data info, and would be deploy when you use command canner schema:deploy. It's written with CannerTypes. To know more, you could read Canner Handbook

    // canner.schema.js
    /* global CannerTypes */
    module.exports = {
      home: CannerTypes.object({
        intro: CannerTypes.string().description('介紹')
      }).description('首頁');
    }
    

    canner.data.js

    This js file is the data you want to import to your app, would be imported when you use command canner data:import. To know more, you could read Canner Handbook

    // canner.data.js
    module.exports = {
      home: {
        intro: 'canner.data.js exports the data'
      }
    }
    

    You can use ImageService to uplaod image.

    // canner.data.js
    /* global ImageService */
    module.exports = {
      home: {
        backgroundImg: ImageService.image('relative/path/to/img')
      }
    }
    

    .canner-image-uploaded.json

    If you use feature auto upload image in canner.data.js. This json file saves the checksum and url of the uploaded images to prevent from uploading the duplicated images.

    .canner-statics-uploaded.json

    This json file saves the checksum of the statics file to prevent from uploading the duplicated files.

    Current Tags

    • 0.3.18                                ...           latest (3 years ago)

    37 Versions

    • 0.3.18                                ...           3 years ago
    • 0.3.17                                ...           3 years ago
    • 0.3.16                                ...           3 years ago
    • 0.3.15                                ...           3 years ago
    • 0.3.14                                ...           3 years ago
    • 0.3.13                                ...           3 years ago
    • 0.3.12                                ...           3 years ago
    • 0.3.11                                ...           3 years ago
    • 0.3.10                                ...           3 years ago
    • 0.3.9                                ...           3 years ago
    • 0.3.8                                ...           3 years ago
    • 0.3.7                                ...           3 years ago
    • 0.3.6                                ...           3 years ago
    • 0.3.5                                ...           3 years ago
    • 0.3.4                                ...           3 years ago
    • 0.3.4-0                                ...           3 years ago
    • 0.3.3                                ...           3 years ago
    • 0.3.2                                ...           3 years ago
    • 0.3.1                                ...           3 years ago
    • 0.3.0                                ...           3 years ago
    • 0.2.2                                ...           3 years ago
    • 0.2.1                                ...           3 years ago
    • 0.2.0                                ...           3 years ago
    • 0.1.1                                ...           3 years ago
    • 0.1.0                                ...           3 years ago
    • 0.0.14                                ...           3 years ago
    • 0.0.13                                ...           3 years ago
    • 0.0.12                                ...           3 years ago
    • 0.0.11                                ...           3 years ago
    • 0.0.9                                ...           3 years ago
    • 0.0.8                                ...           3 years ago
    • 0.0.7                                ...           3 years ago
    • 0.0.6                                ...           3 years ago
    • 0.0.5                                ...           3 years ago
    • 0.0.4                                ...           3 years ago
    • 0.0.2                                ...           3 years ago
    • 0.0.1                                ...           3 years ago
    Downloads
    Today 0
    This Week 37
    This Month 37
    Last Day 0
    Last Week 0
    Last Month 38
    Dependencies (32)
    Dev Dependencies (6)
    Dependents (1)

    Copyright 2014 - 2016 © taobao.org |