Important
This previously experiment is wrapped up, moving forward the development will happen at https://github.com/tinijs/tinijs/tree/main/packages/cli.
If you want to use the experimental version still, please use the version 0.16.0.
The CLI for the TiniJS framework.
- Create a TiniJS app:
npx @tinijs/[email protected] new my-app --latest
- Or, install it globally:
npm i -g @tinijs/[email protected]
For more, please visit: https://tinijs.dev
- 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 👌
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!)
- Install the
@lamnhan/seminjectoCLI 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 --watchtini docs|hometini generate|create|g <type> <dest> --type-prefixed --nestedtini new|start <projectName> --latest --tag [value] --skip-install --skip-ui --skip-gittini preview --port [value] --host [value] --i18ntini pwa <subCommand> --tag [value]tini testtini ui <subCommand> [params...] --build-only --skip-helptini helptini *
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 --watchOptions:
-w, --watch: Watch mode only.
Open documentation.
Usage:
tini docs
tini homeGenerate a resource.
Usage:
tini generate <type> <dest> --type-prefixed --nested
tini create <type> <dest> --type-prefixed --nested
tini g <type> <dest> --type-prefixed --nestedParameters:
<type>: The resource type<dest>: The resource destination
Options:
-t, --type-prefixed: Use the format [name].[type].[ext].-n, --nested: Nested under a folder.
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-gitParameters:
<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] --i18nOptions:
-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 testTools for developing and using Tini.
Usage:
tini ui <subCommand> [params...] --build-only --skip-helpParameters:
<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 helpAny other command is not suppoted.
Usage:
tini <cmd>@tinijs/cli is released under the MIT license.