@adamlui/scss-to-css 1.7.10 → 1.7.11

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.7.10"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.7.10-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.7.11"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.7.11-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_js-utils:scss-to-css/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_js-utils%3Ascss-to-css%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>
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- const c=require("fs"),l=require("path"),t=require("sass");function a(s,r={}){var e="https://github.com/adamlui/js-utils/tree/main/scss-to-css#findscsssearchdir-options",o={recursive:!0,verbose:!0,dotFolders:!1};if("string"!=typeof s)console.error("findSCSS() » ERROR: 1st arg <searchDir> must be a string."),console.info("findSCSS() » For more help, please visit "+e);else{var i=l.resolve(process.cwd(),s);if(c.existsSync(i)){if(u(r,o,e,"findSCSS('assets/scss', { verbose: false, dotFolders: true })")){r={...o,...r};const n=c.readdirSync(s),t=[];return r.verbose&&!r.isRecursing&&console.info("findSCSS() » Searching for SCSS files..."),n.forEach(e=>{var o=l.resolve(s,e);c.statSync(o).isDirectory()&&"node_modules"!=e&&(r.dotFolders||!e.startsWith("."))&&r.recursive?t.push(...a(o,{...r,isRecursing:!0})):e.endsWith(".scss")&&t.push(o)}),!r.isRecursing&&r.verbose&&(console.info("findSCSS() » Search complete! "+(0===t.length?"No":t.length)+` file${0==t.length||1<t.length?"s":""} found.`),"compile"===a.caller.name||require.main.filename.endsWith("cli.js")||console.info("findSCSS() » Check returned array.")),r.isRecursing||0<t.length?t:[]}}else console.error("findSCSS() » ERROR: 1st arg <searchDir> must be an existing directory."),console.error(`findSCSS() » ${i} does not exist.`),console.info("findSCSS() » For more help, please visit "+e)}}function e(e,s={}){var o="https://github.com/adamlui/js-utils/tree/main/scss-to-css#compileinputpath-options",r={recursive:!0,verbose:!0,dotFolders:!1,minify:!0,sourceMaps:!0};if("string"!=typeof e)console.error("compile() » ERROR: 1st arg <inputPath> must be a string."),console.info("compile() » For more help, please visit "+o);else if(e=l.resolve(process.cwd(),e),c.existsSync(e)){if(u(s,r,o,"compile('assets/scss', { recursive: false, minify: false })")){const n={style:(s={...r,...s}).minify?"compressed":"expanded",sourceMap:s.sourceMaps};if(c.existsSync(e)){if(!e.endsWith(".scss"))return r=a(e,{recursive:s.recursive,verbose:s.verbose,dotFolders:s.dotFolders})?.map(e=>{s.verbose&&console.info(`compile() » Compiling ${e}...`);try{var o=t.compile(e,n);return{code:o.css,srcMap:o.sourceMap,srcPath:e}}catch(e){return console.error(`
2
+ const c=require("fs"),l=require("path"),t=require("sass");function a(s,r={}){var e="https://github.com/adamlui/js-utils/tree/main/scss-to-css#findscsssearchdir-options",o={recursive:!0,verbose:!0,dotFolders:!1};if("string"!=typeof s)console.error("findSCSS() » ERROR: 1st arg <searchDir> must be a string."),console.info("findSCSS() » For more help, please visit "+e);else{var i=l.resolve(process.cwd(),s);if(c.existsSync(i)){if(u(r,o,e,"findSCSS('assets/scss', { verbose: false, dotFolders: true })")){r={...o,...r};const n=c.readdirSync(s),t=[];return r.verbose&&!r.isRecursing&&console.info("findSCSS() » Searching for SCSS files..."),n.forEach(e=>{var o=l.resolve(s,e);c.statSync(o).isDirectory()&&"node_modules"!=e&&(r.dotFolders||!e.startsWith("."))&&r.recursive?t.push(...a(o,{...r,isRecursing:!0})):e.endsWith(".scss")&&t.push(o)}),!r.isRecursing&&r.verbose&&(console.info("findSCSS() » Search complete! "+(0===t.length?"No":t.length)+` file${0==t.length||1<t.length?"s":""} found.`),"compile"===a.caller.name||/cli(?:\.min)?\.js$/.test(require.main.filename)||console.info("findSCSS() » Check returned array.")),r.isRecursing||0<t.length?t:[]}}else console.error("findSCSS() » ERROR: 1st arg <searchDir> must be an existing directory."),console.error(`findSCSS() » ${i} does not exist.`),console.info("findSCSS() » For more help, please visit "+e)}}function e(e,s={}){var o="https://github.com/adamlui/js-utils/tree/main/scss-to-css#compileinputpath-options",r={recursive:!0,verbose:!0,dotFolders:!1,minify:!0,sourceMaps:!0};if("string"!=typeof e)console.error("compile() » ERROR: 1st arg <inputPath> must be a string."),console.info("compile() » For more help, please visit "+o);else if(e=l.resolve(process.cwd(),e),c.existsSync(e)){if(u(s,r,o,"compile('assets/scss', { recursive: false, minify: false })")){const n={style:(s={...r,...s}).minify?"compressed":"expanded",sourceMap:s.sourceMaps};if(c.existsSync(e)){if(!e.endsWith(".scss"))return r=a(e,{recursive:s.recursive,verbose:s.verbose,dotFolders:s.dotFolders})?.map(e=>{s.verbose&&console.info(`compile() » Compiling ${e}...`);try{var o=t.compile(e,n);return{code:o.css,srcMap:o.sourceMap,srcPath:e}}catch(e){return console.error(`
3
3
  compile() » ERROR: ${e.message}
4
- `),{error:e}}}).filter(e=>!e.error),s.verbose&&(0<r.length?console.info("compile() » Compilation complete. Check returned object."):console.info("compile() » No SCSS files processed.")),r;s.verbose&&console.info(`compile() » Compiling ${e}...`);try{var i=t.compile(e,n);return s.verbose&&!require.main.filename.endsWith("cli.js")&&console.info("compile() » Compilation complete. Check returned object."),{code:i.css,srcMap:i.sourceMap,srcPath:l.resolve(process.cwd(),e)}}catch(e){return console.error(`
4
+ `),{error:e}}}).filter(e=>!e.error),s.verbose&&(0<r.length?console.info("compile() » Compilation complete. Check returned object."):console.info("compile() » No SCSS files processed.")),r;s.verbose&&console.info(`compile() » Compiling ${e}...`);try{var i=t.compile(e,n);return s.verbose&&!/cli(?:\.min)?\.js$/.test(require.main.filename)&&console.info("compile() » Compilation complete. Check returned object."),{code:i.css,srcMap:i.sourceMap,srcPath:l.resolve(process.cwd(),e)}}catch(e){return console.error(`
5
5
  compile() » ERROR: ${e.message}
6
6
  `),{error:e}}}}}else console.error("compile() » ERROR: 1st arg <inputPath> must be an existing directory or file."),console.error(`compile() » ${e} does not exist.`),console.info("compile() » For more help, please visit "+o)}function u(e,o,s,r){const i=JSON.stringify(o,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),n=Object.keys(o).join(", "),t=Object.keys(o).filter(e=>"boolean"==typeof o[e]),c=Object.keys(o).filter(e=>Number.isInteger(o[e])),l=(u.caller?.name||"validateOptions")+"() » ";var a=()=>{console.info(l+`Valid options: [ ${n} ]`),console.info(l+"If omitted, default settings are: "+i)},p=()=>{console.info(l+"For more help, please visit "+s)};if("object"!=typeof e)return console.error(l+"ERROR: [options] can only be an object of key/values."),console.info(l+"Example valid call: "+r),a(),p(),!1;for(const f in e){if("isRecursing"!=f&&!Object.prototype.hasOwnProperty.call(o,f))return console.error(l+`ERROR: \`${f}\` is an invalid option.`),a(),p(),!1;if(t.includes(f)&&"boolean"!=typeof e[f])return console.error(l+`ERROR: [${f}] option can only be \`true\` or \`false\`.`),p(),!1;if(c.includes(f)&&(e[f]=parseInt(e[f],10),isNaN(e[f])||e[f]<1))return console.error(l+`ERROR: [${f}] option can only be an integer > 0.`),p(),!1}return!0}module.exports={compile:e,find:a,findSCSS:a};
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.7.10"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.7.10-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.7.11"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.7.11-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_js-utils:scss-to-css/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_js-utils%3Ascss-to-css%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.7.10",
3
+ "version": "1.7.11",
4
4
  "description": "Recursively compile all SCSS files into minified CSS",
5
5
  "author": {
6
6
  "name": "Adam Lui",
@@ -20,7 +20,7 @@
20
20
  "scss-to-css": "dist/cli.min.js"
21
21
  },
22
22
  "directories": {
23
- "lib": ".",
23
+ "lib": "./dist",
24
24
  "doc": "./docs"
25
25
  },
26
26
  "scripts": {
@@ -51,13 +51,13 @@
51
51
  "url": "https://js-utils.com/issues"
52
52
  },
53
53
  "dependencies": {
54
- "sass": "^1.74.1"
54
+ "sass": "^1.75.0"
55
55
  },
56
56
  "funding": {
57
57
  "type": "github",
58
58
  "url": "https://github.com/sponsors/adamlui"
59
59
  },
60
60
  "devDependencies": {
61
- "@adamlui/minify.js": "^1.5.0"
61
+ "@adamlui/minify.js": "^1.5.1"
62
62
  }
63
63
  }