@nuofe/ndk-generator
TypeScript icon, indicating that this package has built-in type declarations

8.2.6 • Public • Published

NDK Generator

NPM version Downloads

Generate package by scaffold.

Install

yarn add @nuofe/ndk-generator --dev

Usage

ndk-generator [--dist <distPath>] [--ignore <ignorePath[,ignorePath]>] [--scaffold <scaffoldPath>] [--scope <scope>] [--type <type>] [name]

First, add scripts in package.json, like this:

{
  "scripts": {
    "generate": "ndk-generator --dist ./packages"
  }
}

Second, run command to generate project.

yarn generate

Scaffold

@nuofe/scaffolds is standard scaffold of app/web/component/library/tool/config/none. You can use --scaffold <scaffoldPath> [--type <type>] arguments to use other scaffolds, like this:

{
  "scripts": {
    "generate": "ndk-generator --scaffold ./scaffolds"
  }
}

Scaffold base on mustache template system. The structure should be this:

./
|---[type]/
|   |
|   \---[...scaffold files]
|
\---types.json

types.json content:

{
  "[type]": "[scaffold description]",
}

The scaffold files will transform by mustache.render(fileContent, view). The view will be this:

interface View: {
  type: string; // from types.json
  name: string; // name-value
  nAME: string; // nameValue
  Name: string; // NameValue
  NAME: string; // NAME_VALUE
  scope: string;
  description: string;
  author: string;
  command: string; // for tool
  keywords: string[];
  title: string;
};

Package Sidebar

Install

npm i @nuofe/ndk-generator

Weekly Downloads

0

Version

8.2.6

License

MIT

Unpacked Size

32.9 kB

Total Files

40

Last publish

Collaborators

  • xunyu
  • nuonuofe
  • zoeblow