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

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
};