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

simple-vf-cli

v0.7.5

Published

A simple cli tool for building visualforce pages locally using cutting edge front-end build systems.

Downloads

17

Readme

Simple VF Cli

Simple VF Cli is a small command line utility enabling you to develop Visualforce pages using your favorite front-end build system.

Why

  • Have you tried using a framework like ember, react, angular, etc... inside Salesforce? It's a nightmare and usually consists of you having to give up your local build system (ember-cli, angular-cli, etc...) to do so but not any more!
  • Allows you to leverage Remote Actions (@RemoteAction) and Remote Objects (<apex:remoteObjects>) in your app to CRUD your data for free, no api hits!
  • Gives you back your favorite front-end development tools like your IDE of choice, task runners, build systems, linting, intellisense, the list goes on...
  • No "syncing" code changes to Salesforce during development (you would normally have to make a change to a Visualforce page or static resource and then wait for those changes to save up to Salesforce which often caused a lot of waiting).

Requirements:

  • Node v6.0.0+
    • This project uses several es6 features and does not transpile down to es5
  • A Salesforce org and a user with metadata api access
    • If your Salesforce user does not use the System Administrator profile and you come across additional permissions needed, please let me know so that I can update this documentation!

How to install:

npm install simple-vf-cli -g

This will add the svf command to your path.

Unfortunately you cannot use Yarn to install this cli globally because we are using PouchDB under the hood and Yarn is unable to download and install the right binary. This ends up producing an error stating you need Python installed on your machine which is unnecessary for this project.

Now you can run the svf --version command to ensure simple-vf-cli installed successfully:

NOTE: The version number displayed for you may vary

> svf --version
0.7.0

Run the svf --help command to see all available commands/options.

You can also simply type the svf command with no arguments to produce the same documentation.

Commands:


auth

> svf auth

This command will create an authentication connection to the desired Salesforce org. This connection is stored in a PouchDB instance provided by this tool. Your password will be encrypted using a randomly generated key that is unique to your computer and your computer only.

Neither your password or your unique encryption key will ever be transmitted anywhere, guaranteed!


new

> svf new

This command will create a new Visualforce page (or find an existing one) for the name that you have entered. This new page will be stubbed out with the necessary custom setting, javascript, and css references needed to run inside Salesforce.

You will be asked to choose the type of build system you are using locally to create this page. If you do not see your build system listed, that means a plugin for that build system has not been created yet. More documentation is to come on building plugins.

NOTE: Check the wiki in this repo to see a tutorial for your specific build system.


serve

> svf serve

This command will start an ngrok tunnel that will port your local build system's "output" directory to your Visualforce page. The SimpleVfPageConfig custom setting will be updated with the randomly generated ngrok tunnel domain which will allow the Visualforce page to access the javascript and css resources being served by your local front end build system.


deploy

> svf deploy

This command will deploy the "output" directory of your local build system as is, to the static resource used by the Visualforce page.

NOTE: The maximum size limit for a Salesforce static resource is 5MB. The contents of your build system's "output" directory will be zipped up and deployed to Salesforce as a static resource. If your output directory is larger than 5MB after being compressed, please consider using a cdn or another static resource to pull in some of the external dependencies needed by your app.

An example of this could be that your app is dependent on jQuery. Rather than including jQuery as a dependency that gets included in the compiled output of your build system, include jQuery via script tag directly on the Visualforce page before the script tags that pull in your app. This will help keep the footprint of your app smaller and still ensures jQuery is available on your page.