@magento/directive-parser
Parses Magento PWA Studio directives
Last updated a year ago by sirugh .
(OSL-3.0 OR AFL-3.0) · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @magento/directive-parser 
SYNC missed versions from official npm registry.

PWA Studio Directive Parser

CircleCI

A Directive in Magento PWA Studio is an inline comment within a source file that signals additional metadata that should be processed by the PWA Studio tooling.

If you're a user of Magento PWA Studio, it's unlikely you're looking to depend on this package directly. The primary use-case for this library is to be consumed by other PWA Studio tools.

Goals

The primary goals of this project are:

  • Parse all JavaScript comments within a source file, and return descriptors for every comment that conforms to the Magento Directive syntax
  • Run significantly faster than a parser that parses the entire ECMAScript grammar
  • Provide actionable warnings/errors with location info

Install

npm install @magento/directive-parser

Usage

const parseDirectives = require('@magento/directive-parser');
const { directives, errors } = parseDirectives(someSourceFileString);

Example Directive (Kitchen Sink)

/**
 * @RootComponent
 * pageTypes = some_page, some_other_page
 * description = "Some description here"
 */

Current Tags

  • 0.1.8                                ...           latest (a year ago)

7 Versions

  • 0.1.8                                ...           a year ago
  • 0.1.7                                ...           a year ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.1                                ...           3 years ago
Downloads
Today 0
This Week 1
This Month 3
Last Day 0
Last Week 1
Last Month 14
Dependencies (1)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |