@adamlui/scss-to-css 1.7.7 → 1.7.9
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 +14 -10
- package/dist/cli.min.js +1 -1
- package/dist/scss-to-css.min.js +4 -3
- package/docs/LICENSE.md +1 -0
- package/docs/SECURITY.md +2 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
English |
|
|
9
9
|
<a href="https://github.com/adamlui/js-utils/tree/main/scss-to-css/docs/zh-cn#readme">简体中文</a> |
|
|
10
10
|
<a href="https://github.com/adamlui/js-utils/tree/main/scss-to-css/docs/zh-tw#readme">繁體中文</a> |
|
|
11
|
+
<a href="https://github.com/adamlui/js-utils/tree/main/scss-to-css/docs/ja#readme">日本語</a> |
|
|
11
12
|
<a href="https://github.com/adamlui/js-utils/tree/main/scss-to-css/docs/hi#readme">हिंदी</a> |
|
|
12
13
|
<a href="https://github.com/adamlui/js-utils/tree/main/scss-to-css/docs/bn#readme">বাংলা</a> |
|
|
13
14
|
<a href="https://github.com/adamlui/js-utils/tree/main/scss-to-css/docs/mr#readme">मराठी</a> |
|
|
@@ -26,11 +27,12 @@
|
|
|
26
27
|
|
|
27
28
|
### Recursively compile all SCSS files into minified CSS.
|
|
28
29
|
|
|
29
|
-
<a href="https://www.npmjs.com/package/@adamlui/scss-to-css"><img height=31 src="https://img.shields.io/npm/
|
|
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>
|
|
30
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>
|
|
31
|
-
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.7.
|
|
32
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/scss-to-css-1.7.9"><img height=31 src="https://img.shields.io/badge/Latest_Build-1.7.9-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
32
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>
|
|
33
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
|
+
<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>
|
|
34
36
|
|
|
35
37
|
<img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
|
|
36
38
|
|
|
@@ -154,7 +156,7 @@ Info commands:
|
|
|
154
156
|
|
|
155
157
|
You can also import **scss-to-css** into your app to use its API methods, both as an ECMAScript module or a CommonJS module.
|
|
156
158
|
|
|
157
|
-
####
|
|
159
|
+
#### ECMAScript*:
|
|
158
160
|
|
|
159
161
|
```js
|
|
160
162
|
import * as scssToCSS from '@adamlui/scss-to-css';
|
|
@@ -268,19 +270,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
268
270
|
|
|
269
271
|
> Recursively compress all images to WEBPs.
|
|
270
272
|
<br>[Download](https://raw.githubusercontent.com/adamlui/js-utils/main/img-to-webp/img-to-webp.js) /
|
|
271
|
-
[Discuss](https://
|
|
273
|
+
[Discuss](https://js-utils.com/discussions)
|
|
272
274
|
|
|
273
|
-
### [</> minify.js](https://
|
|
275
|
+
### [</> minify.js](https://minify-js.org)
|
|
274
276
|
|
|
275
277
|
> Recursively minify all JavaScript files.
|
|
276
|
-
<br>[Install](https://github.com/adamlui/js-utils/tree/main/minify.js#-installation) /
|
|
277
|
-
[Readme](
|
|
278
|
-
[
|
|
278
|
+
<br>[Install](https://github.com/adamlui/js-utils/tree/main/minify.js#-installation) /
|
|
279
|
+
[Readme](http://minify-js.org/#readme) /
|
|
280
|
+
[CLI usage](http://minify-js.org/README.md#-command-line-usage) /
|
|
281
|
+
[API usage](http://minify-js.org/README.md#-api-usage) /
|
|
282
|
+
[Discuss](https://js-utils.com/discussions)
|
|
279
283
|
|
|
280
284
|
<br>
|
|
281
285
|
|
|
282
286
|
<img height=6px width="100%" src="https://raw.githubusercontent.com/adamlui/js-utils/main/docs/images/aqua-separator.png">
|
|
283
287
|
|
|
284
|
-
<
|
|
285
|
-
<a href="https://
|
|
288
|
+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/adamlui/js-utils/main/media/images/icons/home/white/icon32x27.png"><img height=13 src="https://raw.githubusercontent.com/adamlui/js-utils/main/media/images/icons/home/dark-gray/icon32x27.png"></picture> <a href="https://js-utils.com">**More JavaScript utilities**</a> /
|
|
289
|
+
<a href="https://js-utils.com/discussions">Discuss</a> /
|
|
286
290
|
<a href="#--scss-to-css">Back to top ↑</a>
|
package/dist/cli.min.js
CHANGED
|
@@ -11,7 +11,7 @@ ${e}Example valid command:
|
|
|
11
11
|
${c}For all command options:
|
|
12
12
|
» scss-to-css --help`+i),process.exit(1)),f.endsWith(".scss")?[p]:o.findSCSS(p,{recursive:!l.noRecursion,verbose:!l.quietMode}));if(l.dryRun)0<m.length?(console.info(`
|
|
13
13
|
${c}SCSS files to be compiled:`+i),m.forEach(e=>console.info(e))):console.info(c+`
|
|
14
|
-
No SCSS files will be compiled.`+i);else{const h=[],g=m.map(e=>{var s=o.compile(e,{minify:!l.noMinify,sourceMaps:!l.noSourceMaps,verbose:!l.quietMode});return s.error&&h.push(e),s}).filter(e=>!e.error);if(g?.forEach(({code:e,srcMap:s,srcPath:o})=>{var i=n.join(n.dirname(o),/(?:src|s[ac]ss)$/.test(n.dirname(o))?"../css":u.endsWith(".css")?n.dirname(u):u||"css"),o=(u.endsWith(".css")&&f.endsWith(".scss")?n.basename(u).replace(/(\.min)?\.css$/,""):n.basename(o,".scss"))+".min.css",o=n.join(i,o);r.existsSync(i)||r.mkdirSync(i,{recursive:!0}),r.writeFileSync(o,e,"utf8"),l.noSourceMaps||r.writeFileSync(o+".map",JSON.stringify(s),"utf8")}),0<g?.length){const S=1<g.length?"s":"";s(`
|
|
14
|
+
No SCSS files will be compiled.`+i);else{const h=[],g=m.map(e=>{var s=o.compile(e,{minify:!l.noMinify,sourceMaps:!l.noSourceMaps,verbose:!l.quietMode});return s.error&&h.push(e),s}).filter(e=>!e.error);if(g?.forEach(({code:e,srcMap:s,srcPath:o})=>{var i=n.join(n.dirname(o),/(?:src|s[ac]ss)$/.test(n.dirname(o))?"../"+(u||"css"):u.endsWith(".css")?n.dirname(u):u||"css"),o=(u.endsWith(".css")&&f.endsWith(".scss")?n.basename(u).replace(/(\.min)?\.css$/,""):n.basename(o,".scss"))+".min.css",o=n.join(i,o);r.existsSync(i)||r.mkdirSync(i,{recursive:!0}),r.writeFileSync(o,e,"utf8"),l.noSourceMaps||r.writeFileSync(o+".map",JSON.stringify(s),"utf8")}),0<g?.length){const S=1<g.length?"s":"";s(`
|
|
15
15
|
${e}Compilation complete!`+i),s(g.length+" CSS file"+S+(l.noSourceMaps?"":` + ${g.length} source map`+S)+" generated.")}else s(c+"No SCSS files processed."+i);0<h.length&&(s(`
|
|
16
16
|
`+t+h.length+" file"+(1<h.length?"s":"")+" failed to compile:"+i),h.forEach(e=>s(e)))}}function d(e=["cmdFormat","pathArgs","configOptions","infoCmds"]){const s={cmdFormat:[`
|
|
17
17
|
${c}scss-to-css [inputPath] [outputPath] [options]`+i],pathArgs:["\nPath arguments:"," [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:["\nConfig options:"," -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:["\nInfo commands:"," -h, --help Display help screen."," -v, --version Show version number."]};e.forEach(e=>{s[e]?.forEach(e=>{{const i=process.stdout.columns||80,r=[],s=e.match(/\S+|\s+/g);let o="";s.forEach(e=>{var s=i-(0===r.length?0:30);o.length+e.length>s&&(r.push(0===r.length?o:o.trimStart()),o=""),o+=e}),r.push(0===r.length?o:o.trimStart()),r.forEach((e,s)=>console.info(0===s?e:" ".repeat(30)+e))}})})}function s(e){l.quietMode||console.info(e)}
|
package/dist/scss-to-css.min.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const c=require("fs"),t=require("path"),n=require("sass");function l(o,s={}){var e={recursive:!0,verbose:!0,dotFolders:!1};if("string"!=typeof o)return console.error("findSCSS() » ERROR: 1st arg <searchDir> must be a string.");var r=t.resolve(process.cwd(),o);if(c.existsSync(r)){if(f(s,e,"findSCSS('assets/scss', { verbose: false, dotFolders: true })")){s={...e,...s};const i=c.readdirSync(o),n=[];return s.verbose&&!s.isRecursing&&console.info("findSCSS() » Searching for SCSS files..."),i.forEach(e=>{var r=t.resolve(o,e);c.statSync(r).isDirectory()&&"node_modules"!=e&&(s.dotFolders||!e.startsWith("."))&&s.recursive?n.push(...l(r,{...s,isRecursing:!0})):e.endsWith(".scss")&&n.push(r)}),!s.isRecursing&&s.verbose&&(console.info("findSCSS() » Search complete! "+(0===n.length?"No":n.length)+` file${0==n.length||1<n.length?"s":""} found.`),"compile"===l.caller.name||require.main.filename.endsWith("cli.js")||console.info("findSCSS() » Check returned array.")),s.isRecursing||0<n.length?n:[]}}else console.error("findSCSS() » ERROR: 1st arg <searchDir> must be an existing directory."),console.error(`findSCSS() » ${r} does not exist.`)}function e(e,o={}){var r={recursive:!0,verbose:!0,dotFolders:!1,minify:!0,sourceMaps:!0};if("string"!=typeof e)return console.error("compile() » ERROR: 1st arg <inputPath> must be a string.");if(e=t.resolve(process.cwd(),e),c.existsSync(e)){if(f(o,r,"compile('assets/scss', { recursive: false, minify: false })")){const i={style:(o={...r,...o}).minify?"compressed":"expanded",sourceMap:o.sourceMaps};if(c.existsSync(e)){if(!e.endsWith(".scss"))return r=l(e,{recursive:o.recursive,verbose:o.verbose,dotFolders:o.dotFolders})?.map(e=>{o.verbose&&console.info(`compile() » Compiling ${e}...`);try{var r=n.compile(e,i);return{code:r.css,srcMap:r.sourceMap,srcPath:e}}catch(e){return console.error(`
|
|
2
3
|
compile() » ERROR: ${e.message}
|
|
3
|
-
`),{error:e}}}).filter(e=>!e.error)
|
|
4
|
+
`),{error:e}}}).filter(e=>!e.error),o.verbose&&(0<r.length?console.info("compile() » Compilation complete. Check returned object."):console.info("compile() » No SCSS files processed.")),r;o.verbose&&console.info(`compile() » Compiling ${e}...`);try{var s=n.compile(e,i);return o.verbose&&!require.main.filename.endsWith("cli.js")&&console.info("compile() » Compilation complete. Check returned object."),{code:s.css,srcMap:s.sourceMap,srcPath:t.resolve(process.cwd(),e)}}catch(e){return console.error(`
|
|
4
5
|
compile() » ERROR: ${e.message}
|
|
5
|
-
`),{error:e}}}}}else console.error("compile() » ERROR: 1st arg <inputPath> must be an existing directory or file."),console.error(`compile() » ${e} does not exist.`)}module.exports={compile:e,findSCSS:
|
|
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.`)}function f(e,r,o){const s=(f.caller?.name||"validateOptions")+"() » ",i=JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),n=Object.keys(r).join(", "),c=Object.keys(r).filter(e=>"boolean"==typeof r[e]),t=Object.keys(r).filter(e=>Number.isInteger(r[e]));var l=()=>{console.info(s+`Valid options: [ ${n} ]`),console.info(s+"If omitted, default settings are: "+i)};if("object"!=typeof e)return console.error(s+"ERROR: [options] can only be an object of key/values."),console.info(s+"Example valid call: "+o),l(),!1;for(const a in e){if("isRecursing"!=a&&!Object.prototype.hasOwnProperty.call(r,a))return console.error(s+`ERROR: \`${a}\` is an invalid option.`),l(),!1;if(c.includes(a)&&"boolean"!=typeof e[a])return console.error(s+`ERROR: [${a}] option can only be \`true\` or \`false\`.`),!1;if(t.includes(a)&&(e[a]=parseInt(e[a],10),isNaN(e[a])||e[a]<1))return console.error(s+`ERROR: [${a}] option can only be an integer > 0.`),!1}return!0}module.exports={compile:e,find:l,findSCSS:l};
|
package/docs/LICENSE.md
CHANGED
package/docs/SECURITY.md
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
</picture>
|
|
7
7
|
English |
|
|
8
8
|
<a href="zh-cn/SECURITY.md">简体中文</a> |
|
|
9
|
-
<a href="zh-tw/SECURITY.md">繁體中文</a> |
|
|
9
|
+
<a href="zh-tw/SECURITY.md">繁體中文</a> | |
|
|
10
|
+
<a href="ja/SECURITY.md">日本語</a> |
|
|
10
11
|
<a href="hi/SECURITY.md">हिंदी</a> |
|
|
11
12
|
<a href="bn/SECURITY.md">বাংলা</a> |
|
|
12
13
|
<a href="mr/SECURITY.md">मराठी</a> |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamlui/scss-to-css",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.9",
|
|
4
4
|
"description": "Recursively compile all SCSS files into minified CSS",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Adam Lui",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"url": "https://js-utils.com/issues"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"sass": "^1.
|
|
54
|
+
"sass": "^1.74.1"
|
|
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.4.
|
|
61
|
+
"@adamlui/minify.js": "^1.4.10"
|
|
62
62
|
}
|
|
63
63
|
}
|