npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@totvs/thf-cli

v4.0.0

Published

CLI

Downloads

1

Readme

THF CLI

The THF CLI is a command-line interface tool that you use to initialize and develop Angular applications with THF already configured. You can use the tool directly in a command shell.

Installation

Make sure Node, NPM and GIT are installed.

Then, install the CLI globally:

$ npm install -g @totvs/thf-cli

Getting Started

Start a new project using the THF CLI and add components dynamically in your project.

To run an application, follow the steps below:

thf new SampleProject
cd SampleProject
ng serve

Getting Started

To check the commands list of THF CLI, invoke --help:

thf --help

Commands

Command | Alias | Description --- | --- | --- add | a | Add a module that has a dynamic component of your choice. new | n | Creates a new project based in a template. convert-imports | ci | Converts imports from THF version 3 to THF version 4.

thf add <newComponentName>
thf new <projectName>
thf convert-imports

add

This command adds in your project a module that has a dynamic component of your choice with internal routes configured, simply adding in your main application path or another module to run.

Must be in project root folder.

thf add <newComponentName>

Add Command

If the project was built through the "sidemenu" template, you need to configure the new module by adding it in the route and in the menu list of the project.

app.component.ts

readonly menus: Array<ThfMenuItem> = [
  { label: 'Home', link: '/home' },
  { label: 'Users', link: '/users' },
  // add here
  { label: 'newComponent', link: '/newComponent' },
];

app-routing.component.ts

const routes: Routes = [
  { path: 'home', loadChildren: './home/home.module#HomeModule' },
  { path: 'users', loadChildren: './users/users.module#UsersModule' },
  // add here
  { path: 'newComponent', loadChildren: './newComponent/newComponent.module#NewComponentModule' },
  { path: '', redirectTo: '/home', pathMatch: 'full'}
];

If is a common Angular project, it's necessary import the new module in app module or adding it in lazy load route.

new

This command initialize a project to you start your development more quickly with the THF already set up ready to run!

thf new <projectName> --template <template> --title <title>

New Command

-t / --template

All templates have the THF configured, the templates that you can start are:

Template | Description --- | --- blank | Creates a simple project with THFModule and THF css configured. sidemenu | Creates a project containing the menu and modules using lazy loading to start development.

The default template is sidemenu.

thf new <projectName> --template <template>

--title

The informed value in this option will be used by the thf-toolbar title, if you don't use this option, the project name will be used.

thf new <projectName> --title <title>

convert-imports

New version of THF 4 has a new and easier way to import components. Now all you need is the project name.

For example this:

import { ThfPageLogin } from '@totvs/thf-templates/components/thf-page-login';

Is now is changed to:

import { ThfPageLogin } from '@totvs/thf-templates';

Using this command in your project Angular or Ionic folder changes those imports automatically.

thf convert-imports

Add Git remote repository

To add a remote repository to your new project, run in folder project the command:

git remote add origin <path>

License

MIT