GithubHelp home page GithubHelp logo

koba04 / duck Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cybozu/duck

0.0 2.0 0.0 51 MB

Serves and builds an app with Google Closure Compiler/Library/Templates. An alternative to plovr.

License: MIT License

JavaScript 0.09% TypeScript 99.91%

duck's Introduction

@teppeis/duck

Serves and builds an app with Google Closure Compiler/Library/Templates. An alternative to plovr.

Status: WIP

npm version Node.js Version Support build status dependency status License

Yellow Duck

Install

$ npm i -D @teppeis/duck

Usage

duck <command>

Commands:
  duck serve [entryConfigDir]     Start dev server
  duck build [entryConfigDir]     Compile Soy and JS files
  duck build:js [entryConfigDir]  Compile JS files
  duck build:soy                  Compile Soy templates
  duck build:deps                 Generate deps.js
  duck clean:soy                  Remove all compiled .soy.js
  duck clean:deps                 Remove generated deps.js
  duck completion                 Generate completion script for bash/zsh

Options:
  -v, --version  Show version number                                             [boolean]
  -h, --help     Show help                                                       [boolean]

CLI options overwrite config file

duck serve

duck serve [entryConfigDir]

Start dev server

Options:
  --inputsRoot          A root directory to serve                                 [string]
  --closureLibraryDir   Closure Library directory                                 [string]
  --depsJs              A path to deps.js to save and load                        [string]
  --skipInitialSoy, -s  Skip initial compiling of Soy templates [boolean] [default: false]
  --port                A port number to listen                   [number] [default: 9810]
  --host                A host to listen                   [string] [default: "localhost"]
  --config              A path to duck.config.js, the extension can be ommited    [string]
  -v, --version         Show version number                                      [boolean]
  -h, --help            Show help                                                [boolean]

duck build

duck build [entryConfigDir]

Compile Soy and JS files

Options:
  --entryConfigs, -e   Entry config files (this option ignores entryConfigDir)     [array]
  --closureLibraryDir  Closure Library directory                                  [string]
  --config             A path to duck.config.js, the extension can be ommited     [string]
  --concurrency, -c    Concurrency limit for compiler                [number] [default: 1]
  --depsJs             A path to deps.js to save and load                         [string]
  --printConfig, -p    Print effective configs for compilers    [boolean] [default: false]
  --soyJarPath         A path to Soy.jar                                          [string]
  --soyFileRoots       Root directories of soy files                               [array]
  -v, --version        Show version number                                       [boolean]
  -h, --help           Show help                                                 [boolean]

Also see examples/chunks.

Tips

How to use HTTPS and HTTP2 in duck serve?

Create a self-signed certificate like

# https://stackoverflow.com/a/10176685
$ openssl req -x509 -newkey rsa:4096 -keyout duck-key.pem -out duck-cert.pem -days 365 -nodes -subj '/CN=localhost'

Then specify them and enable http2 in duck.config.js.

module.exports = {
  http2: true,
  https: {
    keyPath: './path/to/duck-key.pem',
    certPath: './path/to/duck-cert.pem'
  }
};

bash/zsh-completion shortcuts for commands and options

Initial setting:

$ duck completion >> ~/.bashrc
# or
$ duck completion >> ~/.zshrc

Then, you can complete commands and options with TAB !

$ duck build:<TAB>
build:deps  -- Generate deps.js
build:js    -- Compile JS files
build:soy   -- Compile Soy templates

License

MIT License: Teppei Sato <[email protected]>

duck's People

Contributors

renovate-bot avatar renovate[bot] avatar teppeis avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.