ng-git-gen
Generates Angular (Module, Components and Routes) from static files in a git repo
Last updated 6 months ago by samuelmarks .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ng-git-gen 
SYNC missed versions from official npm registry.

ng-git-gen

Generates Angular (Module, Components and Routes) from static files in a git repo.

Originally for Github Wiki integration.

NPM

NPM version oclif

Install

npm i -g ng-git-gen

Options

-R, --global_route                             [default: false] Lazy route in
                                             app-routing

-a, --afterstrap=afterstrap                    Execute this on the content
                                             strings

-b, --bootstrap=bootstrap                      Execute this before collecting
                                             files with extension

-d, --git_dir=git_dir                          [default: tmp] Directory to
                                             clone git repo into

-e, --ext=ext                                  [default: .md] Extension, e.g.:
                                             '.md'

-f, --postprocess_content=postprocess_content  Function to run on content
                                             before conclusion, e.g.:
                                             replace("fo",
                                             "ba").replace("ca","ha"})

-g, --git_url=git_url                          (required) Git URL to use
                                             markdown from

-h, --help                                     show CLI help

-i, --extra_imports=extra_imports              Example: 'import {Foo} from
                                             bar;' will add this line, and
                                             `Foo` to `imports: []` in
                                             Module

-l, --list_route                               [default: true] Generate root
                                             route, listing all wiki links

-m, --global_route_mount=global_route_mount    [default: Value of route flag]
                                             If --global-route

-o, --output_ext=output_ext                    [default: .html] Output
                                             extension

-p, --project_dir=project_dir                  (required) angular project dir

-r, --route=route                              [default: wiki] Route, e.g.:
                                             /wiki

-s, --styleUrls=styleUrls                      styleUrls, if starts with http,
                                             then will download to generated
                                             dir & update styleUrl to this

-v, --verbosity=verbosity                      verbosity

--lifecycle=lifecycle                          Add lifecycle to
                                             component,e.g.: `--lifecycle
                                             AfterViewInit --lifecycle_init
                                             'console.info("AfterViewInit");
                                             throw Error("WOW")'

--lifecycle_init=lifecycle_init                Add lifecycle init to
                                             component. See `--lifecycle`
                                             for example.

--ng_project_name=ng_project_name              angular project name, defaults
                                             to first in angular.json

--version                                      show CLI version

Examples

Full workflow, with github wiki integration

$ ng new foo --routing --interactive=false
$ cd foo
$ mkdir src/app/wiki
$ ng-git-gen -p "$PWD" -g 'https://github.com/Fantom-foundation/fantom-dev-web.wiki.git' -l

This will populate src/app/wiki/generated. Next, you can include this in your src/app/app-routing.module.ts:

import { Routes } from '@angular/router';

const routes: Routes = [{ path: 'wiki', loadChildren: './wiki/generated/generated.module#GeneratedModule' }];

Github wiki generation

 ng-git-gen -p "$PWD" -g 'https://github.com/Fantom-foundation/fantom-dev-web.wiki.git' -l

RFC generation

ng-git-gen -p "$PWD" -g 'https://github.com/Fantom-foundation/fantom-rfcs' -l -b 'make html_body' -e '.html' -i "import { NgxPageScrollModule } from 'ngx-page-scroll';" -f '.replace(/href="#/g, `pageScroll href="#`)' -r rfc

Current Tags

  • 0.0.14                                ...           latest (6 months ago)

9 Versions

  • 0.0.14                                ...           6 months ago
  • 0.0.13                                ...           6 months ago
  • 0.0.12                                ...           6 months ago
  • 0.0.11                                ...           6 months ago
  • 0.0.10                                ...           6 months ago
  • 0.0.8                                ...           7 months ago
  • 0.0.7                                ...           7 months ago
  • 0.0.6                                ...           7 months ago
  • 0.0.5                                ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 0
Last Month 1
Dependencies (12)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |