Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@progress/dss
Advanced tools
This is a fork of DSS.
DSS, Documented Style Sheets, is a comment styleguide and parser for CSS, LESS, SASS and SCSS code.
In most cases, you will want to include the DSS parser in a build step that will generate documentation files automatically.
/**
* @name Button
* @description Your standard form button.
*
* @state :hover - Highlights when hovering.
* @state :disabled - Dims the button when disabled.
* @state .primary - Indicates button is the primary action.
* @state .smaller - A smaller button.
*
* @example
* <span>
* <button>This is a button</button>
* </span>
*
* @deprecated 123.321
* @deprecatedDescription This is deprecated.
*
* @group Buttons
* @type Color
* @subtype Text-Color
* @key $button-bg
*
* @param {string} par1 - ParmOne description.
* @param {function} par2 - ParamTwo description.
* @returns {number} - Return description.
*/
/// @name Button
/// @description Your standard form button.
///
/// @state :hover - Highlights when hovering.
/// @state :disabled - Dims the button when disabled.
/// @state .primary - Indicates button is the primary action.
/// @state .smaller - A smaller button.
///
/// @example
/// <span>
/// <button>This is a button</button>
/// </span>
///
/// @deprecated 123.321
/// @deprecatedDescription This is deprecated.
///
/// @group Buttons
/// @type Color
/// @subtype Text-Color
/// @key $button-bg
///
/// @param {string} par1 - ParmOne description.
/// @param {function} par2 - ParamTwo description.
/// @returns {number} - Return description.
///
// Require/read a file
const fs = require('fs');
const dss = require('dss');
const file = fs.readFileSync('styles.scss');
// Run DSS Parser
dss.parse(file, {}, (parsed) => {
console.log(parsed.blocks);
});
[{
"name": "Button",
"description": "Your standard form button.",
"state": [
{
"name": ":hover",
"escaped": "pseudo-class-hover",
"description": "Highlights when hovering."
},
{
"name": ":disabled",
"escaped": "pseudo-class-disabled",
"description": "Dims the button when disabled."
},
{
"name": ".primary",
"escaped": "primary",
"description": "Indicates button is the primary action."
},
{
"name": ".smaller",
"escaped": "smaller",
"description": "A smaller button."
}
],
"example": {
"example": " <span>\n <button>This is a button</button>\n </span>",
"escaped": " <span>\n <button>This is a button</button>\n </span>"
},
"deprecated": "123.321",
"deprecatedDescription": "This is deprecated.",
"group": "buttons",
"type": "color",
"subtype": "text-color",
"key": "$button-bg",
"param": [
{
"type": "{string}",
"name": "par1",
"description": "ParmOne description."
},
{
"type": "{function}",
"name": "par2",
"description": "ParmTwo description."
}
],
"returns": {
"type": "{number}",
"name": null,
"description": "Return description."
}
}]
description
and example
parsers allow usage of multi-line comments.description
. However, if a description
annotation is available, the parser overrides the non-annotation one.example
is provided, the parser returns an array of examples.state
and param
parsers are returning an array of all the relevant annotations.type
and key
values based on the next line.group
, type
, and subtype
parsers convert the string annotation to lowercase letters.The parser aliases set their value in the key
of the main parser in the output JSON
.
DSS, by default, includes the following alias
- parser
pairs:
return
- returns
markup
- example
DSS, by default, includes the name
, description
, state
, example
, deprecated
, deprecatedDescription
, group
, type
, subtype
, key
, param
, and returns
parsers of a comment block. You can add to or override these default parsers using the following:
// Matches @link
dss.parser('link', (i, line, block, file) => {
// Replace link with HTML wrapped version
const exp = /(b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/ig;
return line.replace(exp, "<a href='$1'>$1</a>");
});
// Matches @version
dss.parser('version', (i, line, block, file) => {
return line;
});
1.0.1 (2021-03-02)
FAQs
Documented Style Sheets
The npm package @progress/dss receives a total of 218 weekly downloads. As such, @progress/dss popularity was classified as not popular.
We found that @progress/dss 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.