
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
gulp-dss-extra
Advanced tools
DEPRECATED!
The variable parser has been moved to dss-variable-parser as useful in various contexts, not just gulp.
The markup examples for state can be made with some post-processing of your DSS like:
dss.blocks.forEach(function(block) {
if (block.hasOwnProperty('state') && block.hasOwnProperty('markup')) {
template = hogan.compile(block.markup.example);
block.markup.example = template.render({}).replace(/\s?[a-z]+="\s*"/gi, '');
block.markup.escaped = block.markup.example.replace(/</g, '<').replace(/>/g, '>');
block.state.forEach(function(state) {
state.markup = {
example: template.render(state),
escaped: template.render(state).replace(/</g, '<').replace(/>/g, '>')
};
});
}
});
Because this relies on 2 DSS variables being present (markup and state) it's not possible to build this into a DSS parser AFAICT.
The other bits and pieces are easy to replicate if you need then :)
A gulp plug-in for parsing Documented Style Sheets (DSS) comments in your CSS/SCSS/LESS, with a couple of extra features.
This will add dss and meta properties to your files.
var gulp = require('gulp');
var dss = require('gulp-dss-extra');
gulp.task('dss', function() {
return gulp.src('src/**/*.scss')
.pipe(dss());
});
It doesn't output any files, so should be used with another pipe that merges with templates.
These parsers are in addition to default @name, @description, @state and @markup:
@variable {name} - {description} - Document a variable. The name must match the name in the file without a $ prefix. The value will be extracted from the file and assigned to value. It won't be computed so things like $height: 5px*10 will have a literal value 5px*10.@stateThe @state is post-parsed to add HTML examples for each state. This is rendered with the state (using hogan) so you can add class names etc. For example:
/**
* @name Button
* @state .primary - Primary button
* @state .danger - Dangerous button
* @markup
* <button class="{{{escaped}}}">{{description}}</button>
*/
As well as block.markup each state will now have markup.example and markup.escaped added. Empty attributes will be stripped from the stateless example to avoid clutter.
file.metasectionName - The @name from the first block in files with basename index is copied to file.meta.sectionNamesubsectionName - The @name from the first block in files without basename index is copied to file.meta.subsectionNameobjectAn key/value hash of additional properties to extract. The value should be a function to parse the DSS (see the DSS docs), or true if you just want the value as is.
objectA key/value hash of properties to copy from the first block to file.meta. The value can be a function with signature function (file, firstBlock) and should return the value, or true just to copy the property.
Note when using the function the property doesn't have to already exist, it can be grabbed from another property. For example in the default options the value sectionName is assigned from the first block's @name in files with the basename index.
arrayIn DSS if properties are only put into arrays if there is more than one. Properties listed in normalizeArray will be forced into an array. Defaults to ['variable', 'state'].
FAQs
gulp plug-in to parse DSS with extra annotations
We found that gulp-dss-extra demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.

Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.

Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.