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

message-go

v1.0.0

Published

A tiny tool to automatically collect messages in source file and transfer them into message properties file(for SF projects)

Downloads

1

Readme

Message-Go

A tiny tool to automatically collect messages in source file and transfer them into message properties file

Why Message-Go

In SF's project, i18n is an important thing we should take care of as an engineer. Commonly, these static messages should be put in the sfmessages-MODULE.properties.utf8.

Problems here!

When you (as an UI developer) develop a new feature for some au module, you have to put the new messages in the sfmessages-MODULE.properties.utf8 file which is located in V4. Then it is required to REBUILD v4 and REDEPLOY your module to get the new messages. As shown in the following chart, the process is really crappy:

  +---------------------+
  | add/change messages |<--------+
  | in sfmessages-MO... |         |
  +---------------------+         |
            +                     |
            |                     |
            v                     |
  +---------------------+         |
  |     rebuild V4      |         |
  +---------------------+         |
            +                     |
            |                     |
            v                     |
  +---------------------+         |
  |  redeploy au module |         |
  +---------------------+         |
            +                     |
            |                     |
            v                     |
  +---------------------+         |
  |  Need more changes  |+--------+
  +---------------------+

So, here comes Message-Go, Message-Go gives you a more efficient way to add new messages, as described in the following:

  1. You just add messages in your source file(like new-feature.js) anyway(At the top of the source file is recommended), like

    MSGS.HOMEPAGE_ADMIN_LABEL_SHOW='show'; MSGS.HOMEPAGE_ADMIN_LABEL_HIDE='hide'; ....

    // use the message in the same way as in production html.push(MSGS.HOMEPAGE_ADMIN_LABEL_SHOW); ...

  2. Message-Go will COLLECT all the messages in your source file(or directory) , put them into sfmessages-MODULE.properties.utf8 automatically after your confirmed you don't wanna change them any more and run Message-Go.

The following chart shows the advantage to use Message-Go compared with the common way:

        OLD PROCESS                     WITH MESSAGE-GO
      ---------------                  -----------------

  +---------------------+          +------------------------+
  | add/change messages |<--+      | add/change messages in |<--+
  | in sfmessages-MO... |   |      | source file directly   |   |
  +---------------------+   |      +------------------------+   |
            +               |                  +                |
            |               |                  |                |
            v               |                  v                |
  +---------------------+   |      +------------------------+   |
  |     rebuild V4      |   |      |        deploy-js       |   |
  +---------------------+   |      +------------------------+   |
            +               |                  +                |
            |               |                  |                |
            v               |                  v                |
  +---------------------+   |      +------------------------+   |
  |  redeploy au module |   |      |    Need more changs    |+--+
  +---------------------+   |      +------------------------+
            +               |                  
            |               |                  
            v               |                  
  +---------------------+   |      
  |  Need more changes  |+--+
  +---------------------+

As you see, with Message-Go, you don't need to rebuild and redeploy anymore, it will make better powerful if it is used with NProxy and you can say GOODBYE to build system as a UI developer.

The following chart shows the great powerful from NProxy and Message-Go:

     WITH MESSAGE-GO                  WITH MESSAGE-GO AND NPROXY
    -----------------                ----------------------------

  +------------------------+          +------------------------+
  | add/change messages in |<--+      | add/change messages in |<--+
  | source file directly   |   |      | source file directly   |   |
  +------------------------+   |      +------------------------+   |
            +                  |                  +                |
            |                  |                  |                |
            v                  |                  v                |
  +------------------------+   |      +------------------------+   |
  |      deploy-js         |   |      |    Need more changs    |+--|
  +------------------------+   |      +------------------------+   
            +                  |       
            |                  |       
            v                  |       
  +------------------------+   |     
  |  Need more changs      |+--|   
  +------------------------+       

Installation

npm i -g message-go

Update

npm update -g message-go

Usage

mgo -f /Users/goddyzhao/project/js -t /Users/goddyzhao/project/sfmessage.properties

Note: -f(from) can be a js file or directory(Message-Go will treat only js file now) -t(to) should be a file but not directory

More Options Usage: mgo [options]

Options:

-h, --help         output usage information
-V, --version      output the version number
-f, --from [from]  Specify a single source file or directory including messages
-t, --to [to]      Specify the message property file

License

Message-Go is available under the terms of the MIT License