@komaci/cli
TypeScript icon, indicating that this package has built-in type declarations

252.1.0 • Public • Published

@komaci/cli

CLI tool to test out functionality for komaci. Currently supports only one command, modgen.

modgen Command

This command will generate a komaci module, similar to what komaci-tester did, but with some improvements. Some example components can be found in ./sandbox.

One important difference is that the component's namespace is no longer hardcoded to "c". It will now be derived from the module structure. For instance;

sandbox
├── jsconfig.json
└── modules              // LWC 'modules' directory; not required
    ├── c                // "c" is the namespace for the modules within this directory
    │   └── komaciAction // "lightning/komaciAction" component — komaciAction in the "c" namespace
    └── lightning        // "lightning" is the namespace for the modules below
        ├── komaciAction // "lightning/komaciAction" component — Same as c/komaciAction, but in a trusted namespace
        └── recordForm   // "lightning/recordForm" component — copied from ui-lightning-components

Usage

Run the following from the packages/@komaci/cli directory:

yarn
yarn build
# Run modgen on the component defined @ <path>
yarn komaci modgen <path>

Examples

# Run modgen on c/komaciAction:
yarn komaci modgen sandbox/modules/c/komaciAction
# Print only the lwc metadata for c/komaciAction:
yarn komaci modgen sandbox/modules/c/komaciAction --only lwc

Modgen can also take in a list of paths:

yarn komaci modgen sandbox/modules/lightning/komaciAction sandbox/modules/lightning/recordForm

If all the modules are in the same subdirectory, you can use a glob pattern:

# Run modgen on all modules in the lightning namespace:
yarn komaci modgen sandbox/modules/lightning/*
# Run modgen on all modules in all namespaces:
yarn komaci modgen sandbox/modules/*/*

Readme

Keywords

none

Package Sidebar

Install

npm i @komaci/cli

Weekly Downloads

79

Version

252.1.0

License

MIT

Unpacked Size

28.5 kB

Total Files

31

Last publish

Collaborators

  • xiaoxugu
  • lwc-admin
  • andrewhuffman