Fix bin/publish: copy docs.dist from project root

Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-10-21 02:08:33 +00:00
commit f6fac6c4bc
79758 changed files with 10547827 additions and 0 deletions

200
node_modules/decomment/README.md generated vendored Executable file
View File

@@ -0,0 +1,200 @@
decomment
=========
Removes comments from JSON/JavaScript, CSS/HTML, CPP/H, etc.
## Installing
```
$ npm i decomment
```
## Testing
```
$ npm test
```
Testing with coverage:
```
$ npm run coverage
```
## Usage
```js
const decomment = require('decomment');
const code = 'var t; // comments';
decomment(code); //=> var t;
```
For build systems / task runners see [gulp-decomment] and [grunt-decomment].
## Features
* Removes both single and multi-line comments from JSON, JavaScript and CSS/Text
* Automatically recognizes HTML and removes all `<!-- comments -->` from it
* Does not change layout / formatting of the original document
* Removes lines that have only comments on them
* Compatible with CSS3, JSON5 and ECMAScript 6
The library does not support mixed content - HTML with JavaScript or CSS in it.
Once the input code is recognized as HTML, only the HTML comments will be removed from it.
## Performance
For JSON and JavaScript this library uses [esprima] to guarantee correct processing for regular expressions.
As an example, it can process [AngularJS 1.5 Core](https://code.angularjs.org/1.5.0/angular.js)
in under 100ms, which is 1.1MB ~ 30,000 lines of JavaScript.
## API
### decomment(code, [options]) ⇒ String
This method first checks if the code starts with `<`, as an HTML, and if so, all `<!-- comment -->` entries
are removed, according to the `options`.
When the `code` is not recognized as HTML, it is assumed to be either JSON or JavaScript. It is then parsed
through [esprima] for ECMAScript 6 compliance, and to extract details about regular expressions.
If [esprima] fails to validate the code, it will throw a parsing error. When successful, this method will remove
`//` and `/**/` comments according to the `options` (see below).
##### options.safe ⇒ Boolean
* `false (default)` - remove all multi-line comments
* `true` - keep special multi-line comments that begin with:
- `<!--[if` - for conditional comments in HTML
- `/*!` - for everything else (other than HTML)
Example:
```js
const decomment = require('decomment');
const code = '/*! special */ var a; /* normal */';
decomment(code); //=> var a;
decomment(code, {safe: true}); //=> /*! special */ var a;
```
##### options.ignore ⇒ RegExp | [RegExp,...]
Takes either a single or an array of regular expressions to match against.
All matching blocks are then skipped, as well as any comment-like content inside them.
Examples:
* CSS may contain Base64-encoded strings with comment-like symbols:
```css
src: url(data:font/woff;base64,d09GRg//ABAAAAAAZ)
```
You can isolate all `url(*)` blocks by using:
```js
{ignore: /url\([\w\s:\/=\-\+;,]*\)/g}
```
* If you want to isolate jsDoc blocks (start with `/**`, followed by a line break, end with `*/`),
you can use the following:
```js
{ignore: /\/\*\*\s*\n([^\*]|(\*(?!\/)))*\*\//g}
```
##### options.space ⇒ Boolean
* `false (default)` - remove comment blocks entirely
* `true` - replace comment blocks with white spaces where needed, in order to preserve
the original line + column position of every code element.
Example:
```js
const decomment = require('decomment');
const code = 'var a/*text*/, b';
decomment(code); //=> var a, b
decomment(code, {space: true}); //=> var a , b
```
NOTE: When this option is enabled, option `trim` is ignored.
##### options.trim ⇒ Boolean
* `false (default)` - do not trim comments
* `true` - remove empty lines that follow removed full-line comments
Example:
```js
const decomment = require('decomment');
const code = '/* comment */\r\n\r\n var test = 123';
decomment(code); //=> \r\n var test = 123
decomment(code, {trim: true}); //=> var test = 123
```
NOTE: This option has no effect when option `space` is enabled.
##### options.tolerant ⇒ Boolean
* `false (default)` - perform strict JavaScript parsing (parser throws on invalid JavaScript)
* `true` - pass `tolerant` flag to [esprima] parser (the parser _may_ choose to continue parsing and produce a syntax tree).
Usefull for parsing Angular/TypeScript code, for example.
Example:
```js
const decomment = require('decomment');
const code = '/* comment */\r\n\r\n@Injectable()\r\nexport class HeroService {}';
decomment(code); //=> Error: 'Unexpected token ILLEGAL'
decomment(code, {tolerant: true}); //=> @Injectable()\r\nexport class HeroService {}
```
### decomment.text(text, [options]) ⇒ String
Unlike the default **decomment**, it instructs the library that `text` is not a JSON,
JavaScript or HTML, rather a plain text that needs no parsing or validation,
only to remove `//` and `/**/` comments from it according to the `options`.
This method is good for any text file that uses syntax `//` and `/**/` for comments,
such as: `.CSS`, `.CPP`, `.H`, etc.
Example:
```js
const decomment = require('decomment');
const text = '.my-class{color:Red;}// comments';
decomment.text(text); //=> .my-class{color:Red;}
```
Please note that while the same rules apply for the text blocks (`''`, `""` and \`\`),
you should not use this method for JSON or JavaScript, as it can break your regular expressions.
### decomment.html(html, [options]) ⇒ String
Unlike the default **decomment** method, it instructs the library not to parse
or validate the input in any way, rather assume it to be HTML, and remove all
`<!-- comment -->` entries from it according to the `options`.
### decomment.getEOL(text) ⇒ String
Returns End-of-Line string used within the `text`, based on the occurrence frequency:
* `\n` - for Unix-encoded text
* `\r\n` - for Windows-encoded text
When impossible to conclude (the same or 0 occurrence), it returns the default End-of-Line
for the current OS.
## License
Copyright © 2021 [Vitaly Tomilov](https://github.com/vitaly-t);
Released under the MIT license.
[esprima]:https://github.com/jquery/esprima
[grunt-decomment]:https://github.com/vitaly-t/grunt-decomment
[gulp-decomment]:https://github.com/vitaly-t/gulp-decomment

33
node_modules/decomment/lib/index.js generated vendored Executable file
View File

@@ -0,0 +1,33 @@
'use strict';
const parser = require('./parser');
const utils = require('./utils');
function main(code, options) {
return parser(code, options, {
parse: true // need to parse;
});
}
main.text = function (text, options) {
return parser(text, options, {
parse: false, // do not parse;
html: false // treat as plain text;
});
};
main.html = function (html, options) {
return parser(html, options, {
parse: false, // do not parse;
html: true // treat as HTML;
});
};
main.getEOL = function (text) {
if (typeof text !== 'string') {
throw new TypeError('Invalid parameter \'text\' specified.');
}
return utils.getEOL(text);
};
module.exports = main;

290
node_modules/decomment/lib/parser.js generated vendored Executable file
View File

@@ -0,0 +1,290 @@
'use strict';
const utils = require('./utils');
function parser(code, options, config) {
if (typeof code !== 'string') {
throw new TypeError('Input code/text/html must be a string.');
}
if (options !== undefined && typeof(options) !== 'object') {
throw new TypeError('Parameter \'options\' must be an object.');
}
const len = code.length, // code length;
optSafe = options && options.safe, // 'safe' option;
optSpace = options && options.space, // 'space' option;
optTrim = options && options.trim, // 'trim' option;
optTolerant = options && options.tolerant, // 'tolerant' option;
EOL = utils.getEOL(code); // get EOL from the code;
let idx = 0, // current index;
s = '', // resulting code;
emptyLine = true, // set while no symbols encountered on the current line;
emptyLetters = '', // empty letters on a new line;
isHtml, // set when the input is recognized as HTML;
regEx = []; // regular expression details;
if (!len) {
return code;
}
if (config.parse) {
isHtml = utils.isHtml(code);
if (!isHtml) {
regEx = utils.parseRegEx(code, optTolerant);
}
} else {
isHtml = config.html;
}
if (options && options.ignore) {
let ignore = options.ignore;
if (ignore instanceof RegExp) {
ignore = [ignore];
} else {
if (ignore instanceof Array) {
ignore = ignore.filter(f => f instanceof RegExp);
if (!ignore.length) {
ignore = null;
}
} else {
ignore = null;
}
}
if (ignore) {
for (let i = 0; i < ignore.length; i++) {
const reg = ignore[i];
let match;
do {
match = reg.exec(code);
if (match) {
regEx.push({
start: match.index,
end: match.index + match[0].length - 1
});
}
} while (match && reg.global);
}
regEx = regEx.sort((a, b) => a.start - b.start);
}
}
do {
if (!isHtml && code[idx] === '/' && idx < len - 1 && (!idx || code[idx - 1] !== '\\')) {
if (code[idx + 1] === '/') {
if (inRegEx()) {
if (emptyLetters) {
s += emptyLetters;
emptyLetters = '';
}
s += '/';
continue;
}
const lb1 = code.indexOf(EOL, idx + 2);
if (lb1 < 0) {
break;
}
if (emptyLine) {
emptyLetters = '';
if (optSpace) {
idx = lb1 - 1; // just before the line break;
} else {
idx = lb1 + EOL.length - 1; // last symbol of the line break;
trim();
}
} else {
idx = lb1 - 1; // just before the line break;
}
continue;
}
if (code[idx + 1] === '*') {
if (inRegEx()) {
if (emptyLetters) {
s += emptyLetters;
emptyLetters = '';
}
s += '/';
continue;
}
const end1 = code.indexOf('*/', idx + 2),
keep1 = optSafe && idx < len - 2 && code[idx + 2] === '!';
if (keep1) {
if (end1 >= 0) {
s += code.substr(idx, end1 - idx + 2);
} else {
s += code.substr(idx, len - idx);
}
}
if (end1 < 0) {
break;
}
const comment1 = code.substr(idx, end1 - idx + 2);
idx = end1 + 1;
if (emptyLine) {
emptyLetters = '';
}
if (!keep1) {
const parts1 = comment1.split(EOL);
if (optSpace) {
for (let k1 = 0; k1 < parts1.length - 1; k1++) {
s += EOL;
}
}
const lb2 = code.indexOf(EOL, idx + 1);
if (lb2 > idx) {
let gapIdx1 = lb2 - 1;
while ((code[gapIdx1] === ' ' || code[gapIdx1] === '\t') && --gapIdx1 > idx) ;
if (gapIdx1 === idx) {
if (emptyLine && !optSpace) {
idx = lb2 + EOL.length - 1; // last symbol of the line break;
trim();
}
} else {
if (optSpace) {
s += utils.getSpaces(parts1[parts1.length - 1].length);
}
}
} else {
if (optSpace) {
let gapIdx2 = idx + 1;
while ((code[gapIdx2] === ' ' || code[gapIdx2] === '\t') && ++gapIdx2 < len) ;
if (gapIdx2 < len) {
s += utils.getSpaces(parts1[parts1.length - 1].length);
}
}
}
}
continue;
}
}
if (isHtml && code[idx] === '<' && idx < len - 3 && code.substr(idx + 1, 3) === '!--') {
if (inRegEx()) {
if (emptyLetters) {
s += emptyLetters;
emptyLetters = '';
}
s += '<';
continue;
}
const end2 = code.indexOf('-->', idx + 4),
keep2 = optSafe && code.substr(idx + 4, 3) === '[if';
if (keep2) {
if (end2 >= 0) {
s += code.substr(idx, end2 - idx + 3);
} else {
s += code.substr(idx, len - idx);
}
}
if (end2 < 0) {
break;
}
const comment2 = code.substr(idx, end2 - idx + 3);
idx = end2 + 2;
if (emptyLine) {
emptyLetters = '';
}
if (!keep2) {
const parts2 = comment2.split(EOL);
if (optSpace) {
for (let k2 = 0; k2 < parts2.length - 1; k2++) {
s += EOL;
}
}
const lb3 = code.indexOf(EOL, idx + 1);
if (lb3 > idx) {
let gapIdx3 = lb3 - 1;
while ((code[gapIdx3] === ' ' || code[gapIdx3] === '\t') && --gapIdx3 > idx) ;
if (gapIdx3 === idx) {
if (emptyLine && !optSpace) {
idx = lb3 + EOL.length - 1; // last symbol of the line break;
trim();
}
} else {
if (optSpace) {
s += utils.getSpaces(parts2[parts2.length - 1].length);
}
}
} else {
if (optSpace) {
let gapIdx4 = idx + 1;
while ((code[gapIdx4] === ' ' || code[gapIdx4] === '\t') && ++gapIdx4 < len) ;
if (gapIdx4 < len) {
s += utils.getSpaces(parts2[parts2.length - 1].length);
}
}
}
}
continue;
}
const symbol = code[idx],
isSpace = symbol === ' ' || symbol === '\t';
if (symbol === '\r' || symbol === '\n') {
if (code.indexOf(EOL, idx) === idx) {
emptyLine = true;
}
} else {
if (!isSpace) {
emptyLine = false;
s += emptyLetters;
emptyLetters = '';
}
}
if (emptyLine && isSpace) {
emptyLetters += symbol;
} else {
s += symbol;
}
if (!isHtml && (symbol === '\'' || symbol === '"' || symbol === '`') && (!idx || code[idx - 1] !== '\\')) {
if (inRegEx()) {
continue;
}
let closeIdx = idx;
do {
closeIdx = code.indexOf(symbol, closeIdx + 1);
if (closeIdx > 0) {
let shIdx = closeIdx;
while (code[--shIdx] === '\\') ;
if ((closeIdx - shIdx) % 2) {
break;
}
}
} while (closeIdx > 0);
if (closeIdx < 0) {
break;
}
s += code.substr(idx + 1, closeIdx - idx);
idx = closeIdx;
}
} while (++idx < len);
function inRegEx() {
if (regEx.length) {
return utils.indexInRegEx(idx, regEx);
}
}
function trim() {
if (optTrim) {
let startIdx, endIdx, i;
do {
startIdx = idx + 1;
endIdx = code.indexOf(EOL, startIdx);
i = startIdx;
while ((code[i] === ' ' || code[i] === '\t') && ++i < endIdx) ;
if (i === endIdx) {
idx = endIdx + EOL.length - 1;
}
} while (i === endIdx);
}
}
return s;
}
module.exports = parser;

