0.0.11 • Published 6 months ago

@tuentyfaiv/cli v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Generate CLI

With this CLI you can generate base code to start to program fast. Also you can personalize the base code to generate.

Options

A command line interface for Frontend development

Usage: tfverse [OPTIONS] [NAME]

Arguments:
  [NAME]  Project name

Options:
  -t, --tool <TOOL>          Template tool to choose
  -a, --arch <ARCH>          Frontend piece or project template
  -l, --language <LANGUAGE>  TypeScript or JavaScript
  -s, --styles <STYLES>      Styles type
  -p, --path <PATH>          Template path to generate
  -y, --sure                 Accept all questions
  -g, --global               Set configuration
  -c, --config <FILE>        Config file to customize this CLI
  -h, --help                 Print help
  -V, --version              Print version

Config file

To personalize the cli you must create a .json file. And use the following schema.

The commented paths are the default values.

Exmaple tfverse_config.json

{
  "$schema": "https://gvtmpjzawvdhojsxlece.supabase.co/storage/v1/object/public/cli/schema/config.json",
  "repository": "git@github.com:YOUR_ORG_OR_YOUR_USER",
  "root": "", // The project root, default is "./"
  "paths": { // The modules paths
    "globals": {
      "contexts": null, // "./src/logic/contexts"
      "schemas": null, // "./src/logic/schemas"
      "services": null, // "./src/logic/services"
      "types": null, // "./src/logic/typing"
      "ui": null // "./src/ui"
    },
    "react": {
      "hocs": null, // "./src/logic/hocs"
      "hooks": {
        "global": null, // "./src/logic/hooks"
        "internal": null // "hooks"
      },
      "locales": null, // "./public/locales"
      "routes": null // "./src/logic/routes"
    },
    "svelte": {
      "actions": null, // "./src/logic/actions"
      "layouts": null, // "./src/routes"
      "locales": null, // "./static/locales"
      "pages": null, // "./src/routes"
      "stores": null // "./src/logic/stores"
    },
    "vanilla": {
      "classes": null, // "./src/logic/classes"
      "functions": null // "./src/logic/functions"
    }
  },
  "tools_type": { // The list to generate libraries and projects boilerplates
    "vanilla": [
      [
        "base", // Name to show in the list
        {
          "name": "REPOSITORY_NAME",
          "project": "main",
          "library": null
        }
      ]
    ],
    "react": [
      [
        "base", // Name to show in the list
        {
          "name": "REPOSITORY_NAME",
          "project": "main",
          "library": null
        }
      ]
    ],
    "svelte": [
      [
        "base", // Name to show in the list
        {
          "name": "REPOSITORY_NAME",
          "project": "main",
          "library": null
        }
      ]
    ]
  },
  "templates": { // The paths to your custom templates, all paths are concat with "$HOME"
    "react": {
      "component": null, // Example: "path/to/your/folder/component"
      "context": null,
      "hoc": null,
      "hook": null,
      "layout": null,
      "page": null,
      "schema": null,
      "service": null
    },
    "svelte": {
      "action": null,
      "context": null,
      "layout": null,
      "page": null,
      "schema": null,
      "service": null,
      "store": null,
      "component": null
    },
    "vanilla": {
      "class": null,
      "component": null,
      "function": null,
      "layout": null,
      "page": null,
      "schema": null,
      "service": null
    }
  }
}

Templates paths

If you want to personalize this CLI you must create the following files inside the folders that you set in the templates option.

React Component

PathTo
/component.(ts\|js)xComponent
/import.(ts\|js)Component imports
/proptypes.tsComponent props
/styles.(ts\|js)Component styles
/styles.responsive.(ts\|js)Component responsive

Svelte Component

PathTo
/component.svelteComponent
/script.(ts\|js).svelteComponent script
/import.(ts\|js)Component imports
/proptypes.tsComponent props
/styles.(ts\|js)Component styles
/styles.responsive.(ts\|js)Component responsive

Vanilla Component

Not ready yet

React Layout

PathTo
/layout.(ts\|js)xLayout
/layout.styles.(ts\|js)xLayout barrel styles
/proptypes.tsLayout props
/styles.(ts\|js)Layout styles
/styles.responsive.(ts\|js)Layout responsive

Svelte Layout

PathTo
/layout.svelteLayout
/layout.styles.(ts\|js)xLayout barrel styles
/script.(ts\|js).svelteLayout script
/proptypes.tsLayout props
/styles.(ts\|js)Layout styles
/styles.responsive.(ts\|js)Layout responsive

Vanilla Layout

Not ready yet

React Page

PathTo
/page.(ts\|js)xPage
/proptypes.tsPage props
/locale.jsonLocale for i18n
/i18n.(ts\|js)i18n context
/styles.(ts\|js)Page styles
/styles.responsive.(ts\|js)Page responsive
/router.(ts\|js)Router
/route.(ts\|js)Route
/config.(ts\|js)Config file project
/config.aliases.(ts\|js)Project aliases
/tsconfig.jsonTSConfig file project
/tsconfig.aliases.jsonTSConfig aliases

Svelte Page

PathTo
/page.sveltePage
/script.(ts\|js).sveltePage script
/locale.jsonLocale for i18n
/i18n.(ts\|js)i18n store
/proptypes.tsPage props
/styles.(ts\|js)Page styles
/styles.responsive.(ts\|js)Page responsive
/config.(ts\|js)Svelte config
/config.aliases.(ts\|js)Svelte config aliases

Vanilla Page

Not ready yet

React Schema

PathTo
/schema.(ts\|js)xSchema
/proptypes.tsSchema props

Svelte Schema

PathTo
/schema.(ts\|js)xSchema
/proptypes.tsSchema props
/proptypes.imports.tsSchema props imports

Vanilla Schema

Not ready yet

Templates keywords

KeywordDescription
NAME_CAMELCamel case name
NAME_PASCALPascal case name
NAME_DASHDash case name
NAME_CONSTANTConstant case name
NAME_SNAKESnake case name
NAME_LOWERLowercase name
NAMEUser input name
NAMESPACEUser input namespace
EXT_STYLESStyles extension

Templates keywords for svelte

KeywordDescription
SCRIPTScript tag

Templates keywords for schemas

KeywordDescription
/* NEXT_TYPE */Next type
/* PROPTYPES */PropTypes

Tempaltes keywords for pages

KeywordDescription
/* NEXT_ALIAS */Alias for next page
/* NEXT_LOCALE */Locale for next page
/* NEXT_ROUTE */Route for next page (Only ReactJS)

Templates keywords for pages and schemas

KeywordDescription
/* NEXT_IMPORT */Next import
0.0.11

6 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago