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

generate-soy-source-maps

v0.2.7-alpha

Published

Generates a source map for Closure template (Soy templates) based on the implementation [described here](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?hl=en_US#). The parsed code is the compiled to incremental Dom th

Downloads

13

Readme

Soy SourceMaps · npm version License MIT PRs Welcome

Generates a source map for Closure template (Soy templates) based on the implementation described here. The parsed code is the compiled to incremental Dom that is made here.

Considering a map of origin for Soy, you guarantee some benefits:

  • Tests coverage - With soy.js files being mapped by the tests you would never be able to cover all use cases, some are just implementations to cover older versions of soy, with source maps you will only cover the parts of interest without affecting the end result.
  • Debugger - With the source map of soy files you will be able to debug in a simple way the same way you write in the syntax of Soy. You do not need to know the generated soy.js file.

Table of Contents

Install

Via NPM:

$ npm install --global generate-soy-source-maps

or via Yarn:

$ yarn add --global generate-soy-source-maps

CLI

Usage

$ soy-sourcemaps

All CLI Options

  Usage
    $ soy-sourcemaps [options]

  Options
    --input      The path of the Soy file
    --output     The path to the final file

Integration

Using with webpack and metalsoy

You may want to integrate the Soy source map generator with your Webpack into your current stack. To do this, the webpack should take the source map generated from outside its scope, consider installing the source-map-loader loader that does exactly that.

npm install -D source-map-loader

In your webpack configuration file, consider adding this new rule:

module.exports = {
  module: {
    rules: [
      //...
      {
        enforce: 'pre',
        test: /\.js$/,
        loader: 'source-map-loader',
      }
      //...
    ]
  }
  //...
};

For a better integration with metalsoy, if you have some task to run the build, consider running the source maps CLI after metalsoy:

{
  "scripts": {
    "build": "metalsoy && soy-sourcemaps --input './src' && webpack"
  }
}

Roadmap

Here's what's coming up for Soy Sourcemaps:

  • ~~Typescript support~~
  • ~~CLI: Generate sourcemaps for multiple files~~
  • Integration with metal-tools-soy
  • Parse HTML in soy files (with Sourcemaps for the generated)

Contributing

Feel free to open up problems or send pull requests. We will always be looking at these problems and we will be responding whenever possible.

Before opening a issue make sure it exists.

License

MIT License