95
node_modules/decomment/lib/utils.js generated vendored Executable file
View File

@@ -0,0 +1,95 @@
'use strict';
const esprima = require('esprima');
const os = require('os');
////////////////////////////////////////////////////
// Automatically calculates and returns End of Line,
// based on the input text.
function getEOL(text) {
let idx = 0, unix = 0, windows = 0;
while (idx < text.length) {
idx = text.indexOf('\n', idx);
if (idx == -1) {
break;
}
if (idx > 0 && text[idx - 1] === '\r') {
windows++;
} else {
unix++;
}
idx++;
}
if (unix === windows) {
return os.EOL;
}
return unix > windows ? '\n' : '\r\n';
}
////////////////////////////////////////////////////////////////////
// Tokenizes JSON or JavaScript via Esprima, enumerates and returns
// all regular expressions as an array of absolute location indexes
// within the source: [{start, end}, {start, end},...]
function parseRegEx(code, tolerant) {
const result = [];
// NOTE: Even though we do not need the location details,
// using option `loc` makes `tokenize` perform 40% faster.
esprima.tokenize(code, {loc: true, range: true, tolerant: !!tolerant}, node => {
if (node.type === 'RegularExpression') {
result.push({
start: node.range[0] + 1, // next after the opening `/`
end: node.range[1] - 1 // previous to the closing `/`
});
}
});
return result;
}
///////////////////////////////////////////////////////////////////////
// Executes a linear search through an array of absolute regEx indexes,
// to find whether the passed index is inside one of the regEx entries.
function indexInRegEx(idx, regExData) {
// regExData - the output provided by parseRegEx;
let mid, low = 0, high = regExData.length - 1;
while (low <= high) {
mid = Math.round((low + high) / 2);
const a = regExData[mid];
if (idx >= a.start) {
if (idx <= a.end) {
return true;
}
low = mid + 1;
} else {
high = mid - 1;
}
}
return false;
}
////////////////////////////////////////////////
// Checks the text for being HTML, by verifying
// whether `<` is the first non-empty symbol.
function isHtml(text) {
let s, idx = 0;
do {
s = text[idx];
if (s !== ' ' && s !== '\t' && s !== '\r' && s !== '\n') {
return s === '<';
}
} while (++idx < text.length);
}
////////////////////////////////////////////////
// Returns space symbol multiplied n times.
//
function getSpaces(n) {
return ' '.repeat(n);
}
module.exports = {
getEOL: getEOL,
getSpaces: getSpaces,
parseRegEx: parseRegEx,
indexInRegEx: indexInRegEx,
isHtml: isHtml
};

