go-aura
v1.0.0
Published
CLI for initializing and managing the ui-library design system
Readme
CLI Package Documentation
This package provides the ui-lib command-line interface for initializing and managing the UI library.
How the files are connected
The CLI starts from the package bin script and then flows into the TypeScript source:
packages/cli/bin/ui-lib.jsis the executable entry point.- That file loads the compiled CLI entry from
dist/after the package is built. packages/cli/src/index.tscreates the Commander program, sets the CLI name and version, and registers commands.packages/cli/src/commands/init.tsdefines theinitcommand.packages/cli/src/templates/config.generator.tsbuilds the JSON config object used byinit.- When the CLI is built, the TypeScript sources are emitted to
packages/cli/dist/. d The runtime flow is:
bin/ui-lib.js -> compiled index.js -> init command -> config.generator.ts -> ui-lib.config.json
How to start this package
From the repository
- Install dependencies from the repo root:
pnpm install- Build the CLI package:
pnpm --filter cli build- Run the CLI from the built output:
node packages/cli/dist/index.js initAs an installed command
After the package is linked or published, the command name is ui-lib because it is mapped in packages/cli/package.json.
ui-lib initRole of each file
packages/cli/package.json
Defines the package name, version, dependencies, scripts, and the bin mapping that exposes the CLI as ui-lib.
packages/cli/tsconfig.json
Configures the TypeScript build for this package. It compiles src/ into dist/.
packages/cli/bin/ui-lib.js
Executable shim that Node runs when the CLI command is invoked. Its job is to boot the compiled CLI entry.
packages/cli/src/index.ts
Main Commander setup file. It creates the CLI program, sets the command name and version, registers subcommands, and parses process.argv.
packages/cli/src/commands/init.ts
Implements the init command. It prompts the user for initialization options, calls the config generator, writes ui-lib.config.json, and prints the next steps.
packages/cli/src/templates/config.generator.ts
Creates the config object used by the init command. It converts the selected themes into a theme record and adds the version.
packages/cli/dist/
Generated build output. This folder is created by the TypeScript compiler and should not be edited directly.
What the init command does
When you run init, the CLI:
- Asks whether you want to initialize the project.
- Lets you choose a theme.
- Optionally asks whether dependencies should be installed.
- Generates a
ui-lib.config.jsonfile in the current working directory. - Prints the import path you can use to start consuming the library.
Notes
- The package currently builds TypeScript into
dist/. - The CLI command name exposed by the package is
ui-lib. - The
initflow writes files into the directory where the command is run, not into the package folder itself.
