diff --git a/.gitignore b/.gitignore index 77d8bb8..20e6ab2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -dist/ +.idea .DS_Store node_modules/ .vscode npm-debug.log -.package-lock.json +package-lock.json diff --git a/README.md b/README.md index 1702809..b119f9e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ +#### 原仓库 +https://github.com/plentycode/sass-export + +#### 改动点 +增加过滤注释功能 + +#### 安装 +npm i -D zhf.sass-export + # Sass-Export **Sass-export** takes SCSS files and export them to a JSON file you can use as data. diff --git a/dist/app/converter/converter-buffer.js b/dist/app/converter/converter-buffer.js new file mode 100644 index 0000000..2ab5781 --- /dev/null +++ b/dist/app/converter/converter-buffer.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConverterBuffer = void 0; +const converter_1 = require("./converter"); +const Types = { + STRUCTURED: 'structured', + ARRAY: 'array' +}; +class ConverterBuffer extends converter_1.Converter { + constructor(inputBuffers, options) { + super(options); + this.inputBuffers = inputBuffers; + } + getData() { + if (this.options && this.options.type === Types.ARRAY) { + return Promise.resolve(this.getArray()); + } + else { + return Promise.resolve(this.getStructured()); + } + } + getContent() { + let contents = this.inputBuffers.map((buffer) => buffer.toString()); + return contents.join('\n'); + } +} +exports.ConverterBuffer = ConverterBuffer; +//# sourceMappingURL=converter-buffer.js.map \ No newline at end of file diff --git a/dist/app/converter/converter-buffer.js.map b/dist/app/converter/converter-buffer.js.map new file mode 100644 index 0000000..19918f6 --- /dev/null +++ b/dist/app/converter/converter-buffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"converter-buffer.js","sourceRoot":"","sources":["../../../src/app/converter/converter-buffer.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAIxC,MAAM,KAAK,GAAG;IACZ,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;CACf,CAAC;AAEF,MAAa,eAAgB,SAAQ,qBAAS;IAG5C,YAAY,YAAsB,EAAE,OAAkB;QACpD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAEM,OAAO;QACZ,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,KAAK,EAAE;YACrD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACzC;aAAM;YACL,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;SAC9C;IACH,CAAC;IAGM,UAAU;QACf,IAAI,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC5E,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AArBD,0CAqBC"} \ No newline at end of file diff --git a/dist/app/converter/converter.js b/dist/app/converter/converter.js new file mode 100644 index 0000000..ebb8637 --- /dev/null +++ b/dist/app/converter/converter.js @@ -0,0 +1,107 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Converter = void 0; +const fs = require("fs"); +const sass = require("sass"); +const glob = require("glob"); +const parser_1 = require("../parser"); +const utils_1 = require("../utils"); +const LINE_BREAK = '\n'; +class Converter { + constructor(options) { + this.options = options; + this.options = options || {}; + } + getArray() { + let content = this.getContent(); + let parsedDeclarations = new parser_1.Parser(content).parse(); + return parsedDeclarations.map((declaration) => { + let isMap = false; + if (declaration.mapValue) { + isMap = true; + } + declaration.compiledValue = this.renderPropertyValue(content, declaration, isMap); + declaration.name = `$${declaration.name}`; + if (declaration.mapValue) { + declaration.mapValue.map((mapDeclaration) => { + mapDeclaration.compiledValue = this.renderPropertyValue(content, mapDeclaration, true); + return mapDeclaration; + }); + } + return declaration; + }); + } + getStructured() { + let content = this.getContent(); + let structuredDeclaration = new parser_1.Parser(content).parseStructured(); + structuredDeclaration = this.compileStructure(structuredDeclaration); + return structuredDeclaration; + } + compileStructure(structuredDeclaration) { + let groups = Object.keys(structuredDeclaration); + groups.forEach((group) => { + let content = this.getContent(); + let isMap = false; + let compiledGroup = structuredDeclaration[group].map((declaration) => { + if (declaration.mapValue) { + isMap = true; + } + declaration.compiledValue = this.renderPropertyValue(content, declaration, isMap); + declaration.name = `$${declaration.name}`; + if (declaration.mapValue) { + declaration.mapValue.map((mapDeclaration) => { + mapDeclaration.compiledValue = this.renderPropertyValue(content, mapDeclaration, true); + return mapDeclaration; + }); + } + return declaration; + }); + }); + return this.checkForMixins(structuredDeclaration); + } + getContent() { + let inputFiles = []; + let inputs = []; + if (!Array.isArray(this.options.inputFiles)) { + inputFiles.push(this.options.inputFiles); + } + else { + inputFiles = this.options.inputFiles; + } + inputFiles.forEach((path) => { + let files = glob.sync(String(path)); + inputs.push(...files); + }); + let contents = inputs.map((filePath) => fs.readFileSync(String(filePath))); + let strContents = contents.join(LINE_BREAK); + strContents = strContents.replace(/\/\*[\w\W\r\n]*?\*\//g, ''); + strContents = strContents.split(LINE_BREAK).filter(v => v.indexOf('//') === -1).join(LINE_BREAK); + return strContents; + } + checkForMixins(structuredDeclaration) { + let mixinsGroup = 'mixins'; + let parsedMixins = new parser_1.Mixins(this.getContent()).parse(); + if (parsedMixins && parsedMixins.length) { + structuredDeclaration[mixinsGroup] = parsedMixins; + } + return structuredDeclaration; + } + renderPropertyValue(content, declaration, isMap) { + try { + let rendered = sass.renderSync({ + data: content + LINE_BREAK + utils_1.Utils.wrapCss(declaration, isMap), + includePaths: this.options.includePaths, + outputStyle: 'compressed' + }); + let wrappedRendered = String(rendered.css); + wrappedRendered = utils_1.Utils.removeDoubleQuotes(wrappedRendered); + return utils_1.Utils.unWrapValue(wrappedRendered); + } + catch (err) { + console.error(err); + return ''; + } + } +} +exports.Converter = Converter; +//# sourceMappingURL=converter.js.map \ No newline at end of file diff --git a/dist/app/converter/converter.js.map b/dist/app/converter/converter.js.map new file mode 100644 index 0000000..59ff168 --- /dev/null +++ b/dist/app/converter/converter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"converter.js","sourceRoot":"","sources":["../../../src/app/converter/converter.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,6BAA6B;AAC7B,6BAA6B;AAC7B,sCAA2C;AAC3C,oCAAiC;AAEjC,MAAM,UAAU,GAAG,IAAI,CAAC;AAMxB,MAAa,SAAS;IAEpB,YAAmB,OAAkB;QAAlB,YAAO,GAAP,OAAO,CAAW;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAc,CAAC;IAC3C,CAAC;IAEM,QAAQ;QACb,IAAI,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,IAAI,kBAAkB,GAAG,IAAI,eAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;QAErD,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;YAC5C,IAAI,KAAK,GAAG,KAAK,CAAC;YAElB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,KAAK,GAAG,IAAI,CAAC;aACd;YAED,WAAW,CAAC,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;YAClF,WAAW,CAAC,IAAI,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;YAG1C,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE;oBAC1C,cAAc,CAAC,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;oBACvF,OAAO,cAAc,CAAC;gBACxB,CAAC,CAAC,CAAC;aACJ;YACD,OAAO,WAAW,CAAC;QACrB,CAAC,CAAC,CAAC;I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QAEzD,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,EAAE;YACvC,qBAAqB,CAAC,WAAW,CAAC,GAAG,YAAY,CAAC;SACnD;QAED,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAGO,mBAAmB,CAAC,OAAe,EAAE,WAAyB,EAAE,KAAc;QACpF,IAAI;YACF,IAAI,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC;gBAC7B,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,aAAK,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC;gBAC9D,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY;gBACvC,WAAW,EAAE,YAAY;aAC1B,CAAC,CAAC;YAEH,IAAI,eAAe,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC3C,eAAe,GAAG,aAAK,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;YAC5D,OAAO,aAAK,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;SAE3C;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnB,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AA7HD,8BA6HC"} \ No newline at end of file diff --git a/dist/app/converter/index.js b/dist/app/converter/index.js new file mode 100644 index 0000000..bccc23e --- /dev/null +++ b/dist/app/converter/index.js @@ -0,0 +1,15 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./converter"), exports); +__exportStar(require("./converter-buffer"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/app/converter/index.js.map b/dist/app/converter/index.js.map new file mode 100644 index 0000000..771cd6c --- /dev/null +++ b/dist/app/converter/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/converter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,qDAAmC"} \ No newline at end of file diff --git a/dist/app/parser/index.js b/dist/app/parser/index.js new file mode 100644 index 0000000..363baed --- /dev/null +++ b/dist/app/parser/index.js @@ -0,0 +1,15 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./parser"), exports); +__exportStar(require("./mixins"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/app/parser/index.js.map b/dist/app/parser/index.js.map new file mode 100644 index 0000000..4e3a664 --- /dev/null +++ b/dist/app/parser/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/parser/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,2CAAyB"} \ No newline at end of file diff --git a/dist/app/parser/mixins.js b/dist/app/parser/mixins.js new file mode 100644 index 0000000..d0003d4 --- /dev/null +++ b/dist/app/parser/mixins.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Mixins = void 0; +const MIXIN_VALUES_REGEX = /@mixin ?((?!\d)[\w_-][\w\d_-]*)(\([^\)"]+.)?/gi; +const FUNC_VALUES_REGEX = /@function ?((?!\d)[\w_-][\w\d_-]*)(\([^\)"]+.)?/gi; +const MIXIN_DECLARATION_REGEX = '@mixin.[^\{]+|@function.[^\{]+'; +class Mixins { + constructor(rawContent) { + this.rawContent = rawContent; + } + parse() { + let matches = this.extractDeclarations(this.rawContent); + let declarations = []; + matches.forEach((match) => { + let mixins = this.parseSingle(match); + let functions = this.parseSingle(match, true); + if (mixins) { + declarations.push(mixins); + } + if (functions) { + declarations.push(functions); + } + }); + return declarations; + } + extractDeclarations(content) { + let matches = content.match(new RegExp(MIXIN_DECLARATION_REGEX, 'gi')); + if (!matches) { + return []; + } + return matches; + } + parseSingle(declaration, checkFunctions = false) { + let regex = checkFunctions ? FUNC_VALUES_REGEX : MIXIN_VALUES_REGEX; + let matches = (new RegExp(regex, 'gi')).exec(declaration); + if (!matches) { + return null; + } + let name = matches[1].trim(); + let parameters = []; + if (matches.length > 2 && matches[2]) { + let params = matches[2].split(',').map((param) => param.trim().replace(/[\(\)]/g, '')); + parameters.push(...params); + } + return { name, parameters }; + } +} +exports.Mixins = Mixins; +//# sourceMappingURL=mixins.js.map \ No newline at end of file diff --git a/dist/app/parser/mixins.js.map b/dist/app/parser/mixins.js.map new file mode 100644 index 0000000..99af839 --- /dev/null +++ b/dist/app/parser/mixins.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mixins.js","sourceRoot":"","sources":["../../../src/app/parser/mixins.ts"],"names":[],"mappings":";;;AAEA,MAAM,kBAAkB,GAAG,gDAAgD,CAAC;AAC5E,MAAM,iBAAiB,GAAG,mDAAmD,CAAC;AAE9E,MAAM,uBAAuB,GAAG,gCAAgC,CAAC;AAEjE,MAAa,MAAM;IAEjB,YAAoB,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAEtC,CAAC;IAEM,KAAK;QACV,IAAI,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,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,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;YACvF,UAAU,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;SAC5B;QAED,OAAO,EAAE,IAAI,EAAE,UAAU,EAAY,CAAC;IACxC,CAAC;CACF;AAhDD,wBAgDC"} \ No newline at end of file diff --git a/dist/app/parser/parser.js b/dist/app/parser/parser.js new file mode 100644 index 0000000..8051416 --- /dev/null +++ b/dist/app/parser/parser.js @@ -0,0 +1,114 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Parser = void 0; +const VARIABLE_PATERN = '(?!\\d)[\\w_-][\\w\\d_-]*'; +const VALUE_PATERN = '[^;]+|"(?:[^"]+|(?:\\\\"|[^"])*)"'; +const DECLARATION_PATTERN = `\\$['"]?(${VARIABLE_PATERN})['"]?\\s*:\\s*(${VALUE_PATERN})(?:\\s*!(global|default)\\s*;|\\s*;(?![^\\{]*\\}))`; +const MAP_DECLARATIOM_REGEX = /['"]?((?!\d)[\w_-][\w\d_-]*)['"]?\s*:\s*([a-z\-]+\([^\)]+\)|[^\)\(,\/]+|\([^\)]+\))/gi; +const QUOTES_PATTERN = /^(['"]).*\1$/; +const QUOTES_REPLACE = /^(['"])|(['"])$/g; +const SECTION_TAG = 'sass-export-section'; +const SECTION_PATTERN = `(@${SECTION_TAG}=)(".+")`; +const END_SECTION_PATTERN = `(@end-${SECTION_TAG})`; +const DEFAULT_SECTION = 'variables'; +class Parser { + constructor(rawContent) { + this.rawContent = rawContent; + } + parse() { + let matches = this.extractDeclarations(this.rawContent); + let declarations = []; + for (let match of matches) { + if (!this.checkIsSectionStart(match) && !this.checkIsSectionStart(match)) { + let parsed = this.parseSingleDeclaration(match); + if (parsed) { + this.parseMapDeclarations(parsed); + declarations.push(parsed); + } + } + } + return declarations; + } + parseStructured() { + let matches = this.extractDeclarationsStructured(this.rawContent); + let currentSection = DEFAULT_SECTION; + let declarations = {}; + if (!matches || !matches.length) { + return {}; + } + declarations[currentSection] = []; + for (let match of matches) { + if (this.checkIsSectionStart(match)) { + let sectionName = String(new RegExp(SECTION_PATTERN, 'gi').exec(match)[2]); + if (sectionName) { + currentSection = sectionName.replace(/"/g, ''); + declarations[currentSection] = declarations[currentSection] || []; + } + } + else if (this.checkIsSectionEnd(match)) { + currentSection = DEFAULT_SECTION; + } + else { + let parsed = this.parseSingleDeclaration(match); + if (parsed) { + this.parseMapDeclarations(parsed); + declarations[currentSection].push(parsed); + } + } + } + return declarations; + } + extractDeclarationsStructured(content) { + const matches = content.match(new RegExp(`${DECLARATION_PATTERN}|${SECTION_PATTERN}|${END_SECTION_PATTERN}`, 'g')); + if (!matches) { + return []; + } + return matches; + } + extractDeclarations(content) { + const matches = content.match(new RegExp(DECLARATION_PATTERN, 'g')); + if (!matches) { + return []; + } + return matches; + } + extractMapDeclarations(content) { + const matches = content.match(new RegExp(MAP_DECLARATIOM_REGEX, 'g')); + if (!matches) { + return []; + } + return matches; + } + parseSingleDeclaration(matchDeclaration) { + let matches = matchDeclaration + .replace(/\s*!(default|global)\s*;/, ';') + .match(new RegExp(DECLARATION_PATTERN)); + if (!matches) { + return; + } + let name = matches[1].trim(); + let value = matches[2].trim().replace(/\s*\n+\s*/g, ' '); + if (value.match(QUOTES_PATTERN)) { + value = value.replace(QUOTES_REPLACE, ''); + } + return { name, value }; + } + parseMapDeclarations(parsedDeclaration) { + let map = this.extractMapDeclarations(parsedDeclaration.value); + if (map.length) { + parsedDeclaration.mapValue = map.map((declaration) => { + const singleDeclaration = this.parseSingleDeclaration(`$${declaration};`); + this.parseMapDeclarations(singleDeclaration); + return singleDeclaration; + }); + } + } + checkIsSectionStart(content) { + return (new RegExp(SECTION_PATTERN, 'gi')).test(content); + } + checkIsSectionEnd(content) { + return (new RegExp(END_SECTION_PATTERN, 'gi')).test(content); + } +} +exports.Parser = Parser; +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/dist/app/parser/parser.js.map b/dist/app/parser/parser.js.map new file mode 100644 index 0000000..4d67d11 --- /dev/null +++ b/dist/app/parser/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/app/parser/parser.ts"],"names":[],"mappings":";;;AAAA,MAAM,eAAe,GAAG,2BAA2B,CAAC;AACpD,MAAM,YAAY,GAAG,mCAAmC,CAAC;AACzD,MAAM,mBAAmB,GACvB,YAAY,eAAe,mBAAmB,YAAY,qDAAqD,CAAC;AAElH,MAAM,qBAAqB,GAAG,uFAAuF,CAAC;AAEtH,MAAM,cAAc,GAAG,cAAc,CAAC;AACtC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAE1C,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,MAAM,eAAe,GAAG,KAAK,WAAW,UAAU,CAAC;AACnD,MAAM,mBAAmB,GAAG,SAAS,WAAW,GAAG,CAAC;AAEpD,MAAM,eAAe,GAAG,WAAW,CAAC;AAGpC,MAAa,MAAM;IAGjB,YAAY,UAAkB;QAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEM,KAAK;QACV,IAAI,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,KAAK,IAAI,KAAK,IAAI,OAAO,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE;gBACxE,IAAI,MAAM,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC;gBAEhD,IAAI,MAAM,EAAE;oBACV,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;oBAClC,YAAY,CAAC,IAAI,CAAC,MAAM,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AAkB,CAAC;IACzC,CAAC;IACO,oBAAoB,CAAC,iBAA+B;QAC1D,IAAI,GAAG,GAAG,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAE/D,IAAI,GAAG,CAAC,MAAM,EAAE;YACd,iBAAiB,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;gBACnD,MAAM,iBAAiB,GAAG,IAAI,CAAC,sBAAsB,CACnD,IAAI,WAAW,GAAG,CACnB,CAAC;gBACF,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;gBAE7C,OAAO,iBAAiB,CAAC;YAC3B,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IACO,mBAAmB,CAAC,OAAe;QACzC,OAAO,CAAC,IAAI,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IAGO,iBAAiB,CAAC,OAAe;QACvC,OAAO,CAAC,IAAI,MAAM,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;CACF;AArID,wBAqIC"} \ No newline at end of file diff --git a/dist/app/utils/index.js b/dist/app/utils/index.js new file mode 100644 index 0000000..e6f0868 --- /dev/null +++ b/dist/app/utils/index.js @@ -0,0 +1,14 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./utils"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/app/utils/index.js.map b/dist/app/utils/index.js.map new file mode 100644 index 0000000..8a11e90 --- /dev/null +++ b/dist/app/utils/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB"} \ No newline at end of file diff --git a/dist/app/utils/utils.js b/dist/app/utils/utils.js new file mode 100644 index 0000000..fc364a6 --- /dev/null +++ b/dist/app/utils/utils.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Utils = void 0; +const WRAPPER_CSS_ID = '#sass-export-id'; +const UNWRAPPER_PATTERN = `${WRAPPER_CSS_ID}\\.(.+)\\s*\\{\\s*content:\\s*["'](.+)["']`; +class Utils { + static getDeclarationByName(declarations = [], name) { + let filtered = declarations.filter((declaration) => declaration.name === name); + return filtered[0]; + } + static wrapCss(cssDeclaration, useInspect) { + if (useInspect) { + return `${WRAPPER_CSS_ID}.${cssDeclaration.name}{content:"#{inspect(${cssDeclaration.value})}";}`; + } + return `${WRAPPER_CSS_ID}.${cssDeclaration.name}{content:"#{${cssDeclaration.value}}";}`; + } + static removeDoubleQuotes(wrappedContent) { + wrappedContent = wrappedContent.replace(/"([^'"]+(?="'))"/, '$1'); + return wrappedContent; + } + static unWrapValue(wrappedContent) { + wrappedContent = wrappedContent.replace(/\n/g, ''); + let matches = wrappedContent.match(UNWRAPPER_PATTERN); + if (matches && matches.length > 2) { + return matches[2].trim(); + } + else { + return ''; + } + } +} +exports.Utils = Utils; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/app/utils/utils.js.map b/dist/app/utils/utils.js.map new file mode 100644 index 0000000..f036d29 --- /dev/null +++ b/dist/app/utils/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/app/utils/utils.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,MAAM,iBAAiB,GAAG,GAAG,cAAc,4CAA4C,CAAC;AAOxF,MAAa,KAAK;IAET,MAAM,CAAC,oBAAoB,CAAC,eAA+B,EAAE,EAAE,IAAY;QAChF,IAAI,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAE/E,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IAGM,MAAM,CAAC,OAAO,CAAC,cAA4B,EAAE,UAAmB;QACrE,IAAI,UAAU,EAAE;YACd,OAAO,GAAG,cAAc,IAAI,cAAc,CAAC,IAAI,uBAAuB,cAAc,CAAC,KAAK,OAAO,CAAC;SACnG;QACD,OAAO,GAAG,cAAc,IAAI,cAAc,CAAC,IAAI,eAAe,cAAc,CAAC,KAAK,MAAM,CAAC;IAC3F,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,cAAsB;QACrD,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;QAClE,OAAO,cAAc,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,cAAsB;QAC9C,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEnD,IAAI,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAEtD,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACjC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAC1B;aAAM;YACL,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AAhCD,sBAgCC"} \ No newline at end of file diff --git a/dist/declarations/app/converter/converter-buffer.d.ts b/dist/declarations/app/converter/converter-buffer.d.ts new file mode 100644 index 0000000..f5012b1 --- /dev/null +++ b/dist/declarations/app/converter/converter-buffer.d.ts @@ -0,0 +1,8 @@ +/// +import { Converter } from './converter'; +export declare class ConverterBuffer extends Converter { + private inputBuffers; + constructor(inputBuffers: Buffer[], options?: IOptions); + getData(): Promise; + getContent(): string; +} diff --git a/dist/declarations/app/converter/converter.d.ts b/dist/declarations/app/converter/converter.d.ts new file mode 100644 index 0000000..dbb305a --- /dev/null +++ b/dist/declarations/app/converter/converter.d.ts @@ -0,0 +1,10 @@ +export declare class Converter { + options?: IOptions; + constructor(options?: IOptions); + getArray(): IDeclaration[]; + getStructured(): any; + compileStructure(structuredDeclaration: IDeclaration): object; + getContent(): string; + private checkForMixins; + private renderPropertyValue; +} diff --git a/dist/declarations/app/converter/index.d.ts b/dist/declarations/app/converter/index.d.ts new file mode 100644 index 0000000..00c0e3d --- /dev/null +++ b/dist/declarations/app/converter/index.d.ts @@ -0,0 +1,2 @@ +export * from './converter'; +export * from './converter-buffer'; diff --git a/dist/declarations/app/parser/index.d.ts b/dist/declarations/app/parser/index.d.ts new file mode 100644 index 0000000..3e440b0 --- /dev/null +++ b/dist/declarations/app/parser/index.d.ts @@ -0,0 +1,2 @@ +export * from './parser'; +export * from './mixins'; diff --git a/dist/declarations/app/parser/mixins.d.ts b/dist/declarations/app/parser/mixins.d.ts new file mode 100644 index 0000000..16cc505 --- /dev/null +++ b/dist/declarations/app/parser/mixins.d.ts @@ -0,0 +1,7 @@ +export declare class Mixins { + private rawContent; + constructor(rawContent: string); + parse(): any[]; + private extractDeclarations; + private parseSingle; +} diff --git a/dist/declarations/app/parser/parser.d.ts b/dist/declarations/app/parser/parser.d.ts new file mode 100644 index 0000000..f469bdf --- /dev/null +++ b/dist/declarations/app/parser/parser.d.ts @@ -0,0 +1,13 @@ +export declare class Parser { + private rawContent; + constructor(rawContent: string); + parse(): IDeclaration[]; + parseStructured(): any; + private extractDeclarationsStructured; + private extractDeclarations; + private extractMapDeclarations; + private parseSingleDeclaration; + private parseMapDeclarations; + private checkIsSectionStart; + private checkIsSectionEnd; +} diff --git a/dist/declarations/app/utils/index.d.ts b/dist/declarations/app/utils/index.d.ts new file mode 100644 index 0000000..04bca77 --- /dev/null +++ b/dist/declarations/app/utils/index.d.ts @@ -0,0 +1 @@ +export * from './utils'; diff --git a/dist/declarations/app/utils/utils.d.ts b/dist/declarations/app/utils/utils.d.ts new file mode 100644 index 0000000..723daf7 --- /dev/null +++ b/dist/declarations/app/utils/utils.d.ts @@ -0,0 +1,6 @@ +export declare class Utils { + static getDeclarationByName(declarations: IDeclaration[], name: string): IDeclaration; + static wrapCss(cssDeclaration: IDeclaration, useInspect: boolean): string; + static removeDoubleQuotes(wrappedContent: string): string; + static unWrapValue(wrappedContent: string): string; +} diff --git a/dist/declarations/index.d.ts b/dist/declarations/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/dist/declarations/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..10268a3 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const converter_1 = require("./app/converter"); +let sassExporter = (options) => { + return new converter_1.Converter(options); +}; +let bufferExporter = (input, options) => { + let converter = new converter_1.ConverterBuffer(input, options); + return converter.getData(); +}; +module.exports = { + exporter: sassExporter, + buffer: bufferExporter +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..d27a92c --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,+CAA6D;AAE7D,IAAI,YAAY,GAAG,CAAC,OAAiB,EAAE,EAAE;IACvC,OAAO,IAAI,qBAAS,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,IAAI,cAAc,GAAG,CAAC,KAAe,EAAE,OAAiB,EAAE,EAAE;IAC1D,IAAI,SAAS,GAAG,IAAI,2BAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACpD,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG;IACf,QAAQ,EAAE,YAAY;IACtB,MAAM,EAAE,cAAc;CACvB,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3f8891f..0ec0a8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,1267 +1,8 @@ { - "name": "sass-export", - "version": "2.1.0", - "lockfileVersion": 2, + "name": "zhf.sass-export", + "version": "1.0.2", + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "name": "sass-export", - "version": "2.1.0", - "license": "ISC", - "dependencies": { - "glob": "^7.1.6", - "minimist": "^1.2.5", - "sass": "^1.32.8" - }, - "bin": { - "sass-export": "bin/sass-export" - }, - "devDependencies": { - "@types/chai": "^4.2.15", - "@types/mocha": "^8.2.2", - "@types/node": "^14.14.37", - "@types/sass": "^1.16", - "chai": "^4.3.4", - "mocha": "^8.3.2", - "ts-node": "^9.1.1", - "typescript": "^4.2.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@types/chai": { - "version": "4.2.15", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.15.tgz", - "integrity": "sha512-rYff6FI+ZTKAPkJUoyz7Udq3GaoDZnxYDEvdEdFZASiA7PoErltHezDishqQiSDWrGxvxmplH304jyzQmjp0AQ==", - "dev": true - }, - "node_modules/@types/mocha": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.2.tgz", - "integrity": "sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw==", - "dev": true - }, - "node_modules/@types/node": { - "version": "14.14.37", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", - "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", - "dev": true - }, - "node_modules/@types/sass": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/@types/sass/-/sass-1.16.0.tgz", - "integrity": "sha512-2XZovu4NwcqmtZtsBR5XYLw18T8cBCnU2USFHTnYLLHz9fkhnoEMoDsqShJIOFsFhn5aJHjweiUUdTrDGujegA==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", - "dev": true, - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", - "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.1" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, - "bin": { - "flat": "cli.js" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true, - "engines": { - "node": ">=4.x" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true, - "bin": { - "he": "bin/he" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/js-yaml": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", - "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", - "dev": true, - "dependencies": { - "chalk": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" - }, - "node_modules/mocha": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.3.2.tgz", - "integrity": "sha512-UdmISwr/5w+uXLPKspgoV7/RXZwKRTiTjJ2/AC5ZiEztIoOYdfKb19+9jNmEInzx5pBsCyJQzarAxqIGBNYJhg==", - "dev": true, - "dependencies": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.1", - "debug": "4.3.1", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.1.6", - "growl": "1.10.5", - "he": "1.2.0", - "js-yaml": "4.0.0", - "log-symbols": "4.0.0", - "minimatch": "3.0.4", - "ms": "2.1.3", - "nanoid": "3.1.20", - "serialize-javascript": "5.0.1", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "which": "2.0.2", - "wide-align": "1.1.3", - "workerpool": "6.1.0", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha" - }, - "engines": { - "node": ">= 10.12.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/nanoid": { - "version": "3.1.20", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/sass": { - "version": "1.32.8", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.32.8.tgz", - "integrity": "sha512-Sl6mIeGpzjIUZqvKnKETfMf0iDAswD9TNlv13A7aAF3XZlRPMq4VvJWBC2N2DXbp94MQVdNSFG6LfF/iOXrPHQ==", - "dependencies": { - "chokidar": ">=2.0.0 <4.0.0" - }, - "bin": { - "sass": "sass.js" - }, - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/serialize-javascript": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-5.0.1.tgz", - "integrity": "sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/source-map-support/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "dependencies": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/ts-node": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", - "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", - "dev": true, - "dependencies": { - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "typescript": ">=2.7" - } - }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/typescript": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", - "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2" - } - }, - "node_modules/workerpool": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.0.tgz", - "integrity": "sha512-toV7q9rWNYha963Pl/qyeZ6wG+3nnsyvolaNUS8+R5Wtw6qJPTxIlOP1ZSvcGhEJw+l3HMMmtiNo9Gl61G4GVg==", - "dev": true - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "node_modules/y18n": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.5.tgz", - "integrity": "sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, "dependencies": { "@types/chai": { "version": "4.2.15", diff --git a/package.json b/package.json index 9852a1a..b9a619f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "sass-export", - "version": "2.1.1", + "name": "zhf.sass-export", + "version": "1.0.2", "description": "Exports Sass files to Json format, able to manage sections with annotations in comments.", "main": "./dist/index.js", "files": [ @@ -10,8 +10,7 @@ "scripts": { "build": "tsc --p tsconfig.json", "dev": "npm run build & npm run test", - "prepare": "npm run build", - "prestart": "npm run build", + "prepublish": "npm run build", "watch": "npm run build -- --watch", "test": "TS_NODE_FILES=true mocha -r ts-node/register src/**/*.test.ts" }, @@ -44,7 +43,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/plentycode/sass-export.git" + "url": "https://github.com/zhouhuafei-team/sass-export.git" }, "devDependencies": { "@types/chai": "^4.2.15", diff --git a/src/app/converter/converter.ts b/src/app/converter/converter.ts index ab540b0..2733e57 100644 --- a/src/app/converter/converter.ts +++ b/src/app/converter/converter.ts @@ -98,7 +98,11 @@ export class Converter { let contents = inputs.map((filePath) => fs.readFileSync(String(filePath))); - return contents.join(LINE_BREAK); + let strContents = contents.join(LINE_BREAK); + strContents = strContents.replace(/\/\*[\w\W\r\n]*?\*\//g, ''); + strContents = strContents.split(LINE_BREAK).filter(v=> v.indexOf('//') === -1).join(LINE_BREAK); + + return strContents; }