@adamlui/scss-to-css 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -29,7 +29,7 @@
29
29
 
30
30
  <a href="https://www.npmjs.com/package/@adamlui/scss-to-css"><img height=31 src="https://img.shields.io/npm/dm/%40adamlui%2Fscss-to-css?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
31
31
  <a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
32
- <a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.8.1"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.1-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
32
+ <a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.8.2"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.2-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
33
33
  <a href="https://www.npmjs.com/package/@adamlui/scss-to-css?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fscss-to-css?style=for-the-badge&logo=ebox&logoColor=white&color=blue&labelColor=464646"></a>
34
34
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_scss-to-css:node.js/src/scss-to-css.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_scss-to-css%3Anode.js%2Fsrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
35
35
  <a href="https://github.com/toolleeo/cli-apps#conversion"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
package/dist/cli.min.js CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  const pkgName="@adamlui/scss-to-css",copyright="© 2024 Adam Lui & contributors under the MIT license.",cmdFormat="scss-to-css [inputPath] [outputPath] [options]",srcURL="https://github.com/adamlui/scss-to-css/tree/main/node.js/src",docURL="https://github.com/adamlui/scss-to-css/#-command-line-usage",scssToCSS=require(__dirname.match(/src/)?"./scss-to-css":"./scss-to-css.min"),fs=require("fs"),path=require("path"),execSync=require("child_process")["execSync"],nc="",br="",by="",bg="",bw="",config={},argRegex={dryRun:/^--?(?:n|dry-?run)$/,includeDotFolders:/^--?(?:dd?|(?:include-?)?dot-?(?:folder|dir(?:ector(?:y|ie))?)s?=?(?:true|1)?)$/,noSourceMaps:/^--?(?:S|(?:exclude|disable|no)-?so?u?rce?-?maps?|so?u?rce?-?maps?=(?:false|0))$/,noRecursion:/^--?(?:R|(?:disable|no)-?recursi(?:on|ve)|recursi(?:on|ve)=(?:false|0))$/,noMinify:/^--?(?:M|(?:disable|no)-?minif(?:y|ication)|minif(?:y|ication)=(?:false|0))$/,quietMode:/^--?q(?:uiet)?(?:-?mode)?$/,help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/};if(process.argv.forEach(s=>{var e;s.startsWith("-")&&((e=Object.keys(argRegex).find(e=>argRegex[e].test(s)))?config[e]=!0:(console.error(`
8
8
  ${br}ERROR: Arg [${s}] not recognized.`+nc),console.info(`
9
- ${by}Valid arguments are below.`+nc),printHelpSections(["configOptions","infoCmds"]),printHelpCmdAndDocURL(),process.exit(1)))}),process.argv.some(e=>argRegex.help.test(e)))printHelpSections();else if(process.argv.some(e=>argRegex.version.test(e))){const f=execSync(`npm view ${pkgName} version`).toString().trim()||"none";let e,s=process.cwd();for(;"/"!=s;){const i=path.join(s,"package.json");if(fs.existsSync(i)){const j=require(i);e=(j.dependencies?.[pkgName]||j.devDependencies?.[pkgName])?.match(/(\d+\.\d+\.\d+)/)[0]||"none";break}s=path.dirname(s)}console.info(`
9
+ ${by}Valid arguments are below.`+nc),printHelpSections(["configOptions","infoCmds"]),process.exit(1)))}),process.argv.some(e=>argRegex.help.test(e)))printHelpSections();else if(process.argv.some(e=>argRegex.version.test(e))){const f=execSync(`npm view ${pkgName} version`).toString().trim()||"none";let e,s=process.cwd();for(;"/"!=s;){const i=path.join(s,"package.json");if(fs.existsSync(i)){const j=require(i);e=(j.dependencies?.[pkgName]||j.devDependencies?.[pkgName])?.match(/(\d+\.\d+\.\d+)/)[0]||"none";break}s=path.dirname(s)}console.info(`
10
10
  Global version: `+f),console.info("Local version: "+e)}else{const[k="",l=""]=process.argv.slice(2).filter(e=>!e.startsWith("-")).map(e=>e.replace(/^\/*/,"")),m=path.resolve(process.cwd(),k),n=(k&&!fs.existsSync(m)&&(console.error(`
11
11
  ${br}Error: First argument can only be an existing file or directory.`+`
12
12
  '${m}' does not exist.`+nc+`
@@ -17,10 +17,10 @@ ${by}SCSS files to be compiled:`+nc),n.forEach(e=>console.info(e))):console.info
17
17
  No SCSS files will be compiled.`+nc);else{const r=[],s=n.map(e=>{var s=scssToCSS.compile(e,{minify:!config.noMinify,sourceMaps:!config.noSourceMaps,verbose:!config.quietMode});return s.error&&r.push(e),s}).filter(e=>!e.error);if(s?.forEach(({code:e,srcMap:s,srcPath:o})=>{var n=path.join(path.dirname(o),/(?:src|s[ac]ss)$/.test(path.dirname(o))?"../"+(l||"css"):l.endsWith(".css")?path.dirname(l):l||"css"),o=(l.endsWith(".css")&&k.endsWith(".scss")?path.basename(l).replace(/(\.min)?\.css$/,""):path.basename(o,".scss"))+".min.css",o=path.join(n,o);fs.existsSync(n)||fs.mkdirSync(n,{recursive:!0}),fs.writeFileSync(o,e,"utf8"),config.noSourceMaps||fs.writeFileSync(o+".map",JSON.stringify(s),"utf8")}),0<s?.length){const C=1<s.length?"s":"";printIfNotQuiet(`
18
18
  ${bg}Compilation complete!`+nc),printIfNotQuiet(s.length+" CSS file"+C+(config.noSourceMaps?"":` + ${s.length} source map`+C)+" generated.")}else printIfNotQuiet(by+"No SCSS files processed."+nc);0<r.length&&(printIfNotQuiet(`
19
19
  `+br+r.length+" file"+(1<r.length?"s":"")+" failed to compile:"+nc),r.forEach(e=>printIfNotQuiet(e)))}}function printHelpSections(e=["header","usage","pathArgs","configOptions","infoCmds"]){var s=` ${pkgName.replace(/^@[^/]+\//,"")} ${nc} `;const o={header:[`
20
- ├ `+s+copyright,s+"Source: "+srcURL,s+"Doc: "+docURL],usage:[`
21
- ${bw}o Usage:`+nc,`${bw} »${nc} `+(bg+cmdFormat+nc)],pathArgs:[`
20
+ ├ `+s+copyright,s+"Source: "+srcURL],usage:[`
21
+ ${bw}o Usage:`+nc,` ${bw}» `+(bg+cmdFormat+nc)],pathArgs:[`
22
22
  ${bw}o Path arguments:`+nc," [inputPath] Path to SCSS file or directory containing SCSS files to be compiled, relative to the current working directory."," [outputPath] Path to file or directory where CSS + sourcemap files will be stored, relative to original file location (if not provided, css/ is used)."],configOptions:[`
23
23
  ${bw}o Config options:`+nc," -n, --dry-run Don't actually compile the file(s), just show if they will be processed."," -d, --include-dotfolders Include dotfolders in file search."," -S, --no-source-maps Prevent source maps from being generated."," -M, --no-minify Disable minification of output CSS."," -R, --no-recursion Disable recursive file searching."," -q, --quiet Suppress all logging except errors."],infoCmds:[`
24
- ${bw}o Info commands:`+nc," -h, --help Display help screen."," -v, --version Show version number."]};e.forEach(r=>{o[r]?.forEach(e=>{{var n=/header|usage/.test(r)?1:29;const i=process.stdout.columns||80,t=[],s=e.match(/\S+|\s+/g);let o="";s.forEach(e=>{var s=i-(0==t.length?0:n);o.length+"| ".length+e.length>s&&(t.push(0==t.length?o:o.trimStart()),o=""),o+=e}),t.push(0==t.length?o:o.trimStart()),t.forEach((e,s)=>console.info("| "+(0==s?e:" ".repeat(n)+e)))}})})}function printHelpCmdAndDocURL(){console.info(`
25
- ${by}For more help, type 'scss-to-css --help' or visit
26
- `+(docURL+nc))}function printIfNotQuiet(e){config.quietMode||console.info(e)}
24
+ ${bw}o Info commands:`+nc," -h, --help Display help screen."," -v, --version Show version number."]};e.forEach(r=>{o[r]?.forEach(e=>{{var n=/header|usage/.test(r)?1:29;const i=process.stdout.columns||80,t=[],s=e.match(/\S+|\s+/g);let o="";s.forEach(e=>{var s=i-(0==t.length?0:n);o.length+"| ".length+e.length>s&&(t.push(0==t.length?o:o.trimStart()),o=""),o+=e}),t.push(0==t.length?o:o.trimStart()),t.forEach((e,s)=>console.info("| "+(0==s?e:" ".repeat(n)+e)))}})}),console.info("\nFor more help, please visit: "+bw+docURL+nc)}function printHelpCmdAndDocURL(){console.info(`
25
+ For more help, type 'scss-to-css --help' or visit
26
+ `+(bw+docURL+nc))}function printIfNotQuiet(e){config.quietMode||console.info(e)}
package/docs/README.md CHANGED
@@ -29,7 +29,7 @@
29
29
 
30
30
  <a href="https://www.npmjs.com/package/@adamlui/scss-to-css"><img height=31 src="https://img.shields.io/npm/dm/%40adamlui%2Fscss-to-css?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
31
31
  <a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
32
- <a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.8.1"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.1-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
32
+ <a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.8.2"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.8.2-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
33
33
  <a href="https://www.npmjs.com/package/@adamlui/scss-to-css?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fscss-to-css?style=for-the-badge&logo=ebox&logoColor=white&color=blue&labelColor=464646"></a>
34
34
  <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_scss-to-css:node.js/src/scss-to-css.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_scss-to-css%3Anode.js%2Fsrc%2Fscss-to-css.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
35
35
  <a href="https://github.com/toolleeo/cli-apps#conversion"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamlui/scss-to-css",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Recursively compile all SCSS files into minified CSS",
5
5
  "author": {
6
6
  "name": "Adam Lui",