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

@v4fire/cli

v2.1.0

Published

Tools for creating V4Fire blocks and pages from CLI

Downloads

49

Readme

WIP V4Fire-cli

Tools for creating V4Fire blocks and pages from CLI

v4fire -h

API

Usage

Create app

It is the easiest way to start use V4Fire

v4fire create-app my-app && yarn build

It will create application ready for work in the current directory.

v4fire create-app my-app/foo/bar && cd my-app/foo/bar && yarn build

It will create application ready for work in the target directory.

Create a workspace

v4fire create-workspace

It will clone all necessary dependencies from .pzlrrc and initialize the npm workspace. Also, you can specify custom dependencies to install to the workspace or change a workspace directory.

v4fire create-workspace --package my-package --root my-workspace

Remove a workspace

v4fire remove-workspace

It will remove workspace folder, clear package-lock.json and components-lock.json, reinstall dependencies

Make block/page

v4fire make block hello-world

It will create src/components/b-hello-world component.

v4fire make block b-hello-world

Also, it will create src/components/b-hello-world.

v4fire make page hello-world

It will create src/pages/p-hello-world component.

If you want create component inside another folder, you can set path

v4fire make block hello-world ./src/pages/p-index

It will generate src/pages/p-index/b-hello-world component. You can choose the type of component: functional, mono or default;

v4fire make block hello-world  --template functional

Also, you can change parent for component. Possible options: default, i-block, i-data, i-dynamic-page, i-static-page

v4fire make block hello-world  --template functional --extend i-data

Rename component

v4fire rename hello-world app-loader

It will rename src/components/b-hello-world to src/components/b-app-loader.

Resolve changelog

v4fire resolve-changelog

It will scan repo for all files with name CHANGELOG.md, resolve conflicts and sort records by date. WARNING: Conflicts within the same record may not be resolved correctly!

Make test

v4fire make-test block hello-world

It will generate simple tests for the src/components/**/b-hello-world component, if it exists.

v4fire make-test page slider

It will generate simple tests for the src/pages/**/p-slider page, if it exists.

v4fire make-test block src/foo/bar/componentName

It will generate simple component tests in the src/foo/bar/componentName folder

v4fire make-test page src/foo/bar/componentName

It will generate simple page tests in the src/foo/bar/componentName folder

The tool also will take care of updating demo-page

The tool generates a test folder for both components and pages. The template for component and the template for page contain the basic test setup and can execute these simple tests.

Runners

You can specify which runners you want to be included in test directory. By default, there are no runners and all test code locates in the test/index.js file. So if you'd like to have different runners for your test cases, you can specify them just after the path to module or component being tested.

v4fire make-test src/components/b-slider analytics render events

For each specified runner the tool will create test/runner/runner-name file. Here is the example of runner template for a module.

In this case generated test/index.js file will include only test setup and all test evaluation code will be moved to runners.

Ai buddy

If you want to learn about the capabilities and configuration of this feature, please refer to the documentation for the intelli-buddy package.

Below are instructions on how to use it in the context of V4fire CLI.

Without diffs

By default, it will replace the selected content with the processed one.

// src/text.txt
{{#ai prompt="translate on portuguese"}}Hello, world!{{/ai}}
v4fire ai-buddy src/text.txt
// src/text.txt
Olá, mundo!

With diffs

You can also specify the --diff flag. Then, in the output, you will see a comparison of the original and processed version in the Git diffs format. This means that the editor will pick up the format and highlight the changes for you.

// src/text.txt
{{#ai prompt="translate on portuguese"}}Hello, world!{{/ai}}
v4fire ai-buddy src/text.txt --diff
// src/text.txt
<<<<<<< ORIGINAL VERSION
Hello, world!
=======
Olá, mundo!
>>>>>>> CORRECTED VERSION