50
node_modules/decomment/package.json generated vendored Executable file
View File

@@ -0,0 +1,50 @@
{
"name": "decomment",
"version": "0.9.5",
"description": "Removes comments from JSON/JavaScript, CSS/HTML, CPP/H, etc.",
"main": "lib/index.js",
"scripts": {
"test": "jasmine-node test",
"coverage": "istanbul cover ./node_modules/jasmine-node/bin/jasmine-node test",
"lint": "eslint ./lib ./test"
},
"files": [
"lib"
],
"homepage": "https://github.com/vitaly-t/decomment",
"repository": {
"type": "git",
"url": "https://github.com/vitaly-t/decomment.git"
},
"bugs": {
"url": "https://github.com/vitaly-t/decomment/issues",
"email": "vitaly.tomilov@gmail.com"
},
"keywords": [
"remove comments",
"JavaScript",
"JSON",
"CSS",
"HTML",
"CPP",
"C++",
"Text"
],
"author": {
"name": "Vitaly Tomilov",
"email": "vitaly.tomilov@gmail.com"
},
"license": "MIT",
"engines": {
"node": ">=6.4",
"npm": ">=2.15"
},
"dependencies": {
"esprima": "4.0.1"
},
"devDependencies": {
"eslint": "8.1.0",
"istanbul": "0.4.5",
"jasmine-node": "3.0.0"
}
}