@tinijs/cli v0.18.2
@tinijs/cli
The CLI for the TiniJS framework.
Install
- Create a TiniJS app:
npx @tinijs/cli new my-app --latest
- Or, install it globally:
npm i -g @tinijs/cli
For more, please visit: https://tinijs.dev
Development
- Create a home for TiniJS:
mkdir TiniJS && cd TiniJS
- Fork the repo
- Install dependencies:
cd cli && npm i
- Make changes & build locally:
npm run build
- Preview a command:
tini <command> [options]
- Push changes & create a PR 👌
The structure
This project uses a design pattern called seminjecto
(it's a term which I invented some years ago).
The source of the package resides in the src
folder:
public-api.ts
: the public interface of the packagebin.ts
: the entry of the CLIlib/index.ts
: the container for all shared featureslib/services/...
: all the reusable servicescli/index.ts
: the container of the CLI appcli/commands/...
: all the commands of the CLI app
The test specs are in the test
folder:
- No unit test has been written yet (please help if you can, thank you!)
Add new command
- Install the
@lamnhan/seminjecto
CLI tool:npm i -g @lamnhan/seminjecto
(the tool is quite outdated but it is still working :), I will update it when I have more time). - Run:
semidi g command commands/<name>
A file will be create in src/cli/commands/<name>.command.ts
.
Beside, the command definition code will be injected into src/cli/index.ts
.
The CLI for the TiniJS framework.
tini build --target [value]
tini clean|c --includes [value] --excludes [value]
tini dev|serve --watch
tini docs|home
tini generate|create|g <type> <dest> --type-prefixed --nested
tini new|start <projectName> --latest --tag [value] --skip-install --skip-ui --skip-git
tini preview --port [value] --host [value] --i18n
tini pwa <subCommand> --tag [value]
tini test
tini ui <subCommand> [params...] --build-only --skip-help
tini help
tini *
Build the app.
Usage:
tini build --target [value]
Options:
-t, --target [value]
: Target: production (default), qa1, any, ...
Clean Typescript output files.
Usage:
tini clean --includes [value] --excludes [value]
tini c --includes [value] --excludes [value]
Options:
-i, --includes [value]
: Including files, separated by |.-e, --excludes [value]
: Excluding files, separated by |.
Start the dev server.
Usage:
tini dev --watch
tini serve --watch
Options:
-w, --watch
: Watch mode only.
Open documentation.
Usage:
tini docs
tini home
Generate a resource.
Usage:
tini generate <type> <dest> --type-prefixed --nested
tini create <type> <dest> --type-prefixed --nested
tini g <type> <dest> --type-prefixed --nested
Parameters:
<type>
: The resource type<dest>
: The resource destination
Options:
Create a new project.
Usage:
tini new <projectName> --latest --tag [value] --skip-install --skip-ui --skip-git
tini start <projectName> --latest --tag [value] --skip-install --skip-ui --skip-git
Parameters:
<projectName>
: The project name.
Options:
-l, --latest
: Install the latest @tinijs/skeleton.-t, --tag [value]
: Use the custom version of the @tinijs/skeleton.-i, --skip-install
: Do not install dependency packages.-u, --skip-ui
: Do not run tini ui use.-g, --skip-git
: Do not initialize a git repository.
Preview the app.
Usage:
tini preview --port [value] --host [value] --i18n
Options:
-p, --port [value]
: Custom port.-h, --host [value]
: Custom host.-i, --i18n
: Enable superstatic i18n.
Working with PWA apps.
Usage:
tini pwa <subCommand> --tag [value]
Parameters:
<subCommand>
: The<subCommand>
parameter.
Options:
-t, --tag [value]
: Use the custom version of @tinijs/pwa.
Unit test the app.
Usage:
tini test
Tools for developing and using Tini.
Usage:
tini ui <subCommand> [params...] --build-only --skip-help
Parameters:
<subCommand>
: The<subCommand>
parameter.[params...]
: The[params...]
parameter.
Options:
-b, --build-only
: Build mode only of the use command.-i, --skip-help
: Skip instruction of the use command.
Display help.
Usage:
tini help
Any other command is not suppoted.
Usage:
tini <cmd>
License
@tinijs/cli is released under the MIT license.
5 days ago
5 days ago
5 days ago
24 days ago
24 days ago
24 days ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
6 months ago
7 months ago
9 months ago
9 months ago
9 months ago
9 months ago
6 months ago
8 months ago
6 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
1 year ago
1 year ago