Skip to content

Latest commit

 

History

History
102 lines (76 loc) · 3.96 KB

README-EN.md

File metadata and controls

102 lines (76 loc) · 3.96 KB

readme: Home | RU

SKELETON-LIB-CLI

Command line interface that activates the skeleton library.

The task of the utility is to: launch it, answer questions and get a skeleton for writing your own library, which can be used both for servers on nodejs and in the browser. If you want to use a utility to create UI components for vue, for example, then you should use more specialized solutions.

# Functionality

  • Rollup - the core used to build bundles in CJS(CommonJS), UMD and ES formats;
  • TypeScript support and assembly of types into a single type file;
  • Eslint and Pritter with base configuration;
  • Jest c Coverage;
  • Multilingual - Create skeletons for documentation with the specified languages;
  • File bin (cli run)
  • GitHub issues template;
  • JavaScript support;
  • Mono-repositories based on Lerna;
  • Lint Git Commits - lint git commits according to rules;

# Install

npx skeleton-lib-cli

The cli also has optional parameters:

npx skeleton-lib-cli -lang en

npx skeleton-lib-cli -outDir DIR_PROJECT

npx skeleton-lib-cli -outDir DIR_PROJECT -lang en
Option Type Default Description
--lang en | ru ru What language should the UI cli be in?
--outDir string --- Path where to create the project

After installation, you need to go to the project folder and install the dependency via NPM or YARN.

# Questions/Answers

  1. Question:
    - I see CJS(CommonJS), UMD and ES formats being built. How can I disable an unnecessary format?

    Answer:
    - Rollup is responsible for the assembly and the config for it is rollup.config.ts - just comment out the extra call.

    // rollup.config.ts
    
    export default [
      defineCJS(PACKAGE_NAME),
      //defineUMD(PACKAGE_NAME, MODULE_NAME),
      //defineES(PACKAGE_NAME),
      defineTypeTS(PACKAGE_NAME),
    ];

    But you also need to understand that you will need to fix the package.json file in order to disable the extra:

    // package.json
    
    {
      // ....
      "main": "dist/lib-cli.cjs.js",
      // "unpkg": "dist/lib-cli.umd.js", remove
      // "module": "dist/lib-cli.esm.js", remove
      "types": "dist/lib-cli.d.ts"
      // ...
    }

  2. Question:
    - What is multilingualism and how does it work?

    Answer:
    - If you chose multilingual when starting the utility, then you will be asked which languages you want to use - just list in the format: ru, en, ch.
    After that, files will be created in the docs folder README-* and CHANGELOG-*, where "*" are the specified languages. And there will be links to them in the README and CHANGELOG.
    It follows from this that multilingualism is the support of a project / package in different languages in the same way. How it works can be seen on the current project.

  3. Question:
    - I created a project with a utility and didn't select some packages when initializing. How do I add these packages?

    Answer:
    - For the current day, it is not possible to add to a previously created project or update dependencies using this utility.
    The best solution today is to create a new project using the utility and transfer the necessary part from the old one to it.

# License

MIT